From 426315f589b3cbb8530e309dcb4495ea46e13c13 Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" Date: Thu, 26 Aug 2021 10:40:10 -0400 Subject: [PATCH 01/31] Consider last stored ValueSet not necessarily current version anymore. --- ...JpaPersistedResourceValidationSupport.java | 24 ++++++++ .../fhir/jpa/dao/data/ITermValueSetDao.java | 20 ++++++- .../ca/uhn/fhir/jpa/entity/TermValueSet.java | 13 ++++ .../fhir/jpa/term/BaseTermReadSvcImpl.java | 60 ++++++++++++++++--- .../term/TermCodeSystemStorageSvcImpl.java | 2 +- .../jpa/term/TermDeferredStorageSvcImpl.java | 20 ++++--- .../term/api/ITermCodeSystemStorageSvc.java | 11 +++- .../jpa/term/api/ITermDeferredStorageSvc.java | 3 +- .../uhn/fhir/jpa/term/api/ITermReadSvc.java | 15 +++-- .../jpa/term/api/ITermVersionAdapterSvc.java | 2 +- 10 files changed, 144 insertions(+), 26 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java index f1819cbbbb7..be05a547e9d 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java @@ -25,6 +25,7 @@ import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.jpa.api.dao.DaoRegistry; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; +import ca.uhn.fhir.jpa.term.api.ITermReadSvc; import ca.uhn.fhir.rest.api.SortOrderEnum; import ca.uhn.fhir.rest.api.SortSpec; import ca.uhn.fhir.rest.api.server.IBundleProvider; @@ -41,6 +42,7 @@ import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.ImplementationGuide; import org.hl7.fhir.r4.model.Questionnaire; import org.hl7.fhir.r4.model.StructureDefinition; +import org.hl7.fhir.r4.model.UriType; import org.hl7.fhir.r4.model.ValueSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -51,6 +53,7 @@ import javax.annotation.PostConstruct; import javax.transaction.Transactional; import java.util.Arrays; import java.util.List; +import java.util.Optional; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; @@ -71,6 +74,10 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport @Autowired private DaoRegistry myDaoRegistry; + + @Autowired + private ITermReadSvc myITermReadSvc; + private Class myCodeSystemType; private Class myStructureDefinitionType; private Class myValueSetType; @@ -97,9 +104,23 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport @Override public IBaseResource fetchValueSet(String theSystem) { + // if no version is present, we need to append the current version, + // if one exists, in case it is not the last loaded + theSystem = appendCurrentVersion(theSystem); return fetchResource(myValueSetType, theSystem); } + + private String appendCurrentVersion(String theSystem) { + // if version is included there is nothing to add here + if (theSystem.contains("|")) return theSystem; + + Optional currentVersionOpt = myITermReadSvc.getValueSetCurrentVersion(new UriType(theSystem)); + + return currentVersionOpt.map(ver -> theSystem + "|" + ver).orElse(theSystem); + } + + @Override public IBaseResource fetchStructureDefinition(String theUrl) { return fetchResource(myStructureDefinitionType, theUrl); @@ -174,6 +195,9 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport params.add(ValueSet.SP_VERSION, new TokenParam(theUri.substring(versionSeparator + 1))); params.add(ValueSet.SP_URL, new UriParam(theUri.substring(0, versionSeparator))); } else { + // last loaded ValueSet not necessarily is the current version anymore, so code should be executing + // this path only when there is no current version pointed for the ValueSet + ourLog.warn("Fetching ValueSet current version as last loaded"); params.add(ValueSet.SP_URL, new UriParam(theUri)); } params.setSort(new SortSpec("_lastUpdated").setOrder(SortOrderEnum.DESC)); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetDao.java index 2bb11d4f22a..fbdd1d86921 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetDao.java @@ -44,14 +44,28 @@ public interface ITermValueSetDao extends JpaRepository { @Query("SELECT vs FROM TermValueSet vs WHERE vs.myExpansionStatus = :expansion_status") Slice findByExpansionStatus(Pageable pageable, @Param("expansion_status") TermValueSetPreExpansionStatusEnum theExpansionStatus); - @Query(value="SELECT vs FROM TermValueSet vs INNER JOIN ResourceTable r ON r.myId = vs.myResourcePid WHERE vs.myUrl = :url ORDER BY r.myUpdated DESC") - List findTermValueSetByUrl(Pageable thePage, @Param("url") String theUrl); - @Query("SELECT vs FROM TermValueSet vs WHERE vs.myUrl = :url AND vs.myVersion IS NULL") Optional findTermValueSetByUrlAndNullVersion(@Param("url") String theUrl); @Query("SELECT vs FROM TermValueSet vs WHERE vs.myUrl = :url AND vs.myVersion = :version") Optional findTermValueSetByUrlAndVersion(@Param("url") String theUrl, @Param("version") String theVersion); + /** + * Obtain the only ValueSet for the url which myIsCurrentVersion is true if one exists + * or the last loaded ValueSet for the url which version is null otherwise + */ + @Query("select vs FROM TermValueSet vs JOIN FETCH vs.myResource r WHERE vs.myUrl = :url AND (vs.myIsCurrentVersion is true or " + + "(vs.myIsCurrentVersion is false AND vs.myVersion is null AND not exists(" + + "FROM TermValueSet WHERE myUrl = :url AND myIsCurrentVersion is true )) ) order by r.myUpdated DESC") + List listTermValueSetsByUrlAndCurrentVersion(@Param("url") String theUrl, Pageable pageable); + /** + * This method uses the previous one to get a possible list of ValueSets and return the first if any + * because the query will obtain no more than one if one with the myCurrentVersion flag exists but + * could obtain more if one with that flag doesn't exist. For that reason the query is Pageable and ordered + */ + default Optional findTermValueSetByUrlAndCurrentVersion(@Param("url") String theUrl) { + List termValueSets = listTermValueSetsByUrlAndCurrentVersion(theUrl, Pageable.ofSize(1)); + return termValueSets.isEmpty()? Optional.empty() : Optional.of(termValueSets.get(0)); + } } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSet.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSet.java index e11e041dae5..549388877dd 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSet.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSet.java @@ -26,6 +26,7 @@ import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import org.hibernate.annotations.ColumnDefault; +import org.hibernate.annotations.OptimisticLock; import javax.annotation.Nonnull; import javax.persistence.*; @@ -85,6 +86,10 @@ public class TermValueSet implements Serializable { @Column(name = "EXPANSION_STATUS", nullable = false, length = MAX_EXPANSION_STATUS_LENGTH) private TermValueSetPreExpansionStatusEnum myExpansionStatus; + @OptimisticLock(excluded = true) + @Column(name = "CURRENT_VERSION") + private Boolean myIsCurrentVersion = false; + @Transient private transient Integer myHashCode; @@ -198,6 +203,14 @@ public class TermValueSet implements Serializable { return this; } + public Boolean getCurrentVersion() { + return myIsCurrentVersion; + } + + public void setCurrentVersion(Boolean theCurrentVersion) { + myIsCurrentVersion = theCurrentVersion; + } + @Override public boolean equals(Object theO) { if (this == theO) return true; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java index 125fbe191c9..84f6eae61d1 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java @@ -68,6 +68,7 @@ import ca.uhn.fhir.jpa.term.api.ITermReadSvc; import ca.uhn.fhir.jpa.term.ex.ExpansionTooCostlyException; import ca.uhn.fhir.jpa.util.LogicUtil; import ca.uhn.fhir.rest.api.Constants; +import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; @@ -117,6 +118,7 @@ import org.hl7.fhir.r4.model.Enumerations; import org.hl7.fhir.r4.model.Extension; import org.hl7.fhir.r4.model.IntegerType; import org.hl7.fhir.r4.model.StringType; +import org.hl7.fhir.r4.model.UriType; import org.hl7.fhir.r4.model.ValueSet; import org.hl7.fhir.r4.model.codesystems.ConceptSubsumptionOutcome; import org.quartz.JobExecutionContext; @@ -231,6 +233,9 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { @Autowired private ITermConceptMappingSvc myTermConceptMappingSvc; + @Autowired + private ITermValueSetDao myTermValueSetDao; + private volatile IValidationSupport myJpaValidationSupport; private volatile IValidationSupport myValidationSupport; @@ -445,12 +450,7 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { if (theValueSetToExpand.hasVersion()) { optionalTermValueSet = myValueSetDao.findTermValueSetByUrlAndVersion(theValueSetToExpand.getUrl(), theValueSetToExpand.getVersion()); } else { - List termValueSets = myValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 1), theValueSetToExpand.getUrl()); - if (termValueSets.size() > 0) { - optionalTermValueSet = Optional.of(termValueSets.get(0)); - } else { - optionalTermValueSet = Optional.empty(); - } + optionalTermValueSet = myValueSetDao.findTermValueSetByUrlAndCurrentVersion(theValueSetToExpand.getUrl()); } } else { optionalTermValueSet = Optional.empty(); @@ -1884,7 +1884,7 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { @Override @Transactional - public void storeTermValueSet(ResourceTable theResourceTable, ValueSet theValueSet) { + public void storeTermValueSet(ResourceTable theResourceTable, ValueSet theValueSet , RequestDetails theRequestDetails) { ValidateUtil.isTrueOrThrowInvalidRequest(theResourceTable != null, "No resource supplied"); if (isPlaceholder(theValueSet)) { @@ -1904,6 +1904,13 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { termValueSet.setVersion(theValueSet.getVersion()); termValueSet.setName(theValueSet.hasName() ? theValueSet.getName() : null); + // value sets must be marked as current only when version is present and flag indicates that + if (theValueSet.getVersion() != null) { + if (ITermCodeSystemStorageSvc.isMakeVersionCurrent(theRequestDetails)) { + makeVersionCurrent(theValueSet); + } + } + // Delete version being replaced deleteValueSetForResource(theResourceTable); @@ -1940,6 +1947,31 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { } } + + private void makeVersionCurrent(ValueSet theValueSet) { + resetCurrentValueSetVersion(theValueSet); + + TermValueSet termValueSet = myTermValueSetDao.findTermValueSetByUrlAndVersion( + theValueSet.getUrl(), theValueSet.getVersion()) + .orElseThrow(() -> + new InternalErrorException("Couldn't retrieve TermValueSet with url: " + + theValueSet.getUrl() + " and version: " + theValueSet.getVersion() ) ); + + termValueSet.setCurrentVersion(true); + myTermValueSetDao.save(termValueSet); + } + + + private void resetCurrentValueSetVersion(ValueSet theValueSet) { + Optional termValueSetOpt = myTermValueSetDao.findTermValueSetByUrlAndCurrentVersion(theValueSet.getUrl()); + if (! termValueSetOpt.isPresent()) return; + + TermValueSet termValueSet = termValueSetOpt.get(); + termValueSet.setCurrentVersion(false); + myTermValueSetDao.save(termValueSet); + } + + @Override @Transactional public IFhirResourceDaoCodeSystem.SubsumesResult subsumes(IPrimitiveType theCodeA, IPrimitiveType theCodeB, @@ -2481,4 +2513,18 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { return termConcept; } + + @Override + @Transactional + public Optional getValueSetCurrentVersion(UriType theUrl) { + Optional termValueSetOpt = + myTermValueSetDao.findTermValueSetByUrlAndCurrentVersion(theUrl.getValueAsString()); + + if (! termValueSetOpt.isPresent() || StringUtils.isBlank(termValueSetOpt.get().getVersion())) { + return Optional.empty(); + } + + return termValueSetOpt.map(TermValueSet::getVersion); + } + } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java index 01a4acb5bd4..e5a86ca0616 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java @@ -399,7 +399,7 @@ public class TermCodeSystemStorageSvcImpl implements ITermCodeSystemStorageSvc { theCodeSystemResource.getVersion(), theCodeSystemVersion, resource, theRequest); myDeferredStorageSvc.addConceptMapsToStorageQueue(theConceptMaps); - myDeferredStorageSvc.addValueSetsToStorageQueue(theValueSets); + myDeferredStorageSvc.addValueSetsToStorageQueue(theValueSets, theRequest); return csId; } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermDeferredStorageSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermDeferredStorageSvcImpl.java index 6e36e2fb331..930122d4f9e 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermDeferredStorageSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermDeferredStorageSvcImpl.java @@ -37,6 +37,7 @@ import ca.uhn.fhir.jpa.model.sched.ScheduledJobDefinition; import ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc; import ca.uhn.fhir.jpa.term.api.ITermDeferredStorageSvc; import ca.uhn.fhir.jpa.term.api.ITermVersionAdapterSvc; +import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.util.StopWatch; import com.google.common.annotations.VisibleForTesting; import org.apache.commons.lang3.Validate; @@ -49,6 +50,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Slice; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.util.Pair; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; @@ -65,6 +67,7 @@ import java.util.UUID; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; +import java.util.stream.Collectors; public class TermDeferredStorageSvcImpl implements ITermDeferredStorageSvc { @@ -72,7 +75,7 @@ public class TermDeferredStorageSvcImpl implements ITermDeferredStorageSvc { final private List myDeferredCodeSystemsDeletions = Collections.synchronizedList(new ArrayList<>()); final private Queue myDeferredCodeSystemVersionsDeletions = new ConcurrentLinkedQueue<>(); final private List myDeferredConcepts = Collections.synchronizedList(new ArrayList<>()); - final private List myDeferredValueSets = Collections.synchronizedList(new ArrayList<>()); + final private List> myDeferredValueSets = Collections.synchronizedList(new ArrayList<>()); final private List myDeferredConceptMaps = Collections.synchronizedList(new ArrayList<>()); final private List myConceptLinksToSaveLater = Collections.synchronizedList(new ArrayList<>()); @Autowired @@ -116,9 +119,9 @@ public class TermDeferredStorageSvcImpl implements ITermDeferredStorageSvc { } @Override - public void addValueSetsToStorageQueue(List theValueSets) { + public void addValueSetsToStorageQueue(List theValueSets, RequestDetails theRequestDetails) { Validate.notNull(theValueSets); - myDeferredValueSets.addAll(theValueSets); + myDeferredValueSets.addAll(theValueSets.stream().map(vs -> Pair.of(vs, theRequestDetails)).collect(Collectors.toList())); } @Override @@ -214,12 +217,15 @@ public class TermDeferredStorageSvcImpl implements ITermDeferredStorageSvc { } } + private void processDeferredValueSets() { int count = Math.min(myDeferredValueSets.size(), 200); - for (ValueSet nextValueSet : new ArrayList<>(myDeferredValueSets.subList(0, count))) { - ourLog.info("Creating ValueSet: {}", nextValueSet.getId()); - myTerminologyVersionAdapterSvc.createOrUpdateValueSet(nextValueSet); - myDeferredValueSets.remove(nextValueSet); + for (Pair nextPair : new ArrayList<>(myDeferredValueSets.subList(0, count))) { + ValueSet valueSet = nextPair.getFirst(); + RequestDetails requestDetails = nextPair.getSecond(); + ourLog.info("Creating ValueSet: {}", valueSet.getId()); + myTerminologyVersionAdapterSvc.createOrUpdateValueSet(valueSet, requestDetails); + myDeferredValueSets.remove(nextPair); } ourLog.info("Saved {} deferred ValueSet resources, have {} remaining", count, myDeferredValueSets.size()); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermCodeSystemStorageSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermCodeSystemStorageSvc.java index 2c62f3d05b9..1f85e823720 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermCodeSystemStorageSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermCodeSystemStorageSvc.java @@ -40,7 +40,16 @@ import java.util.List; */ public interface ITermCodeSystemStorageSvc { - static final String MAKE_LOADING_VERSION_CURRENT = "make.loading.version.current"; + String MAKE_LOADING_VERSION_CURRENT = "make.loading.version.current"; + + + /** + * Defaults to true when parameter is null or entry is not present in requestDetails.myUserData + */ + static boolean isMakeVersionCurrent(RequestDetails theRequestDetails) { + return theRequestDetails == null || + (boolean) theRequestDetails.getUserData().getOrDefault(MAKE_LOADING_VERSION_CURRENT, Boolean.TRUE); + } void deleteCodeSystem(TermCodeSystem theCodeSystem); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermDeferredStorageSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermDeferredStorageSvc.java index 91cdb11b7f6..5d7424aa19d 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermDeferredStorageSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermDeferredStorageSvc.java @@ -25,6 +25,7 @@ import ca.uhn.fhir.jpa.entity.TermCodeSystemVersion; import ca.uhn.fhir.jpa.entity.TermConcept; import ca.uhn.fhir.jpa.entity.TermConceptParentChildLink; import ca.uhn.fhir.jpa.model.entity.ResourceTable; +import ca.uhn.fhir.rest.api.server.RequestDetails; import org.hl7.fhir.r4.model.ConceptMap; import org.hl7.fhir.r4.model.ValueSet; @@ -52,7 +53,7 @@ public interface ITermDeferredStorageSvc { void addConceptMapsToStorageQueue(List theConceptMaps); - void addValueSetsToStorageQueue(List theValueSets); + void addValueSetsToStorageQueue(List theValueSets, RequestDetails theRequestDetails); void deleteCodeSystem(TermCodeSystem theCodeSystem); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java index 0f04f62bd8e..0aec2dcb7eb 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java @@ -4,12 +4,10 @@ import ca.uhn.fhir.context.support.ConceptValidationOptions; import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.context.support.ValueSetExpansionOptions; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoCodeSystem; -import ca.uhn.fhir.jpa.api.model.TranslationRequest; import ca.uhn.fhir.jpa.entity.TermConcept; -import ca.uhn.fhir.jpa.entity.TermConceptMapGroupElement; -import ca.uhn.fhir.jpa.entity.TermConceptMapGroupElementTarget; import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.jpa.term.IValueSetConceptAccumulator; +import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.util.FhirVersionIndependentConcept; import org.hl7.fhir.instance.model.api.IBaseCoding; import org.hl7.fhir.instance.model.api.IBaseDatatype; @@ -17,7 +15,7 @@ import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.instance.model.api.IPrimitiveType; import org.hl7.fhir.r4.model.CodeSystem; -import org.hl7.fhir.r4.model.ConceptMap; +import org.hl7.fhir.r4.model.UriType; import org.hl7.fhir.r4.model.ValueSet; import javax.annotation.Nonnull; @@ -91,7 +89,13 @@ public interface ITermReadSvc extends IValidationSupport { void deleteValueSetAndChildren(ResourceTable theResourceTable); - void storeTermValueSet(ResourceTable theResourceTable, ValueSet theValueSet); + + void storeTermValueSet(ResourceTable theResourceTable, ValueSet theValueSet, RequestDetails theRequestDetails); + + default void storeTermValueSet(ResourceTable theResourceTable, ValueSet theValueSet) { + storeTermValueSet(theResourceTable, theValueSet, null); + } + IFhirResourceDaoCodeSystem.SubsumesResult subsumes(IPrimitiveType theCodeA, IPrimitiveType theCodeB, IPrimitiveType theSystem, IBaseCoding theCodingA, IBaseCoding theCodingB); @@ -119,4 +123,5 @@ public interface ITermReadSvc extends IValidationSupport { */ CodeValidationResult codeSystemValidateCode(IIdType theCodeSystemId, String theValueSetUrl, String theVersion, String theCode, String theDisplay, IBaseDatatype theCoding, IBaseDatatype theCodeableConcept); + Optional getValueSetCurrentVersion(UriType theUrl); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermVersionAdapterSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermVersionAdapterSvc.java index 1f763f5a6b9..e3b703f40b4 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermVersionAdapterSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermVersionAdapterSvc.java @@ -41,6 +41,6 @@ public interface ITermVersionAdapterSvc { void createOrUpdateConceptMap(ConceptMap theNextConceptMap); - void createOrUpdateValueSet(ValueSet theValueSet); + void createOrUpdateValueSet(ValueSet theValueSet, RequestDetails theRequestDetails); } From f63f12e976814b7393e5f3d1484e58bac72412c9 Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" Date: Fri, 27 Aug 2021 10:57:06 -0400 Subject: [PATCH 02/31] Use boolean parameter as DAO misinterprets RequestDetails --- .../jpa/dao/r4/FhirResourceDaoValueSetR4.java | 1 - .../fhir/jpa/term/BaseTermReadSvcImpl.java | 25 ++++--------------- .../term/TermCodeSystemStorageSvcImpl.java | 9 +++---- .../jpa/term/TermDeferredStorageSvcImpl.java | 15 ++++++----- .../jpa/term/TermVersionAdapterSvcDstu2.java | 2 +- .../jpa/term/TermVersionAdapterSvcDstu3.java | 11 +++++--- .../jpa/term/TermVersionAdapterSvcR4.java | 11 +++++--- .../jpa/term/TermVersionAdapterSvcR5.java | 11 +++++--- .../jpa/term/api/ITermDeferredStorageSvc.java | 3 +-- .../uhn/fhir/jpa/term/api/ITermReadSvc.java | 5 ++-- .../jpa/term/api/ITermVersionAdapterSvc.java | 2 +- 11 files changed, 45 insertions(+), 50 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoValueSetR4.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoValueSetR4.java index 43226b5f2ff..82d2a97ccd4 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoValueSetR4.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoValueSetR4.java @@ -28,7 +28,6 @@ import ca.uhn.fhir.jpa.model.cross.IBasePersistedResource; import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; -import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.instance.model.api.IPrimitiveType; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java index b4487a7624d..b9ce7fa3597 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java @@ -68,7 +68,6 @@ import ca.uhn.fhir.jpa.term.api.ITermReadSvc; import ca.uhn.fhir.jpa.term.ex.ExpansionTooCostlyException; import ca.uhn.fhir.jpa.util.LogicUtil; import ca.uhn.fhir.rest.api.Constants; -import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; @@ -1884,7 +1883,7 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { @Override @Transactional - public void storeTermValueSet(ResourceTable theResourceTable, ValueSet theValueSet , RequestDetails theRequestDetails) { + public void storeTermValueSet(ResourceTable theResourceTable, ValueSet theValueSet , boolean theMakeItCurrent) { ValidateUtil.isTrueOrThrowInvalidRequest(theResourceTable != null, "No resource supplied"); if (isPlaceholder(theValueSet)) { @@ -1903,12 +1902,12 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { termValueSet.setUrl(theValueSet.getUrl()); termValueSet.setVersion(theValueSet.getVersion()); termValueSet.setName(theValueSet.hasName() ? theValueSet.getName() : null); + termValueSet.setCurrentVersion(false); // value sets must be marked as current only when version is present and flag indicates that - if (theValueSet.getVersion() != null) { - if (ITermCodeSystemStorageSvc.isMakeVersionCurrent(theRequestDetails)) { - makeVersionCurrent(theValueSet); - } + if (theValueSet.getVersion() != null && theMakeItCurrent) { + resetCurrentValueSetVersion(theValueSet); + termValueSet.setCurrentVersion(true); } // Delete version being replaced @@ -1948,20 +1947,6 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { } - private void makeVersionCurrent(ValueSet theValueSet) { - resetCurrentValueSetVersion(theValueSet); - - TermValueSet termValueSet = myTermValueSetDao.findTermValueSetByUrlAndVersion( - theValueSet.getUrl(), theValueSet.getVersion()) - .orElseThrow(() -> - new InternalErrorException("Couldn't retrieve TermValueSet with url: " + - theValueSet.getUrl() + " and version: " + theValueSet.getVersion() ) ); - - termValueSet.setCurrentVersion(true); - myTermValueSetDao.save(termValueSet); - } - - private void resetCurrentValueSetVersion(ValueSet theValueSet) { Optional termValueSetOpt = myTermValueSetDao.findTermValueSetByUrlAndCurrentVersion(theValueSet.getUrl()); if (! termValueSetOpt.isPresent()) return; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java index e5a86ca0616..a204f2d6080 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java @@ -399,7 +399,9 @@ public class TermCodeSystemStorageSvcImpl implements ITermCodeSystemStorageSvc { theCodeSystemResource.getVersion(), theCodeSystemVersion, resource, theRequest); myDeferredStorageSvc.addConceptMapsToStorageQueue(theConceptMaps); - myDeferredStorageSvc.addValueSetsToStorageQueue(theValueSets, theRequest); + + boolean isMakeVersionCurrent = ITermCodeSystemStorageSvc.isMakeVersionCurrent(theRequest); + myDeferredStorageSvc.addValueSetsToStorageQueue(theValueSets, isMakeVersionCurrent); return csId; } @@ -470,10 +472,7 @@ public class TermCodeSystemStorageSvcImpl implements ITermCodeSystemStorageSvc { codeSystemToStore = myCodeSystemVersionDao.saveAndFlush(codeSystemToStore); } - // defaults to true - boolean isMakeVersionCurrent = theRequestDetails == null || - (boolean) theRequestDetails.getUserData().getOrDefault(MAKE_LOADING_VERSION_CURRENT, Boolean.TRUE); - + boolean isMakeVersionCurrent = ITermCodeSystemStorageSvc.isMakeVersionCurrent(theRequestDetails); if (isMakeVersionCurrent) { codeSystem.setCurrentVersion(codeSystemToStore); if (codeSystem.getPid() == null) { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermDeferredStorageSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermDeferredStorageSvcImpl.java index 930122d4f9e..808138cd649 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermDeferredStorageSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermDeferredStorageSvcImpl.java @@ -37,7 +37,6 @@ import ca.uhn.fhir.jpa.model.sched.ScheduledJobDefinition; import ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc; import ca.uhn.fhir.jpa.term.api.ITermDeferredStorageSvc; import ca.uhn.fhir.jpa.term.api.ITermVersionAdapterSvc; -import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.util.StopWatch; import com.google.common.annotations.VisibleForTesting; import org.apache.commons.lang3.Validate; @@ -75,7 +74,7 @@ public class TermDeferredStorageSvcImpl implements ITermDeferredStorageSvc { final private List myDeferredCodeSystemsDeletions = Collections.synchronizedList(new ArrayList<>()); final private Queue myDeferredCodeSystemVersionsDeletions = new ConcurrentLinkedQueue<>(); final private List myDeferredConcepts = Collections.synchronizedList(new ArrayList<>()); - final private List> myDeferredValueSets = Collections.synchronizedList(new ArrayList<>()); + final private List> myDeferredValueSets = Collections.synchronizedList(new ArrayList<>()); final private List myDeferredConceptMaps = Collections.synchronizedList(new ArrayList<>()); final private List myConceptLinksToSaveLater = Collections.synchronizedList(new ArrayList<>()); @Autowired @@ -119,9 +118,9 @@ public class TermDeferredStorageSvcImpl implements ITermDeferredStorageSvc { } @Override - public void addValueSetsToStorageQueue(List theValueSets, RequestDetails theRequestDetails) { + public void addValueSetsToStorageQueue(List theValueSets, boolean theMakeThemCurrent) { Validate.notNull(theValueSets); - myDeferredValueSets.addAll(theValueSets.stream().map(vs -> Pair.of(vs, theRequestDetails)).collect(Collectors.toList())); + myDeferredValueSets.addAll(theValueSets.stream().map(vs -> Pair.of(vs, theMakeThemCurrent)).collect(Collectors.toList())); } @Override @@ -220,11 +219,11 @@ public class TermDeferredStorageSvcImpl implements ITermDeferredStorageSvc { private void processDeferredValueSets() { int count = Math.min(myDeferredValueSets.size(), 200); - for (Pair nextPair : new ArrayList<>(myDeferredValueSets.subList(0, count))) { + for (Pair nextPair : new ArrayList<>(myDeferredValueSets.subList(0, count))) { ValueSet valueSet = nextPair.getFirst(); - RequestDetails requestDetails = nextPair.getSecond(); - ourLog.info("Creating ValueSet: {}", valueSet.getId()); - myTerminologyVersionAdapterSvc.createOrUpdateValueSet(valueSet, requestDetails); + boolean makeItCurrent = nextPair.getSecond(); + ourLog.info("Creating ValueSet: {} , {}making it current version", valueSet.getId(), (makeItCurrent ? "" : "not ")); + myTerminologyVersionAdapterSvc.createOrUpdateValueSet(valueSet, makeItCurrent); myDeferredValueSets.remove(nextPair); } ourLog.info("Saved {} deferred ValueSet resources, have {} remaining", count, myDeferredValueSets.size()); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcDstu2.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcDstu2.java index 07d134461e2..61947b8460b 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcDstu2.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcDstu2.java @@ -40,7 +40,7 @@ public class TermVersionAdapterSvcDstu2 implements ITermVersionAdapterSvc { } @Override - public void createOrUpdateValueSet(ValueSet theValueSet, RequestDetails theRequestDetails) { + public void createOrUpdateValueSet(ValueSet theValueSet, boolean theMakeItCurrent) { throw new UnsupportedOperationException(); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcDstu3.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcDstu3.java index 891d9019ae5..047f40bee34 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcDstu3.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcDstu3.java @@ -23,6 +23,7 @@ package ca.uhn.fhir.jpa.term; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.term.api.ITermVersionAdapterSvc; import ca.uhn.fhir.rest.api.server.RequestDetails; +import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.util.UrlUtil; import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_30_40; @@ -37,6 +38,7 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.EventListener; +import static ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc.MAKE_LOADING_VERSION_CURRENT; import static org.apache.commons.lang3.StringUtils.isBlank; public class TermVersionAdapterSvcDstu3 extends BaseTermVersionAdapterSvcImpl implements ITermVersionAdapterSvc { @@ -103,7 +105,7 @@ public class TermVersionAdapterSvcDstu3 extends BaseTermVersionAdapterSvcImpl im } @Override - public void createOrUpdateValueSet(org.hl7.fhir.r4.model.ValueSet theValueSet, RequestDetails theRequestDetails) { + public void createOrUpdateValueSet(org.hl7.fhir.r4.model.ValueSet theValueSet, boolean theMakeItCurrent) { ValueSet valueSetDstu3; try { valueSetDstu3 = (ValueSet) VersionConvertorFactory_30_40.convertResource(theValueSet, new BaseAdvisor_30_40(false)); @@ -111,11 +113,14 @@ public class TermVersionAdapterSvcDstu3 extends BaseTermVersionAdapterSvcImpl im throw new InternalErrorException(e); } + TransactionDetails txDetails = new TransactionDetails(); + txDetails.putUserData(MAKE_LOADING_VERSION_CURRENT, theMakeItCurrent); + if (isBlank(valueSetDstu3.getIdElement().getIdPart())) { String matchUrl = "ValueSet?url=" + UrlUtil.escapeUrlParam(theValueSet.getUrl()); - myValueSetResourceDao.update(valueSetDstu3, matchUrl, theRequestDetails); + myValueSetResourceDao.update(valueSetDstu3, matchUrl, true, false, null, txDetails); } else { - myValueSetResourceDao.update(valueSetDstu3, theRequestDetails); + myValueSetResourceDao.update(valueSetDstu3, null, true, false, null, txDetails); } } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4.java index 65162294e38..70ef2efbfbc 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4.java @@ -23,6 +23,7 @@ package ca.uhn.fhir.jpa.term; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.term.api.ITermVersionAdapterSvc; import ca.uhn.fhir.rest.api.server.RequestDetails; +import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; import ca.uhn.fhir.util.UrlUtil; import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.r4.model.CodeSystem; @@ -33,6 +34,7 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.EventListener; +import static ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc.MAKE_LOADING_VERSION_CURRENT; import static org.apache.commons.lang3.StringUtils.isBlank; public class TermVersionAdapterSvcR4 extends BaseTermVersionAdapterSvcImpl implements ITermVersionAdapterSvc { @@ -81,12 +83,15 @@ public class TermVersionAdapterSvcR4 extends BaseTermVersionAdapterSvcImpl imple } @Override - public void createOrUpdateValueSet(org.hl7.fhir.r4.model.ValueSet theValueSet, RequestDetails theRequestDetails) { + public void createOrUpdateValueSet(org.hl7.fhir.r4.model.ValueSet theValueSet, boolean theMakeItCurrent) { + TransactionDetails txDetails = new TransactionDetails(); + txDetails.putUserData(MAKE_LOADING_VERSION_CURRENT, theMakeItCurrent); + if (isBlank(theValueSet.getIdElement().getIdPart())) { String matchUrl = "ValueSet?url=" + UrlUtil.escapeUrlParam(theValueSet.getUrl()); - myValueSetResourceDao.update(theValueSet, matchUrl, theRequestDetails); + myValueSetResourceDao.update(theValueSet, matchUrl, true, false, null, txDetails); } else { - myValueSetResourceDao.update(theValueSet, theRequestDetails); + myValueSetResourceDao.update(theValueSet, null, true, false, null, txDetails); } } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR5.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR5.java index ebc5120823b..18ac5987e70 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR5.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR5.java @@ -23,6 +23,7 @@ package ca.uhn.fhir.jpa.term; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.term.api.ITermVersionAdapterSvc; import ca.uhn.fhir.rest.api.server.RequestDetails; +import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; import ca.uhn.fhir.util.UrlUtil; import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_40_50; import org.hl7.fhir.convertors.factory.VersionConvertorFactory_40_50; @@ -35,6 +36,7 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.EventListener; +import static ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc.MAKE_LOADING_VERSION_CURRENT; import static org.apache.commons.lang3.StringUtils.isBlank; public class TermVersionAdapterSvcR5 extends BaseTermVersionAdapterSvcImpl implements ITermVersionAdapterSvc { @@ -88,15 +90,18 @@ public class TermVersionAdapterSvcR5 extends BaseTermVersionAdapterSvcImpl imple } @Override - public void createOrUpdateValueSet(org.hl7.fhir.r4.model.ValueSet theValueSet, RequestDetails theRequestDetails) { + public void createOrUpdateValueSet(org.hl7.fhir.r4.model.ValueSet theValueSet, boolean theMakeItCurrent) { ValueSet valueSetR4 = (ValueSet) VersionConvertorFactory_40_50.convertResource(theValueSet, new BaseAdvisor_40_50(false)); + TransactionDetails txDetails = new TransactionDetails(); + txDetails.putUserData(MAKE_LOADING_VERSION_CURRENT, theMakeItCurrent); + if (isBlank(theValueSet.getIdElement().getIdPart())) { String matchUrl = "ValueSet?url=" + UrlUtil.escapeUrlParam(theValueSet.getUrl()); - myValueSetResourceDao.update(valueSetR4, matchUrl, theRequestDetails); + myValueSetResourceDao.update(valueSetR4, matchUrl, true, false, null, txDetails); } else { - myValueSetResourceDao.update(valueSetR4, theRequestDetails); + myValueSetResourceDao.update(valueSetR4, null, true, false, null, txDetails); } } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermDeferredStorageSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermDeferredStorageSvc.java index 5d7424aa19d..6d13a10249e 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermDeferredStorageSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermDeferredStorageSvc.java @@ -25,7 +25,6 @@ import ca.uhn.fhir.jpa.entity.TermCodeSystemVersion; import ca.uhn.fhir.jpa.entity.TermConcept; import ca.uhn.fhir.jpa.entity.TermConceptParentChildLink; import ca.uhn.fhir.jpa.model.entity.ResourceTable; -import ca.uhn.fhir.rest.api.server.RequestDetails; import org.hl7.fhir.r4.model.ConceptMap; import org.hl7.fhir.r4.model.ValueSet; @@ -53,7 +52,7 @@ public interface ITermDeferredStorageSvc { void addConceptMapsToStorageQueue(List theConceptMaps); - void addValueSetsToStorageQueue(List theValueSets, RequestDetails theRequestDetails); + void addValueSetsToStorageQueue(List theValueSets, boolean theMakeThemCurrent); void deleteCodeSystem(TermCodeSystem theCodeSystem); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java index 0aec2dcb7eb..6dbe1d0e603 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java @@ -7,7 +7,6 @@ import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoCodeSystem; import ca.uhn.fhir.jpa.entity.TermConcept; import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.jpa.term.IValueSetConceptAccumulator; -import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.util.FhirVersionIndependentConcept; import org.hl7.fhir.instance.model.api.IBaseCoding; import org.hl7.fhir.instance.model.api.IBaseDatatype; @@ -90,10 +89,10 @@ public interface ITermReadSvc extends IValidationSupport { void deleteValueSetAndChildren(ResourceTable theResourceTable); - void storeTermValueSet(ResourceTable theResourceTable, ValueSet theValueSet, RequestDetails theRequestDetails); + void storeTermValueSet(ResourceTable theResourceTable, ValueSet theValueSet, boolean theMakeItCurrent); default void storeTermValueSet(ResourceTable theResourceTable, ValueSet theValueSet) { - storeTermValueSet(theResourceTable, theValueSet, null); + storeTermValueSet(theResourceTable, theValueSet, true); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermVersionAdapterSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermVersionAdapterSvc.java index e3b703f40b4..1b528a5b9c3 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermVersionAdapterSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermVersionAdapterSvc.java @@ -41,6 +41,6 @@ public interface ITermVersionAdapterSvc { void createOrUpdateConceptMap(ConceptMap theNextConceptMap); - void createOrUpdateValueSet(ValueSet theValueSet, RequestDetails theRequestDetails); + void createOrUpdateValueSet(ValueSet theValueSet, boolean makeItCurrent); } From 710343a59964d128032c288b69b62d884f8835ed Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" Date: Tue, 31 Aug 2021 13:33:39 -0400 Subject: [PATCH 03/31] Use ForcedId to get current ValueSet version --- ...JpaPersistedResourceValidationSupport.java | 48 ++++++++----- .../fhir/jpa/dao/data/ITermValueSetDao.java | 43 +++++++----- .../ca/uhn/fhir/jpa/entity/TermValueSet.java | 30 ++++---- .../r4/BaseJpaResourceProviderValueSetR4.java | 18 ----- .../fhir/jpa/term/BaseTermReadSvcImpl.java | 68 +++++-------------- .../term/TermCodeSystemStorageSvcImpl.java | 4 +- .../jpa/term/TermDeferredStorageSvcImpl.java | 19 ++---- .../jpa/term/TermVersionAdapterSvcDstu2.java | 2 +- .../jpa/term/TermVersionAdapterSvcDstu3.java | 11 +-- .../jpa/term/TermVersionAdapterSvcR4.java | 11 +-- .../jpa/term/TermVersionAdapterSvcR5.java | 11 +-- .../jpa/term/api/ITermDeferredStorageSvc.java | 2 +- .../uhn/fhir/jpa/term/api/ITermReadSvc.java | 10 +-- .../jpa/term/api/ITermVersionAdapterSvc.java | 2 +- .../ca/uhn/fhir/jpa/dao/r5/BaseJpaR5Test.java | 2 +- .../tasks/HapiFhirJpaMigrationTasks.java | 7 -- 16 files changed, 110 insertions(+), 178 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java index be05a547e9d..e46fe36abf9 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java @@ -25,15 +25,18 @@ import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.jpa.api.dao.DaoRegistry; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; -import ca.uhn.fhir.jpa.term.api.ITermReadSvc; +import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.api.SortOrderEnum; import ca.uhn.fhir.rest.api.SortSpec; import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.rest.param.StringParam; import ca.uhn.fhir.rest.param.TokenParam; import ca.uhn.fhir.rest.param.UriParam; +import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import com.github.benmanes.caffeine.cache.Cache; import com.github.benmanes.caffeine.cache.Caffeine; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -69,15 +72,15 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport private static final Logger ourLog = LoggerFactory.getLogger(JpaPersistedResourceValidationSupport.class); + public static final String LOINC_GENERIC_VALUESET_URL = "http://loinc.org/vs"; + public static final String LOINC_GENERIC_VALUESET_URL_PLUS_SLASH = LOINC_GENERIC_VALUESET_URL + "/"; + private final FhirContext myFhirContext; private final IBaseResource myNoMatch; @Autowired private DaoRegistry myDaoRegistry; - @Autowired - private ITermReadSvc myITermReadSvc; - private Class myCodeSystemType; private Class myStructureDefinitionType; private Class myValueSetType; @@ -104,20 +107,34 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport @Override public IBaseResource fetchValueSet(String theSystem) { - // if no version is present, we need to append the current version, - // if one exists, in case it is not the last loaded - theSystem = appendCurrentVersion(theSystem); - return fetchResource(myValueSetType, theSystem); + boolean isNotLoincCodeSystem = ! StringUtils.containsIgnoreCase(theSystem, "loinc"); + boolean hasVersion = theSystem.contains("|"); + boolean isForGenericValueSet = theSystem.equals(LOINC_GENERIC_VALUESET_URL); + if (isNotLoincCodeSystem || hasVersion || isForGenericValueSet) { + return fetchResource(myValueSetType, theSystem); + } + + // if no version is present, we need to fetch the resource for the current version if one exists, + // in case it is not the last loaded + Optional currentVSOpt = getValueSetCurrentVersion(new UriType(theSystem)); + return currentVSOpt.orElseThrow(() -> new ResourceNotFoundException( + "Couldn't find current version ValueSet for url: " + theSystem)); } + /** + * Obtains the current version of a ValueSet using the fact that the current + * version is always pointed by the ForcedId for the no-versioned VS + */ + public Optional getValueSetCurrentVersion(UriType theUrl) { + if (! theUrl.getValueAsString().startsWith(LOINC_GENERIC_VALUESET_URL)) return Optional.empty(); - private String appendCurrentVersion(String theSystem) { - // if version is included there is nothing to add here - if (theSystem.contains("|")) return theSystem; + if (!theUrl.getValue().startsWith(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH)) { + throw new InternalErrorException("Don't know how to extract ForcedId from url: " + theUrl.getValueAsString()); + } - Optional currentVersionOpt = myITermReadSvc.getValueSetCurrentVersion(new UriType(theSystem)); - - return currentVersionOpt.map(ver -> theSystem + "|" + ver).orElse(theSystem); + String forcedId = theUrl.getValue().substring(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH.length()); + IBaseResource valueSet = myDaoRegistry.getResourceDao(myValueSetType).read(new IdDt("ValueSet", forcedId)); + return Optional.ofNullable(valueSet); } @@ -195,9 +212,6 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport params.add(ValueSet.SP_VERSION, new TokenParam(theUri.substring(versionSeparator + 1))); params.add(ValueSet.SP_URL, new UriParam(theUri.substring(0, versionSeparator))); } else { - // last loaded ValueSet not necessarily is the current version anymore, so code should be executing - // this path only when there is no current version pointed for the ValueSet - ourLog.warn("Fetching ValueSet current version as last loaded"); params.add(ValueSet.SP_URL, new UriParam(theUri)); } params.setSort(new SortSpec("_lastUpdated").setOrder(SortOrderEnum.DESC)); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetDao.java index fbdd1d86921..ac37eac7525 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetDao.java @@ -22,6 +22,7 @@ package ca.uhn.fhir.jpa.dao.data; import ca.uhn.fhir.jpa.entity.TermValueSet; import ca.uhn.fhir.jpa.entity.TermValueSetPreExpansionStatusEnum; +import org.apache.commons.lang3.StringUtils; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; import org.springframework.data.jpa.repository.JpaRepository; @@ -31,6 +32,8 @@ import org.springframework.data.repository.query.Param; import java.util.List; import java.util.Optional; +import static ca.uhn.fhir.jpa.dao.JpaPersistedResourceValidationSupport.LOINC_GENERIC_VALUESET_URL; + public interface ITermValueSetDao extends JpaRepository { @Query("SELECT vs FROM TermValueSet vs WHERE vs.myResourcePid = :resource_pid") @@ -44,28 +47,32 @@ public interface ITermValueSetDao extends JpaRepository { @Query("SELECT vs FROM TermValueSet vs WHERE vs.myExpansionStatus = :expansion_status") Slice findByExpansionStatus(Pageable pageable, @Param("expansion_status") TermValueSetPreExpansionStatusEnum theExpansionStatus); + @Query(value="SELECT vs FROM TermValueSet vs INNER JOIN ResourceTable r ON r.myId = vs.myResourcePid WHERE vs.myUrl = :url ORDER BY r.myUpdated DESC") + List findTermValueSetByUrl(Pageable thePage, @Param("url") String theUrl); + + /** + * The current TermValueSet is not necessarily the last uploaded anymore, but we know which is the last VS resource + * because it is pointed by a specific ForcedId, so we locate current ValueSet as the one pointing to the current resource + */ + @Query(value="SELECT vs FROM ForcedId f, TermValueSet vs where f.myForcedId = :forcedId and vs.myResource = f.myResource") + Optional findTermValueSetByForcedId(@Param("forcedId") String theForcedId); + + default Optional findTermValueSetByUrl(@Param("url") String theUrl) { + if (theUrl.startsWith(LOINC_GENERIC_VALUESET_URL)) { + String forcedId = theUrl.substring(LOINC_GENERIC_VALUESET_URL.length()); + if (StringUtils.isBlank(forcedId)) return Optional.empty(); + return findTermValueSetByForcedId(forcedId); + } + + List tvsList = findTermValueSetByUrl(Pageable.ofSize(1), theUrl); + + return Optional.ofNullable(tvsList.size() == 1 ? tvsList.get(0) : null); + } + @Query("SELECT vs FROM TermValueSet vs WHERE vs.myUrl = :url AND vs.myVersion IS NULL") Optional findTermValueSetByUrlAndNullVersion(@Param("url") String theUrl); @Query("SELECT vs FROM TermValueSet vs WHERE vs.myUrl = :url AND vs.myVersion = :version") Optional findTermValueSetByUrlAndVersion(@Param("url") String theUrl, @Param("version") String theVersion); - /** - * Obtain the only ValueSet for the url which myIsCurrentVersion is true if one exists - * or the last loaded ValueSet for the url which version is null otherwise - */ - @Query("select vs FROM TermValueSet vs JOIN FETCH vs.myResource r WHERE vs.myUrl = :url AND (vs.myIsCurrentVersion is true or " + - "(vs.myIsCurrentVersion is false AND vs.myVersion is null AND not exists(" + - "FROM TermValueSet WHERE myUrl = :url AND myIsCurrentVersion is true )) ) order by r.myUpdated DESC") - List listTermValueSetsByUrlAndCurrentVersion(@Param("url") String theUrl, Pageable pageable); - - /** - * This method uses the previous one to get a possible list of ValueSets and return the first if any - * because the query will obtain no more than one if one with the myCurrentVersion flag exists but - * could obtain more if one with that flag doesn't exist. For that reason the query is Pageable and ordered - */ - default Optional findTermValueSetByUrlAndCurrentVersion(@Param("url") String theUrl) { - List termValueSets = listTermValueSetsByUrlAndCurrentVersion(theUrl, Pageable.ofSize(1)); - return termValueSets.isEmpty()? Optional.empty() : Optional.of(termValueSets.get(0)); - } } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSet.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSet.java index 549388877dd..c42e6ca96e0 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSet.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSet.java @@ -26,10 +26,24 @@ import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import org.hibernate.annotations.ColumnDefault; -import org.hibernate.annotations.OptimisticLock; import javax.annotation.Nonnull; -import javax.persistence.*; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.ForeignKey; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Transient; +import javax.persistence.UniqueConstraint; import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -86,10 +100,6 @@ public class TermValueSet implements Serializable { @Column(name = "EXPANSION_STATUS", nullable = false, length = MAX_EXPANSION_STATUS_LENGTH) private TermValueSetPreExpansionStatusEnum myExpansionStatus; - @OptimisticLock(excluded = true) - @Column(name = "CURRENT_VERSION") - private Boolean myIsCurrentVersion = false; - @Transient private transient Integer myHashCode; @@ -203,14 +213,6 @@ public class TermValueSet implements Serializable { return this; } - public Boolean getCurrentVersion() { - return myIsCurrentVersion; - } - - public void setCurrentVersion(Boolean theCurrentVersion) { - myIsCurrentVersion = theCurrentVersion; - } - @Override public boolean equals(Object theO) { if (this == theO) return true; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/BaseJpaResourceProviderValueSetR4.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/BaseJpaResourceProviderValueSetR4.java index 6021db337e1..94cb8a684e2 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/BaseJpaResourceProviderValueSetR4.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/BaseJpaResourceProviderValueSetR4.java @@ -26,7 +26,6 @@ import ca.uhn.fhir.jpa.api.config.DaoConfig; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoValueSet; import ca.uhn.fhir.jpa.model.util.JpaConstants; import ca.uhn.fhir.jpa.provider.BaseJpaResourceProviderValueSetDstu2; -import ca.uhn.fhir.jpa.term.api.ITermReadSvc; import ca.uhn.fhir.rest.annotation.IdParam; import ca.uhn.fhir.rest.annotation.Operation; import ca.uhn.fhir.rest.annotation.OperationParam; @@ -43,20 +42,14 @@ import org.hl7.fhir.r4.model.Parameters; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.UriType; import org.hl7.fhir.r4.model.ValueSet; -import org.springframework.beans.factory.annotation.Autowired; import javax.servlet.http.HttpServletRequest; -import java.util.Optional; - import static org.apache.commons.lang3.StringUtils.isNotBlank; public class BaseJpaResourceProviderValueSetR4 extends JpaResourceProviderR4 { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BaseJpaResourceProviderValueSetR4.class); - @Autowired - private ITermReadSvc myITermReadSvc; - @Operation(name = JpaConstants.OPERATION_EXPAND, idempotent = true) public ValueSet expand( HttpServletRequest theServletRequest, @@ -83,16 +76,6 @@ public class BaseJpaResourceProviderValueSetR4 extends JpaResourceProviderR4 currentVersionOpt = myITermReadSvc.getValueSetCurrentVersion(theUrl); - if (currentVersionOpt.isPresent()) { - theValueSetVersion = new StringType(currentVersionOpt.get()); - haveValueSetVersion = true; - } - } - ValueSetExpansionOptions options = createValueSetExpansionOptions(myDaoConfig, theOffset, theCount, theIncludeHierarchy, theFilter); startRequest(theServletRequest); @@ -115,7 +98,6 @@ public class BaseJpaResourceProviderValueSetR4 extends JpaResourceProviderR4 optionalExistingTermValueSetById = myValueSetDao.findByResourcePid(theResourceTable.getId()); + Optional optionalExistingTermValueSetById = myTermValueSetDao.findByResourcePid(theResourceTable.getId()); if (optionalExistingTermValueSetById.isPresent()) { TermValueSet existingTermValueSet = optionalExistingTermValueSetById.get(); @@ -351,7 +347,7 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { ourLog.info("Deleting existing TermValueSet[{}] and its children...", existingTermValueSet.getId()); myValueSetConceptDesignationDao.deleteByTermValueSetId(existingTermValueSet.getId()); myValueSetConceptDao.deleteByTermValueSetId(existingTermValueSet.getId()); - myValueSetDao.deleteById(existingTermValueSet.getId()); + myTermValueSetDao.deleteById(existingTermValueSet.getId()); ourLog.info("Done deleting existing TermValueSet[{}] and its children.", existingTermValueSet.getId()); } } @@ -447,9 +443,9 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { Optional optionalTermValueSet; if (theValueSetToExpand.hasUrl()) { if (theValueSetToExpand.hasVersion()) { - optionalTermValueSet = myValueSetDao.findTermValueSetByUrlAndVersion(theValueSetToExpand.getUrl(), theValueSetToExpand.getVersion()); + optionalTermValueSet = myTermValueSetDao.findTermValueSetByUrlAndVersion(theValueSetToExpand.getUrl(), theValueSetToExpand.getVersion()); } else { - optionalTermValueSet = myValueSetDao.findTermValueSetByUrlAndCurrentVersion(theValueSetToExpand.getUrl()); + optionalTermValueSet = myTermValueSetDao.findTermValueSetByUrl(theValueSetToExpand.getUrl()); } } else { optionalTermValueSet = Optional.empty(); @@ -1454,7 +1450,7 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { @Override public boolean isValueSetPreExpandedForCodeValidation(ValueSet theValueSet) { ResourcePersistentId valueSetResourcePid = myConceptStorageSvc.getValueSetResourcePid(theValueSet.getIdElement()); - Optional optionalTermValueSet = myValueSetDao.findByResourcePid(valueSetResourcePid.getIdAsLong()); + Optional optionalTermValueSet = myTermValueSetDao.findByResourcePid(valueSetResourcePid.getIdAsLong()); if (!optionalTermValueSet.isPresent()) { ourLog.warn("ValueSet is not present in terminology tables. Will perform in-memory code validation. {}", getValueSetInfo(theValueSet)); @@ -1759,7 +1755,7 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { TermValueSet termValueSet = optionalTermValueSet.get(); termValueSet.setExpansionStatus(TermValueSetPreExpansionStatusEnum.EXPANSION_IN_PROGRESS); - return myValueSetDao.saveAndFlush(termValueSet); + return myTermValueSetDao.saveAndFlush(termValueSet); }); if (valueSetToExpand == null) { return; @@ -1768,18 +1764,18 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { // We have a ValueSet to pre-expand. try { ValueSet valueSet = txTemplate.execute(t -> { - TermValueSet refreshedValueSetToExpand = myValueSetDao.findById(valueSetToExpand.getId()).orElseThrow(() -> new IllegalStateException("Unknown VS ID: " + valueSetToExpand.getId())); + TermValueSet refreshedValueSetToExpand = myTermValueSetDao.findById(valueSetToExpand.getId()).orElseThrow(() -> new IllegalStateException("Unknown VS ID: " + valueSetToExpand.getId())); return getValueSetFromResourceTable(refreshedValueSetToExpand.getResource()); }); assert valueSet != null; - ValueSetConceptAccumulator accumulator = new ValueSetConceptAccumulator(valueSetToExpand, myValueSetDao, myValueSetConceptDao, myValueSetConceptDesignationDao); + ValueSetConceptAccumulator accumulator = new ValueSetConceptAccumulator(valueSetToExpand, myTermValueSetDao, myValueSetConceptDao, myValueSetConceptDesignationDao); expandValueSet(null, valueSet, accumulator); // We are done with this ValueSet. txTemplate.execute(t -> { valueSetToExpand.setExpansionStatus(TermValueSetPreExpansionStatusEnum.EXPANDED); - myValueSetDao.saveAndFlush(valueSetToExpand); + myTermValueSetDao.saveAndFlush(valueSetToExpand); return null; }); @@ -1789,7 +1785,7 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { ourLog.error("Failed to pre-expand ValueSet: " + e.getMessage(), e); txTemplate.execute(t -> { valueSetToExpand.setExpansionStatus(TermValueSetPreExpansionStatusEnum.FAILED_TO_EXPAND); - myValueSetDao.saveAndFlush(valueSetToExpand); + myTermValueSetDao.saveAndFlush(valueSetToExpand); return null; }); } @@ -1872,7 +1868,7 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { private Optional getNextTermValueSetNotExpanded() { Optional retVal = Optional.empty(); - Slice page = myValueSetDao.findByExpansionStatus(PageRequest.of(0, 1), TermValueSetPreExpansionStatusEnum.NOT_EXPANDED); + Slice page = myTermValueSetDao.findByExpansionStatus(PageRequest.of(0, 1), TermValueSetPreExpansionStatusEnum.NOT_EXPANDED); if (!page.getContent().isEmpty()) { retVal = Optional.of(page.getContent().get(0)); @@ -1883,7 +1879,7 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { @Override @Transactional - public void storeTermValueSet(ResourceTable theResourceTable, ValueSet theValueSet , boolean theMakeItCurrent) { + public void storeTermValueSet(ResourceTable theResourceTable, ValueSet theValueSet) { ValidateUtil.isTrueOrThrowInvalidRequest(theResourceTable != null, "No resource supplied"); if (isPlaceholder(theValueSet)) { @@ -1902,13 +1898,6 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { termValueSet.setUrl(theValueSet.getUrl()); termValueSet.setVersion(theValueSet.getVersion()); termValueSet.setName(theValueSet.hasName() ? theValueSet.getName() : null); - termValueSet.setCurrentVersion(false); - - // value sets must be marked as current only when version is present and flag indicates that - if (theValueSet.getVersion() != null && theMakeItCurrent) { - resetCurrentValueSetVersion(theValueSet); - termValueSet.setCurrentVersion(true); - } // Delete version being replaced deleteValueSetForResource(theResourceTable); @@ -1920,13 +1909,13 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { String version = termValueSet.getVersion(); Optional optionalExistingTermValueSetByUrl; if (version != null) { - optionalExistingTermValueSetByUrl = myValueSetDao.findTermValueSetByUrlAndVersion(url, version); + optionalExistingTermValueSetByUrl = myTermValueSetDao.findTermValueSetByUrlAndVersion(url, version); } else { - optionalExistingTermValueSetByUrl = myValueSetDao.findTermValueSetByUrlAndNullVersion(url); + optionalExistingTermValueSetByUrl = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(url); } if (!optionalExistingTermValueSetByUrl.isPresent()) { - myValueSetDao.save(termValueSet); + myTermValueSetDao.save(termValueSet); } else { TermValueSet existingTermValueSet = optionalExistingTermValueSetByUrl.get(); @@ -1946,17 +1935,6 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { } } - - private void resetCurrentValueSetVersion(ValueSet theValueSet) { - Optional termValueSetOpt = myTermValueSetDao.findTermValueSetByUrlAndCurrentVersion(theValueSet.getUrl()); - if (! termValueSetOpt.isPresent()) return; - - TermValueSet termValueSet = termValueSetOpt.get(); - termValueSet.setCurrentVersion(false); - myTermValueSetDao.save(termValueSet); - } - - @Override @Transactional public IFhirResourceDaoCodeSystem.SubsumesResult subsumes(IPrimitiveType theCodeA, IPrimitiveType theCodeB, @@ -2509,18 +2487,4 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { return theReqLang.equalsIgnoreCase(theStoredLang); } - - @Override - @Transactional - public Optional getValueSetCurrentVersion(UriType theUrl) { - Optional termValueSetOpt = - myTermValueSetDao.findTermValueSetByUrlAndCurrentVersion(theUrl.getValueAsString()); - - if (! termValueSetOpt.isPresent() || StringUtils.isBlank(termValueSetOpt.get().getVersion())) { - return Optional.empty(); - } - - return termValueSetOpt.map(TermValueSet::getVersion); - } - } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java index a204f2d6080..6a4d72c0337 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java @@ -399,9 +399,7 @@ public class TermCodeSystemStorageSvcImpl implements ITermCodeSystemStorageSvc { theCodeSystemResource.getVersion(), theCodeSystemVersion, resource, theRequest); myDeferredStorageSvc.addConceptMapsToStorageQueue(theConceptMaps); - - boolean isMakeVersionCurrent = ITermCodeSystemStorageSvc.isMakeVersionCurrent(theRequest); - myDeferredStorageSvc.addValueSetsToStorageQueue(theValueSets, isMakeVersionCurrent); + myDeferredStorageSvc.addValueSetsToStorageQueue(theValueSets); return csId; } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermDeferredStorageSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermDeferredStorageSvcImpl.java index 808138cd649..6e36e2fb331 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermDeferredStorageSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermDeferredStorageSvcImpl.java @@ -49,7 +49,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Slice; import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.util.Pair; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; @@ -66,7 +65,6 @@ import java.util.UUID; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; -import java.util.stream.Collectors; public class TermDeferredStorageSvcImpl implements ITermDeferredStorageSvc { @@ -74,7 +72,7 @@ public class TermDeferredStorageSvcImpl implements ITermDeferredStorageSvc { final private List myDeferredCodeSystemsDeletions = Collections.synchronizedList(new ArrayList<>()); final private Queue myDeferredCodeSystemVersionsDeletions = new ConcurrentLinkedQueue<>(); final private List myDeferredConcepts = Collections.synchronizedList(new ArrayList<>()); - final private List> myDeferredValueSets = Collections.synchronizedList(new ArrayList<>()); + final private List myDeferredValueSets = Collections.synchronizedList(new ArrayList<>()); final private List myDeferredConceptMaps = Collections.synchronizedList(new ArrayList<>()); final private List myConceptLinksToSaveLater = Collections.synchronizedList(new ArrayList<>()); @Autowired @@ -118,9 +116,9 @@ public class TermDeferredStorageSvcImpl implements ITermDeferredStorageSvc { } @Override - public void addValueSetsToStorageQueue(List theValueSets, boolean theMakeThemCurrent) { + public void addValueSetsToStorageQueue(List theValueSets) { Validate.notNull(theValueSets); - myDeferredValueSets.addAll(theValueSets.stream().map(vs -> Pair.of(vs, theMakeThemCurrent)).collect(Collectors.toList())); + myDeferredValueSets.addAll(theValueSets); } @Override @@ -216,15 +214,12 @@ public class TermDeferredStorageSvcImpl implements ITermDeferredStorageSvc { } } - private void processDeferredValueSets() { int count = Math.min(myDeferredValueSets.size(), 200); - for (Pair nextPair : new ArrayList<>(myDeferredValueSets.subList(0, count))) { - ValueSet valueSet = nextPair.getFirst(); - boolean makeItCurrent = nextPair.getSecond(); - ourLog.info("Creating ValueSet: {} , {}making it current version", valueSet.getId(), (makeItCurrent ? "" : "not ")); - myTerminologyVersionAdapterSvc.createOrUpdateValueSet(valueSet, makeItCurrent); - myDeferredValueSets.remove(nextPair); + for (ValueSet nextValueSet : new ArrayList<>(myDeferredValueSets.subList(0, count))) { + ourLog.info("Creating ValueSet: {}", nextValueSet.getId()); + myTerminologyVersionAdapterSvc.createOrUpdateValueSet(nextValueSet); + myDeferredValueSets.remove(nextValueSet); } ourLog.info("Saved {} deferred ValueSet resources, have {} remaining", count, myDeferredValueSets.size()); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcDstu2.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcDstu2.java index 61947b8460b..6fad466ce7e 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcDstu2.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcDstu2.java @@ -40,7 +40,7 @@ public class TermVersionAdapterSvcDstu2 implements ITermVersionAdapterSvc { } @Override - public void createOrUpdateValueSet(ValueSet theValueSet, boolean theMakeItCurrent) { + public void createOrUpdateValueSet(ValueSet theValueSet) { throw new UnsupportedOperationException(); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcDstu3.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcDstu3.java index 047f40bee34..446a5188cfa 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcDstu3.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcDstu3.java @@ -23,7 +23,6 @@ package ca.uhn.fhir.jpa.term; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.term.api.ITermVersionAdapterSvc; import ca.uhn.fhir.rest.api.server.RequestDetails; -import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.util.UrlUtil; import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_30_40; @@ -38,7 +37,6 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.EventListener; -import static ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc.MAKE_LOADING_VERSION_CURRENT; import static org.apache.commons.lang3.StringUtils.isBlank; public class TermVersionAdapterSvcDstu3 extends BaseTermVersionAdapterSvcImpl implements ITermVersionAdapterSvc { @@ -105,7 +103,7 @@ public class TermVersionAdapterSvcDstu3 extends BaseTermVersionAdapterSvcImpl im } @Override - public void createOrUpdateValueSet(org.hl7.fhir.r4.model.ValueSet theValueSet, boolean theMakeItCurrent) { + public void createOrUpdateValueSet(org.hl7.fhir.r4.model.ValueSet theValueSet) { ValueSet valueSetDstu3; try { valueSetDstu3 = (ValueSet) VersionConvertorFactory_30_40.convertResource(theValueSet, new BaseAdvisor_30_40(false)); @@ -113,14 +111,11 @@ public class TermVersionAdapterSvcDstu3 extends BaseTermVersionAdapterSvcImpl im throw new InternalErrorException(e); } - TransactionDetails txDetails = new TransactionDetails(); - txDetails.putUserData(MAKE_LOADING_VERSION_CURRENT, theMakeItCurrent); - if (isBlank(valueSetDstu3.getIdElement().getIdPart())) { String matchUrl = "ValueSet?url=" + UrlUtil.escapeUrlParam(theValueSet.getUrl()); - myValueSetResourceDao.update(valueSetDstu3, matchUrl, true, false, null, txDetails); + myValueSetResourceDao.update(valueSetDstu3, matchUrl); } else { - myValueSetResourceDao.update(valueSetDstu3, null, true, false, null, txDetails); + myValueSetResourceDao.update(valueSetDstu3); } } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4.java index 70ef2efbfbc..be3cf92be7e 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4.java @@ -23,7 +23,6 @@ package ca.uhn.fhir.jpa.term; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.term.api.ITermVersionAdapterSvc; import ca.uhn.fhir.rest.api.server.RequestDetails; -import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; import ca.uhn.fhir.util.UrlUtil; import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.r4.model.CodeSystem; @@ -34,7 +33,6 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.EventListener; -import static ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc.MAKE_LOADING_VERSION_CURRENT; import static org.apache.commons.lang3.StringUtils.isBlank; public class TermVersionAdapterSvcR4 extends BaseTermVersionAdapterSvcImpl implements ITermVersionAdapterSvc { @@ -83,15 +81,12 @@ public class TermVersionAdapterSvcR4 extends BaseTermVersionAdapterSvcImpl imple } @Override - public void createOrUpdateValueSet(org.hl7.fhir.r4.model.ValueSet theValueSet, boolean theMakeItCurrent) { - TransactionDetails txDetails = new TransactionDetails(); - txDetails.putUserData(MAKE_LOADING_VERSION_CURRENT, theMakeItCurrent); - + public void createOrUpdateValueSet(org.hl7.fhir.r4.model.ValueSet theValueSet) { if (isBlank(theValueSet.getIdElement().getIdPart())) { String matchUrl = "ValueSet?url=" + UrlUtil.escapeUrlParam(theValueSet.getUrl()); - myValueSetResourceDao.update(theValueSet, matchUrl, true, false, null, txDetails); + myValueSetResourceDao.update(theValueSet, matchUrl); } else { - myValueSetResourceDao.update(theValueSet, null, true, false, null, txDetails); + myValueSetResourceDao.update(theValueSet); } } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR5.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR5.java index 18ac5987e70..93e96974d27 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR5.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR5.java @@ -23,7 +23,6 @@ package ca.uhn.fhir.jpa.term; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.term.api.ITermVersionAdapterSvc; import ca.uhn.fhir.rest.api.server.RequestDetails; -import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; import ca.uhn.fhir.util.UrlUtil; import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_40_50; import org.hl7.fhir.convertors.factory.VersionConvertorFactory_40_50; @@ -36,7 +35,6 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.EventListener; -import static ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc.MAKE_LOADING_VERSION_CURRENT; import static org.apache.commons.lang3.StringUtils.isBlank; public class TermVersionAdapterSvcR5 extends BaseTermVersionAdapterSvcImpl implements ITermVersionAdapterSvc { @@ -90,18 +88,15 @@ public class TermVersionAdapterSvcR5 extends BaseTermVersionAdapterSvcImpl imple } @Override - public void createOrUpdateValueSet(org.hl7.fhir.r4.model.ValueSet theValueSet, boolean theMakeItCurrent) { + public void createOrUpdateValueSet(org.hl7.fhir.r4.model.ValueSet theValueSet) { ValueSet valueSetR4 = (ValueSet) VersionConvertorFactory_40_50.convertResource(theValueSet, new BaseAdvisor_40_50(false)); - TransactionDetails txDetails = new TransactionDetails(); - txDetails.putUserData(MAKE_LOADING_VERSION_CURRENT, theMakeItCurrent); - if (isBlank(theValueSet.getIdElement().getIdPart())) { String matchUrl = "ValueSet?url=" + UrlUtil.escapeUrlParam(theValueSet.getUrl()); - myValueSetResourceDao.update(valueSetR4, matchUrl, true, false, null, txDetails); + myValueSetResourceDao.update(valueSetR4, matchUrl); } else { - myValueSetResourceDao.update(valueSetR4, null, true, false, null, txDetails); + myValueSetResourceDao.update(valueSetR4); } } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermDeferredStorageSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermDeferredStorageSvc.java index 6d13a10249e..91cdb11b7f6 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermDeferredStorageSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermDeferredStorageSvc.java @@ -52,7 +52,7 @@ public interface ITermDeferredStorageSvc { void addConceptMapsToStorageQueue(List theConceptMaps); - void addValueSetsToStorageQueue(List theValueSets, boolean theMakeThemCurrent); + void addValueSetsToStorageQueue(List theValueSets); void deleteCodeSystem(TermCodeSystem theCodeSystem); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java index 6dbe1d0e603..b8e93b2e97f 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java @@ -14,7 +14,6 @@ import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.instance.model.api.IPrimitiveType; import org.hl7.fhir.r4.model.CodeSystem; -import org.hl7.fhir.r4.model.UriType; import org.hl7.fhir.r4.model.ValueSet; import javax.annotation.Nonnull; @@ -88,13 +87,7 @@ public interface ITermReadSvc extends IValidationSupport { void deleteValueSetAndChildren(ResourceTable theResourceTable); - - void storeTermValueSet(ResourceTable theResourceTable, ValueSet theValueSet, boolean theMakeItCurrent); - - default void storeTermValueSet(ResourceTable theResourceTable, ValueSet theValueSet) { - storeTermValueSet(theResourceTable, theValueSet, true); - } - + void storeTermValueSet(ResourceTable theResourceTable, ValueSet theValueSet); IFhirResourceDaoCodeSystem.SubsumesResult subsumes(IPrimitiveType theCodeA, IPrimitiveType theCodeB, IPrimitiveType theSystem, IBaseCoding theCodingA, IBaseCoding theCodingB); @@ -122,5 +115,4 @@ public interface ITermReadSvc extends IValidationSupport { */ CodeValidationResult codeSystemValidateCode(IIdType theCodeSystemId, String theValueSetUrl, String theVersion, String theCode, String theDisplay, IBaseDatatype theCoding, IBaseDatatype theCodeableConcept); - Optional getValueSetCurrentVersion(UriType theUrl); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermVersionAdapterSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermVersionAdapterSvc.java index 1b528a5b9c3..1f763f5a6b9 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermVersionAdapterSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermVersionAdapterSvc.java @@ -41,6 +41,6 @@ public interface ITermVersionAdapterSvc { void createOrUpdateConceptMap(ConceptMap theNextConceptMap); - void createOrUpdateValueSet(ValueSet theValueSet, boolean makeItCurrent); + void createOrUpdateValueSet(ValueSet theValueSet); } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r5/BaseJpaR5Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r5/BaseJpaR5Test.java index c97c0f682e6..8f00ee5a1d7 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r5/BaseJpaR5Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r5/BaseJpaR5Test.java @@ -571,7 +571,7 @@ public abstract class BaseJpaR5Test extends BaseJpaTest implements ITestDataBuil public List getExpandedConceptsByValueSetUrl(String theValuesetUrl) { return runInTransaction(() -> { - Optional valueSetOpt = myTermValueSetDao.findTermValueSetByUrlAndCurrentVersion(theValuesetUrl); + Optional valueSetOpt = myTermValueSetDao.findTermValueSetByUrl(theValuesetUrl); assertTrue(valueSetOpt.isPresent()); TermValueSet valueSet = valueSetOpt.get(); List concepts = valueSet.getConcepts(); diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java index 1cedc83eabc..dcd04dcad57 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java @@ -122,15 +122,8 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks { cmbTokNuTable.addColumn("20210722.1", "PARTITION_ID").nullable().type(ColumnTypeEnum.INT); cmbTokNuTable.addColumn("20210722.2", "PARTITION_DATE").nullable().type(ColumnTypeEnum.DATE_ONLY); cmbTokNuTable.modifyColumn("20210722.3", "RES_ID").nullable().withType(ColumnTypeEnum.LONG); - - version.onTable("TRM_VALUESET") - .addColumn("20210820.1", "CURRENT_VERSION").nullable().type(ColumnTypeEnum.BOOLEAN); - - //todo JM Add new column initialization and validate boolean in Oracle - } - private void init540() { Builder version = forVersion(VersionEnum.V5_4_0); From d7fde3f984d1298c6ce89af7ad43f327581eb26b Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" Date: Fri, 10 Sep 2021 09:32:47 -0400 Subject: [PATCH 04/31] Simplify implementation. Add tests. --- ...JpaPersistedResourceValidationSupport.java | 7 +- .../fhir/jpa/dao/data/ITermValueSetDao.java | 20 +- .../ca/uhn/fhir/jpa/entity/TermValueSet.java | 17 +- .../fhir/jpa/term/BaseTermReadSvcImpl.java | 30 +- .../uhn/fhir/jpa/term/TermLoaderSvcImpl.java | 5 +- .../uhn/fhir/jpa/term/api/ITermReadSvc.java | 5 + .../term/loinc/LoincUploadPropertiesEnum.java | 1 + .../ca/uhn/fhir/jpa/dao/r5/BaseJpaR5Test.java | 2 +- ...erminologySvcImplCurrentVersionR4Test.java | 701 +++++++++++++++--- .../fhir/jpa/term/ZipCollectionBuilder.java | 36 +- .../loinc-ver/loincupload.properties | 93 +++ .../loincupload_singlepartlink.properties | 82 ++ .../AccessoryFiles/AnswerFile/AnswerList.csv | 12 + .../AnswerFile/LoincAnswerListLink.csv | 11 + .../ConsumerName/ConsumerName.csv | 6 + .../DocumentOntology/DocumentOntology.csv | 10 + .../AccessoryFiles/GroupFile/Group.csv | 2 + .../GroupFile/GroupLoincTerms.csv | 3 + .../AccessoryFiles/GroupFile/ParentGroup.csv | 2 + .../ImagingDocuments/ImagingDocumentCodes.csv | 10 + .../LinguisticVariants/LinguisticVariants.csv | 9 + .../deAT24LinguisticVariant.csv | 4 + .../frCA8LinguisticVariant.csv | 6 + .../zhCN5LinguisticVariant.csv | 9 + ...LoincIeeeMedicalDeviceCodeMappingTable.csv | 10 + .../LoincRsnaRadiologyPlaybook.csv | 10 + .../LoincUniversalLabOrdersValueSet.csv | 10 + .../MultiAxialHierarchy.csv | 10 + .../PanelsAndForms/AnswerList.csv | 12 + .../AccessoryFiles/PanelsAndForms/Loinc.csv | 16 + .../PanelsAndForms/LoincAnswerListLink.csv | 11 + .../AccessoryFiles/PartFile/LoincPartLink.csv | 10 + .../PartFile/LoincPartLink_Primary.csv | 7 + .../PartFile/LoincPartLink_Supplementary.csv | 13 + .../AccessoryFiles/PartFile/Part.csv | 46 ++ .../PartFile/PartRelatedCodeMapping.csv | 12 + .../SI/Top2000CommonLabResultsSi.csv | 10 + .../US/Top2000CommonLabResultsUs.csv | 10 + .../v-no-version/LoincTable/Loinc.csv | 16 + .../loinc-ver/v-no-version}/loinc.xml | 67 +- .../AccessoryFiles/AnswerFile/AnswerList.csv | 12 + .../AnswerFile/LoincAnswerListLink.csv | 11 + .../ConsumerName/ConsumerName.csv | 6 + .../DocumentOntology/DocumentOntology.csv | 10 + .../v267/AccessoryFiles/GroupFile/Group.csv | 2 + .../GroupFile/GroupLoincTerms.csv | 3 + .../AccessoryFiles/GroupFile/ParentGroup.csv | 2 + .../ImagingDocuments/ImagingDocumentCodes.csv | 10 + .../LinguisticVariants/LinguisticVariants.csv | 9 + .../deAT24LinguisticVariant.csv | 4 + .../frCA8LinguisticVariant.csv | 6 + .../zhCN5LinguisticVariant.csv | 9 + ...LoincIeeeMedicalDeviceCodeMappingTable.csv | 10 + .../LoincRsnaRadiologyPlaybook.csv | 10 + .../LoincUniversalLabOrdersValueSet.csv | 10 + .../MultiAxialHierarchy.csv | 10 + .../PanelsAndForms/AnswerList.csv | 12 + .../AccessoryFiles/PanelsAndForms/Loinc.csv | 16 + .../PanelsAndForms/LoincAnswerListLink.csv | 11 + .../AccessoryFiles/PartFile/LoincPartLink.csv | 10 + .../PartFile/LoincPartLink_Primary.csv | 7 + .../PartFile/LoincPartLink_Supplementary.csv | 13 + .../v267/AccessoryFiles/PartFile/Part.csv | 46 ++ .../PartFile/PartRelatedCodeMapping.csv | 12 + .../SI/Top2000CommonLabResultsSi.csv | 10 + .../US/Top2000CommonLabResultsUs.csv | 10 + .../loinc-ver/v267/LoincTable/Loinc.csv | 16 + .../test/resources/loinc-ver/v267/loinc.xml | 543 ++++++++++++++ .../AccessoryFiles/AnswerFile/AnswerList.csv | 12 + .../AnswerFile/LoincAnswerListLink.csv | 11 + .../ConsumerName/ConsumerName.csv | 6 + .../DocumentOntology/DocumentOntology.csv | 10 + .../v268/AccessoryFiles/GroupFile/Group.csv | 2 + .../GroupFile/GroupLoincTerms.csv | 3 + .../AccessoryFiles/GroupFile/ParentGroup.csv | 2 + .../ImagingDocuments/ImagingDocumentCodes.csv | 10 + .../LinguisticVariants/LinguisticVariants.csv | 9 + .../deAT24LinguisticVariant.csv | 4 + .../frCA8LinguisticVariant.csv | 6 + .../zhCN5LinguisticVariant.csv | 9 + ...LoincIeeeMedicalDeviceCodeMappingTable.csv | 10 + .../LoincRsnaRadiologyPlaybook.csv | 10 + .../LoincUniversalLabOrdersValueSet.csv | 10 + .../MultiAxialHierarchy.csv | 10 + .../PanelsAndForms/AnswerList.csv | 12 + .../AccessoryFiles/PanelsAndForms/Loinc.csv | 16 + .../PanelsAndForms/LoincAnswerListLink.csv | 11 + .../AccessoryFiles/PartFile/LoincPartLink.csv | 10 + .../PartFile/LoincPartLink_Primary.csv | 7 + .../PartFile/LoincPartLink_Supplementary.csv | 13 + .../v268/AccessoryFiles/PartFile/Part.csv | 46 ++ .../PartFile/PartRelatedCodeMapping.csv | 12 + .../SI/Top2000CommonLabResultsSi.csv | 10 + .../US/Top2000CommonLabResultsUs.csv | 10 + .../loinc-ver/v268/LoincTable/Loinc.csv | 16 + .../test/resources/loinc-ver/v268/loinc.xml | 543 ++++++++++++++ .../AccessoryFiles/AnswerFile/AnswerList.csv | 12 + .../AnswerFile/LoincAnswerListLink.csv | 11 + .../ConsumerName/ConsumerName.csv | 6 + .../DocumentOntology/DocumentOntology.csv | 10 + .../v269/AccessoryFiles/GroupFile/Group.csv | 2 + .../GroupFile/GroupLoincTerms.csv | 3 + .../AccessoryFiles/GroupFile/ParentGroup.csv | 2 + .../ImagingDocuments/ImagingDocumentCodes.csv | 10 + .../LinguisticVariants/LinguisticVariants.csv | 9 + .../deAT24LinguisticVariant.csv | 4 + .../frCA8LinguisticVariant.csv | 6 + .../zhCN5LinguisticVariant.csv | 9 + ...LoincIeeeMedicalDeviceCodeMappingTable.csv | 10 + .../LoincRsnaRadiologyPlaybook.csv | 10 + .../LoincUniversalLabOrdersValueSet.csv | 10 + .../MultiAxialHierarchy.csv | 10 + .../PanelsAndForms/AnswerList.csv | 12 + .../AccessoryFiles/PanelsAndForms/Loinc.csv | 16 + .../PanelsAndForms/LoincAnswerListLink.csv | 11 + .../AccessoryFiles/PartFile/LoincPartLink.csv | 10 + .../PartFile/LoincPartLink_Primary.csv | 7 + .../PartFile/LoincPartLink_Supplementary.csv | 13 + .../v269/AccessoryFiles/PartFile/Part.csv | 46 ++ .../PartFile/PartRelatedCodeMapping.csv | 12 + .../SI/Top2000CommonLabResultsSi.csv | 10 + .../US/Top2000CommonLabResultsUs.csv | 10 + .../loinc-ver/v269/LoincTable/Loinc.csv | 16 + .../test/resources/loinc-ver/v269/loinc.xml | 543 ++++++++++++++ 124 files changed, 3661 insertions(+), 182 deletions(-) create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/loincupload.properties create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/loincupload_singlepartlink.properties create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/AnswerFile/AnswerList.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/AnswerFile/LoincAnswerListLink.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/ConsumerName/ConsumerName.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/DocumentOntology/DocumentOntology.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/GroupFile/Group.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/GroupFile/GroupLoincTerms.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/GroupFile/ParentGroup.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LinguisticVariants/LinguisticVariants.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LinguisticVariants/deAT24LinguisticVariant.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LinguisticVariants/frCA8LinguisticVariant.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LinguisticVariants/zhCN5LinguisticVariant.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LoincIeeeMedicalDeviceCodeMappingTable/LoincIeeeMedicalDeviceCodeMappingTable.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LoincUniversalLabOrdersValueSet/LoincUniversalLabOrdersValueSet.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PanelsAndForms/AnswerList.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PanelsAndForms/Loinc.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PanelsAndForms/LoincAnswerListLink.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/LoincPartLink.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/LoincPartLink_Primary.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/LoincPartLink_Supplementary.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/Part.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/PartRelatedCodeMapping.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/Top2000Results/SI/Top2000CommonLabResultsSi.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/Top2000Results/US/Top2000CommonLabResultsUs.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/LoincTable/Loinc.csv rename hapi-fhir-jpaserver-base/src/{main/resources/ca/uhn/fhir/jpa/term/loinc => test/resources/loinc-ver/v-no-version}/loinc.xml (92%) create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/AnswerFile/AnswerList.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/AnswerFile/LoincAnswerListLink.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/ConsumerName/ConsumerName.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/DocumentOntology/DocumentOntology.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/GroupFile/Group.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/GroupFile/GroupLoincTerms.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/GroupFile/ParentGroup.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LinguisticVariants/LinguisticVariants.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LinguisticVariants/deAT24LinguisticVariant.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LinguisticVariants/frCA8LinguisticVariant.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LinguisticVariants/zhCN5LinguisticVariant.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LoincIeeeMedicalDeviceCodeMappingTable/LoincIeeeMedicalDeviceCodeMappingTable.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LoincUniversalLabOrdersValueSet/LoincUniversalLabOrdersValueSet.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/AnswerList.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/Loinc.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/LoincAnswerListLink.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/LoincPartLink.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/LoincPartLink_Primary.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/LoincPartLink_Supplementary.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/Part.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/PartRelatedCodeMapping.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/Top2000Results/SI/Top2000CommonLabResultsSi.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/Top2000Results/US/Top2000CommonLabResultsUs.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/LoincTable/Loinc.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/loinc.xml create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/AnswerFile/AnswerList.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/AnswerFile/LoincAnswerListLink.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/ConsumerName/ConsumerName.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/DocumentOntology/DocumentOntology.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/GroupFile/Group.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/GroupFile/GroupLoincTerms.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/GroupFile/ParentGroup.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LinguisticVariants/LinguisticVariants.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LinguisticVariants/deAT24LinguisticVariant.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LinguisticVariants/frCA8LinguisticVariant.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LinguisticVariants/zhCN5LinguisticVariant.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LoincIeeeMedicalDeviceCodeMappingTable/LoincIeeeMedicalDeviceCodeMappingTable.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LoincUniversalLabOrdersValueSet/LoincUniversalLabOrdersValueSet.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/AnswerList.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/Loinc.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/LoincAnswerListLink.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/LoincPartLink.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/LoincPartLink_Primary.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/LoincPartLink_Supplementary.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/Part.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/PartRelatedCodeMapping.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/Top2000Results/SI/Top2000CommonLabResultsSi.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/Top2000Results/US/Top2000CommonLabResultsUs.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/LoincTable/Loinc.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/loinc.xml create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/AnswerFile/AnswerList.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/AnswerFile/LoincAnswerListLink.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/ConsumerName/ConsumerName.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/DocumentOntology/DocumentOntology.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/GroupFile/Group.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/GroupFile/GroupLoincTerms.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/GroupFile/ParentGroup.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LinguisticVariants/LinguisticVariants.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LinguisticVariants/deAT24LinguisticVariant.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LinguisticVariants/frCA8LinguisticVariant.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LinguisticVariants/zhCN5LinguisticVariant.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LoincIeeeMedicalDeviceCodeMappingTable/LoincIeeeMedicalDeviceCodeMappingTable.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LoincUniversalLabOrdersValueSet/LoincUniversalLabOrdersValueSet.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/AnswerList.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/Loinc.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/LoincAnswerListLink.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/LoincPartLink.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/LoincPartLink_Primary.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/LoincPartLink_Supplementary.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/Part.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/PartRelatedCodeMapping.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/Top2000Results/SI/Top2000CommonLabResultsSi.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/Top2000Results/US/Top2000CommonLabResultsUs.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/LoincTable/Loinc.csv create mode 100644 hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/loinc.xml diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java index e46fe36abf9..77467bd3431 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java @@ -24,6 +24,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.jpa.api.dao.DaoRegistry; +import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.api.SortOrderEnum; @@ -80,7 +81,6 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport @Autowired private DaoRegistry myDaoRegistry; - private Class myCodeSystemType; private Class myStructureDefinitionType; private Class myValueSetType; @@ -128,12 +128,13 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport public Optional getValueSetCurrentVersion(UriType theUrl) { if (! theUrl.getValueAsString().startsWith(LOINC_GENERIC_VALUESET_URL)) return Optional.empty(); - if (!theUrl.getValue().startsWith(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH)) { + if (! theUrl.getValue().startsWith(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH)) { throw new InternalErrorException("Don't know how to extract ForcedId from url: " + theUrl.getValueAsString()); } String forcedId = theUrl.getValue().substring(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH.length()); - IBaseResource valueSet = myDaoRegistry.getResourceDao(myValueSetType).read(new IdDt("ValueSet", forcedId)); + IFhirResourceDao valueSetResourceDao = myDaoRegistry.getResourceDao(myValueSetType); + IBaseResource valueSet = valueSetResourceDao.read(new IdDt("ValueSet", forcedId)); return Optional.ofNullable(valueSet); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetDao.java index ac37eac7525..fd5a5bc95ce 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetDao.java @@ -22,7 +22,6 @@ package ca.uhn.fhir.jpa.dao.data; import ca.uhn.fhir.jpa.entity.TermValueSet; import ca.uhn.fhir.jpa.entity.TermValueSetPreExpansionStatusEnum; -import org.apache.commons.lang3.StringUtils; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; import org.springframework.data.jpa.repository.JpaRepository; @@ -32,8 +31,6 @@ import org.springframework.data.repository.query.Param; import java.util.List; import java.util.Optional; -import static ca.uhn.fhir.jpa.dao.JpaPersistedResourceValidationSupport.LOINC_GENERIC_VALUESET_URL; - public interface ITermValueSetDao extends JpaRepository { @Query("SELECT vs FROM TermValueSet vs WHERE vs.myResourcePid = :resource_pid") @@ -51,28 +48,17 @@ public interface ITermValueSetDao extends JpaRepository { List findTermValueSetByUrl(Pageable thePage, @Param("url") String theUrl); /** - * The current TermValueSet is not necessarily the last uploaded anymore, but we know which is the last VS resource - * because it is pointed by a specific ForcedId, so we locate current ValueSet as the one pointing to the current resource + * The current TermValueSet is not necessarily the last uploaded anymore, but the current VS resource + * is pointed by a specific ForcedId, so we locate current ValueSet as the one pointing to current VS resource */ @Query(value="SELECT vs FROM ForcedId f, TermValueSet vs where f.myForcedId = :forcedId and vs.myResource = f.myResource") Optional findTermValueSetByForcedId(@Param("forcedId") String theForcedId); - default Optional findTermValueSetByUrl(@Param("url") String theUrl) { - if (theUrl.startsWith(LOINC_GENERIC_VALUESET_URL)) { - String forcedId = theUrl.substring(LOINC_GENERIC_VALUESET_URL.length()); - if (StringUtils.isBlank(forcedId)) return Optional.empty(); - return findTermValueSetByForcedId(forcedId); - } - - List tvsList = findTermValueSetByUrl(Pageable.ofSize(1), theUrl); - - return Optional.ofNullable(tvsList.size() == 1 ? tvsList.get(0) : null); - } - @Query("SELECT vs FROM TermValueSet vs WHERE vs.myUrl = :url AND vs.myVersion IS NULL") Optional findTermValueSetByUrlAndNullVersion(@Param("url") String theUrl); @Query("SELECT vs FROM TermValueSet vs WHERE vs.myUrl = :url AND vs.myVersion = :version") Optional findTermValueSetByUrlAndVersion(@Param("url") String theUrl, @Param("version") String theVersion); + } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSet.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSet.java index c42e6ca96e0..e11e041dae5 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSet.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSet.java @@ -28,22 +28,7 @@ import org.apache.commons.lang3.builder.ToStringStyle; import org.hibernate.annotations.ColumnDefault; import javax.annotation.Nonnull; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.FetchType; -import javax.persistence.ForeignKey; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; -import javax.persistence.OneToOne; -import javax.persistence.SequenceGenerator; -import javax.persistence.Table; -import javax.persistence.Transient; -import javax.persistence.UniqueConstraint; +import javax.persistence.*; import java.io.Serializable; import java.util.ArrayList; import java.util.List; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java index 871338e8dfb..b55dab9e7a4 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java @@ -123,6 +123,7 @@ import org.quartz.JobExecutionContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.TransactionDefinition; @@ -168,6 +169,8 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Supplier; import java.util.stream.Collectors; +import static ca.uhn.fhir.jpa.dao.JpaPersistedResourceValidationSupport.LOINC_GENERIC_VALUESET_URL; +import static ca.uhn.fhir.jpa.dao.JpaPersistedResourceValidationSupport.LOINC_GENERIC_VALUESET_URL_PLUS_SLASH; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; import static org.apache.commons.lang3.StringUtils.defaultString; import static org.apache.commons.lang3.StringUtils.isBlank; @@ -445,7 +448,7 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { if (theValueSetToExpand.hasVersion()) { optionalTermValueSet = myTermValueSetDao.findTermValueSetByUrlAndVersion(theValueSetToExpand.getUrl(), theValueSetToExpand.getVersion()); } else { - optionalTermValueSet = myTermValueSetDao.findTermValueSetByUrl(theValueSetToExpand.getUrl()); + optionalTermValueSet = findCurrentTermValueSet(theValueSetToExpand.getUrl()); } } else { optionalTermValueSet = Optional.empty(); @@ -2333,6 +2336,31 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { return codeSystemValidateCode(codeSystemUrl, theVersion, code, display); } + + @Override + public Optional findCurrentTermValueSet(String theUrl) { + boolean isNotLoincCodeSystem = ! StringUtils.containsIgnoreCase(theUrl, "loinc"); + boolean hasVersion = theUrl.contains("|"); + boolean isForGenericValueSet = theUrl.equals(LOINC_GENERIC_VALUESET_URL); + if (isNotLoincCodeSystem || hasVersion || isForGenericValueSet) { + List termValueSetList = myTermValueSetDao.findTermValueSetByUrl(Pageable.ofSize(1), theUrl); + if (termValueSetList.isEmpty()) return Optional.empty(); + return Optional.of(termValueSetList.get(0)); + } + + if (! theUrl.startsWith(LOINC_GENERIC_VALUESET_URL)) return Optional.empty(); + + if (! theUrl.startsWith(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH)) { + throw new InternalErrorException("Don't know how to extract ForcedId from url: " + theUrl); + } + + String forcedId = theUrl.substring(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH.length()); + if (StringUtils.isBlank(forcedId)) return Optional.empty(); + + return myTermValueSetDao.findTermValueSetByForcedId(forcedId); + } + + @SuppressWarnings("unchecked") private CodeValidationResult codeSystemValidateCode(String theCodeSystemUrl, String theCodeSystemVersion, String theCode, String theDisplay) { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java index 60f2952754c..e750f1fee3d 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java @@ -40,7 +40,6 @@ import ca.uhn.fhir.rest.api.EncodingEnum; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; -import ca.uhn.fhir.util.ClasspathUtil; import ca.uhn.fhir.util.ValidateUtil; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Charsets; @@ -563,9 +562,9 @@ public class TermLoaderSvcImpl implements ITermLoaderSvc { String loincCsString = loincXmlHandler.getContents(); if (isBlank(loincCsString)) { - ourLog.warn("Did not find loinc.xml in the ZIP distribution. Using built-in copy"); - loincCsString = ClasspathUtil.loadResource("/ca/uhn/fhir/jpa/term/loinc/loinc.xml"); + throw new InvalidRequestException("Did not find loinc.xml in the ZIP distribution."); } + CodeSystem loincCs = FhirContext.forR4().newXmlParser().parseResource(CodeSystem.class, loincCsString); String codeSystemVersionId = theUploadProperties.getProperty(LOINC_CODESYSTEM_VERSION.getCode()); if (codeSystemVersionId != null) { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java index b8e93b2e97f..b4d0d94e2e7 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java @@ -5,6 +5,7 @@ import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.context.support.ValueSetExpansionOptions; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoCodeSystem; import ca.uhn.fhir.jpa.entity.TermConcept; +import ca.uhn.fhir.jpa.entity.TermValueSet; import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.jpa.term.IValueSetConceptAccumulator; import ca.uhn.fhir.util.FhirVersionIndependentConcept; @@ -115,4 +116,8 @@ public interface ITermReadSvc extends IValidationSupport { */ CodeValidationResult codeSystemValidateCode(IIdType theCodeSystemId, String theValueSetUrl, String theVersion, String theCode, String theDisplay, IBaseDatatype theCoding, IBaseDatatype theCodeableConcept); + /** + * Version independent + */ + Optional findCurrentTermValueSet(String theUrl); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincUploadPropertiesEnum.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincUploadPropertiesEnum.java index 8e2f26f5490..20ebb162a05 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincUploadPropertiesEnum.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincUploadPropertiesEnum.java @@ -33,6 +33,7 @@ public enum LoincUploadPropertiesEnum { */ LOINC_UPLOAD_PROPERTIES_FILE("loincupload.properties"), + LOINC_XML_FILE("loinc.xml"), /* * MANDATORY diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r5/BaseJpaR5Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r5/BaseJpaR5Test.java index 8f00ee5a1d7..cafcb1ef39d 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r5/BaseJpaR5Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r5/BaseJpaR5Test.java @@ -571,7 +571,7 @@ public abstract class BaseJpaR5Test extends BaseJpaTest implements ITestDataBuil public List getExpandedConceptsByValueSetUrl(String theValuesetUrl) { return runInTransaction(() -> { - Optional valueSetOpt = myTermValueSetDao.findTermValueSetByUrl(theValuesetUrl); + Optional valueSetOpt = myTermSvc.findCurrentTermValueSet(theValuesetUrl); assertTrue(valueSetOpt.isPresent()); TermValueSet valueSet = valueSetOpt.get(); List concepts = valueSet.getConcepts(); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java index ac522bf4768..1358c66cecb 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java @@ -1,61 +1,491 @@ package ca.uhn.fhir.jpa.term; -import ca.uhn.fhir.jpa.entity.TermCodeSystem; +import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; +import ca.uhn.fhir.jpa.dao.r4.BaseJpaR4Test; import ca.uhn.fhir.jpa.entity.TermCodeSystemVersion; -import ca.uhn.fhir.jpa.entity.TermConcept; +import ca.uhn.fhir.jpa.entity.TermValueSet; +import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; +import ca.uhn.fhir.jpa.term.api.ITermReadSvc; +import ca.uhn.fhir.rest.api.server.IBundleProvider; +import ca.uhn.fhir.rest.param.TokenParam; +import ca.uhn.fhir.rest.param.UriParam; +import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; +import com.google.common.collect.Sets; +import org.apache.commons.lang3.StringUtils; +import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.r4.model.CodeSystem; +import org.hl7.fhir.r4.model.IdType; +import org.hl7.fhir.r4.model.ValueSet; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.mockito.Answers; +import org.mockito.Mock; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.ResourceUtils; +import javax.persistence.EntityManager; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.Collection; +import java.util.Collections; import java.util.HashSet; import java.util.List; +import java.util.Optional; +import java.util.Properties; import java.util.Set; +import java.util.stream.Collectors; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_ANSWERLIST_DUPLICATE_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_ANSWERLIST_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_ANSWERLIST_LINK_DUPLICATE_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_ANSWERLIST_LINK_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CODESYSTEM_MAKE_CURRENT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CODESYSTEM_VERSION; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_DOCUMENT_ONTOLOGY_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_DUPLICATE_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_GROUP_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_GROUP_TERMS_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_HIERARCHY_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_IEEE_MEDICAL_DEVICE_CODE_MAPPING_TABLE_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_IMAGING_DOCUMENT_CODES_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_PARENT_GROUP_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_PART_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_PART_LINK_FILE_PRIMARY_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_PART_LINK_FILE_SUPPLEMENTARY_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_PART_RELATED_CODE_MAPPING_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_RSNA_PLAYBOOK_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_TOP2000_COMMON_LAB_RESULTS_SI_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_TOP2000_COMMON_LAB_RESULTS_US_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_UNIVERSAL_LAB_ORDER_VALUESET_FILE_DEFAULT; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_UPLOAD_PROPERTIES_FILE; +import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_XML_FILE; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import static org.mockito.Mockito.when; /** * Tests load and validate CodeSystem and ValueSet so test names as uploadFirstCurrent... mean uploadCodeSystemAndValueSetCurrent... */ -public class TerminologySvcImplCurrentVersionR4Test extends BaseTermR4Test { +public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { private static final Logger ourLog = LoggerFactory.getLogger(TerminologySvcImplCurrentVersionR4Test.class); - @Test - public void uploadFirstCurrentNoVersion() { + public static final String BASE_VS_URL = "http://loinc.org/vs/"; + + // some ValueSets have a version specified independent of the CS version being uploaded. This is one of them + public static final String VS_VERSIONED_ON_UPLOAD_ID = "LL1000-0"; + public static final String VS_VERSIONED_ON_UPLOAD = BASE_VS_URL + VS_VERSIONED_ON_UPLOAD_ID; + + // some ValueSets have a version specified independent of the CS version being uploaded. This one doesn't + public static final String VS_NO_VERSIONED_ON_UPLOAD_ID = "loinc-rsna-radiology-playbook"; + public static final String VS_NO_VERSIONED_ON_UPLOAD = BASE_VS_URL + VS_NO_VERSIONED_ON_UPLOAD_ID; + + public static final String VS_ANSWER_LIST_VERSION = "Beta.1"; + public static final Set possibleVersions = Sets.newHashSet("2.67", "2.68", "2.69"); + + @Mock + HttpServletResponse mockServletResponse; + + @Mock(answer = Answers.RETURNS_DEEP_STUBS) + ServletRequestDetails mockRequestDetails; + + @Autowired private EntityManager myEntityManager; + @Autowired private TermLoaderSvcImpl myTermLoaderSvc; + @Autowired private ITermReadSvc myITermReadSvc; + + + private ZipCollectionBuilder myFiles; + private ServletRequestDetails myRequestDetails = new ServletRequestDetails(); + + private Properties uploadProperties; + private IFhirResourceDao dao; + + + +// @BeforeAll +// public static void beforeAll() throws Exception { +// // remove DB +// Files.deleteIfExists(Paths.get( +// "/Users/juan.marchionattosmilecdr.com/projects/hapi-fhir/hapi-fhir-jpaserver-base/testdb_r4_2.mv.db")); +// } + + @BeforeEach + public void beforeEach() throws Exception { +// myTermLoaderSvc = TermLoaderSvcImpl.withoutProxyCheck(myTermDeferredStorageSvc, myTermCodeSystemStorageSvc); + + File file = ResourceUtils.getFile("classpath:loinc-ver/" + LOINC_UPLOAD_PROPERTIES_FILE.getCode()); + uploadProperties = new Properties(); + uploadProperties.load(new FileInputStream(file)); + + dao = (IFhirResourceDao) myDaoRegistry.getResourceDao(ValueSet.class); + + when(mockRequestDetails.getServer().getDefaultPageSize()).thenReturn(25); } - @Test - public void uploadFirstCurrentWithVersion() { + /** + * For input version or for current (when input is null) validates following operations: + * _ JpaTerminologyProvider.in() + * _ JpaTerminologyProvider.expand() + * _ JpaTerminologyProvider.lookup() + * + * _ BaseJpaResourceProvider.read() + * _ BaseJpaResourceProvider.validate() + */ + private void validateOperations(Collection theExpectedVersions) { + validateValueSetSearch(theExpectedVersions); + + validateValueExpand(theExpectedVersions); + + validateValueLookup(theExpectedVersions); + + +// // JpaTerminologyProvider.lookup() +// // JpaTerminologyProvider.in() +// BaseJpaResourceProviderCodeSystemR4.lookup() +// BaseJpaResourceProviderCodeSystemR4.subsumes() +// BaseJpaResourceProviderCodeSystemR4.validateCode() +// + } + + private void validateValueLookup(Collection theExpectedVersions) { + } + + + private void validateValueExpand(Collection theExpectedVersions) { + // for CS ver = null, VS ver = null + ValueSet vs = myValueSetDao.expandByIdentifier(VS_NO_VERSIONED_ON_UPLOAD, null); + assertEquals(1, vs.getExpansion().getContains().size()); + + // for CS ver = null, VS ver != null + ValueSet vs1 = myValueSetDao.expandByIdentifier(VS_VERSIONED_ON_UPLOAD + "|" + VS_ANSWER_LIST_VERSION, null); + assertEquals(3, vs1.getExpansion().getContains().size()); + + // now for each uploaded version + theExpectedVersions.forEach(this::validateValueExpandForVersion); + + } + + private void validateValueExpandForVersion(String theVersion) { + // for CS ver != null, VS ver = null + ValueSet vs2 = myValueSetDao.expandByIdentifier( + VS_NO_VERSIONED_ON_UPLOAD + "|" + theVersion, null); + assertEquals(1, vs2.getExpansion().getContains().size()); + + // for CS ver != null, VS ver != null + ValueSet vs3 = myValueSetDao.expandByIdentifier( + VS_VERSIONED_ON_UPLOAD + "|" + VS_ANSWER_LIST_VERSION + "-" + theVersion, null); + assertEquals(3, vs3.getExpansion().getContains().size()); + } + + + private void validateValueSetSearch(Collection theExpectedIdVersions) { + // first validate search for CS ver = null VS ver = null + + SearchParameterMap paramsNoUploadVer = new SearchParameterMap("url", new UriParam(VS_NO_VERSIONED_ON_UPLOAD)); + int expectedResultQty = theExpectedIdVersions.size() + 1; // + 1 because an extra null version (the current) is always present + IBundleProvider noUploadVerResult = dao.search(paramsNoUploadVer, mockRequestDetails, mockServletResponse); + List noUploadVerValueSets = noUploadVerResult.getAllResources(); + assertEquals(expectedResultQty, noUploadVerValueSets.size()); + + matchUnqualifiedIds(noUploadVerValueSets, theExpectedIdVersions); + + // now validate search for CS ver = null VS ver != null + + SearchParameterMap paramsUploadVer = new SearchParameterMap("url", new UriParam(VS_VERSIONED_ON_UPLOAD)); + paramsUploadVer.add("version", new TokenParam(VS_ANSWER_LIST_VERSION)); + IBundleProvider uploadVerResult = dao.search(paramsUploadVer, mockRequestDetails, mockServletResponse); + List uploadVerValueSets = uploadVerResult.getAllResources(); + assertEquals(1, uploadVerValueSets.size()); + + assertEquals(VS_VERSIONED_ON_UPLOAD_ID, uploadVerValueSets.get(0).getIdElement().getIdPart()); + assertEquals( VS_ANSWER_LIST_VERSION, ((ValueSet ) uploadVerValueSets.get(0)).getVersion()); + + // now validate each specific uploaded version + theExpectedIdVersions.forEach(this::validateValueSetSearchForVersion); + } + + + /** + * Some ValueSets (IE: AnswerLists), can have a specific version, different than the version of the + * CodeSystem with which they were uploaded. That version is what we distinguish in both sets of tests here, + * no the CodeSystem version. + */ + private void validateValueSetSearchForVersion(String theVersion) { + // for no versioned VS (VS version, different than CS version) + + SearchParameterMap paramsUploadNoVer = new SearchParameterMap("url", new UriParam(VS_NO_VERSIONED_ON_UPLOAD)); + paramsUploadNoVer.add("version", new TokenParam(theVersion)); + + IBundleProvider uploadNoVerResult = dao.search(paramsUploadNoVer, mockRequestDetails, mockServletResponse); + List uploadNoVerValueSets = uploadNoVerResult.getAllResources(); + assertEquals(1, uploadNoVerValueSets.size()); + + ValueSet loadNoVersionValueSet = (ValueSet) uploadNoVerValueSets.get(0); + String expectedLoadNoVersionUnqualifiedId = VS_NO_VERSIONED_ON_UPLOAD_ID + (theVersion == null ? "" : "-" + theVersion); + assertEquals(expectedLoadNoVersionUnqualifiedId, loadNoVersionValueSet.getIdElement().getIdPart()); + + + // versioned VS (VS version, different than CS version) + + SearchParameterMap paramsUploadVer = new SearchParameterMap("url", new UriParam(VS_VERSIONED_ON_UPLOAD)); + paramsUploadVer.add("version", new TokenParam(VS_ANSWER_LIST_VERSION + "-" + theVersion)); + + IBundleProvider uploadVerResult = dao.search(paramsUploadVer, mockRequestDetails, mockServletResponse); + List uploadVerValueSets = uploadVerResult.getAllResources(); + assertEquals(1, uploadVerValueSets.size()); + + ValueSet loadVersionValueSet = (ValueSet) uploadVerValueSets.get(0); + String expectedLoadVersionUnqualifiedId = VS_VERSIONED_ON_UPLOAD_ID + (theVersion == null ? "" : "-" + theVersion); + assertEquals(expectedLoadVersionUnqualifiedId, loadVersionValueSet.getIdElement().getIdPart()); + } + + + /** + * Validates that the collection of unqualified IDs of each element of theValueSets matches the expected + * unqualifiedIds corresponding to the uploaded versions plus one with no version + * + * @param theValueSets the ValueSet collection + * @param theExpectedIdVersions the collection of expected versions + */ + private void matchUnqualifiedIds(List theValueSets, Collection theExpectedIdVersions) { + // set should contain one entry per expectedVersion + List expectedNoVersionUnqualifiedIds = theExpectedIdVersions.stream() + .map(expVer -> VS_NO_VERSIONED_ON_UPLOAD_ID + "-" + expVer) + .collect(Collectors.toList()); + + // plus one entry for null version + expectedNoVersionUnqualifiedIds.add(VS_NO_VERSIONED_ON_UPLOAD_ID); + + List resultUnqualifiedIds = theValueSets.stream() + .map(r -> r.getIdElement().getIdPart()) + .collect(Collectors.toList()); + + assertThat(resultUnqualifiedIds, containsInAnyOrder(resultUnqualifiedIds.toArray())); + + List resultVersions = theValueSets.stream() + .map(r -> ((ValueSet) r).getVersion()) + .collect(Collectors.toList()); + + Set theExpectedIdVersionsPlusNull = Sets.newHashSet(theExpectedIdVersions); + theExpectedIdVersionsPlusNull.add(null); + assertThat(theExpectedIdVersionsPlusNull, containsInAnyOrder(resultVersions.toArray())); + } + + + /** + * Validates that: + * for CodeSystem: + * _ current CS has no version, obtaining it from DAO + * _ current TCS has no version + * for ValueSet: + * _ current TVSs with upload version have upload-version with no version append + * _ current TVSs with no upload version have null version + * operations: + * _ validate operation for current (no version parameter) + */ + private void runCommonValidations(String theVersion) { + // for CodeSystem: + + // _ current CS is present and has no version + CodeSystem codeSystem = myCodeSystemDao.read(new IdType("loinc")); + String csString = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem); + ourLog.info("CodeSystem:\n" + csString); + + HashSet shouldNotBePresentVersions = new HashSet<>(possibleVersions); + shouldNotBePresentVersions.remove(theVersion); + shouldNotBePresentVersions.stream().forEach(vv -> assertFalse(csString.contains(vv))); + + // _ current TermCodeSystem has no version + TermCodeSystemVersion termCSVersion = fetchCurrentCodeSystemVersion(); + assertNotNull(termCSVersion); + assertNull(termCSVersion.getCodeSystemVersionId()); + + // for ValueSet: + + // current TermVSs with no upload version have null version + Optional noUploadCurrentVsOpt = myITermReadSvc.findCurrentTermValueSet(VS_NO_VERSIONED_ON_UPLOAD); + assertTrue(noUploadCurrentVsOpt.isPresent()); + assertNull(noUploadCurrentVsOpt.get().getVersion()); + + // current VSs with upload version have upload-version with no version append + Optional uploadCurrentVsOpt = myITermReadSvc.findCurrentTermValueSet(VS_VERSIONED_ON_UPLOAD); + assertTrue(uploadCurrentVsOpt.isPresent()); + assertEquals(VS_ANSWER_LIST_VERSION, uploadCurrentVsOpt.get().getVersion()); + } + + + @Test() + public void uploadCSCurrentNoVersion() throws Exception { + IIdType csId = uploadLoincCodeSystem(null, true); + + runCommonValidations(null); + + // validate operation for current (no version parameter) + validateOperations(Collections.emptySet()); } - @Test - public void uploadFirstCurrentNoVersionThenNoCurrent() { + @Test() + public void uploadCSCurrentWithVersion() throws Exception { + String ver = "2.67"; + IIdType csId = uploadLoincCodeSystem(ver, true); + + runCommonValidations(ver); + +// myTermSvc.preExpandDeferredValueSetsToTerminologyTables(); + + // validate operation for specific version + validateOperations(Collections.singleton(ver)); + } + + +// @Test + public void uploadCurrentNoVersionThenNoCurrent() throws Exception { + uploadLoincCodeSystem(null, true); + String ver = "2.67"; + uploadLoincCodeSystem(ver, false); + + Optional csIdNoVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc"); + assertTrue(csIdNoVersionedOpt.isPresent()); + + Optional csIdVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc" + "-" + ver); + assertTrue(csIdVersionedOpt.isPresent()); + + // current CS data is no-ver + CodeSystem codeSystem = myCodeSystemDao.read(new IdType("loinc")); + String csString = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem); + ourLog.info("CodeSystem:\n" + csString); + + // no versions present in CS data + possibleVersions.stream().forEach(vv -> assertFalse(csString.contains(vv))); + + + // ValueSets + + checkVsVersionExists(null); } - @Test - public void uploadFirstCurrentWithVersionThenNoCurrent() { +// @Test + public void uploadFirstCurrentWithVersionThenNoCurrent() throws Exception { + String firstVer = "2.67"; + uploadLoincCodeSystem(firstVer, true); + String secondVer = "2.68"; + uploadLoincCodeSystem(secondVer, false); + + Optional csIdNoVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc"); + assertTrue(csIdNoVersionedOpt.isPresent()); + + Optional csIdFirstVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc" + "-" + firstVer); + assertTrue(csIdFirstVersionedOpt.isPresent()); + + Optional csIdSecondVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc" + "-" + secondVer); + assertTrue(csIdSecondVersionedOpt.isPresent()); + + // current CS data is no-ver + CodeSystem codeSystem = myCodeSystemDao.read(new IdType("loinc")); + String csString = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem); + ourLog.info("CodeSystem:\n" + csString); + + // only 2.67 versions present in CS data + Set noVersionsPresent = new HashSet(possibleVersions); + noVersionsPresent.remove(firstVer); + noVersionsPresent.stream().forEach(vv -> assertFalse(csString.contains(vv))); + + // ValueSets + + checkVsVersionExists(firstVer); + checkVsVersionExists(secondVer); + + + + +// Optional csIdVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc" + "-" + "2.58"); +// assertFalse(csIdVersionedOpt.isPresent()); +// +// Optional csIdNoVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc"); +// assertTrue(csIdNoVersionedOpt.isPresent()); + + // make sure: + + // curr CS ver is null ver with 2.59 data + + // VS present for V 2.58 (curr = true), 2,59 (curr = false) & null (curr = true) + + // only one VS per url-ver true + } + + private void checkVsVersionExists(String ver) { + String vsNoVersionedVersion = VS_NO_VERSIONED_ON_UPLOAD + (ver == null ? "" : "-" + ver); + Optional noUploadVersionedVsOpt = myITermReadSvc.findCurrentTermValueSet(vsNoVersionedVersion); + assertTrue(noUploadVersionedVsOpt.isPresent()); + assertNull(noUploadVersionedVsOpt.get().getVersion()); + + String vsersionedVersion = VS_VERSIONED_ON_UPLOAD + (ver == null ? "" : "-" + ver); + Optional uploadVersionedVsOpt = myITermReadSvc.findCurrentTermValueSet(vsersionedVersion); + assertTrue(uploadVersionedVsOpt.isPresent()); + assertEquals(VS_ANSWER_LIST_VERSION, uploadVersionedVsOpt.get().getVersion()); } - @Test - public void uploadFirstCurrentNoVersionThenNoCurrentThenCurrent() { + // @Test + public void uploadFirstCurrentNoVersionThenNoCurrentThenCurrent() throws Exception { + uploadLoincCodeSystem(null, true); + uploadLoincCodeSystem("2.58", false); + uploadLoincCodeSystem("2.59", true); +// Optional csIdVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc" + "-" + "2.58"); +// assertFalse(csIdVersionedOpt.isPresent()); +// +// Optional csIdNoVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc"); +// assertTrue(csIdNoVersionedOpt.isPresent()); + + // make sure: + + // curr CS ver is null ver with 2.59 data + + // VS present for V 2.58 (curr = false), 2.59 (curr = true) & null (curr = true) + + // only one VS per url-ver true + // both curr = true have same data (2.59) } - @Test - public void uploadFirstCurrentWithVersionThenNoCurrentThenCurrent() { +// @Test + public void uploadFirstCurrentWithVersionThenNoCurrentThenCurrent() throws Exception { + uploadLoincCodeSystem("2.57", true); + uploadLoincCodeSystem("2.58", false); + uploadLoincCodeSystem("2.59", true); +// Optional csIdVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc" + "-" + "2.58"); +// assertFalse(csIdVersionedOpt.isPresent()); +// +// Optional csIdNoVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc"); +// assertTrue(csIdNoVersionedOpt.isPresent()); + + // make sure: + + // curr CS ver is null ver with 2.59 data + + // VS present for V 2.57 (curr = false), 2.58 (curr = false), 2,59 (curr = true) & null (curr = true) + + // both curr = true have same data (2.59) } @@ -70,6 +500,116 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseTermR4Test { // assertFalse(validation.isOk()); // } + + private IIdType uploadLoincCodeSystem(String theVersion, boolean theMakeItCurrent) throws Exception { + myFiles = new ZipCollectionBuilder(); + + if (! theMakeItCurrent) { + myRequestDetails.getUserData().put(LOINC_CODESYSTEM_MAKE_CURRENT, false); + uploadProperties.put(LOINC_CODESYSTEM_MAKE_CURRENT.getCode(), "false"); + } + + assertTrue( + theVersion == null || theVersion.equals("2.67") || theVersion.equals("2.68") || theVersion.equals("2.69"), + "Version supported are: 2.67, 2.68, 2.69 and null" ); + + if (StringUtils.isBlank(theVersion)) { + uploadProperties.remove(LOINC_CODESYSTEM_VERSION.getCode()); + } else { + uploadProperties.put(LOINC_CODESYSTEM_VERSION.getCode(), theVersion); + } + + addLoincMandatoryFilesToZip(myFiles, theVersion); + + UploadStatistics stats = myTermLoaderSvc.loadLoinc(myFiles.getFiles(), mySrd); + myTerminologyDeferredStorageSvc.saveAllDeferred(); + + return stats.getTarget(); + } + + + public void addLoincMandatoryFilesToZip(ZipCollectionBuilder theFiles, String theVersion) throws IOException { + String theClassPathPrefix = getClassPathPrefix(theVersion); + addBaseLoincMandatoryFilesToZip(theFiles, true, theClassPathPrefix); + theFiles.addPropertiesZip(uploadProperties, LOINC_UPLOAD_PROPERTIES_FILE.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_PART_LINK_FILE_PRIMARY_DEFAULT.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_PART_LINK_FILE_SUPPLEMENTARY_DEFAULT.getCode()); + } + + + private String getClassPathPrefix(String theVersion) { + String theClassPathPrefix = "/loinc-ver/v-no-version/"; + + if (StringUtils.isBlank(theVersion)) return theClassPathPrefix; + + switch(theVersion) { + case "2.67": return "/loinc-ver/v267/"; + case "2.68": return "/loinc-ver/v268/"; + case "2.69": return "/loinc-ver/v269/"; + }; + + fail("Setup failed. Unexpected version: " + theVersion); + return null; + } + + + private static void addBaseLoincMandatoryFilesToZip( + ZipCollectionBuilder theFiles, Boolean theIncludeTop2000, String theClassPathPrefix) throws IOException { + theFiles.addFileZip(theClassPathPrefix, LOINC_XML_FILE.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_GROUP_FILE_DEFAULT.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_GROUP_TERMS_FILE_DEFAULT.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_PARENT_GROUP_FILE_DEFAULT.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_FILE_DEFAULT.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_DUPLICATE_FILE_DEFAULT.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_HIERARCHY_FILE_DEFAULT.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_ANSWERLIST_FILE_DEFAULT.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_ANSWERLIST_DUPLICATE_FILE_DEFAULT.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_ANSWERLIST_LINK_FILE_DEFAULT.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_ANSWERLIST_LINK_DUPLICATE_FILE_DEFAULT.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_PART_FILE_DEFAULT.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_PART_RELATED_CODE_MAPPING_FILE_DEFAULT.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_DOCUMENT_ONTOLOGY_FILE_DEFAULT.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_RSNA_PLAYBOOK_FILE_DEFAULT.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_UNIVERSAL_LAB_ORDER_VALUESET_FILE_DEFAULT.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_IEEE_MEDICAL_DEVICE_CODE_MAPPING_TABLE_FILE_DEFAULT.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_IMAGING_DOCUMENT_CODES_FILE_DEFAULT.getCode()); + if (theIncludeTop2000) { + theFiles.addFileZip(theClassPathPrefix, LOINC_TOP2000_COMMON_LAB_RESULTS_SI_FILE_DEFAULT.getCode()); + theFiles.addFileZip(theClassPathPrefix, LOINC_TOP2000_COMMON_LAB_RESULTS_US_FILE_DEFAULT.getCode()); + } + } + + private void logAllTermValueSets() { + List vsList = myTermValueSetDao.findAll(); + + vsList.forEach(vs -> { + ourLog.info("ValueSet:\n" + vs); + }); + + } + + + private TermCodeSystemVersion fetchCurrentCodeSystemVersion() { + return (TermCodeSystemVersion) myEntityManager.createQuery( + "select tcsv from TermCodeSystemVersion tcsv join fetch tcsv.myCodeSystem tcs " + + "where tcs.myCurrentVersion = tcsv" ).getSingleResult(); + } + + private List fetchTermValueSets(String url) { + return myEntityManager.createQuery("from TermValueSet where url = '" + url + "'").getResultList(); + } + + private List fetchValueSets(Collection ids) { +// ResourcePersistentId rscIds = myIdHelperService.resolveResourcePersistentIds( +// RequestPartitionId.allPartitions(), "ValueSet", url); +// + return myEntityManager.createQuery("from ResourceTable where myResourceType = 'ValueSet'").getResultList(); + } + + + + + // @Test // public void testValidateCodeIsInPreExpandedValueSet() throws Exception { // myDaoConfig.setPreExpandValueSets(true); @@ -118,109 +658,62 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseTermR4Test { // assertEquals("Systolic blood pressure at First encounter", result.getDisplay()); // } + + // @Test -// public void testValidateCodeIsInPreExpandedValueSetWithClientAssignedId() throws Exception { -// myDaoConfig.setPreExpandValueSets(true); +// public void testCreateCodeSystemTwoVersions() { +// CodeSystem codeSystem = new CodeSystem(); +// codeSystem.setUrl(CS_URL); +// codeSystem.setContent(CodeSystem.CodeSystemContentMode.COMPLETE); +// codeSystem +// .addConcept().setCode("A").setDisplay("Code A"); +// codeSystem +// .addConcept().setCode("B").setDisplay("Code A"); // -// loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.PUT); +// codeSystem.setVersion("1"); // -// CodeSystem codeSystem = myCodeSystemDao.read(myExtensionalCsId); -// ourLog.info("CodeSystem:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem)); +// IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified(); // -// ValueSet valueSet = myValueSetDao.read(myExtensionalVsId); -// ourLog.info("ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(valueSet)); +// Set codes = myTermSvc.findCodesBelow(id.getIdPartAsLong(), id.getVersionIdPartAsLong(), "A"); +// assertThat(toCodes(codes), containsInAnyOrder("A")); // -// myTermSvc.preExpandDeferredValueSetsToTerminologyTables(); +// codes = myTermSvc.findCodesBelow(id.getIdPartAsLong(), id.getVersionIdPartAsLong(), "B"); +// assertThat(toCodes(codes), containsInAnyOrder("B")); // -// IValidationSupport.CodeValidationResult result = myTermSvc.validateCodeIsInPreExpandedValueSet(optsNoGuess, valueSet, null, null, null, null, null); -// assertNull(result); +// runInTransaction(() -> { +// List termCodeSystemVersions = myTermCodeSystemVersionDao.findAll(); +// assertEquals(termCodeSystemVersions.size(), 1); +// TermCodeSystemVersion termCodeSystemVersion_1 = termCodeSystemVersions.get(0); +// assertEquals(termCodeSystemVersion_1.getConcepts().size(), 2); +// Set termConcepts = new HashSet<>(termCodeSystemVersion_1.getConcepts()); +// assertThat(toCodes(termConcepts), containsInAnyOrder("A", "B")); // +// TermCodeSystem termCodeSystem = myTermCodeSystemDao.findByResourcePid(id.getIdPartAsLong()); +// assertEquals("1", termCodeSystem.getCurrentVersion().getCodeSystemVersionId()); // -// result = myTermSvc.validateCodeIsInPreExpandedValueSet(optsNoGuess, valueSet, null, "BOGUS", null, null, null); -// assertFalse(result.isOk()); +// }); // -// result = myTermSvc.validateCodeIsInPreExpandedValueSet(optsNoGuess, valueSet, null, "11378-7", null, null, null); -// assertFalse(result.isOk()); +// codeSystem.setVersion("2"); +// codeSystem +// .addConcept().setCode("C").setDisplay("Code C"); // -// result = myTermSvc.validateCodeIsInPreExpandedValueSet(optsGuess, valueSet, null, "11378-7", null, null, null); -// assertTrue(result.isOk()); -// assertEquals("Systolic blood pressure at First encounter", result.getDisplay()); +// IIdType id_v2 = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified(); +// codes = myTermSvc.findCodesBelow(id_v2.getIdPartAsLong(), id_v2.getVersionIdPartAsLong(), "C"); +// assertThat(toCodes(codes), containsInAnyOrder("C")); // -// result = myTermSvc.validateCodeIsInPreExpandedValueSet(optsGuess, valueSet, null, "11378-7", "Systolic blood pressure at First encounter", null, null); -// assertTrue(result.isOk()); -// assertEquals("Systolic blood pressure at First encounter", result.getDisplay()); +// runInTransaction(() -> { +// List termCodeSystemVersions_updated = myTermCodeSystemVersionDao.findAll(); +// assertEquals(termCodeSystemVersions_updated.size(), 2); +// TermCodeSystemVersion termCodeSystemVersion_2 = termCodeSystemVersions_updated.get(1); +// assertEquals(termCodeSystemVersion_2.getConcepts().size(), 3); +// Set termConcepts_updated = new HashSet<>(termCodeSystemVersion_2.getConcepts()); +// assertThat(toCodes(termConcepts_updated), containsInAnyOrder("A", "B", "C")); // -// result = myTermSvc.validateCodeIsInPreExpandedValueSet(optsNoGuess, valueSet, "http://acme.org", "11378-7", null, null, null); -// assertTrue(result.isOk()); -// assertEquals("Systolic blood pressure at First encounter", result.getDisplay()); -// -// Coding coding = new Coding("http://acme.org", "11378-7", "Systolic blood pressure at First encounter"); -// result = myTermSvc.validateCodeIsInPreExpandedValueSet(optsNoGuess, valueSet, null, null, null, coding, null); -// assertTrue(result.isOk()); -// assertEquals("Systolic blood pressure at First encounter", result.getDisplay()); -// -// CodeableConcept codeableConcept = new CodeableConcept(); -// codeableConcept.addCoding(new Coding("BOGUS", "BOGUS", "BOGUS")); -// codeableConcept.addCoding(coding); -// result = myTermSvc.validateCodeIsInPreExpandedValueSet(optsNoGuess, valueSet, null, null, null, null, codeableConcept); -// assertTrue(result.isOk()); -// assertEquals("Systolic blood pressure at First encounter", result.getDisplay()); +// TermCodeSystem termCodeSystem = myTermCodeSystemDao.findByResourcePid(id_v2.getIdPartAsLong()); +// assertEquals("2", termCodeSystem.getCurrentVersion().getCodeSystemVersionId()); +// }); // } - @Test - public void testCreateCodeSystemTwoVersions() { - CodeSystem codeSystem = new CodeSystem(); - codeSystem.setUrl(CS_URL); - codeSystem.setContent(CodeSystem.CodeSystemContentMode.COMPLETE); - codeSystem - .addConcept().setCode("A").setDisplay("Code A"); - codeSystem - .addConcept().setCode("B").setDisplay("Code A"); - - codeSystem.setVersion("1"); - - IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified(); - - Set codes = myTermSvc.findCodesBelow(id.getIdPartAsLong(), id.getVersionIdPartAsLong(), "A"); - assertThat(toCodes(codes), containsInAnyOrder("A")); - - codes = myTermSvc.findCodesBelow(id.getIdPartAsLong(), id.getVersionIdPartAsLong(), "B"); - assertThat(toCodes(codes), containsInAnyOrder("B")); - - runInTransaction(() -> { - List termCodeSystemVersions = myTermCodeSystemVersionDao.findAll(); - assertEquals(termCodeSystemVersions.size(), 1); - TermCodeSystemVersion termCodeSystemVersion_1 = termCodeSystemVersions.get(0); - assertEquals(termCodeSystemVersion_1.getConcepts().size(), 2); - Set termConcepts = new HashSet<>(termCodeSystemVersion_1.getConcepts()); - assertThat(toCodes(termConcepts), containsInAnyOrder("A", "B")); - - TermCodeSystem termCodeSystem = myTermCodeSystemDao.findByResourcePid(id.getIdPartAsLong()); - assertEquals("1", termCodeSystem.getCurrentVersion().getCodeSystemVersionId()); - - }); - - codeSystem.setVersion("2"); - codeSystem - .addConcept().setCode("C").setDisplay("Code C"); - - IIdType id_v2 = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified(); - codes = myTermSvc.findCodesBelow(id_v2.getIdPartAsLong(), id_v2.getVersionIdPartAsLong(), "C"); - assertThat(toCodes(codes), containsInAnyOrder("C")); - - runInTransaction(() -> { - List termCodeSystemVersions_updated = myTermCodeSystemVersionDao.findAll(); - assertEquals(termCodeSystemVersions_updated.size(), 2); - TermCodeSystemVersion termCodeSystemVersion_2 = termCodeSystemVersions_updated.get(1); - assertEquals(termCodeSystemVersion_2.getConcepts().size(), 3); - Set termConcepts_updated = new HashSet<>(termCodeSystemVersion_2.getConcepts()); - assertThat(toCodes(termConcepts_updated), containsInAnyOrder("A", "B", "C")); - - TermCodeSystem termCodeSystem = myTermCodeSystemDao.findByResourcePid(id_v2.getIdPartAsLong()); - assertEquals("2", termCodeSystem.getCurrentVersion().getCodeSystemVersionId()); - }); - } - diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/ZipCollectionBuilder.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/ZipCollectionBuilder.java index 026bd396e7d..1b887b37234 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/ZipCollectionBuilder.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/ZipCollectionBuilder.java @@ -13,11 +13,15 @@ import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; +import java.util.Properties; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; public class ZipCollectionBuilder { + public static final String ZIP_ENTRY_PREFIX = "SnomedCT_Release_INT_20160131_Full/Terminology/"; + + private static final Logger ourLog = LoggerFactory.getLogger(ZipCollectionBuilder.class); private final ArrayList myFiles; @@ -58,7 +62,7 @@ public class ZipCollectionBuilder { bos = new ByteArrayOutputStream(); ZipOutputStream zos = new ZipOutputStream(bos); ourLog.info("Adding {} to test zip", theClasspathFileName); - zos.putNextEntry(new ZipEntry("SnomedCT_Release_INT_20160131_Full/Terminology/" + theOutputFilename)); + zos.putNextEntry(new ZipEntry(ZIP_ENTRY_PREFIX + theOutputFilename)); zos.write(readFile(theClasspathPrefix, theClasspathFileName)); zos.closeEntry(); zos.close(); @@ -76,6 +80,36 @@ public class ZipCollectionBuilder { }); } + public void addPropertiesZip(Properties properties, String theOutputFilename) throws IOException { + + ByteArrayOutputStream bos; + bos = new ByteArrayOutputStream(); + ZipOutputStream zos = new ZipOutputStream(bos); + ourLog.info("Adding properties to test zip"); + zos.putNextEntry(new ZipEntry(ZIP_ENTRY_PREFIX + theOutputFilename)); + zos.write(getPropertiesBytes(properties)); + zos.closeEntry(); + zos.close(); + ourLog.info("ZIP file has {} bytes", bos.toByteArray().length); + myFiles.add(new ITermLoaderSvc.FileDescriptor() { + @Override + public String getFilename() { + return "AAA.zip"; + } + + @Override + public InputStream getInputStream() { + return new ByteArrayInputStream(bos.toByteArray()); + } + }); + } + + private byte[] getPropertiesBytes(Properties theProperties) throws IOException { + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + theProperties.store(byteArrayOutputStream, ""); + return byteArrayOutputStream.toByteArray(); + } + private byte[] readFile(String theClasspathPrefix, String theClasspathFileName) throws IOException { String classpathName = theClasspathPrefix + theClasspathFileName; InputStream stream = getClass().getResourceAsStream(classpathName); diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/loincupload.properties b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/loincupload.properties new file mode 100644 index 00000000000..3d36353cec0 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/loincupload.properties @@ -0,0 +1,93 @@ +################# +### MANDATORY ### +################# + +# Answer lists (ValueSets of potential answers/values for LOINC "questions") +## File must be present +loinc.answerlist.file=AccessoryFiles/AnswerFile/AnswerList.csv +# Answer list links (connects LOINC observation codes to answer list codes) +## File must be present +loinc.answerlist.link.file=AccessoryFiles/AnswerFile/LoincAnswerListLink.csv + +# Document ontology +## File must be present +loinc.document.ontology.file=AccessoryFiles/DocumentOntology/DocumentOntology.csv + +# LOINC codes +## File must be present +loinc.file=LoincTable/Loinc.csv + +# LOINC hierarchy +## File must be present +loinc.hierarchy.file=AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv + +# IEEE medical device codes +## File must be present +loinc.ieee.medical.device.code.mapping.table.file=AccessoryFiles/LoincIeeeMedicalDeviceCodeMappingTable/LoincIeeeMedicalDeviceCodeMappingTable.csv + +# Imaging document codes +## File must be present +loinc.imaging.document.codes.file=AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv + +# Part +## File must be present +loinc.part.file=AccessoryFiles/PartFile/Part.csv + +# Part link +## File must be present +loinc.part.link.primary.file=AccessoryFiles/PartFile/LoincPartLink_Primary.csv +loinc.part.link.supplementary.file=AccessoryFiles/PartFile/LoincPartLink_Supplementary.csv + +# Part related code mapping +## File must be present +loinc.part.related.code.mapping.file=AccessoryFiles/PartFile/PartRelatedCodeMapping.csv + +# RSNA playbook +## File must be present +loinc.rsna.playbook.file=AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv + +# Top 2000 codes - SI +## File must be present +loinc.top2000.common.lab.results.si.file=AccessoryFiles/Top2000Results/SI/Top2000CommonLabResultsSi.csv +# Top 2000 codes - US +## File must be present +loinc.top2000.common.lab.results.us.file=AccessoryFiles/Top2000Results/US/Top2000CommonLabResultsUs.csv + +# Universal lab order ValueSet +## File must be present +loinc.universal.lab.order.valueset.file=AccessoryFiles/LoincUniversalLabOrdersValueSet/LoincUniversalLabOrdersValueSet.csv + +################ +### OPTIONAL ### +################ + +# This is the version identifier for the answer list file +## Key may be omitted +loinc.answerlist.version=Beta.1 + +# This is the version identifier for uploaded ConceptMap resources +## Key may be omitted +loinc.conceptmap.version=Beta.1 + +# Group +## Default value if key not provided: AccessoryFiles/GroupFile/Group.csv +## File may be omitted +loinc.group.file=AccessoryFiles/GroupFile/Group.csv +# Group terms +## Default value if key not provided: AccessoryFiles/GroupFile/GroupLoincTerms.csv +## File may be omitted +loinc.group.terms.file=AccessoryFiles/GroupFile/GroupLoincTerms.csv +# Parent group +## Default value if key not provided: AccessoryFiles/GroupFile/ParentGroup.csv +## File may be omitted +loinc.parent.group.file=AccessoryFiles/GroupFile/ParentGroup.csv + +# Consumer Names +## Default value if key not provided: AccessoryFiles/ConsumerName/ConsumerName.csv +## File may be omitted +loinc.consumer.name.file=AccessoryFiles/ConsumerName/ConsumerName.csv + +# Linguistic Variants +## Default value if key not provided: AccessoryFiles/LinguisticVariants/LinguisticVariants.csv +## File may be omitted +loinc.linguistic.variants.file=AccessoryFiles/LinguisticVariants/LinguisticVariants.csv \ No newline at end of file diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/loincupload_singlepartlink.properties b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/loincupload_singlepartlink.properties new file mode 100644 index 00000000000..3164f533888 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/loincupload_singlepartlink.properties @@ -0,0 +1,82 @@ +################# +### MANDATORY ### +################# + +# Answer lists (ValueSets of potential answers/values for LOINC "questions") +## File must be present +loinc.answerlist.file=AccessoryFiles/AnswerFile/AnswerList.csv +# Answer list links (connects LOINC observation codes to answer list codes) +## File must be present +loinc.answerlist.link.file=AccessoryFiles/AnswerFile/LoincAnswerListLink.csv + +# Document ontology +## File must be present +loinc.document.ontology.file=AccessoryFiles/DocumentOntology/DocumentOntology.csv + +# LOINC codes +## File must be present +loinc.file=LoincTable/Loinc.csv + +# LOINC hierarchy +## File must be present +loinc.hierarchy.file=AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv + +# IEEE medical device codes +## File must be present +loinc.ieee.medical.device.code.mapping.table.file=AccessoryFiles/LoincIeeeMedicalDeviceCodeMappingTable/LoincIeeeMedicalDeviceCodeMappingTable.csv + +# Imaging document codes +## File must be present +loinc.imaging.document.codes.file=AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv + +# Part +## File must be present +loinc.part.file=AccessoryFiles/PartFile/Part.csv + +# Part link +## File must be present +loinc.part.link.file=AccessoryFiles/PartFile/LoincPartLink.csv + +# Part related code mapping +## File must be present +loinc.part.related.code.mapping.file=AccessoryFiles/PartFile/PartRelatedCodeMapping.csv + +# RSNA playbook +## File must be present +loinc.rsna.playbook.file=AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv + +# Top 2000 codes - SI +## File must be present +loinc.top2000.common.lab.results.si.file=AccessoryFiles/Top2000Results/SI/Top2000CommonLabResultsSi.csv +# Top 2000 codes - US +## File must be present +loinc.top2000.common.lab.results.us.file=AccessoryFiles/Top2000Results/US/Top2000CommonLabResultsUs.csv + +# Universal lab order ValueSet +## File must be present +loinc.universal.lab.order.valueset.file=AccessoryFiles/LoincUniversalLabOrdersValueSet/LoincUniversalLabOrdersValueSet.csv + +################ +### OPTIONAL ### +################ + +# This is the version identifier for the answer list file +## Key may be omitted +loinc.answerlist.version=Beta.1 + +# This is the version identifier for uploaded ConceptMap resources +## Key may be omitted +loinc.conceptmap.version=Beta.1 + +# Group +## Default value if key not provided: AccessoryFiles/GroupFile/Group.csv +## File may be omitted +loinc.group.file=AccessoryFiles/GroupFile/Group.csv +# Group terms +## Default value if key not provided: AccessoryFiles/GroupFile/GroupLoincTerms.csv +## File may be omitted +loinc.group.terms.file=AccessoryFiles/GroupFile/GroupLoincTerms.csv +# Parent group +## Default value if key not provided: AccessoryFiles/GroupFile/ParentGroup.csv +## File may be omitted +loinc.parent.group.file=AccessoryFiles/GroupFile/ParentGroup.csv diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/AnswerFile/AnswerList.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/AnswerFile/AnswerList.csv new file mode 100644 index 00000000000..a448cf80f2d --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/AnswerFile/AnswerList.csv @@ -0,0 +1,12 @@ +"AnswerListId","AnswerListName" ,"AnswerListOID" ,"ExtDefinedYN","ExtDefinedAnswerListCodeSystem","ExtDefinedAnswerListLink" ,"AnswerStringId","LocalAnswerCode","LocalAnswerCodeSystem","SequenceNumber","DisplayText" ,"ExtCodeId","ExtCodeDisplayName" ,"ExtCodeSystem" ,"ExtCodeSystemVersion" ,"ExtCodeSystemCopyrightNotice" ,"SubsequentTextPrompt","Description","Score" +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"1 slice or 1 dinner roll" , , , , , , , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"2 slices or 2 dinner rolls" , , , , , , , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"More than 2 slices or 2 dinner rolls", , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"Never" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"1-3 times per month" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"1-2 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"3-4 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"5-6 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"1 time per day" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , +"LL1892-0" ,"ICD-9_ICD-10" ,"1.3.6.1.4.1.12009.10.1.1069","Y" , ,"http://www.cdc.gov/nchs/icd.htm", , , , , , , , , , , , , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/AnswerFile/LoincAnswerListLink.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/AnswerFile/LoincAnswerListLink.csv new file mode 100644 index 00000000000..820602c77ad --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/AnswerFile/LoincAnswerListLink.csv @@ -0,0 +1,11 @@ +"LoincNumber","LongCommonName" ,"AnswerListId","AnswerListName" ,"AnswerListLinkType","ApplicableContext" +"61438-8" ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]","LL1000-0" ,"PhenX05_13_30D bread amt","NORMATIVE" , +"10061-0" ,"S' wave amplitude in lead I" ,"LL1311-1" ,"PhenX12_44" ,"EXAMPLE" , +"10331-7" ,"Rh [Type] in Blood" ,"LL360-9" ,"Pos|Neg" ,"EXAMPLE" , +"10389-5" ,"Blood product.other [Type]" ,"LL2413-4" ,"Othr bld prod" ,"EXAMPLE" , +"10390-3" ,"Blood product special preparation [Type]" ,"LL2422-5" ,"Blood prod treatment" ,"EXAMPLE" , +"10393-7" ,"Factor IX given [Type]" ,"LL2420-9" ,"Human/Recomb" ,"EXAMPLE" , +"10395-2" ,"Factor VIII given [Type]" ,"LL2420-9" ,"Human/Recomb" ,"EXAMPLE" , +"10401-8" ,"Immune serum globulin given [Type]" ,"LL2421-7" ,"IM/IV" ,"EXAMPLE" , +"10410-9" ,"Plasma given [Type]" ,"LL2417-5" ,"Plasma type" ,"EXAMPLE" , +"10568-4" ,"Clarity of Semen" ,"LL2427-4" ,"Clear/Opales/Milky" ,"EXAMPLE" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/ConsumerName/ConsumerName.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/ConsumerName/ConsumerName.csv new file mode 100644 index 00000000000..b4ec2907985 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/ConsumerName/ConsumerName.csv @@ -0,0 +1,6 @@ +"LoincNumber","ConsumerName" +"61438-8","Consumer Name 61438-8" +,"Consumer Name X" +47239-9","" +"17787-3","Consumer Name 17787-3" +"38699-5","1,1-Dichloroethane, Air" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/DocumentOntology/DocumentOntology.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/DocumentOntology/DocumentOntology.csv new file mode 100644 index 00000000000..f857d7f297b --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/DocumentOntology/DocumentOntology.csv @@ -0,0 +1,10 @@ +"LoincNumber","PartNumber","PartTypeName","PartSequenceOrder","PartName" +"11488-4","LP173418-7","Document.Kind","1","Note" +"11488-4","LP173110-0","Document.TypeOfService","1","Consultation" +"11488-4","LP173061-5","Document.Setting","1","{Setting}" +"11488-4","LP187187-2","Document.Role","1","{Role}" +"11490-0","LP173418-7","Document.Kind","1","Note" +"11490-0","LP173221-5","Document.TypeOfService","1","Discharge summary" +"11490-0","LP173061-5","Document.Setting","1","{Setting}" +"11490-0","LP173084-7","Document.Role","1","Physician" +"11492-6","LP173418-7","Document.Kind","1","Note" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/GroupFile/Group.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/GroupFile/Group.csv new file mode 100644 index 00000000000..66f5561ea1c --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/GroupFile/Group.csv @@ -0,0 +1,2 @@ +"ParentGroupId","GroupId","Group","Archetype","Status","VersionFirstReleased" +"LG100-4","LG1695-8","1,4-Dichlorobenzene|MCnc|Pt|ANYBldSerPl","","Active","" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/GroupFile/GroupLoincTerms.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/GroupFile/GroupLoincTerms.csv new file mode 100644 index 00000000000..04c19759cfb --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/GroupFile/GroupLoincTerms.csv @@ -0,0 +1,3 @@ +"Category","GroupId","Archetype","LoincNumber","LongCommonName" +"Flowsheet","LG1695-8","","17424-3","1,4-Dichlorobenzene [Mass/volume] in Blood" +"Flowsheet","LG1695-8","","13006-2","1,4-Dichlorobenzene [Mass/volume] in Serum or Plasma" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/GroupFile/ParentGroup.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/GroupFile/ParentGroup.csv new file mode 100644 index 00000000000..734a86c43dd --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/GroupFile/ParentGroup.csv @@ -0,0 +1,2 @@ +"ParentGroupId","ParentGroup","Status" +"LG100-4","Chem_DrugTox_Chal_Sero_Allergy","ACTIVE" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv new file mode 100644 index 00000000000..a26397639ff --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv @@ -0,0 +1,10 @@ +"LOINC_NUM","LONG_COMMON_NAME" +"11525-3","US Pelvis Fetus for pregnancy" +"17787-3","NM Thyroid gland Study report" +"18744-3","Bronchoscopy study" +"18746-8","Colonoscopy study" +"18748-4","Diagnostic imaging study" +"18751-8","Endoscopy study" +"18753-4","Flexible sigmoidoscopy study" +"24531-6","US Retroperitoneum" +"24532-4","US Abdomen RUQ" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LinguisticVariants/LinguisticVariants.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LinguisticVariants/LinguisticVariants.csv new file mode 100644 index 00000000000..c79b3197490 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LinguisticVariants/LinguisticVariants.csv @@ -0,0 +1,9 @@ +"ID","ISO_LANGUAGE","ISO_COUNTRY","LANGUAGE_NAME","PRODUCER" +"5","zh","CN","Chinese (CHINA)","Lin Zhang, A LOINC volunteer from China" +"7","es","AR","Spanish (ARGENTINA)","Conceptum Medical Terminology Center" +"8","fr","CA","French (CANADA)","Canada Health Infoway Inc." +,"de","AT","German (AUSTRIA)","ELGA, Austria" +"88",,"AT","German (AUSTRIA)","ELGA, Austria" +"89","de",,"German (AUSTRIA)","ELGA, Austria" +"90","de","AT",,"ELGA, Austria" +"24","de","AT","German (AUSTRIA)","ELGA, Austria" \ No newline at end of file diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LinguisticVariants/deAT24LinguisticVariant.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LinguisticVariants/deAT24LinguisticVariant.csv new file mode 100644 index 00000000000..c6882d47504 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LinguisticVariants/deAT24LinguisticVariant.csv @@ -0,0 +1,4 @@ +"LOINC_NUM","COMPONENT","PROPERTY","TIME_ASPCT","SYSTEM","SCALE_TYP","METHOD_TYP","CLASS","SHORTNAME","LONG_COMMON_NAME","RELATEDNAMES2","LinguisticVariantDisplayName" +"61438-8","Entlassungsbrief Ärztlich","Ergebnis","Zeitpunkt","{Setting}","Dokument","Dermatologie","DOC.ONTOLOGY","de shortname","de long common name","de related names 2","de linguistic variant display name" +"43730-1","","","","","","","","","","EBV-DNA qn. PCR","EBV-DNA quantitativ PCR" +"17787-3","","","","","","","","","","CoV OC43 RNA ql/SM P","Coronavirus OC43 RNA ql. /Sondermaterial PCR" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LinguisticVariants/frCA8LinguisticVariant.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LinguisticVariants/frCA8LinguisticVariant.csv new file mode 100644 index 00000000000..fa09e0cb242 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LinguisticVariants/frCA8LinguisticVariant.csv @@ -0,0 +1,6 @@ +"LOINC_NUM","COMPONENT","PROPERTY","TIME_ASPCT","SYSTEM","SCALE_TYP","METHOD_TYP","CLASS","SHORTNAME","LONG_COMMON_NAME","RELATEDNAMES2","LinguisticVariantDisplayName" +"61438-8","Cellules de Purkinje cytoplasmique type 2 , IgG","Titre","Temps ponctuel","Sérum","Quantitatif","Immunofluorescence","Sérologie","","","","" +"11704-4","Gliale nucléaire de type 1 , IgG","Titre","Temps ponctuel","LCR","Quantitatif","Immunofluorescence","Sérologie","","","","" +,"Cellules de Purkinje cytoplasmique type 2 , IgG","Titre","Temps ponctuel","Sérum","Quantitatif",,,"","","","" +"17787-3","Virus respiratoire syncytial bovin","Présence-Seuil","Temps ponctuel","XXX","Ordinal","Culture spécifique à un microorganisme","Microbiologie","","","","" +"17788-1","Cellules de Purkinje cytoplasmique type 2 , IgG","Titre","Temps ponctuel","Sérum","Quantitatif",,,"","","","" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LinguisticVariants/zhCN5LinguisticVariant.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LinguisticVariants/zhCN5LinguisticVariant.csv new file mode 100644 index 00000000000..48d07d9fdc3 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LinguisticVariants/zhCN5LinguisticVariant.csv @@ -0,0 +1,9 @@ +"LOINC_NUM","COMPONENT","PROPERTY","TIME_ASPCT","SYSTEM","SCALE_TYP","METHOD_TYP","CLASS","SHORTNAME","LONG_COMMON_NAME","RELATEDNAMES2","LinguisticVariantDisplayName" +"61438-8","血流速度.收缩期.最大值","速度","时间点","大脑中动脉","定量型","超声.多普勒","产科学检查与测量指标.超声","","","Cereb 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 大脑(Cerebral) 时刻;随机;随意;瞬间 术语""cerebral""指的是主要由中枢半球(大脑皮质和基底神经节)组成的那部分脑结构 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"11704-4","血流速度.收缩期.最大值","速度","时间点","动脉导管","定量型","超声.多普勒","产科学检查与测量指标.超声","","","动态 动脉管 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 时刻;随机;随意;瞬间 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"17787-3","血流速度.收缩期.最大值","速度","时间点","二尖瓣^胎儿","定量型","超声.多普勒","产科学检查与测量指标.超声","","","僧帽瓣 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 时刻;随机;随意;瞬间 流 流量;流速;流体 胎;超系统 - 胎儿 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"61438-6",,"速度","时间点","二尖瓣^胎儿","定量型","超声.多普勒","产科学检查与测量指标.超声","","","僧帽瓣 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 时刻;随机;随意;瞬间 流 流量;流速;流体 胎;超系统 - 胎儿 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"10000-8","血流速度.收缩期.最大值",,"时间点","二尖瓣^胎儿","定量型","超声.多普勒","产科学检查与测量指标.超声","","","僧帽瓣 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 时刻;随机;随意;瞬间 流 流量;流速;流体 胎;超系统 - 胎儿 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"17788-1","血流速度.收缩期.最大值","速度",,"大脑中动脉","定量型","超声.多普勒","产科学检查与测量指标.超声","","","Cereb 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 大脑(Cerebral) 时刻;随机;随意;瞬间 术语""cerebral""指的是主要由中枢半球(大脑皮质和基底神经节)组成的那部分脑结构 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"11488-4","血流速度.收缩期.最大值","速度","时间点",,"定量型","超声.多普勒","产科学检查与测量指标.超声","","","Cereb 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 大脑(Cerebral) 时刻;随机;随意;瞬间 术语""cerebral""指的是主要由中枢半球(大脑皮质和基底神经节)组成的那部分脑结构 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"47239-9","血流速度.收缩期.最大值","速度","时间点","大脑中动脉",,"超声.多普勒","产科学检查与测量指标.超声","","","Cereb 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 大脑(Cerebral) 时刻;随机;随意;瞬间 术语""cerebral""指的是主要由中枢半球(大脑皮质和基底神经节)组成的那部分脑结构 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LoincIeeeMedicalDeviceCodeMappingTable/LoincIeeeMedicalDeviceCodeMappingTable.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LoincIeeeMedicalDeviceCodeMappingTable/LoincIeeeMedicalDeviceCodeMappingTable.csv new file mode 100644 index 00000000000..d8cf83cd09e --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LoincIeeeMedicalDeviceCodeMappingTable/LoincIeeeMedicalDeviceCodeMappingTable.csv @@ -0,0 +1,10 @@ +LOINC_NUM,LOINC_LONG_COMMON_NAME,IEEE_CF_CODE10,IEEE_REFID,IEEE_DESCRIPTION,IEEE_DIM,IEEE_UOM_UCUM +11556-8,Oxygen [Partial pressure] in Blood,160116,MDC_CONC_PO2_GEN,,LMT-2L-2 LMT-2L-2,kPa mm[Hg] +11557-6,Carbon dioxide [Partial pressure] in Blood,160064,MDC_CONC_PCO2_GEN,,LMT-2L-2 LMT-2L-2,kPa mm[Hg] +11558-4,pH of Blood,160004,MDC_CONC_PH_GEN,,[pH],[pH] +12961-9,Urea nitrogen [Mass/volume] in Arterial blood,160080,MDC_CONC_UREA_ART,,ML-3 NL-3,mg/dL mmol/L +14749-6,Glucose [Moles/volume] in Serum or Plasma,160196,MDC_CONC_GLU_VENOUS_PLASMA,Plasma glucose concentration taken from venous,NL-3 ,mmol/L +14749-6,Glucose [Moles/volume] in Serum or Plasma,160368,MDC_CONC_GLU_UNDETERMINED_PLASMA,Plasma glucose concentration taken from undetermined sample source,NL-3 ,mmol/L +15074-8,Glucose [Moles/volume] in Blood,160020,MDC_CONC_GLU_GEN,,NL-3,mmol/L +15074-8,Glucose [Moles/volume] in Blood,160364,MDC_CONC_GLU_UNDETERMINED_WHOLEBLOOD,Whole blood glucose concentration taken from undetermined sample source,NL-3 ,mmol/L +17861-6,Calcium [Mass/volume] in Serum or Plasma,160024,MDC_CONC_CA_GEN,,ML-3,mg/dL diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv new file mode 100644 index 00000000000..1acba586623 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv @@ -0,0 +1,10 @@ +"LoincNumber","LongCommonName" ,"PartNumber","PartTypeName" ,"PartName" ,"PartSequenceOrder","RID" ,"PreferredName" ,"RPID" ,"LongName" +"17787-3" ,"NM Thyroid gland Study report","LP199995-4","Rad.Anatomic Location.Region Imaged","Neck" ,"A" ,"RID7488" ,"neck" ,"" ,"" +"17787-3" ,"NM Thyroid gland Study report","LP206648-0","Rad.Anatomic Location.Imaging Focus","Thyroid gland" ,"A" ,"RID7578" ,"thyroid gland" ,"" ,"" +"17787-3" ,"NM Thyroid gland Study report","LP208891-4","Rad.Modality.Modality type" ,"NM" ,"A" ,"RID10330","nuclear medicine imaging","" ,"" +"24531-6" ,"US Retroperitoneum" ,"LP207608-3","Rad.Modality.Modality type" ,"US" ,"A" ,"RID10326","Ultrasound" ,"RPID2142","US Retroperitoneum" +"24531-6" ,"US Retroperitoneum" ,"LP199943-4","Rad.Anatomic Location.Imaging Focus","Retroperitoneum" ,"A" ,"RID431" ,"RETROPERITONEUM" ,"RPID2142","US Retroperitoneum" +"24531-6" ,"US Retroperitoneum" ,"LP199956-6","Rad.Anatomic Location.Region Imaged","Abdomen" ,"A" ,"RID56" ,"Abdomen" ,"RPID2142","US Retroperitoneum" +"24532-4" ,"US Abdomen RUQ" ,"LP199956-6","Rad.Anatomic Location.Region Imaged","Abdomen" ,"A" ,"RID56" ,"Abdomen" ,"" ,"" +"24532-4" ,"US Abdomen RUQ" ,"LP207608-3","Rad.Modality.Modality type" ,"US" ,"A" ,"RID10326","Ultrasound" ,"" ,"" +"24532-4" ,"US Abdomen RUQ" ,"LP208105-9","Rad.Anatomic Location.Imaging Focus","Right upper quadrant","A" ,"RID29994","Right upper quadrant" ,"" ,"" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LoincUniversalLabOrdersValueSet/LoincUniversalLabOrdersValueSet.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LoincUniversalLabOrdersValueSet/LoincUniversalLabOrdersValueSet.csv new file mode 100644 index 00000000000..72d95485a58 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/LoincUniversalLabOrdersValueSet/LoincUniversalLabOrdersValueSet.csv @@ -0,0 +1,10 @@ +"LOINC_NUM","LONG_COMMON_NAME","ORDER_OBS" +"42176-8","1,3 beta glucan [Mass/volume] in Serum","Both" +"53835-5","1,5-Anhydroglucitol [Mass/volume] in Serum or Plasma","Both" +"31019-3","10-Hydroxycarbazepine [Mass/volume] in Serum or Plasma","Both" +"6765-2","17-Hydroxypregnenolone [Mass/volume] in Serum or Plasma","Both" +"1668-3","17-Hydroxyprogesterone [Mass/volume] in Serum or Plasma","Both" +"32854-2","17-Hydroxyprogesterone [Presence] in DBS","Both" +"49054-0","25-Hydroxycalciferol [Mass/volume] in Serum or Plasma","Both" +"62292-8","25-Hydroxyvitamin D2+25-Hydroxyvitamin D3 [Mass/volume] in Serum or Plasma","Both" +"44907-4","5-Hydroxyindoleacetate panel - 24 hour Urine","Order" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv new file mode 100644 index 00000000000..527b8fd5cae --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv @@ -0,0 +1,10 @@ +PATH_TO_ROOT,SEQUENCE,IMMEDIATE_PARENT,CODE,CODE_TEXT +,1,,LP31755-9,Microbiology +LP31755-9,1,LP31755-9,LP14559-6,Microorganism +LP31755-9.LP14559-6,1,LP14559-6,LP98185-9,Bacteria +LP31755-9.LP14559-6.LP98185-9,1,LP98185-9,LP14082-9,Bacteria +LP31755-9.LP14559-6.LP98185-9.LP14082-9,1,LP14082-9,LP52258-8,Bacteria | Body Fluid +LP31755-9.LP14559-6.LP98185-9.LP14082-9.LP52258-8,1,LP52258-8,41599-2,Bacteria Fld Ql Micro +LP31755-9.LP14559-6.LP98185-9.LP14082-9,2,LP14082-9,LP52260-4,Bacteria | Cerebral spinal fluid +LP31755-9.LP14559-6.LP98185-9.LP14082-9.LP52260-4,1,LP52260-4,41602-4,Bacteria CSF Ql Micro +LP31755-9.LP14559-6.LP98185-9.LP14082-9,3,LP14082-9,LP52960-9,Bacteria | Cervix diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PanelsAndForms/AnswerList.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PanelsAndForms/AnswerList.csv new file mode 100644 index 00000000000..a448cf80f2d --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PanelsAndForms/AnswerList.csv @@ -0,0 +1,12 @@ +"AnswerListId","AnswerListName" ,"AnswerListOID" ,"ExtDefinedYN","ExtDefinedAnswerListCodeSystem","ExtDefinedAnswerListLink" ,"AnswerStringId","LocalAnswerCode","LocalAnswerCodeSystem","SequenceNumber","DisplayText" ,"ExtCodeId","ExtCodeDisplayName" ,"ExtCodeSystem" ,"ExtCodeSystemVersion" ,"ExtCodeSystemCopyrightNotice" ,"SubsequentTextPrompt","Description","Score" +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"1 slice or 1 dinner roll" , , , , , , , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"2 slices or 2 dinner rolls" , , , , , , , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"More than 2 slices or 2 dinner rolls", , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"Never" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"1-3 times per month" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"1-2 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"3-4 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"5-6 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"1 time per day" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , +"LL1892-0" ,"ICD-9_ICD-10" ,"1.3.6.1.4.1.12009.10.1.1069","Y" , ,"http://www.cdc.gov/nchs/icd.htm", , , , , , , , , , , , , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PanelsAndForms/Loinc.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PanelsAndForms/Loinc.csv new file mode 100644 index 00000000000..20379cb7f1d --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PanelsAndForms/Loinc.csv @@ -0,0 +1,16 @@ +"LOINC_NUM","COMPONENT" ,"PROPERTY","TIME_ASPCT","SYSTEM" ,"SCALE_TYP","METHOD_TYP" ,"CLASS" ,"VersionLastChanged","CHNG_TYPE","DefinitionDescription" ,"STATUS","CONSUMER_NAME","CLASSTYPE","FORMULA","SPECIES","EXMPL_ANSWERS","SURVEY_QUEST_TEXT" ,"SURVEY_QUEST_SRC" ,"UNITSREQUIRED","SUBMITTED_UNITS","RELATEDNAMES2" ,"SHORTNAME" ,"ORDER_OBS" ,"CDISC_COMMON_TESTS","HL7_FIELD_SUBFIELD_ID","EXTERNAL_COPYRIGHT_NOTICE" ,"EXAMPLE_UNITS","LONG_COMMON_NAME" ,"UnitsAndRange","DOCUMENT_SECTION","EXAMPLE_UCUM_UNITS","EXAMPLE_SI_UCUM_UNITS","STATUS_REASON","STATUS_TEXT","CHANGE_REASON_PUBLIC" ,"COMMON_TEST_RANK","COMMON_ORDER_RANK","COMMON_SI_TEST_RANK","HL7_ATTACHMENT_STRUCTURE","EXTERNAL_COPYRIGHT_LINK","PanelType","AskAtOrderEntry","AssociatedObservations" ,"VersionFirstReleased","ValidHL7AttachmentRequest" +"10013-1" ,"R' wave amplitude.lead I" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-I; R wave Amp L-I; Random; Right; Voltage" ,"R' wave Amp L-I" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead I" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10014-9" ,"R' wave amplitude.lead II" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"2; Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-II; R wave Amp L-II; Random; Right; Voltage" ,"R' wave Amp L-II" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead II" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10015-6" ,"R' wave amplitude.lead III" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"3; Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-III; R wave Amp L-III; Random; Right; Voltage" ,"R' wave Amp L-III" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead III" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10016-4" ,"R' wave amplitude.lead V1" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V1; R wave Amp L-V1; Random; Right; Voltage" ,"R' wave Amp L-V1" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V1" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"1001-7" ,"DBG Ab" ,"Pr" ,"Pt" ,"Ser/Plas^donor" ,"Ord" , ,"BLDBK" ,"2.44" ,"MIN" , ,"ACTIVE", ,1 , , , , , , , ,"ABS; Aby; Antby; Anti; Antibodies; Antibody; Autoantibodies; Autoantibody; BLOOD BANK; Donna Bennett-Goodspeed; Donr; Ordinal; Pl; Plasma; Plsm; Point in time; QL; Qual; Qualitative; Random; Screen; SerP; SerPl; SerPl^donor; SerPlas; Serum; Serum or plasma; SR" ,"DBG Ab SerPl Donr Ql" ,"Observation", , , , ,"DBG Ab [Presence] in Serum or Plasma from donor" , , , , , , ,"The Property has been changed from ACnc to Pr (Presence) to reflect the new model for ordinal terms where results are based on presence or absence." ,0 ,0 ,0 , , , , , , , +"10017-2" ,"R' wave amplitude.lead V2" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V2; R wave Amp L-V2; Random; Right; Voltage" ,"R' wave Amp L-V2" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V2" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10018-0" ,"R' wave amplitude.lead V3" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V3; R wave Amp L-V3; Random; Right; Voltage" ,"R' wave Amp L-V3" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V3" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10019-8" ,"R' wave amplitude.lead V4" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V4; R wave Amp L-V4; Random; Right; Voltage" ,"R' wave Amp L-V4" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V4" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10020-6" ,"R' wave amplitude.lead V5" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V5; R wave Amp L-V5; Random; Right; Voltage" ,"R' wave Amp L-V5" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V5" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"61438-8" ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30D","Find" ,"Pt" ,"^Patient" ,"Ord" ,"PhenX" ,"PHENX" ,"2.44" ,"MIN" , ,"TRIAL" , ,2 , , , ,"Each time you eat bread, toast or dinner rolls, how much do you usually eat?","PhenX.050201100100","N" , ,"Finding; Findings; How much bread in 30D; Last; Ordinal; Point in time; QL; Qual; Qualitative; Random; Screen" ,"How much bread in 30D PhenX", , , , , ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]", , , , , , , ,0 ,0 ,0 , , , , , , , +"10000-8" ,"R wave duration.lead AVR" ,"Time" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; Durat; ECG; EKG.MEASUREMENTS; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave dur L-AVR; R wave dur L-AVR; Random; Right" ,"R wave dur L-AVR" ,"Observation", , , ,"s" ,"R wave duration in lead AVR" , , ,"s" , , , , ,0 ,0 ,0 , , , , , , , +"17787-3" ,"Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , +"17788-1" ,"Large unstained cells/100 leukocytes" ,"NFr" ,"Pt" ,"Bld" ,"Qn" ,"Automated count","HEM/BC" ,"2.50" ,"MIN" ,"Part of auto diff output of Bayer H*3S; peroxidase negative cells too large to be classified as lymph or basophil" ,"ACTIVE", ,1 , , , , , ,"Y" ,"%" ,"100WBC; Auto; Automated detection; Blood; Cell; Cellularity; Elec; Elect; Electr; HEMATOLOGY/CELL COUNTS; Leuc; Leuk; Leukocyte; Lkcs; LUC; Number Fraction; Percent; Point in time; QNT; Quan; Quant; Quantitative; Random; WB; WBC; WBCs; White blood cell; White blood cells; Whole blood" ,"LUC/leuk NFr Bld Auto" ,"Observation", , , ,"%" ,"Large unstained cells/100 leukocytes in Blood by Automated count" , , ,"%" , , , , ,1894 ,0 ,1894 , , , , , ,"1.0l" , +"11488-4" ,"Consultation note" ,"Find" ,"Pt" ,"{Setting}" ,"Doc" ,"{Role}" ,"DOC.ONTOLOGY","2.63" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Consult note; DOC.ONT; Document; Encounter; Evaluation and management; Evaluation and management note; Finding; Findings; notes; Point in time; Random; Visit note" ,"Consult note" ,"Both" , , , , ,"Consult note" , , , , , , ,"Edit made because this term is conformant to the Document Ontology axis values and therefore are being placed in this class.; Based on Clinical LOINC Committee decision during the September 2014 meeting, {Provider} was changed to {Author Type} to emphasize a greater breadth of potential document authors. At the September 2015 Clinical LOINC Committee meeting, the Committee decided to change {Author Type} to {Role} to align with the 'Role' axis name in the LOINC Document Ontology.; Because it is too difficult to maintain and because the distinction between documents and sections is not clear-cut nor necessary in most cases, the DOCUMENT_SECTION field has been deemed to have little value. The field has been set to null in the December 2017 release in preparation for removal in the December 2018 release. These changes were approved by the Clinical LOINC Committee.",0 ,0 ,0 ,"IG exists" , , , ,"81222-2;72231-4;81243-8","1.0j-a" ,"Y" +"47239-9" ,"Reason for stopping HIV Rx" ,"Type" ,"Pt" ,"^Patient" ,"Nom" ,"Reported" ,"ART" ,"2.50" ,"MIN" ,"Reason for stopping antiretroviral therapy" ,"ACTIVE", ,2 , , , , , ,"N" , ,"AIDS; Anti-retroviral therapy; ART; Human immunodeficiency virus; Nominal; Point in time; Random; Treatment; Typ" ,"Reason for stopping HIV Rx" ,"Observation", , ,"Copyright © 2006 World Health Organization. Used with permission. Publications of the World Health Organization can be obtained from WHO Press, World Health Organization, 20 Avenue Appia, 1211 Geneva 27, Switzerland (tel: +41 22 791 2476; fax: +41 22 791 4857; email: bookorders@who.int). Requests for permission to reproduce or translate WHO publications – whether for sale or for noncommercial distribution – should be addressed to WHO Press, at the above address (fax: +41 22 791 4806; email: permissions@who.int). The designations employed and the presentation of the material in this publication do not imply the expression of any opinion whatsoever on the part of the World Health Organization concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Dotted lines on maps represent approximate border lines for which there may not yet be full agreement. The mention of specific companies or of certain manufacturers’ products does not imply that they are endorsed or recommended by the World Health Organization in preference to others of a similar nature that are not mentioned. Errors and omissions excepted, the names of proprietary products are distinguished by initial capital letters. All reasonable precautions have been taken by WHO to verify the information contained in this publication. However, the published material is being distributed without warranty of any kind, either express or implied. The responsibility for the interpretation and use of the material lies with the reader. In no event shall the World Health Organization be liable for damages arising from its use.", ,"Reason for stopping HIV treatment" , , , , , , , ,0 ,0 ,0 , ,"WHO_HIV" , , , ,"2.22" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PanelsAndForms/LoincAnswerListLink.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PanelsAndForms/LoincAnswerListLink.csv new file mode 100644 index 00000000000..820602c77ad --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PanelsAndForms/LoincAnswerListLink.csv @@ -0,0 +1,11 @@ +"LoincNumber","LongCommonName" ,"AnswerListId","AnswerListName" ,"AnswerListLinkType","ApplicableContext" +"61438-8" ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]","LL1000-0" ,"PhenX05_13_30D bread amt","NORMATIVE" , +"10061-0" ,"S' wave amplitude in lead I" ,"LL1311-1" ,"PhenX12_44" ,"EXAMPLE" , +"10331-7" ,"Rh [Type] in Blood" ,"LL360-9" ,"Pos|Neg" ,"EXAMPLE" , +"10389-5" ,"Blood product.other [Type]" ,"LL2413-4" ,"Othr bld prod" ,"EXAMPLE" , +"10390-3" ,"Blood product special preparation [Type]" ,"LL2422-5" ,"Blood prod treatment" ,"EXAMPLE" , +"10393-7" ,"Factor IX given [Type]" ,"LL2420-9" ,"Human/Recomb" ,"EXAMPLE" , +"10395-2" ,"Factor VIII given [Type]" ,"LL2420-9" ,"Human/Recomb" ,"EXAMPLE" , +"10401-8" ,"Immune serum globulin given [Type]" ,"LL2421-7" ,"IM/IV" ,"EXAMPLE" , +"10410-9" ,"Plasma given [Type]" ,"LL2417-5" ,"Plasma type" ,"EXAMPLE" , +"10568-4" ,"Clarity of Semen" ,"LL2427-4" ,"Clear/Opales/Milky" ,"EXAMPLE" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/LoincPartLink.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/LoincPartLink.csv new file mode 100644 index 00000000000..36c84f3fe95 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/LoincPartLink.csv @@ -0,0 +1,10 @@ +"LoincNumber","LongCommonName","PartNumber","PartName","PartCodeSystem","PartTypeName","LinkTypeName","Property" +"10013-1","R' wave amplitude in lead I","LP31101-6","R' wave amplitude.lead I","http://loinc.org","COMPONENT","Primary","http://loinc.org/property/COMPONENT" +"10013-1","R' wave amplitude in lead I","LP6802-5","Elpot","http://loinc.org","PROPERTY","Primary","http://loinc.org/property/PROPERTY" +"10013-1","R' wave amplitude in lead I","LP6960-1","Pt","http://loinc.org","TIME","Primary","http://loinc.org/property/TIME_ASPCT" +"10013-1","R' wave amplitude in lead I","LP7289-4","Heart","http://loinc.org","SYSTEM","Primary","http://loinc.org/property/SYSTEM" +"10013-1","R' wave amplitude in lead I","LP7753-9","Qn","http://loinc.org","SCALE","Primary","http://loinc.org/property/SCALE_TYP" +"10013-1","R' wave amplitude in lead I","LP6244-0","EKG","http://loinc.org","METHOD","Primary","http://loinc.org/property/METHOD_TYP" +"10013-1","R' wave amplitude in lead I","LP31101-6","R' wave amplitude.lead I","http://loinc.org","COMPONENT","DetailedModel","http://loinc.org/property/analyte" +"10013-1","R' wave amplitude in lead I","LP6802-5","Elpot","http://loinc.org","PROPERTY","DetailedModel","http://loinc.org/property/PROPERTY" +"10013-1","R' wave amplitude in lead I","LP6960-1","Pt","http://loinc.org","TIME","DetailedModel","http://loinc.org/property/time-core" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/LoincPartLink_Primary.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/LoincPartLink_Primary.csv new file mode 100644 index 00000000000..8dbe575ffd2 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/LoincPartLink_Primary.csv @@ -0,0 +1,7 @@ +"LoincNumber","LongCommonName" ,"PartNumber","PartName" ,"PartCodeSystem" ,"PartTypeName","LinkTypeName","Property" +"10013-1" ,"R' wave amplitude in lead I","LP31101-6" ,"R' wave amplitude.lead I","http://loinc.org","COMPONENT" ,"Primary" ,"http://loinc.org/property/COMPONENT" +"10013-1" ,"R' wave amplitude in lead I","LP6802-5" ,"Elpot" ,"http://loinc.org","PROPERTY" ,"Primary" ,"http://loinc.org/property/PROPERTY" +"10013-1" ,"R' wave amplitude in lead I","LP6960-1" ,"Pt" ,"http://loinc.org","TIME" ,"Primary" ,"http://loinc.org/property/TIME_ASPCT" +"10013-1" ,"R' wave amplitude in lead I","LP7289-4" ,"Heart" ,"http://loinc.org","SYSTEM" ,"Primary" ,"http://loinc.org/property/SYSTEM" +"10013-1" ,"R' wave amplitude in lead I","LP7753-9" ,"Qn" ,"http://loinc.org","SCALE" ,"Primary" ,"http://loinc.org/property/SCALE_TYP" +"10013-1" ,"R' wave amplitude in lead I","LP6244-0" ,"EKG" ,"http://loinc.org","METHOD" ,"Primary" ,"http://loinc.org/property/METHOD_TYP" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/LoincPartLink_Supplementary.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/LoincPartLink_Supplementary.csv new file mode 100644 index 00000000000..869c2c1651d --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/LoincPartLink_Supplementary.csv @@ -0,0 +1,13 @@ +"LoincNumber","LongCommonName" ,"PartNumber","PartName" ,"PartCodeSystem" ,"PartTypeName","LinkTypeName" ,"Property" +"10013-1" ,"R' wave amplitude in lead I","LP31101-6" ,"R' wave amplitude.lead I","http://loinc.org","COMPONENT" ,"DetailedModel" ,"http://loinc.org/property/analyte" +"10013-1" ,"R' wave amplitude in lead I","LP6802-5" ,"Elpot" ,"http://loinc.org","PROPERTY" ,"DetailedModel" ,"http://loinc.org/property/PROPERTY" +"10013-1" ,"R' wave amplitude in lead I","LP6960-1" ,"Pt" ,"http://loinc.org","TIME" ,"DetailedModel" ,"http://loinc.org/property/time-core" +"10013-1" ,"R' wave amplitude in lead I","LP7289-4" ,"Heart" ,"http://loinc.org","SYSTEM" ,"DetailedModel" ,"http://loinc.org/property/system-core" +"10013-1" ,"R' wave amplitude in lead I","LP7753-9" ,"Qn" ,"http://loinc.org","SCALE" ,"DetailedModel" ,"http://loinc.org/property/SCALE_TYP" +"10013-1" ,"R' wave amplitude in lead I","LP6244-0" ,"EKG" ,"http://loinc.org","METHOD" ,"DetailedModel" ,"http://loinc.org/property/METHOD_TYP" +"10013-1" ,"R' wave amplitude in lead I","LP31101-6" ,"R' wave amplitude.lead I","http://loinc.org","COMPONENT" ,"SyntaxEnhancement","http://loinc.org/property/analyte-core" +"10013-1" ,"R' wave amplitude in lead I","LP190563-9","Cardiology" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/category" +"10013-1" ,"R' wave amplitude in lead I","LP29708-2" ,"Cardiology" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/category" +"10013-1" ,"R' wave amplitude in lead I","LP7787-7" ,"Clinical" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/category" +"10013-1" ,"R' wave amplitude in lead I","LP7795-0" ,"EKG measurements" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/category" +"10013-1" ,"R' wave amplitude in lead I","LP7795-0" ,"EKG.MEAS" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/CLASS" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/Part.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/Part.csv new file mode 100644 index 00000000000..d5816ead286 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/Part.csv @@ -0,0 +1,46 @@ +"PartNumber","PartTypeName","PartName","PartDisplayName","Status" +"LP101394-7","ADJUSTMENT","adjusted for maternal weight","adjusted for maternal weight","ACTIVE" +"LP101907-6","ADJUSTMENT","corrected for age","corrected for age","ACTIVE" +"LP115711-6","ADJUSTMENT","corrected for background","corrected for background","ACTIVE" +"LP147359-6","ADJUSTMENT","adjusted for body weight","adjusted for body weight","ACTIVE" +"LP173482-3","ADJUSTMENT","1st specimen","1st specimen","DEPRECATED" +"LP173483-1","ADJUSTMENT","post cyanocobalamin",,"ACTIVE" +"LP173484-9","ADJUSTMENT","W hyperextension)",,"ACTIVE" +"LP6244-0","METHOD","EKG","Electrocardiogram (EKG)","ACTIVE" +"LP18172-4","COMPONENT","Interferon.beta","Interferon beta","ACTIVE" +"LP7289-4","SYSTEM","Heart","Heart","ACTIVE" +"LP6960-1","TIME","Pt","Point in time (spot)","ACTIVE" +"LP6802-5","PROPERTY","Elpot","Electrical Potential (Voltage)","ACTIVE" +"LP7753-9","SCALE","Qn","Qn","ACTIVE" +"LP31101-6","COMPONENT","R' wave amplitude.lead I","R' wave amplitude.lead I","ACTIVE" +"LP31102-4","COMPONENT","R' wave amplitude.lead II","R' wave amplitude.lead II","ACTIVE" +"LP31103-2","COMPONENT","R' wave amplitude.lead III","R' wave amplitude.lead III","ACTIVE" +"LP31104-0","COMPONENT","R' wave amplitude.lead V1","R' wave amplitude.lead V1","ACTIVE" +"LP31105-7","COMPONENT","R' wave amplitude.lead V2","R' wave amplitude.lead V2","ACTIVE" +"LP31106-5","COMPONENT","R' wave amplitude.lead V3","R' wave amplitude.lead V3","ACTIVE" +"LP31107-3","COMPONENT","R' wave amplitude.lead V4","R' wave amplitude.lead V4","ACTIVE" +"LP31108-1","COMPONENT","R' wave amplitude.lead V5","R' wave amplitude.lead V5","ACTIVE" +"LP31109-9","COMPONENT","R' wave amplitude.lead V6","R' wave amplitude.lead V6","ACTIVE" +"LP31110-7","COMPONENT","R' wave duration.lead AVF","R' wave duration.lead AVF","ACTIVE" +"LP30269-2","SYSTEM","Ser/Plas^donor",,"ACTIVE" +"LP149220-8","PROPERTY","Pr","Presence","ACTIVE" +"LP7751-3","SCALE","Ord","Ord","ACTIVE" +"LP37904-7","COMPONENT","DBG Ab","DBG Ab","ACTIVE" +"LP6813-2","PROPERTY","Find","Finding","ACTIVE" +"LP95333-8","METHOD","PhenX","PhenX","ACTIVE" +"LP102627-9","COMPONENT","Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30D","Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days","ACTIVE" +"LP6879-3","PROPERTY","Time","Time (e.g. seconds)","ACTIVE" +"LP31088-5","COMPONENT","R wave duration.lead AVR","R wave duration.lead AVR","ACTIVE" +"LP206647-2","SYSTEM","Neck>Thyroid gland","Thyroid gland","ACTIVE" +"LP208655-3","METHOD","NM","NM","ACTIVE" +"LP32888-7","SCALE","Doc","Doc","ACTIVE" +"LP31534-8","COMPONENT","Study report","Study report","ACTIVE" +"LP7057-5","SYSTEM","Bld","Blood","ACTIVE" +"LP6838-9","PROPERTY","NFr","Number Fraction","ACTIVE" +"LP6141-8","METHOD","Automated count","Automated count","ACTIVE" +"LP15842-5","COMPONENT","Pyridoxine","Pyridoxine","ACTIVE" +"LP19258-0","COMPONENT","Large unstained cells","Large unstained cells","ACTIVE" +"LP32887-9","SYSTEM","{Setting}","{Setting}","ACTIVE" +"LP187178-1","METHOD","{Role}","Role-unspecified","ACTIVE" +"LP72311-1","COMPONENT","Consultation note","Consultation note","ACTIVE" + diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/PartRelatedCodeMapping.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/PartRelatedCodeMapping.csv new file mode 100644 index 00000000000..495416894ce --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/PartFile/PartRelatedCodeMapping.csv @@ -0,0 +1,12 @@ +"PartNumber","PartName" ,"PartTypeName","ExtCodeId" ,"ExtCodeDisplayName" ,"ExtCodeSystem" ,"Equivalence","ContentOrigin","ExtCodeSystemVersion" ,"ExtCodeSystemCopyrightNotice" +"LP18172-4" ,"Interferon.beta" ,"COMPONENT" ," 420710006","Interferon beta (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org. This may incur a fee in SNOMED International non-Member countries." +"LP31706-2" ,"Nornicotine" ,"COMPONENT" ,"1018001" ,"Nornicotine (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org. This may incur a fee in SNOMED International non-Member countries." +"LP15826-8" ,"Prostaglandin F2","COMPONENT" ,"10192006" ,"Prostaglandin PGF2 (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org. This may incur a fee in SNOMED International non-Member countries." +"LP7400-7" ,"Liver" ,"SYSTEM" ,"10200004" ,"Liver structure (body structure)","http://snomed.info/sct" ,"wider" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org. This may incur a fee in SNOMED International non-Member countries." +"LP29165-5" ,"Liver.FNA" ,"SYSTEM" ,"10200004" ,"Liver structure (body structure)","http://snomed.info/sct" ,"narrower" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org. This may incur a fee in SNOMED International non-Member countries." +"LP15666-8" ,"Inosine" ,"COMPONENT" ,"102640000" ,"Inosine (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org. This may incur a fee in SNOMED International non-Member countries." +"LP15943-1" ,"Uronate" ,"COMPONENT" ,"102641001" ,"Uronic acid (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org. This may incur a fee in SNOMED International non-Member countries." +"LP15791-4" ,"Phenylketones" ,"COMPONENT" ,"102642008" ,"Phenylketones (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org. This may incur a fee in SNOMED International non-Member countries." +"LP15721-1" ,"Malonate" ,"COMPONENT" ,"102648007" ,"Malonic acid (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org. This may incur a fee in SNOMED International non-Member countries." +"LP15842-5" ,"Pyridoxine" ,"COMPONENT" ,"1054" ,"Pyridoxine" ,"http://pubchem.ncbi.nlm.nih.gov","equivalent" , , , +"LP15842-5" ,"Pyridoxine" ,"COMPONENT" ,"1054" ,"Pyridoxine" ,"http://foo/bar" ,"equivalent" , , , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/Top2000Results/SI/Top2000CommonLabResultsSi.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/Top2000Results/SI/Top2000CommonLabResultsSi.csv new file mode 100644 index 00000000000..1e9b3872892 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/Top2000Results/SI/Top2000CommonLabResultsSi.csv @@ -0,0 +1,10 @@ +LOINC #,Long Common Name,Short Name,CLASS,Rank +14682-9,Creatinine [Moles/volume] in Serum or Plasma,Creat SerPl-mCnc,Chem,1 +718-7,Hemoglobin [Mass/volume] in Blood,Hgb Bld-mCnc,HEM/BC,2 +2823-3,Potassium [Moles/volume] in Serum or Plasma,Potassium SerPl-sCnc,Chem,3 +14749-6,Glucose [Moles/volume] in Serum or Plasma,Glucose SerPl-mCnc,Chem,4 +2951-2,Sodium [Moles/volume] in Serum or Plasma,Sodium SerPl-sCnc,Chem,5 +3094-0,Urea nitrogen [Mass/volume] in Serum or Plasma,BUN SerPl-mCnc,Chem,6 +2028-9,"Carbon dioxide, total [Moles/volume] in Serum or Plasma",CO2 SerPl-sCnc,Chem,7 +2075-0,Chloride [Moles/volume] in Serum or Plasma,Chloride SerPl-sCnc,Chem,8 +789-8,Erythrocytes [#/volume] in Blood by Automated count,RBC # Bld Auto,HEM/BC,9 diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/Top2000Results/US/Top2000CommonLabResultsUs.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/Top2000Results/US/Top2000CommonLabResultsUs.csv new file mode 100644 index 00000000000..c80db052dd3 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/AccessoryFiles/Top2000Results/US/Top2000CommonLabResultsUs.csv @@ -0,0 +1,10 @@ +LOINC #,Long Common Name,Short Name,CLASS,Rank +2160-0,Creatinine [Mass/volume] in Serum or Plasma,Creat SerPl-mCnc,Chem,1 +718-7,Hemoglobin [Mass/volume] in Blood,Hgb Bld-mCnc,HEM/BC,2 +2823-3,Potassium [Moles/volume] in Serum or Plasma,Potassium SerPl-sCnc,Chem,3 +2345-7,Glucose [Mass/volume] in Serum or Plasma,Glucose SerPl-mCnc,Chem,4 +2951-2,Sodium [Moles/volume] in Serum or Plasma,Sodium SerPl-sCnc,Chem,5 +3094-0,Urea nitrogen [Mass/volume] in Serum or Plasma,BUN SerPl-mCnc,Chem,6 +2028-9,"Carbon dioxide, total [Moles/volume] in Serum or Plasma",CO2 SerPl-sCnc,Chem,7 +2075-0,Chloride [Moles/volume] in Serum or Plasma,Chloride SerPl-sCnc,Chem,8 +789-8,Erythrocytes [#/volume] in Blood by Automated count,RBC # Bld Auto,HEM/BC,9 diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/LoincTable/Loinc.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/LoincTable/Loinc.csv new file mode 100644 index 00000000000..20379cb7f1d --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/LoincTable/Loinc.csv @@ -0,0 +1,16 @@ +"LOINC_NUM","COMPONENT" ,"PROPERTY","TIME_ASPCT","SYSTEM" ,"SCALE_TYP","METHOD_TYP" ,"CLASS" ,"VersionLastChanged","CHNG_TYPE","DefinitionDescription" ,"STATUS","CONSUMER_NAME","CLASSTYPE","FORMULA","SPECIES","EXMPL_ANSWERS","SURVEY_QUEST_TEXT" ,"SURVEY_QUEST_SRC" ,"UNITSREQUIRED","SUBMITTED_UNITS","RELATEDNAMES2" ,"SHORTNAME" ,"ORDER_OBS" ,"CDISC_COMMON_TESTS","HL7_FIELD_SUBFIELD_ID","EXTERNAL_COPYRIGHT_NOTICE" ,"EXAMPLE_UNITS","LONG_COMMON_NAME" ,"UnitsAndRange","DOCUMENT_SECTION","EXAMPLE_UCUM_UNITS","EXAMPLE_SI_UCUM_UNITS","STATUS_REASON","STATUS_TEXT","CHANGE_REASON_PUBLIC" ,"COMMON_TEST_RANK","COMMON_ORDER_RANK","COMMON_SI_TEST_RANK","HL7_ATTACHMENT_STRUCTURE","EXTERNAL_COPYRIGHT_LINK","PanelType","AskAtOrderEntry","AssociatedObservations" ,"VersionFirstReleased","ValidHL7AttachmentRequest" +"10013-1" ,"R' wave amplitude.lead I" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-I; R wave Amp L-I; Random; Right; Voltage" ,"R' wave Amp L-I" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead I" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10014-9" ,"R' wave amplitude.lead II" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"2; Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-II; R wave Amp L-II; Random; Right; Voltage" ,"R' wave Amp L-II" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead II" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10015-6" ,"R' wave amplitude.lead III" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"3; Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-III; R wave Amp L-III; Random; Right; Voltage" ,"R' wave Amp L-III" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead III" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10016-4" ,"R' wave amplitude.lead V1" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V1; R wave Amp L-V1; Random; Right; Voltage" ,"R' wave Amp L-V1" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V1" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"1001-7" ,"DBG Ab" ,"Pr" ,"Pt" ,"Ser/Plas^donor" ,"Ord" , ,"BLDBK" ,"2.44" ,"MIN" , ,"ACTIVE", ,1 , , , , , , , ,"ABS; Aby; Antby; Anti; Antibodies; Antibody; Autoantibodies; Autoantibody; BLOOD BANK; Donna Bennett-Goodspeed; Donr; Ordinal; Pl; Plasma; Plsm; Point in time; QL; Qual; Qualitative; Random; Screen; SerP; SerPl; SerPl^donor; SerPlas; Serum; Serum or plasma; SR" ,"DBG Ab SerPl Donr Ql" ,"Observation", , , , ,"DBG Ab [Presence] in Serum or Plasma from donor" , , , , , , ,"The Property has been changed from ACnc to Pr (Presence) to reflect the new model for ordinal terms where results are based on presence or absence." ,0 ,0 ,0 , , , , , , , +"10017-2" ,"R' wave amplitude.lead V2" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V2; R wave Amp L-V2; Random; Right; Voltage" ,"R' wave Amp L-V2" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V2" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10018-0" ,"R' wave amplitude.lead V3" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V3; R wave Amp L-V3; Random; Right; Voltage" ,"R' wave Amp L-V3" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V3" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10019-8" ,"R' wave amplitude.lead V4" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V4; R wave Amp L-V4; Random; Right; Voltage" ,"R' wave Amp L-V4" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V4" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10020-6" ,"R' wave amplitude.lead V5" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V5; R wave Amp L-V5; Random; Right; Voltage" ,"R' wave Amp L-V5" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V5" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"61438-8" ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30D","Find" ,"Pt" ,"^Patient" ,"Ord" ,"PhenX" ,"PHENX" ,"2.44" ,"MIN" , ,"TRIAL" , ,2 , , , ,"Each time you eat bread, toast or dinner rolls, how much do you usually eat?","PhenX.050201100100","N" , ,"Finding; Findings; How much bread in 30D; Last; Ordinal; Point in time; QL; Qual; Qualitative; Random; Screen" ,"How much bread in 30D PhenX", , , , , ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]", , , , , , , ,0 ,0 ,0 , , , , , , , +"10000-8" ,"R wave duration.lead AVR" ,"Time" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; Durat; ECG; EKG.MEASUREMENTS; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave dur L-AVR; R wave dur L-AVR; Random; Right" ,"R wave dur L-AVR" ,"Observation", , , ,"s" ,"R wave duration in lead AVR" , , ,"s" , , , , ,0 ,0 ,0 , , , , , , , +"17787-3" ,"Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , +"17788-1" ,"Large unstained cells/100 leukocytes" ,"NFr" ,"Pt" ,"Bld" ,"Qn" ,"Automated count","HEM/BC" ,"2.50" ,"MIN" ,"Part of auto diff output of Bayer H*3S; peroxidase negative cells too large to be classified as lymph or basophil" ,"ACTIVE", ,1 , , , , , ,"Y" ,"%" ,"100WBC; Auto; Automated detection; Blood; Cell; Cellularity; Elec; Elect; Electr; HEMATOLOGY/CELL COUNTS; Leuc; Leuk; Leukocyte; Lkcs; LUC; Number Fraction; Percent; Point in time; QNT; Quan; Quant; Quantitative; Random; WB; WBC; WBCs; White blood cell; White blood cells; Whole blood" ,"LUC/leuk NFr Bld Auto" ,"Observation", , , ,"%" ,"Large unstained cells/100 leukocytes in Blood by Automated count" , , ,"%" , , , , ,1894 ,0 ,1894 , , , , , ,"1.0l" , +"11488-4" ,"Consultation note" ,"Find" ,"Pt" ,"{Setting}" ,"Doc" ,"{Role}" ,"DOC.ONTOLOGY","2.63" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Consult note; DOC.ONT; Document; Encounter; Evaluation and management; Evaluation and management note; Finding; Findings; notes; Point in time; Random; Visit note" ,"Consult note" ,"Both" , , , , ,"Consult note" , , , , , , ,"Edit made because this term is conformant to the Document Ontology axis values and therefore are being placed in this class.; Based on Clinical LOINC Committee decision during the September 2014 meeting, {Provider} was changed to {Author Type} to emphasize a greater breadth of potential document authors. At the September 2015 Clinical LOINC Committee meeting, the Committee decided to change {Author Type} to {Role} to align with the 'Role' axis name in the LOINC Document Ontology.; Because it is too difficult to maintain and because the distinction between documents and sections is not clear-cut nor necessary in most cases, the DOCUMENT_SECTION field has been deemed to have little value. The field has been set to null in the December 2017 release in preparation for removal in the December 2018 release. These changes were approved by the Clinical LOINC Committee.",0 ,0 ,0 ,"IG exists" , , , ,"81222-2;72231-4;81243-8","1.0j-a" ,"Y" +"47239-9" ,"Reason for stopping HIV Rx" ,"Type" ,"Pt" ,"^Patient" ,"Nom" ,"Reported" ,"ART" ,"2.50" ,"MIN" ,"Reason for stopping antiretroviral therapy" ,"ACTIVE", ,2 , , , , , ,"N" , ,"AIDS; Anti-retroviral therapy; ART; Human immunodeficiency virus; Nominal; Point in time; Random; Treatment; Typ" ,"Reason for stopping HIV Rx" ,"Observation", , ,"Copyright © 2006 World Health Organization. Used with permission. Publications of the World Health Organization can be obtained from WHO Press, World Health Organization, 20 Avenue Appia, 1211 Geneva 27, Switzerland (tel: +41 22 791 2476; fax: +41 22 791 4857; email: bookorders@who.int). Requests for permission to reproduce or translate WHO publications – whether for sale or for noncommercial distribution – should be addressed to WHO Press, at the above address (fax: +41 22 791 4806; email: permissions@who.int). The designations employed and the presentation of the material in this publication do not imply the expression of any opinion whatsoever on the part of the World Health Organization concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Dotted lines on maps represent approximate border lines for which there may not yet be full agreement. The mention of specific companies or of certain manufacturers’ products does not imply that they are endorsed or recommended by the World Health Organization in preference to others of a similar nature that are not mentioned. Errors and omissions excepted, the names of proprietary products are distinguished by initial capital letters. All reasonable precautions have been taken by WHO to verify the information contained in this publication. However, the published material is being distributed without warranty of any kind, either express or implied. The responsibility for the interpretation and use of the material lies with the reader. In no event shall the World Health Organization be liable for damages arising from its use.", ,"Reason for stopping HIV treatment" , , , , , , , ,0 ,0 ,0 , ,"WHO_HIV" , , , ,"2.22" , diff --git a/hapi-fhir-jpaserver-base/src/main/resources/ca/uhn/fhir/jpa/term/loinc/loinc.xml b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/loinc.xml similarity index 92% rename from hapi-fhir-jpaserver-base/src/main/resources/ca/uhn/fhir/jpa/term/loinc/loinc.xml rename to hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/loinc.xml index efe4184e99b..ed461aab3e5 100644 --- a/hapi-fhir-jpaserver-base/src/main/resources/ca/uhn/fhir/jpa/term/loinc/loinc.xml +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v-no-version/loinc.xml @@ -7,24 +7,23 @@ This CodeSystem resource describes 'LOINC' independent of any particular version Note that the following set of codes are defined by the LOINC code systems: - the main LOINC codes - - the LOINC Answer codes (LA-) and the LOINC Answer list codes (LL-) - - the LOINC Part codes (LP-) in the Multiaxial Hierarchy - - the LOINC Part codes (LP-) for the properties + - the LOINC Answer codes (LA) and the LOINC Answer list codes (LL) + - the LOINC Part codes (LP) in the Multiaxial Hierarchy + - the LOINC Part codes (LP) for the properties Note: there are license restrictions on the use of LOINC Part codes - - the LOINC Group codes (LG-) + - the LOINC Group codes (LG) Note: presently the LOINC Group codes are used to identify these roll-up groups as ValueSets, but are not yet loaded as codes in the CodeSystem Servers may generate variants of this for the LOINC version(s) and features they support. -File Version: 0.6 --> + This url is unchanged for all versions of LOINC. There can only be one correct Code System resource for each value of the version attribute (at least, only one per server). + --> @@ -33,38 +32,32 @@ File Version: 0.6 - + + If a specific version is specified, the name should carry this information (e.g. LOINC_270). + --> - + <title value="LOINC Code System (Testing Copy)"/> <status value="active"/> <experimental value="false"/> <publisher value="Regenstrief Institute, Inc."/> <contact> <telecom> + <system value="url" /> <value value="http://loinc.org"/> </telecom> </contact> <!-- - <date value=2020-06/> + <date value=2021-06/> --> <description value="LOINC is a freely available international standard for tests, measurements, and observations"/> - <copyright value="This material contains content from LOINC (http://loinc.org). LOINC is copyright ©1995-2020, Regenstrief Institute, Inc. and the Logical Observation Identifiers Names and Codes (LOINC) Committee and is available at no cost under the license at http://loinc.org/license. LOINC® is a registered United States trademark of Regenstrief Institute, Inc."/> + <copyright value="This material contains content from LOINC (http://loinc.org). LOINC is copyright ©1995-2021, Regenstrief Institute, Inc. and the Logical Observation Identifiers Names and Codes (LOINC) Committee and is available at no cost under the license at http://loinc.org/license. LOINC® is a registered United States trademark of Regenstrief Institute, Inc."/> <caseSensitive value="false"/> - <valueSet value=" http://loinc.org/vs"/> - <!-- - For a version specific reference: - <valueSet value="http://loinc.org/2.68/vs"/> - --> + <valueSet value="http://loinc.org/vs"/> <!-- It's at the discretion of servers whether to present fragments of LOINC hierarchically or not, when using the code system resource. But, if they are hierarchical, the Hierarchy SHALL be based on the is-a relationship that is derived from the LOINC Multiaxial Hierarchy. @@ -93,13 +86,15 @@ File Version: 0.6 For illustration purposes, consider this slice of the LOINC Multiaxial Hierarchy when reading the descriptions below: - Microbiology [LP7819-8] - Microorganism [LP14559-6] - Virus [LP14855-8] - Zika virus [LP200137-0] - Zika virus RNA | XXX [LP203271-4] - Zika virus RNA | XXX | Microbiology [LP379670-5] - Zika virus RNA [Presence] in Unspecified specimen by Probe and target amplification method [79190-5] + Laboratory [LP29693-6] + Microbiology and Antimicrobial susceptibility [LP343406-7] + Microbiology [LP7819-8] + Microorganism [LP14559-6] + Virus [LP14855-8] + Zika virus [LP200137-0] + Zika virus RNA | XXX [LP203271-4] + Zika virus RNA | XXX | Microbiology [LP379670-5] + Zika virus RNA [Presence] in Unspecified specimen by Probe and target amplification method [79190-5] Language Note: The filters defined here are specified using the default LOINC language - English (US). Requests are meant to be specified and interpreted on the English version. The return can be in a specified language (if supported by the server). But note that not all filters/properties have language translations available. --> @@ -141,13 +136,13 @@ File Version: 0.6 <code value="parent"/> <uri value="http://hl7.org/fhir/concept-properties#parent"/> <description value="A parent code in the Multiaxial Hierarchy"/> - <type value=""/> + <type value="code"/> </property> <property> <code value="child"/> <uri value="http://hl7.org/fhir/concept-properties#child"/> <description value="A child code in the Multiaxial Hierarchy"/> - <type value=""/> + <type value="code"/> </property> <!-- @@ -155,8 +150,8 @@ File Version: 0.6 These apply to the main LOINC codes, but not the Multiaxial Hierarchy, Answer lists, or the Part codes. Notes: In the LOINC code system resource, the display element = LONG_COMMON_NAME - Many properties are specified as type "coding", which allows use of LOINC Part codes (LP-) and the display text. LOINC Parts and their associations to LOINC terms are published in the LOINC Part File. - The properties defined here follow the guidance of the LOINC Users' Manual, which states that they should be expressed with the LOINC attributes contained in the LOINC Table. Properties that are not defined in the LOINC Table use FHIR-styled names. + Many properties are specified as type "Coding", which allows use of LOINC Part codes (LP-) and the display text. LOINC Parts and their associations to LOINC terms are published in the LOINC Part File. + The properties defined here follow the guidance of the LOINC Users' Guide, which states that they should be expressed with the LOINC attributes contained in the LOINC Table. Properties that are not defined in the LOINC Table use FHIR-styled names. --> <property> @@ -204,7 +199,7 @@ File Version: 0.6 <property> <code value="CLASS"/> <uri value="http://loinc.org/property/CLASS"/> - <description value="An arbitrary classification of the terms for grouping related observations together"/> + <description value="An arbitrary classification of terms for grouping related observations together"/> <type value="Coding"/> </property> <property> @@ -228,7 +223,7 @@ File Version: 0.6 <property> <code value="HL7_ATTACHMENT_STRUCTURE"/> <uri value="http://loinc.org/property/HL7_ATTACHMENT_STRUCTURE"/> - <description value="This property is populated in collaboration with the HL7 Attachments Work Group as described in the HL7 Attachment Specification: Supplement to Consolidated CDA Templated Guide."/> + <description value="This property is populated in collaboration with the HL7 Payer-Provider Exchange (PIE) Work Group (previously called Attachments Work Group) as described in the HL7 Attachment Specification: Supplement to Consolidated CDA Templated Guide."/> <type value="string"/> </property> <property> @@ -369,7 +364,7 @@ File Version: 0.6 <!-- LOINC/RSNA Radiology Playbook properties. These apply only to terms in the LOINC/RSNA Radiology Playbook File. Notes: - Properties are specified as type "coding", which are represented by LOINC Part codes (LP-) and their display names. + Properties are specified as type "Coding", which are represented by LOINC Part codes (LP-) and their display names. The attribute names here use FHIR styled names rather than their original LOINC style names because the original names contain periods. --> @@ -486,7 +481,7 @@ File Version: 0.6 Document Ontology properties. These apply only to terms in the LOINC Document Ontology File Notes - Properties are specified as type "coding", which are represented by LOINC Part codes (LP-) and their display names. + Properties are specified as type "Coding", which are represented by LOINC Part codes (LP-) and their display names. The attribute names here use FHIR styled names rather than their original LOINC style names because those contain periods. --> diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/AnswerFile/AnswerList.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/AnswerFile/AnswerList.csv new file mode 100644 index 00000000000..fae22daef78 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/AnswerFile/AnswerList.csv @@ -0,0 +1,12 @@ +"AnswerListId","AnswerListName" ,"AnswerListOID" ,"ExtDefinedYN","ExtDefinedAnswerListCodeSystem","ExtDefinedAnswerListLink" ,"AnswerStringId","LocalAnswerCode","LocalAnswerCodeSystem","SequenceNumber","DisplayText" ,"ExtCodeId","ExtCodeDisplayName" ,"ExtCodeSystem" ,"ExtCodeSystemVersion" ,"ExtCodeSystemCopyrightNotice" ,"SubsequentTextPrompt","Description","Score" +"LL1000-0" ,"v2.67 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"1 slice or 1 dinner roll" , , , , , , , , +"LL1000-0" ,"v2.67 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"2 slices or 2 dinner rolls" , , , , , , , , +"LL1000-0" ,"v2.67 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"More than 2 slices or 2 dinner rolls", , , , , , , , +"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"Never" , , , , , , , , +"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"1-3 times per month" , , , , , , , , +"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"1-2 times per week" , , , , , , , , +"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"3-4 times per week" , , , , , , , , +"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"5-6 times per week" , , , , , , , , +"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"1 time per day" , , , , , , , , +"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , +"LL1892-0" ,"v2.67 ICD-9_ICD-10" ,"1.3.6.1.4.1.12009.10.1.1069","Y" , ,"http://www.cdc.gov/nchs/icd.htm", , , , , , , , , , , , , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/AnswerFile/LoincAnswerListLink.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/AnswerFile/LoincAnswerListLink.csv new file mode 100644 index 00000000000..820602c77ad --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/AnswerFile/LoincAnswerListLink.csv @@ -0,0 +1,11 @@ +"LoincNumber","LongCommonName" ,"AnswerListId","AnswerListName" ,"AnswerListLinkType","ApplicableContext" +"61438-8" ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]","LL1000-0" ,"PhenX05_13_30D bread amt","NORMATIVE" , +"10061-0" ,"S' wave amplitude in lead I" ,"LL1311-1" ,"PhenX12_44" ,"EXAMPLE" , +"10331-7" ,"Rh [Type] in Blood" ,"LL360-9" ,"Pos|Neg" ,"EXAMPLE" , +"10389-5" ,"Blood product.other [Type]" ,"LL2413-4" ,"Othr bld prod" ,"EXAMPLE" , +"10390-3" ,"Blood product special preparation [Type]" ,"LL2422-5" ,"Blood prod treatment" ,"EXAMPLE" , +"10393-7" ,"Factor IX given [Type]" ,"LL2420-9" ,"Human/Recomb" ,"EXAMPLE" , +"10395-2" ,"Factor VIII given [Type]" ,"LL2420-9" ,"Human/Recomb" ,"EXAMPLE" , +"10401-8" ,"Immune serum globulin given [Type]" ,"LL2421-7" ,"IM/IV" ,"EXAMPLE" , +"10410-9" ,"Plasma given [Type]" ,"LL2417-5" ,"Plasma type" ,"EXAMPLE" , +"10568-4" ,"Clarity of Semen" ,"LL2427-4" ,"Clear/Opales/Milky" ,"EXAMPLE" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/ConsumerName/ConsumerName.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/ConsumerName/ConsumerName.csv new file mode 100644 index 00000000000..b4ec2907985 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/ConsumerName/ConsumerName.csv @@ -0,0 +1,6 @@ +"LoincNumber","ConsumerName" +"61438-8","Consumer Name 61438-8" +,"Consumer Name X" +47239-9","" +"17787-3","Consumer Name 17787-3" +"38699-5","1,1-Dichloroethane, Air" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/DocumentOntology/DocumentOntology.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/DocumentOntology/DocumentOntology.csv new file mode 100644 index 00000000000..f857d7f297b --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/DocumentOntology/DocumentOntology.csv @@ -0,0 +1,10 @@ +"LoincNumber","PartNumber","PartTypeName","PartSequenceOrder","PartName" +"11488-4","LP173418-7","Document.Kind","1","Note" +"11488-4","LP173110-0","Document.TypeOfService","1","Consultation" +"11488-4","LP173061-5","Document.Setting","1","{Setting}" +"11488-4","LP187187-2","Document.Role","1","{Role}" +"11490-0","LP173418-7","Document.Kind","1","Note" +"11490-0","LP173221-5","Document.TypeOfService","1","Discharge summary" +"11490-0","LP173061-5","Document.Setting","1","{Setting}" +"11490-0","LP173084-7","Document.Role","1","Physician" +"11492-6","LP173418-7","Document.Kind","1","Note" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/GroupFile/Group.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/GroupFile/Group.csv new file mode 100644 index 00000000000..66f5561ea1c --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/GroupFile/Group.csv @@ -0,0 +1,2 @@ +"ParentGroupId","GroupId","Group","Archetype","Status","VersionFirstReleased" +"LG100-4","LG1695-8","1,4-Dichlorobenzene|MCnc|Pt|ANYBldSerPl","","Active","" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/GroupFile/GroupLoincTerms.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/GroupFile/GroupLoincTerms.csv new file mode 100644 index 00000000000..04c19759cfb --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/GroupFile/GroupLoincTerms.csv @@ -0,0 +1,3 @@ +"Category","GroupId","Archetype","LoincNumber","LongCommonName" +"Flowsheet","LG1695-8","","17424-3","1,4-Dichlorobenzene [Mass/volume] in Blood" +"Flowsheet","LG1695-8","","13006-2","1,4-Dichlorobenzene [Mass/volume] in Serum or Plasma" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/GroupFile/ParentGroup.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/GroupFile/ParentGroup.csv new file mode 100644 index 00000000000..734a86c43dd --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/GroupFile/ParentGroup.csv @@ -0,0 +1,2 @@ +"ParentGroupId","ParentGroup","Status" +"LG100-4","Chem_DrugTox_Chal_Sero_Allergy<SAME:Comp|Prop|Tm|Syst (except intravascular and urine)><ANYBldSerPlas,ANYUrineUrineSed><ROLLUP:Method>","ACTIVE" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv new file mode 100644 index 00000000000..a26397639ff --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv @@ -0,0 +1,10 @@ +"LOINC_NUM","LONG_COMMON_NAME" +"11525-3","US Pelvis Fetus for pregnancy" +"17787-3","NM Thyroid gland Study report" +"18744-3","Bronchoscopy study" +"18746-8","Colonoscopy study" +"18748-4","Diagnostic imaging study" +"18751-8","Endoscopy study" +"18753-4","Flexible sigmoidoscopy study" +"24531-6","US Retroperitoneum" +"24532-4","US Abdomen RUQ" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LinguisticVariants/LinguisticVariants.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LinguisticVariants/LinguisticVariants.csv new file mode 100644 index 00000000000..c79b3197490 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LinguisticVariants/LinguisticVariants.csv @@ -0,0 +1,9 @@ +"ID","ISO_LANGUAGE","ISO_COUNTRY","LANGUAGE_NAME","PRODUCER" +"5","zh","CN","Chinese (CHINA)","Lin Zhang, A LOINC volunteer from China" +"7","es","AR","Spanish (ARGENTINA)","Conceptum Medical Terminology Center" +"8","fr","CA","French (CANADA)","Canada Health Infoway Inc." +,"de","AT","German (AUSTRIA)","ELGA, Austria" +"88",,"AT","German (AUSTRIA)","ELGA, Austria" +"89","de",,"German (AUSTRIA)","ELGA, Austria" +"90","de","AT",,"ELGA, Austria" +"24","de","AT","German (AUSTRIA)","ELGA, Austria" \ No newline at end of file diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LinguisticVariants/deAT24LinguisticVariant.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LinguisticVariants/deAT24LinguisticVariant.csv new file mode 100644 index 00000000000..c6882d47504 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LinguisticVariants/deAT24LinguisticVariant.csv @@ -0,0 +1,4 @@ +"LOINC_NUM","COMPONENT","PROPERTY","TIME_ASPCT","SYSTEM","SCALE_TYP","METHOD_TYP","CLASS","SHORTNAME","LONG_COMMON_NAME","RELATEDNAMES2","LinguisticVariantDisplayName" +"61438-8","Entlassungsbrief Ärztlich","Ergebnis","Zeitpunkt","{Setting}","Dokument","Dermatologie","DOC.ONTOLOGY","de shortname","de long common name","de related names 2","de linguistic variant display name" +"43730-1","","","","","","","","","","EBV-DNA qn. PCR","EBV-DNA quantitativ PCR" +"17787-3","","","","","","","","","","CoV OC43 RNA ql/SM P","Coronavirus OC43 RNA ql. /Sondermaterial PCR" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LinguisticVariants/frCA8LinguisticVariant.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LinguisticVariants/frCA8LinguisticVariant.csv new file mode 100644 index 00000000000..fa09e0cb242 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LinguisticVariants/frCA8LinguisticVariant.csv @@ -0,0 +1,6 @@ +"LOINC_NUM","COMPONENT","PROPERTY","TIME_ASPCT","SYSTEM","SCALE_TYP","METHOD_TYP","CLASS","SHORTNAME","LONG_COMMON_NAME","RELATEDNAMES2","LinguisticVariantDisplayName" +"61438-8","Cellules de Purkinje cytoplasmique type 2 , IgG","Titre","Temps ponctuel","Sérum","Quantitatif","Immunofluorescence","Sérologie","","","","" +"11704-4","Gliale nucléaire de type 1 , IgG","Titre","Temps ponctuel","LCR","Quantitatif","Immunofluorescence","Sérologie","","","","" +,"Cellules de Purkinje cytoplasmique type 2 , IgG","Titre","Temps ponctuel","Sérum","Quantitatif",,,"","","","" +"17787-3","Virus respiratoire syncytial bovin","Présence-Seuil","Temps ponctuel","XXX","Ordinal","Culture spécifique à un microorganisme","Microbiologie","","","","" +"17788-1","Cellules de Purkinje cytoplasmique type 2 , IgG","Titre","Temps ponctuel","Sérum","Quantitatif",,,"","","","" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LinguisticVariants/zhCN5LinguisticVariant.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LinguisticVariants/zhCN5LinguisticVariant.csv new file mode 100644 index 00000000000..48d07d9fdc3 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LinguisticVariants/zhCN5LinguisticVariant.csv @@ -0,0 +1,9 @@ +"LOINC_NUM","COMPONENT","PROPERTY","TIME_ASPCT","SYSTEM","SCALE_TYP","METHOD_TYP","CLASS","SHORTNAME","LONG_COMMON_NAME","RELATEDNAMES2","LinguisticVariantDisplayName" +"61438-8","血流速度.收缩期.最大值","速度","时间点","大脑中动脉","定量型","超声.多普勒","产科学检查与测量指标.超声","","","Cereb 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 大脑(Cerebral) 时刻;随机;随意;瞬间 术语""cerebral""指的是主要由中枢半球(大脑皮质和基底神经节)组成的那部分脑结构 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"11704-4","血流速度.收缩期.最大值","速度","时间点","动脉导管","定量型","超声.多普勒","产科学检查与测量指标.超声","","","动态 动脉管 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 时刻;随机;随意;瞬间 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"17787-3","血流速度.收缩期.最大值","速度","时间点","二尖瓣^胎儿","定量型","超声.多普勒","产科学检查与测量指标.超声","","","僧帽瓣 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 时刻;随机;随意;瞬间 流 流量;流速;流体 胎;超系统 - 胎儿 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"61438-6",,"速度","时间点","二尖瓣^胎儿","定量型","超声.多普勒","产科学检查与测量指标.超声","","","僧帽瓣 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 时刻;随机;随意;瞬间 流 流量;流速;流体 胎;超系统 - 胎儿 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"10000-8","血流速度.收缩期.最大值",,"时间点","二尖瓣^胎儿","定量型","超声.多普勒","产科学检查与测量指标.超声","","","僧帽瓣 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 时刻;随机;随意;瞬间 流 流量;流速;流体 胎;超系统 - 胎儿 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"17788-1","血流速度.收缩期.最大值","速度",,"大脑中动脉","定量型","超声.多普勒","产科学检查与测量指标.超声","","","Cereb 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 大脑(Cerebral) 时刻;随机;随意;瞬间 术语""cerebral""指的是主要由中枢半球(大脑皮质和基底神经节)组成的那部分脑结构 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"11488-4","血流速度.收缩期.最大值","速度","时间点",,"定量型","超声.多普勒","产科学检查与测量指标.超声","","","Cereb 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 大脑(Cerebral) 时刻;随机;随意;瞬间 术语""cerebral""指的是主要由中枢半球(大脑皮质和基底神经节)组成的那部分脑结构 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"47239-9","血流速度.收缩期.最大值","速度","时间点","大脑中动脉",,"超声.多普勒","产科学检查与测量指标.超声","","","Cereb 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 大脑(Cerebral) 时刻;随机;随意;瞬间 术语""cerebral""指的是主要由中枢半球(大脑皮质和基底神经节)组成的那部分脑结构 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LoincIeeeMedicalDeviceCodeMappingTable/LoincIeeeMedicalDeviceCodeMappingTable.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LoincIeeeMedicalDeviceCodeMappingTable/LoincIeeeMedicalDeviceCodeMappingTable.csv new file mode 100644 index 00000000000..d8cf83cd09e --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LoincIeeeMedicalDeviceCodeMappingTable/LoincIeeeMedicalDeviceCodeMappingTable.csv @@ -0,0 +1,10 @@ +LOINC_NUM,LOINC_LONG_COMMON_NAME,IEEE_CF_CODE10,IEEE_REFID,IEEE_DESCRIPTION,IEEE_DIM,IEEE_UOM_UCUM +11556-8,Oxygen [Partial pressure] in Blood,160116,MDC_CONC_PO2_GEN,,LMT-2L-2 LMT-2L-2,kPa mm[Hg] +11557-6,Carbon dioxide [Partial pressure] in Blood,160064,MDC_CONC_PCO2_GEN,,LMT-2L-2 LMT-2L-2,kPa mm[Hg] +11558-4,pH of Blood,160004,MDC_CONC_PH_GEN,,[pH],[pH] +12961-9,Urea nitrogen [Mass/volume] in Arterial blood,160080,MDC_CONC_UREA_ART,,ML-3 NL-3,mg/dL mmol/L +14749-6,Glucose [Moles/volume] in Serum or Plasma,160196,MDC_CONC_GLU_VENOUS_PLASMA,Plasma glucose concentration taken from venous,NL-3 ,mmol/L +14749-6,Glucose [Moles/volume] in Serum or Plasma,160368,MDC_CONC_GLU_UNDETERMINED_PLASMA,Plasma glucose concentration taken from undetermined sample source,NL-3 ,mmol/L +15074-8,Glucose [Moles/volume] in Blood,160020,MDC_CONC_GLU_GEN,,NL-3,mmol/L +15074-8,Glucose [Moles/volume] in Blood,160364,MDC_CONC_GLU_UNDETERMINED_WHOLEBLOOD,Whole blood glucose concentration taken from undetermined sample source,NL-3 ,mmol/L +17861-6,Calcium [Mass/volume] in Serum or Plasma,160024,MDC_CONC_CA_GEN,,ML-3,mg/dL diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv new file mode 100644 index 00000000000..e49311f5b28 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv @@ -0,0 +1,10 @@ +"LoincNumber","LongCommonName" ,"PartNumber","PartTypeName" ,"PartName" ,"PartSequenceOrder","RID" ,"PreferredName" ,"RPID" ,"LongName" +"17787-3" ,"v2.67 NM Thyroid gland Study report","LP199995-4","Rad.Anatomic Location.Region Imaged","Neck" ,"A" ,"RID7488" ,"neck" ,"" ,"" +"17787-3" ,"v2.67 NM Thyroid gland Study report","LP206648-0","Rad.Anatomic Location.Imaging Focus","Thyroid gland" ,"A" ,"RID7578" ,"thyroid gland" ,"" ,"" +"17787-3" ,"v2.67 NM Thyroid gland Study report","LP208891-4","Rad.Modality.Modality type" ,"NM" ,"A" ,"RID10330","nuclear medicine imaging","" ,"" +"24531-6" ,"v2.67 US Retroperitoneum" ,"LP207608-3","Rad.Modality.Modality type" ,"US" ,"A" ,"RID10326","Ultrasound" ,"RPID2142","US Retroperitoneum" +"24531-6" ,"v2.67 US Retroperitoneum" ,"LP199943-4","Rad.Anatomic Location.Imaging Focus","Retroperitoneum" ,"A" ,"RID431" ,"RETROPERITONEUM" ,"RPID2142","US Retroperitoneum" +"24531-6" ,"v2.67 US Retroperitoneum" ,"LP199956-6","Rad.Anatomic Location.Region Imaged","Abdomen" ,"A" ,"RID56" ,"Abdomen" ,"RPID2142","US Retroperitoneum" +"24532-4" ,"v2.67 US Abdomen RUQ" ,"LP199956-6","Rad.Anatomic Location.Region Imaged","Abdomen" ,"A" ,"RID56" ,"Abdomen" ,"" ,"" +"24532-4" ,"v2.67 US Abdomen RUQ" ,"LP207608-3","Rad.Modality.Modality type" ,"US" ,"A" ,"RID10326","Ultrasound" ,"" ,"" +"24532-4" ,"v2.67 US Abdomen RUQ" ,"LP208105-9","Rad.Anatomic Location.Imaging Focus","Right upper quadrant","A" ,"RID29994","Right upper quadrant" ,"" ,"" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LoincUniversalLabOrdersValueSet/LoincUniversalLabOrdersValueSet.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LoincUniversalLabOrdersValueSet/LoincUniversalLabOrdersValueSet.csv new file mode 100644 index 00000000000..72d95485a58 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/LoincUniversalLabOrdersValueSet/LoincUniversalLabOrdersValueSet.csv @@ -0,0 +1,10 @@ +"LOINC_NUM","LONG_COMMON_NAME","ORDER_OBS" +"42176-8","1,3 beta glucan [Mass/volume] in Serum","Both" +"53835-5","1,5-Anhydroglucitol [Mass/volume] in Serum or Plasma","Both" +"31019-3","10-Hydroxycarbazepine [Mass/volume] in Serum or Plasma","Both" +"6765-2","17-Hydroxypregnenolone [Mass/volume] in Serum or Plasma","Both" +"1668-3","17-Hydroxyprogesterone [Mass/volume] in Serum or Plasma","Both" +"32854-2","17-Hydroxyprogesterone [Presence] in DBS","Both" +"49054-0","25-Hydroxycalciferol [Mass/volume] in Serum or Plasma","Both" +"62292-8","25-Hydroxyvitamin D2+25-Hydroxyvitamin D3 [Mass/volume] in Serum or Plasma","Both" +"44907-4","5-Hydroxyindoleacetate panel - 24 hour Urine","Order" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv new file mode 100644 index 00000000000..527b8fd5cae --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv @@ -0,0 +1,10 @@ +PATH_TO_ROOT,SEQUENCE,IMMEDIATE_PARENT,CODE,CODE_TEXT +,1,,LP31755-9,Microbiology +LP31755-9,1,LP31755-9,LP14559-6,Microorganism +LP31755-9.LP14559-6,1,LP14559-6,LP98185-9,Bacteria +LP31755-9.LP14559-6.LP98185-9,1,LP98185-9,LP14082-9,Bacteria +LP31755-9.LP14559-6.LP98185-9.LP14082-9,1,LP14082-9,LP52258-8,Bacteria | Body Fluid +LP31755-9.LP14559-6.LP98185-9.LP14082-9.LP52258-8,1,LP52258-8,41599-2,Bacteria Fld Ql Micro +LP31755-9.LP14559-6.LP98185-9.LP14082-9,2,LP14082-9,LP52260-4,Bacteria | Cerebral spinal fluid +LP31755-9.LP14559-6.LP98185-9.LP14082-9.LP52260-4,1,LP52260-4,41602-4,Bacteria CSF Ql Micro +LP31755-9.LP14559-6.LP98185-9.LP14082-9,3,LP14082-9,LP52960-9,Bacteria | Cervix diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/AnswerList.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/AnswerList.csv new file mode 100644 index 00000000000..a448cf80f2d --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/AnswerList.csv @@ -0,0 +1,12 @@ +"AnswerListId","AnswerListName" ,"AnswerListOID" ,"ExtDefinedYN","ExtDefinedAnswerListCodeSystem","ExtDefinedAnswerListLink" ,"AnswerStringId","LocalAnswerCode","LocalAnswerCodeSystem","SequenceNumber","DisplayText" ,"ExtCodeId","ExtCodeDisplayName" ,"ExtCodeSystem" ,"ExtCodeSystemVersion" ,"ExtCodeSystemCopyrightNotice" ,"SubsequentTextPrompt","Description","Score" +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"1 slice or 1 dinner roll" , , , , , , , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"2 slices or 2 dinner rolls" , , , , , , , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"More than 2 slices or 2 dinner rolls", , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"Never" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"1-3 times per month" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"1-2 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"3-4 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"5-6 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"1 time per day" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , +"LL1892-0" ,"ICD-9_ICD-10" ,"1.3.6.1.4.1.12009.10.1.1069","Y" , ,"http://www.cdc.gov/nchs/icd.htm", , , , , , , , , , , , , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/Loinc.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/Loinc.csv new file mode 100644 index 00000000000..20379cb7f1d --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/Loinc.csv @@ -0,0 +1,16 @@ +"LOINC_NUM","COMPONENT" ,"PROPERTY","TIME_ASPCT","SYSTEM" ,"SCALE_TYP","METHOD_TYP" ,"CLASS" ,"VersionLastChanged","CHNG_TYPE","DefinitionDescription" ,"STATUS","CONSUMER_NAME","CLASSTYPE","FORMULA","SPECIES","EXMPL_ANSWERS","SURVEY_QUEST_TEXT" ,"SURVEY_QUEST_SRC" ,"UNITSREQUIRED","SUBMITTED_UNITS","RELATEDNAMES2" ,"SHORTNAME" ,"ORDER_OBS" ,"CDISC_COMMON_TESTS","HL7_FIELD_SUBFIELD_ID","EXTERNAL_COPYRIGHT_NOTICE" ,"EXAMPLE_UNITS","LONG_COMMON_NAME" ,"UnitsAndRange","DOCUMENT_SECTION","EXAMPLE_UCUM_UNITS","EXAMPLE_SI_UCUM_UNITS","STATUS_REASON","STATUS_TEXT","CHANGE_REASON_PUBLIC" ,"COMMON_TEST_RANK","COMMON_ORDER_RANK","COMMON_SI_TEST_RANK","HL7_ATTACHMENT_STRUCTURE","EXTERNAL_COPYRIGHT_LINK","PanelType","AskAtOrderEntry","AssociatedObservations" ,"VersionFirstReleased","ValidHL7AttachmentRequest" +"10013-1" ,"R' wave amplitude.lead I" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-I; R wave Amp L-I; Random; Right; Voltage" ,"R' wave Amp L-I" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead I" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10014-9" ,"R' wave amplitude.lead II" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"2; Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-II; R wave Amp L-II; Random; Right; Voltage" ,"R' wave Amp L-II" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead II" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10015-6" ,"R' wave amplitude.lead III" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"3; Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-III; R wave Amp L-III; Random; Right; Voltage" ,"R' wave Amp L-III" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead III" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10016-4" ,"R' wave amplitude.lead V1" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V1; R wave Amp L-V1; Random; Right; Voltage" ,"R' wave Amp L-V1" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V1" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"1001-7" ,"DBG Ab" ,"Pr" ,"Pt" ,"Ser/Plas^donor" ,"Ord" , ,"BLDBK" ,"2.44" ,"MIN" , ,"ACTIVE", ,1 , , , , , , , ,"ABS; Aby; Antby; Anti; Antibodies; Antibody; Autoantibodies; Autoantibody; BLOOD BANK; Donna Bennett-Goodspeed; Donr; Ordinal; Pl; Plasma; Plsm; Point in time; QL; Qual; Qualitative; Random; Screen; SerP; SerPl; SerPl^donor; SerPlas; Serum; Serum or plasma; SR" ,"DBG Ab SerPl Donr Ql" ,"Observation", , , , ,"DBG Ab [Presence] in Serum or Plasma from donor" , , , , , , ,"The Property has been changed from ACnc to Pr (Presence) to reflect the new model for ordinal terms where results are based on presence or absence." ,0 ,0 ,0 , , , , , , , +"10017-2" ,"R' wave amplitude.lead V2" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V2; R wave Amp L-V2; Random; Right; Voltage" ,"R' wave Amp L-V2" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V2" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10018-0" ,"R' wave amplitude.lead V3" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V3; R wave Amp L-V3; Random; Right; Voltage" ,"R' wave Amp L-V3" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V3" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10019-8" ,"R' wave amplitude.lead V4" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V4; R wave Amp L-V4; Random; Right; Voltage" ,"R' wave Amp L-V4" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V4" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10020-6" ,"R' wave amplitude.lead V5" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V5; R wave Amp L-V5; Random; Right; Voltage" ,"R' wave Amp L-V5" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V5" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"61438-8" ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30D","Find" ,"Pt" ,"^Patient" ,"Ord" ,"PhenX" ,"PHENX" ,"2.44" ,"MIN" , ,"TRIAL" , ,2 , , , ,"Each time you eat bread, toast or dinner rolls, how much do you usually eat?","PhenX.050201100100","N" , ,"Finding; Findings; How much bread in 30D; Last; Ordinal; Point in time; QL; Qual; Qualitative; Random; Screen" ,"How much bread in 30D PhenX", , , , , ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]", , , , , , , ,0 ,0 ,0 , , , , , , , +"10000-8" ,"R wave duration.lead AVR" ,"Time" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; Durat; ECG; EKG.MEASUREMENTS; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave dur L-AVR; R wave dur L-AVR; Random; Right" ,"R wave dur L-AVR" ,"Observation", , , ,"s" ,"R wave duration in lead AVR" , , ,"s" , , , , ,0 ,0 ,0 , , , , , , , +"17787-3" ,"Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , +"17788-1" ,"Large unstained cells/100 leukocytes" ,"NFr" ,"Pt" ,"Bld" ,"Qn" ,"Automated count","HEM/BC" ,"2.50" ,"MIN" ,"Part of auto diff output of Bayer H*3S; peroxidase negative cells too large to be classified as lymph or basophil" ,"ACTIVE", ,1 , , , , , ,"Y" ,"%" ,"100WBC; Auto; Automated detection; Blood; Cell; Cellularity; Elec; Elect; Electr; HEMATOLOGY/CELL COUNTS; Leuc; Leuk; Leukocyte; Lkcs; LUC; Number Fraction; Percent; Point in time; QNT; Quan; Quant; Quantitative; Random; WB; WBC; WBCs; White blood cell; White blood cells; Whole blood" ,"LUC/leuk NFr Bld Auto" ,"Observation", , , ,"%" ,"Large unstained cells/100 leukocytes in Blood by Automated count" , , ,"%" , , , , ,1894 ,0 ,1894 , , , , , ,"1.0l" , +"11488-4" ,"Consultation note" ,"Find" ,"Pt" ,"{Setting}" ,"Doc" ,"{Role}" ,"DOC.ONTOLOGY","2.63" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Consult note; DOC.ONT; Document; Encounter; Evaluation and management; Evaluation and management note; Finding; Findings; notes; Point in time; Random; Visit note" ,"Consult note" ,"Both" , , , , ,"Consult note" , , , , , , ,"Edit made because this term is conformant to the Document Ontology axis values and therefore are being placed in this class.; Based on Clinical LOINC Committee decision during the September 2014 meeting, {Provider} was changed to {Author Type} to emphasize a greater breadth of potential document authors. At the September 2015 Clinical LOINC Committee meeting, the Committee decided to change {Author Type} to {Role} to align with the 'Role' axis name in the LOINC Document Ontology.; Because it is too difficult to maintain and because the distinction between documents and sections is not clear-cut nor necessary in most cases, the DOCUMENT_SECTION field has been deemed to have little value. The field has been set to null in the December 2017 release in preparation for removal in the December 2018 release. These changes were approved by the Clinical LOINC Committee.",0 ,0 ,0 ,"IG exists" , , , ,"81222-2;72231-4;81243-8","1.0j-a" ,"Y" +"47239-9" ,"Reason for stopping HIV Rx" ,"Type" ,"Pt" ,"^Patient" ,"Nom" ,"Reported" ,"ART" ,"2.50" ,"MIN" ,"Reason for stopping antiretroviral therapy" ,"ACTIVE", ,2 , , , , , ,"N" , ,"AIDS; Anti-retroviral therapy; ART; Human immunodeficiency virus; Nominal; Point in time; Random; Treatment; Typ" ,"Reason for stopping HIV Rx" ,"Observation", , ,"Copyright © 2006 World Health Organization. Used with permission. Publications of the World Health Organization can be obtained from WHO Press, World Health Organization, 20 Avenue Appia, 1211 Geneva 27, Switzerland (tel: +41 22 791 2476; fax: +41 22 791 4857; email: bookorders@who.int). Requests for permission to reproduce or translate WHO publications – whether for sale or for noncommercial distribution – should be addressed to WHO Press, at the above address (fax: +41 22 791 4806; email: permissions@who.int). The designations employed and the presentation of the material in this publication do not imply the expression of any opinion whatsoever on the part of the World Health Organization concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Dotted lines on maps represent approximate border lines for which there may not yet be full agreement. The mention of specific companies or of certain manufacturers’ products does not imply that they are endorsed or recommended by the World Health Organization in preference to others of a similar nature that are not mentioned. Errors and omissions excepted, the names of proprietary products are distinguished by initial capital letters. All reasonable precautions have been taken by WHO to verify the information contained in this publication. However, the published material is being distributed without warranty of any kind, either express or implied. The responsibility for the interpretation and use of the material lies with the reader. In no event shall the World Health Organization be liable for damages arising from its use.", ,"Reason for stopping HIV treatment" , , , , , , , ,0 ,0 ,0 , ,"WHO_HIV" , , , ,"2.22" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/LoincAnswerListLink.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/LoincAnswerListLink.csv new file mode 100644 index 00000000000..820602c77ad --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/LoincAnswerListLink.csv @@ -0,0 +1,11 @@ +"LoincNumber","LongCommonName" ,"AnswerListId","AnswerListName" ,"AnswerListLinkType","ApplicableContext" +"61438-8" ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]","LL1000-0" ,"PhenX05_13_30D bread amt","NORMATIVE" , +"10061-0" ,"S' wave amplitude in lead I" ,"LL1311-1" ,"PhenX12_44" ,"EXAMPLE" , +"10331-7" ,"Rh [Type] in Blood" ,"LL360-9" ,"Pos|Neg" ,"EXAMPLE" , +"10389-5" ,"Blood product.other [Type]" ,"LL2413-4" ,"Othr bld prod" ,"EXAMPLE" , +"10390-3" ,"Blood product special preparation [Type]" ,"LL2422-5" ,"Blood prod treatment" ,"EXAMPLE" , +"10393-7" ,"Factor IX given [Type]" ,"LL2420-9" ,"Human/Recomb" ,"EXAMPLE" , +"10395-2" ,"Factor VIII given [Type]" ,"LL2420-9" ,"Human/Recomb" ,"EXAMPLE" , +"10401-8" ,"Immune serum globulin given [Type]" ,"LL2421-7" ,"IM/IV" ,"EXAMPLE" , +"10410-9" ,"Plasma given [Type]" ,"LL2417-5" ,"Plasma type" ,"EXAMPLE" , +"10568-4" ,"Clarity of Semen" ,"LL2427-4" ,"Clear/Opales/Milky" ,"EXAMPLE" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/LoincPartLink.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/LoincPartLink.csv new file mode 100644 index 00000000000..36c84f3fe95 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/LoincPartLink.csv @@ -0,0 +1,10 @@ +"LoincNumber","LongCommonName","PartNumber","PartName","PartCodeSystem","PartTypeName","LinkTypeName","Property" +"10013-1","R' wave amplitude in lead I","LP31101-6","R' wave amplitude.lead I","http://loinc.org","COMPONENT","Primary","http://loinc.org/property/COMPONENT" +"10013-1","R' wave amplitude in lead I","LP6802-5","Elpot","http://loinc.org","PROPERTY","Primary","http://loinc.org/property/PROPERTY" +"10013-1","R' wave amplitude in lead I","LP6960-1","Pt","http://loinc.org","TIME","Primary","http://loinc.org/property/TIME_ASPCT" +"10013-1","R' wave amplitude in lead I","LP7289-4","Heart","http://loinc.org","SYSTEM","Primary","http://loinc.org/property/SYSTEM" +"10013-1","R' wave amplitude in lead I","LP7753-9","Qn","http://loinc.org","SCALE","Primary","http://loinc.org/property/SCALE_TYP" +"10013-1","R' wave amplitude in lead I","LP6244-0","EKG","http://loinc.org","METHOD","Primary","http://loinc.org/property/METHOD_TYP" +"10013-1","R' wave amplitude in lead I","LP31101-6","R' wave amplitude.lead I","http://loinc.org","COMPONENT","DetailedModel","http://loinc.org/property/analyte" +"10013-1","R' wave amplitude in lead I","LP6802-5","Elpot","http://loinc.org","PROPERTY","DetailedModel","http://loinc.org/property/PROPERTY" +"10013-1","R' wave amplitude in lead I","LP6960-1","Pt","http://loinc.org","TIME","DetailedModel","http://loinc.org/property/time-core" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/LoincPartLink_Primary.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/LoincPartLink_Primary.csv new file mode 100644 index 00000000000..8dbe575ffd2 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/LoincPartLink_Primary.csv @@ -0,0 +1,7 @@ +"LoincNumber","LongCommonName" ,"PartNumber","PartName" ,"PartCodeSystem" ,"PartTypeName","LinkTypeName","Property" +"10013-1" ,"R' wave amplitude in lead I","LP31101-6" ,"R' wave amplitude.lead I","http://loinc.org","COMPONENT" ,"Primary" ,"http://loinc.org/property/COMPONENT" +"10013-1" ,"R' wave amplitude in lead I","LP6802-5" ,"Elpot" ,"http://loinc.org","PROPERTY" ,"Primary" ,"http://loinc.org/property/PROPERTY" +"10013-1" ,"R' wave amplitude in lead I","LP6960-1" ,"Pt" ,"http://loinc.org","TIME" ,"Primary" ,"http://loinc.org/property/TIME_ASPCT" +"10013-1" ,"R' wave amplitude in lead I","LP7289-4" ,"Heart" ,"http://loinc.org","SYSTEM" ,"Primary" ,"http://loinc.org/property/SYSTEM" +"10013-1" ,"R' wave amplitude in lead I","LP7753-9" ,"Qn" ,"http://loinc.org","SCALE" ,"Primary" ,"http://loinc.org/property/SCALE_TYP" +"10013-1" ,"R' wave amplitude in lead I","LP6244-0" ,"EKG" ,"http://loinc.org","METHOD" ,"Primary" ,"http://loinc.org/property/METHOD_TYP" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/LoincPartLink_Supplementary.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/LoincPartLink_Supplementary.csv new file mode 100644 index 00000000000..869c2c1651d --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/LoincPartLink_Supplementary.csv @@ -0,0 +1,13 @@ +"LoincNumber","LongCommonName" ,"PartNumber","PartName" ,"PartCodeSystem" ,"PartTypeName","LinkTypeName" ,"Property" +"10013-1" ,"R' wave amplitude in lead I","LP31101-6" ,"R' wave amplitude.lead I","http://loinc.org","COMPONENT" ,"DetailedModel" ,"http://loinc.org/property/analyte" +"10013-1" ,"R' wave amplitude in lead I","LP6802-5" ,"Elpot" ,"http://loinc.org","PROPERTY" ,"DetailedModel" ,"http://loinc.org/property/PROPERTY" +"10013-1" ,"R' wave amplitude in lead I","LP6960-1" ,"Pt" ,"http://loinc.org","TIME" ,"DetailedModel" ,"http://loinc.org/property/time-core" +"10013-1" ,"R' wave amplitude in lead I","LP7289-4" ,"Heart" ,"http://loinc.org","SYSTEM" ,"DetailedModel" ,"http://loinc.org/property/system-core" +"10013-1" ,"R' wave amplitude in lead I","LP7753-9" ,"Qn" ,"http://loinc.org","SCALE" ,"DetailedModel" ,"http://loinc.org/property/SCALE_TYP" +"10013-1" ,"R' wave amplitude in lead I","LP6244-0" ,"EKG" ,"http://loinc.org","METHOD" ,"DetailedModel" ,"http://loinc.org/property/METHOD_TYP" +"10013-1" ,"R' wave amplitude in lead I","LP31101-6" ,"R' wave amplitude.lead I","http://loinc.org","COMPONENT" ,"SyntaxEnhancement","http://loinc.org/property/analyte-core" +"10013-1" ,"R' wave amplitude in lead I","LP190563-9","Cardiology" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/category" +"10013-1" ,"R' wave amplitude in lead I","LP29708-2" ,"Cardiology" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/category" +"10013-1" ,"R' wave amplitude in lead I","LP7787-7" ,"Clinical" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/category" +"10013-1" ,"R' wave amplitude in lead I","LP7795-0" ,"EKG measurements" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/category" +"10013-1" ,"R' wave amplitude in lead I","LP7795-0" ,"EKG.MEAS" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/CLASS" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/Part.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/Part.csv new file mode 100644 index 00000000000..d5816ead286 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/Part.csv @@ -0,0 +1,46 @@ +"PartNumber","PartTypeName","PartName","PartDisplayName","Status" +"LP101394-7","ADJUSTMENT","adjusted for maternal weight","adjusted for maternal weight","ACTIVE" +"LP101907-6","ADJUSTMENT","corrected for age","corrected for age","ACTIVE" +"LP115711-6","ADJUSTMENT","corrected for background","corrected for background","ACTIVE" +"LP147359-6","ADJUSTMENT","adjusted for body weight","adjusted for body weight","ACTIVE" +"LP173482-3","ADJUSTMENT","1st specimen","1st specimen","DEPRECATED" +"LP173483-1","ADJUSTMENT","post cyanocobalamin",,"ACTIVE" +"LP173484-9","ADJUSTMENT","W hyperextension)",,"ACTIVE" +"LP6244-0","METHOD","EKG","Electrocardiogram (EKG)","ACTIVE" +"LP18172-4","COMPONENT","Interferon.beta","Interferon beta","ACTIVE" +"LP7289-4","SYSTEM","Heart","Heart","ACTIVE" +"LP6960-1","TIME","Pt","Point in time (spot)","ACTIVE" +"LP6802-5","PROPERTY","Elpot","Electrical Potential (Voltage)","ACTIVE" +"LP7753-9","SCALE","Qn","Qn","ACTIVE" +"LP31101-6","COMPONENT","R' wave amplitude.lead I","R' wave amplitude.lead I","ACTIVE" +"LP31102-4","COMPONENT","R' wave amplitude.lead II","R' wave amplitude.lead II","ACTIVE" +"LP31103-2","COMPONENT","R' wave amplitude.lead III","R' wave amplitude.lead III","ACTIVE" +"LP31104-0","COMPONENT","R' wave amplitude.lead V1","R' wave amplitude.lead V1","ACTIVE" +"LP31105-7","COMPONENT","R' wave amplitude.lead V2","R' wave amplitude.lead V2","ACTIVE" +"LP31106-5","COMPONENT","R' wave amplitude.lead V3","R' wave amplitude.lead V3","ACTIVE" +"LP31107-3","COMPONENT","R' wave amplitude.lead V4","R' wave amplitude.lead V4","ACTIVE" +"LP31108-1","COMPONENT","R' wave amplitude.lead V5","R' wave amplitude.lead V5","ACTIVE" +"LP31109-9","COMPONENT","R' wave amplitude.lead V6","R' wave amplitude.lead V6","ACTIVE" +"LP31110-7","COMPONENT","R' wave duration.lead AVF","R' wave duration.lead AVF","ACTIVE" +"LP30269-2","SYSTEM","Ser/Plas^donor",,"ACTIVE" +"LP149220-8","PROPERTY","Pr","Presence","ACTIVE" +"LP7751-3","SCALE","Ord","Ord","ACTIVE" +"LP37904-7","COMPONENT","DBG Ab","DBG Ab","ACTIVE" +"LP6813-2","PROPERTY","Find","Finding","ACTIVE" +"LP95333-8","METHOD","PhenX","PhenX","ACTIVE" +"LP102627-9","COMPONENT","Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30D","Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days","ACTIVE" +"LP6879-3","PROPERTY","Time","Time (e.g. seconds)","ACTIVE" +"LP31088-5","COMPONENT","R wave duration.lead AVR","R wave duration.lead AVR","ACTIVE" +"LP206647-2","SYSTEM","Neck>Thyroid gland","Thyroid gland","ACTIVE" +"LP208655-3","METHOD","NM","NM","ACTIVE" +"LP32888-7","SCALE","Doc","Doc","ACTIVE" +"LP31534-8","COMPONENT","Study report","Study report","ACTIVE" +"LP7057-5","SYSTEM","Bld","Blood","ACTIVE" +"LP6838-9","PROPERTY","NFr","Number Fraction","ACTIVE" +"LP6141-8","METHOD","Automated count","Automated count","ACTIVE" +"LP15842-5","COMPONENT","Pyridoxine","Pyridoxine","ACTIVE" +"LP19258-0","COMPONENT","Large unstained cells","Large unstained cells","ACTIVE" +"LP32887-9","SYSTEM","{Setting}","{Setting}","ACTIVE" +"LP187178-1","METHOD","{Role}","Role-unspecified","ACTIVE" +"LP72311-1","COMPONENT","Consultation note","Consultation note","ACTIVE" + diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/PartRelatedCodeMapping.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/PartRelatedCodeMapping.csv new file mode 100644 index 00000000000..495416894ce --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PartFile/PartRelatedCodeMapping.csv @@ -0,0 +1,12 @@ +"PartNumber","PartName" ,"PartTypeName","ExtCodeId" ,"ExtCodeDisplayName" ,"ExtCodeSystem" ,"Equivalence","ContentOrigin","ExtCodeSystemVersion" ,"ExtCodeSystemCopyrightNotice" +"LP18172-4" ,"Interferon.beta" ,"COMPONENT" ," 420710006","Interferon beta (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP31706-2" ,"Nornicotine" ,"COMPONENT" ,"1018001" ,"Nornicotine (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP15826-8" ,"Prostaglandin F2","COMPONENT" ,"10192006" ,"Prostaglandin PGF2 (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP7400-7" ,"Liver" ,"SYSTEM" ,"10200004" ,"Liver structure (body structure)","http://snomed.info/sct" ,"wider" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP29165-5" ,"Liver.FNA" ,"SYSTEM" ,"10200004" ,"Liver structure (body structure)","http://snomed.info/sct" ,"narrower" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP15666-8" ,"Inosine" ,"COMPONENT" ,"102640000" ,"Inosine (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP15943-1" ,"Uronate" ,"COMPONENT" ,"102641001" ,"Uronic acid (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP15791-4" ,"Phenylketones" ,"COMPONENT" ,"102642008" ,"Phenylketones (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP15721-1" ,"Malonate" ,"COMPONENT" ,"102648007" ,"Malonic acid (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP15842-5" ,"Pyridoxine" ,"COMPONENT" ,"1054" ,"Pyridoxine" ,"http://pubchem.ncbi.nlm.nih.gov","equivalent" , , , +"LP15842-5" ,"Pyridoxine" ,"COMPONENT" ,"1054" ,"Pyridoxine" ,"http://foo/bar" ,"equivalent" , , , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/Top2000Results/SI/Top2000CommonLabResultsSi.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/Top2000Results/SI/Top2000CommonLabResultsSi.csv new file mode 100644 index 00000000000..1e9b3872892 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/Top2000Results/SI/Top2000CommonLabResultsSi.csv @@ -0,0 +1,10 @@ +LOINC #,Long Common Name,Short Name,CLASS,Rank +14682-9,Creatinine [Moles/volume] in Serum or Plasma,Creat SerPl-mCnc,Chem,1 +718-7,Hemoglobin [Mass/volume] in Blood,Hgb Bld-mCnc,HEM/BC,2 +2823-3,Potassium [Moles/volume] in Serum or Plasma,Potassium SerPl-sCnc,Chem,3 +14749-6,Glucose [Moles/volume] in Serum or Plasma,Glucose SerPl-mCnc,Chem,4 +2951-2,Sodium [Moles/volume] in Serum or Plasma,Sodium SerPl-sCnc,Chem,5 +3094-0,Urea nitrogen [Mass/volume] in Serum or Plasma,BUN SerPl-mCnc,Chem,6 +2028-9,"Carbon dioxide, total [Moles/volume] in Serum or Plasma",CO2 SerPl-sCnc,Chem,7 +2075-0,Chloride [Moles/volume] in Serum or Plasma,Chloride SerPl-sCnc,Chem,8 +789-8,Erythrocytes [#/volume] in Blood by Automated count,RBC # Bld Auto,HEM/BC,9 diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/Top2000Results/US/Top2000CommonLabResultsUs.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/Top2000Results/US/Top2000CommonLabResultsUs.csv new file mode 100644 index 00000000000..c80db052dd3 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/Top2000Results/US/Top2000CommonLabResultsUs.csv @@ -0,0 +1,10 @@ +LOINC #,Long Common Name,Short Name,CLASS,Rank +2160-0,Creatinine [Mass/volume] in Serum or Plasma,Creat SerPl-mCnc,Chem,1 +718-7,Hemoglobin [Mass/volume] in Blood,Hgb Bld-mCnc,HEM/BC,2 +2823-3,Potassium [Moles/volume] in Serum or Plasma,Potassium SerPl-sCnc,Chem,3 +2345-7,Glucose [Mass/volume] in Serum or Plasma,Glucose SerPl-mCnc,Chem,4 +2951-2,Sodium [Moles/volume] in Serum or Plasma,Sodium SerPl-sCnc,Chem,5 +3094-0,Urea nitrogen [Mass/volume] in Serum or Plasma,BUN SerPl-mCnc,Chem,6 +2028-9,"Carbon dioxide, total [Moles/volume] in Serum or Plasma",CO2 SerPl-sCnc,Chem,7 +2075-0,Chloride [Moles/volume] in Serum or Plasma,Chloride SerPl-sCnc,Chem,8 +789-8,Erythrocytes [#/volume] in Blood by Automated count,RBC # Bld Auto,HEM/BC,9 diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/LoincTable/Loinc.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/LoincTable/Loinc.csv new file mode 100644 index 00000000000..4017edb85b0 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/LoincTable/Loinc.csv @@ -0,0 +1,16 @@ +"LOINC_NUM","COMPONENT" ,"PROPERTY","TIME_ASPCT","SYSTEM" ,"SCALE_TYP","METHOD_TYP" ,"CLASS" ,"VersionLastChanged","CHNG_TYPE","DefinitionDescription" ,"STATUS","CONSUMER_NAME","CLASSTYPE","FORMULA","SPECIES","EXMPL_ANSWERS","SURVEY_QUEST_TEXT" ,"SURVEY_QUEST_SRC" ,"UNITSREQUIRED","SUBMITTED_UNITS","RELATEDNAMES2" ,"SHORTNAME" ,"ORDER_OBS" ,"CDISC_COMMON_TESTS","HL7_FIELD_SUBFIELD_ID","EXTERNAL_COPYRIGHT_NOTICE" ,"EXAMPLE_UNITS","LONG_COMMON_NAME" ,"UnitsAndRange","DOCUMENT_SECTION","EXAMPLE_UCUM_UNITS","EXAMPLE_SI_UCUM_UNITS","STATUS_REASON","STATUS_TEXT","CHANGE_REASON_PUBLIC" ,"COMMON_TEST_RANK","COMMON_ORDER_RANK","COMMON_SI_TEST_RANK","HL7_ATTACHMENT_STRUCTURE","EXTERNAL_COPYRIGHT_LINK","PanelType","AskAtOrderEntry","AssociatedObservations" ,"VersionFirstReleased","ValidHL7AttachmentRequest" +"10013-1" ,"v2.67 R' wave amplitude.lead I" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-I; R wave Amp L-I; Random; Right; Voltage" ,"R' wave Amp L-I" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead I" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10014-9" ,"v2.67 R' wave amplitude.lead II" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"2; Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-II; R wave Amp L-II; Random; Right; Voltage" ,"R' wave Amp L-II" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead II" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10015-6" ,"v2.67 R' wave amplitude.lead III" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"3; Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-III; R wave Amp L-III; Random; Right; Voltage" ,"R' wave Amp L-III" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead III" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10016-4" ,"v2.67 R' wave amplitude.lead V1" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V1; R wave Amp L-V1; Random; Right; Voltage" ,"R' wave Amp L-V1" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V1" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"1001-7" ,"v2.67 DBG Ab" ,"Pr" ,"Pt" ,"Ser/Plas^donor" ,"Ord" , ,"BLDBK" ,"2.44" ,"MIN" , ,"ACTIVE", ,1 , , , , , , , ,"ABS; Aby; Antby; Anti; Antibodies; Antibody; Autoantibodies; Autoantibody; BLOOD BANK; Donna Bennett-Goodspeed; Donr; Ordinal; Pl; Plasma; Plsm; Point in time; QL; Qual; Qualitative; Random; Screen; SerP; SerPl; SerPl^donor; SerPlas; Serum; Serum or plasma; SR" ,"DBG Ab SerPl Donr Ql" ,"Observation", , , , ,"DBG Ab [Presence] in Serum or Plasma from donor" , , , , , , ,"The Property has been changed from ACnc to Pr (Presence) to reflect the new model for ordinal terms where results are based on presence or absence." ,0 ,0 ,0 , , , , , , , +"10017-2" ,"v2.67 R' wave amplitude.lead V2" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V2; R wave Amp L-V2; Random; Right; Voltage" ,"R' wave Amp L-V2" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V2" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10018-0" ,"v2.67 R' wave amplitude.lead V3" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V3; R wave Amp L-V3; Random; Right; Voltage" ,"R' wave Amp L-V3" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V3" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10019-8" ,"v2.67 R' wave amplitude.lead V4" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V4; R wave Amp L-V4; Random; Right; Voltage" ,"R' wave Amp L-V4" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V4" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10020-6" ,"v2.67 R' wave amplitude.lead V5" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V5; R wave Amp L-V5; Random; Right; Voltage" ,"R' wave Amp L-V5" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V5" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"61438-8" ,"v2.67 Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30D","Find" ,"Pt" ,"^Patient" ,"Ord" ,"PhenX" ,"PHENX" ,"2.44" ,"MIN" , ,"TRIAL" , ,2 , , , ,"Each time you eat bread, toast or dinner rolls, how much do you usually eat?","PhenX.050201100100","N" , ,"Finding; Findings; How much bread in 30D; Last; Ordinal; Point in time; QL; Qual; Qualitative; Random; Screen" ,"How much bread in 30D PhenX", , , , , ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]", , , , , , , ,0 ,0 ,0 , , , , , , , +"10000-8" ,"v2.67 R wave duration.lead AVR" ,"Time" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; Durat; ECG; EKG.MEASUREMENTS; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave dur L-AVR; R wave dur L-AVR; Random; Right" ,"R wave dur L-AVR" ,"Observation", , , ,"s" ,"R wave duration in lead AVR" , , ,"s" , , , , ,0 ,0 ,0 , , , , , , , +"17787-3" ,"v2.67 Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , +"17788-1" ,"v2.67 Large unstained cells/100 leukocytes" ,"NFr" ,"Pt" ,"Bld" ,"Qn" ,"Automated count","HEM/BC" ,"2.50" ,"MIN" ,"Part of auto diff output of Bayer H*3S; peroxidase negative cells too large to be classified as lymph or basophil" ,"ACTIVE", ,1 , , , , , ,"Y" ,"%" ,"100WBC; Auto; Automated detection; Blood; Cell; Cellularity; Elec; Elect; Electr; HEMATOLOGY/CELL COUNTS; Leuc; Leuk; Leukocyte; Lkcs; LUC; Number Fraction; Percent; Point in time; QNT; Quan; Quant; Quantitative; Random; WB; WBC; WBCs; White blood cell; White blood cells; Whole blood" ,"LUC/leuk NFr Bld Auto" ,"Observation", , , ,"%" ,"Large unstained cells/100 leukocytes in Blood by Automated count" , , ,"%" , , , , ,1894 ,0 ,1894 , , , , , ,"1.0l" , +"11488-4" ,"v2.67 Consultation note" ,"Find" ,"Pt" ,"{Setting}" ,"Doc" ,"{Role}" ,"DOC.ONTOLOGY","2.63" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Consult note; DOC.ONT; Document; Encounter; Evaluation and management; Evaluation and management note; Finding; Findings; notes; Point in time; Random; Visit note" ,"Consult note" ,"Both" , , , , ,"Consult note" , , , , , , ,"Edit made because this term is conformant to the Document Ontology axis values and therefore are being placed in this class.; Based on Clinical LOINC Committee decision during the September 2014 meeting, {Provider} was changed to {Author Type} to emphasize a greater breadth of potential document authors. At the September 2015 Clinical LOINC Committee meeting, the Committee decided to change {Author Type} to {Role} to align with the 'Role' axis name in the LOINC Document Ontology.; Because it is too difficult to maintain and because the distinction between documents and sections is not clear-cut nor necessary in most cases, the DOCUMENT_SECTION field has been deemed to have little value. The field has been set to null in the December 2017 release in preparation for removal in the December 2018 release. These changes were approved by the Clinical LOINC Committee.",0 ,0 ,0 ,"IG exists" , , , ,"81222-2;72231-4;81243-8","1.0j-a" ,"Y" +"47239-9" ,"v2.67 Reason for stopping HIV Rx" ,"Type" ,"Pt" ,"^Patient" ,"Nom" ,"Reported" ,"ART" ,"2.50" ,"MIN" ,"Reason for stopping antiretroviral therapy" ,"ACTIVE", ,2 , , , , , ,"N" , ,"AIDS; Anti-retroviral therapy; ART; Human immunodeficiency virus; Nominal; Point in time; Random; Treatment; Typ" ,"Reason for stopping HIV Rx" ,"Observation", , ,"Copyright © 2006 World Health Organization. Used with permission. Publications of the World Health Organization can be obtained from WHO Press, World Health Organization, 20 Avenue Appia, 1211 Geneva 27, Switzerland (tel: +41 22 791 2476; fax: +41 22 791 4857; email: bookorders@who.int). Requests for permission to reproduce or translate WHO publications – whether for sale or for noncommercial distribution – should be addressed to WHO Press, at the above address (fax: +41 22 791 4806; email: permissions@who.int). The designations employed and the presentation of the material in this publication do not imply the expression of any opinion whatsoever on the part of the World Health Organization concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Dotted lines on maps represent approximate border lines for which there may not yet be full agreement. The mention of specific companies or of certain manufacturers’ products does not imply that they are endorsed or recommended by the World Health Organization in preference to others of a similar nature that are not mentioned. Errors and omissions excepted, the names of proprietary products are distinguished by initial capital letters. All reasonable precautions have been taken by WHO to verify the information contained in this publication. However, the published material is being distributed without warranty of any kind, either express or implied. The responsibility for the interpretation and use of the material lies with the reader. In no event shall the World Health Organization be liable for damages arising from its use.", ,"Reason for stopping HIV treatment" , , , , , , , ,0 ,0 ,0 , ,"WHO_HIV" , , , ,"2.22" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/loinc.xml b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/loinc.xml new file mode 100644 index 00000000000..46e29461fbb --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/loinc.xml @@ -0,0 +1,543 @@ +<!-- +LOINC is a freely available international standard for tests, measurements, and observations. It is a well maintained, version independent code system. + +Use of LOINC is governed by the LOINC License: https://loinc.org/license/ + +This CodeSystem resource describes 'LOINC' independent of any particular version. There are notes about changes for version specific LOINC code system resources. + +Note that the following set of codes are defined by the LOINC code systems: + - the main LOINC codes + - the LOINC Answer codes (LA) and the LOINC Answer list codes (LL) + - the LOINC Part codes (LP) in the Multiaxial Hierarchy + - the LOINC Part codes (LP) for the properties + Note: there are license restrictions on the use of LOINC Part codes + - the LOINC Group codes (LG) + Note: presently the LOINC Group codes are used to identify these roll-up groups as ValueSets, but are not yet loaded as codes in the CodeSystem + +Servers may generate variants of this for the LOINC version(s) and features they support. + +--> + +<CodeSystem xmlns="http://hl7.org/fhir"> + <id value="loinc"/> + + <!-- + This url is unchanged for all versions of LOINC. There can only be one correct Code System resource for each value of the version attribute (at least, only one per server). + --> + <url value="http://loinc.org"/> + + <!-- the HL7 v3 OID assigned to LOINC --> + <identifier> + <system value="urn:ietf:rfc:3986"/> + <value value="urn:oid:2.16.840.1.113883.6.1"/> + </identifier> + +<!-- <version value="2.67"/>--> + + <!-- + If a specific version is specified, the name should carry this information (e.g. LOINC_270). + --> + <name value="LOINC"/> + <title value="LOINC Code System (Testing Copy)"/> + <status value="active"/> + <experimental value="false"/> + + <publisher value="Regenstrief Institute, Inc."/> + <contact> + <telecom> + <system value="url" /> + <value value="http://loinc.org"/> + </telecom> + </contact> + + <!-- + <date value=2021-06/> + --> + <description value="LOINC is a freely available international standard for tests, measurements, and observations"/> + <copyright value="This material contains content from LOINC (http://loinc.org). LOINC is copyright ©1995-2021, Regenstrief Institute, Inc. and the Logical Observation Identifiers Names and Codes (LOINC) Committee and is available at no cost under the license at http://loinc.org/license. LOINC® is a registered United States trademark of Regenstrief Institute, Inc."/> + <caseSensitive value="false"/> + + <valueSet value="http://loinc.org/vs"/> + + <!-- + It's at the discretion of servers whether to present fragments of LOINC hierarchically or not, when using the code system resource. But, if they are hierarchical, the Hierarchy SHALL be based on the is-a relationship that is derived from the LOINC Multiaxial Hierarchy. + --> + <hierarchyMeaning value="is-a"/> + <compositional value="false"/> <!-- no compositional grammar in LOINC --> + <versionNeeded value="false"/> + + <!-- + This canonical definition of LOINC does not include the LOINC content, which is distributed separately for portability. + + Servers may choose to include fragments of LOINC for illustration purposes. + --> + <content value="not-present"/> + + <!-- + <count value="65000"/> + If working with a specific version, you could nominate a count of the total number of concepts (including the answers, Hierarchy, etc.). In this canonical definition we do not. + --> + + <!-- + FILTERS + Generally defined filters for specifying value sets + In LOINC, all the properties can also be used as filters, but they are not defined explicitly as filters. + Parent/child properties are as defined by FHIR. Note that at this time the LOINC code system resource does not support ancestor/descendant relationships. + + For illustration purposes, consider this slice of the LOINC Multiaxial Hierarchy when reading the descriptions below: + + Laboratory [LP29693-6] + Microbiology and Antimicrobial susceptibility [LP343406-7] + Microbiology [LP7819-8] + Microorganism [LP14559-6] + Virus [LP14855-8] + Zika virus [LP200137-0] + Zika virus RNA | XXX [LP203271-4] + Zika virus RNA | XXX | Microbiology [LP379670-5] + Zika virus RNA [Presence] in Unspecified specimen by Probe and target amplification method [79190-5] + + Language Note: The filters defined here are specified using the default LOINC language - English (US). Requests are meant to be specified and interpreted on the English version. The return can be in a specified language (if supported by the server). But note that not all filters/properties have language translations available. + --> + <filter> + <code value="parent"/> + <description value="Allows for the selection of a set of codes based on their appearance in the LOINC Multiaxial Hierarchy. Parent selects immediate parent only. For example, the code '79190-5' has the parent 'LP379670-5'"/> + <operator value="="/> + <value value="A Part code"/> + </filter> + <filter> + <code value="child"/> + <description value="Allows for the selection of a set of codes based on their appearance in the LOINC Multiaxial Hierarchy. Child selects immediate children only. For example, the code 'LP379670-5' has the child '79190-5'. Only LOINC Parts have children; LOINC codes do not have any children because they are leaf nodes."/> + <operator value="="/> + <value value="A comma separated list of Part or LOINC codes"/> + </filter> + <filter> + <code value="copyright"/> + <description value="Allows for the inclusion or exclusion of LOINC codes that include 3rd party copyright notices. LOINC = only codes with a sole copyright by Regenstrief. 3rdParty = only codes with a 3rd party copyright in addition to the one from Regenstrief"/> + <operator value="="/> + <value value="LOINC | 3rdParty"/> + </filter> + + <!-- + PROPERTIES + There are 4 kinds of properties that apply to all LOINC codes: + 1. FHIR: display, designation; these are not described here since they are inherent in the specification + 2. Infrastructural: defined by FHIR, but documented here for the LOINC Multiaxial Hierarchy + 3. Primary LOINC properties: defined by the main LOINC table + 4. Secondary LOINC properties: defined by the LoincPartLink table + Additionally, there are 2 kinds of properties specific to Document ontology and Radiology codes, respectively: + 1. LOINC/RSNA Radiology Playbook properties + 2. Document Ontology properties + --> + <!-- + Infrastructural properties - inherited from FHIR, but documented here for the LOINC Multiaxial Hierarchy. + --> + + <property> + <code value="parent"/> + <uri value="http://hl7.org/fhir/concept-properties#parent"/> + <description value="A parent code in the Multiaxial Hierarchy"/> + <type value="code"/> + </property> + <property> + <code value="child"/> + <uri value="http://hl7.org/fhir/concept-properties#child"/> + <description value="A child code in the Multiaxial Hierarchy"/> + <type value="code"/> + </property> + + <!-- + Primary LOINC properties. + These apply to the main LOINC codes, but not the Multiaxial Hierarchy, Answer lists, or the Part codes. + Notes: + In the LOINC code system resource, the display element = LONG_COMMON_NAME + Many properties are specified as type "Coding", which allows use of LOINC Part codes (LP-) and the display text. LOINC Parts and their associations to LOINC terms are published in the LOINC Part File. + The properties defined here follow the guidance of the LOINC Users' Guide, which states that they should be expressed with the LOINC attributes contained in the LOINC Table. Properties that are not defined in the LOINC Table use FHIR-styled names. + --> + + <property> + <code value="STATUS"/> + <uri value="http://loinc.org/property/STATUS"/> + <description value="Status of the term. Within LOINC, codes with STATUS=DEPRECATED are considered inactive. Current values: ACTIVE, TRIAL, DISCOURAGED, and DEPRECATED"/> + <type value="string"/> + </property> + <property> + <code value="COMPONENT"/> + <uri value="http://loinc.org/property/COMPONENT"/> + <description value="First major axis-component or analyte: Analyte Name, Analyte sub-class, Challenge"/> + <type value="Coding"/> + </property> + <property> + <code value="PROPERTY"/> + <uri value="http://loinc.org/property/PROPERTY"/> + <description value="Second major axis-property observed: Kind of Property (also called kind of quantity)"/> + <type value="Coding"/> + </property> + <property> + <code value="TIME_ASPCT"/> + <uri value="http://loinc.org/property/TIME_ASPCT"/> + <description value="Third major axis-timing of the measurement: Time Aspect (Point or moment in time vs. time interval)"/> + <type value="Coding"/> + </property> + <property> + <code value="SYSTEM"/> + <uri value="http://loinc.org/property/SYSTEM"/> + <description value="Fourth major axis-type of specimen or system: System (Sample) Type"/> + <type value="Coding"/> + </property> + <property> + <code value="SCALE_TYP"/> + <uri value="http://loinc.org/property/SCALE_TYP"/> + <description value="Fifth major axis-scale of measurement: Type of Scale"/> + <type value="Coding"/> + </property> + <property> + <code value="METHOD_TYP"/> + <uri value="http://loinc.org/property/METHOD_TYP"/> + <description value="Sixth major axis-method of measurement: Type of Method"/> + <type value="Coding"/> + </property> + <property> + <code value="CLASS"/> + <uri value="http://loinc.org/property/CLASS"/> + <description value="An arbitrary classification of terms for grouping related observations together"/> + <type value="Coding"/> + </property> + <property> + <code value="VersionLastChanged"/> + <uri value="http://loinc.org/property/VersionLastChanged"/> + <description value="The LOINC version number in which the record has last changed. For new records, this field contains the same value as the VersionFirstReleased property."/> + <type value="string"/> + </property> + <property> + <code value="CLASSTYPE"/> + <uri value="http://loinc.org/property/CLASSTYPE"/> + <description value="1=Laboratory class; 2=Clinical class; 3=Claims attachments; 4=Surveys"/> + <type value="string"/> + </property> + <property> + <code value="ORDER_OBS"/> + <uri value="http://loinc.org/property/ORDER_OBS"/> + <description value="Provides users with an idea of the intended use of the term by categorizing it as an order only, observation only, or both"/> + <type value="string"/> + </property> + <property> + <code value="HL7_ATTACHMENT_STRUCTURE"/> + <uri value="http://loinc.org/property/HL7_ATTACHMENT_STRUCTURE"/> + <description value="This property is populated in collaboration with the HL7 Payer-Provider Exchange (PIE) Work Group (previously called Attachments Work Group) as described in the HL7 Attachment Specification: Supplement to Consolidated CDA Templated Guide."/> + <type value="string"/> + </property> + <property> + <code value="VersionFirstReleased"/> + <uri value="http://loinc.org/property/VersionFirstReleased"/> + <description value="This is the LOINC version number in which this LOINC term was first published."/> + <type value="string"/> + </property> + <property> + <code value="PanelType"/> + <uri value="http://loinc.org/property/PanelType"/> + <description value="For LOINC terms that are panels, this attribute classifies them as a 'Convenience group', 'Organizer', or 'Panel'"/> + <type value="string"/> + </property> + <property> + <code value="ValidHL7AttachmentRequest"/> + <uri value="http://loinc.org/property/ValidHL7AttachmentRequest"/> + <description value="A value of Y in this field indicates that this LOINC code can be sent by a payer as part of an HL7 Attachment request for additional information."/> + <type value="string"/> + </property> + <property> + <code value="DisplayName"/> + <uri value="http://loinc.org/property/DisplayName"/> + <description value="A name that is more 'clinician-friendly' compared to the current LOINC Short Name, Long Common Name, and Fully Specified Name. It is created algorithmically from the manually crafted display text for each Part and is generally more concise than the Long Common Name."/> + <type value="string"/> + </property> + <property> + <code value="answer-list"/> + <uri value="http://loinc.org/property/answer-list"/> + <description value="An answer list associated with this LOINC code (if there are matching answer lists defined)."/> + <type value="Coding"/> + </property> + + <!-- + Secondary LOINC properties. + These properties also apply to the main LOINC codes, but not the Multiaxial Hierarchy, Answer lists, or the Part codes. + Notes: + These properties are defined in the LoincPartLink table. + --> + + <property> + <code value="analyte"/> + <uri value="http://loinc.org/property/analyte"/> + <description value="First sub-part of the Component, i.e., the part of the Component before the first carat"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-core"/> + <uri value="http://loinc.org/property/analyte-core"/> + <description value="The primary part of the analyte without the suffix"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-suffix"/> + <uri value="http://loinc.org/property/analyte-suffix"/> + <description value="The suffix part of the analyte, if present, e.g., Ab or DNA"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-numerator"/> + <uri value="http://loinc.org/property/analyte-numerator"/> + <description value="The numerator part of the analyte, i.e., everything before the slash in analytes that contain a divisor"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-divisor"/> + <uri value="http://loinc.org/property/analyte-divisor"/> + <description value="The divisor part of the analyte, if present, i.e., after the slash and before the first carat"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-divisor-suffix"/> + <uri value="http://loinc.org/property/analyte-divisor-suffix"/> + <description value="The suffix part of the divisor, if present"/> + <type value="Coding"/> + </property> + <property> + <code value="challenge"/> + <uri value="http://loinc.org/property/challenge"/> + <description value="Second sub-part of the Component, i.e., after the first carat"/> + <type value="Coding"/> + </property> + <property> + <code value="adjustment"/> + <uri value="http://loinc.org/property/adjustment"/> + <description value="Third sub-part of the Component, i.e., after the second carat"/> + <type value="Coding"/> + </property> + <property> + <code value="count"/> + <uri value="http://loinc.org/property/count"/> + <description value="Fourth sub-part of the Component, i.e., after the third carat"/> + <type value="Coding"/> + </property> + <property> + <code value="time-core"/> + <uri value="http://loinc.org/property/time-core"/> + <description value="The primary part of the Time"/> + <type value="Coding"/> + </property> + <property> + <code value="time-modifier"/> + <uri value="http://loinc.org/property/time-modifier"/> + <description value="The modifier of the Time value, such as mean or max"/> + <type value="Coding"/> + </property> + <property> + <code value="system-core"/> + <uri value="http://loinc.org/property/system-core"/> + <description value="The primary part of the System, i.e., without the super system"/> + <type value="Coding"/> + </property> + <property> + <code value="super-system"/> + <uri value="http://loinc.org/property/super-system"/> + <description value="The super system part of the System, if present. The super system represents the source of the specimen when the source is someone or something other than the patient whose chart the result will be stored in. For example, fetus is the super system for measurements done on obstetric ultrasounds, because the fetus is being measured and that measurement is being recorded in the patient's (mother's) chart."/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-gene"/> + <uri value="http://loinc.org/property/analyte-gene"/> + <description value="The specific gene represented in the analyte"/> + <type value="Coding"/> + </property> + <property> + <code value="category"/> + <uri value="http://loinc.org/property/category"/> + <description value="A single LOINC term can be assigned one or more categories based on both programmatic and manual tagging. Category properties also utilize LOINC Class Parts."/> + <type value="Coding"/> + </property> + <property> + <code value="search"/> + <uri value="http://loinc.org/property/search"/> + <description value="Synonyms, fragments, and other Parts that are linked to a term to enable more encompassing search results."/> + <type value="Coding"/> + </property> + + <!-- + LOINC/RSNA Radiology Playbook properties. These apply only to terms in the LOINC/RSNA Radiology Playbook File. + Notes: + Properties are specified as type "Coding", which are represented by LOINC Part codes (LP-) and their display names. + The attribute names here use FHIR styled names rather than their original LOINC style names because the original names contain periods. + --> + + <property> + <code value="rad-modality-modality-type"/> + <uri value="http://loinc.org/property/rad-modality-modality-type"/> + <description value="Modality is used to represent the device used to acquire imaging information."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-modality-modality-subtype"/> + <uri value="http://loinc.org/property/rad-modality-modality-subtype"/> + <description value="Modality subtype may be optionally included to signify a particularly common or evocative configuration of the modality."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-anatomic-location-region-imaged"/> + <uri value="http://loinc.org/property/rad-anatomic-location-region-imaged"/> + <description value="The Anatomic Location Region Imaged attribute is used in two ways: as a coarse-grained descriptor of the area imaged and a grouper for finding related imaging exams; or, it is used just as a grouper."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-anatomic-location-imaging-focus"/> + <uri value="http://loinc.org/property/rad-anatomic-location-imaging-focus"/> + <description value="The Anatomic Location Imaging Focus is a more fine-grained descriptor of the specific target structure of an imaging exam. In many areas, the focus should be a specific organ."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-anatomic-location-laterality-presence"/> + <uri value="http://loinc.org/property/rad-anatomic-location-laterality-presence"/> + <description value="Radiology Exams that require laterality to be specified in order to be performed are signified with an Anatomic Location Laterality Presence attribute set to 'True'"/> + <type value="Coding"/> + </property> + <property> + <code value="rad-anatomic-location-laterality"/> + <uri value="http://loinc.org/property/rad-anatomic-location-laterality"/> + <description value="Radiology exam Laterality is specified as one of: Left, Right, Bilateral, Unilateral, Unspecified"/> + <type value="Coding"/> + </property> + <property> + <code value="rad-view-aggregation"/> + <uri value="http://loinc.org/property/rad-view-aggregation"/> + <description value="Aggregation describes the extent of the imaging performed, whether in quantitative terms (e.g., '3 or more views') or subjective terms (e.g., 'complete')."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-view-view-type"/> + <uri value="http://loinc.org/property/rad-view-view-type"/> + <description value="View type names specific views, such as 'lateral' or 'AP'."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-maneuver-maneuver-type"/> + <uri value="http://loinc.org/property/rad-maneuver-maneuver-type"/> + <description value="Maneuver type indicates an action taken with the goal of elucidating or testing a dynamic aspect of the anatomy."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-timing"/> + <uri value="http://loinc.org/property/rad-timing"/> + <description value="The Timing/Existence property used in conjunction with pharmaceutical and maneuver properties. It specifies whether or not the imaging occurs in the presence of the administered pharmaceutical or a maneuver designed to test some dynamic aspect of anatomy or physiology ."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-pharmaceutical-substance-given"/> + <uri value="http://loinc.org/property/rad-pharmaceutical-substance-given"/> + <description value="The Pharmaceutical Substance Given specifies administered contrast agents, radiopharmaceuticals, medications, or other clinically important agents and challenges during the imaging procedure."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-pharmaceutical-route"/> + <uri value="http://loinc.org/property/rad-pharmaceutical-route"/> + <description value="Route specifies the route of administration of the pharmaceutical."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-reason-for-exam"/> + <uri value="http://loinc.org/property/rad-reason-for-exam"/> + <description value="Reason for exam is used to describe a clinical indication or a purpose for the study."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-guidance-for-presence"/> + <uri value="http://loinc.org/property/rad-guidance-for-presence"/> + <description value="Guidance for.Presence indicates when a procedure is guided by imaging."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-guidance-for-approach"/> + <uri value="http://loinc.org/property/rad-guidance-for-approach"/> + <description value="Guidance for.Approach refers to the primary route of access used, such as percutaneous, transcatheter, or transhepatic."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-guidance-for-action"/> + <uri value="http://loinc.org/property/rad-guidance-for-action"/> + <description value="Guidance for.Action indicates the intervention performed, such as biopsy, aspiration, or ablation."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-guidance-for-object"/> + <uri value="http://loinc.org/property/rad-guidance-for-object"/> + <description value="Guidance for.Object specifies the target of the action, such as mass, abscess or cyst."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-subject"/> + <uri value="http://loinc.org/property/rad-subject"/> + <description value="Subject is intended for use when there is a need to distinguish between the patient associated with an imaging study, and the target of the study."/> + <type value="Coding"/> + </property> + + <!-- + Document Ontology properties. + These apply only to terms in the LOINC Document Ontology File + Notes + Properties are specified as type "Coding", which are represented by LOINC Part codes (LP-) and their display names. + The attribute names here use FHIR styled names rather than their original LOINC style names because those contain periods. + --> + + <property> + <code value="document-kind"/> + <uri value="http://loinc.org/property/document-kind"/> + <description value="Characterizes the general structure of the document at a macro level."/> + <type value="Coding"/> + </property> + <property> + <code value="document-role"/> + <uri value="http://loinc.org/property/document-role"/> + <description value="Characterizes the training or professional level of the author of the document, but does not break down to specialty or subspecialty."/> + <type value="Coding"/> + </property> + <property> + <code value="document-setting"/> + <uri value="http://loinc.org/property/document-setting"/> + <description value="Setting is a modest extension of CMS’s coarse definition of care settings, such as outpatient, hospital, etc. Setting is not equivalent to location, which typically has more locally defined meanings."/> + <type value="Coding"/> + </property> + <property> + <code value="document-subject-matter-domain"/> + <uri value="http://loinc.org/property/document-subject-matter-domain"/> + <description value="Characterizes the clinical domain that is the subject of the document. For example, Internal Medicine, Neurology, Physical Therapy, etc."/> + <type value="Coding"/> + </property> + <property> + <code value="document-type-of-service"/> + <uri value="http://loinc.org/property/document-type-of-service"/> + <description value="Characterizes the kind of service or activity provided to/for the patient (or other subject of the service) that is described in the document."/> + <type value="Coding"/> + </property> + + <!-- Answer list related properties --> + <property> + <code value="answers-for"/> + <uri value="http://loinc.org/property/answers-for"/> + <description value="A LOINC Code for which this answer list is used."/> + <type value="Coding"/> + </property> + + <!-- Note for future consideration. These are properties of LA codes in the context of a particular list. Not global properties. + <property> + <code value="sequence"/> + <uri value="http://loinc.org/property/sequence"/> + <description value="Sequence Number of a answer in a set of answers (LA- codes only)"/> + <type value="integer"/> + </property> + <property> + <code value="score"/> + <uri value="http://loinc.org/property/score"/> + <description value="Score assigned to an answer (LA- codes only)"/> + <type value="integer"/> + </property> + --> +</CodeSystem> + + diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/AnswerFile/AnswerList.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/AnswerFile/AnswerList.csv new file mode 100644 index 00000000000..d82c5b4ad6a --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/AnswerFile/AnswerList.csv @@ -0,0 +1,12 @@ +"AnswerListId","AnswerListName" ,"AnswerListOID" ,"ExtDefinedYN","ExtDefinedAnswerListCodeSystem","ExtDefinedAnswerListLink" ,"AnswerStringId","LocalAnswerCode","LocalAnswerCodeSystem","SequenceNumber","DisplayText" ,"ExtCodeId","ExtCodeDisplayName" ,"ExtCodeSystem" ,"ExtCodeSystemVersion" ,"ExtCodeSystemCopyrightNotice" ,"SubsequentTextPrompt","Description","Score" +"LL1000-0" ,"v2.68 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"1 slice or 1 dinner roll" , , , , , , , , +"LL1000-0" ,"v2.68 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"2 slices or 2 dinner rolls" , , , , , , , , +"LL1000-0" ,"v2.68 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"More than 2 slices or 2 dinner rolls", , , , , , , , +"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"Never" , , , , , , , , +"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"1-3 times per month" , , , , , , , , +"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"1-2 times per week" , , , , , , , , +"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"3-4 times per week" , , , , , , , , +"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"5-6 times per week" , , , , , , , , +"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"1 time per day" , , , , , , , , +"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , +"LL1892-0" ,"v2.68 ICD-9_ICD-10" ,"1.3.6.1.4.1.12009.10.1.1069","Y" , ,"http://www.cdc.gov/nchs/icd.htm", , , , , , , , , , , , , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/AnswerFile/LoincAnswerListLink.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/AnswerFile/LoincAnswerListLink.csv new file mode 100644 index 00000000000..820602c77ad --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/AnswerFile/LoincAnswerListLink.csv @@ -0,0 +1,11 @@ +"LoincNumber","LongCommonName" ,"AnswerListId","AnswerListName" ,"AnswerListLinkType","ApplicableContext" +"61438-8" ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]","LL1000-0" ,"PhenX05_13_30D bread amt","NORMATIVE" , +"10061-0" ,"S' wave amplitude in lead I" ,"LL1311-1" ,"PhenX12_44" ,"EXAMPLE" , +"10331-7" ,"Rh [Type] in Blood" ,"LL360-9" ,"Pos|Neg" ,"EXAMPLE" , +"10389-5" ,"Blood product.other [Type]" ,"LL2413-4" ,"Othr bld prod" ,"EXAMPLE" , +"10390-3" ,"Blood product special preparation [Type]" ,"LL2422-5" ,"Blood prod treatment" ,"EXAMPLE" , +"10393-7" ,"Factor IX given [Type]" ,"LL2420-9" ,"Human/Recomb" ,"EXAMPLE" , +"10395-2" ,"Factor VIII given [Type]" ,"LL2420-9" ,"Human/Recomb" ,"EXAMPLE" , +"10401-8" ,"Immune serum globulin given [Type]" ,"LL2421-7" ,"IM/IV" ,"EXAMPLE" , +"10410-9" ,"Plasma given [Type]" ,"LL2417-5" ,"Plasma type" ,"EXAMPLE" , +"10568-4" ,"Clarity of Semen" ,"LL2427-4" ,"Clear/Opales/Milky" ,"EXAMPLE" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/ConsumerName/ConsumerName.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/ConsumerName/ConsumerName.csv new file mode 100644 index 00000000000..b4ec2907985 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/ConsumerName/ConsumerName.csv @@ -0,0 +1,6 @@ +"LoincNumber","ConsumerName" +"61438-8","Consumer Name 61438-8" +,"Consumer Name X" +47239-9","" +"17787-3","Consumer Name 17787-3" +"38699-5","1,1-Dichloroethane, Air" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/DocumentOntology/DocumentOntology.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/DocumentOntology/DocumentOntology.csv new file mode 100644 index 00000000000..f857d7f297b --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/DocumentOntology/DocumentOntology.csv @@ -0,0 +1,10 @@ +"LoincNumber","PartNumber","PartTypeName","PartSequenceOrder","PartName" +"11488-4","LP173418-7","Document.Kind","1","Note" +"11488-4","LP173110-0","Document.TypeOfService","1","Consultation" +"11488-4","LP173061-5","Document.Setting","1","{Setting}" +"11488-4","LP187187-2","Document.Role","1","{Role}" +"11490-0","LP173418-7","Document.Kind","1","Note" +"11490-0","LP173221-5","Document.TypeOfService","1","Discharge summary" +"11490-0","LP173061-5","Document.Setting","1","{Setting}" +"11490-0","LP173084-7","Document.Role","1","Physician" +"11492-6","LP173418-7","Document.Kind","1","Note" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/GroupFile/Group.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/GroupFile/Group.csv new file mode 100644 index 00000000000..66f5561ea1c --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/GroupFile/Group.csv @@ -0,0 +1,2 @@ +"ParentGroupId","GroupId","Group","Archetype","Status","VersionFirstReleased" +"LG100-4","LG1695-8","1,4-Dichlorobenzene|MCnc|Pt|ANYBldSerPl","","Active","" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/GroupFile/GroupLoincTerms.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/GroupFile/GroupLoincTerms.csv new file mode 100644 index 00000000000..04c19759cfb --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/GroupFile/GroupLoincTerms.csv @@ -0,0 +1,3 @@ +"Category","GroupId","Archetype","LoincNumber","LongCommonName" +"Flowsheet","LG1695-8","","17424-3","1,4-Dichlorobenzene [Mass/volume] in Blood" +"Flowsheet","LG1695-8","","13006-2","1,4-Dichlorobenzene [Mass/volume] in Serum or Plasma" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/GroupFile/ParentGroup.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/GroupFile/ParentGroup.csv new file mode 100644 index 00000000000..734a86c43dd --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/GroupFile/ParentGroup.csv @@ -0,0 +1,2 @@ +"ParentGroupId","ParentGroup","Status" +"LG100-4","Chem_DrugTox_Chal_Sero_Allergy<SAME:Comp|Prop|Tm|Syst (except intravascular and urine)><ANYBldSerPlas,ANYUrineUrineSed><ROLLUP:Method>","ACTIVE" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv new file mode 100644 index 00000000000..a26397639ff --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv @@ -0,0 +1,10 @@ +"LOINC_NUM","LONG_COMMON_NAME" +"11525-3","US Pelvis Fetus for pregnancy" +"17787-3","NM Thyroid gland Study report" +"18744-3","Bronchoscopy study" +"18746-8","Colonoscopy study" +"18748-4","Diagnostic imaging study" +"18751-8","Endoscopy study" +"18753-4","Flexible sigmoidoscopy study" +"24531-6","US Retroperitoneum" +"24532-4","US Abdomen RUQ" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LinguisticVariants/LinguisticVariants.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LinguisticVariants/LinguisticVariants.csv new file mode 100644 index 00000000000..c79b3197490 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LinguisticVariants/LinguisticVariants.csv @@ -0,0 +1,9 @@ +"ID","ISO_LANGUAGE","ISO_COUNTRY","LANGUAGE_NAME","PRODUCER" +"5","zh","CN","Chinese (CHINA)","Lin Zhang, A LOINC volunteer from China" +"7","es","AR","Spanish (ARGENTINA)","Conceptum Medical Terminology Center" +"8","fr","CA","French (CANADA)","Canada Health Infoway Inc." +,"de","AT","German (AUSTRIA)","ELGA, Austria" +"88",,"AT","German (AUSTRIA)","ELGA, Austria" +"89","de",,"German (AUSTRIA)","ELGA, Austria" +"90","de","AT",,"ELGA, Austria" +"24","de","AT","German (AUSTRIA)","ELGA, Austria" \ No newline at end of file diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LinguisticVariants/deAT24LinguisticVariant.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LinguisticVariants/deAT24LinguisticVariant.csv new file mode 100644 index 00000000000..c6882d47504 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LinguisticVariants/deAT24LinguisticVariant.csv @@ -0,0 +1,4 @@ +"LOINC_NUM","COMPONENT","PROPERTY","TIME_ASPCT","SYSTEM","SCALE_TYP","METHOD_TYP","CLASS","SHORTNAME","LONG_COMMON_NAME","RELATEDNAMES2","LinguisticVariantDisplayName" +"61438-8","Entlassungsbrief Ärztlich","Ergebnis","Zeitpunkt","{Setting}","Dokument","Dermatologie","DOC.ONTOLOGY","de shortname","de long common name","de related names 2","de linguistic variant display name" +"43730-1","","","","","","","","","","EBV-DNA qn. PCR","EBV-DNA quantitativ PCR" +"17787-3","","","","","","","","","","CoV OC43 RNA ql/SM P","Coronavirus OC43 RNA ql. /Sondermaterial PCR" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LinguisticVariants/frCA8LinguisticVariant.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LinguisticVariants/frCA8LinguisticVariant.csv new file mode 100644 index 00000000000..fa09e0cb242 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LinguisticVariants/frCA8LinguisticVariant.csv @@ -0,0 +1,6 @@ +"LOINC_NUM","COMPONENT","PROPERTY","TIME_ASPCT","SYSTEM","SCALE_TYP","METHOD_TYP","CLASS","SHORTNAME","LONG_COMMON_NAME","RELATEDNAMES2","LinguisticVariantDisplayName" +"61438-8","Cellules de Purkinje cytoplasmique type 2 , IgG","Titre","Temps ponctuel","Sérum","Quantitatif","Immunofluorescence","Sérologie","","","","" +"11704-4","Gliale nucléaire de type 1 , IgG","Titre","Temps ponctuel","LCR","Quantitatif","Immunofluorescence","Sérologie","","","","" +,"Cellules de Purkinje cytoplasmique type 2 , IgG","Titre","Temps ponctuel","Sérum","Quantitatif",,,"","","","" +"17787-3","Virus respiratoire syncytial bovin","Présence-Seuil","Temps ponctuel","XXX","Ordinal","Culture spécifique à un microorganisme","Microbiologie","","","","" +"17788-1","Cellules de Purkinje cytoplasmique type 2 , IgG","Titre","Temps ponctuel","Sérum","Quantitatif",,,"","","","" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LinguisticVariants/zhCN5LinguisticVariant.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LinguisticVariants/zhCN5LinguisticVariant.csv new file mode 100644 index 00000000000..48d07d9fdc3 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LinguisticVariants/zhCN5LinguisticVariant.csv @@ -0,0 +1,9 @@ +"LOINC_NUM","COMPONENT","PROPERTY","TIME_ASPCT","SYSTEM","SCALE_TYP","METHOD_TYP","CLASS","SHORTNAME","LONG_COMMON_NAME","RELATEDNAMES2","LinguisticVariantDisplayName" +"61438-8","血流速度.收缩期.最大值","速度","时间点","大脑中动脉","定量型","超声.多普勒","产科学检查与测量指标.超声","","","Cereb 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 大脑(Cerebral) 时刻;随机;随意;瞬间 术语""cerebral""指的是主要由中枢半球(大脑皮质和基底神经节)组成的那部分脑结构 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"11704-4","血流速度.收缩期.最大值","速度","时间点","动脉导管","定量型","超声.多普勒","产科学检查与测量指标.超声","","","动态 动脉管 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 时刻;随机;随意;瞬间 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"17787-3","血流速度.收缩期.最大值","速度","时间点","二尖瓣^胎儿","定量型","超声.多普勒","产科学检查与测量指标.超声","","","僧帽瓣 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 时刻;随机;随意;瞬间 流 流量;流速;流体 胎;超系统 - 胎儿 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"61438-6",,"速度","时间点","二尖瓣^胎儿","定量型","超声.多普勒","产科学检查与测量指标.超声","","","僧帽瓣 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 时刻;随机;随意;瞬间 流 流量;流速;流体 胎;超系统 - 胎儿 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"10000-8","血流速度.收缩期.最大值",,"时间点","二尖瓣^胎儿","定量型","超声.多普勒","产科学检查与测量指标.超声","","","僧帽瓣 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 时刻;随机;随意;瞬间 流 流量;流速;流体 胎;超系统 - 胎儿 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"17788-1","血流速度.收缩期.最大值","速度",,"大脑中动脉","定量型","超声.多普勒","产科学检查与测量指标.超声","","","Cereb 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 大脑(Cerebral) 时刻;随机;随意;瞬间 术语""cerebral""指的是主要由中枢半球(大脑皮质和基底神经节)组成的那部分脑结构 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"11488-4","血流速度.收缩期.最大值","速度","时间点",,"定量型","超声.多普勒","产科学检查与测量指标.超声","","","Cereb 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 大脑(Cerebral) 时刻;随机;随意;瞬间 术语""cerebral""指的是主要由中枢半球(大脑皮质和基底神经节)组成的那部分脑结构 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"47239-9","血流速度.收缩期.最大值","速度","时间点","大脑中动脉",,"超声.多普勒","产科学检查与测量指标.超声","","","Cereb 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 大脑(Cerebral) 时刻;随机;随意;瞬间 术语""cerebral""指的是主要由中枢半球(大脑皮质和基底神经节)组成的那部分脑结构 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LoincIeeeMedicalDeviceCodeMappingTable/LoincIeeeMedicalDeviceCodeMappingTable.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LoincIeeeMedicalDeviceCodeMappingTable/LoincIeeeMedicalDeviceCodeMappingTable.csv new file mode 100644 index 00000000000..d8cf83cd09e --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LoincIeeeMedicalDeviceCodeMappingTable/LoincIeeeMedicalDeviceCodeMappingTable.csv @@ -0,0 +1,10 @@ +LOINC_NUM,LOINC_LONG_COMMON_NAME,IEEE_CF_CODE10,IEEE_REFID,IEEE_DESCRIPTION,IEEE_DIM,IEEE_UOM_UCUM +11556-8,Oxygen [Partial pressure] in Blood,160116,MDC_CONC_PO2_GEN,,LMT-2L-2 LMT-2L-2,kPa mm[Hg] +11557-6,Carbon dioxide [Partial pressure] in Blood,160064,MDC_CONC_PCO2_GEN,,LMT-2L-2 LMT-2L-2,kPa mm[Hg] +11558-4,pH of Blood,160004,MDC_CONC_PH_GEN,,[pH],[pH] +12961-9,Urea nitrogen [Mass/volume] in Arterial blood,160080,MDC_CONC_UREA_ART,,ML-3 NL-3,mg/dL mmol/L +14749-6,Glucose [Moles/volume] in Serum or Plasma,160196,MDC_CONC_GLU_VENOUS_PLASMA,Plasma glucose concentration taken from venous,NL-3 ,mmol/L +14749-6,Glucose [Moles/volume] in Serum or Plasma,160368,MDC_CONC_GLU_UNDETERMINED_PLASMA,Plasma glucose concentration taken from undetermined sample source,NL-3 ,mmol/L +15074-8,Glucose [Moles/volume] in Blood,160020,MDC_CONC_GLU_GEN,,NL-3,mmol/L +15074-8,Glucose [Moles/volume] in Blood,160364,MDC_CONC_GLU_UNDETERMINED_WHOLEBLOOD,Whole blood glucose concentration taken from undetermined sample source,NL-3 ,mmol/L +17861-6,Calcium [Mass/volume] in Serum or Plasma,160024,MDC_CONC_CA_GEN,,ML-3,mg/dL diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv new file mode 100644 index 00000000000..f935aeec77b --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv @@ -0,0 +1,10 @@ +"LoincNumber","LongCommonName" ,"PartNumber","PartTypeName" ,"PartName" ,"PartSequenceOrder","RID" ,"PreferredName" ,"RPID" ,"LongName" +"17787-3" ,"v2.68 NM Thyroid gland Study report","LP199995-4","Rad.Anatomic Location.Region Imaged","Neck" ,"A" ,"RID7488" ,"neck" ,"" ,"" +"17787-3" ,"v2.68 NM Thyroid gland Study report","LP206648-0","Rad.Anatomic Location.Imaging Focus","Thyroid gland" ,"A" ,"RID7578" ,"thyroid gland" ,"" ,"" +"17787-3" ,"v2.68 NM Thyroid gland Study report","LP208891-4","Rad.Modality.Modality type" ,"NM" ,"A" ,"RID10330","nuclear medicine imaging","" ,"" +"24531-6" ,"v2.68 US Retroperitoneum" ,"LP207608-3","Rad.Modality.Modality type" ,"US" ,"A" ,"RID10326","Ultrasound" ,"RPID2142","US Retroperitoneum" +"24531-6" ,"v2.68 US Retroperitoneum" ,"LP199943-4","Rad.Anatomic Location.Imaging Focus","Retroperitoneum" ,"A" ,"RID431" ,"RETROPERITONEUM" ,"RPID2142","US Retroperitoneum" +"24531-6" ,"v2.68 US Retroperitoneum" ,"LP199956-6","Rad.Anatomic Location.Region Imaged","Abdomen" ,"A" ,"RID56" ,"Abdomen" ,"RPID2142","US Retroperitoneum" +"24532-4" ,"v2.68 US Abdomen RUQ" ,"LP199956-6","Rad.Anatomic Location.Region Imaged","Abdomen" ,"A" ,"RID56" ,"Abdomen" ,"" ,"" +"24532-4" ,"v2.68 US Abdomen RUQ" ,"LP207608-3","Rad.Modality.Modality type" ,"US" ,"A" ,"RID10326","Ultrasound" ,"" ,"" +"24532-4" ,"v2.68 US Abdomen RUQ" ,"LP208105-9","Rad.Anatomic Location.Imaging Focus","Right upper quadrant","A" ,"RID29994","Right upper quadrant" ,"" ,"" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LoincUniversalLabOrdersValueSet/LoincUniversalLabOrdersValueSet.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LoincUniversalLabOrdersValueSet/LoincUniversalLabOrdersValueSet.csv new file mode 100644 index 00000000000..72d95485a58 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/LoincUniversalLabOrdersValueSet/LoincUniversalLabOrdersValueSet.csv @@ -0,0 +1,10 @@ +"LOINC_NUM","LONG_COMMON_NAME","ORDER_OBS" +"42176-8","1,3 beta glucan [Mass/volume] in Serum","Both" +"53835-5","1,5-Anhydroglucitol [Mass/volume] in Serum or Plasma","Both" +"31019-3","10-Hydroxycarbazepine [Mass/volume] in Serum or Plasma","Both" +"6765-2","17-Hydroxypregnenolone [Mass/volume] in Serum or Plasma","Both" +"1668-3","17-Hydroxyprogesterone [Mass/volume] in Serum or Plasma","Both" +"32854-2","17-Hydroxyprogesterone [Presence] in DBS","Both" +"49054-0","25-Hydroxycalciferol [Mass/volume] in Serum or Plasma","Both" +"62292-8","25-Hydroxyvitamin D2+25-Hydroxyvitamin D3 [Mass/volume] in Serum or Plasma","Both" +"44907-4","5-Hydroxyindoleacetate panel - 24 hour Urine","Order" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv new file mode 100644 index 00000000000..527b8fd5cae --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv @@ -0,0 +1,10 @@ +PATH_TO_ROOT,SEQUENCE,IMMEDIATE_PARENT,CODE,CODE_TEXT +,1,,LP31755-9,Microbiology +LP31755-9,1,LP31755-9,LP14559-6,Microorganism +LP31755-9.LP14559-6,1,LP14559-6,LP98185-9,Bacteria +LP31755-9.LP14559-6.LP98185-9,1,LP98185-9,LP14082-9,Bacteria +LP31755-9.LP14559-6.LP98185-9.LP14082-9,1,LP14082-9,LP52258-8,Bacteria | Body Fluid +LP31755-9.LP14559-6.LP98185-9.LP14082-9.LP52258-8,1,LP52258-8,41599-2,Bacteria Fld Ql Micro +LP31755-9.LP14559-6.LP98185-9.LP14082-9,2,LP14082-9,LP52260-4,Bacteria | Cerebral spinal fluid +LP31755-9.LP14559-6.LP98185-9.LP14082-9.LP52260-4,1,LP52260-4,41602-4,Bacteria CSF Ql Micro +LP31755-9.LP14559-6.LP98185-9.LP14082-9,3,LP14082-9,LP52960-9,Bacteria | Cervix diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/AnswerList.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/AnswerList.csv new file mode 100644 index 00000000000..a448cf80f2d --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/AnswerList.csv @@ -0,0 +1,12 @@ +"AnswerListId","AnswerListName" ,"AnswerListOID" ,"ExtDefinedYN","ExtDefinedAnswerListCodeSystem","ExtDefinedAnswerListLink" ,"AnswerStringId","LocalAnswerCode","LocalAnswerCodeSystem","SequenceNumber","DisplayText" ,"ExtCodeId","ExtCodeDisplayName" ,"ExtCodeSystem" ,"ExtCodeSystemVersion" ,"ExtCodeSystemCopyrightNotice" ,"SubsequentTextPrompt","Description","Score" +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"1 slice or 1 dinner roll" , , , , , , , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"2 slices or 2 dinner rolls" , , , , , , , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"More than 2 slices or 2 dinner rolls", , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"Never" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"1-3 times per month" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"1-2 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"3-4 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"5-6 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"1 time per day" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , +"LL1892-0" ,"ICD-9_ICD-10" ,"1.3.6.1.4.1.12009.10.1.1069","Y" , ,"http://www.cdc.gov/nchs/icd.htm", , , , , , , , , , , , , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/Loinc.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/Loinc.csv new file mode 100644 index 00000000000..20379cb7f1d --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/Loinc.csv @@ -0,0 +1,16 @@ +"LOINC_NUM","COMPONENT" ,"PROPERTY","TIME_ASPCT","SYSTEM" ,"SCALE_TYP","METHOD_TYP" ,"CLASS" ,"VersionLastChanged","CHNG_TYPE","DefinitionDescription" ,"STATUS","CONSUMER_NAME","CLASSTYPE","FORMULA","SPECIES","EXMPL_ANSWERS","SURVEY_QUEST_TEXT" ,"SURVEY_QUEST_SRC" ,"UNITSREQUIRED","SUBMITTED_UNITS","RELATEDNAMES2" ,"SHORTNAME" ,"ORDER_OBS" ,"CDISC_COMMON_TESTS","HL7_FIELD_SUBFIELD_ID","EXTERNAL_COPYRIGHT_NOTICE" ,"EXAMPLE_UNITS","LONG_COMMON_NAME" ,"UnitsAndRange","DOCUMENT_SECTION","EXAMPLE_UCUM_UNITS","EXAMPLE_SI_UCUM_UNITS","STATUS_REASON","STATUS_TEXT","CHANGE_REASON_PUBLIC" ,"COMMON_TEST_RANK","COMMON_ORDER_RANK","COMMON_SI_TEST_RANK","HL7_ATTACHMENT_STRUCTURE","EXTERNAL_COPYRIGHT_LINK","PanelType","AskAtOrderEntry","AssociatedObservations" ,"VersionFirstReleased","ValidHL7AttachmentRequest" +"10013-1" ,"R' wave amplitude.lead I" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-I; R wave Amp L-I; Random; Right; Voltage" ,"R' wave Amp L-I" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead I" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10014-9" ,"R' wave amplitude.lead II" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"2; Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-II; R wave Amp L-II; Random; Right; Voltage" ,"R' wave Amp L-II" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead II" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10015-6" ,"R' wave amplitude.lead III" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"3; Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-III; R wave Amp L-III; Random; Right; Voltage" ,"R' wave Amp L-III" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead III" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10016-4" ,"R' wave amplitude.lead V1" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V1; R wave Amp L-V1; Random; Right; Voltage" ,"R' wave Amp L-V1" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V1" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"1001-7" ,"DBG Ab" ,"Pr" ,"Pt" ,"Ser/Plas^donor" ,"Ord" , ,"BLDBK" ,"2.44" ,"MIN" , ,"ACTIVE", ,1 , , , , , , , ,"ABS; Aby; Antby; Anti; Antibodies; Antibody; Autoantibodies; Autoantibody; BLOOD BANK; Donna Bennett-Goodspeed; Donr; Ordinal; Pl; Plasma; Plsm; Point in time; QL; Qual; Qualitative; Random; Screen; SerP; SerPl; SerPl^donor; SerPlas; Serum; Serum or plasma; SR" ,"DBG Ab SerPl Donr Ql" ,"Observation", , , , ,"DBG Ab [Presence] in Serum or Plasma from donor" , , , , , , ,"The Property has been changed from ACnc to Pr (Presence) to reflect the new model for ordinal terms where results are based on presence or absence." ,0 ,0 ,0 , , , , , , , +"10017-2" ,"R' wave amplitude.lead V2" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V2; R wave Amp L-V2; Random; Right; Voltage" ,"R' wave Amp L-V2" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V2" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10018-0" ,"R' wave amplitude.lead V3" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V3; R wave Amp L-V3; Random; Right; Voltage" ,"R' wave Amp L-V3" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V3" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10019-8" ,"R' wave amplitude.lead V4" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V4; R wave Amp L-V4; Random; Right; Voltage" ,"R' wave Amp L-V4" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V4" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10020-6" ,"R' wave amplitude.lead V5" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V5; R wave Amp L-V5; Random; Right; Voltage" ,"R' wave Amp L-V5" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V5" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"61438-8" ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30D","Find" ,"Pt" ,"^Patient" ,"Ord" ,"PhenX" ,"PHENX" ,"2.44" ,"MIN" , ,"TRIAL" , ,2 , , , ,"Each time you eat bread, toast or dinner rolls, how much do you usually eat?","PhenX.050201100100","N" , ,"Finding; Findings; How much bread in 30D; Last; Ordinal; Point in time; QL; Qual; Qualitative; Random; Screen" ,"How much bread in 30D PhenX", , , , , ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]", , , , , , , ,0 ,0 ,0 , , , , , , , +"10000-8" ,"R wave duration.lead AVR" ,"Time" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; Durat; ECG; EKG.MEASUREMENTS; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave dur L-AVR; R wave dur L-AVR; Random; Right" ,"R wave dur L-AVR" ,"Observation", , , ,"s" ,"R wave duration in lead AVR" , , ,"s" , , , , ,0 ,0 ,0 , , , , , , , +"17787-3" ,"Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , +"17788-1" ,"Large unstained cells/100 leukocytes" ,"NFr" ,"Pt" ,"Bld" ,"Qn" ,"Automated count","HEM/BC" ,"2.50" ,"MIN" ,"Part of auto diff output of Bayer H*3S; peroxidase negative cells too large to be classified as lymph or basophil" ,"ACTIVE", ,1 , , , , , ,"Y" ,"%" ,"100WBC; Auto; Automated detection; Blood; Cell; Cellularity; Elec; Elect; Electr; HEMATOLOGY/CELL COUNTS; Leuc; Leuk; Leukocyte; Lkcs; LUC; Number Fraction; Percent; Point in time; QNT; Quan; Quant; Quantitative; Random; WB; WBC; WBCs; White blood cell; White blood cells; Whole blood" ,"LUC/leuk NFr Bld Auto" ,"Observation", , , ,"%" ,"Large unstained cells/100 leukocytes in Blood by Automated count" , , ,"%" , , , , ,1894 ,0 ,1894 , , , , , ,"1.0l" , +"11488-4" ,"Consultation note" ,"Find" ,"Pt" ,"{Setting}" ,"Doc" ,"{Role}" ,"DOC.ONTOLOGY","2.63" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Consult note; DOC.ONT; Document; Encounter; Evaluation and management; Evaluation and management note; Finding; Findings; notes; Point in time; Random; Visit note" ,"Consult note" ,"Both" , , , , ,"Consult note" , , , , , , ,"Edit made because this term is conformant to the Document Ontology axis values and therefore are being placed in this class.; Based on Clinical LOINC Committee decision during the September 2014 meeting, {Provider} was changed to {Author Type} to emphasize a greater breadth of potential document authors. At the September 2015 Clinical LOINC Committee meeting, the Committee decided to change {Author Type} to {Role} to align with the 'Role' axis name in the LOINC Document Ontology.; Because it is too difficult to maintain and because the distinction between documents and sections is not clear-cut nor necessary in most cases, the DOCUMENT_SECTION field has been deemed to have little value. The field has been set to null in the December 2017 release in preparation for removal in the December 2018 release. These changes were approved by the Clinical LOINC Committee.",0 ,0 ,0 ,"IG exists" , , , ,"81222-2;72231-4;81243-8","1.0j-a" ,"Y" +"47239-9" ,"Reason for stopping HIV Rx" ,"Type" ,"Pt" ,"^Patient" ,"Nom" ,"Reported" ,"ART" ,"2.50" ,"MIN" ,"Reason for stopping antiretroviral therapy" ,"ACTIVE", ,2 , , , , , ,"N" , ,"AIDS; Anti-retroviral therapy; ART; Human immunodeficiency virus; Nominal; Point in time; Random; Treatment; Typ" ,"Reason for stopping HIV Rx" ,"Observation", , ,"Copyright © 2006 World Health Organization. Used with permission. Publications of the World Health Organization can be obtained from WHO Press, World Health Organization, 20 Avenue Appia, 1211 Geneva 27, Switzerland (tel: +41 22 791 2476; fax: +41 22 791 4857; email: bookorders@who.int). Requests for permission to reproduce or translate WHO publications – whether for sale or for noncommercial distribution – should be addressed to WHO Press, at the above address (fax: +41 22 791 4806; email: permissions@who.int). The designations employed and the presentation of the material in this publication do not imply the expression of any opinion whatsoever on the part of the World Health Organization concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Dotted lines on maps represent approximate border lines for which there may not yet be full agreement. The mention of specific companies or of certain manufacturers’ products does not imply that they are endorsed or recommended by the World Health Organization in preference to others of a similar nature that are not mentioned. Errors and omissions excepted, the names of proprietary products are distinguished by initial capital letters. All reasonable precautions have been taken by WHO to verify the information contained in this publication. However, the published material is being distributed without warranty of any kind, either express or implied. The responsibility for the interpretation and use of the material lies with the reader. In no event shall the World Health Organization be liable for damages arising from its use.", ,"Reason for stopping HIV treatment" , , , , , , , ,0 ,0 ,0 , ,"WHO_HIV" , , , ,"2.22" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/LoincAnswerListLink.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/LoincAnswerListLink.csv new file mode 100644 index 00000000000..820602c77ad --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/LoincAnswerListLink.csv @@ -0,0 +1,11 @@ +"LoincNumber","LongCommonName" ,"AnswerListId","AnswerListName" ,"AnswerListLinkType","ApplicableContext" +"61438-8" ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]","LL1000-0" ,"PhenX05_13_30D bread amt","NORMATIVE" , +"10061-0" ,"S' wave amplitude in lead I" ,"LL1311-1" ,"PhenX12_44" ,"EXAMPLE" , +"10331-7" ,"Rh [Type] in Blood" ,"LL360-9" ,"Pos|Neg" ,"EXAMPLE" , +"10389-5" ,"Blood product.other [Type]" ,"LL2413-4" ,"Othr bld prod" ,"EXAMPLE" , +"10390-3" ,"Blood product special preparation [Type]" ,"LL2422-5" ,"Blood prod treatment" ,"EXAMPLE" , +"10393-7" ,"Factor IX given [Type]" ,"LL2420-9" ,"Human/Recomb" ,"EXAMPLE" , +"10395-2" ,"Factor VIII given [Type]" ,"LL2420-9" ,"Human/Recomb" ,"EXAMPLE" , +"10401-8" ,"Immune serum globulin given [Type]" ,"LL2421-7" ,"IM/IV" ,"EXAMPLE" , +"10410-9" ,"Plasma given [Type]" ,"LL2417-5" ,"Plasma type" ,"EXAMPLE" , +"10568-4" ,"Clarity of Semen" ,"LL2427-4" ,"Clear/Opales/Milky" ,"EXAMPLE" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/LoincPartLink.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/LoincPartLink.csv new file mode 100644 index 00000000000..36c84f3fe95 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/LoincPartLink.csv @@ -0,0 +1,10 @@ +"LoincNumber","LongCommonName","PartNumber","PartName","PartCodeSystem","PartTypeName","LinkTypeName","Property" +"10013-1","R' wave amplitude in lead I","LP31101-6","R' wave amplitude.lead I","http://loinc.org","COMPONENT","Primary","http://loinc.org/property/COMPONENT" +"10013-1","R' wave amplitude in lead I","LP6802-5","Elpot","http://loinc.org","PROPERTY","Primary","http://loinc.org/property/PROPERTY" +"10013-1","R' wave amplitude in lead I","LP6960-1","Pt","http://loinc.org","TIME","Primary","http://loinc.org/property/TIME_ASPCT" +"10013-1","R' wave amplitude in lead I","LP7289-4","Heart","http://loinc.org","SYSTEM","Primary","http://loinc.org/property/SYSTEM" +"10013-1","R' wave amplitude in lead I","LP7753-9","Qn","http://loinc.org","SCALE","Primary","http://loinc.org/property/SCALE_TYP" +"10013-1","R' wave amplitude in lead I","LP6244-0","EKG","http://loinc.org","METHOD","Primary","http://loinc.org/property/METHOD_TYP" +"10013-1","R' wave amplitude in lead I","LP31101-6","R' wave amplitude.lead I","http://loinc.org","COMPONENT","DetailedModel","http://loinc.org/property/analyte" +"10013-1","R' wave amplitude in lead I","LP6802-5","Elpot","http://loinc.org","PROPERTY","DetailedModel","http://loinc.org/property/PROPERTY" +"10013-1","R' wave amplitude in lead I","LP6960-1","Pt","http://loinc.org","TIME","DetailedModel","http://loinc.org/property/time-core" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/LoincPartLink_Primary.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/LoincPartLink_Primary.csv new file mode 100644 index 00000000000..8dbe575ffd2 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/LoincPartLink_Primary.csv @@ -0,0 +1,7 @@ +"LoincNumber","LongCommonName" ,"PartNumber","PartName" ,"PartCodeSystem" ,"PartTypeName","LinkTypeName","Property" +"10013-1" ,"R' wave amplitude in lead I","LP31101-6" ,"R' wave amplitude.lead I","http://loinc.org","COMPONENT" ,"Primary" ,"http://loinc.org/property/COMPONENT" +"10013-1" ,"R' wave amplitude in lead I","LP6802-5" ,"Elpot" ,"http://loinc.org","PROPERTY" ,"Primary" ,"http://loinc.org/property/PROPERTY" +"10013-1" ,"R' wave amplitude in lead I","LP6960-1" ,"Pt" ,"http://loinc.org","TIME" ,"Primary" ,"http://loinc.org/property/TIME_ASPCT" +"10013-1" ,"R' wave amplitude in lead I","LP7289-4" ,"Heart" ,"http://loinc.org","SYSTEM" ,"Primary" ,"http://loinc.org/property/SYSTEM" +"10013-1" ,"R' wave amplitude in lead I","LP7753-9" ,"Qn" ,"http://loinc.org","SCALE" ,"Primary" ,"http://loinc.org/property/SCALE_TYP" +"10013-1" ,"R' wave amplitude in lead I","LP6244-0" ,"EKG" ,"http://loinc.org","METHOD" ,"Primary" ,"http://loinc.org/property/METHOD_TYP" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/LoincPartLink_Supplementary.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/LoincPartLink_Supplementary.csv new file mode 100644 index 00000000000..869c2c1651d --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/LoincPartLink_Supplementary.csv @@ -0,0 +1,13 @@ +"LoincNumber","LongCommonName" ,"PartNumber","PartName" ,"PartCodeSystem" ,"PartTypeName","LinkTypeName" ,"Property" +"10013-1" ,"R' wave amplitude in lead I","LP31101-6" ,"R' wave amplitude.lead I","http://loinc.org","COMPONENT" ,"DetailedModel" ,"http://loinc.org/property/analyte" +"10013-1" ,"R' wave amplitude in lead I","LP6802-5" ,"Elpot" ,"http://loinc.org","PROPERTY" ,"DetailedModel" ,"http://loinc.org/property/PROPERTY" +"10013-1" ,"R' wave amplitude in lead I","LP6960-1" ,"Pt" ,"http://loinc.org","TIME" ,"DetailedModel" ,"http://loinc.org/property/time-core" +"10013-1" ,"R' wave amplitude in lead I","LP7289-4" ,"Heart" ,"http://loinc.org","SYSTEM" ,"DetailedModel" ,"http://loinc.org/property/system-core" +"10013-1" ,"R' wave amplitude in lead I","LP7753-9" ,"Qn" ,"http://loinc.org","SCALE" ,"DetailedModel" ,"http://loinc.org/property/SCALE_TYP" +"10013-1" ,"R' wave amplitude in lead I","LP6244-0" ,"EKG" ,"http://loinc.org","METHOD" ,"DetailedModel" ,"http://loinc.org/property/METHOD_TYP" +"10013-1" ,"R' wave amplitude in lead I","LP31101-6" ,"R' wave amplitude.lead I","http://loinc.org","COMPONENT" ,"SyntaxEnhancement","http://loinc.org/property/analyte-core" +"10013-1" ,"R' wave amplitude in lead I","LP190563-9","Cardiology" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/category" +"10013-1" ,"R' wave amplitude in lead I","LP29708-2" ,"Cardiology" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/category" +"10013-1" ,"R' wave amplitude in lead I","LP7787-7" ,"Clinical" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/category" +"10013-1" ,"R' wave amplitude in lead I","LP7795-0" ,"EKG measurements" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/category" +"10013-1" ,"R' wave amplitude in lead I","LP7795-0" ,"EKG.MEAS" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/CLASS" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/Part.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/Part.csv new file mode 100644 index 00000000000..d5816ead286 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/Part.csv @@ -0,0 +1,46 @@ +"PartNumber","PartTypeName","PartName","PartDisplayName","Status" +"LP101394-7","ADJUSTMENT","adjusted for maternal weight","adjusted for maternal weight","ACTIVE" +"LP101907-6","ADJUSTMENT","corrected for age","corrected for age","ACTIVE" +"LP115711-6","ADJUSTMENT","corrected for background","corrected for background","ACTIVE" +"LP147359-6","ADJUSTMENT","adjusted for body weight","adjusted for body weight","ACTIVE" +"LP173482-3","ADJUSTMENT","1st specimen","1st specimen","DEPRECATED" +"LP173483-1","ADJUSTMENT","post cyanocobalamin",,"ACTIVE" +"LP173484-9","ADJUSTMENT","W hyperextension)",,"ACTIVE" +"LP6244-0","METHOD","EKG","Electrocardiogram (EKG)","ACTIVE" +"LP18172-4","COMPONENT","Interferon.beta","Interferon beta","ACTIVE" +"LP7289-4","SYSTEM","Heart","Heart","ACTIVE" +"LP6960-1","TIME","Pt","Point in time (spot)","ACTIVE" +"LP6802-5","PROPERTY","Elpot","Electrical Potential (Voltage)","ACTIVE" +"LP7753-9","SCALE","Qn","Qn","ACTIVE" +"LP31101-6","COMPONENT","R' wave amplitude.lead I","R' wave amplitude.lead I","ACTIVE" +"LP31102-4","COMPONENT","R' wave amplitude.lead II","R' wave amplitude.lead II","ACTIVE" +"LP31103-2","COMPONENT","R' wave amplitude.lead III","R' wave amplitude.lead III","ACTIVE" +"LP31104-0","COMPONENT","R' wave amplitude.lead V1","R' wave amplitude.lead V1","ACTIVE" +"LP31105-7","COMPONENT","R' wave amplitude.lead V2","R' wave amplitude.lead V2","ACTIVE" +"LP31106-5","COMPONENT","R' wave amplitude.lead V3","R' wave amplitude.lead V3","ACTIVE" +"LP31107-3","COMPONENT","R' wave amplitude.lead V4","R' wave amplitude.lead V4","ACTIVE" +"LP31108-1","COMPONENT","R' wave amplitude.lead V5","R' wave amplitude.lead V5","ACTIVE" +"LP31109-9","COMPONENT","R' wave amplitude.lead V6","R' wave amplitude.lead V6","ACTIVE" +"LP31110-7","COMPONENT","R' wave duration.lead AVF","R' wave duration.lead AVF","ACTIVE" +"LP30269-2","SYSTEM","Ser/Plas^donor",,"ACTIVE" +"LP149220-8","PROPERTY","Pr","Presence","ACTIVE" +"LP7751-3","SCALE","Ord","Ord","ACTIVE" +"LP37904-7","COMPONENT","DBG Ab","DBG Ab","ACTIVE" +"LP6813-2","PROPERTY","Find","Finding","ACTIVE" +"LP95333-8","METHOD","PhenX","PhenX","ACTIVE" +"LP102627-9","COMPONENT","Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30D","Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days","ACTIVE" +"LP6879-3","PROPERTY","Time","Time (e.g. seconds)","ACTIVE" +"LP31088-5","COMPONENT","R wave duration.lead AVR","R wave duration.lead AVR","ACTIVE" +"LP206647-2","SYSTEM","Neck>Thyroid gland","Thyroid gland","ACTIVE" +"LP208655-3","METHOD","NM","NM","ACTIVE" +"LP32888-7","SCALE","Doc","Doc","ACTIVE" +"LP31534-8","COMPONENT","Study report","Study report","ACTIVE" +"LP7057-5","SYSTEM","Bld","Blood","ACTIVE" +"LP6838-9","PROPERTY","NFr","Number Fraction","ACTIVE" +"LP6141-8","METHOD","Automated count","Automated count","ACTIVE" +"LP15842-5","COMPONENT","Pyridoxine","Pyridoxine","ACTIVE" +"LP19258-0","COMPONENT","Large unstained cells","Large unstained cells","ACTIVE" +"LP32887-9","SYSTEM","{Setting}","{Setting}","ACTIVE" +"LP187178-1","METHOD","{Role}","Role-unspecified","ACTIVE" +"LP72311-1","COMPONENT","Consultation note","Consultation note","ACTIVE" + diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/PartRelatedCodeMapping.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/PartRelatedCodeMapping.csv new file mode 100644 index 00000000000..495416894ce --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PartFile/PartRelatedCodeMapping.csv @@ -0,0 +1,12 @@ +"PartNumber","PartName" ,"PartTypeName","ExtCodeId" ,"ExtCodeDisplayName" ,"ExtCodeSystem" ,"Equivalence","ContentOrigin","ExtCodeSystemVersion" ,"ExtCodeSystemCopyrightNotice" +"LP18172-4" ,"Interferon.beta" ,"COMPONENT" ," 420710006","Interferon beta (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP31706-2" ,"Nornicotine" ,"COMPONENT" ,"1018001" ,"Nornicotine (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP15826-8" ,"Prostaglandin F2","COMPONENT" ,"10192006" ,"Prostaglandin PGF2 (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP7400-7" ,"Liver" ,"SYSTEM" ,"10200004" ,"Liver structure (body structure)","http://snomed.info/sct" ,"wider" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP29165-5" ,"Liver.FNA" ,"SYSTEM" ,"10200004" ,"Liver structure (body structure)","http://snomed.info/sct" ,"narrower" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP15666-8" ,"Inosine" ,"COMPONENT" ,"102640000" ,"Inosine (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP15943-1" ,"Uronate" ,"COMPONENT" ,"102641001" ,"Uronic acid (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP15791-4" ,"Phenylketones" ,"COMPONENT" ,"102642008" ,"Phenylketones (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP15721-1" ,"Malonate" ,"COMPONENT" ,"102648007" ,"Malonic acid (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP15842-5" ,"Pyridoxine" ,"COMPONENT" ,"1054" ,"Pyridoxine" ,"http://pubchem.ncbi.nlm.nih.gov","equivalent" , , , +"LP15842-5" ,"Pyridoxine" ,"COMPONENT" ,"1054" ,"Pyridoxine" ,"http://foo/bar" ,"equivalent" , , , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/Top2000Results/SI/Top2000CommonLabResultsSi.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/Top2000Results/SI/Top2000CommonLabResultsSi.csv new file mode 100644 index 00000000000..1e9b3872892 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/Top2000Results/SI/Top2000CommonLabResultsSi.csv @@ -0,0 +1,10 @@ +LOINC #,Long Common Name,Short Name,CLASS,Rank +14682-9,Creatinine [Moles/volume] in Serum or Plasma,Creat SerPl-mCnc,Chem,1 +718-7,Hemoglobin [Mass/volume] in Blood,Hgb Bld-mCnc,HEM/BC,2 +2823-3,Potassium [Moles/volume] in Serum or Plasma,Potassium SerPl-sCnc,Chem,3 +14749-6,Glucose [Moles/volume] in Serum or Plasma,Glucose SerPl-mCnc,Chem,4 +2951-2,Sodium [Moles/volume] in Serum or Plasma,Sodium SerPl-sCnc,Chem,5 +3094-0,Urea nitrogen [Mass/volume] in Serum or Plasma,BUN SerPl-mCnc,Chem,6 +2028-9,"Carbon dioxide, total [Moles/volume] in Serum or Plasma",CO2 SerPl-sCnc,Chem,7 +2075-0,Chloride [Moles/volume] in Serum or Plasma,Chloride SerPl-sCnc,Chem,8 +789-8,Erythrocytes [#/volume] in Blood by Automated count,RBC # Bld Auto,HEM/BC,9 diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/Top2000Results/US/Top2000CommonLabResultsUs.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/Top2000Results/US/Top2000CommonLabResultsUs.csv new file mode 100644 index 00000000000..c80db052dd3 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/Top2000Results/US/Top2000CommonLabResultsUs.csv @@ -0,0 +1,10 @@ +LOINC #,Long Common Name,Short Name,CLASS,Rank +2160-0,Creatinine [Mass/volume] in Serum or Plasma,Creat SerPl-mCnc,Chem,1 +718-7,Hemoglobin [Mass/volume] in Blood,Hgb Bld-mCnc,HEM/BC,2 +2823-3,Potassium [Moles/volume] in Serum or Plasma,Potassium SerPl-sCnc,Chem,3 +2345-7,Glucose [Mass/volume] in Serum or Plasma,Glucose SerPl-mCnc,Chem,4 +2951-2,Sodium [Moles/volume] in Serum or Plasma,Sodium SerPl-sCnc,Chem,5 +3094-0,Urea nitrogen [Mass/volume] in Serum or Plasma,BUN SerPl-mCnc,Chem,6 +2028-9,"Carbon dioxide, total [Moles/volume] in Serum or Plasma",CO2 SerPl-sCnc,Chem,7 +2075-0,Chloride [Moles/volume] in Serum or Plasma,Chloride SerPl-sCnc,Chem,8 +789-8,Erythrocytes [#/volume] in Blood by Automated count,RBC # Bld Auto,HEM/BC,9 diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/LoincTable/Loinc.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/LoincTable/Loinc.csv new file mode 100644 index 00000000000..8f43cfb4941 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/LoincTable/Loinc.csv @@ -0,0 +1,16 @@ +"LOINC_NUM","COMPONENT" ,"PROPERTY","TIME_ASPCT","SYSTEM" ,"SCALE_TYP","METHOD_TYP" ,"CLASS" ,"VersionLastChanged","CHNG_TYPE","DefinitionDescription" ,"STATUS","CONSUMER_NAME","CLASSTYPE","FORMULA","SPECIES","EXMPL_ANSWERS","SURVEY_QUEST_TEXT" ,"SURVEY_QUEST_SRC" ,"UNITSREQUIRED","SUBMITTED_UNITS","RELATEDNAMES2" ,"SHORTNAME" ,"ORDER_OBS" ,"CDISC_COMMON_TESTS","HL7_FIELD_SUBFIELD_ID","EXTERNAL_COPYRIGHT_NOTICE" ,"EXAMPLE_UNITS","LONG_COMMON_NAME" ,"UnitsAndRange","DOCUMENT_SECTION","EXAMPLE_UCUM_UNITS","EXAMPLE_SI_UCUM_UNITS","STATUS_REASON","STATUS_TEXT","CHANGE_REASON_PUBLIC" ,"COMMON_TEST_RANK","COMMON_ORDER_RANK","COMMON_SI_TEST_RANK","HL7_ATTACHMENT_STRUCTURE","EXTERNAL_COPYRIGHT_LINK","PanelType","AskAtOrderEntry","AssociatedObservations" ,"VersionFirstReleased","ValidHL7AttachmentRequest" +"10013-1" ,"v2.68 R' wave amplitude.lead I" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-I; R wave Amp L-I; Random; Right; Voltage" ,"R' wave Amp L-I" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead I" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10014-9" ,"v2.68 R' wave amplitude.lead II" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"2; Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-II; R wave Amp L-II; Random; Right; Voltage" ,"R' wave Amp L-II" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead II" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10015-6" ,"v2.68 R' wave amplitude.lead III" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"3; Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-III; R wave Amp L-III; Random; Right; Voltage" ,"R' wave Amp L-III" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead III" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10016-4" ,"v2.68 R' wave amplitude.lead V1" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V1; R wave Amp L-V1; Random; Right; Voltage" ,"R' wave Amp L-V1" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V1" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"1001-7" ,"v2.68 DBG Ab" ,"Pr" ,"Pt" ,"Ser/Plas^donor" ,"Ord" , ,"BLDBK" ,"2.44" ,"MIN" , ,"ACTIVE", ,1 , , , , , , , ,"ABS; Aby; Antby; Anti; Antibodies; Antibody; Autoantibodies; Autoantibody; BLOOD BANK; Donna Bennett-Goodspeed; Donr; Ordinal; Pl; Plasma; Plsm; Point in time; QL; Qual; Qualitative; Random; Screen; SerP; SerPl; SerPl^donor; SerPlas; Serum; Serum or plasma; SR" ,"DBG Ab SerPl Donr Ql" ,"Observation", , , , ,"DBG Ab [Presence] in Serum or Plasma from donor" , , , , , , ,"The Property has been changed from ACnc to Pr (Presence) to reflect the new model for ordinal terms where results are based on presence or absence." ,0 ,0 ,0 , , , , , , , +"10017-2" ,"v2.68 R' wave amplitude.lead V2" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V2; R wave Amp L-V2; Random; Right; Voltage" ,"R' wave Amp L-V2" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V2" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10018-0" ,"v2.68 R' wave amplitude.lead V3" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V3; R wave Amp L-V3; Random; Right; Voltage" ,"R' wave Amp L-V3" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V3" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10019-8" ,"v2.68 R' wave amplitude.lead V4" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V4; R wave Amp L-V4; Random; Right; Voltage" ,"R' wave Amp L-V4" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V4" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10020-6" ,"v2.68 R' wave amplitude.lead V5" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V5; R wave Amp L-V5; Random; Right; Voltage" ,"R' wave Amp L-V5" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V5" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"61438-8" ,"v2.68 Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30D","Find" ,"Pt" ,"^Patient" ,"Ord" ,"PhenX" ,"PHENX" ,"2.44" ,"MIN" , ,"TRIAL" , ,2 , , , ,"Each time you eat bread, toast or dinner rolls, how much do you usually eat?","PhenX.050201100100","N" , ,"Finding; Findings; How much bread in 30D; Last; Ordinal; Point in time; QL; Qual; Qualitative; Random; Screen" ,"How much bread in 30D PhenX", , , , , ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]", , , , , , , ,0 ,0 ,0 , , , , , , , +"10000-8" ,"v2.68 R wave duration.lead AVR" ,"Time" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; Durat; ECG; EKG.MEASUREMENTS; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave dur L-AVR; R wave dur L-AVR; Random; Right" ,"R wave dur L-AVR" ,"Observation", , , ,"s" ,"R wave duration in lead AVR" , , ,"s" , , , , ,0 ,0 ,0 , , , , , , , +"17787-3" ,"v2.68 Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , +"17788-1" ,"v2.68 Large unstained cells/100 leukocytes" ,"NFr" ,"Pt" ,"Bld" ,"Qn" ,"Automated count","HEM/BC" ,"2.50" ,"MIN" ,"Part of auto diff output of Bayer H*3S; peroxidase negative cells too large to be classified as lymph or basophil" ,"ACTIVE", ,1 , , , , , ,"Y" ,"%" ,"100WBC; Auto; Automated detection; Blood; Cell; Cellularity; Elec; Elect; Electr; HEMATOLOGY/CELL COUNTS; Leuc; Leuk; Leukocyte; Lkcs; LUC; Number Fraction; Percent; Point in time; QNT; Quan; Quant; Quantitative; Random; WB; WBC; WBCs; White blood cell; White blood cells; Whole blood" ,"LUC/leuk NFr Bld Auto" ,"Observation", , , ,"%" ,"Large unstained cells/100 leukocytes in Blood by Automated count" , , ,"%" , , , , ,1894 ,0 ,1894 , , , , , ,"1.0l" , +"11488-4" ,"v2.68 Consultation note" ,"Find" ,"Pt" ,"{Setting}" ,"Doc" ,"{Role}" ,"DOC.ONTOLOGY","2.63" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Consult note; DOC.ONT; Document; Encounter; Evaluation and management; Evaluation and management note; Finding; Findings; notes; Point in time; Random; Visit note" ,"Consult note" ,"Both" , , , , ,"Consult note" , , , , , , ,"Edit made because this term is conformant to the Document Ontology axis values and therefore are being placed in this class.; Based on Clinical LOINC Committee decision during the September 2014 meeting, {Provider} was changed to {Author Type} to emphasize a greater breadth of potential document authors. At the September 2015 Clinical LOINC Committee meeting, the Committee decided to change {Author Type} to {Role} to align with the 'Role' axis name in the LOINC Document Ontology.; Because it is too difficult to maintain and because the distinction between documents and sections is not clear-cut nor necessary in most cases, the DOCUMENT_SECTION field has been deemed to have little value. The field has been set to null in the December 2017 release in preparation for removal in the December 2018 release. These changes were approved by the Clinical LOINC Committee.",0 ,0 ,0 ,"IG exists" , , , ,"81222-2;72231-4;81243-8","1.0j-a" ,"Y" +"47239-9" ,"v2.68 Reason for stopping HIV Rx" ,"Type" ,"Pt" ,"^Patient" ,"Nom" ,"Reported" ,"ART" ,"2.50" ,"MIN" ,"Reason for stopping antiretroviral therapy" ,"ACTIVE", ,2 , , , , , ,"N" , ,"AIDS; Anti-retroviral therapy; ART; Human immunodeficiency virus; Nominal; Point in time; Random; Treatment; Typ" ,"Reason for stopping HIV Rx" ,"Observation", , ,"Copyright © 2006 World Health Organization. Used with permission. Publications of the World Health Organization can be obtained from WHO Press, World Health Organization, 20 Avenue Appia, 1211 Geneva 27, Switzerland (tel: +41 22 791 2476; fax: +41 22 791 4857; email: bookorders@who.int). Requests for permission to reproduce or translate WHO publications – whether for sale or for noncommercial distribution – should be addressed to WHO Press, at the above address (fax: +41 22 791 4806; email: permissions@who.int). The designations employed and the presentation of the material in this publication do not imply the expression of any opinion whatsoever on the part of the World Health Organization concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Dotted lines on maps represent approximate border lines for which there may not yet be full agreement. The mention of specific companies or of certain manufacturers’ products does not imply that they are endorsed or recommended by the World Health Organization in preference to others of a similar nature that are not mentioned. Errors and omissions excepted, the names of proprietary products are distinguished by initial capital letters. All reasonable precautions have been taken by WHO to verify the information contained in this publication. However, the published material is being distributed without warranty of any kind, either express or implied. The responsibility for the interpretation and use of the material lies with the reader. In no event shall the World Health Organization be liable for damages arising from its use.", ,"Reason for stopping HIV treatment" , , , , , , , ,0 ,0 ,0 , ,"WHO_HIV" , , , ,"2.22" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/loinc.xml b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/loinc.xml new file mode 100644 index 00000000000..0212b1d705e --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/loinc.xml @@ -0,0 +1,543 @@ +<!-- +LOINC is a freely available international standard for tests, measurements, and observations. It is a well maintained, version independent code system. + +Use of LOINC is governed by the LOINC License: https://loinc.org/license/ + +This CodeSystem resource describes 'LOINC' independent of any particular version. There are notes about changes for version specific LOINC code system resources. + +Note that the following set of codes are defined by the LOINC code systems: + - the main LOINC codes + - the LOINC Answer codes (LA) and the LOINC Answer list codes (LL) + - the LOINC Part codes (LP) in the Multiaxial Hierarchy + - the LOINC Part codes (LP) for the properties + Note: there are license restrictions on the use of LOINC Part codes + - the LOINC Group codes (LG) + Note: presently the LOINC Group codes are used to identify these roll-up groups as ValueSets, but are not yet loaded as codes in the CodeSystem + +Servers may generate variants of this for the LOINC version(s) and features they support. + +--> + +<CodeSystem xmlns="http://hl7.org/fhir"> + <id value="loinc"/> + + <!-- + This url is unchanged for all versions of LOINC. There can only be one correct Code System resource for each value of the version attribute (at least, only one per server). + --> + <url value="http://loinc.org"/> + + <!-- the HL7 v3 OID assigned to LOINC --> + <identifier> + <system value="urn:ietf:rfc:3986"/> + <value value="urn:oid:2.16.840.1.113883.6.1"/> + </identifier> + +<!-- <version value="2.68"/>--> + + <!-- + If a specific version is specified, the name should carry this information (e.g. LOINC_270). + --> + <name value="LOINC"/> + <title value="LOINC Code System (Testing Copy)"/> + <status value="active"/> + <experimental value="false"/> + + <publisher value="Regenstrief Institute, Inc."/> + <contact> + <telecom> + <system value="url" /> + <value value="http://loinc.org"/> + </telecom> + </contact> + + <!-- + <date value=2021-06/> + --> + <description value="LOINC is a freely available international standard for tests, measurements, and observations"/> + <copyright value="This material contains content from LOINC (http://loinc.org). LOINC is copyright ©1995-2021, Regenstrief Institute, Inc. and the Logical Observation Identifiers Names and Codes (LOINC) Committee and is available at no cost under the license at http://loinc.org/license. LOINC® is a registered United States trademark of Regenstrief Institute, Inc."/> + <caseSensitive value="false"/> + + <valueSet value="http://loinc.org/vs"/> + + <!-- + It's at the discretion of servers whether to present fragments of LOINC hierarchically or not, when using the code system resource. But, if they are hierarchical, the Hierarchy SHALL be based on the is-a relationship that is derived from the LOINC Multiaxial Hierarchy. + --> + <hierarchyMeaning value="is-a"/> + <compositional value="false"/> <!-- no compositional grammar in LOINC --> + <versionNeeded value="false"/> + + <!-- + This canonical definition of LOINC does not include the LOINC content, which is distributed separately for portability. + + Servers may choose to include fragments of LOINC for illustration purposes. + --> + <content value="not-present"/> + + <!-- + <count value="65000"/> + If working with a specific version, you could nominate a count of the total number of concepts (including the answers, Hierarchy, etc.). In this canonical definition we do not. + --> + + <!-- + FILTERS + Generally defined filters for specifying value sets + In LOINC, all the properties can also be used as filters, but they are not defined explicitly as filters. + Parent/child properties are as defined by FHIR. Note that at this time the LOINC code system resource does not support ancestor/descendant relationships. + + For illustration purposes, consider this slice of the LOINC Multiaxial Hierarchy when reading the descriptions below: + + Laboratory [LP29693-6] + Microbiology and Antimicrobial susceptibility [LP343406-7] + Microbiology [LP7819-8] + Microorganism [LP14559-6] + Virus [LP14855-8] + Zika virus [LP200137-0] + Zika virus RNA | XXX [LP203271-4] + Zika virus RNA | XXX | Microbiology [LP379670-5] + Zika virus RNA [Presence] in Unspecified specimen by Probe and target amplification method [79190-5] + + Language Note: The filters defined here are specified using the default LOINC language - English (US). Requests are meant to be specified and interpreted on the English version. The return can be in a specified language (if supported by the server). But note that not all filters/properties have language translations available. + --> + <filter> + <code value="parent"/> + <description value="Allows for the selection of a set of codes based on their appearance in the LOINC Multiaxial Hierarchy. Parent selects immediate parent only. For example, the code '79190-5' has the parent 'LP379670-5'"/> + <operator value="="/> + <value value="A Part code"/> + </filter> + <filter> + <code value="child"/> + <description value="Allows for the selection of a set of codes based on their appearance in the LOINC Multiaxial Hierarchy. Child selects immediate children only. For example, the code 'LP379670-5' has the child '79190-5'. Only LOINC Parts have children; LOINC codes do not have any children because they are leaf nodes."/> + <operator value="="/> + <value value="A comma separated list of Part or LOINC codes"/> + </filter> + <filter> + <code value="copyright"/> + <description value="Allows for the inclusion or exclusion of LOINC codes that include 3rd party copyright notices. LOINC = only codes with a sole copyright by Regenstrief. 3rdParty = only codes with a 3rd party copyright in addition to the one from Regenstrief"/> + <operator value="="/> + <value value="LOINC | 3rdParty"/> + </filter> + + <!-- + PROPERTIES + There are 4 kinds of properties that apply to all LOINC codes: + 1. FHIR: display, designation; these are not described here since they are inherent in the specification + 2. Infrastructural: defined by FHIR, but documented here for the LOINC Multiaxial Hierarchy + 3. Primary LOINC properties: defined by the main LOINC table + 4. Secondary LOINC properties: defined by the LoincPartLink table + Additionally, there are 2 kinds of properties specific to Document ontology and Radiology codes, respectively: + 1. LOINC/RSNA Radiology Playbook properties + 2. Document Ontology properties + --> + <!-- + Infrastructural properties - inherited from FHIR, but documented here for the LOINC Multiaxial Hierarchy. + --> + + <property> + <code value="parent"/> + <uri value="http://hl7.org/fhir/concept-properties#parent"/> + <description value="A parent code in the Multiaxial Hierarchy"/> + <type value="code"/> + </property> + <property> + <code value="child"/> + <uri value="http://hl7.org/fhir/concept-properties#child"/> + <description value="A child code in the Multiaxial Hierarchy"/> + <type value="code"/> + </property> + + <!-- + Primary LOINC properties. + These apply to the main LOINC codes, but not the Multiaxial Hierarchy, Answer lists, or the Part codes. + Notes: + In the LOINC code system resource, the display element = LONG_COMMON_NAME + Many properties are specified as type "Coding", which allows use of LOINC Part codes (LP-) and the display text. LOINC Parts and their associations to LOINC terms are published in the LOINC Part File. + The properties defined here follow the guidance of the LOINC Users' Guide, which states that they should be expressed with the LOINC attributes contained in the LOINC Table. Properties that are not defined in the LOINC Table use FHIR-styled names. + --> + + <property> + <code value="STATUS"/> + <uri value="http://loinc.org/property/STATUS"/> + <description value="Status of the term. Within LOINC, codes with STATUS=DEPRECATED are considered inactive. Current values: ACTIVE, TRIAL, DISCOURAGED, and DEPRECATED"/> + <type value="string"/> + </property> + <property> + <code value="COMPONENT"/> + <uri value="http://loinc.org/property/COMPONENT"/> + <description value="First major axis-component or analyte: Analyte Name, Analyte sub-class, Challenge"/> + <type value="Coding"/> + </property> + <property> + <code value="PROPERTY"/> + <uri value="http://loinc.org/property/PROPERTY"/> + <description value="Second major axis-property observed: Kind of Property (also called kind of quantity)"/> + <type value="Coding"/> + </property> + <property> + <code value="TIME_ASPCT"/> + <uri value="http://loinc.org/property/TIME_ASPCT"/> + <description value="Third major axis-timing of the measurement: Time Aspect (Point or moment in time vs. time interval)"/> + <type value="Coding"/> + </property> + <property> + <code value="SYSTEM"/> + <uri value="http://loinc.org/property/SYSTEM"/> + <description value="Fourth major axis-type of specimen or system: System (Sample) Type"/> + <type value="Coding"/> + </property> + <property> + <code value="SCALE_TYP"/> + <uri value="http://loinc.org/property/SCALE_TYP"/> + <description value="Fifth major axis-scale of measurement: Type of Scale"/> + <type value="Coding"/> + </property> + <property> + <code value="METHOD_TYP"/> + <uri value="http://loinc.org/property/METHOD_TYP"/> + <description value="Sixth major axis-method of measurement: Type of Method"/> + <type value="Coding"/> + </property> + <property> + <code value="CLASS"/> + <uri value="http://loinc.org/property/CLASS"/> + <description value="An arbitrary classification of terms for grouping related observations together"/> + <type value="Coding"/> + </property> + <property> + <code value="VersionLastChanged"/> + <uri value="http://loinc.org/property/VersionLastChanged"/> + <description value="The LOINC version number in which the record has last changed. For new records, this field contains the same value as the VersionFirstReleased property."/> + <type value="string"/> + </property> + <property> + <code value="CLASSTYPE"/> + <uri value="http://loinc.org/property/CLASSTYPE"/> + <description value="1=Laboratory class; 2=Clinical class; 3=Claims attachments; 4=Surveys"/> + <type value="string"/> + </property> + <property> + <code value="ORDER_OBS"/> + <uri value="http://loinc.org/property/ORDER_OBS"/> + <description value="Provides users with an idea of the intended use of the term by categorizing it as an order only, observation only, or both"/> + <type value="string"/> + </property> + <property> + <code value="HL7_ATTACHMENT_STRUCTURE"/> + <uri value="http://loinc.org/property/HL7_ATTACHMENT_STRUCTURE"/> + <description value="This property is populated in collaboration with the HL7 Payer-Provider Exchange (PIE) Work Group (previously called Attachments Work Group) as described in the HL7 Attachment Specification: Supplement to Consolidated CDA Templated Guide."/> + <type value="string"/> + </property> + <property> + <code value="VersionFirstReleased"/> + <uri value="http://loinc.org/property/VersionFirstReleased"/> + <description value="This is the LOINC version number in which this LOINC term was first published."/> + <type value="string"/> + </property> + <property> + <code value="PanelType"/> + <uri value="http://loinc.org/property/PanelType"/> + <description value="For LOINC terms that are panels, this attribute classifies them as a 'Convenience group', 'Organizer', or 'Panel'"/> + <type value="string"/> + </property> + <property> + <code value="ValidHL7AttachmentRequest"/> + <uri value="http://loinc.org/property/ValidHL7AttachmentRequest"/> + <description value="A value of Y in this field indicates that this LOINC code can be sent by a payer as part of an HL7 Attachment request for additional information."/> + <type value="string"/> + </property> + <property> + <code value="DisplayName"/> + <uri value="http://loinc.org/property/DisplayName"/> + <description value="A name that is more 'clinician-friendly' compared to the current LOINC Short Name, Long Common Name, and Fully Specified Name. It is created algorithmically from the manually crafted display text for each Part and is generally more concise than the Long Common Name."/> + <type value="string"/> + </property> + <property> + <code value="answer-list"/> + <uri value="http://loinc.org/property/answer-list"/> + <description value="An answer list associated with this LOINC code (if there are matching answer lists defined)."/> + <type value="Coding"/> + </property> + + <!-- + Secondary LOINC properties. + These properties also apply to the main LOINC codes, but not the Multiaxial Hierarchy, Answer lists, or the Part codes. + Notes: + These properties are defined in the LoincPartLink table. + --> + + <property> + <code value="analyte"/> + <uri value="http://loinc.org/property/analyte"/> + <description value="First sub-part of the Component, i.e., the part of the Component before the first carat"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-core"/> + <uri value="http://loinc.org/property/analyte-core"/> + <description value="The primary part of the analyte without the suffix"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-suffix"/> + <uri value="http://loinc.org/property/analyte-suffix"/> + <description value="The suffix part of the analyte, if present, e.g., Ab or DNA"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-numerator"/> + <uri value="http://loinc.org/property/analyte-numerator"/> + <description value="The numerator part of the analyte, i.e., everything before the slash in analytes that contain a divisor"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-divisor"/> + <uri value="http://loinc.org/property/analyte-divisor"/> + <description value="The divisor part of the analyte, if present, i.e., after the slash and before the first carat"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-divisor-suffix"/> + <uri value="http://loinc.org/property/analyte-divisor-suffix"/> + <description value="The suffix part of the divisor, if present"/> + <type value="Coding"/> + </property> + <property> + <code value="challenge"/> + <uri value="http://loinc.org/property/challenge"/> + <description value="Second sub-part of the Component, i.e., after the first carat"/> + <type value="Coding"/> + </property> + <property> + <code value="adjustment"/> + <uri value="http://loinc.org/property/adjustment"/> + <description value="Third sub-part of the Component, i.e., after the second carat"/> + <type value="Coding"/> + </property> + <property> + <code value="count"/> + <uri value="http://loinc.org/property/count"/> + <description value="Fourth sub-part of the Component, i.e., after the third carat"/> + <type value="Coding"/> + </property> + <property> + <code value="time-core"/> + <uri value="http://loinc.org/property/time-core"/> + <description value="The primary part of the Time"/> + <type value="Coding"/> + </property> + <property> + <code value="time-modifier"/> + <uri value="http://loinc.org/property/time-modifier"/> + <description value="The modifier of the Time value, such as mean or max"/> + <type value="Coding"/> + </property> + <property> + <code value="system-core"/> + <uri value="http://loinc.org/property/system-core"/> + <description value="The primary part of the System, i.e., without the super system"/> + <type value="Coding"/> + </property> + <property> + <code value="super-system"/> + <uri value="http://loinc.org/property/super-system"/> + <description value="The super system part of the System, if present. The super system represents the source of the specimen when the source is someone or something other than the patient whose chart the result will be stored in. For example, fetus is the super system for measurements done on obstetric ultrasounds, because the fetus is being measured and that measurement is being recorded in the patient's (mother's) chart."/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-gene"/> + <uri value="http://loinc.org/property/analyte-gene"/> + <description value="The specific gene represented in the analyte"/> + <type value="Coding"/> + </property> + <property> + <code value="category"/> + <uri value="http://loinc.org/property/category"/> + <description value="A single LOINC term can be assigned one or more categories based on both programmatic and manual tagging. Category properties also utilize LOINC Class Parts."/> + <type value="Coding"/> + </property> + <property> + <code value="search"/> + <uri value="http://loinc.org/property/search"/> + <description value="Synonyms, fragments, and other Parts that are linked to a term to enable more encompassing search results."/> + <type value="Coding"/> + </property> + + <!-- + LOINC/RSNA Radiology Playbook properties. These apply only to terms in the LOINC/RSNA Radiology Playbook File. + Notes: + Properties are specified as type "Coding", which are represented by LOINC Part codes (LP-) and their display names. + The attribute names here use FHIR styled names rather than their original LOINC style names because the original names contain periods. + --> + + <property> + <code value="rad-modality-modality-type"/> + <uri value="http://loinc.org/property/rad-modality-modality-type"/> + <description value="Modality is used to represent the device used to acquire imaging information."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-modality-modality-subtype"/> + <uri value="http://loinc.org/property/rad-modality-modality-subtype"/> + <description value="Modality subtype may be optionally included to signify a particularly common or evocative configuration of the modality."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-anatomic-location-region-imaged"/> + <uri value="http://loinc.org/property/rad-anatomic-location-region-imaged"/> + <description value="The Anatomic Location Region Imaged attribute is used in two ways: as a coarse-grained descriptor of the area imaged and a grouper for finding related imaging exams; or, it is used just as a grouper."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-anatomic-location-imaging-focus"/> + <uri value="http://loinc.org/property/rad-anatomic-location-imaging-focus"/> + <description value="The Anatomic Location Imaging Focus is a more fine-grained descriptor of the specific target structure of an imaging exam. In many areas, the focus should be a specific organ."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-anatomic-location-laterality-presence"/> + <uri value="http://loinc.org/property/rad-anatomic-location-laterality-presence"/> + <description value="Radiology Exams that require laterality to be specified in order to be performed are signified with an Anatomic Location Laterality Presence attribute set to 'True'"/> + <type value="Coding"/> + </property> + <property> + <code value="rad-anatomic-location-laterality"/> + <uri value="http://loinc.org/property/rad-anatomic-location-laterality"/> + <description value="Radiology exam Laterality is specified as one of: Left, Right, Bilateral, Unilateral, Unspecified"/> + <type value="Coding"/> + </property> + <property> + <code value="rad-view-aggregation"/> + <uri value="http://loinc.org/property/rad-view-aggregation"/> + <description value="Aggregation describes the extent of the imaging performed, whether in quantitative terms (e.g., '3 or more views') or subjective terms (e.g., 'complete')."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-view-view-type"/> + <uri value="http://loinc.org/property/rad-view-view-type"/> + <description value="View type names specific views, such as 'lateral' or 'AP'."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-maneuver-maneuver-type"/> + <uri value="http://loinc.org/property/rad-maneuver-maneuver-type"/> + <description value="Maneuver type indicates an action taken with the goal of elucidating or testing a dynamic aspect of the anatomy."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-timing"/> + <uri value="http://loinc.org/property/rad-timing"/> + <description value="The Timing/Existence property used in conjunction with pharmaceutical and maneuver properties. It specifies whether or not the imaging occurs in the presence of the administered pharmaceutical or a maneuver designed to test some dynamic aspect of anatomy or physiology ."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-pharmaceutical-substance-given"/> + <uri value="http://loinc.org/property/rad-pharmaceutical-substance-given"/> + <description value="The Pharmaceutical Substance Given specifies administered contrast agents, radiopharmaceuticals, medications, or other clinically important agents and challenges during the imaging procedure."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-pharmaceutical-route"/> + <uri value="http://loinc.org/property/rad-pharmaceutical-route"/> + <description value="Route specifies the route of administration of the pharmaceutical."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-reason-for-exam"/> + <uri value="http://loinc.org/property/rad-reason-for-exam"/> + <description value="Reason for exam is used to describe a clinical indication or a purpose for the study."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-guidance-for-presence"/> + <uri value="http://loinc.org/property/rad-guidance-for-presence"/> + <description value="Guidance for.Presence indicates when a procedure is guided by imaging."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-guidance-for-approach"/> + <uri value="http://loinc.org/property/rad-guidance-for-approach"/> + <description value="Guidance for.Approach refers to the primary route of access used, such as percutaneous, transcatheter, or transhepatic."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-guidance-for-action"/> + <uri value="http://loinc.org/property/rad-guidance-for-action"/> + <description value="Guidance for.Action indicates the intervention performed, such as biopsy, aspiration, or ablation."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-guidance-for-object"/> + <uri value="http://loinc.org/property/rad-guidance-for-object"/> + <description value="Guidance for.Object specifies the target of the action, such as mass, abscess or cyst."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-subject"/> + <uri value="http://loinc.org/property/rad-subject"/> + <description value="Subject is intended for use when there is a need to distinguish between the patient associated with an imaging study, and the target of the study."/> + <type value="Coding"/> + </property> + + <!-- + Document Ontology properties. + These apply only to terms in the LOINC Document Ontology File + Notes + Properties are specified as type "Coding", which are represented by LOINC Part codes (LP-) and their display names. + The attribute names here use FHIR styled names rather than their original LOINC style names because those contain periods. + --> + + <property> + <code value="document-kind"/> + <uri value="http://loinc.org/property/document-kind"/> + <description value="Characterizes the general structure of the document at a macro level."/> + <type value="Coding"/> + </property> + <property> + <code value="document-role"/> + <uri value="http://loinc.org/property/document-role"/> + <description value="Characterizes the training or professional level of the author of the document, but does not break down to specialty or subspecialty."/> + <type value="Coding"/> + </property> + <property> + <code value="document-setting"/> + <uri value="http://loinc.org/property/document-setting"/> + <description value="Setting is a modest extension of CMS’s coarse definition of care settings, such as outpatient, hospital, etc. Setting is not equivalent to location, which typically has more locally defined meanings."/> + <type value="Coding"/> + </property> + <property> + <code value="document-subject-matter-domain"/> + <uri value="http://loinc.org/property/document-subject-matter-domain"/> + <description value="Characterizes the clinical domain that is the subject of the document. For example, Internal Medicine, Neurology, Physical Therapy, etc."/> + <type value="Coding"/> + </property> + <property> + <code value="document-type-of-service"/> + <uri value="http://loinc.org/property/document-type-of-service"/> + <description value="Characterizes the kind of service or activity provided to/for the patient (or other subject of the service) that is described in the document."/> + <type value="Coding"/> + </property> + + <!-- Answer list related properties --> + <property> + <code value="answers-for"/> + <uri value="http://loinc.org/property/answers-for"/> + <description value="A LOINC Code for which this answer list is used."/> + <type value="Coding"/> + </property> + + <!-- Note for future consideration. These are properties of LA codes in the context of a particular list. Not global properties. + <property> + <code value="sequence"/> + <uri value="http://loinc.org/property/sequence"/> + <description value="Sequence Number of a answer in a set of answers (LA- codes only)"/> + <type value="integer"/> + </property> + <property> + <code value="score"/> + <uri value="http://loinc.org/property/score"/> + <description value="Score assigned to an answer (LA- codes only)"/> + <type value="integer"/> + </property> + --> +</CodeSystem> + + diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/AnswerFile/AnswerList.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/AnswerFile/AnswerList.csv new file mode 100644 index 00000000000..ec157fd70fe --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/AnswerFile/AnswerList.csv @@ -0,0 +1,12 @@ +"AnswerListId","AnswerListName" ,"AnswerListOID" ,"ExtDefinedYN","ExtDefinedAnswerListCodeSystem","ExtDefinedAnswerListLink" ,"AnswerStringId","LocalAnswerCode","LocalAnswerCodeSystem","SequenceNumber","DisplayText" ,"ExtCodeId","ExtCodeDisplayName" ,"ExtCodeSystem" ,"ExtCodeSystemVersion" ,"ExtCodeSystemCopyrightNotice" ,"SubsequentTextPrompt","Description","Score" +"LL1000-0" ,"v2.69 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"1 slice or 1 dinner roll" , , , , , , , , +"LL1000-0" ,"v2.69 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"2 slices or 2 dinner rolls" , , , , , , , , +"LL1000-0" ,"v2.69 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"More than 2 slices or 2 dinner rolls", , , , , , , , +"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"Never" , , , , , , , , +"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"1-3 times per month" , , , , , , , , +"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"1-2 times per week" , , , , , , , , +"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"3-4 times per week" , , , , , , , , +"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"5-6 times per week" , , , , , , , , +"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"1 time per day" , , , , , , , , +"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , +"LL1892-0" ,"v2.69 ICD-9_ICD-10" ,"1.3.6.1.4.1.12009.10.1.1069","Y" , ,"http://www.cdc.gov/nchs/icd.htm", , , , , , , , , , , , , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/AnswerFile/LoincAnswerListLink.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/AnswerFile/LoincAnswerListLink.csv new file mode 100644 index 00000000000..820602c77ad --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/AnswerFile/LoincAnswerListLink.csv @@ -0,0 +1,11 @@ +"LoincNumber","LongCommonName" ,"AnswerListId","AnswerListName" ,"AnswerListLinkType","ApplicableContext" +"61438-8" ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]","LL1000-0" ,"PhenX05_13_30D bread amt","NORMATIVE" , +"10061-0" ,"S' wave amplitude in lead I" ,"LL1311-1" ,"PhenX12_44" ,"EXAMPLE" , +"10331-7" ,"Rh [Type] in Blood" ,"LL360-9" ,"Pos|Neg" ,"EXAMPLE" , +"10389-5" ,"Blood product.other [Type]" ,"LL2413-4" ,"Othr bld prod" ,"EXAMPLE" , +"10390-3" ,"Blood product special preparation [Type]" ,"LL2422-5" ,"Blood prod treatment" ,"EXAMPLE" , +"10393-7" ,"Factor IX given [Type]" ,"LL2420-9" ,"Human/Recomb" ,"EXAMPLE" , +"10395-2" ,"Factor VIII given [Type]" ,"LL2420-9" ,"Human/Recomb" ,"EXAMPLE" , +"10401-8" ,"Immune serum globulin given [Type]" ,"LL2421-7" ,"IM/IV" ,"EXAMPLE" , +"10410-9" ,"Plasma given [Type]" ,"LL2417-5" ,"Plasma type" ,"EXAMPLE" , +"10568-4" ,"Clarity of Semen" ,"LL2427-4" ,"Clear/Opales/Milky" ,"EXAMPLE" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/ConsumerName/ConsumerName.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/ConsumerName/ConsumerName.csv new file mode 100644 index 00000000000..b4ec2907985 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/ConsumerName/ConsumerName.csv @@ -0,0 +1,6 @@ +"LoincNumber","ConsumerName" +"61438-8","Consumer Name 61438-8" +,"Consumer Name X" +47239-9","" +"17787-3","Consumer Name 17787-3" +"38699-5","1,1-Dichloroethane, Air" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/DocumentOntology/DocumentOntology.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/DocumentOntology/DocumentOntology.csv new file mode 100644 index 00000000000..f857d7f297b --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/DocumentOntology/DocumentOntology.csv @@ -0,0 +1,10 @@ +"LoincNumber","PartNumber","PartTypeName","PartSequenceOrder","PartName" +"11488-4","LP173418-7","Document.Kind","1","Note" +"11488-4","LP173110-0","Document.TypeOfService","1","Consultation" +"11488-4","LP173061-5","Document.Setting","1","{Setting}" +"11488-4","LP187187-2","Document.Role","1","{Role}" +"11490-0","LP173418-7","Document.Kind","1","Note" +"11490-0","LP173221-5","Document.TypeOfService","1","Discharge summary" +"11490-0","LP173061-5","Document.Setting","1","{Setting}" +"11490-0","LP173084-7","Document.Role","1","Physician" +"11492-6","LP173418-7","Document.Kind","1","Note" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/GroupFile/Group.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/GroupFile/Group.csv new file mode 100644 index 00000000000..66f5561ea1c --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/GroupFile/Group.csv @@ -0,0 +1,2 @@ +"ParentGroupId","GroupId","Group","Archetype","Status","VersionFirstReleased" +"LG100-4","LG1695-8","1,4-Dichlorobenzene|MCnc|Pt|ANYBldSerPl","","Active","" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/GroupFile/GroupLoincTerms.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/GroupFile/GroupLoincTerms.csv new file mode 100644 index 00000000000..04c19759cfb --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/GroupFile/GroupLoincTerms.csv @@ -0,0 +1,3 @@ +"Category","GroupId","Archetype","LoincNumber","LongCommonName" +"Flowsheet","LG1695-8","","17424-3","1,4-Dichlorobenzene [Mass/volume] in Blood" +"Flowsheet","LG1695-8","","13006-2","1,4-Dichlorobenzene [Mass/volume] in Serum or Plasma" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/GroupFile/ParentGroup.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/GroupFile/ParentGroup.csv new file mode 100644 index 00000000000..734a86c43dd --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/GroupFile/ParentGroup.csv @@ -0,0 +1,2 @@ +"ParentGroupId","ParentGroup","Status" +"LG100-4","Chem_DrugTox_Chal_Sero_Allergy<SAME:Comp|Prop|Tm|Syst (except intravascular and urine)><ANYBldSerPlas,ANYUrineUrineSed><ROLLUP:Method>","ACTIVE" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv new file mode 100644 index 00000000000..a26397639ff --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv @@ -0,0 +1,10 @@ +"LOINC_NUM","LONG_COMMON_NAME" +"11525-3","US Pelvis Fetus for pregnancy" +"17787-3","NM Thyroid gland Study report" +"18744-3","Bronchoscopy study" +"18746-8","Colonoscopy study" +"18748-4","Diagnostic imaging study" +"18751-8","Endoscopy study" +"18753-4","Flexible sigmoidoscopy study" +"24531-6","US Retroperitoneum" +"24532-4","US Abdomen RUQ" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LinguisticVariants/LinguisticVariants.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LinguisticVariants/LinguisticVariants.csv new file mode 100644 index 00000000000..c79b3197490 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LinguisticVariants/LinguisticVariants.csv @@ -0,0 +1,9 @@ +"ID","ISO_LANGUAGE","ISO_COUNTRY","LANGUAGE_NAME","PRODUCER" +"5","zh","CN","Chinese (CHINA)","Lin Zhang, A LOINC volunteer from China" +"7","es","AR","Spanish (ARGENTINA)","Conceptum Medical Terminology Center" +"8","fr","CA","French (CANADA)","Canada Health Infoway Inc." +,"de","AT","German (AUSTRIA)","ELGA, Austria" +"88",,"AT","German (AUSTRIA)","ELGA, Austria" +"89","de",,"German (AUSTRIA)","ELGA, Austria" +"90","de","AT",,"ELGA, Austria" +"24","de","AT","German (AUSTRIA)","ELGA, Austria" \ No newline at end of file diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LinguisticVariants/deAT24LinguisticVariant.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LinguisticVariants/deAT24LinguisticVariant.csv new file mode 100644 index 00000000000..c6882d47504 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LinguisticVariants/deAT24LinguisticVariant.csv @@ -0,0 +1,4 @@ +"LOINC_NUM","COMPONENT","PROPERTY","TIME_ASPCT","SYSTEM","SCALE_TYP","METHOD_TYP","CLASS","SHORTNAME","LONG_COMMON_NAME","RELATEDNAMES2","LinguisticVariantDisplayName" +"61438-8","Entlassungsbrief Ärztlich","Ergebnis","Zeitpunkt","{Setting}","Dokument","Dermatologie","DOC.ONTOLOGY","de shortname","de long common name","de related names 2","de linguistic variant display name" +"43730-1","","","","","","","","","","EBV-DNA qn. PCR","EBV-DNA quantitativ PCR" +"17787-3","","","","","","","","","","CoV OC43 RNA ql/SM P","Coronavirus OC43 RNA ql. /Sondermaterial PCR" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LinguisticVariants/frCA8LinguisticVariant.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LinguisticVariants/frCA8LinguisticVariant.csv new file mode 100644 index 00000000000..fa09e0cb242 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LinguisticVariants/frCA8LinguisticVariant.csv @@ -0,0 +1,6 @@ +"LOINC_NUM","COMPONENT","PROPERTY","TIME_ASPCT","SYSTEM","SCALE_TYP","METHOD_TYP","CLASS","SHORTNAME","LONG_COMMON_NAME","RELATEDNAMES2","LinguisticVariantDisplayName" +"61438-8","Cellules de Purkinje cytoplasmique type 2 , IgG","Titre","Temps ponctuel","Sérum","Quantitatif","Immunofluorescence","Sérologie","","","","" +"11704-4","Gliale nucléaire de type 1 , IgG","Titre","Temps ponctuel","LCR","Quantitatif","Immunofluorescence","Sérologie","","","","" +,"Cellules de Purkinje cytoplasmique type 2 , IgG","Titre","Temps ponctuel","Sérum","Quantitatif",,,"","","","" +"17787-3","Virus respiratoire syncytial bovin","Présence-Seuil","Temps ponctuel","XXX","Ordinal","Culture spécifique à un microorganisme","Microbiologie","","","","" +"17788-1","Cellules de Purkinje cytoplasmique type 2 , IgG","Titre","Temps ponctuel","Sérum","Quantitatif",,,"","","","" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LinguisticVariants/zhCN5LinguisticVariant.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LinguisticVariants/zhCN5LinguisticVariant.csv new file mode 100644 index 00000000000..48d07d9fdc3 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LinguisticVariants/zhCN5LinguisticVariant.csv @@ -0,0 +1,9 @@ +"LOINC_NUM","COMPONENT","PROPERTY","TIME_ASPCT","SYSTEM","SCALE_TYP","METHOD_TYP","CLASS","SHORTNAME","LONG_COMMON_NAME","RELATEDNAMES2","LinguisticVariantDisplayName" +"61438-8","血流速度.收缩期.最大值","速度","时间点","大脑中动脉","定量型","超声.多普勒","产科学检查与测量指标.超声","","","Cereb 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 大脑(Cerebral) 时刻;随机;随意;瞬间 术语""cerebral""指的是主要由中枢半球(大脑皮质和基底神经节)组成的那部分脑结构 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"11704-4","血流速度.收缩期.最大值","速度","时间点","动脉导管","定量型","超声.多普勒","产科学检查与测量指标.超声","","","动态 动脉管 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 时刻;随机;随意;瞬间 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"17787-3","血流速度.收缩期.最大值","速度","时间点","二尖瓣^胎儿","定量型","超声.多普勒","产科学检查与测量指标.超声","","","僧帽瓣 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 时刻;随机;随意;瞬间 流 流量;流速;流体 胎;超系统 - 胎儿 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"61438-6",,"速度","时间点","二尖瓣^胎儿","定量型","超声.多普勒","产科学检查与测量指标.超声","","","僧帽瓣 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 时刻;随机;随意;瞬间 流 流量;流速;流体 胎;超系统 - 胎儿 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"10000-8","血流速度.收缩期.最大值",,"时间点","二尖瓣^胎儿","定量型","超声.多普勒","产科学检查与测量指标.超声","","","僧帽瓣 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 时刻;随机;随意;瞬间 流 流量;流速;流体 胎;超系统 - 胎儿 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"17788-1","血流速度.收缩期.最大值","速度",,"大脑中动脉","定量型","超声.多普勒","产科学检查与测量指标.超声","","","Cereb 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 大脑(Cerebral) 时刻;随机;随意;瞬间 术语""cerebral""指的是主要由中枢半球(大脑皮质和基底神经节)组成的那部分脑结构 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"11488-4","血流速度.收缩期.最大值","速度","时间点",,"定量型","超声.多普勒","产科学检查与测量指标.超声","","","Cereb 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 大脑(Cerebral) 时刻;随机;随意;瞬间 术语""cerebral""指的是主要由中枢半球(大脑皮质和基底神经节)组成的那部分脑结构 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" +"47239-9","血流速度.收缩期.最大值","速度","时间点","大脑中动脉",,"超声.多普勒","产科学检查与测量指标.超声","","","Cereb 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 大脑(Cerebral) 时刻;随机;随意;瞬间 术语""cerebral""指的是主要由中枢半球(大脑皮质和基底神经节)组成的那部分脑结构 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LoincIeeeMedicalDeviceCodeMappingTable/LoincIeeeMedicalDeviceCodeMappingTable.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LoincIeeeMedicalDeviceCodeMappingTable/LoincIeeeMedicalDeviceCodeMappingTable.csv new file mode 100644 index 00000000000..d8cf83cd09e --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LoincIeeeMedicalDeviceCodeMappingTable/LoincIeeeMedicalDeviceCodeMappingTable.csv @@ -0,0 +1,10 @@ +LOINC_NUM,LOINC_LONG_COMMON_NAME,IEEE_CF_CODE10,IEEE_REFID,IEEE_DESCRIPTION,IEEE_DIM,IEEE_UOM_UCUM +11556-8,Oxygen [Partial pressure] in Blood,160116,MDC_CONC_PO2_GEN,,LMT-2L-2 LMT-2L-2,kPa mm[Hg] +11557-6,Carbon dioxide [Partial pressure] in Blood,160064,MDC_CONC_PCO2_GEN,,LMT-2L-2 LMT-2L-2,kPa mm[Hg] +11558-4,pH of Blood,160004,MDC_CONC_PH_GEN,,[pH],[pH] +12961-9,Urea nitrogen [Mass/volume] in Arterial blood,160080,MDC_CONC_UREA_ART,,ML-3 NL-3,mg/dL mmol/L +14749-6,Glucose [Moles/volume] in Serum or Plasma,160196,MDC_CONC_GLU_VENOUS_PLASMA,Plasma glucose concentration taken from venous,NL-3 ,mmol/L +14749-6,Glucose [Moles/volume] in Serum or Plasma,160368,MDC_CONC_GLU_UNDETERMINED_PLASMA,Plasma glucose concentration taken from undetermined sample source,NL-3 ,mmol/L +15074-8,Glucose [Moles/volume] in Blood,160020,MDC_CONC_GLU_GEN,,NL-3,mmol/L +15074-8,Glucose [Moles/volume] in Blood,160364,MDC_CONC_GLU_UNDETERMINED_WHOLEBLOOD,Whole blood glucose concentration taken from undetermined sample source,NL-3 ,mmol/L +17861-6,Calcium [Mass/volume] in Serum or Plasma,160024,MDC_CONC_CA_GEN,,ML-3,mg/dL diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv new file mode 100644 index 00000000000..f935aeec77b --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv @@ -0,0 +1,10 @@ +"LoincNumber","LongCommonName" ,"PartNumber","PartTypeName" ,"PartName" ,"PartSequenceOrder","RID" ,"PreferredName" ,"RPID" ,"LongName" +"17787-3" ,"v2.68 NM Thyroid gland Study report","LP199995-4","Rad.Anatomic Location.Region Imaged","Neck" ,"A" ,"RID7488" ,"neck" ,"" ,"" +"17787-3" ,"v2.68 NM Thyroid gland Study report","LP206648-0","Rad.Anatomic Location.Imaging Focus","Thyroid gland" ,"A" ,"RID7578" ,"thyroid gland" ,"" ,"" +"17787-3" ,"v2.68 NM Thyroid gland Study report","LP208891-4","Rad.Modality.Modality type" ,"NM" ,"A" ,"RID10330","nuclear medicine imaging","" ,"" +"24531-6" ,"v2.68 US Retroperitoneum" ,"LP207608-3","Rad.Modality.Modality type" ,"US" ,"A" ,"RID10326","Ultrasound" ,"RPID2142","US Retroperitoneum" +"24531-6" ,"v2.68 US Retroperitoneum" ,"LP199943-4","Rad.Anatomic Location.Imaging Focus","Retroperitoneum" ,"A" ,"RID431" ,"RETROPERITONEUM" ,"RPID2142","US Retroperitoneum" +"24531-6" ,"v2.68 US Retroperitoneum" ,"LP199956-6","Rad.Anatomic Location.Region Imaged","Abdomen" ,"A" ,"RID56" ,"Abdomen" ,"RPID2142","US Retroperitoneum" +"24532-4" ,"v2.68 US Abdomen RUQ" ,"LP199956-6","Rad.Anatomic Location.Region Imaged","Abdomen" ,"A" ,"RID56" ,"Abdomen" ,"" ,"" +"24532-4" ,"v2.68 US Abdomen RUQ" ,"LP207608-3","Rad.Modality.Modality type" ,"US" ,"A" ,"RID10326","Ultrasound" ,"" ,"" +"24532-4" ,"v2.68 US Abdomen RUQ" ,"LP208105-9","Rad.Anatomic Location.Imaging Focus","Right upper quadrant","A" ,"RID29994","Right upper quadrant" ,"" ,"" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LoincUniversalLabOrdersValueSet/LoincUniversalLabOrdersValueSet.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LoincUniversalLabOrdersValueSet/LoincUniversalLabOrdersValueSet.csv new file mode 100644 index 00000000000..72d95485a58 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LoincUniversalLabOrdersValueSet/LoincUniversalLabOrdersValueSet.csv @@ -0,0 +1,10 @@ +"LOINC_NUM","LONG_COMMON_NAME","ORDER_OBS" +"42176-8","1,3 beta glucan [Mass/volume] in Serum","Both" +"53835-5","1,5-Anhydroglucitol [Mass/volume] in Serum or Plasma","Both" +"31019-3","10-Hydroxycarbazepine [Mass/volume] in Serum or Plasma","Both" +"6765-2","17-Hydroxypregnenolone [Mass/volume] in Serum or Plasma","Both" +"1668-3","17-Hydroxyprogesterone [Mass/volume] in Serum or Plasma","Both" +"32854-2","17-Hydroxyprogesterone [Presence] in DBS","Both" +"49054-0","25-Hydroxycalciferol [Mass/volume] in Serum or Plasma","Both" +"62292-8","25-Hydroxyvitamin D2+25-Hydroxyvitamin D3 [Mass/volume] in Serum or Plasma","Both" +"44907-4","5-Hydroxyindoleacetate panel - 24 hour Urine","Order" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv new file mode 100644 index 00000000000..527b8fd5cae --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv @@ -0,0 +1,10 @@ +PATH_TO_ROOT,SEQUENCE,IMMEDIATE_PARENT,CODE,CODE_TEXT +,1,,LP31755-9,Microbiology +LP31755-9,1,LP31755-9,LP14559-6,Microorganism +LP31755-9.LP14559-6,1,LP14559-6,LP98185-9,Bacteria +LP31755-9.LP14559-6.LP98185-9,1,LP98185-9,LP14082-9,Bacteria +LP31755-9.LP14559-6.LP98185-9.LP14082-9,1,LP14082-9,LP52258-8,Bacteria | Body Fluid +LP31755-9.LP14559-6.LP98185-9.LP14082-9.LP52258-8,1,LP52258-8,41599-2,Bacteria Fld Ql Micro +LP31755-9.LP14559-6.LP98185-9.LP14082-9,2,LP14082-9,LP52260-4,Bacteria | Cerebral spinal fluid +LP31755-9.LP14559-6.LP98185-9.LP14082-9.LP52260-4,1,LP52260-4,41602-4,Bacteria CSF Ql Micro +LP31755-9.LP14559-6.LP98185-9.LP14082-9,3,LP14082-9,LP52960-9,Bacteria | Cervix diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/AnswerList.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/AnswerList.csv new file mode 100644 index 00000000000..a448cf80f2d --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/AnswerList.csv @@ -0,0 +1,12 @@ +"AnswerListId","AnswerListName" ,"AnswerListOID" ,"ExtDefinedYN","ExtDefinedAnswerListCodeSystem","ExtDefinedAnswerListLink" ,"AnswerStringId","LocalAnswerCode","LocalAnswerCodeSystem","SequenceNumber","DisplayText" ,"ExtCodeId","ExtCodeDisplayName" ,"ExtCodeSystem" ,"ExtCodeSystemVersion" ,"ExtCodeSystemCopyrightNotice" ,"SubsequentTextPrompt","Description","Score" +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"1 slice or 1 dinner roll" , , , , , , , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"2 slices or 2 dinner rolls" , , , , , , , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"More than 2 slices or 2 dinner rolls", , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"Never" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"1-3 times per month" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"1-2 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"3-4 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"5-6 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"1 time per day" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , +"LL1892-0" ,"ICD-9_ICD-10" ,"1.3.6.1.4.1.12009.10.1.1069","Y" , ,"http://www.cdc.gov/nchs/icd.htm", , , , , , , , , , , , , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/Loinc.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/Loinc.csv new file mode 100644 index 00000000000..20379cb7f1d --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/Loinc.csv @@ -0,0 +1,16 @@ +"LOINC_NUM","COMPONENT" ,"PROPERTY","TIME_ASPCT","SYSTEM" ,"SCALE_TYP","METHOD_TYP" ,"CLASS" ,"VersionLastChanged","CHNG_TYPE","DefinitionDescription" ,"STATUS","CONSUMER_NAME","CLASSTYPE","FORMULA","SPECIES","EXMPL_ANSWERS","SURVEY_QUEST_TEXT" ,"SURVEY_QUEST_SRC" ,"UNITSREQUIRED","SUBMITTED_UNITS","RELATEDNAMES2" ,"SHORTNAME" ,"ORDER_OBS" ,"CDISC_COMMON_TESTS","HL7_FIELD_SUBFIELD_ID","EXTERNAL_COPYRIGHT_NOTICE" ,"EXAMPLE_UNITS","LONG_COMMON_NAME" ,"UnitsAndRange","DOCUMENT_SECTION","EXAMPLE_UCUM_UNITS","EXAMPLE_SI_UCUM_UNITS","STATUS_REASON","STATUS_TEXT","CHANGE_REASON_PUBLIC" ,"COMMON_TEST_RANK","COMMON_ORDER_RANK","COMMON_SI_TEST_RANK","HL7_ATTACHMENT_STRUCTURE","EXTERNAL_COPYRIGHT_LINK","PanelType","AskAtOrderEntry","AssociatedObservations" ,"VersionFirstReleased","ValidHL7AttachmentRequest" +"10013-1" ,"R' wave amplitude.lead I" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-I; R wave Amp L-I; Random; Right; Voltage" ,"R' wave Amp L-I" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead I" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10014-9" ,"R' wave amplitude.lead II" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"2; Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-II; R wave Amp L-II; Random; Right; Voltage" ,"R' wave Amp L-II" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead II" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10015-6" ,"R' wave amplitude.lead III" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"3; Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-III; R wave Amp L-III; Random; Right; Voltage" ,"R' wave Amp L-III" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead III" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10016-4" ,"R' wave amplitude.lead V1" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V1; R wave Amp L-V1; Random; Right; Voltage" ,"R' wave Amp L-V1" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V1" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"1001-7" ,"DBG Ab" ,"Pr" ,"Pt" ,"Ser/Plas^donor" ,"Ord" , ,"BLDBK" ,"2.44" ,"MIN" , ,"ACTIVE", ,1 , , , , , , , ,"ABS; Aby; Antby; Anti; Antibodies; Antibody; Autoantibodies; Autoantibody; BLOOD BANK; Donna Bennett-Goodspeed; Donr; Ordinal; Pl; Plasma; Plsm; Point in time; QL; Qual; Qualitative; Random; Screen; SerP; SerPl; SerPl^donor; SerPlas; Serum; Serum or plasma; SR" ,"DBG Ab SerPl Donr Ql" ,"Observation", , , , ,"DBG Ab [Presence] in Serum or Plasma from donor" , , , , , , ,"The Property has been changed from ACnc to Pr (Presence) to reflect the new model for ordinal terms where results are based on presence or absence." ,0 ,0 ,0 , , , , , , , +"10017-2" ,"R' wave amplitude.lead V2" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V2; R wave Amp L-V2; Random; Right; Voltage" ,"R' wave Amp L-V2" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V2" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10018-0" ,"R' wave amplitude.lead V3" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V3; R wave Amp L-V3; Random; Right; Voltage" ,"R' wave Amp L-V3" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V3" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10019-8" ,"R' wave amplitude.lead V4" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V4; R wave Amp L-V4; Random; Right; Voltage" ,"R' wave Amp L-V4" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V4" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10020-6" ,"R' wave amplitude.lead V5" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V5; R wave Amp L-V5; Random; Right; Voltage" ,"R' wave Amp L-V5" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V5" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"61438-8" ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30D","Find" ,"Pt" ,"^Patient" ,"Ord" ,"PhenX" ,"PHENX" ,"2.44" ,"MIN" , ,"TRIAL" , ,2 , , , ,"Each time you eat bread, toast or dinner rolls, how much do you usually eat?","PhenX.050201100100","N" , ,"Finding; Findings; How much bread in 30D; Last; Ordinal; Point in time; QL; Qual; Qualitative; Random; Screen" ,"How much bread in 30D PhenX", , , , , ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]", , , , , , , ,0 ,0 ,0 , , , , , , , +"10000-8" ,"R wave duration.lead AVR" ,"Time" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; Durat; ECG; EKG.MEASUREMENTS; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave dur L-AVR; R wave dur L-AVR; Random; Right" ,"R wave dur L-AVR" ,"Observation", , , ,"s" ,"R wave duration in lead AVR" , , ,"s" , , , , ,0 ,0 ,0 , , , , , , , +"17787-3" ,"Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , +"17788-1" ,"Large unstained cells/100 leukocytes" ,"NFr" ,"Pt" ,"Bld" ,"Qn" ,"Automated count","HEM/BC" ,"2.50" ,"MIN" ,"Part of auto diff output of Bayer H*3S; peroxidase negative cells too large to be classified as lymph or basophil" ,"ACTIVE", ,1 , , , , , ,"Y" ,"%" ,"100WBC; Auto; Automated detection; Blood; Cell; Cellularity; Elec; Elect; Electr; HEMATOLOGY/CELL COUNTS; Leuc; Leuk; Leukocyte; Lkcs; LUC; Number Fraction; Percent; Point in time; QNT; Quan; Quant; Quantitative; Random; WB; WBC; WBCs; White blood cell; White blood cells; Whole blood" ,"LUC/leuk NFr Bld Auto" ,"Observation", , , ,"%" ,"Large unstained cells/100 leukocytes in Blood by Automated count" , , ,"%" , , , , ,1894 ,0 ,1894 , , , , , ,"1.0l" , +"11488-4" ,"Consultation note" ,"Find" ,"Pt" ,"{Setting}" ,"Doc" ,"{Role}" ,"DOC.ONTOLOGY","2.63" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Consult note; DOC.ONT; Document; Encounter; Evaluation and management; Evaluation and management note; Finding; Findings; notes; Point in time; Random; Visit note" ,"Consult note" ,"Both" , , , , ,"Consult note" , , , , , , ,"Edit made because this term is conformant to the Document Ontology axis values and therefore are being placed in this class.; Based on Clinical LOINC Committee decision during the September 2014 meeting, {Provider} was changed to {Author Type} to emphasize a greater breadth of potential document authors. At the September 2015 Clinical LOINC Committee meeting, the Committee decided to change {Author Type} to {Role} to align with the 'Role' axis name in the LOINC Document Ontology.; Because it is too difficult to maintain and because the distinction between documents and sections is not clear-cut nor necessary in most cases, the DOCUMENT_SECTION field has been deemed to have little value. The field has been set to null in the December 2017 release in preparation for removal in the December 2018 release. These changes were approved by the Clinical LOINC Committee.",0 ,0 ,0 ,"IG exists" , , , ,"81222-2;72231-4;81243-8","1.0j-a" ,"Y" +"47239-9" ,"Reason for stopping HIV Rx" ,"Type" ,"Pt" ,"^Patient" ,"Nom" ,"Reported" ,"ART" ,"2.50" ,"MIN" ,"Reason for stopping antiretroviral therapy" ,"ACTIVE", ,2 , , , , , ,"N" , ,"AIDS; Anti-retroviral therapy; ART; Human immunodeficiency virus; Nominal; Point in time; Random; Treatment; Typ" ,"Reason for stopping HIV Rx" ,"Observation", , ,"Copyright © 2006 World Health Organization. Used with permission. Publications of the World Health Organization can be obtained from WHO Press, World Health Organization, 20 Avenue Appia, 1211 Geneva 27, Switzerland (tel: +41 22 791 2476; fax: +41 22 791 4857; email: bookorders@who.int). Requests for permission to reproduce or translate WHO publications – whether for sale or for noncommercial distribution – should be addressed to WHO Press, at the above address (fax: +41 22 791 4806; email: permissions@who.int). The designations employed and the presentation of the material in this publication do not imply the expression of any opinion whatsoever on the part of the World Health Organization concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Dotted lines on maps represent approximate border lines for which there may not yet be full agreement. The mention of specific companies or of certain manufacturers’ products does not imply that they are endorsed or recommended by the World Health Organization in preference to others of a similar nature that are not mentioned. Errors and omissions excepted, the names of proprietary products are distinguished by initial capital letters. All reasonable precautions have been taken by WHO to verify the information contained in this publication. However, the published material is being distributed without warranty of any kind, either express or implied. The responsibility for the interpretation and use of the material lies with the reader. In no event shall the World Health Organization be liable for damages arising from its use.", ,"Reason for stopping HIV treatment" , , , , , , , ,0 ,0 ,0 , ,"WHO_HIV" , , , ,"2.22" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/LoincAnswerListLink.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/LoincAnswerListLink.csv new file mode 100644 index 00000000000..820602c77ad --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/LoincAnswerListLink.csv @@ -0,0 +1,11 @@ +"LoincNumber","LongCommonName" ,"AnswerListId","AnswerListName" ,"AnswerListLinkType","ApplicableContext" +"61438-8" ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]","LL1000-0" ,"PhenX05_13_30D bread amt","NORMATIVE" , +"10061-0" ,"S' wave amplitude in lead I" ,"LL1311-1" ,"PhenX12_44" ,"EXAMPLE" , +"10331-7" ,"Rh [Type] in Blood" ,"LL360-9" ,"Pos|Neg" ,"EXAMPLE" , +"10389-5" ,"Blood product.other [Type]" ,"LL2413-4" ,"Othr bld prod" ,"EXAMPLE" , +"10390-3" ,"Blood product special preparation [Type]" ,"LL2422-5" ,"Blood prod treatment" ,"EXAMPLE" , +"10393-7" ,"Factor IX given [Type]" ,"LL2420-9" ,"Human/Recomb" ,"EXAMPLE" , +"10395-2" ,"Factor VIII given [Type]" ,"LL2420-9" ,"Human/Recomb" ,"EXAMPLE" , +"10401-8" ,"Immune serum globulin given [Type]" ,"LL2421-7" ,"IM/IV" ,"EXAMPLE" , +"10410-9" ,"Plasma given [Type]" ,"LL2417-5" ,"Plasma type" ,"EXAMPLE" , +"10568-4" ,"Clarity of Semen" ,"LL2427-4" ,"Clear/Opales/Milky" ,"EXAMPLE" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/LoincPartLink.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/LoincPartLink.csv new file mode 100644 index 00000000000..36c84f3fe95 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/LoincPartLink.csv @@ -0,0 +1,10 @@ +"LoincNumber","LongCommonName","PartNumber","PartName","PartCodeSystem","PartTypeName","LinkTypeName","Property" +"10013-1","R' wave amplitude in lead I","LP31101-6","R' wave amplitude.lead I","http://loinc.org","COMPONENT","Primary","http://loinc.org/property/COMPONENT" +"10013-1","R' wave amplitude in lead I","LP6802-5","Elpot","http://loinc.org","PROPERTY","Primary","http://loinc.org/property/PROPERTY" +"10013-1","R' wave amplitude in lead I","LP6960-1","Pt","http://loinc.org","TIME","Primary","http://loinc.org/property/TIME_ASPCT" +"10013-1","R' wave amplitude in lead I","LP7289-4","Heart","http://loinc.org","SYSTEM","Primary","http://loinc.org/property/SYSTEM" +"10013-1","R' wave amplitude in lead I","LP7753-9","Qn","http://loinc.org","SCALE","Primary","http://loinc.org/property/SCALE_TYP" +"10013-1","R' wave amplitude in lead I","LP6244-0","EKG","http://loinc.org","METHOD","Primary","http://loinc.org/property/METHOD_TYP" +"10013-1","R' wave amplitude in lead I","LP31101-6","R' wave amplitude.lead I","http://loinc.org","COMPONENT","DetailedModel","http://loinc.org/property/analyte" +"10013-1","R' wave amplitude in lead I","LP6802-5","Elpot","http://loinc.org","PROPERTY","DetailedModel","http://loinc.org/property/PROPERTY" +"10013-1","R' wave amplitude in lead I","LP6960-1","Pt","http://loinc.org","TIME","DetailedModel","http://loinc.org/property/time-core" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/LoincPartLink_Primary.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/LoincPartLink_Primary.csv new file mode 100644 index 00000000000..8dbe575ffd2 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/LoincPartLink_Primary.csv @@ -0,0 +1,7 @@ +"LoincNumber","LongCommonName" ,"PartNumber","PartName" ,"PartCodeSystem" ,"PartTypeName","LinkTypeName","Property" +"10013-1" ,"R' wave amplitude in lead I","LP31101-6" ,"R' wave amplitude.lead I","http://loinc.org","COMPONENT" ,"Primary" ,"http://loinc.org/property/COMPONENT" +"10013-1" ,"R' wave amplitude in lead I","LP6802-5" ,"Elpot" ,"http://loinc.org","PROPERTY" ,"Primary" ,"http://loinc.org/property/PROPERTY" +"10013-1" ,"R' wave amplitude in lead I","LP6960-1" ,"Pt" ,"http://loinc.org","TIME" ,"Primary" ,"http://loinc.org/property/TIME_ASPCT" +"10013-1" ,"R' wave amplitude in lead I","LP7289-4" ,"Heart" ,"http://loinc.org","SYSTEM" ,"Primary" ,"http://loinc.org/property/SYSTEM" +"10013-1" ,"R' wave amplitude in lead I","LP7753-9" ,"Qn" ,"http://loinc.org","SCALE" ,"Primary" ,"http://loinc.org/property/SCALE_TYP" +"10013-1" ,"R' wave amplitude in lead I","LP6244-0" ,"EKG" ,"http://loinc.org","METHOD" ,"Primary" ,"http://loinc.org/property/METHOD_TYP" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/LoincPartLink_Supplementary.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/LoincPartLink_Supplementary.csv new file mode 100644 index 00000000000..869c2c1651d --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/LoincPartLink_Supplementary.csv @@ -0,0 +1,13 @@ +"LoincNumber","LongCommonName" ,"PartNumber","PartName" ,"PartCodeSystem" ,"PartTypeName","LinkTypeName" ,"Property" +"10013-1" ,"R' wave amplitude in lead I","LP31101-6" ,"R' wave amplitude.lead I","http://loinc.org","COMPONENT" ,"DetailedModel" ,"http://loinc.org/property/analyte" +"10013-1" ,"R' wave amplitude in lead I","LP6802-5" ,"Elpot" ,"http://loinc.org","PROPERTY" ,"DetailedModel" ,"http://loinc.org/property/PROPERTY" +"10013-1" ,"R' wave amplitude in lead I","LP6960-1" ,"Pt" ,"http://loinc.org","TIME" ,"DetailedModel" ,"http://loinc.org/property/time-core" +"10013-1" ,"R' wave amplitude in lead I","LP7289-4" ,"Heart" ,"http://loinc.org","SYSTEM" ,"DetailedModel" ,"http://loinc.org/property/system-core" +"10013-1" ,"R' wave amplitude in lead I","LP7753-9" ,"Qn" ,"http://loinc.org","SCALE" ,"DetailedModel" ,"http://loinc.org/property/SCALE_TYP" +"10013-1" ,"R' wave amplitude in lead I","LP6244-0" ,"EKG" ,"http://loinc.org","METHOD" ,"DetailedModel" ,"http://loinc.org/property/METHOD_TYP" +"10013-1" ,"R' wave amplitude in lead I","LP31101-6" ,"R' wave amplitude.lead I","http://loinc.org","COMPONENT" ,"SyntaxEnhancement","http://loinc.org/property/analyte-core" +"10013-1" ,"R' wave amplitude in lead I","LP190563-9","Cardiology" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/category" +"10013-1" ,"R' wave amplitude in lead I","LP29708-2" ,"Cardiology" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/category" +"10013-1" ,"R' wave amplitude in lead I","LP7787-7" ,"Clinical" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/category" +"10013-1" ,"R' wave amplitude in lead I","LP7795-0" ,"EKG measurements" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/category" +"10013-1" ,"R' wave amplitude in lead I","LP7795-0" ,"EKG.MEAS" ,"http://loinc.org","CLASS" ,"Metadata" ,"http://loinc.org/property/CLASS" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/Part.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/Part.csv new file mode 100644 index 00000000000..d5816ead286 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/Part.csv @@ -0,0 +1,46 @@ +"PartNumber","PartTypeName","PartName","PartDisplayName","Status" +"LP101394-7","ADJUSTMENT","adjusted for maternal weight","adjusted for maternal weight","ACTIVE" +"LP101907-6","ADJUSTMENT","corrected for age","corrected for age","ACTIVE" +"LP115711-6","ADJUSTMENT","corrected for background","corrected for background","ACTIVE" +"LP147359-6","ADJUSTMENT","adjusted for body weight","adjusted for body weight","ACTIVE" +"LP173482-3","ADJUSTMENT","1st specimen","1st specimen","DEPRECATED" +"LP173483-1","ADJUSTMENT","post cyanocobalamin",,"ACTIVE" +"LP173484-9","ADJUSTMENT","W hyperextension)",,"ACTIVE" +"LP6244-0","METHOD","EKG","Electrocardiogram (EKG)","ACTIVE" +"LP18172-4","COMPONENT","Interferon.beta","Interferon beta","ACTIVE" +"LP7289-4","SYSTEM","Heart","Heart","ACTIVE" +"LP6960-1","TIME","Pt","Point in time (spot)","ACTIVE" +"LP6802-5","PROPERTY","Elpot","Electrical Potential (Voltage)","ACTIVE" +"LP7753-9","SCALE","Qn","Qn","ACTIVE" +"LP31101-6","COMPONENT","R' wave amplitude.lead I","R' wave amplitude.lead I","ACTIVE" +"LP31102-4","COMPONENT","R' wave amplitude.lead II","R' wave amplitude.lead II","ACTIVE" +"LP31103-2","COMPONENT","R' wave amplitude.lead III","R' wave amplitude.lead III","ACTIVE" +"LP31104-0","COMPONENT","R' wave amplitude.lead V1","R' wave amplitude.lead V1","ACTIVE" +"LP31105-7","COMPONENT","R' wave amplitude.lead V2","R' wave amplitude.lead V2","ACTIVE" +"LP31106-5","COMPONENT","R' wave amplitude.lead V3","R' wave amplitude.lead V3","ACTIVE" +"LP31107-3","COMPONENT","R' wave amplitude.lead V4","R' wave amplitude.lead V4","ACTIVE" +"LP31108-1","COMPONENT","R' wave amplitude.lead V5","R' wave amplitude.lead V5","ACTIVE" +"LP31109-9","COMPONENT","R' wave amplitude.lead V6","R' wave amplitude.lead V6","ACTIVE" +"LP31110-7","COMPONENT","R' wave duration.lead AVF","R' wave duration.lead AVF","ACTIVE" +"LP30269-2","SYSTEM","Ser/Plas^donor",,"ACTIVE" +"LP149220-8","PROPERTY","Pr","Presence","ACTIVE" +"LP7751-3","SCALE","Ord","Ord","ACTIVE" +"LP37904-7","COMPONENT","DBG Ab","DBG Ab","ACTIVE" +"LP6813-2","PROPERTY","Find","Finding","ACTIVE" +"LP95333-8","METHOD","PhenX","PhenX","ACTIVE" +"LP102627-9","COMPONENT","Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30D","Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days","ACTIVE" +"LP6879-3","PROPERTY","Time","Time (e.g. seconds)","ACTIVE" +"LP31088-5","COMPONENT","R wave duration.lead AVR","R wave duration.lead AVR","ACTIVE" +"LP206647-2","SYSTEM","Neck>Thyroid gland","Thyroid gland","ACTIVE" +"LP208655-3","METHOD","NM","NM","ACTIVE" +"LP32888-7","SCALE","Doc","Doc","ACTIVE" +"LP31534-8","COMPONENT","Study report","Study report","ACTIVE" +"LP7057-5","SYSTEM","Bld","Blood","ACTIVE" +"LP6838-9","PROPERTY","NFr","Number Fraction","ACTIVE" +"LP6141-8","METHOD","Automated count","Automated count","ACTIVE" +"LP15842-5","COMPONENT","Pyridoxine","Pyridoxine","ACTIVE" +"LP19258-0","COMPONENT","Large unstained cells","Large unstained cells","ACTIVE" +"LP32887-9","SYSTEM","{Setting}","{Setting}","ACTIVE" +"LP187178-1","METHOD","{Role}","Role-unspecified","ACTIVE" +"LP72311-1","COMPONENT","Consultation note","Consultation note","ACTIVE" + diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/PartRelatedCodeMapping.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/PartRelatedCodeMapping.csv new file mode 100644 index 00000000000..495416894ce --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PartFile/PartRelatedCodeMapping.csv @@ -0,0 +1,12 @@ +"PartNumber","PartName" ,"PartTypeName","ExtCodeId" ,"ExtCodeDisplayName" ,"ExtCodeSystem" ,"Equivalence","ContentOrigin","ExtCodeSystemVersion" ,"ExtCodeSystemCopyrightNotice" +"LP18172-4" ,"Interferon.beta" ,"COMPONENT" ," 420710006","Interferon beta (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP31706-2" ,"Nornicotine" ,"COMPONENT" ,"1018001" ,"Nornicotine (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP15826-8" ,"Prostaglandin F2","COMPONENT" ,"10192006" ,"Prostaglandin PGF2 (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP7400-7" ,"Liver" ,"SYSTEM" ,"10200004" ,"Liver structure (body structure)","http://snomed.info/sct" ,"wider" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP29165-5" ,"Liver.FNA" ,"SYSTEM" ,"10200004" ,"Liver structure (body structure)","http://snomed.info/sct" ,"narrower" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP15666-8" ,"Inosine" ,"COMPONENT" ,"102640000" ,"Inosine (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP15943-1" ,"Uronate" ,"COMPONENT" ,"102641001" ,"Uronic acid (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP15791-4" ,"Phenylketones" ,"COMPONENT" ,"102642008" ,"Phenylketones (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP15721-1" ,"Malonate" ,"COMPONENT" ,"102648007" ,"Malonic acid (substance)" ,"http://snomed.info/sct" ,"equivalent" ,"Both" ,"http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College of American Pathologists. “SNOMED” and “SNOMED CT” are registered trademarks of the IHTSDO.This material includes content from the US Edition to SNOMED CT, which is developed and maintained by the U.S. National Library of Medicine and is available to authorized UMLS Metathesaurus Licensees from the UTS Downloads site at https://uts.nlm.nih.gov.Use of SNOMED CT content is subject to the terms and conditions set forth in the SNOMED CT Affiliate License Agreement. It is the responsibility of those implementing this product to ensure they are appropriately licensed and for more information on the license, including how to register as an Affiliate Licensee, please refer to http://www.snomed.org/snomed-ct/get-snomed-ct or info@snomed.org<mailto:info@snomed.org>. This may incur a fee in SNOMED International non-Member countries." +"LP15842-5" ,"Pyridoxine" ,"COMPONENT" ,"1054" ,"Pyridoxine" ,"http://pubchem.ncbi.nlm.nih.gov","equivalent" , , , +"LP15842-5" ,"Pyridoxine" ,"COMPONENT" ,"1054" ,"Pyridoxine" ,"http://foo/bar" ,"equivalent" , , , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/Top2000Results/SI/Top2000CommonLabResultsSi.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/Top2000Results/SI/Top2000CommonLabResultsSi.csv new file mode 100644 index 00000000000..1e9b3872892 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/Top2000Results/SI/Top2000CommonLabResultsSi.csv @@ -0,0 +1,10 @@ +LOINC #,Long Common Name,Short Name,CLASS,Rank +14682-9,Creatinine [Moles/volume] in Serum or Plasma,Creat SerPl-mCnc,Chem,1 +718-7,Hemoglobin [Mass/volume] in Blood,Hgb Bld-mCnc,HEM/BC,2 +2823-3,Potassium [Moles/volume] in Serum or Plasma,Potassium SerPl-sCnc,Chem,3 +14749-6,Glucose [Moles/volume] in Serum or Plasma,Glucose SerPl-mCnc,Chem,4 +2951-2,Sodium [Moles/volume] in Serum or Plasma,Sodium SerPl-sCnc,Chem,5 +3094-0,Urea nitrogen [Mass/volume] in Serum or Plasma,BUN SerPl-mCnc,Chem,6 +2028-9,"Carbon dioxide, total [Moles/volume] in Serum or Plasma",CO2 SerPl-sCnc,Chem,7 +2075-0,Chloride [Moles/volume] in Serum or Plasma,Chloride SerPl-sCnc,Chem,8 +789-8,Erythrocytes [#/volume] in Blood by Automated count,RBC # Bld Auto,HEM/BC,9 diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/Top2000Results/US/Top2000CommonLabResultsUs.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/Top2000Results/US/Top2000CommonLabResultsUs.csv new file mode 100644 index 00000000000..c80db052dd3 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/Top2000Results/US/Top2000CommonLabResultsUs.csv @@ -0,0 +1,10 @@ +LOINC #,Long Common Name,Short Name,CLASS,Rank +2160-0,Creatinine [Mass/volume] in Serum or Plasma,Creat SerPl-mCnc,Chem,1 +718-7,Hemoglobin [Mass/volume] in Blood,Hgb Bld-mCnc,HEM/BC,2 +2823-3,Potassium [Moles/volume] in Serum or Plasma,Potassium SerPl-sCnc,Chem,3 +2345-7,Glucose [Mass/volume] in Serum or Plasma,Glucose SerPl-mCnc,Chem,4 +2951-2,Sodium [Moles/volume] in Serum or Plasma,Sodium SerPl-sCnc,Chem,5 +3094-0,Urea nitrogen [Mass/volume] in Serum or Plasma,BUN SerPl-mCnc,Chem,6 +2028-9,"Carbon dioxide, total [Moles/volume] in Serum or Plasma",CO2 SerPl-sCnc,Chem,7 +2075-0,Chloride [Moles/volume] in Serum or Plasma,Chloride SerPl-sCnc,Chem,8 +789-8,Erythrocytes [#/volume] in Blood by Automated count,RBC # Bld Auto,HEM/BC,9 diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/LoincTable/Loinc.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/LoincTable/Loinc.csv new file mode 100644 index 00000000000..c519331fc53 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/LoincTable/Loinc.csv @@ -0,0 +1,16 @@ +"LOINC_NUM","COMPONENT" ,"PROPERTY","TIME_ASPCT","SYSTEM" ,"SCALE_TYP","METHOD_TYP" ,"CLASS" ,"VersionLastChanged","CHNG_TYPE","DefinitionDescription" ,"STATUS","CONSUMER_NAME","CLASSTYPE","FORMULA","SPECIES","EXMPL_ANSWERS","SURVEY_QUEST_TEXT" ,"SURVEY_QUEST_SRC" ,"UNITSREQUIRED","SUBMITTED_UNITS","RELATEDNAMES2" ,"SHORTNAME" ,"ORDER_OBS" ,"CDISC_COMMON_TESTS","HL7_FIELD_SUBFIELD_ID","EXTERNAL_COPYRIGHT_NOTICE" ,"EXAMPLE_UNITS","LONG_COMMON_NAME" ,"UnitsAndRange","DOCUMENT_SECTION","EXAMPLE_UCUM_UNITS","EXAMPLE_SI_UCUM_UNITS","STATUS_REASON","STATUS_TEXT","CHANGE_REASON_PUBLIC" ,"COMMON_TEST_RANK","COMMON_ORDER_RANK","COMMON_SI_TEST_RANK","HL7_ATTACHMENT_STRUCTURE","EXTERNAL_COPYRIGHT_LINK","PanelType","AskAtOrderEntry","AssociatedObservations" ,"VersionFirstReleased","ValidHL7AttachmentRequest" +"10013-1" ,"v2.69 R' wave amplitude.lead I" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-I; R wave Amp L-I; Random; Right; Voltage" ,"R' wave Amp L-I" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead I" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10014-9" ,"v2.69 R' wave amplitude.lead II" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"2; Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-II; R wave Amp L-II; Random; Right; Voltage" ,"R' wave Amp L-II" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead II" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10015-6" ,"v2.69 R' wave amplitude.lead III" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"3; Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-III; R wave Amp L-III; Random; Right; Voltage" ,"R' wave Amp L-III" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead III" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10016-4" ,"v2.69 R' wave amplitude.lead V1" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V1; R wave Amp L-V1; Random; Right; Voltage" ,"R' wave Amp L-V1" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V1" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"1001-7" ,"v2.69 DBG Ab" ,"Pr" ,"Pt" ,"Ser/Plas^donor" ,"Ord" , ,"BLDBK" ,"2.44" ,"MIN" , ,"ACTIVE", ,1 , , , , , , , ,"ABS; Aby; Antby; Anti; Antibodies; Antibody; Autoantibodies; Autoantibody; BLOOD BANK; Donna Bennett-Goodspeed; Donr; Ordinal; Pl; Plasma; Plsm; Point in time; QL; Qual; Qualitative; Random; Screen; SerP; SerPl; SerPl^donor; SerPlas; Serum; Serum or plasma; SR" ,"DBG Ab SerPl Donr Ql" ,"Observation", , , , ,"DBG Ab [Presence] in Serum or Plasma from donor" , , , , , , ,"The Property has been changed from ACnc to Pr (Presence) to reflect the new model for ordinal terms where results are based on presence or absence." ,0 ,0 ,0 , , , , , , , +"10017-2" ,"v2.69 R' wave amplitude.lead V2" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V2; R wave Amp L-V2; Random; Right; Voltage" ,"R' wave Amp L-V2" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V2" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10018-0" ,"v2.69 R' wave amplitude.lead V3" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V3; R wave Amp L-V3; Random; Right; Voltage" ,"R' wave Amp L-V3" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V3" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10019-8" ,"v2.69 R' wave amplitude.lead V4" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V4; R wave Amp L-V4; Random; Right; Voltage" ,"R' wave Amp L-V4" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V4" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"10020-6" ,"v2.69 R' wave amplitude.lead V5" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V5; R wave Amp L-V5; Random; Right; Voltage" ,"R' wave Amp L-V5" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V5" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , +"61438-8" ,"v2.69 Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30D","Find" ,"Pt" ,"^Patient" ,"Ord" ,"PhenX" ,"PHENX" ,"2.44" ,"MIN" , ,"TRIAL" , ,2 , , , ,"Each time you eat bread, toast or dinner rolls, how much do you usually eat?","PhenX.050201100100","N" , ,"Finding; Findings; How much bread in 30D; Last; Ordinal; Point in time; QL; Qual; Qualitative; Random; Screen" ,"How much bread in 30D PhenX", , , , , ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]", , , , , , , ,0 ,0 ,0 , , , , , , , +"10000-8" ,"v2.69 R wave duration.lead AVR" ,"Time" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; Durat; ECG; EKG.MEASUREMENTS; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave dur L-AVR; R wave dur L-AVR; Random; Right" ,"R wave dur L-AVR" ,"Observation", , , ,"s" ,"R wave duration in lead AVR" , , ,"s" , , , , ,0 ,0 ,0 , , , , , , , +"17787-3" ,"v2.69 Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , +"17788-1" ,"v2.69 Large unstained cells/100 leukocytes" ,"NFr" ,"Pt" ,"Bld" ,"Qn" ,"Automated count","HEM/BC" ,"2.50" ,"MIN" ,"Part of auto diff output of Bayer H*3S; peroxidase negative cells too large to be classified as lymph or basophil" ,"ACTIVE", ,1 , , , , , ,"Y" ,"%" ,"100WBC; Auto; Automated detection; Blood; Cell; Cellularity; Elec; Elect; Electr; HEMATOLOGY/CELL COUNTS; Leuc; Leuk; Leukocyte; Lkcs; LUC; Number Fraction; Percent; Point in time; QNT; Quan; Quant; Quantitative; Random; WB; WBC; WBCs; White blood cell; White blood cells; Whole blood" ,"LUC/leuk NFr Bld Auto" ,"Observation", , , ,"%" ,"Large unstained cells/100 leukocytes in Blood by Automated count" , , ,"%" , , , , ,1894 ,0 ,1894 , , , , , ,"1.0l" , +"11488-4" ,"v2.69 Consultation note" ,"Find" ,"Pt" ,"{Setting}" ,"Doc" ,"{Role}" ,"DOC.ONTOLOGY","2.63" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Consult note; DOC.ONT; Document; Encounter; Evaluation and management; Evaluation and management note; Finding; Findings; notes; Point in time; Random; Visit note" ,"Consult note" ,"Both" , , , , ,"Consult note" , , , , , , ,"Edit made because this term is conformant to the Document Ontology axis values and therefore are being placed in this class.; Based on Clinical LOINC Committee decision during the September 2014 meeting, {Provider} was changed to {Author Type} to emphasize a greater breadth of potential document authors. At the September 2015 Clinical LOINC Committee meeting, the Committee decided to change {Author Type} to {Role} to align with the 'Role' axis name in the LOINC Document Ontology.; Because it is too difficult to maintain and because the distinction between documents and sections is not clear-cut nor necessary in most cases, the DOCUMENT_SECTION field has been deemed to have little value. The field has been set to null in the December 2017 release in preparation for removal in the December 2018 release. These changes were approved by the Clinical LOINC Committee.",0 ,0 ,0 ,"IG exists" , , , ,"81222-2;72231-4;81243-8","1.0j-a" ,"Y" +"47239-9" ,"v2.69 Reason for stopping HIV Rx" ,"Type" ,"Pt" ,"^Patient" ,"Nom" ,"Reported" ,"ART" ,"2.50" ,"MIN" ,"Reason for stopping antiretroviral therapy" ,"ACTIVE", ,2 , , , , , ,"N" , ,"AIDS; Anti-retroviral therapy; ART; Human immunodeficiency virus; Nominal; Point in time; Random; Treatment; Typ" ,"Reason for stopping HIV Rx" ,"Observation", , ,"Copyright © 2006 World Health Organization. Used with permission. Publications of the World Health Organization can be obtained from WHO Press, World Health Organization, 20 Avenue Appia, 1211 Geneva 27, Switzerland (tel: +41 22 791 2476; fax: +41 22 791 4857; email: bookorders@who.int). Requests for permission to reproduce or translate WHO publications – whether for sale or for noncommercial distribution – should be addressed to WHO Press, at the above address (fax: +41 22 791 4806; email: permissions@who.int). The designations employed and the presentation of the material in this publication do not imply the expression of any opinion whatsoever on the part of the World Health Organization concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Dotted lines on maps represent approximate border lines for which there may not yet be full agreement. The mention of specific companies or of certain manufacturers’ products does not imply that they are endorsed or recommended by the World Health Organization in preference to others of a similar nature that are not mentioned. Errors and omissions excepted, the names of proprietary products are distinguished by initial capital letters. All reasonable precautions have been taken by WHO to verify the information contained in this publication. However, the published material is being distributed without warranty of any kind, either express or implied. The responsibility for the interpretation and use of the material lies with the reader. In no event shall the World Health Organization be liable for damages arising from its use.", ,"Reason for stopping HIV treatment" , , , , , , , ,0 ,0 ,0 , ,"WHO_HIV" , , , ,"2.22" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/loinc.xml b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/loinc.xml new file mode 100644 index 00000000000..15f65f5766e --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/loinc.xml @@ -0,0 +1,543 @@ +<!-- +LOINC is a freely available international standard for tests, measurements, and observations. It is a well maintained, version independent code system. + +Use of LOINC is governed by the LOINC License: https://loinc.org/license/ + +This CodeSystem resource describes 'LOINC' independent of any particular version. There are notes about changes for version specific LOINC code system resources. + +Note that the following set of codes are defined by the LOINC code systems: + - the main LOINC codes + - the LOINC Answer codes (LA) and the LOINC Answer list codes (LL) + - the LOINC Part codes (LP) in the Multiaxial Hierarchy + - the LOINC Part codes (LP) for the properties + Note: there are license restrictions on the use of LOINC Part codes + - the LOINC Group codes (LG) + Note: presently the LOINC Group codes are used to identify these roll-up groups as ValueSets, but are not yet loaded as codes in the CodeSystem + +Servers may generate variants of this for the LOINC version(s) and features they support. + +--> + +<CodeSystem xmlns="http://hl7.org/fhir"> + <id value="loinc"/> + + <!-- + This url is unchanged for all versions of LOINC. There can only be one correct Code System resource for each value of the version attribute (at least, only one per server). + --> + <url value="http://loinc.org"/> + + <!-- the HL7 v3 OID assigned to LOINC --> + <identifier> + <system value="urn:ietf:rfc:3986"/> + <value value="urn:oid:2.16.840.1.113883.6.1"/> + </identifier> + +<!-- <version value="2.69"/>--> + + <!-- + If a specific version is specified, the name should carry this information (e.g. LOINC_270). + --> + <name value="LOINC"/> + <title value="LOINC Code System (Testing Copy)"/> + <status value="active"/> + <experimental value="false"/> + + <publisher value="Regenstrief Institute, Inc."/> + <contact> + <telecom> + <system value="url" /> + <value value="http://loinc.org"/> + </telecom> + </contact> + + <!-- + <date value=2021-06/> + --> + <description value="LOINC is a freely available international standard for tests, measurements, and observations"/> + <copyright value="This material contains content from LOINC (http://loinc.org). LOINC is copyright ©1995-2021, Regenstrief Institute, Inc. and the Logical Observation Identifiers Names and Codes (LOINC) Committee and is available at no cost under the license at http://loinc.org/license. LOINC® is a registered United States trademark of Regenstrief Institute, Inc."/> + <caseSensitive value="false"/> + + <valueSet value="http://loinc.org/vs"/> + + <!-- + It's at the discretion of servers whether to present fragments of LOINC hierarchically or not, when using the code system resource. But, if they are hierarchical, the Hierarchy SHALL be based on the is-a relationship that is derived from the LOINC Multiaxial Hierarchy. + --> + <hierarchyMeaning value="is-a"/> + <compositional value="false"/> <!-- no compositional grammar in LOINC --> + <versionNeeded value="false"/> + + <!-- + This canonical definition of LOINC does not include the LOINC content, which is distributed separately for portability. + + Servers may choose to include fragments of LOINC for illustration purposes. + --> + <content value="not-present"/> + + <!-- + <count value="65000"/> + If working with a specific version, you could nominate a count of the total number of concepts (including the answers, Hierarchy, etc.). In this canonical definition we do not. + --> + + <!-- + FILTERS + Generally defined filters for specifying value sets + In LOINC, all the properties can also be used as filters, but they are not defined explicitly as filters. + Parent/child properties are as defined by FHIR. Note that at this time the LOINC code system resource does not support ancestor/descendant relationships. + + For illustration purposes, consider this slice of the LOINC Multiaxial Hierarchy when reading the descriptions below: + + Laboratory [LP29693-6] + Microbiology and Antimicrobial susceptibility [LP343406-7] + Microbiology [LP7819-8] + Microorganism [LP14559-6] + Virus [LP14855-8] + Zika virus [LP200137-0] + Zika virus RNA | XXX [LP203271-4] + Zika virus RNA | XXX | Microbiology [LP379670-5] + Zika virus RNA [Presence] in Unspecified specimen by Probe and target amplification method [79190-5] + + Language Note: The filters defined here are specified using the default LOINC language - English (US). Requests are meant to be specified and interpreted on the English version. The return can be in a specified language (if supported by the server). But note that not all filters/properties have language translations available. + --> + <filter> + <code value="parent"/> + <description value="Allows for the selection of a set of codes based on their appearance in the LOINC Multiaxial Hierarchy. Parent selects immediate parent only. For example, the code '79190-5' has the parent 'LP379670-5'"/> + <operator value="="/> + <value value="A Part code"/> + </filter> + <filter> + <code value="child"/> + <description value="Allows for the selection of a set of codes based on their appearance in the LOINC Multiaxial Hierarchy. Child selects immediate children only. For example, the code 'LP379670-5' has the child '79190-5'. Only LOINC Parts have children; LOINC codes do not have any children because they are leaf nodes."/> + <operator value="="/> + <value value="A comma separated list of Part or LOINC codes"/> + </filter> + <filter> + <code value="copyright"/> + <description value="Allows for the inclusion or exclusion of LOINC codes that include 3rd party copyright notices. LOINC = only codes with a sole copyright by Regenstrief. 3rdParty = only codes with a 3rd party copyright in addition to the one from Regenstrief"/> + <operator value="="/> + <value value="LOINC | 3rdParty"/> + </filter> + + <!-- + PROPERTIES + There are 4 kinds of properties that apply to all LOINC codes: + 1. FHIR: display, designation; these are not described here since they are inherent in the specification + 2. Infrastructural: defined by FHIR, but documented here for the LOINC Multiaxial Hierarchy + 3. Primary LOINC properties: defined by the main LOINC table + 4. Secondary LOINC properties: defined by the LoincPartLink table + Additionally, there are 2 kinds of properties specific to Document ontology and Radiology codes, respectively: + 1. LOINC/RSNA Radiology Playbook properties + 2. Document Ontology properties + --> + <!-- + Infrastructural properties - inherited from FHIR, but documented here for the LOINC Multiaxial Hierarchy. + --> + + <property> + <code value="parent"/> + <uri value="http://hl7.org/fhir/concept-properties#parent"/> + <description value="A parent code in the Multiaxial Hierarchy"/> + <type value="code"/> + </property> + <property> + <code value="child"/> + <uri value="http://hl7.org/fhir/concept-properties#child"/> + <description value="A child code in the Multiaxial Hierarchy"/> + <type value="code"/> + </property> + + <!-- + Primary LOINC properties. + These apply to the main LOINC codes, but not the Multiaxial Hierarchy, Answer lists, or the Part codes. + Notes: + In the LOINC code system resource, the display element = LONG_COMMON_NAME + Many properties are specified as type "Coding", which allows use of LOINC Part codes (LP-) and the display text. LOINC Parts and their associations to LOINC terms are published in the LOINC Part File. + The properties defined here follow the guidance of the LOINC Users' Guide, which states that they should be expressed with the LOINC attributes contained in the LOINC Table. Properties that are not defined in the LOINC Table use FHIR-styled names. + --> + + <property> + <code value="STATUS"/> + <uri value="http://loinc.org/property/STATUS"/> + <description value="Status of the term. Within LOINC, codes with STATUS=DEPRECATED are considered inactive. Current values: ACTIVE, TRIAL, DISCOURAGED, and DEPRECATED"/> + <type value="string"/> + </property> + <property> + <code value="COMPONENT"/> + <uri value="http://loinc.org/property/COMPONENT"/> + <description value="First major axis-component or analyte: Analyte Name, Analyte sub-class, Challenge"/> + <type value="Coding"/> + </property> + <property> + <code value="PROPERTY"/> + <uri value="http://loinc.org/property/PROPERTY"/> + <description value="Second major axis-property observed: Kind of Property (also called kind of quantity)"/> + <type value="Coding"/> + </property> + <property> + <code value="TIME_ASPCT"/> + <uri value="http://loinc.org/property/TIME_ASPCT"/> + <description value="Third major axis-timing of the measurement: Time Aspect (Point or moment in time vs. time interval)"/> + <type value="Coding"/> + </property> + <property> + <code value="SYSTEM"/> + <uri value="http://loinc.org/property/SYSTEM"/> + <description value="Fourth major axis-type of specimen or system: System (Sample) Type"/> + <type value="Coding"/> + </property> + <property> + <code value="SCALE_TYP"/> + <uri value="http://loinc.org/property/SCALE_TYP"/> + <description value="Fifth major axis-scale of measurement: Type of Scale"/> + <type value="Coding"/> + </property> + <property> + <code value="METHOD_TYP"/> + <uri value="http://loinc.org/property/METHOD_TYP"/> + <description value="Sixth major axis-method of measurement: Type of Method"/> + <type value="Coding"/> + </property> + <property> + <code value="CLASS"/> + <uri value="http://loinc.org/property/CLASS"/> + <description value="An arbitrary classification of terms for grouping related observations together"/> + <type value="Coding"/> + </property> + <property> + <code value="VersionLastChanged"/> + <uri value="http://loinc.org/property/VersionLastChanged"/> + <description value="The LOINC version number in which the record has last changed. For new records, this field contains the same value as the VersionFirstReleased property."/> + <type value="string"/> + </property> + <property> + <code value="CLASSTYPE"/> + <uri value="http://loinc.org/property/CLASSTYPE"/> + <description value="1=Laboratory class; 2=Clinical class; 3=Claims attachments; 4=Surveys"/> + <type value="string"/> + </property> + <property> + <code value="ORDER_OBS"/> + <uri value="http://loinc.org/property/ORDER_OBS"/> + <description value="Provides users with an idea of the intended use of the term by categorizing it as an order only, observation only, or both"/> + <type value="string"/> + </property> + <property> + <code value="HL7_ATTACHMENT_STRUCTURE"/> + <uri value="http://loinc.org/property/HL7_ATTACHMENT_STRUCTURE"/> + <description value="This property is populated in collaboration with the HL7 Payer-Provider Exchange (PIE) Work Group (previously called Attachments Work Group) as described in the HL7 Attachment Specification: Supplement to Consolidated CDA Templated Guide."/> + <type value="string"/> + </property> + <property> + <code value="VersionFirstReleased"/> + <uri value="http://loinc.org/property/VersionFirstReleased"/> + <description value="This is the LOINC version number in which this LOINC term was first published."/> + <type value="string"/> + </property> + <property> + <code value="PanelType"/> + <uri value="http://loinc.org/property/PanelType"/> + <description value="For LOINC terms that are panels, this attribute classifies them as a 'Convenience group', 'Organizer', or 'Panel'"/> + <type value="string"/> + </property> + <property> + <code value="ValidHL7AttachmentRequest"/> + <uri value="http://loinc.org/property/ValidHL7AttachmentRequest"/> + <description value="A value of Y in this field indicates that this LOINC code can be sent by a payer as part of an HL7 Attachment request for additional information."/> + <type value="string"/> + </property> + <property> + <code value="DisplayName"/> + <uri value="http://loinc.org/property/DisplayName"/> + <description value="A name that is more 'clinician-friendly' compared to the current LOINC Short Name, Long Common Name, and Fully Specified Name. It is created algorithmically from the manually crafted display text for each Part and is generally more concise than the Long Common Name."/> + <type value="string"/> + </property> + <property> + <code value="answer-list"/> + <uri value="http://loinc.org/property/answer-list"/> + <description value="An answer list associated with this LOINC code (if there are matching answer lists defined)."/> + <type value="Coding"/> + </property> + + <!-- + Secondary LOINC properties. + These properties also apply to the main LOINC codes, but not the Multiaxial Hierarchy, Answer lists, or the Part codes. + Notes: + These properties are defined in the LoincPartLink table. + --> + + <property> + <code value="analyte"/> + <uri value="http://loinc.org/property/analyte"/> + <description value="First sub-part of the Component, i.e., the part of the Component before the first carat"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-core"/> + <uri value="http://loinc.org/property/analyte-core"/> + <description value="The primary part of the analyte without the suffix"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-suffix"/> + <uri value="http://loinc.org/property/analyte-suffix"/> + <description value="The suffix part of the analyte, if present, e.g., Ab or DNA"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-numerator"/> + <uri value="http://loinc.org/property/analyte-numerator"/> + <description value="The numerator part of the analyte, i.e., everything before the slash in analytes that contain a divisor"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-divisor"/> + <uri value="http://loinc.org/property/analyte-divisor"/> + <description value="The divisor part of the analyte, if present, i.e., after the slash and before the first carat"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-divisor-suffix"/> + <uri value="http://loinc.org/property/analyte-divisor-suffix"/> + <description value="The suffix part of the divisor, if present"/> + <type value="Coding"/> + </property> + <property> + <code value="challenge"/> + <uri value="http://loinc.org/property/challenge"/> + <description value="Second sub-part of the Component, i.e., after the first carat"/> + <type value="Coding"/> + </property> + <property> + <code value="adjustment"/> + <uri value="http://loinc.org/property/adjustment"/> + <description value="Third sub-part of the Component, i.e., after the second carat"/> + <type value="Coding"/> + </property> + <property> + <code value="count"/> + <uri value="http://loinc.org/property/count"/> + <description value="Fourth sub-part of the Component, i.e., after the third carat"/> + <type value="Coding"/> + </property> + <property> + <code value="time-core"/> + <uri value="http://loinc.org/property/time-core"/> + <description value="The primary part of the Time"/> + <type value="Coding"/> + </property> + <property> + <code value="time-modifier"/> + <uri value="http://loinc.org/property/time-modifier"/> + <description value="The modifier of the Time value, such as mean or max"/> + <type value="Coding"/> + </property> + <property> + <code value="system-core"/> + <uri value="http://loinc.org/property/system-core"/> + <description value="The primary part of the System, i.e., without the super system"/> + <type value="Coding"/> + </property> + <property> + <code value="super-system"/> + <uri value="http://loinc.org/property/super-system"/> + <description value="The super system part of the System, if present. The super system represents the source of the specimen when the source is someone or something other than the patient whose chart the result will be stored in. For example, fetus is the super system for measurements done on obstetric ultrasounds, because the fetus is being measured and that measurement is being recorded in the patient's (mother's) chart."/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-gene"/> + <uri value="http://loinc.org/property/analyte-gene"/> + <description value="The specific gene represented in the analyte"/> + <type value="Coding"/> + </property> + <property> + <code value="category"/> + <uri value="http://loinc.org/property/category"/> + <description value="A single LOINC term can be assigned one or more categories based on both programmatic and manual tagging. Category properties also utilize LOINC Class Parts."/> + <type value="Coding"/> + </property> + <property> + <code value="search"/> + <uri value="http://loinc.org/property/search"/> + <description value="Synonyms, fragments, and other Parts that are linked to a term to enable more encompassing search results."/> + <type value="Coding"/> + </property> + + <!-- + LOINC/RSNA Radiology Playbook properties. These apply only to terms in the LOINC/RSNA Radiology Playbook File. + Notes: + Properties are specified as type "Coding", which are represented by LOINC Part codes (LP-) and their display names. + The attribute names here use FHIR styled names rather than their original LOINC style names because the original names contain periods. + --> + + <property> + <code value="rad-modality-modality-type"/> + <uri value="http://loinc.org/property/rad-modality-modality-type"/> + <description value="Modality is used to represent the device used to acquire imaging information."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-modality-modality-subtype"/> + <uri value="http://loinc.org/property/rad-modality-modality-subtype"/> + <description value="Modality subtype may be optionally included to signify a particularly common or evocative configuration of the modality."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-anatomic-location-region-imaged"/> + <uri value="http://loinc.org/property/rad-anatomic-location-region-imaged"/> + <description value="The Anatomic Location Region Imaged attribute is used in two ways: as a coarse-grained descriptor of the area imaged and a grouper for finding related imaging exams; or, it is used just as a grouper."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-anatomic-location-imaging-focus"/> + <uri value="http://loinc.org/property/rad-anatomic-location-imaging-focus"/> + <description value="The Anatomic Location Imaging Focus is a more fine-grained descriptor of the specific target structure of an imaging exam. In many areas, the focus should be a specific organ."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-anatomic-location-laterality-presence"/> + <uri value="http://loinc.org/property/rad-anatomic-location-laterality-presence"/> + <description value="Radiology Exams that require laterality to be specified in order to be performed are signified with an Anatomic Location Laterality Presence attribute set to 'True'"/> + <type value="Coding"/> + </property> + <property> + <code value="rad-anatomic-location-laterality"/> + <uri value="http://loinc.org/property/rad-anatomic-location-laterality"/> + <description value="Radiology exam Laterality is specified as one of: Left, Right, Bilateral, Unilateral, Unspecified"/> + <type value="Coding"/> + </property> + <property> + <code value="rad-view-aggregation"/> + <uri value="http://loinc.org/property/rad-view-aggregation"/> + <description value="Aggregation describes the extent of the imaging performed, whether in quantitative terms (e.g., '3 or more views') or subjective terms (e.g., 'complete')."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-view-view-type"/> + <uri value="http://loinc.org/property/rad-view-view-type"/> + <description value="View type names specific views, such as 'lateral' or 'AP'."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-maneuver-maneuver-type"/> + <uri value="http://loinc.org/property/rad-maneuver-maneuver-type"/> + <description value="Maneuver type indicates an action taken with the goal of elucidating or testing a dynamic aspect of the anatomy."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-timing"/> + <uri value="http://loinc.org/property/rad-timing"/> + <description value="The Timing/Existence property used in conjunction with pharmaceutical and maneuver properties. It specifies whether or not the imaging occurs in the presence of the administered pharmaceutical or a maneuver designed to test some dynamic aspect of anatomy or physiology ."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-pharmaceutical-substance-given"/> + <uri value="http://loinc.org/property/rad-pharmaceutical-substance-given"/> + <description value="The Pharmaceutical Substance Given specifies administered contrast agents, radiopharmaceuticals, medications, or other clinically important agents and challenges during the imaging procedure."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-pharmaceutical-route"/> + <uri value="http://loinc.org/property/rad-pharmaceutical-route"/> + <description value="Route specifies the route of administration of the pharmaceutical."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-reason-for-exam"/> + <uri value="http://loinc.org/property/rad-reason-for-exam"/> + <description value="Reason for exam is used to describe a clinical indication or a purpose for the study."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-guidance-for-presence"/> + <uri value="http://loinc.org/property/rad-guidance-for-presence"/> + <description value="Guidance for.Presence indicates when a procedure is guided by imaging."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-guidance-for-approach"/> + <uri value="http://loinc.org/property/rad-guidance-for-approach"/> + <description value="Guidance for.Approach refers to the primary route of access used, such as percutaneous, transcatheter, or transhepatic."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-guidance-for-action"/> + <uri value="http://loinc.org/property/rad-guidance-for-action"/> + <description value="Guidance for.Action indicates the intervention performed, such as biopsy, aspiration, or ablation."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-guidance-for-object"/> + <uri value="http://loinc.org/property/rad-guidance-for-object"/> + <description value="Guidance for.Object specifies the target of the action, such as mass, abscess or cyst."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-subject"/> + <uri value="http://loinc.org/property/rad-subject"/> + <description value="Subject is intended for use when there is a need to distinguish between the patient associated with an imaging study, and the target of the study."/> + <type value="Coding"/> + </property> + + <!-- + Document Ontology properties. + These apply only to terms in the LOINC Document Ontology File + Notes + Properties are specified as type "Coding", which are represented by LOINC Part codes (LP-) and their display names. + The attribute names here use FHIR styled names rather than their original LOINC style names because those contain periods. + --> + + <property> + <code value="document-kind"/> + <uri value="http://loinc.org/property/document-kind"/> + <description value="Characterizes the general structure of the document at a macro level."/> + <type value="Coding"/> + </property> + <property> + <code value="document-role"/> + <uri value="http://loinc.org/property/document-role"/> + <description value="Characterizes the training or professional level of the author of the document, but does not break down to specialty or subspecialty."/> + <type value="Coding"/> + </property> + <property> + <code value="document-setting"/> + <uri value="http://loinc.org/property/document-setting"/> + <description value="Setting is a modest extension of CMS’s coarse definition of care settings, such as outpatient, hospital, etc. Setting is not equivalent to location, which typically has more locally defined meanings."/> + <type value="Coding"/> + </property> + <property> + <code value="document-subject-matter-domain"/> + <uri value="http://loinc.org/property/document-subject-matter-domain"/> + <description value="Characterizes the clinical domain that is the subject of the document. For example, Internal Medicine, Neurology, Physical Therapy, etc."/> + <type value="Coding"/> + </property> + <property> + <code value="document-type-of-service"/> + <uri value="http://loinc.org/property/document-type-of-service"/> + <description value="Characterizes the kind of service or activity provided to/for the patient (or other subject of the service) that is described in the document."/> + <type value="Coding"/> + </property> + + <!-- Answer list related properties --> + <property> + <code value="answers-for"/> + <uri value="http://loinc.org/property/answers-for"/> + <description value="A LOINC Code for which this answer list is used."/> + <type value="Coding"/> + </property> + + <!-- Note for future consideration. These are properties of LA codes in the context of a particular list. Not global properties. + <property> + <code value="sequence"/> + <uri value="http://loinc.org/property/sequence"/> + <description value="Sequence Number of a answer in a set of answers (LA- codes only)"/> + <type value="integer"/> + </property> + <property> + <code value="score"/> + <uri value="http://loinc.org/property/score"/> + <description value="Score assigned to an answer (LA- codes only)"/> + <type value="integer"/> + </property> + --> +</CodeSystem> + + From 5b6ac3e6d668c2d169361ed23cce6094a8b6f917 Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" <juan.marchionatto@smilecdr.com> Date: Fri, 10 Sep 2021 11:22:04 -0400 Subject: [PATCH 05/31] Refactor to eliminate duplication --- ...JpaPersistedResourceValidationSupport.java | 26 +++++++----- .../fhir/jpa/term/BaseTermReadSvcImpl.java | 41 ++++++++++++++----- .../uhn/fhir/jpa/term/api/ITermReadSvc.java | 4 ++ 3 files changed, 50 insertions(+), 21 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java index 77467bd3431..b88cff4231d 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java @@ -26,6 +26,7 @@ import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.jpa.api.dao.DaoRegistry; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; +import ca.uhn.fhir.jpa.term.api.ITermReadSvc; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.api.SortOrderEnum; import ca.uhn.fhir.rest.api.SortSpec; @@ -81,6 +82,10 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport @Autowired private DaoRegistry myDaoRegistry; + + @Autowired + private ITermReadSvc myTermReadSvc; + private Class<? extends IBaseResource> myCodeSystemType; private Class<? extends IBaseResource> myStructureDefinitionType; private Class<? extends IBaseResource> myValueSetType; @@ -107,25 +112,20 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport @Override public IBaseResource fetchValueSet(String theSystem) { - boolean isNotLoincCodeSystem = ! StringUtils.containsIgnoreCase(theSystem, "loinc"); - boolean hasVersion = theSystem.contains("|"); - boolean isForGenericValueSet = theSystem.equals(LOINC_GENERIC_VALUESET_URL); - if (isNotLoincCodeSystem || hasVersion || isForGenericValueSet) { - return fetchResource(myValueSetType, theSystem); + if (myTermReadSvc.isLoincNotGenericUnversionedValueSet(theSystem)) { + Optional<IBaseResource> currentVSOpt = getValueSetCurrentVersion(new UriType(theSystem)); + return currentVSOpt.orElseThrow(() -> new ResourceNotFoundException( + "Couldn't find current version ValueSet for url: " + theSystem)); } - // if no version is present, we need to fetch the resource for the current version if one exists, - // in case it is not the last loaded - Optional<IBaseResource> currentVSOpt = getValueSetCurrentVersion(new UriType(theSystem)); - return currentVSOpt.orElseThrow(() -> new ResourceNotFoundException( - "Couldn't find current version ValueSet for url: " + theSystem)); + return fetchResource(myValueSetType, theSystem); } /** * Obtains the current version of a ValueSet using the fact that the current * version is always pointed by the ForcedId for the no-versioned VS */ - public Optional<IBaseResource> getValueSetCurrentVersion(UriType theUrl) { + private Optional<IBaseResource> getValueSetCurrentVersion(UriType theUrl) { if (! theUrl.getValueAsString().startsWith(LOINC_GENERIC_VALUESET_URL)) return Optional.empty(); if (! theUrl.getValue().startsWith(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH)) { @@ -133,6 +133,10 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport } String forcedId = theUrl.getValue().substring(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH.length()); + if (StringUtils.isBlank(forcedId)) return Optional.empty(); + + if (myTermReadSvc.mustReturnEmptyValueSet(theUrl.getValueAsString())) return Optional.empty(); + IFhirResourceDao<? extends IBaseResource> valueSetResourceDao = myDaoRegistry.getResourceDao(myValueSetType); IBaseResource valueSet = valueSetResourceDao.read(new IdDt("ValueSet", forcedId)); return Optional.ofNullable(valueSet); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java index b55dab9e7a4..cd96da10f42 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java @@ -2337,27 +2337,48 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { } + /** + * When the search is for no-version loinc system it uses the forcedId to obtain the current + * version, as it is not necessarily the last one anymore. + * For other cases it keeps on considering the last uploaded as the current + */ @Override public Optional<TermValueSet> findCurrentTermValueSet(String theUrl) { - boolean isNotLoincCodeSystem = ! StringUtils.containsIgnoreCase(theUrl, "loinc"); - boolean hasVersion = theUrl.contains("|"); - boolean isForGenericValueSet = theUrl.equals(LOINC_GENERIC_VALUESET_URL); - if (isNotLoincCodeSystem || hasVersion || isForGenericValueSet) { - List<TermValueSet> termValueSetList = myTermValueSetDao.findTermValueSetByUrl(Pageable.ofSize(1), theUrl); - if (termValueSetList.isEmpty()) return Optional.empty(); - return Optional.of(termValueSetList.get(0)); + if (isLoincNotGenericUnversionedValueSet(theUrl)) { + if (mustReturnEmptyValueSet(theUrl)) return Optional.empty(); + + String forcedId = theUrl.substring(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH.length()); + if (StringUtils.isBlank(forcedId)) return Optional.empty(); + + return myTermValueSetDao.findTermValueSetByForcedId(forcedId); } - if (! theUrl.startsWith(LOINC_GENERIC_VALUESET_URL)) return Optional.empty(); + List<TermValueSet> termValueSetList = myTermValueSetDao.findTermValueSetByUrl(Pageable.ofSize(1), theUrl); + if (termValueSetList.isEmpty()) return Optional.empty(); + return Optional.of(termValueSetList.get(0)); + } + + + @Override + public boolean mustReturnEmptyValueSet(String theUrl) { + if (! theUrl.startsWith(LOINC_GENERIC_VALUESET_URL)) return true; if (! theUrl.startsWith(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH)) { throw new InternalErrorException("Don't know how to extract ForcedId from url: " + theUrl); } String forcedId = theUrl.substring(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH.length()); - if (StringUtils.isBlank(forcedId)) return Optional.empty(); + return StringUtils.isBlank(forcedId); + } - return myTermValueSetDao.findTermValueSetByForcedId(forcedId); + + @Override + public boolean isLoincNotGenericUnversionedValueSet(String theUrl) { + boolean isLoincCodeSystem = StringUtils.containsIgnoreCase(theUrl, "loinc"); + boolean isNoVersion = ! theUrl.contains("|"); + boolean isNotLoincGenericValueSet = ! theUrl.equals(LOINC_GENERIC_VALUESET_URL); + + return isLoincCodeSystem && isNoVersion && isNotLoincGenericValueSet; } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java index b4d0d94e2e7..31569dedfd9 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java @@ -120,4 +120,8 @@ public interface ITermReadSvc extends IValidationSupport { * Version independent */ Optional<TermValueSet> findCurrentTermValueSet(String theUrl); + + boolean mustReturnEmptyValueSet(String theUrl); + + boolean isLoincNotGenericUnversionedValueSet(String theUrl); } From 8288d12e976f1851c6506f7c3361f65ceabdd183 Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" <juan.marchionatto@smilecdr.com> Date: Tue, 14 Sep 2021 09:58:32 -0400 Subject: [PATCH 06/31] Obtain current CodeSystem from null-pointed ForcedId, as done for ValueSet --- ...JpaPersistedResourceValidationSupport.java | 32 +++++++++++++------ .../fhir/jpa/term/BaseTermReadSvcImpl.java | 9 ++++++ .../uhn/fhir/jpa/term/api/ITermReadSvc.java | 12 +++++++ 3 files changed, 44 insertions(+), 9 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java index b88cff4231d..44b0b2582e2 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java @@ -34,7 +34,6 @@ import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.rest.param.StringParam; import ca.uhn.fhir.rest.param.TokenParam; import ca.uhn.fhir.rest.param.UriParam; -import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import com.github.benmanes.caffeine.cache.Cache; import com.github.benmanes.caffeine.cache.Caffeine; @@ -74,7 +73,8 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport private static final Logger ourLog = LoggerFactory.getLogger(JpaPersistedResourceValidationSupport.class); - public static final String LOINC_GENERIC_VALUESET_URL = "http://loinc.org/vs"; + public static final String LOINC_GENERIC_CODE_SYSTEM_URL = "http://loinc.org"; + public static final String LOINC_GENERIC_VALUESET_URL = LOINC_GENERIC_CODE_SYSTEM_URL + "/vs"; public static final String LOINC_GENERIC_VALUESET_URL_PLUS_SLASH = LOINC_GENERIC_VALUESET_URL + "/"; private final FhirContext myFhirContext; @@ -107,9 +107,29 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport @Override public IBaseResource fetchCodeSystem(String theSystem) { + if (myTermReadSvc.isLoincNotGenericUnversionedCodeSystem(theSystem)) { + Optional<IBaseResource> currentCSOpt = getCodeSystemCurrentVersion(new UriType(theSystem)); + return currentCSOpt.orElseThrow(() -> new ResourceNotFoundException( + "Couldn't find current version CodeSystem for url: " + theSystem)); + } + return fetchResource(myCodeSystemType, theSystem); } + /** + * Obtains the current version of a CodeSystem using the fact that the current + * version is always pointed by the ForcedId for the no-versioned CS + */ + private Optional<IBaseResource> getCodeSystemCurrentVersion(UriType theUrl) { + if (! theUrl.getValueAsString().contains("loinc")) return Optional.empty(); + + IFhirResourceDao<? extends IBaseResource> valueSetResourceDao = myDaoRegistry.getResourceDao(myCodeSystemType); + String forcedId = "loinc"; + IBaseResource codeSystem = valueSetResourceDao.read(new IdDt("CodeSystem", forcedId)); + return Optional.ofNullable(codeSystem); + } + + @Override public IBaseResource fetchValueSet(String theSystem) { if (myTermReadSvc.isLoincNotGenericUnversionedValueSet(theSystem)) { @@ -126,17 +146,11 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport * version is always pointed by the ForcedId for the no-versioned VS */ private Optional<IBaseResource> getValueSetCurrentVersion(UriType theUrl) { - if (! theUrl.getValueAsString().startsWith(LOINC_GENERIC_VALUESET_URL)) return Optional.empty(); - - if (! theUrl.getValue().startsWith(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH)) { - throw new InternalErrorException("Don't know how to extract ForcedId from url: " + theUrl.getValueAsString()); - } + if (myTermReadSvc.mustReturnEmptyValueSet(theUrl.getValueAsString())) return Optional.empty(); String forcedId = theUrl.getValue().substring(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH.length()); if (StringUtils.isBlank(forcedId)) return Optional.empty(); - if (myTermReadSvc.mustReturnEmptyValueSet(theUrl.getValueAsString())) return Optional.empty(); - IFhirResourceDao<? extends IBaseResource> valueSetResourceDao = myDaoRegistry.getResourceDao(myValueSetType); IBaseResource valueSet = valueSetResourceDao.read(new IdDt("ValueSet", forcedId)); return Optional.ofNullable(valueSet); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java index cd96da10f42..069117b8ad0 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java @@ -2382,6 +2382,15 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { } + @Override + public boolean isLoincNotGenericUnversionedCodeSystem(String theUrl) { + boolean isLoincCodeSystem = StringUtils.containsIgnoreCase(theUrl, "loinc"); + boolean isNoVersion = ! theUrl.contains("|"); + + return isLoincCodeSystem && isNoVersion; + } + + @SuppressWarnings("unchecked") private CodeValidationResult codeSystemValidateCode(String theCodeSystemUrl, String theCodeSystemVersion, String theCode, String theDisplay) { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java index 31569dedfd9..43c4ab902cc 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java @@ -121,7 +121,19 @@ public interface ITermReadSvc extends IValidationSupport { */ Optional<TermValueSet> findCurrentTermValueSet(String theUrl); + /** + * Version independent + */ boolean mustReturnEmptyValueSet(String theUrl); + /** + * Version independent + */ + boolean isLoincNotGenericUnversionedCodeSystem(String theSystem); + + /** + * Version independent + */ boolean isLoincNotGenericUnversionedValueSet(String theUrl); + } From bd456dfff28e0a608cca161e3b7b1e9779c82838 Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" <juan.marchionatto@smilecdr.com> Date: Tue, 14 Sep 2021 10:00:15 -0400 Subject: [PATCH 07/31] Enhance test by adding operations use cases. Improve test data with more version differentiators. --- ...erminologySvcImplCurrentVersionR4Test.java | 373 +++++++++++------- .../AccessoryFiles/AnswerFile/AnswerList.csv | 20 +- .../ImagingDocuments/ImagingDocumentCodes.csv | 2 +- .../AccessoryFiles/PanelsAndForms/Loinc.csv | 2 +- .../loinc-ver/v267/LoincTable/Loinc.csv | 2 +- .../ImagingDocuments/ImagingDocumentCodes.csv | 2 +- .../AccessoryFiles/PanelsAndForms/Loinc.csv | 2 +- .../loinc-ver/v268/LoincTable/Loinc.csv | 2 +- .../ImagingDocuments/ImagingDocumentCodes.csv | 2 +- .../LoincRsnaRadiologyPlaybook.csv | 18 +- .../AccessoryFiles/PanelsAndForms/Loinc.csv | 2 +- .../loinc-ver/v269/LoincTable/Loinc.csv | 2 +- 12 files changed, 254 insertions(+), 175 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java index 1358c66cecb..21ace9a8c7a 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java @@ -1,8 +1,12 @@ package ca.uhn.fhir.jpa.term; +import ca.uhn.fhir.context.support.IValidationSupport; +import ca.uhn.fhir.context.support.ValidationSupportContext; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; +import ca.uhn.fhir.jpa.config.BaseConfig; import ca.uhn.fhir.jpa.dao.r4.BaseJpaR4Test; import ca.uhn.fhir.jpa.entity.TermCodeSystemVersion; +import ca.uhn.fhir.jpa.entity.TermConcept; import ca.uhn.fhir.jpa.entity.TermValueSet; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; import ca.uhn.fhir.jpa.term.api.ITermReadSvc; @@ -10,12 +14,15 @@ import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.rest.param.TokenParam; import ca.uhn.fhir.rest.param.UriParam; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; +import com.google.common.collect.Lists; import com.google.common.collect.Sets; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.r4.model.CodeSystem; +import org.hl7.fhir.r4.model.CodeType; import org.hl7.fhir.r4.model.IdType; +import org.hl7.fhir.r4.model.UriType; import org.hl7.fhir.r4.model.ValueSet; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -24,6 +31,7 @@ import org.mockito.Mock; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.util.ResourceUtils; import javax.persistence.EntityManager; @@ -81,15 +89,20 @@ import static org.mockito.Mockito.when; public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { private static final Logger ourLog = LoggerFactory.getLogger(TerminologySvcImplCurrentVersionR4Test.class); - public static final String BASE_VS_URL = "http://loinc.org/vs/"; - - // some ValueSets have a version specified independent of the CS version being uploaded. This is one of them - public static final String VS_VERSIONED_ON_UPLOAD_ID = "LL1000-0"; - public static final String VS_VERSIONED_ON_UPLOAD = BASE_VS_URL + VS_VERSIONED_ON_UPLOAD_ID; + public static final String BASE_LOINC_URL = "http://loinc.org"; + public static final String BASE_LOINC_VS_URL = BASE_LOINC_URL + "/vs/"; // some ValueSets have a version specified independent of the CS version being uploaded. This one doesn't public static final String VS_NO_VERSIONED_ON_UPLOAD_ID = "loinc-rsna-radiology-playbook"; - public static final String VS_NO_VERSIONED_ON_UPLOAD = BASE_VS_URL + VS_NO_VERSIONED_ON_UPLOAD_ID; + public static final String VS_NO_VERSIONED_ON_UPLOAD = BASE_LOINC_VS_URL + VS_NO_VERSIONED_ON_UPLOAD_ID; + public static final String VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE = "17787-3"; + public static final String VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY = "NM Thyroid gland Study report"; + + // some ValueSets have a version specified independent of the CS version being uploaded. This is one of them + public static final String VS_VERSIONED_ON_UPLOAD_ID = "LL1000-0"; + public static final String VS_VERSIONED_ON_UPLOAD = BASE_LOINC_VS_URL + VS_VERSIONED_ON_UPLOAD_ID; + public static final String VS_VERSIONED_ON_UPLOAD_FIRST_CODE = "LA13825-7"; + public static final String VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY = "1 slice or 1 dinner roll"; public static final String VS_ANSWER_LIST_VERSION = "Beta.1"; public static final Set<String> possibleVersions = Sets.newHashSet("2.67", "2.68", "2.69"); @@ -104,6 +117,9 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { @Autowired private TermLoaderSvcImpl myTermLoaderSvc; @Autowired private ITermReadSvc myITermReadSvc; + @Autowired + @Qualifier(BaseConfig.JPA_VALIDATION_SUPPORT) + private IValidationSupport myJpaPersistedResourceValidationSupport; private ZipCollectionBuilder myFiles; private ServletRequestDetails myRequestDetails = new ServletRequestDetails(); @@ -124,6 +140,9 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { public void beforeEach() throws Exception { // myTermLoaderSvc = TermLoaderSvcImpl.withoutProxyCheck(myTermDeferredStorageSvc, myTermCodeSystemStorageSvc); + // myTermSvc.preExpandDeferredValueSetsToTerminologyTables(); + + File file = ResourceUtils.getFile("classpath:loinc-ver/" + LOINC_UPLOAD_PROPERTIES_FILE.getCode()); uploadProperties = new Properties(); uploadProperties.load(new FileInputStream(file)); @@ -136,58 +155,188 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { /** - * For input version or for current (when input is null) validates following operations: - * _ JpaTerminologyProvider.in() - * _ JpaTerminologyProvider.expand() - * _ JpaTerminologyProvider.lookup() - * - * _ BaseJpaResourceProvider.read() - * _ BaseJpaResourceProvider.validate() + * For input version or for current (when input is null) validates search, expand, lookup and validateCode operations */ - private void validateOperations(Collection<String> theExpectedVersions) { + private void validateOperations(String currentVersion, Collection<String> theExpectedVersions) { validateValueSetSearch(theExpectedVersions); - validateValueExpand(theExpectedVersions); + validateValueExpand(currentVersion, theExpectedVersions); - validateValueLookup(theExpectedVersions); - - -// // JpaTerminologyProvider.lookup() -// // JpaTerminologyProvider.in() -// BaseJpaResourceProviderCodeSystemR4.lookup() -// BaseJpaResourceProviderCodeSystemR4.subsumes() -// BaseJpaResourceProviderCodeSystemR4.validateCode() +// validateValueLookup(currentVersion, theExpectedVersions); // - } - - private void validateValueLookup(Collection<String> theExpectedVersions) { +// validateValidateCode(currentVersion, theExpectedVersions); } - private void validateValueExpand(Collection<String> theExpectedVersions) { + private void validateValidateCode(String theCurrentVersion, Collection<String> allVersions) { + IValidationSupport.CodeValidationResult resultNoVersioned = myCodeSystemDao.validateCode(null, + new UriType(BASE_LOINC_URL), null, new CodeType(VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE), + null, null, null, null); + assertNotNull(resultNoVersioned); + assertEquals(prefixWithVersion(theCurrentVersion, VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), resultNoVersioned.getDisplay()); + + IValidationSupport.CodeValidationResult resultVersioned = myCodeSystemDao.validateCode(null, + new UriType(BASE_LOINC_URL), null, new CodeType(VS_VERSIONED_ON_UPLOAD_FIRST_CODE), + null, null, null, null); + assertNotNull(resultVersioned); + assertEquals(prefixWithVersion(theCurrentVersion, VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), resultVersioned.getDisplay()); + + allVersions.forEach(this::validateValidateCodeForVersion); + } + + + private void validateValidateCodeForVersion(String theVersion) { + IValidationSupport.CodeValidationResult resultNoVersioned = myCodeSystemDao.validateCode(null, + new UriType(BASE_LOINC_URL), null, new CodeType(VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE), + null, null, null, null); + assertNotNull(resultNoVersioned); + assertEquals(prefixWithVersion(theVersion, VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), resultNoVersioned.getDisplay()); + + IValidationSupport.CodeValidationResult resultVersioned = myCodeSystemDao.validateCode(null, + new UriType(BASE_LOINC_URL), null, new CodeType(VS_VERSIONED_ON_UPLOAD_FIRST_CODE), + null, null, null, null); + assertNotNull(resultVersioned); + assertEquals(prefixWithVersion(theVersion, VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), resultVersioned.getDisplay()); + } + + + + private void validateValueLookup(String theCurrentVersion, Collection<String> allVersions) { + IValidationSupport.LookupCodeResult resultNoVer = myValidationSupport.lookupCode( + new ValidationSupportContext(myValidationSupport), BASE_LOINC_URL, VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE, null); + assertNotNull(resultNoVer); + String expectedNoVer = prefixWithVersion(theCurrentVersion, VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY); + assertEquals(expectedNoVer, resultNoVer.getCodeDisplay()); + + IValidationSupport.LookupCodeResult resultWithVer = myValidationSupport.lookupCode( + new ValidationSupportContext(myValidationSupport), BASE_LOINC_URL, VS_VERSIONED_ON_UPLOAD_FIRST_CODE, null); + assertNotNull(resultWithVer); + String expectedWithVer = prefixWithVersion(theCurrentVersion, VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY); + assertEquals(expectedWithVer, resultWithVer.getCodeDisplay()); + + allVersions.forEach(this::lookupForVersion); + } + + + private void lookupForVersion(String theVersion) { + IValidationSupport.LookupCodeResult resultNoVer = myValidationSupport.lookupCode( + new ValidationSupportContext(myValidationSupport), BASE_LOINC_URL + "|" + theVersion, + VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE, null); + assertNotNull(resultNoVer); + String expectedNoVer = prefixWithVersion(theVersion, VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY); + assertEquals(expectedNoVer, resultNoVer.getCodeDisplay()); + + IValidationSupport.LookupCodeResult resultWithVer = myValidationSupport.lookupCode( + new ValidationSupportContext(myValidationSupport), BASE_LOINC_URL + "|" + theVersion, + VS_VERSIONED_ON_UPLOAD_FIRST_CODE, null); + assertNotNull(resultWithVer); + String expectedWithVer = prefixWithVersion(theVersion, VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY); + assertEquals(expectedWithVer, resultWithVer.getCodeDisplay()); + } + + + private String prefixWithVersion(String version, String suffix) { + return (version == null ? "" : "v" + version + " ") + suffix; + + } + + private void validateValueExpand(String currentVersion, Collection<String> theAllVersions) { // for CS ver = null, VS ver = null ValueSet vs = myValueSetDao.expandByIdentifier(VS_NO_VERSIONED_ON_UPLOAD, null); assertEquals(1, vs.getExpansion().getContains().size()); + // version was added before code display to validate + assertEquals(prefixWithVersion(currentVersion, VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), + vs.getExpansion().getContains().iterator().next().getDisplay()); + // for CS ver = null, VS ver != null ValueSet vs1 = myValueSetDao.expandByIdentifier(VS_VERSIONED_ON_UPLOAD + "|" + VS_ANSWER_LIST_VERSION, null); assertEquals(3, vs1.getExpansion().getContains().size()); - // now for each uploaded version - theExpectedVersions.forEach(this::validateValueExpandForVersion); + assertEquals(prefixWithVersion(currentVersion, VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), + vs1.getExpansion().getContains().iterator().next().getDisplay()); + validateExpandedTermConcepts(currentVersion, theAllVersions); + + // now for each uploaded version + theAllVersions.forEach(this::validateValueExpandForVersion); } + + private void validateExpandedTermConcepts(String theCurrentVersion, Collection<String> theAllVersions) { + @SuppressWarnings("unchecked") + TermConcept termConceptNoVerCsvNoVer = (TermConcept) myEntityManager.createQuery( + "select tc from TermConcept tc join fetch tc.myCodeSystem tcsv where tc.myCode = '" + + VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId is null").getSingleResult(); + assertNotNull(termConceptNoVerCsvNoVer); + assertEquals(VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY, termConceptNoVerCsvNoVer.getDisplay()); + + @SuppressWarnings("unchecked") + TermConcept termConceptVerCsvNoVer = (TermConcept) myEntityManager.createQuery( + "select tc from TermConcept tc join fetch tc.myCodeSystem tcsv where tc.myCode = '" + + VS_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId is null").getSingleResult(); + assertNotNull(termConceptVerCsvNoVer); + assertEquals(VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY, termConceptVerCsvNoVer.getDisplay()); + + if (theCurrentVersion != null) { + @SuppressWarnings("unchecked") + TermConcept termConceptNoVerCsvVer = (TermConcept) myEntityManager.createQuery( + "select tc from TermConcept tc join fetch tc.myCodeSystem tcsv where tc.myCode = '" + + VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId is null").getSingleResult(); + assertNotNull(termConceptNoVerCsvVer); + assertEquals(VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY, termConceptNoVerCsvVer.getDisplay()); + + @SuppressWarnings("unchecked") + TermConcept termConceptVerCsvVer = (TermConcept) myEntityManager.createQuery( + "select tc from TermConcept tc join fetch tc.myCodeSystem tcsv where tc.myCode = '" + + VS_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId is null").getSingleResult(); + assertNotNull(termConceptVerCsvVer); + assertEquals(VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY, termConceptVerCsvVer.getDisplay()); + } + + + theAllVersions.forEach(this::validateExpandedTermConceptsForVersion); + } + + + private void validateExpandedTermConceptsForVersion(String theVersion) { + @SuppressWarnings("unchecked") + TermConcept termConceptNoVer = (TermConcept) myEntityManager.createQuery( + "select tc from TermConcept tc join fetch tc.myCodeSystem tcsv where tc.myCode = '" + + VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId = '" + theVersion + "'").getSingleResult(); + assertNotNull(termConceptNoVer); + assertEquals(prefixWithVersion(theVersion, VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), termConceptNoVer.getDisplay()); + + @SuppressWarnings("unchecked") + TermConcept termConceptVer = (TermConcept) myEntityManager.createQuery( + "select tc from TermConcept tc join fetch tc.myCodeSystem tcsv where tc.myCode = '" + + VS_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId = '" + theVersion + "'").getSingleResult(); + assertNotNull(termConceptVer); + assertEquals(prefixWithVersion(theVersion, VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), termConceptVer.getDisplay()); + } + + private void validateValueExpandForVersion(String theVersion) { // for CS ver != null, VS ver = null + ValueSet vs2 = myValueSetDao.expandByIdentifier( VS_NO_VERSIONED_ON_UPLOAD + "|" + theVersion, null); assertEquals(1, vs2.getExpansion().getContains().size()); + // version was added before code display to validate + assertEquals(prefixWithVersion(theVersion, VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), + vs2.getExpansion().getContains().iterator().next().getDisplay()); + + // for CS ver != null, VS ver != null + ValueSet vs3 = myValueSetDao.expandByIdentifier( VS_VERSIONED_ON_UPLOAD + "|" + VS_ANSWER_LIST_VERSION + "-" + theVersion, null); assertEquals(3, vs3.getExpansion().getContains().size()); + + // version was added before code display to validate + assertEquals(prefixWithVersion( theVersion, VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), + vs3.getExpansion().getContains().iterator().next().getDisplay()); } @@ -288,13 +437,11 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { /** * Validates that: * for CodeSystem: - * _ current CS has no version, obtaining it from DAO + * _ current CS has no version * _ current TCS has no version * for ValueSet: * _ current TVSs with upload version have upload-version with no version append * _ current TVSs with no upload version have null version - * operations: - * _ validate operation for current (no version parameter) */ private void runCommonValidations(String theVersion) { // for CodeSystem: @@ -308,6 +455,11 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { shouldNotBePresentVersions.remove(theVersion); shouldNotBePresentVersions.stream().forEach(vv -> assertFalse(csString.contains(vv))); + // same reading it from term service + CodeSystem cs = myITermReadSvc.fetchCanonicalCodeSystemFromCompleteContext(BASE_LOINC_URL); + assertEquals(BASE_LOINC_URL, cs.getUrl()); + assertNull(cs.getVersion()); + // _ current TermCodeSystem has no version TermCodeSystemVersion termCSVersion = fetchCurrentCodeSystemVersion(); assertNotNull(termCSVersion); @@ -315,6 +467,11 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { // for ValueSet: + // for ValueSet resource + ValueSet vs = (ValueSet) myJpaPersistedResourceValidationSupport.fetchValueSet(VS_NO_VERSIONED_ON_UPLOAD); + assertEquals(VS_NO_VERSIONED_ON_UPLOAD, vs.getUrl()); + assertNull(vs.getVersion()); + // current TermVSs with no upload version have null version Optional<TermValueSet> noUploadCurrentVsOpt = myITermReadSvc.findCurrentTermValueSet(VS_NO_VERSIONED_ON_UPLOAD); assertTrue(noUploadCurrentVsOpt.isPresent()); @@ -324,64 +481,50 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { Optional<TermValueSet> uploadCurrentVsOpt = myITermReadSvc.findCurrentTermValueSet(VS_VERSIONED_ON_UPLOAD); assertTrue(uploadCurrentVsOpt.isPresent()); assertEquals(VS_ANSWER_LIST_VERSION, uploadCurrentVsOpt.get().getVersion()); + } @Test() - public void uploadCSCurrentNoVersion() throws Exception { + public void uploadCurrentNoVersion() throws Exception { IIdType csId = uploadLoincCodeSystem(null, true); runCommonValidations(null); // validate operation for current (no version parameter) - validateOperations(Collections.emptySet()); - + validateOperations(null, Collections.emptySet()); } @Test() - public void uploadCSCurrentWithVersion() throws Exception { + public void uploadCurrentWithVersion() throws Exception { String ver = "2.67"; IIdType csId = uploadLoincCodeSystem(ver, true); runCommonValidations(ver); -// myTermSvc.preExpandDeferredValueSetsToTerminologyTables(); - // validate operation for specific version - validateOperations(Collections.singleton(ver)); + validateOperations(ver, Collections.singleton(ver)); } -// @Test + @Test public void uploadCurrentNoVersionThenNoCurrent() throws Exception { uploadLoincCodeSystem(null, true); + String ver = "2.67"; uploadLoincCodeSystem(ver, false); - Optional<Long> csIdNoVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc"); - assertTrue(csIdNoVersionedOpt.isPresent()); + myTermSvc.preExpandDeferredValueSetsToTerminologyTables(); - Optional<Long> csIdVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc" + "-" + ver); - assertTrue(csIdVersionedOpt.isPresent()); - - // current CS data is no-ver - CodeSystem codeSystem = myCodeSystemDao.read(new IdType("loinc")); - String csString = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem); - ourLog.info("CodeSystem:\n" + csString); - - // no versions present in CS data - possibleVersions.stream().forEach(vv -> assertFalse(csString.contains(vv))); - - - // ValueSets - - checkVsVersionExists(null); + runCommonValidations(ver); + // validate operation for specific version + validateOperations(null, Collections.singleton(ver)); } -// @Test + @Test public void uploadFirstCurrentWithVersionThenNoCurrent() throws Exception { String firstVer = "2.67"; uploadLoincCodeSystem(firstVer, true); @@ -389,116 +532,52 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { String secondVer = "2.68"; uploadLoincCodeSystem(secondVer, false); - Optional<Long> csIdNoVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc"); - assertTrue(csIdNoVersionedOpt.isPresent()); + runCommonValidations(firstVer); + runCommonValidations(secondVer); - Optional<Long> csIdFirstVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc" + "-" + firstVer); - assertTrue(csIdFirstVersionedOpt.isPresent()); - - Optional<Long> csIdSecondVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc" + "-" + secondVer); - assertTrue(csIdSecondVersionedOpt.isPresent()); - - // current CS data is no-ver - CodeSystem codeSystem = myCodeSystemDao.read(new IdType("loinc")); - String csString = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem); - ourLog.info("CodeSystem:\n" + csString); - - // only 2.67 versions present in CS data - Set<String> noVersionsPresent = new HashSet(possibleVersions); - noVersionsPresent.remove(firstVer); - noVersionsPresent.stream().forEach(vv -> assertFalse(csString.contains(vv))); - - // ValueSets - - checkVsVersionExists(firstVer); - checkVsVersionExists(secondVer); - - - - -// Optional<Long> csIdVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc" + "-" + "2.58"); -// assertFalse(csIdVersionedOpt.isPresent()); -// -// Optional<Long> csIdNoVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc"); -// assertTrue(csIdNoVersionedOpt.isPresent()); - - // make sure: - - // curr CS ver is null ver with 2.59 data - - // VS present for V 2.58 (curr = true), 2,59 (curr = false) & null (curr = true) - - // only one VS per url-ver true - } - - private void checkVsVersionExists(String ver) { - String vsNoVersionedVersion = VS_NO_VERSIONED_ON_UPLOAD + (ver == null ? "" : "-" + ver); - Optional<TermValueSet> noUploadVersionedVsOpt = myITermReadSvc.findCurrentTermValueSet(vsNoVersionedVersion); - assertTrue(noUploadVersionedVsOpt.isPresent()); - assertNull(noUploadVersionedVsOpt.get().getVersion()); - - String vsersionedVersion = VS_VERSIONED_ON_UPLOAD + (ver == null ? "" : "-" + ver); - Optional<TermValueSet> uploadVersionedVsOpt = myITermReadSvc.findCurrentTermValueSet(vsersionedVersion); - assertTrue(uploadVersionedVsOpt.isPresent()); - assertEquals(VS_ANSWER_LIST_VERSION, uploadVersionedVsOpt.get().getVersion()); + // validate operation for specific version + validateOperations(null, Lists.newArrayList(firstVer, secondVer)); } - // @Test + @Test public void uploadFirstCurrentNoVersionThenNoCurrentThenCurrent() throws Exception { uploadLoincCodeSystem(null, true); - uploadLoincCodeSystem("2.58", false); - uploadLoincCodeSystem("2.59", true); -// Optional<Long> csIdVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc" + "-" + "2.58"); -// assertFalse(csIdVersionedOpt.isPresent()); -// -// Optional<Long> csIdNoVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc"); -// assertTrue(csIdNoVersionedOpt.isPresent()); + String firstVer = "2.67"; + uploadLoincCodeSystem(firstVer, false); - // make sure: + String secondVer = "2.68"; + uploadLoincCodeSystem(secondVer, true); - // curr CS ver is null ver with 2.59 data + runCommonValidations(firstVer); + runCommonValidations(secondVer); - // VS present for V 2.58 (curr = false), 2.59 (curr = true) & null (curr = true) - - // only one VS per url-ver true - // both curr = true have same data (2.59) + // validate operation for specific version + validateOperations(secondVer, Lists.newArrayList(firstVer, secondVer)); } -// @Test + @Test public void uploadFirstCurrentWithVersionThenNoCurrentThenCurrent() throws Exception { - uploadLoincCodeSystem("2.57", true); - uploadLoincCodeSystem("2.58", false); - uploadLoincCodeSystem("2.59", true); + String firstVer = "2.67"; + uploadLoincCodeSystem(firstVer, true); -// Optional<Long> csIdVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc" + "-" + "2.58"); -// assertFalse(csIdVersionedOpt.isPresent()); -// -// Optional<Long> csIdNoVersionedOpt = myForcedIdDao.findByTypeAndForcedId("CodeSystem", "loinc"); -// assertTrue(csIdNoVersionedOpt.isPresent()); + String secondVer = "2.68"; + uploadLoincCodeSystem(secondVer, false); - // make sure: + String thirdVer = "2.68"; + uploadLoincCodeSystem(thirdVer, true); - // curr CS ver is null ver with 2.59 data + runCommonValidations(firstVer); + runCommonValidations(secondVer); + runCommonValidations(thirdVer); - // VS present for V 2.57 (curr = false), 2.58 (curr = false), 2,59 (curr = true) & null (curr = true) - - // both curr = true have same data (2.59) + // validate operation for specific version + validateOperations(thirdVer, Lists.newArrayList(firstVer, secondVer, thirdVer)); } -// @Test -// public void testValidateCode() { -// createCodeSystem(); -// -// IValidationSupport.CodeValidationResult validation = myTermSvc.validateCode(new ValidationSupportContext(myValidationSupport), new ConceptValidationOptions(), CS_URL, "ParentWithNoChildrenA", null, null); -// assertTrue(validation.isOk()); -// -// validation = myTermSvc.validateCode(new ValidationSupportContext(myValidationSupport), new ConceptValidationOptions(), CS_URL, "ZZZZZZZ", null, null); -// assertFalse(validation.isOk()); -// } private IIdType uploadLoincCodeSystem(String theVersion, boolean theMakeItCurrent) throws Exception { diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/AnswerFile/AnswerList.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/AnswerFile/AnswerList.csv index fae22daef78..f07d57edd54 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/AnswerFile/AnswerList.csv +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/AnswerFile/AnswerList.csv @@ -1,12 +1,12 @@ "AnswerListId","AnswerListName" ,"AnswerListOID" ,"ExtDefinedYN","ExtDefinedAnswerListCodeSystem","ExtDefinedAnswerListLink" ,"AnswerStringId","LocalAnswerCode","LocalAnswerCodeSystem","SequenceNumber","DisplayText" ,"ExtCodeId","ExtCodeDisplayName" ,"ExtCodeSystem" ,"ExtCodeSystemVersion" ,"ExtCodeSystemCopyrightNotice" ,"SubsequentTextPrompt","Description","Score" -"LL1000-0" ,"v2.67 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"1 slice or 1 dinner roll" , , , , , , , , -"LL1000-0" ,"v2.67 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"2 slices or 2 dinner rolls" , , , , , , , , -"LL1000-0" ,"v2.67 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"More than 2 slices or 2 dinner rolls", , , , , , , , -"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"Never" , , , , , , , , -"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"1-3 times per month" , , , , , , , , -"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"1-2 times per week" , , , , , , , , -"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"3-4 times per week" , , , , , , , , -"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"5-6 times per week" , , , , , , , , -"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"1 time per day" , , , , , , , , -"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , +"LL1000-0" ,"v2.67 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"v2.67 1 slice or 1 dinner roll" , , , , , , , , +"LL1000-0" ,"v2.67 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"v2.67 2 slices or 2 dinner rolls" , , , , , , , , +"LL1000-0" ,"v2.67 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"v2.67 More than 2 slices or 2 dinner rolls", , , , , , , , +"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"v2.67 Never" , , , , , , , , +"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"v2.67 1-3 times per month" , , , , , , , , +"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"v2.67 1-2 times per week" , , , , , , , , +"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"v2.67 3-4 times per week" , , , , , , , , +"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"v2.67 5-6 times per week" , , , , , , , , +"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"v2.67 1 time per day" , , , , , , , , +"LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"v2.67 Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , "LL1892-0" ,"v2.67 ICD-9_ICD-10" ,"1.3.6.1.4.1.12009.10.1.1069","Y" , ,"http://www.cdc.gov/nchs/icd.htm", , , , , , , , , , , , , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv index a26397639ff..06e5b67b70d 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv @@ -1,6 +1,6 @@ "LOINC_NUM","LONG_COMMON_NAME" "11525-3","US Pelvis Fetus for pregnancy" -"17787-3","NM Thyroid gland Study report" +"17787-3","v2.67 NM Thyroid gland Study report" "18744-3","Bronchoscopy study" "18746-8","Colonoscopy study" "18748-4","Diagnostic imaging study" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/Loinc.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/Loinc.csv index 20379cb7f1d..62a7af00421 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/Loinc.csv +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/Loinc.csv @@ -10,7 +10,7 @@ "10020-6" ,"R' wave amplitude.lead V5" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V5; R wave Amp L-V5; Random; Right; Voltage" ,"R' wave Amp L-V5" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V5" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , "61438-8" ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30D","Find" ,"Pt" ,"^Patient" ,"Ord" ,"PhenX" ,"PHENX" ,"2.44" ,"MIN" , ,"TRIAL" , ,2 , , , ,"Each time you eat bread, toast or dinner rolls, how much do you usually eat?","PhenX.050201100100","N" , ,"Finding; Findings; How much bread in 30D; Last; Ordinal; Point in time; QL; Qual; Qualitative; Random; Screen" ,"How much bread in 30D PhenX", , , , , ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]", , , , , , , ,0 ,0 ,0 , , , , , , , "10000-8" ,"R wave duration.lead AVR" ,"Time" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; Durat; ECG; EKG.MEASUREMENTS; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave dur L-AVR; R wave dur L-AVR; Random; Right" ,"R wave dur L-AVR" ,"Observation", , , ,"s" ,"R wave duration in lead AVR" , , ,"s" , , , , ,0 ,0 ,0 , , , , , , , -"17787-3" ,"Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , +"17787-3" ,"Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"v2.67 NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , "17788-1" ,"Large unstained cells/100 leukocytes" ,"NFr" ,"Pt" ,"Bld" ,"Qn" ,"Automated count","HEM/BC" ,"2.50" ,"MIN" ,"Part of auto diff output of Bayer H*3S; peroxidase negative cells too large to be classified as lymph or basophil" ,"ACTIVE", ,1 , , , , , ,"Y" ,"%" ,"100WBC; Auto; Automated detection; Blood; Cell; Cellularity; Elec; Elect; Electr; HEMATOLOGY/CELL COUNTS; Leuc; Leuk; Leukocyte; Lkcs; LUC; Number Fraction; Percent; Point in time; QNT; Quan; Quant; Quantitative; Random; WB; WBC; WBCs; White blood cell; White blood cells; Whole blood" ,"LUC/leuk NFr Bld Auto" ,"Observation", , , ,"%" ,"Large unstained cells/100 leukocytes in Blood by Automated count" , , ,"%" , , , , ,1894 ,0 ,1894 , , , , , ,"1.0l" , "11488-4" ,"Consultation note" ,"Find" ,"Pt" ,"{Setting}" ,"Doc" ,"{Role}" ,"DOC.ONTOLOGY","2.63" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Consult note; DOC.ONT; Document; Encounter; Evaluation and management; Evaluation and management note; Finding; Findings; notes; Point in time; Random; Visit note" ,"Consult note" ,"Both" , , , , ,"Consult note" , , , , , , ,"Edit made because this term is conformant to the Document Ontology axis values and therefore are being placed in this class.; Based on Clinical LOINC Committee decision during the September 2014 meeting, {Provider} was changed to {Author Type} to emphasize a greater breadth of potential document authors. At the September 2015 Clinical LOINC Committee meeting, the Committee decided to change {Author Type} to {Role} to align with the 'Role' axis name in the LOINC Document Ontology.; Because it is too difficult to maintain and because the distinction between documents and sections is not clear-cut nor necessary in most cases, the DOCUMENT_SECTION field has been deemed to have little value. The field has been set to null in the December 2017 release in preparation for removal in the December 2018 release. These changes were approved by the Clinical LOINC Committee.",0 ,0 ,0 ,"IG exists" , , , ,"81222-2;72231-4;81243-8","1.0j-a" ,"Y" "47239-9" ,"Reason for stopping HIV Rx" ,"Type" ,"Pt" ,"^Patient" ,"Nom" ,"Reported" ,"ART" ,"2.50" ,"MIN" ,"Reason for stopping antiretroviral therapy" ,"ACTIVE", ,2 , , , , , ,"N" , ,"AIDS; Anti-retroviral therapy; ART; Human immunodeficiency virus; Nominal; Point in time; Random; Treatment; Typ" ,"Reason for stopping HIV Rx" ,"Observation", , ,"Copyright © 2006 World Health Organization. Used with permission. Publications of the World Health Organization can be obtained from WHO Press, World Health Organization, 20 Avenue Appia, 1211 Geneva 27, Switzerland (tel: +41 22 791 2476; fax: +41 22 791 4857; email: bookorders@who.int). Requests for permission to reproduce or translate WHO publications – whether for sale or for noncommercial distribution – should be addressed to WHO Press, at the above address (fax: +41 22 791 4806; email: permissions@who.int). The designations employed and the presentation of the material in this publication do not imply the expression of any opinion whatsoever on the part of the World Health Organization concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Dotted lines on maps represent approximate border lines for which there may not yet be full agreement. The mention of specific companies or of certain manufacturers’ products does not imply that they are endorsed or recommended by the World Health Organization in preference to others of a similar nature that are not mentioned. Errors and omissions excepted, the names of proprietary products are distinguished by initial capital letters. All reasonable precautions have been taken by WHO to verify the information contained in this publication. However, the published material is being distributed without warranty of any kind, either express or implied. The responsibility for the interpretation and use of the material lies with the reader. In no event shall the World Health Organization be liable for damages arising from its use.", ,"Reason for stopping HIV treatment" , , , , , , , ,0 ,0 ,0 , ,"WHO_HIV" , , , ,"2.22" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/LoincTable/Loinc.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/LoincTable/Loinc.csv index 4017edb85b0..1998b5c00e5 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/LoincTable/Loinc.csv +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/LoincTable/Loinc.csv @@ -10,7 +10,7 @@ "10020-6" ,"v2.67 R' wave amplitude.lead V5" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V5; R wave Amp L-V5; Random; Right; Voltage" ,"R' wave Amp L-V5" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V5" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , "61438-8" ,"v2.67 Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30D","Find" ,"Pt" ,"^Patient" ,"Ord" ,"PhenX" ,"PHENX" ,"2.44" ,"MIN" , ,"TRIAL" , ,2 , , , ,"Each time you eat bread, toast or dinner rolls, how much do you usually eat?","PhenX.050201100100","N" , ,"Finding; Findings; How much bread in 30D; Last; Ordinal; Point in time; QL; Qual; Qualitative; Random; Screen" ,"How much bread in 30D PhenX", , , , , ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]", , , , , , , ,0 ,0 ,0 , , , , , , , "10000-8" ,"v2.67 R wave duration.lead AVR" ,"Time" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; Durat; ECG; EKG.MEASUREMENTS; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave dur L-AVR; R wave dur L-AVR; Random; Right" ,"R wave dur L-AVR" ,"Observation", , , ,"s" ,"R wave duration in lead AVR" , , ,"s" , , , , ,0 ,0 ,0 , , , , , , , -"17787-3" ,"v2.67 Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , +"17787-3" ,"v2.67 Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"v2.67 NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , "17788-1" ,"v2.67 Large unstained cells/100 leukocytes" ,"NFr" ,"Pt" ,"Bld" ,"Qn" ,"Automated count","HEM/BC" ,"2.50" ,"MIN" ,"Part of auto diff output of Bayer H*3S; peroxidase negative cells too large to be classified as lymph or basophil" ,"ACTIVE", ,1 , , , , , ,"Y" ,"%" ,"100WBC; Auto; Automated detection; Blood; Cell; Cellularity; Elec; Elect; Electr; HEMATOLOGY/CELL COUNTS; Leuc; Leuk; Leukocyte; Lkcs; LUC; Number Fraction; Percent; Point in time; QNT; Quan; Quant; Quantitative; Random; WB; WBC; WBCs; White blood cell; White blood cells; Whole blood" ,"LUC/leuk NFr Bld Auto" ,"Observation", , , ,"%" ,"Large unstained cells/100 leukocytes in Blood by Automated count" , , ,"%" , , , , ,1894 ,0 ,1894 , , , , , ,"1.0l" , "11488-4" ,"v2.67 Consultation note" ,"Find" ,"Pt" ,"{Setting}" ,"Doc" ,"{Role}" ,"DOC.ONTOLOGY","2.63" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Consult note; DOC.ONT; Document; Encounter; Evaluation and management; Evaluation and management note; Finding; Findings; notes; Point in time; Random; Visit note" ,"Consult note" ,"Both" , , , , ,"Consult note" , , , , , , ,"Edit made because this term is conformant to the Document Ontology axis values and therefore are being placed in this class.; Based on Clinical LOINC Committee decision during the September 2014 meeting, {Provider} was changed to {Author Type} to emphasize a greater breadth of potential document authors. At the September 2015 Clinical LOINC Committee meeting, the Committee decided to change {Author Type} to {Role} to align with the 'Role' axis name in the LOINC Document Ontology.; Because it is too difficult to maintain and because the distinction between documents and sections is not clear-cut nor necessary in most cases, the DOCUMENT_SECTION field has been deemed to have little value. The field has been set to null in the December 2017 release in preparation for removal in the December 2018 release. These changes were approved by the Clinical LOINC Committee.",0 ,0 ,0 ,"IG exists" , , , ,"81222-2;72231-4;81243-8","1.0j-a" ,"Y" "47239-9" ,"v2.67 Reason for stopping HIV Rx" ,"Type" ,"Pt" ,"^Patient" ,"Nom" ,"Reported" ,"ART" ,"2.50" ,"MIN" ,"Reason for stopping antiretroviral therapy" ,"ACTIVE", ,2 , , , , , ,"N" , ,"AIDS; Anti-retroviral therapy; ART; Human immunodeficiency virus; Nominal; Point in time; Random; Treatment; Typ" ,"Reason for stopping HIV Rx" ,"Observation", , ,"Copyright © 2006 World Health Organization. Used with permission. Publications of the World Health Organization can be obtained from WHO Press, World Health Organization, 20 Avenue Appia, 1211 Geneva 27, Switzerland (tel: +41 22 791 2476; fax: +41 22 791 4857; email: bookorders@who.int). Requests for permission to reproduce or translate WHO publications – whether for sale or for noncommercial distribution – should be addressed to WHO Press, at the above address (fax: +41 22 791 4806; email: permissions@who.int). The designations employed and the presentation of the material in this publication do not imply the expression of any opinion whatsoever on the part of the World Health Organization concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Dotted lines on maps represent approximate border lines for which there may not yet be full agreement. The mention of specific companies or of certain manufacturers’ products does not imply that they are endorsed or recommended by the World Health Organization in preference to others of a similar nature that are not mentioned. Errors and omissions excepted, the names of proprietary products are distinguished by initial capital letters. All reasonable precautions have been taken by WHO to verify the information contained in this publication. However, the published material is being distributed without warranty of any kind, either express or implied. The responsibility for the interpretation and use of the material lies with the reader. In no event shall the World Health Organization be liable for damages arising from its use.", ,"Reason for stopping HIV treatment" , , , , , , , ,0 ,0 ,0 , ,"WHO_HIV" , , , ,"2.22" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv index a26397639ff..a78b16dd69a 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv @@ -1,6 +1,6 @@ "LOINC_NUM","LONG_COMMON_NAME" "11525-3","US Pelvis Fetus for pregnancy" -"17787-3","NM Thyroid gland Study report" +"17787-3","v2.68 NM Thyroid gland Study report" "18744-3","Bronchoscopy study" "18746-8","Colonoscopy study" "18748-4","Diagnostic imaging study" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/Loinc.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/Loinc.csv index 20379cb7f1d..ec4fd526a0c 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/Loinc.csv +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/Loinc.csv @@ -10,7 +10,7 @@ "10020-6" ,"R' wave amplitude.lead V5" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V5; R wave Amp L-V5; Random; Right; Voltage" ,"R' wave Amp L-V5" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V5" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , "61438-8" ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30D","Find" ,"Pt" ,"^Patient" ,"Ord" ,"PhenX" ,"PHENX" ,"2.44" ,"MIN" , ,"TRIAL" , ,2 , , , ,"Each time you eat bread, toast or dinner rolls, how much do you usually eat?","PhenX.050201100100","N" , ,"Finding; Findings; How much bread in 30D; Last; Ordinal; Point in time; QL; Qual; Qualitative; Random; Screen" ,"How much bread in 30D PhenX", , , , , ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]", , , , , , , ,0 ,0 ,0 , , , , , , , "10000-8" ,"R wave duration.lead AVR" ,"Time" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; Durat; ECG; EKG.MEASUREMENTS; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave dur L-AVR; R wave dur L-AVR; Random; Right" ,"R wave dur L-AVR" ,"Observation", , , ,"s" ,"R wave duration in lead AVR" , , ,"s" , , , , ,0 ,0 ,0 , , , , , , , -"17787-3" ,"Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , +"17787-3" ,"Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"v2.68 NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , "17788-1" ,"Large unstained cells/100 leukocytes" ,"NFr" ,"Pt" ,"Bld" ,"Qn" ,"Automated count","HEM/BC" ,"2.50" ,"MIN" ,"Part of auto diff output of Bayer H*3S; peroxidase negative cells too large to be classified as lymph or basophil" ,"ACTIVE", ,1 , , , , , ,"Y" ,"%" ,"100WBC; Auto; Automated detection; Blood; Cell; Cellularity; Elec; Elect; Electr; HEMATOLOGY/CELL COUNTS; Leuc; Leuk; Leukocyte; Lkcs; LUC; Number Fraction; Percent; Point in time; QNT; Quan; Quant; Quantitative; Random; WB; WBC; WBCs; White blood cell; White blood cells; Whole blood" ,"LUC/leuk NFr Bld Auto" ,"Observation", , , ,"%" ,"Large unstained cells/100 leukocytes in Blood by Automated count" , , ,"%" , , , , ,1894 ,0 ,1894 , , , , , ,"1.0l" , "11488-4" ,"Consultation note" ,"Find" ,"Pt" ,"{Setting}" ,"Doc" ,"{Role}" ,"DOC.ONTOLOGY","2.63" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Consult note; DOC.ONT; Document; Encounter; Evaluation and management; Evaluation and management note; Finding; Findings; notes; Point in time; Random; Visit note" ,"Consult note" ,"Both" , , , , ,"Consult note" , , , , , , ,"Edit made because this term is conformant to the Document Ontology axis values and therefore are being placed in this class.; Based on Clinical LOINC Committee decision during the September 2014 meeting, {Provider} was changed to {Author Type} to emphasize a greater breadth of potential document authors. At the September 2015 Clinical LOINC Committee meeting, the Committee decided to change {Author Type} to {Role} to align with the 'Role' axis name in the LOINC Document Ontology.; Because it is too difficult to maintain and because the distinction between documents and sections is not clear-cut nor necessary in most cases, the DOCUMENT_SECTION field has been deemed to have little value. The field has been set to null in the December 2017 release in preparation for removal in the December 2018 release. These changes were approved by the Clinical LOINC Committee.",0 ,0 ,0 ,"IG exists" , , , ,"81222-2;72231-4;81243-8","1.0j-a" ,"Y" "47239-9" ,"Reason for stopping HIV Rx" ,"Type" ,"Pt" ,"^Patient" ,"Nom" ,"Reported" ,"ART" ,"2.50" ,"MIN" ,"Reason for stopping antiretroviral therapy" ,"ACTIVE", ,2 , , , , , ,"N" , ,"AIDS; Anti-retroviral therapy; ART; Human immunodeficiency virus; Nominal; Point in time; Random; Treatment; Typ" ,"Reason for stopping HIV Rx" ,"Observation", , ,"Copyright © 2006 World Health Organization. Used with permission. Publications of the World Health Organization can be obtained from WHO Press, World Health Organization, 20 Avenue Appia, 1211 Geneva 27, Switzerland (tel: +41 22 791 2476; fax: +41 22 791 4857; email: bookorders@who.int). Requests for permission to reproduce or translate WHO publications – whether for sale or for noncommercial distribution – should be addressed to WHO Press, at the above address (fax: +41 22 791 4806; email: permissions@who.int). The designations employed and the presentation of the material in this publication do not imply the expression of any opinion whatsoever on the part of the World Health Organization concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Dotted lines on maps represent approximate border lines for which there may not yet be full agreement. The mention of specific companies or of certain manufacturers’ products does not imply that they are endorsed or recommended by the World Health Organization in preference to others of a similar nature that are not mentioned. Errors and omissions excepted, the names of proprietary products are distinguished by initial capital letters. All reasonable precautions have been taken by WHO to verify the information contained in this publication. However, the published material is being distributed without warranty of any kind, either express or implied. The responsibility for the interpretation and use of the material lies with the reader. In no event shall the World Health Organization be liable for damages arising from its use.", ,"Reason for stopping HIV treatment" , , , , , , , ,0 ,0 ,0 , ,"WHO_HIV" , , , ,"2.22" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/LoincTable/Loinc.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/LoincTable/Loinc.csv index 8f43cfb4941..215f236095b 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/LoincTable/Loinc.csv +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/LoincTable/Loinc.csv @@ -10,7 +10,7 @@ "10020-6" ,"v2.68 R' wave amplitude.lead V5" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V5; R wave Amp L-V5; Random; Right; Voltage" ,"R' wave Amp L-V5" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V5" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , "61438-8" ,"v2.68 Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30D","Find" ,"Pt" ,"^Patient" ,"Ord" ,"PhenX" ,"PHENX" ,"2.44" ,"MIN" , ,"TRIAL" , ,2 , , , ,"Each time you eat bread, toast or dinner rolls, how much do you usually eat?","PhenX.050201100100","N" , ,"Finding; Findings; How much bread in 30D; Last; Ordinal; Point in time; QL; Qual; Qualitative; Random; Screen" ,"How much bread in 30D PhenX", , , , , ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]", , , , , , , ,0 ,0 ,0 , , , , , , , "10000-8" ,"v2.68 R wave duration.lead AVR" ,"Time" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; Durat; ECG; EKG.MEASUREMENTS; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave dur L-AVR; R wave dur L-AVR; Random; Right" ,"R wave dur L-AVR" ,"Observation", , , ,"s" ,"R wave duration in lead AVR" , , ,"s" , , , , ,0 ,0 ,0 , , , , , , , -"17787-3" ,"v2.68 Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , +"17787-3" ,"v2.68 Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"v2.68 NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , "17788-1" ,"v2.68 Large unstained cells/100 leukocytes" ,"NFr" ,"Pt" ,"Bld" ,"Qn" ,"Automated count","HEM/BC" ,"2.50" ,"MIN" ,"Part of auto diff output of Bayer H*3S; peroxidase negative cells too large to be classified as lymph or basophil" ,"ACTIVE", ,1 , , , , , ,"Y" ,"%" ,"100WBC; Auto; Automated detection; Blood; Cell; Cellularity; Elec; Elect; Electr; HEMATOLOGY/CELL COUNTS; Leuc; Leuk; Leukocyte; Lkcs; LUC; Number Fraction; Percent; Point in time; QNT; Quan; Quant; Quantitative; Random; WB; WBC; WBCs; White blood cell; White blood cells; Whole blood" ,"LUC/leuk NFr Bld Auto" ,"Observation", , , ,"%" ,"Large unstained cells/100 leukocytes in Blood by Automated count" , , ,"%" , , , , ,1894 ,0 ,1894 , , , , , ,"1.0l" , "11488-4" ,"v2.68 Consultation note" ,"Find" ,"Pt" ,"{Setting}" ,"Doc" ,"{Role}" ,"DOC.ONTOLOGY","2.63" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Consult note; DOC.ONT; Document; Encounter; Evaluation and management; Evaluation and management note; Finding; Findings; notes; Point in time; Random; Visit note" ,"Consult note" ,"Both" , , , , ,"Consult note" , , , , , , ,"Edit made because this term is conformant to the Document Ontology axis values and therefore are being placed in this class.; Based on Clinical LOINC Committee decision during the September 2014 meeting, {Provider} was changed to {Author Type} to emphasize a greater breadth of potential document authors. At the September 2015 Clinical LOINC Committee meeting, the Committee decided to change {Author Type} to {Role} to align with the 'Role' axis name in the LOINC Document Ontology.; Because it is too difficult to maintain and because the distinction between documents and sections is not clear-cut nor necessary in most cases, the DOCUMENT_SECTION field has been deemed to have little value. The field has been set to null in the December 2017 release in preparation for removal in the December 2018 release. These changes were approved by the Clinical LOINC Committee.",0 ,0 ,0 ,"IG exists" , , , ,"81222-2;72231-4;81243-8","1.0j-a" ,"Y" "47239-9" ,"v2.68 Reason for stopping HIV Rx" ,"Type" ,"Pt" ,"^Patient" ,"Nom" ,"Reported" ,"ART" ,"2.50" ,"MIN" ,"Reason for stopping antiretroviral therapy" ,"ACTIVE", ,2 , , , , , ,"N" , ,"AIDS; Anti-retroviral therapy; ART; Human immunodeficiency virus; Nominal; Point in time; Random; Treatment; Typ" ,"Reason for stopping HIV Rx" ,"Observation", , ,"Copyright © 2006 World Health Organization. Used with permission. Publications of the World Health Organization can be obtained from WHO Press, World Health Organization, 20 Avenue Appia, 1211 Geneva 27, Switzerland (tel: +41 22 791 2476; fax: +41 22 791 4857; email: bookorders@who.int). Requests for permission to reproduce or translate WHO publications – whether for sale or for noncommercial distribution – should be addressed to WHO Press, at the above address (fax: +41 22 791 4806; email: permissions@who.int). The designations employed and the presentation of the material in this publication do not imply the expression of any opinion whatsoever on the part of the World Health Organization concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Dotted lines on maps represent approximate border lines for which there may not yet be full agreement. The mention of specific companies or of certain manufacturers’ products does not imply that they are endorsed or recommended by the World Health Organization in preference to others of a similar nature that are not mentioned. Errors and omissions excepted, the names of proprietary products are distinguished by initial capital letters. All reasonable precautions have been taken by WHO to verify the information contained in this publication. However, the published material is being distributed without warranty of any kind, either express or implied. The responsibility for the interpretation and use of the material lies with the reader. In no event shall the World Health Organization be liable for damages arising from its use.", ,"Reason for stopping HIV treatment" , , , , , , , ,0 ,0 ,0 , ,"WHO_HIV" , , , ,"2.22" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv index a26397639ff..30bb5209e9f 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/ImagingDocuments/ImagingDocumentCodes.csv @@ -1,6 +1,6 @@ "LOINC_NUM","LONG_COMMON_NAME" "11525-3","US Pelvis Fetus for pregnancy" -"17787-3","NM Thyroid gland Study report" +"17787-3","v2.69 NM Thyroid gland Study report" "18744-3","Bronchoscopy study" "18746-8","Colonoscopy study" "18748-4","Diagnostic imaging study" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv index f935aeec77b..0d02ad7cb0b 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/LoincRsnaRadiologyPlaybook/LoincRsnaRadiologyPlaybook.csv @@ -1,10 +1,10 @@ "LoincNumber","LongCommonName" ,"PartNumber","PartTypeName" ,"PartName" ,"PartSequenceOrder","RID" ,"PreferredName" ,"RPID" ,"LongName" -"17787-3" ,"v2.68 NM Thyroid gland Study report","LP199995-4","Rad.Anatomic Location.Region Imaged","Neck" ,"A" ,"RID7488" ,"neck" ,"" ,"" -"17787-3" ,"v2.68 NM Thyroid gland Study report","LP206648-0","Rad.Anatomic Location.Imaging Focus","Thyroid gland" ,"A" ,"RID7578" ,"thyroid gland" ,"" ,"" -"17787-3" ,"v2.68 NM Thyroid gland Study report","LP208891-4","Rad.Modality.Modality type" ,"NM" ,"A" ,"RID10330","nuclear medicine imaging","" ,"" -"24531-6" ,"v2.68 US Retroperitoneum" ,"LP207608-3","Rad.Modality.Modality type" ,"US" ,"A" ,"RID10326","Ultrasound" ,"RPID2142","US Retroperitoneum" -"24531-6" ,"v2.68 US Retroperitoneum" ,"LP199943-4","Rad.Anatomic Location.Imaging Focus","Retroperitoneum" ,"A" ,"RID431" ,"RETROPERITONEUM" ,"RPID2142","US Retroperitoneum" -"24531-6" ,"v2.68 US Retroperitoneum" ,"LP199956-6","Rad.Anatomic Location.Region Imaged","Abdomen" ,"A" ,"RID56" ,"Abdomen" ,"RPID2142","US Retroperitoneum" -"24532-4" ,"v2.68 US Abdomen RUQ" ,"LP199956-6","Rad.Anatomic Location.Region Imaged","Abdomen" ,"A" ,"RID56" ,"Abdomen" ,"" ,"" -"24532-4" ,"v2.68 US Abdomen RUQ" ,"LP207608-3","Rad.Modality.Modality type" ,"US" ,"A" ,"RID10326","Ultrasound" ,"" ,"" -"24532-4" ,"v2.68 US Abdomen RUQ" ,"LP208105-9","Rad.Anatomic Location.Imaging Focus","Right upper quadrant","A" ,"RID29994","Right upper quadrant" ,"" ,"" +"17787-3" ,"v2.69 NM Thyroid gland Study report","LP199995-4","Rad.Anatomic Location.Region Imaged","Neck" ,"A" ,"RID7488" ,"neck" ,"" ,"" +"17787-3" ,"v2.69 NM Thyroid gland Study report","LP206648-0","Rad.Anatomic Location.Imaging Focus","Thyroid gland" ,"A" ,"RID7578" ,"thyroid gland" ,"" ,"" +"17787-3" ,"v2.69 NM Thyroid gland Study report","LP208891-4","Rad.Modality.Modality type" ,"NM" ,"A" ,"RID10330","nuclear medicine imaging","" ,"" +"24531-6" ,"v2.69 US Retroperitoneum" ,"LP207608-3","Rad.Modality.Modality type" ,"US" ,"A" ,"RID10326","Ultrasound" ,"RPID2142","US Retroperitoneum" +"24531-6" ,"v2.69 US Retroperitoneum" ,"LP199943-4","Rad.Anatomic Location.Imaging Focus","Retroperitoneum" ,"A" ,"RID431" ,"RETROPERITONEUM" ,"RPID2142","US Retroperitoneum" +"24531-6" ,"v2.69 US Retroperitoneum" ,"LP199956-6","Rad.Anatomic Location.Region Imaged","Abdomen" ,"A" ,"RID56" ,"Abdomen" ,"RPID2142","US Retroperitoneum" +"24532-4" ,"v2.69 US Abdomen RUQ" ,"LP199956-6","Rad.Anatomic Location.Region Imaged","Abdomen" ,"A" ,"RID56" ,"Abdomen" ,"" ,"" +"24532-4" ,"v2.69 US Abdomen RUQ" ,"LP207608-3","Rad.Modality.Modality type" ,"US" ,"A" ,"RID10326","Ultrasound" ,"" ,"" +"24532-4" ,"v2.69 US Abdomen RUQ" ,"LP208105-9","Rad.Anatomic Location.Imaging Focus","Right upper quadrant","A" ,"RID29994","Right upper quadrant" ,"" ,"" diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/Loinc.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/Loinc.csv index 20379cb7f1d..051297e87a0 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/Loinc.csv +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/Loinc.csv @@ -10,7 +10,7 @@ "10020-6" ,"R' wave amplitude.lead V5" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V5; R wave Amp L-V5; Random; Right; Voltage" ,"R' wave Amp L-V5" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V5" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , "61438-8" ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30D","Find" ,"Pt" ,"^Patient" ,"Ord" ,"PhenX" ,"PHENX" ,"2.44" ,"MIN" , ,"TRIAL" , ,2 , , , ,"Each time you eat bread, toast or dinner rolls, how much do you usually eat?","PhenX.050201100100","N" , ,"Finding; Findings; How much bread in 30D; Last; Ordinal; Point in time; QL; Qual; Qualitative; Random; Screen" ,"How much bread in 30D PhenX", , , , , ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]", , , , , , , ,0 ,0 ,0 , , , , , , , "10000-8" ,"R wave duration.lead AVR" ,"Time" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; Durat; ECG; EKG.MEASUREMENTS; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave dur L-AVR; R wave dur L-AVR; Random; Right" ,"R wave dur L-AVR" ,"Observation", , , ,"s" ,"R wave duration in lead AVR" , , ,"s" , , , , ,0 ,0 ,0 , , , , , , , -"17787-3" ,"Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , +"17787-3" ,"Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"v2.69 NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , "17788-1" ,"Large unstained cells/100 leukocytes" ,"NFr" ,"Pt" ,"Bld" ,"Qn" ,"Automated count","HEM/BC" ,"2.50" ,"MIN" ,"Part of auto diff output of Bayer H*3S; peroxidase negative cells too large to be classified as lymph or basophil" ,"ACTIVE", ,1 , , , , , ,"Y" ,"%" ,"100WBC; Auto; Automated detection; Blood; Cell; Cellularity; Elec; Elect; Electr; HEMATOLOGY/CELL COUNTS; Leuc; Leuk; Leukocyte; Lkcs; LUC; Number Fraction; Percent; Point in time; QNT; Quan; Quant; Quantitative; Random; WB; WBC; WBCs; White blood cell; White blood cells; Whole blood" ,"LUC/leuk NFr Bld Auto" ,"Observation", , , ,"%" ,"Large unstained cells/100 leukocytes in Blood by Automated count" , , ,"%" , , , , ,1894 ,0 ,1894 , , , , , ,"1.0l" , "11488-4" ,"Consultation note" ,"Find" ,"Pt" ,"{Setting}" ,"Doc" ,"{Role}" ,"DOC.ONTOLOGY","2.63" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Consult note; DOC.ONT; Document; Encounter; Evaluation and management; Evaluation and management note; Finding; Findings; notes; Point in time; Random; Visit note" ,"Consult note" ,"Both" , , , , ,"Consult note" , , , , , , ,"Edit made because this term is conformant to the Document Ontology axis values and therefore are being placed in this class.; Based on Clinical LOINC Committee decision during the September 2014 meeting, {Provider} was changed to {Author Type} to emphasize a greater breadth of potential document authors. At the September 2015 Clinical LOINC Committee meeting, the Committee decided to change {Author Type} to {Role} to align with the 'Role' axis name in the LOINC Document Ontology.; Because it is too difficult to maintain and because the distinction between documents and sections is not clear-cut nor necessary in most cases, the DOCUMENT_SECTION field has been deemed to have little value. The field has been set to null in the December 2017 release in preparation for removal in the December 2018 release. These changes were approved by the Clinical LOINC Committee.",0 ,0 ,0 ,"IG exists" , , , ,"81222-2;72231-4;81243-8","1.0j-a" ,"Y" "47239-9" ,"Reason for stopping HIV Rx" ,"Type" ,"Pt" ,"^Patient" ,"Nom" ,"Reported" ,"ART" ,"2.50" ,"MIN" ,"Reason for stopping antiretroviral therapy" ,"ACTIVE", ,2 , , , , , ,"N" , ,"AIDS; Anti-retroviral therapy; ART; Human immunodeficiency virus; Nominal; Point in time; Random; Treatment; Typ" ,"Reason for stopping HIV Rx" ,"Observation", , ,"Copyright © 2006 World Health Organization. Used with permission. Publications of the World Health Organization can be obtained from WHO Press, World Health Organization, 20 Avenue Appia, 1211 Geneva 27, Switzerland (tel: +41 22 791 2476; fax: +41 22 791 4857; email: bookorders@who.int). Requests for permission to reproduce or translate WHO publications – whether for sale or for noncommercial distribution – should be addressed to WHO Press, at the above address (fax: +41 22 791 4806; email: permissions@who.int). The designations employed and the presentation of the material in this publication do not imply the expression of any opinion whatsoever on the part of the World Health Organization concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Dotted lines on maps represent approximate border lines for which there may not yet be full agreement. The mention of specific companies or of certain manufacturers’ products does not imply that they are endorsed or recommended by the World Health Organization in preference to others of a similar nature that are not mentioned. Errors and omissions excepted, the names of proprietary products are distinguished by initial capital letters. All reasonable precautions have been taken by WHO to verify the information contained in this publication. However, the published material is being distributed without warranty of any kind, either express or implied. The responsibility for the interpretation and use of the material lies with the reader. In no event shall the World Health Organization be liable for damages arising from its use.", ,"Reason for stopping HIV treatment" , , , , , , , ,0 ,0 ,0 , ,"WHO_HIV" , , , ,"2.22" , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/LoincTable/Loinc.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/LoincTable/Loinc.csv index c519331fc53..44a9062f695 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/LoincTable/Loinc.csv +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/LoincTable/Loinc.csv @@ -10,7 +10,7 @@ "10020-6" ,"v2.69 R' wave amplitude.lead V5" ,"Elpot" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; ECG; EKG.MEASUREMENTS; Electrical potential; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave Amp L-V5; R wave Amp L-V5; Random; Right; Voltage" ,"R' wave Amp L-V5" ,"Observation", , , ,"mV" ,"R' wave amplitude in lead V5" , , ,"mV" , , , , ,0 ,0 ,0 , , , , , , , "61438-8" ,"v2.69 Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30D","Find" ,"Pt" ,"^Patient" ,"Ord" ,"PhenX" ,"PHENX" ,"2.44" ,"MIN" , ,"TRIAL" , ,2 , , , ,"Each time you eat bread, toast or dinner rolls, how much do you usually eat?","PhenX.050201100100","N" , ,"Finding; Findings; How much bread in 30D; Last; Ordinal; Point in time; QL; Qual; Qualitative; Random; Screen" ,"How much bread in 30D PhenX", , , , , ,"Each time you ate bread, toast or dinner rolls, how much did you usually eat in the past 30 days [PhenX]", , , , , , , ,0 ,0 ,0 , , , , , , , "10000-8" ,"v2.69 R wave duration.lead AVR" ,"Time" ,"Pt" ,"Heart" ,"Qn" ,"EKG" ,"EKG.MEAS" ,"2.48" ,"MIN" , ,"ACTIVE", ,2 , , , , , ,"Y" , ,"Cardiac; Durat; ECG; EKG.MEASUREMENTS; Electrocardiogram; Electrocardiograph; Hrt; Painter's colic; PB; Plumbism; Point in time; QNT; Quan; Quant; Quantitative; R prime; R' wave dur L-AVR; R wave dur L-AVR; Random; Right" ,"R wave dur L-AVR" ,"Observation", , , ,"s" ,"R wave duration in lead AVR" , , ,"s" , , , , ,0 ,0 ,0 , , , , , , , -"17787-3" ,"v2.69 Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , +"17787-3" ,"v2.69 Study report" ,"Find" ,"Pt" ,"Neck>Thyroid gland","Doc" ,"NM" ,"RAD" ,"2.61" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Document; Finding; Findings; Imaging; Point in time; Radiology; Random; Study report; Thy" ,"NM Thyroid Study report" ,"Both" , , , , ,"v2.69 NM Thyroid gland Study report" , , , , , , ,"Changed System from ""Thyroid"" for conformance with the LOINC/RadLex unified model.; Method of ""Radnuc"" was changed to ""NM"". The LOINC/RadLex Committee agreed to use a subset of the two-letter DICOM modality codes as the primary modality identifier." ,0 ,0 ,0 ,"IG exists" , , , ,"81220-6;72230-6" ,"1.0l" , "17788-1" ,"v2.69 Large unstained cells/100 leukocytes" ,"NFr" ,"Pt" ,"Bld" ,"Qn" ,"Automated count","HEM/BC" ,"2.50" ,"MIN" ,"Part of auto diff output of Bayer H*3S; peroxidase negative cells too large to be classified as lymph or basophil" ,"ACTIVE", ,1 , , , , , ,"Y" ,"%" ,"100WBC; Auto; Automated detection; Blood; Cell; Cellularity; Elec; Elect; Electr; HEMATOLOGY/CELL COUNTS; Leuc; Leuk; Leukocyte; Lkcs; LUC; Number Fraction; Percent; Point in time; QNT; Quan; Quant; Quantitative; Random; WB; WBC; WBCs; White blood cell; White blood cells; Whole blood" ,"LUC/leuk NFr Bld Auto" ,"Observation", , , ,"%" ,"Large unstained cells/100 leukocytes in Blood by Automated count" , , ,"%" , , , , ,1894 ,0 ,1894 , , , , , ,"1.0l" , "11488-4" ,"v2.69 Consultation note" ,"Find" ,"Pt" ,"{Setting}" ,"Doc" ,"{Role}" ,"DOC.ONTOLOGY","2.63" ,"MIN" , ,"ACTIVE", ,2 , , , , , , , ,"Consult note; DOC.ONT; Document; Encounter; Evaluation and management; Evaluation and management note; Finding; Findings; notes; Point in time; Random; Visit note" ,"Consult note" ,"Both" , , , , ,"Consult note" , , , , , , ,"Edit made because this term is conformant to the Document Ontology axis values and therefore are being placed in this class.; Based on Clinical LOINC Committee decision during the September 2014 meeting, {Provider} was changed to {Author Type} to emphasize a greater breadth of potential document authors. At the September 2015 Clinical LOINC Committee meeting, the Committee decided to change {Author Type} to {Role} to align with the 'Role' axis name in the LOINC Document Ontology.; Because it is too difficult to maintain and because the distinction between documents and sections is not clear-cut nor necessary in most cases, the DOCUMENT_SECTION field has been deemed to have little value. The field has been set to null in the December 2017 release in preparation for removal in the December 2018 release. These changes were approved by the Clinical LOINC Committee.",0 ,0 ,0 ,"IG exists" , , , ,"81222-2;72231-4;81243-8","1.0j-a" ,"Y" "47239-9" ,"v2.69 Reason for stopping HIV Rx" ,"Type" ,"Pt" ,"^Patient" ,"Nom" ,"Reported" ,"ART" ,"2.50" ,"MIN" ,"Reason for stopping antiretroviral therapy" ,"ACTIVE", ,2 , , , , , ,"N" , ,"AIDS; Anti-retroviral therapy; ART; Human immunodeficiency virus; Nominal; Point in time; Random; Treatment; Typ" ,"Reason for stopping HIV Rx" ,"Observation", , ,"Copyright © 2006 World Health Organization. Used with permission. Publications of the World Health Organization can be obtained from WHO Press, World Health Organization, 20 Avenue Appia, 1211 Geneva 27, Switzerland (tel: +41 22 791 2476; fax: +41 22 791 4857; email: bookorders@who.int). Requests for permission to reproduce or translate WHO publications – whether for sale or for noncommercial distribution – should be addressed to WHO Press, at the above address (fax: +41 22 791 4806; email: permissions@who.int). The designations employed and the presentation of the material in this publication do not imply the expression of any opinion whatsoever on the part of the World Health Organization concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Dotted lines on maps represent approximate border lines for which there may not yet be full agreement. The mention of specific companies or of certain manufacturers’ products does not imply that they are endorsed or recommended by the World Health Organization in preference to others of a similar nature that are not mentioned. Errors and omissions excepted, the names of proprietary products are distinguished by initial capital letters. All reasonable precautions have been taken by WHO to verify the information contained in this publication. However, the published material is being distributed without warranty of any kind, either express or implied. The responsibility for the interpretation and use of the material lies with the reader. In no event shall the World Health Organization be liable for damages arising from its use.", ,"Reason for stopping HIV treatment" , , , , , , , ,0 ,0 ,0 , ,"WHO_HIV" , , , ,"2.22" , From 790023043153f4b3184772a36787574bbcee8631 Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" <juan.marchionatto@smilecdr.com> Date: Wed, 15 Sep 2021 10:29:30 -0400 Subject: [PATCH 08/31] Add version to ValueSet.compose.include when uploading terminology --- .../fhir/jpa/term/BaseTermReadSvcImpl.java | 9 ++- .../uhn/fhir/jpa/term/TermLoaderSvcImpl.java | 2 +- .../fhir/jpa/term/loinc/BaseLoincHandler.java | 4 ++ .../term/loinc/LoincAnswerListHandler.java | 1 + .../term/loinc/LoincRsnaPlaybookHandler.java | 1 + ...erminologySvcImplCurrentVersionR4Test.java | 61 ++++++++++--------- 6 files changed, 47 insertions(+), 31 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java index 069117b8ad0..53cccd72a9b 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java @@ -158,6 +158,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -2417,10 +2418,16 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { predicates.add(criteriaBuilder.equal(systemJoin.get("myCodeSystemUri"), theCodeSystemUrl)); } + // for loinc CodeSystem last version is not necessarily the current anymore, so if no version is present + // we need to query for the current, which is that which version is null if (isNoneBlank(theCodeSystemVersion)) { predicates.add(criteriaBuilder.equal(systemVersionJoin.get("myCodeSystemVersionId"), theCodeSystemVersion)); } else { - query.orderBy(criteriaBuilder.desc(root.get("myUpdated"))); + if (theCodeSystemUrl.toLowerCase(Locale.ROOT).contains("loinc")) { + predicates.add(criteriaBuilder.isNull(systemVersionJoin.get("myCodeSystemVersionId"))); + } else { + query.orderBy(criteriaBuilder.desc(root.get("myUpdated"))); + } } Predicate outerPredicate = criteriaBuilder.and(predicates.toArray(new Predicate[0])); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java index e750f1fee3d..6f762f15103 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java @@ -722,7 +722,7 @@ public class TermLoaderSvcImpl implements ITermLoaderSvc { retVal.setPublisher("Regenstrief Institute, Inc."); retVal.setDescription("A value set that includes all LOINC codes"); retVal.setCopyright("This content from LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at https://loinc.org/license/"); - retVal.getCompose().addInclude().setSystem(ITermLoaderSvc.LOINC_URI); + retVal.getCompose().addInclude().setSystem(ITermLoaderSvc.LOINC_URI).setVersion(codeSystemVersionId); return retVal; } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/BaseLoincHandler.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/BaseLoincHandler.java index cba3609fa8b..7cd49e97c45 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/BaseLoincHandler.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/BaseLoincHandler.java @@ -22,6 +22,7 @@ package ca.uhn.fhir.jpa.term.loinc; import ca.uhn.fhir.jpa.entity.TermConcept; import ca.uhn.fhir.jpa.term.IZipContentsHandlerCsv; +import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.r4.model.ConceptMap; import org.hl7.fhir.r4.model.ContactPoint; import org.hl7.fhir.r4.model.Enumerations; @@ -74,6 +75,9 @@ public abstract class BaseLoincHandler implements IZipContentsHandlerCsv { if (include == null) { include = theVs.getCompose().addInclude(); include.setSystem(theCodeSystemUrl); + if (StringUtils.isNotBlank(theVs.getVersion())) { + include.setVersion(theVs.getVersion()); + } } boolean found = false; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincAnswerListHandler.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincAnswerListHandler.java index cdb97ca48d8..037a2fb0e6b 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincAnswerListHandler.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincAnswerListHandler.java @@ -104,6 +104,7 @@ public class LoincAnswerListHandler extends BaseLoincHandler { .getCompose() .getIncludeFirstRep() .setSystem(ITermLoaderSvc.LOINC_URI) + .setVersion(codeSystemVersionId) .addConcept() .setCode(answerString) .setDisplay(displayText); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincRsnaPlaybookHandler.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincRsnaPlaybookHandler.java index d0b03f0acc9..d81466f5380 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincRsnaPlaybookHandler.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincRsnaPlaybookHandler.java @@ -120,6 +120,7 @@ public class LoincRsnaPlaybookHandler extends BaseLoincHandler implements IZipCo .getCompose() .getIncludeFirstRep() .setSystem(ITermLoaderSvc.LOINC_URI) + .setVersion(codeSystemVersionId) .addConcept() .setCode(loincNumber) .setDisplay(longCommonName); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java index 21ace9a8c7a..f33e1e17874 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java @@ -22,6 +22,7 @@ import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.r4.model.CodeSystem; import org.hl7.fhir.r4.model.CodeType; import org.hl7.fhir.r4.model.IdType; +import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.UriType; import org.hl7.fhir.r4.model.ValueSet; import org.junit.jupiter.api.BeforeEach; @@ -187,13 +188,13 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { private void validateValidateCodeForVersion(String theVersion) { IValidationSupport.CodeValidationResult resultNoVersioned = myCodeSystemDao.validateCode(null, - new UriType(BASE_LOINC_URL), null, new CodeType(VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE), + new UriType(BASE_LOINC_URL), new StringType(theVersion), new CodeType(VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE), null, null, null, null); assertNotNull(resultNoVersioned); assertEquals(prefixWithVersion(theVersion, VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), resultNoVersioned.getDisplay()); IValidationSupport.CodeValidationResult resultVersioned = myCodeSystemDao.validateCode(null, - new UriType(BASE_LOINC_URL), null, new CodeType(VS_VERSIONED_ON_UPLOAD_FIRST_CODE), + new UriType(BASE_LOINC_URL), new StringType(theVersion), new CodeType(VS_VERSIONED_ON_UPLOAD_FIRST_CODE), null, null, null, null); assertNotNull(resultVersioned); assertEquals(prefixWithVersion(theVersion, VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), resultVersioned.getDisplay()); @@ -245,10 +246,11 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { ValueSet vs = myValueSetDao.expandByIdentifier(VS_NO_VERSIONED_ON_UPLOAD, null); assertEquals(1, vs.getExpansion().getContains().size()); - // version was added before code display to validate + // version was added prefixing code display to validate assertEquals(prefixWithVersion(currentVersion, VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), vs.getExpansion().getContains().iterator().next().getDisplay()); + // for CS ver = null, VS ver != null ValueSet vs1 = myValueSetDao.expandByIdentifier(VS_VERSIONED_ON_UPLOAD + "|" + VS_ANSWER_LIST_VERSION, null); assertEquals(3, vs1.getExpansion().getContains().size()); @@ -256,6 +258,7 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { assertEquals(prefixWithVersion(currentVersion, VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), vs1.getExpansion().getContains().iterator().next().getDisplay()); + validateExpandedTermConcepts(currentVersion, theAllVersions); // now for each uploaded version @@ -269,29 +272,33 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { "select tc from TermConcept tc join fetch tc.myCodeSystem tcsv where tc.myCode = '" + VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId is null").getSingleResult(); assertNotNull(termConceptNoVerCsvNoVer); - assertEquals(VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY, termConceptNoVerCsvNoVer.getDisplay()); + // data should have version because it was loaded with a version + assertEquals(prefixWithVersion(theCurrentVersion, VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), termConceptNoVerCsvNoVer.getDisplay()); @SuppressWarnings("unchecked") TermConcept termConceptVerCsvNoVer = (TermConcept) myEntityManager.createQuery( "select tc from TermConcept tc join fetch tc.myCodeSystem tcsv where tc.myCode = '" + VS_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId is null").getSingleResult(); assertNotNull(termConceptVerCsvNoVer); - assertEquals(VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY, termConceptVerCsvNoVer.getDisplay()); + // data should have version because it was loaded with a version + assertEquals(prefixWithVersion(theCurrentVersion, VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), termConceptVerCsvNoVer.getDisplay()); if (theCurrentVersion != null) { @SuppressWarnings("unchecked") TermConcept termConceptNoVerCsvVer = (TermConcept) myEntityManager.createQuery( "select tc from TermConcept tc join fetch tc.myCodeSystem tcsv where tc.myCode = '" + - VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId is null").getSingleResult(); + VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId = '" + theCurrentVersion + "'").getSingleResult(); assertNotNull(termConceptNoVerCsvVer); - assertEquals(VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY, termConceptNoVerCsvVer.getDisplay()); + // data should have version because it was loaded with a version + assertEquals(prefixWithVersion(theCurrentVersion, VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), termConceptNoVerCsvVer.getDisplay()); @SuppressWarnings("unchecked") TermConcept termConceptVerCsvVer = (TermConcept) myEntityManager.createQuery( "select tc from TermConcept tc join fetch tc.myCodeSystem tcsv where tc.myCode = '" + - VS_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId is null").getSingleResult(); + VS_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId = '" + theCurrentVersion + "'").getSingleResult(); assertNotNull(termConceptVerCsvVer); - assertEquals(VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY, termConceptVerCsvVer.getDisplay()); + // data should have version because it was loaded with a version + assertEquals(prefixWithVersion(theCurrentVersion, VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), termConceptVerCsvVer.getDisplay()); } @@ -443,7 +450,7 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { * _ current TVSs with upload version have upload-version with no version append * _ current TVSs with no upload version have null version */ - private void runCommonValidations(String theVersion) { + private void runCommonValidations(List<String> theAllVersions) { // for CodeSystem: // _ current CS is present and has no version @@ -452,8 +459,9 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { ourLog.info("CodeSystem:\n" + csString); HashSet<String> shouldNotBePresentVersions = new HashSet<>(possibleVersions); - shouldNotBePresentVersions.remove(theVersion); - shouldNotBePresentVersions.stream().forEach(vv -> assertFalse(csString.contains(vv))); + shouldNotBePresentVersions.removeAll(theAllVersions); + shouldNotBePresentVersions.stream().forEach(vv -> assertFalse(csString.contains(vv), + "Found version string: '" + vv + "' in CodeSystem: " + csString)); // same reading it from term service CodeSystem cs = myITermReadSvc.fetchCanonicalCodeSystemFromCompleteContext(BASE_LOINC_URL); @@ -489,7 +497,7 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { public void uploadCurrentNoVersion() throws Exception { IIdType csId = uploadLoincCodeSystem(null, true); - runCommonValidations(null); + runCommonValidations(Collections.emptyList()); // validate operation for current (no version parameter) validateOperations(null, Collections.emptySet()); @@ -497,11 +505,11 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { @Test() - public void uploadCurrentWithVersion() throws Exception { + public void uploadWithVersion() throws Exception { String ver = "2.67"; IIdType csId = uploadLoincCodeSystem(ver, true); - runCommonValidations(ver); + runCommonValidations(Collections.singletonList(ver)); // validate operation for specific version validateOperations(ver, Collections.singleton(ver)); @@ -509,15 +517,14 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { @Test - public void uploadCurrentNoVersionThenNoCurrent() throws Exception { + public void uploadNoVersionThenNoCurrent() throws Exception { uploadLoincCodeSystem(null, true); String ver = "2.67"; uploadLoincCodeSystem(ver, false); - myTermSvc.preExpandDeferredValueSetsToTerminologyTables(); - - runCommonValidations(ver); +// myTermSvc.preExpandDeferredValueSetsToTerminologyTables(); + runCommonValidations(Collections.singletonList(ver)); // validate operation for specific version validateOperations(null, Collections.singleton(ver)); @@ -525,15 +532,14 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { @Test - public void uploadFirstCurrentWithVersionThenNoCurrent() throws Exception { + public void uploadWithVersionThenNoCurrent() throws Exception { String firstVer = "2.67"; uploadLoincCodeSystem(firstVer, true); String secondVer = "2.68"; uploadLoincCodeSystem(secondVer, false); - runCommonValidations(firstVer); - runCommonValidations(secondVer); + runCommonValidations(Lists.newArrayList(firstVer, secondVer)); // validate operation for specific version validateOperations(null, Lists.newArrayList(firstVer, secondVer)); @@ -541,7 +547,7 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { @Test - public void uploadFirstCurrentNoVersionThenNoCurrentThenCurrent() throws Exception { + public void uploadNoVersionThenNoCurrentThenCurrent() throws Exception { uploadLoincCodeSystem(null, true); String firstVer = "2.67"; @@ -550,8 +556,7 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { String secondVer = "2.68"; uploadLoincCodeSystem(secondVer, true); - runCommonValidations(firstVer); - runCommonValidations(secondVer); + runCommonValidations(Lists.newArrayList(firstVer, secondVer)); // validate operation for specific version validateOperations(secondVer, Lists.newArrayList(firstVer, secondVer)); @@ -559,7 +564,7 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { @Test - public void uploadFirstCurrentWithVersionThenNoCurrentThenCurrent() throws Exception { + public void uploadWithVersionThenNoCurrentThenCurrent() throws Exception { String firstVer = "2.67"; uploadLoincCodeSystem(firstVer, true); @@ -569,9 +574,7 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { String thirdVer = "2.68"; uploadLoincCodeSystem(thirdVer, true); - runCommonValidations(firstVer); - runCommonValidations(secondVer); - runCommonValidations(thirdVer); + runCommonValidations(Lists.newArrayList(firstVer, secondVer, thirdVer)); // validate operation for specific version validateOperations(thirdVer, Lists.newArrayList(firstVer, secondVer, thirdVer)); From 0dfc716a82a7143577195c0e5f7b301481c7954a Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" <juan.marchionatto@smilecdr.com> Date: Thu, 16 Sep 2021 13:18:49 -0400 Subject: [PATCH 09/31] Adjust code validation to properly obtain CodeSystem's current version --- .../java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java index 069117b8ad0..53cccd72a9b 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java @@ -158,6 +158,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -2417,10 +2418,16 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { predicates.add(criteriaBuilder.equal(systemJoin.get("myCodeSystemUri"), theCodeSystemUrl)); } + // for loinc CodeSystem last version is not necessarily the current anymore, so if no version is present + // we need to query for the current, which is that which version is null if (isNoneBlank(theCodeSystemVersion)) { predicates.add(criteriaBuilder.equal(systemVersionJoin.get("myCodeSystemVersionId"), theCodeSystemVersion)); } else { - query.orderBy(criteriaBuilder.desc(root.get("myUpdated"))); + if (theCodeSystemUrl.toLowerCase(Locale.ROOT).contains("loinc")) { + predicates.add(criteriaBuilder.isNull(systemVersionJoin.get("myCodeSystemVersionId"))); + } else { + query.orderBy(criteriaBuilder.desc(root.get("myUpdated"))); + } } Predicate outerPredicate = criteriaBuilder.and(predicates.toArray(new Predicate[0])); From c9162cba6dc0aa957c2a252434188f6038c71833 Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" <juan.marchionatto@smilecdr.com> Date: Thu, 16 Sep 2021 13:20:00 -0400 Subject: [PATCH 10/31] Merge in fix for ISSUE-2995 --- .../src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java | 2 +- .../java/ca/uhn/fhir/jpa/term/loinc/BaseLoincHandler.java | 4 ++++ .../ca/uhn/fhir/jpa/term/loinc/LoincAnswerListHandler.java | 1 + .../ca/uhn/fhir/jpa/term/loinc/LoincRsnaPlaybookHandler.java | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java index e750f1fee3d..6f762f15103 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java @@ -722,7 +722,7 @@ public class TermLoaderSvcImpl implements ITermLoaderSvc { retVal.setPublisher("Regenstrief Institute, Inc."); retVal.setDescription("A value set that includes all LOINC codes"); retVal.setCopyright("This content from LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at https://loinc.org/license/"); - retVal.getCompose().addInclude().setSystem(ITermLoaderSvc.LOINC_URI); + retVal.getCompose().addInclude().setSystem(ITermLoaderSvc.LOINC_URI).setVersion(codeSystemVersionId); return retVal; } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/BaseLoincHandler.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/BaseLoincHandler.java index cba3609fa8b..7cd49e97c45 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/BaseLoincHandler.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/BaseLoincHandler.java @@ -22,6 +22,7 @@ package ca.uhn.fhir.jpa.term.loinc; import ca.uhn.fhir.jpa.entity.TermConcept; import ca.uhn.fhir.jpa.term.IZipContentsHandlerCsv; +import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.r4.model.ConceptMap; import org.hl7.fhir.r4.model.ContactPoint; import org.hl7.fhir.r4.model.Enumerations; @@ -74,6 +75,9 @@ public abstract class BaseLoincHandler implements IZipContentsHandlerCsv { if (include == null) { include = theVs.getCompose().addInclude(); include.setSystem(theCodeSystemUrl); + if (StringUtils.isNotBlank(theVs.getVersion())) { + include.setVersion(theVs.getVersion()); + } } boolean found = false; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincAnswerListHandler.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincAnswerListHandler.java index cdb97ca48d8..037a2fb0e6b 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincAnswerListHandler.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincAnswerListHandler.java @@ -104,6 +104,7 @@ public class LoincAnswerListHandler extends BaseLoincHandler { .getCompose() .getIncludeFirstRep() .setSystem(ITermLoaderSvc.LOINC_URI) + .setVersion(codeSystemVersionId) .addConcept() .setCode(answerString) .setDisplay(displayText); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincRsnaPlaybookHandler.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincRsnaPlaybookHandler.java index d0b03f0acc9..d81466f5380 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincRsnaPlaybookHandler.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincRsnaPlaybookHandler.java @@ -120,6 +120,7 @@ public class LoincRsnaPlaybookHandler extends BaseLoincHandler implements IZipCo .getCompose() .getIncludeFirstRep() .setSystem(ITermLoaderSvc.LOINC_URI) + .setVersion(codeSystemVersionId) .addConcept() .setCode(loincNumber) .setDisplay(longCommonName); From fbd23498fc78d9cc740703374b5ab0c340701746 Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" <juan.marchionatto@smilecdr.com> Date: Thu, 16 Sep 2021 13:41:05 -0400 Subject: [PATCH 11/31] Adjust test data and fix all test cases implemented so far --- ...erminologySvcImplCurrentVersionR4Test.java | 390 +++++++----------- .../AccessoryFiles/AnswerFile/AnswerList.csv | 2 +- .../PanelsAndForms/AnswerList.csv | 20 +- .../AccessoryFiles/AnswerFile/AnswerList.csv | 22 +- .../PanelsAndForms/AnswerList.csv | 20 +- .../AccessoryFiles/AnswerFile/AnswerList.csv | 22 +- .../PanelsAndForms/AnswerList.csv | 20 +- 7 files changed, 197 insertions(+), 299 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java index 21ace9a8c7a..2760086772c 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java @@ -22,6 +22,7 @@ import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.r4.model.CodeSystem; import org.hl7.fhir.r4.model.CodeType; import org.hl7.fhir.r4.model.IdType; +import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.UriType; import org.hl7.fhir.r4.model.ValueSet; import org.junit.jupiter.api.BeforeEach; @@ -39,6 +40,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.File; import java.io.FileInputStream; import java.io.IOException; +import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashSet; @@ -93,64 +95,55 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { public static final String BASE_LOINC_VS_URL = BASE_LOINC_URL + "/vs/"; // some ValueSets have a version specified independent of the CS version being uploaded. This one doesn't - public static final String VS_NO_VERSIONED_ON_UPLOAD_ID = "loinc-rsna-radiology-playbook"; - public static final String VS_NO_VERSIONED_ON_UPLOAD = BASE_LOINC_VS_URL + VS_NO_VERSIONED_ON_UPLOAD_ID; - public static final String VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE = "17787-3"; - public static final String VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY = "NM Thyroid gland Study report"; + public static final String VS_NO_VERSIONED_ON_UPLOAD_ID = "loinc-rsna-radiology-playbook"; + public static final String VS_NO_VERSIONED_ON_UPLOAD = BASE_LOINC_VS_URL + VS_NO_VERSIONED_ON_UPLOAD_ID; + public static final String VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE = "17787-3"; + public static final String VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY = "NM Thyroid gland Study report"; // some ValueSets have a version specified independent of the CS version being uploaded. This is one of them - public static final String VS_VERSIONED_ON_UPLOAD_ID = "LL1000-0"; - public static final String VS_VERSIONED_ON_UPLOAD = BASE_LOINC_VS_URL + VS_VERSIONED_ON_UPLOAD_ID; - public static final String VS_VERSIONED_ON_UPLOAD_FIRST_CODE = "LA13825-7"; - public static final String VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY = "1 slice or 1 dinner roll"; + public static final String VS_VERSIONED_ON_UPLOAD_ID = "LL1000-0"; + public static final String VS_VERSIONED_ON_UPLOAD = BASE_LOINC_VS_URL + VS_VERSIONED_ON_UPLOAD_ID; + public static final String VS_VERSIONED_ON_UPLOAD_FIRST_CODE = "LA13825-7"; + public static final String VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY = "1 slice or 1 dinner roll"; - public static final String VS_ANSWER_LIST_VERSION = "Beta.1"; + public static final String VS_ANSWER_LIST_VERSION = "Beta.1"; public static final Set<String> possibleVersions = Sets.newHashSet("2.67", "2.68", "2.69"); @Mock - HttpServletResponse mockServletResponse; + private HttpServletResponse mockServletResponse; @Mock(answer = Answers.RETURNS_DEEP_STUBS) - ServletRequestDetails mockRequestDetails; + private ServletRequestDetails mockRequestDetails; - @Autowired private EntityManager myEntityManager; - @Autowired private TermLoaderSvcImpl myTermLoaderSvc; - @Autowired private ITermReadSvc myITermReadSvc; + @Autowired + private EntityManager myEntityManager; + + @Autowired + private TermLoaderSvcImpl myTermLoaderSvc; + + @Autowired + private ITermReadSvc myITermReadSvc; @Autowired @Qualifier(BaseConfig.JPA_VALIDATION_SUPPORT) - private IValidationSupport myJpaPersistedResourceValidationSupport; + private IValidationSupport myJpaPersistedResourceValidationSupport; private ZipCollectionBuilder myFiles; private ServletRequestDetails myRequestDetails = new ServletRequestDetails(); private Properties uploadProperties; - private IFhirResourceDao<ValueSet> dao; + private IFhirResourceDao<ValueSet> myValueSetIFhirResourceDao; - -// @BeforeAll -// public static void beforeAll() throws Exception { -// // remove DB -// Files.deleteIfExists(Paths.get( -// "/Users/juan.marchionattosmilecdr.com/projects/hapi-fhir/hapi-fhir-jpaserver-base/testdb_r4_2.mv.db")); -// } - @BeforeEach public void beforeEach() throws Exception { -// myTermLoaderSvc = TermLoaderSvcImpl.withoutProxyCheck(myTermDeferredStorageSvc, myTermCodeSystemStorageSvc); - - // myTermSvc.preExpandDeferredValueSetsToTerminologyTables(); - - File file = ResourceUtils.getFile("classpath:loinc-ver/" + LOINC_UPLOAD_PROPERTIES_FILE.getCode()); uploadProperties = new Properties(); uploadProperties.load(new FileInputStream(file)); - dao = (IFhirResourceDao<ValueSet>) myDaoRegistry.getResourceDao(ValueSet.class); + myValueSetIFhirResourceDao = myDaoRegistry.getResourceDao(ValueSet.class); when(mockRequestDetails.getServer().getDefaultPageSize()).thenReturn(25); - } @@ -162,9 +155,9 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { validateValueExpand(currentVersion, theExpectedVersions); -// validateValueLookup(currentVersion, theExpectedVersions); -// -// validateValidateCode(currentVersion, theExpectedVersions); + validateValueLookup(currentVersion, theExpectedVersions); + + validateValidateCode(currentVersion, theExpectedVersions); } @@ -187,20 +180,19 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { private void validateValidateCodeForVersion(String theVersion) { IValidationSupport.CodeValidationResult resultNoVersioned = myCodeSystemDao.validateCode(null, - new UriType(BASE_LOINC_URL), null, new CodeType(VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE), + new UriType(BASE_LOINC_URL), new StringType(theVersion), new CodeType(VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE), null, null, null, null); assertNotNull(resultNoVersioned); assertEquals(prefixWithVersion(theVersion, VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), resultNoVersioned.getDisplay()); IValidationSupport.CodeValidationResult resultVersioned = myCodeSystemDao.validateCode(null, - new UriType(BASE_LOINC_URL), null, new CodeType(VS_VERSIONED_ON_UPLOAD_FIRST_CODE), + new UriType(BASE_LOINC_URL), new StringType(theVersion), new CodeType(VS_VERSIONED_ON_UPLOAD_FIRST_CODE), null, null, null, null); assertNotNull(resultVersioned); assertEquals(prefixWithVersion(theVersion, VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), resultVersioned.getDisplay()); } - private void validateValueLookup(String theCurrentVersion, Collection<String> allVersions) { IValidationSupport.LookupCodeResult resultNoVer = myValidationSupport.lookupCode( new ValidationSupportContext(myValidationSupport), BASE_LOINC_URL, VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE, null); @@ -236,7 +228,7 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { private String prefixWithVersion(String version, String suffix) { - return (version == null ? "" : "v" + version + " ") + suffix; + return (version == null ? "" : "v" + version + " ") + suffix; } @@ -245,17 +237,20 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { ValueSet vs = myValueSetDao.expandByIdentifier(VS_NO_VERSIONED_ON_UPLOAD, null); assertEquals(1, vs.getExpansion().getContains().size()); - // version was added before code display to validate + // version was added prefixing code display to validate assertEquals(prefixWithVersion(currentVersion, VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), vs.getExpansion().getContains().iterator().next().getDisplay()); + // for CS ver = null, VS ver != null - ValueSet vs1 = myValueSetDao.expandByIdentifier(VS_VERSIONED_ON_UPLOAD + "|" + VS_ANSWER_LIST_VERSION, null); + ValueSet vs1 = myValueSetDao.expandByIdentifier( + VS_VERSIONED_ON_UPLOAD + "|" + VS_ANSWER_LIST_VERSION, null); assertEquals(3, vs1.getExpansion().getContains().size()); assertEquals(prefixWithVersion(currentVersion, VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), vs1.getExpansion().getContains().iterator().next().getDisplay()); + validateExpandedTermConcepts(currentVersion, theAllVersions); // now for each uploaded version @@ -264,34 +259,34 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { private void validateExpandedTermConcepts(String theCurrentVersion, Collection<String> theAllVersions) { - @SuppressWarnings("unchecked") TermConcept termConceptNoVerCsvNoVer = (TermConcept) myEntityManager.createQuery( "select tc from TermConcept tc join fetch tc.myCodeSystem tcsv where tc.myCode = '" + VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId is null").getSingleResult(); assertNotNull(termConceptNoVerCsvNoVer); - assertEquals(VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY, termConceptNoVerCsvNoVer.getDisplay()); + // data should have version because it was loaded with a version + assertEquals(prefixWithVersion(theCurrentVersion, VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), termConceptNoVerCsvNoVer.getDisplay()); - @SuppressWarnings("unchecked") TermConcept termConceptVerCsvNoVer = (TermConcept) myEntityManager.createQuery( "select tc from TermConcept tc join fetch tc.myCodeSystem tcsv where tc.myCode = '" + VS_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId is null").getSingleResult(); assertNotNull(termConceptVerCsvNoVer); - assertEquals(VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY, termConceptVerCsvNoVer.getDisplay()); + // data should have version because it was loaded with a version + assertEquals(prefixWithVersion(theCurrentVersion, VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), termConceptVerCsvNoVer.getDisplay()); if (theCurrentVersion != null) { - @SuppressWarnings("unchecked") TermConcept termConceptNoVerCsvVer = (TermConcept) myEntityManager.createQuery( "select tc from TermConcept tc join fetch tc.myCodeSystem tcsv where tc.myCode = '" + - VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId is null").getSingleResult(); + VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId = '" + theCurrentVersion + "'").getSingleResult(); assertNotNull(termConceptNoVerCsvVer); - assertEquals(VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY, termConceptNoVerCsvVer.getDisplay()); + // data should have version because it was loaded with a version + assertEquals(prefixWithVersion(theCurrentVersion, VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), termConceptNoVerCsvVer.getDisplay()); - @SuppressWarnings("unchecked") TermConcept termConceptVerCsvVer = (TermConcept) myEntityManager.createQuery( "select tc from TermConcept tc join fetch tc.myCodeSystem tcsv where tc.myCode = '" + - VS_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId is null").getSingleResult(); + VS_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId = '" + theCurrentVersion + "'").getSingleResult(); assertNotNull(termConceptVerCsvVer); - assertEquals(VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY, termConceptVerCsvVer.getDisplay()); + // data should have version because it was loaded with a version + assertEquals(prefixWithVersion(theCurrentVersion, VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), termConceptVerCsvVer.getDisplay()); } @@ -300,14 +295,12 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { private void validateExpandedTermConceptsForVersion(String theVersion) { - @SuppressWarnings("unchecked") TermConcept termConceptNoVer = (TermConcept) myEntityManager.createQuery( "select tc from TermConcept tc join fetch tc.myCodeSystem tcsv where tc.myCode = '" + VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId = '" + theVersion + "'").getSingleResult(); assertNotNull(termConceptNoVer); assertEquals(prefixWithVersion(theVersion, VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), termConceptNoVer.getDisplay()); - @SuppressWarnings("unchecked") TermConcept termConceptVer = (TermConcept) myEntityManager.createQuery( "select tc from TermConcept tc join fetch tc.myCodeSystem tcsv where tc.myCode = '" + VS_VERSIONED_ON_UPLOAD_FIRST_CODE + "' and tcsv.myCodeSystemVersionId = '" + theVersion + "'").getSingleResult(); @@ -335,7 +328,7 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { assertEquals(3, vs3.getExpansion().getContains().size()); // version was added before code display to validate - assertEquals(prefixWithVersion( theVersion, VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), + assertEquals(prefixWithVersion(theVersion, VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), vs3.getExpansion().getContains().iterator().next().getDisplay()); } @@ -345,7 +338,7 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { SearchParameterMap paramsNoUploadVer = new SearchParameterMap("url", new UriParam(VS_NO_VERSIONED_ON_UPLOAD)); int expectedResultQty = theExpectedIdVersions.size() + 1; // + 1 because an extra null version (the current) is always present - IBundleProvider noUploadVerResult = dao.search(paramsNoUploadVer, mockRequestDetails, mockServletResponse); + IBundleProvider noUploadVerResult = myValueSetIFhirResourceDao.search(paramsNoUploadVer, mockRequestDetails, mockServletResponse); List<IBaseResource> noUploadVerValueSets = noUploadVerResult.getAllResources(); assertEquals(expectedResultQty, noUploadVerValueSets.size()); @@ -355,12 +348,12 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { SearchParameterMap paramsUploadVer = new SearchParameterMap("url", new UriParam(VS_VERSIONED_ON_UPLOAD)); paramsUploadVer.add("version", new TokenParam(VS_ANSWER_LIST_VERSION)); - IBundleProvider uploadVerResult = dao.search(paramsUploadVer, mockRequestDetails, mockServletResponse); + IBundleProvider uploadVerResult = myValueSetIFhirResourceDao.search(paramsUploadVer, mockRequestDetails, mockServletResponse); List<IBaseResource> uploadVerValueSets = uploadVerResult.getAllResources(); assertEquals(1, uploadVerValueSets.size()); assertEquals(VS_VERSIONED_ON_UPLOAD_ID, uploadVerValueSets.get(0).getIdElement().getIdPart()); - assertEquals( VS_ANSWER_LIST_VERSION, ((ValueSet ) uploadVerValueSets.get(0)).getVersion()); + assertEquals(VS_ANSWER_LIST_VERSION, ((ValueSet) uploadVerValueSets.get(0)).getVersion()); // now validate each specific uploaded version theExpectedIdVersions.forEach(this::validateValueSetSearchForVersion); @@ -378,7 +371,7 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { SearchParameterMap paramsUploadNoVer = new SearchParameterMap("url", new UriParam(VS_NO_VERSIONED_ON_UPLOAD)); paramsUploadNoVer.add("version", new TokenParam(theVersion)); - IBundleProvider uploadNoVerResult = dao.search(paramsUploadNoVer, mockRequestDetails, mockServletResponse); + IBundleProvider uploadNoVerResult = myValueSetIFhirResourceDao.search(paramsUploadNoVer, mockRequestDetails, mockServletResponse); List<IBaseResource> uploadNoVerValueSets = uploadNoVerResult.getAllResources(); assertEquals(1, uploadNoVerValueSets.size()); @@ -392,7 +385,7 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { SearchParameterMap paramsUploadVer = new SearchParameterMap("url", new UriParam(VS_VERSIONED_ON_UPLOAD)); paramsUploadVer.add("version", new TokenParam(VS_ANSWER_LIST_VERSION + "-" + theVersion)); - IBundleProvider uploadVerResult = dao.search(paramsUploadVer, mockRequestDetails, mockServletResponse); + IBundleProvider uploadVerResult = myValueSetIFhirResourceDao.search(paramsUploadVer, mockRequestDetails, mockServletResponse); List<IBaseResource> uploadVerValueSets = uploadVerResult.getAllResources(); assertEquals(1, uploadVerValueSets.size()); @@ -406,7 +399,7 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { * Validates that the collection of unqualified IDs of each element of theValueSets matches the expected * unqualifiedIds corresponding to the uploaded versions plus one with no version * - * @param theValueSets the ValueSet collection + * @param theValueSets the ValueSet collection * @param theExpectedIdVersions the collection of expected versions */ private void matchUnqualifiedIds(List<IBaseResource> theValueSets, Collection<String> theExpectedIdVersions) { @@ -418,33 +411,31 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { // plus one entry for null version expectedNoVersionUnqualifiedIds.add(VS_NO_VERSIONED_ON_UPLOAD_ID); - List <String> resultUnqualifiedIds = theValueSets.stream() + List<String> resultUnqualifiedIds = theValueSets.stream() .map(r -> r.getIdElement().getIdPart()) .collect(Collectors.toList()); assertThat(resultUnqualifiedIds, containsInAnyOrder(resultUnqualifiedIds.toArray())); - List <String> resultVersions = theValueSets.stream() - .map(r -> ((ValueSet) r).getVersion()) - .collect(Collectors.toList()); - Set<String> theExpectedIdVersionsPlusNull = Sets.newHashSet(theExpectedIdVersions); theExpectedIdVersionsPlusNull.add(null); - assertThat(theExpectedIdVersionsPlusNull, containsInAnyOrder(resultVersions.toArray())); + assertThat(theExpectedIdVersionsPlusNull, containsInAnyOrder( + theValueSets.stream().map(r -> ((ValueSet) r).getVersion()).toArray())); + } /** * Validates that: - * for CodeSystem: - * _ current CS has no version - * _ current TCS has no version + * for CodeSystem: + * _ current CS has no version + * _ current TCS has no version * for ValueSet: - * _ current TVSs with upload version have upload-version with no version append - * _ current TVSs with no upload version have null version + * _ current TVSs with upload version have upload-version with no version append + * _ current TVSs with no upload version have null version */ - private void runCommonValidations(String theVersion) { - // for CodeSystem: + private void runCommonValidations(List<String> theAllVersions) { + // for CodeSystem: // _ current CS is present and has no version CodeSystem codeSystem = myCodeSystemDao.read(new IdType("loinc")); @@ -452,8 +443,9 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { ourLog.info("CodeSystem:\n" + csString); HashSet<String> shouldNotBePresentVersions = new HashSet<>(possibleVersions); - shouldNotBePresentVersions.remove(theVersion); - shouldNotBePresentVersions.stream().forEach(vv -> assertFalse(csString.contains(vv))); + theAllVersions.forEach(shouldNotBePresentVersions::remove); + shouldNotBePresentVersions.forEach(vv -> assertFalse(csString.contains(vv), + "Found version string: '" + vv + "' in CodeSystem: " + csString)); // same reading it from term service CodeSystem cs = myITermReadSvc.fetchCanonicalCodeSystemFromCompleteContext(BASE_LOINC_URL); @@ -469,6 +461,7 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { // for ValueSet resource ValueSet vs = (ValueSet) myJpaPersistedResourceValidationSupport.fetchValueSet(VS_NO_VERSIONED_ON_UPLOAD); + assertNotNull(vs); assertEquals(VS_NO_VERSIONED_ON_UPLOAD, vs.getUrl()); assertNull(vs.getVersion()); @@ -489,92 +482,132 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { public void uploadCurrentNoVersion() throws Exception { IIdType csId = uploadLoincCodeSystem(null, true); - runCommonValidations(null); + runCommonValidations(Collections.emptyList()); // validate operation for current (no version parameter) validateOperations(null, Collections.emptySet()); + + // tests conditions which were failing after VS expansion (before fix for issue-2995) + validateTermConcepts(Lists.newArrayList((String) null)); } @Test() - public void uploadCurrentWithVersion() throws Exception { + public void uploadWithVersion() throws Exception { String ver = "2.67"; IIdType csId = uploadLoincCodeSystem(ver, true); - runCommonValidations(ver); + runCommonValidations(Collections.singletonList(ver)); // validate operation for specific version validateOperations(ver, Collections.singleton(ver)); + + // tests conditions which were failing after VS expansion (before fix for issue-2995) + validateTermConcepts(Lists.newArrayList(ver, ver)); } + @Test - public void uploadCurrentNoVersionThenNoCurrent() throws Exception { + public void uploadNoVersionThenNoCurrent() throws Exception { uploadLoincCodeSystem(null, true); String ver = "2.67"; uploadLoincCodeSystem(ver, false); - myTermSvc.preExpandDeferredValueSetsToTerminologyTables(); - - runCommonValidations(ver); +// myTermSvc.preExpandDeferredValueSetsToTerminologyTables(); + runCommonValidations(Collections.singletonList(ver)); // validate operation for specific version validateOperations(null, Collections.singleton(ver)); + + // tests conditions which were failing after VS expansion (before fix for issue-2995) + validateTermConcepts(Lists.newArrayList(null, ver)); } @Test - public void uploadFirstCurrentWithVersionThenNoCurrent() throws Exception { - String firstVer = "2.67"; - uploadLoincCodeSystem(firstVer, true); + public void uploadWithVersionThenNoCurrent() throws Exception { + String currentVer = "2.67"; + uploadLoincCodeSystem(currentVer, true); - String secondVer = "2.68"; - uploadLoincCodeSystem(secondVer, false); + String nonCurrentVer = "2.68"; + uploadLoincCodeSystem(nonCurrentVer, false); - runCommonValidations(firstVer); - runCommonValidations(secondVer); + // myTermSvc.preExpandDeferredValueSetsToTerminologyTables(); + + runCommonValidations(Lists.newArrayList(currentVer, nonCurrentVer)); // validate operation for specific version - validateOperations(null, Lists.newArrayList(firstVer, secondVer)); + validateOperations(currentVer, Lists.newArrayList(currentVer, nonCurrentVer)); + + // tests conditions which were failing after VS expansion (before fix for issue-2995) + validateTermConcepts(Lists.newArrayList(currentVer, currentVer, nonCurrentVer)); + } + + /** + * Validates TermConcepts were created in the sequence indicated by the parameters + * and their displays match the expected versions + */ + private void validateTermConcepts(ArrayList<String> theExpectedVersions) { + @SuppressWarnings("unchecked") + List<TermConcept> termConceptNoVerList = (List<TermConcept>) myEntityManager.createQuery( + "from TermConcept where myCode = '" + VS_NO_VERSIONED_ON_UPLOAD_FIRST_CODE + "' order by myId").getResultList(); + assertEquals(theExpectedVersions.size(), termConceptNoVerList.size()); + for (int i = 0; i < theExpectedVersions.size(); i++) { + assertEquals( prefixWithVersion(theExpectedVersions.get(i), VS_NO_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), + termConceptNoVerList.get(i).getDisplay(), "TermCode with id: " + i + " display"); + } + + @SuppressWarnings("unchecked") + List<TermConcept> termConceptWithVerList = (List<TermConcept>) myEntityManager.createQuery( + "from TermConcept where myCode = '" + VS_VERSIONED_ON_UPLOAD_FIRST_CODE + "' order by myId").getResultList(); + assertEquals(theExpectedVersions.size(), termConceptWithVerList.size()); + for (int i = 0; i < theExpectedVersions.size(); i++) { + assertEquals( prefixWithVersion(theExpectedVersions.get(i), VS_VERSIONED_ON_UPLOAD_FIRST_DISPLAY), + termConceptWithVerList.get(i).getDisplay(), "TermCode with id: " + i + " display"); + } } @Test - public void uploadFirstCurrentNoVersionThenNoCurrentThenCurrent() throws Exception { + public void uploadNoVersionThenNoCurrentThenCurrent() throws Exception { uploadLoincCodeSystem(null, true); - String firstVer = "2.67"; - uploadLoincCodeSystem(firstVer, false); + String nonCurrentVer = "2.67"; + uploadLoincCodeSystem(nonCurrentVer, false); - String secondVer = "2.68"; - uploadLoincCodeSystem(secondVer, true); + String currentVer = "2.68"; + uploadLoincCodeSystem(currentVer, true); - runCommonValidations(firstVer); - runCommonValidations(secondVer); + runCommonValidations(Lists.newArrayList(nonCurrentVer, currentVer)); // validate operation for specific version - validateOperations(secondVer, Lists.newArrayList(firstVer, secondVer)); + validateOperations(currentVer, Lists.newArrayList(nonCurrentVer, currentVer)); + + // tests conditions which were failing after VS expansion (before fix for issue-2995) + validateTermConcepts(Lists.newArrayList(nonCurrentVer, currentVer, currentVer)); } @Test - public void uploadFirstCurrentWithVersionThenNoCurrentThenCurrent() throws Exception { - String firstVer = "2.67"; - uploadLoincCodeSystem(firstVer, true); + public void uploadWithVersionThenNoCurrentThenCurrent() throws Exception { + String firstCurrentVer = "2.67"; + uploadLoincCodeSystem(firstCurrentVer, true); - String secondVer = "2.68"; - uploadLoincCodeSystem(secondVer, false); + String noCurrentVer = "2.68"; + uploadLoincCodeSystem(noCurrentVer, false); - String thirdVer = "2.68"; - uploadLoincCodeSystem(thirdVer, true); + String lastCurrentVer = "2.69"; + uploadLoincCodeSystem(lastCurrentVer, true); - runCommonValidations(firstVer); - runCommonValidations(secondVer); - runCommonValidations(thirdVer); + runCommonValidations(Lists.newArrayList(firstCurrentVer, noCurrentVer, lastCurrentVer)); // validate operation for specific version - validateOperations(thirdVer, Lists.newArrayList(firstVer, secondVer, thirdVer)); + validateOperations(lastCurrentVer, Lists.newArrayList(firstCurrentVer, noCurrentVer, lastCurrentVer)); + + // tests conditions which were failing after VS expansion (before fix for issue-2995) + validateTermConcepts(Lists.newArrayList(firstCurrentVer, noCurrentVer, lastCurrentVer, lastCurrentVer)); } @@ -583,10 +616,8 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { private IIdType uploadLoincCodeSystem(String theVersion, boolean theMakeItCurrent) throws Exception { myFiles = new ZipCollectionBuilder(); - if (! theMakeItCurrent) { - myRequestDetails.getUserData().put(LOINC_CODESYSTEM_MAKE_CURRENT, false); - uploadProperties.put(LOINC_CODESYSTEM_MAKE_CURRENT.getCode(), "false"); - } + myRequestDetails.getUserData().put(LOINC_CODESYSTEM_MAKE_CURRENT, theMakeItCurrent); + uploadProperties.put(LOINC_CODESYSTEM_MAKE_CURRENT.getCode(), Boolean.toString(theMakeItCurrent)); assertTrue( theVersion == null || theVersion.equals("2.67") || theVersion.equals("2.68") || theVersion.equals("2.69"), @@ -625,7 +656,7 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { case "2.67": return "/loinc-ver/v267/"; case "2.68": return "/loinc-ver/v268/"; case "2.69": return "/loinc-ver/v269/"; - }; + } fail("Setup failed. Unexpected version: " + theVersion); return null; @@ -658,144 +689,11 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { } } - private void logAllTermValueSets() { - List<TermValueSet> vsList = myTermValueSetDao.findAll(); - - vsList.forEach(vs -> { - ourLog.info("ValueSet:\n" + vs); - }); - - } - - private TermCodeSystemVersion fetchCurrentCodeSystemVersion() { return (TermCodeSystemVersion) myEntityManager.createQuery( "select tcsv from TermCodeSystemVersion tcsv join fetch tcsv.myCodeSystem tcs " + "where tcs.myCurrentVersion = tcsv" ).getSingleResult(); } - private List<TermValueSet> fetchTermValueSets(String url) { - return myEntityManager.createQuery("from TermValueSet where url = '" + url + "'").getResultList(); - } - - private List<ValueSet> fetchValueSets(Collection<Long> ids) { -// ResourcePersistentId rscIds = myIdHelperService.resolveResourcePersistentIds( -// RequestPartitionId.allPartitions(), "ValueSet", url); -// - return myEntityManager.createQuery("from ResourceTable where myResourceType = 'ValueSet'").getResultList(); - } - - - - - -// @Test -// public void testValidateCodeIsInPreExpandedValueSet() throws Exception { -// myDaoConfig.setPreExpandValueSets(true); -// -// loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.POST); -// -// CodeSystem codeSystem = myCodeSystemDao.read(myExtensionalCsId); -// ourLog.info("CodeSystem:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem)); -// -// ValueSet valueSet = myValueSetDao.read(myExtensionalVsId); -// ourLog.info("ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(valueSet)); -// -// myTermSvc.preExpandDeferredValueSetsToTerminologyTables(); -// -// IValidationSupport.CodeValidationResult result = myTermSvc.validateCodeIsInPreExpandedValueSet(optsNoGuess, valueSet, null, null, null, null, null); -// assertNull(result); -// -// result = myTermSvc.validateCodeIsInPreExpandedValueSet(optsNoGuess, valueSet, null, "BOGUS", null, null, null); -// assertFalse(result.isOk()); -// -// result = myTermSvc.validateCodeIsInPreExpandedValueSet(optsNoGuess, valueSet, null, "11378-7", null, null, null); -// assertFalse(result.isOk()); -// -// result = myTermSvc.validateCodeIsInPreExpandedValueSet(optsGuess, valueSet, null, "11378-7", null, null, null); -// assertTrue(result.isOk()); -// assertEquals("Systolic blood pressure at First encounter", result.getDisplay()); -// -// result = myTermSvc.validateCodeIsInPreExpandedValueSet(optsGuess, valueSet, null, "11378-7", "Systolic blood pressure at First encounter", null, null); -// assertTrue(result.isOk()); -// assertEquals("Systolic blood pressure at First encounter", result.getDisplay()); -// -// result = myTermSvc.validateCodeIsInPreExpandedValueSet(optsNoGuess, valueSet, "http://acme.org", "11378-7", null, null, null); -// assertTrue(result.isOk()); -// assertEquals("Systolic blood pressure at First encounter", result.getDisplay()); -// -// Coding coding = new Coding("http://acme.org", "11378-7", "Systolic blood pressure at First encounter"); -// result = myTermSvc.validateCodeIsInPreExpandedValueSet(optsNoGuess, valueSet, null, null, null, coding, null); -// assertTrue(result.isOk()); -// assertEquals("Systolic blood pressure at First encounter", result.getDisplay()); -// -// CodeableConcept codeableConcept = new CodeableConcept(); -// codeableConcept.addCoding(new Coding("BOGUS", "BOGUS", "BOGUS")); -// codeableConcept.addCoding(coding); -// result = myTermSvc.validateCodeIsInPreExpandedValueSet(optsNoGuess, valueSet, null, null, null, null, codeableConcept); -// assertTrue(result.isOk()); -// assertEquals("Systolic blood pressure at First encounter", result.getDisplay()); -// } - - - -// @Test -// public void testCreateCodeSystemTwoVersions() { -// CodeSystem codeSystem = new CodeSystem(); -// codeSystem.setUrl(CS_URL); -// codeSystem.setContent(CodeSystem.CodeSystemContentMode.COMPLETE); -// codeSystem -// .addConcept().setCode("A").setDisplay("Code A"); -// codeSystem -// .addConcept().setCode("B").setDisplay("Code A"); -// -// codeSystem.setVersion("1"); -// -// IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified(); -// -// Set<TermConcept> codes = myTermSvc.findCodesBelow(id.getIdPartAsLong(), id.getVersionIdPartAsLong(), "A"); -// assertThat(toCodes(codes), containsInAnyOrder("A")); -// -// codes = myTermSvc.findCodesBelow(id.getIdPartAsLong(), id.getVersionIdPartAsLong(), "B"); -// assertThat(toCodes(codes), containsInAnyOrder("B")); -// -// runInTransaction(() -> { -// List<TermCodeSystemVersion> termCodeSystemVersions = myTermCodeSystemVersionDao.findAll(); -// assertEquals(termCodeSystemVersions.size(), 1); -// TermCodeSystemVersion termCodeSystemVersion_1 = termCodeSystemVersions.get(0); -// assertEquals(termCodeSystemVersion_1.getConcepts().size(), 2); -// Set<TermConcept> termConcepts = new HashSet<>(termCodeSystemVersion_1.getConcepts()); -// assertThat(toCodes(termConcepts), containsInAnyOrder("A", "B")); -// -// TermCodeSystem termCodeSystem = myTermCodeSystemDao.findByResourcePid(id.getIdPartAsLong()); -// assertEquals("1", termCodeSystem.getCurrentVersion().getCodeSystemVersionId()); -// -// }); -// -// codeSystem.setVersion("2"); -// codeSystem -// .addConcept().setCode("C").setDisplay("Code C"); -// -// IIdType id_v2 = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified(); -// codes = myTermSvc.findCodesBelow(id_v2.getIdPartAsLong(), id_v2.getVersionIdPartAsLong(), "C"); -// assertThat(toCodes(codes), containsInAnyOrder("C")); -// -// runInTransaction(() -> { -// List<TermCodeSystemVersion> termCodeSystemVersions_updated = myTermCodeSystemVersionDao.findAll(); -// assertEquals(termCodeSystemVersions_updated.size(), 2); -// TermCodeSystemVersion termCodeSystemVersion_2 = termCodeSystemVersions_updated.get(1); -// assertEquals(termCodeSystemVersion_2.getConcepts().size(), 3); -// Set<TermConcept> termConcepts_updated = new HashSet<>(termCodeSystemVersion_2.getConcepts()); -// assertThat(toCodes(termConcepts_updated), containsInAnyOrder("A", "B", "C")); -// -// TermCodeSystem termCodeSystem = myTermCodeSystemDao.findByResourcePid(id_v2.getIdPartAsLong()); -// assertEquals("2", termCodeSystem.getCurrentVersion().getCodeSystemVersionId()); -// }); -// } - - - - - } diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/AnswerFile/AnswerList.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/AnswerFile/AnswerList.csv index f07d57edd54..650551cb1be 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/AnswerFile/AnswerList.csv +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/AnswerFile/AnswerList.csv @@ -9,4 +9,4 @@ "LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"v2.67 5-6 times per week" , , , , , , , , "LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"v2.67 1 time per day" , , , , , , , , "LL1001-8" ,"v2.67 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"v2.67 Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , -"LL1892-0" ,"v2.67 ICD-9_ICD-10" ,"1.3.6.1.4.1.12009.10.1.1069","Y" , ,"http://www.cdc.gov/nchs/icd.htm", , , , , , , , , , , , , +"LL1892-0" ,"v2.67 ICD-9_ICD-10" ,"1.3.6.1.4.1.12009.10.1.1069","Y" , ,"http://www.cdc.gov/nchs/icd.htm", , , , ,"v2.67 " , , , , , , , , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/AnswerList.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/AnswerList.csv index a448cf80f2d..12fb5f865de 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/AnswerList.csv +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v267/AccessoryFiles/PanelsAndForms/AnswerList.csv @@ -1,12 +1,12 @@ "AnswerListId","AnswerListName" ,"AnswerListOID" ,"ExtDefinedYN","ExtDefinedAnswerListCodeSystem","ExtDefinedAnswerListLink" ,"AnswerStringId","LocalAnswerCode","LocalAnswerCodeSystem","SequenceNumber","DisplayText" ,"ExtCodeId","ExtCodeDisplayName" ,"ExtCodeSystem" ,"ExtCodeSystemVersion" ,"ExtCodeSystemCopyrightNotice" ,"SubsequentTextPrompt","Description","Score" -"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"1 slice or 1 dinner roll" , , , , , , , , -"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"2 slices or 2 dinner rolls" , , , , , , , , -"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"More than 2 slices or 2 dinner rolls", , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"Never" , , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"1-3 times per month" , , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"1-2 times per week" , , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"3-4 times per week" , , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"5-6 times per week" , , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"1 time per day" , , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"v2.67 1 slice or 1 dinner roll" , , , , , , , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"v2.67 2 slices or 2 dinner rolls" , , , , , , , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"v2.67 More than 2 slices or 2 dinner rolls", , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"v2.67 Never" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"v2.67 1-3 times per month" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"v2.67 1-2 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"v2.67 3-4 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"v2.67 5-6 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"v2.67 1 time per day" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"v2.67 Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , "LL1892-0" ,"ICD-9_ICD-10" ,"1.3.6.1.4.1.12009.10.1.1069","Y" , ,"http://www.cdc.gov/nchs/icd.htm", , , , , , , , , , , , , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/AnswerFile/AnswerList.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/AnswerFile/AnswerList.csv index d82c5b4ad6a..de4bcdc652e 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/AnswerFile/AnswerList.csv +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/AnswerFile/AnswerList.csv @@ -1,12 +1,12 @@ "AnswerListId","AnswerListName" ,"AnswerListOID" ,"ExtDefinedYN","ExtDefinedAnswerListCodeSystem","ExtDefinedAnswerListLink" ,"AnswerStringId","LocalAnswerCode","LocalAnswerCodeSystem","SequenceNumber","DisplayText" ,"ExtCodeId","ExtCodeDisplayName" ,"ExtCodeSystem" ,"ExtCodeSystemVersion" ,"ExtCodeSystemCopyrightNotice" ,"SubsequentTextPrompt","Description","Score" -"LL1000-0" ,"v2.68 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"1 slice or 1 dinner roll" , , , , , , , , -"LL1000-0" ,"v2.68 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"2 slices or 2 dinner rolls" , , , , , , , , -"LL1000-0" ,"v2.68 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"More than 2 slices or 2 dinner rolls", , , , , , , , -"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"Never" , , , , , , , , -"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"1-3 times per month" , , , , , , , , -"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"1-2 times per week" , , , , , , , , -"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"3-4 times per week" , , , , , , , , -"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"5-6 times per week" , , , , , , , , -"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"1 time per day" , , , , , , , , -"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , -"LL1892-0" ,"v2.68 ICD-9_ICD-10" ,"1.3.6.1.4.1.12009.10.1.1069","Y" , ,"http://www.cdc.gov/nchs/icd.htm", , , , , , , , , , , , , +"LL1000-0" ,"v2.68 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"v2.68 1 slice or 1 dinner roll" , , , , , , , , +"LL1000-0" ,"v2.68 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"v2.68 2 slices or 2 dinner rolls" , , , , , , , , +"LL1000-0" ,"v2.68 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"v2.68 More than 2 slices or 2 dinner rolls", , , , , , , , +"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"v2.68 Never" , , , , , , , , +"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"v2.68 1-3 times per month" , , , , , , , , +"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"v2.68 1-2 times per week" , , , , , , , , +"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"v2.68 3-4 times per week" , , , , , , , , +"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"v2.68 5-6 times per week" , , , , , , , , +"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"v2.68 1 time per day" , , , , , , , , +"LL1001-8" ,"v2.68 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"v2.68 Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , +"LL1892-0" ,"v2.68 ICD-9_ICD-10" ,"1.3.6.1.4.1.12009.10.1.1069","Y" , ,"http://www.cdc.gov/nchs/icd.htm", , , , ,"v2.68 " , , , , , , , , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/AnswerList.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/AnswerList.csv index a448cf80f2d..4d8aaaac004 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/AnswerList.csv +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v268/AccessoryFiles/PanelsAndForms/AnswerList.csv @@ -1,12 +1,12 @@ "AnswerListId","AnswerListName" ,"AnswerListOID" ,"ExtDefinedYN","ExtDefinedAnswerListCodeSystem","ExtDefinedAnswerListLink" ,"AnswerStringId","LocalAnswerCode","LocalAnswerCodeSystem","SequenceNumber","DisplayText" ,"ExtCodeId","ExtCodeDisplayName" ,"ExtCodeSystem" ,"ExtCodeSystemVersion" ,"ExtCodeSystemCopyrightNotice" ,"SubsequentTextPrompt","Description","Score" -"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"1 slice or 1 dinner roll" , , , , , , , , -"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"2 slices or 2 dinner rolls" , , , , , , , , -"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"More than 2 slices or 2 dinner rolls", , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"Never" , , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"1-3 times per month" , , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"1-2 times per week" , , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"3-4 times per week" , , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"5-6 times per week" , , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"1 time per day" , , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"v2.68 1 slice or 1 dinner roll" , , , , , , , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"v2.68 2 slices or 2 dinner rolls" , , , , , , , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"v2.68 More than 2 slices or 2 dinner rolls", , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"v2.68 Never" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"v2.68 1-3 times per month" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"v2.68 1-2 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"v2.68 3-4 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"v2.68 5-6 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"v2.68 1 time per day" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"v2.68 Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , "LL1892-0" ,"ICD-9_ICD-10" ,"1.3.6.1.4.1.12009.10.1.1069","Y" , ,"http://www.cdc.gov/nchs/icd.htm", , , , , , , , , , , , , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/AnswerFile/AnswerList.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/AnswerFile/AnswerList.csv index ec157fd70fe..31600cdab70 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/AnswerFile/AnswerList.csv +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/AnswerFile/AnswerList.csv @@ -1,12 +1,12 @@ "AnswerListId","AnswerListName" ,"AnswerListOID" ,"ExtDefinedYN","ExtDefinedAnswerListCodeSystem","ExtDefinedAnswerListLink" ,"AnswerStringId","LocalAnswerCode","LocalAnswerCodeSystem","SequenceNumber","DisplayText" ,"ExtCodeId","ExtCodeDisplayName" ,"ExtCodeSystem" ,"ExtCodeSystemVersion" ,"ExtCodeSystemCopyrightNotice" ,"SubsequentTextPrompt","Description","Score" -"LL1000-0" ,"v2.69 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"1 slice or 1 dinner roll" , , , , , , , , -"LL1000-0" ,"v2.69 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"2 slices or 2 dinner rolls" , , , , , , , , -"LL1000-0" ,"v2.69 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"More than 2 slices or 2 dinner rolls", , , , , , , , -"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"Never" , , , , , , , , -"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"1-3 times per month" , , , , , , , , -"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"1-2 times per week" , , , , , , , , -"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"3-4 times per week" , , , , , , , , -"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"5-6 times per week" , , , , , , , , -"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"1 time per day" , , , , , , , , -"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , -"LL1892-0" ,"v2.69 ICD-9_ICD-10" ,"1.3.6.1.4.1.12009.10.1.1069","Y" , ,"http://www.cdc.gov/nchs/icd.htm", , , , , , , , , , , , , +"LL1000-0" ,"v2.69 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"v2.69 1 slice or 1 dinner roll" , , , , , , , , +"LL1000-0" ,"v2.69 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"v2.69 2 slices or 2 dinner rolls" , , , , , , , , +"LL1000-0" ,"v2.69 PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"v2.69 More than 2 slices or 2 dinner rolls", , , , , , , , +"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"v2.69 Never" , , , , , , , , +"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"v2.69 1-3 times per month" , , , , , , , , +"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"v2.69 1-2 times per week" , , , , , , , , +"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"v2.69 3-4 times per week" , , , , , , , , +"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"v2.69 5-6 times per week" , , , , , , , , +"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"v2.69 1 time per day" , , , , , , , , +"LL1001-8" ,"v2.69 PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"v2.69 Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , +"LL1892-0" ,"v2.69 ICD-9_ICD-10" ,"1.3.6.1.4.1.12009.10.1.1069","Y" , ,"http://www.cdc.gov/nchs/icd.htm", , , , ,"v2.69 " , , , , , , , , diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/AnswerList.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/AnswerList.csv index a448cf80f2d..82330d220c1 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/AnswerList.csv +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc-ver/v269/AccessoryFiles/PanelsAndForms/AnswerList.csv @@ -1,12 +1,12 @@ "AnswerListId","AnswerListName" ,"AnswerListOID" ,"ExtDefinedYN","ExtDefinedAnswerListCodeSystem","ExtDefinedAnswerListLink" ,"AnswerStringId","LocalAnswerCode","LocalAnswerCodeSystem","SequenceNumber","DisplayText" ,"ExtCodeId","ExtCodeDisplayName" ,"ExtCodeSystem" ,"ExtCodeSystemVersion" ,"ExtCodeSystemCopyrightNotice" ,"SubsequentTextPrompt","Description","Score" -"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"1 slice or 1 dinner roll" , , , , , , , , -"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"2 slices or 2 dinner rolls" , , , , , , , , -"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"More than 2 slices or 2 dinner rolls", , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"Never" , , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"1-3 times per month" , , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"1-2 times per week" , , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"3-4 times per week" , , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"5-6 times per week" , , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"1 time per day" , , , , , , , , -"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13825-7" ,"1" , ,1 ,"v2.69 1 slice or 1 dinner roll" , , , , , , , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13838-0" ,"2" , ,2 ,"v2.69 2 slices or 2 dinner rolls" , , , , , , , , +"LL1000-0" ,"PhenX05_13_30D bread amt","1.3.6.1.4.1.12009.10.1.165" ,"N" , , ,"LA13892-7" ,"3" , ,3 ,"v2.69 More than 2 slices or 2 dinner rolls", , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA6270-8" ,"00" , ,1 ,"v2.69 Never" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13836-4" ,"01" , ,2 ,"v2.69 1-3 times per month" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13834-9" ,"02" , ,3 ,"v2.69 1-2 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13853-9" ,"03" , ,4 ,"v2.69 3-4 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13860-4" ,"04" , ,5 ,"v2.69 5-6 times per week" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA13827-3" ,"05" , ,6 ,"v2.69 1 time per day" , , , , , , , , +"LL1001-8" ,"PhenX05_14_30D freq amts","1.3.6.1.4.1.12009.10.1.166" ,"N" , , ,"LA4389-8" ,"97" , ,11 ,"v2.69 Refused" ,"443390004","Refused (qualifier value)","http://snomed.info/sct","http://snomed.info/sct/900000000000207008/version/20170731","This material includes SNOMED Clinical Terms® (SNOMED CT®) which is used by permission of the International Health Terminology Standards Development Organisation (IHTSDO) under license. All rights reserved. SNOMED CT® was originally created by The College", , , "LL1892-0" ,"ICD-9_ICD-10" ,"1.3.6.1.4.1.12009.10.1.1069","Y" , ,"http://www.cdc.gov/nchs/icd.htm", , , , , , , , , , , , , From 18e3ed68eb4b0056a27a2ea56a100c7e9cf166dc Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" <juan.marchionatto@smilecdr.com> Date: Thu, 16 Sep 2021 15:14:43 -0400 Subject: [PATCH 12/31] Revert loinc.xml deletion until current work gets completed --- .../uhn/fhir/jpa/term/TermLoaderSvcImpl.java | 5 +- .../ca/uhn/fhir/jpa/term/loinc/loinc.xml | 548 ++++++++++++++++++ 2 files changed, 551 insertions(+), 2 deletions(-) create mode 100644 hapi-fhir-jpaserver-base/src/main/resources/ca/uhn/fhir/jpa/term/loinc/loinc.xml diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java index 6f762f15103..be31eb190c3 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java @@ -40,6 +40,7 @@ import ca.uhn.fhir.rest.api.EncodingEnum; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import ca.uhn.fhir.util.ClasspathUtil; import ca.uhn.fhir.util.ValidateUtil; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Charsets; @@ -562,9 +563,9 @@ public class TermLoaderSvcImpl implements ITermLoaderSvc { String loincCsString = loincXmlHandler.getContents(); if (isBlank(loincCsString)) { - throw new InvalidRequestException("Did not find loinc.xml in the ZIP distribution."); + ourLog.warn("Did not find loinc.xml in the ZIP distribution. Using built-in copy"); + loincCsString = ClasspathUtil.loadResource("/ca/uhn/fhir/jpa/term/loinc/loinc.xml"); } - CodeSystem loincCs = FhirContext.forR4().newXmlParser().parseResource(CodeSystem.class, loincCsString); String codeSystemVersionId = theUploadProperties.getProperty(LOINC_CODESYSTEM_VERSION.getCode()); if (codeSystemVersionId != null) { diff --git a/hapi-fhir-jpaserver-base/src/main/resources/ca/uhn/fhir/jpa/term/loinc/loinc.xml b/hapi-fhir-jpaserver-base/src/main/resources/ca/uhn/fhir/jpa/term/loinc/loinc.xml new file mode 100644 index 00000000000..efe4184e99b --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/main/resources/ca/uhn/fhir/jpa/term/loinc/loinc.xml @@ -0,0 +1,548 @@ +<!-- +LOINC is a freely available international standard for tests, measurements, and observations. It is a well maintained, version independent code system. + +Use of LOINC is governed by the LOINC License: https://loinc.org/license/ + +This CodeSystem resource describes 'LOINC' independent of any particular version. There are notes about changes for version specific LOINC code system resources. + +Note that the following set of codes are defined by the LOINC code systems: + - the main LOINC codes + - the LOINC Answer codes (LA-) and the LOINC Answer list codes (LL-) + - the LOINC Part codes (LP-) in the Multiaxial Hierarchy + - the LOINC Part codes (LP-) for the properties + Note: there are license restrictions on the use of LOINC Part codes + - the LOINC Group codes (LG-) + Note: presently the LOINC Group codes are used to identify these roll-up groups as ValueSets, but are not yet loaded as codes in the CodeSystem + +Servers may generate variants of this for the LOINC version(s) and features they support. + +File Version: 0.6 +--> + +<CodeSystem xmlns="http://hl7.org/fhir"> + <id value="loinc"/> + + <!-- + This url is unchanged for all versions of LOINC. There can only be one correct Code System resource for each value of the version attribute (at least, only one per server). + --> + <url value="http://loinc.org"/> + + <!-- the HL7 v3 OID assigned to LOINC --> + <identifier> + <system value="urn:ietf:rfc:3986"/> + <value value="urn:oid:2.16.840.1.113883.6.1"/> + </identifier> + + <!-- + If a version is specified: + <version value="2.68"/> + --> + + <!-- + If a specific version is specified, the name should carry this information (e.g. LOINC_268). + --> + <name value="LOINC"/> + <title value="LOINC Code System"/> + <status value="active"/> + <experimental value="false"/> + + <publisher value="Regenstrief Institute, Inc."/> + <contact> + <telecom> + <value value="http://loinc.org"/> + </telecom> + </contact> + + <!-- + <date value=2020-06/> + --> + <description value="LOINC is a freely available international standard for tests, measurements, and observations"/> + <copyright value="This material contains content from LOINC (http://loinc.org). LOINC is copyright ©1995-2020, Regenstrief Institute, Inc. and the Logical Observation Identifiers Names and Codes (LOINC) Committee and is available at no cost under the license at http://loinc.org/license. LOINC® is a registered United States trademark of Regenstrief Institute, Inc."/> + <caseSensitive value="false"/> + + <valueSet value=" http://loinc.org/vs"/> + <!-- + For a version specific reference: + <valueSet value="http://loinc.org/2.68/vs"/> + --> + + <!-- + It's at the discretion of servers whether to present fragments of LOINC hierarchically or not, when using the code system resource. But, if they are hierarchical, the Hierarchy SHALL be based on the is-a relationship that is derived from the LOINC Multiaxial Hierarchy. + --> + <hierarchyMeaning value="is-a"/> + <compositional value="false"/> <!-- no compositional grammar in LOINC --> + <versionNeeded value="false"/> + + <!-- + This canonical definition of LOINC does not include the LOINC content, which is distributed separately for portability. + + Servers may choose to include fragments of LOINC for illustration purposes. + --> + <content value="not-present"/> + + <!-- + <count value="65000"/> + If working with a specific version, you could nominate a count of the total number of concepts (including the answers, Hierarchy, etc.). In this canonical definition we do not. + --> + + <!-- + FILTERS + Generally defined filters for specifying value sets + In LOINC, all the properties can also be used as filters, but they are not defined explicitly as filters. + Parent/child properties are as defined by FHIR. Note that at this time the LOINC code system resource does not support ancestor/descendant relationships. + + For illustration purposes, consider this slice of the LOINC Multiaxial Hierarchy when reading the descriptions below: + + Microbiology [LP7819-8] + Microorganism [LP14559-6] + Virus [LP14855-8] + Zika virus [LP200137-0] + Zika virus RNA | XXX [LP203271-4] + Zika virus RNA | XXX | Microbiology [LP379670-5] + Zika virus RNA [Presence] in Unspecified specimen by Probe and target amplification method [79190-5] + + Language Note: The filters defined here are specified using the default LOINC language - English (US). Requests are meant to be specified and interpreted on the English version. The return can be in a specified language (if supported by the server). But note that not all filters/properties have language translations available. + --> + <filter> + <code value="parent"/> + <description value="Allows for the selection of a set of codes based on their appearance in the LOINC Multiaxial Hierarchy. Parent selects immediate parent only. For example, the code '79190-5' has the parent 'LP379670-5'"/> + <operator value="="/> + <value value="A Part code"/> + </filter> + <filter> + <code value="child"/> + <description value="Allows for the selection of a set of codes based on their appearance in the LOINC Multiaxial Hierarchy. Child selects immediate children only. For example, the code 'LP379670-5' has the child '79190-5'. Only LOINC Parts have children; LOINC codes do not have any children because they are leaf nodes."/> + <operator value="="/> + <value value="A comma separated list of Part or LOINC codes"/> + </filter> + <filter> + <code value="copyright"/> + <description value="Allows for the inclusion or exclusion of LOINC codes that include 3rd party copyright notices. LOINC = only codes with a sole copyright by Regenstrief. 3rdParty = only codes with a 3rd party copyright in addition to the one from Regenstrief"/> + <operator value="="/> + <value value="LOINC | 3rdParty"/> + </filter> + + <!-- + PROPERTIES + There are 4 kinds of properties that apply to all LOINC codes: + 1. FHIR: display, designation; these are not described here since they are inherent in the specification + 2. Infrastructural: defined by FHIR, but documented here for the LOINC Multiaxial Hierarchy + 3. Primary LOINC properties: defined by the main LOINC table + 4. Secondary LOINC properties: defined by the LoincPartLink table + Additionally, there are 2 kinds of properties specific to Document ontology and Radiology codes, respectively: + 1. LOINC/RSNA Radiology Playbook properties + 2. Document Ontology properties + --> + <!-- + Infrastructural properties - inherited from FHIR, but documented here for the LOINC Multiaxial Hierarchy. + --> + + <property> + <code value="parent"/> + <uri value="http://hl7.org/fhir/concept-properties#parent"/> + <description value="A parent code in the Multiaxial Hierarchy"/> + <type value=""/> + </property> + <property> + <code value="child"/> + <uri value="http://hl7.org/fhir/concept-properties#child"/> + <description value="A child code in the Multiaxial Hierarchy"/> + <type value=""/> + </property> + + <!-- + Primary LOINC properties. + These apply to the main LOINC codes, but not the Multiaxial Hierarchy, Answer lists, or the Part codes. + Notes: + In the LOINC code system resource, the display element = LONG_COMMON_NAME + Many properties are specified as type "coding", which allows use of LOINC Part codes (LP-) and the display text. LOINC Parts and their associations to LOINC terms are published in the LOINC Part File. + The properties defined here follow the guidance of the LOINC Users' Manual, which states that they should be expressed with the LOINC attributes contained in the LOINC Table. Properties that are not defined in the LOINC Table use FHIR-styled names. + --> + + <property> + <code value="STATUS"/> + <uri value="http://loinc.org/property/STATUS"/> + <description value="Status of the term. Within LOINC, codes with STATUS=DEPRECATED are considered inactive. Current values: ACTIVE, TRIAL, DISCOURAGED, and DEPRECATED"/> + <type value="string"/> + </property> + <property> + <code value="COMPONENT"/> + <uri value="http://loinc.org/property/COMPONENT"/> + <description value="First major axis-component or analyte: Analyte Name, Analyte sub-class, Challenge"/> + <type value="Coding"/> + </property> + <property> + <code value="PROPERTY"/> + <uri value="http://loinc.org/property/PROPERTY"/> + <description value="Second major axis-property observed: Kind of Property (also called kind of quantity)"/> + <type value="Coding"/> + </property> + <property> + <code value="TIME_ASPCT"/> + <uri value="http://loinc.org/property/TIME_ASPCT"/> + <description value="Third major axis-timing of the measurement: Time Aspect (Point or moment in time vs. time interval)"/> + <type value="Coding"/> + </property> + <property> + <code value="SYSTEM"/> + <uri value="http://loinc.org/property/SYSTEM"/> + <description value="Fourth major axis-type of specimen or system: System (Sample) Type"/> + <type value="Coding"/> + </property> + <property> + <code value="SCALE_TYP"/> + <uri value="http://loinc.org/property/SCALE_TYP"/> + <description value="Fifth major axis-scale of measurement: Type of Scale"/> + <type value="Coding"/> + </property> + <property> + <code value="METHOD_TYP"/> + <uri value="http://loinc.org/property/METHOD_TYP"/> + <description value="Sixth major axis-method of measurement: Type of Method"/> + <type value="Coding"/> + </property> + <property> + <code value="CLASS"/> + <uri value="http://loinc.org/property/CLASS"/> + <description value="An arbitrary classification of the terms for grouping related observations together"/> + <type value="Coding"/> + </property> + <property> + <code value="VersionLastChanged"/> + <uri value="http://loinc.org/property/VersionLastChanged"/> + <description value="The LOINC version number in which the record has last changed. For new records, this field contains the same value as the VersionFirstReleased property."/> + <type value="string"/> + </property> + <property> + <code value="CLASSTYPE"/> + <uri value="http://loinc.org/property/CLASSTYPE"/> + <description value="1=Laboratory class; 2=Clinical class; 3=Claims attachments; 4=Surveys"/> + <type value="string"/> + </property> + <property> + <code value="ORDER_OBS"/> + <uri value="http://loinc.org/property/ORDER_OBS"/> + <description value="Provides users with an idea of the intended use of the term by categorizing it as an order only, observation only, or both"/> + <type value="string"/> + </property> + <property> + <code value="HL7_ATTACHMENT_STRUCTURE"/> + <uri value="http://loinc.org/property/HL7_ATTACHMENT_STRUCTURE"/> + <description value="This property is populated in collaboration with the HL7 Attachments Work Group as described in the HL7 Attachment Specification: Supplement to Consolidated CDA Templated Guide."/> + <type value="string"/> + </property> + <property> + <code value="VersionFirstReleased"/> + <uri value="http://loinc.org/property/VersionFirstReleased"/> + <description value="This is the LOINC version number in which this LOINC term was first published."/> + <type value="string"/> + </property> + <property> + <code value="PanelType"/> + <uri value="http://loinc.org/property/PanelType"/> + <description value="For LOINC terms that are panels, this attribute classifies them as a 'Convenience group', 'Organizer', or 'Panel'"/> + <type value="string"/> + </property> + <property> + <code value="ValidHL7AttachmentRequest"/> + <uri value="http://loinc.org/property/ValidHL7AttachmentRequest"/> + <description value="A value of Y in this field indicates that this LOINC code can be sent by a payer as part of an HL7 Attachment request for additional information."/> + <type value="string"/> + </property> + <property> + <code value="DisplayName"/> + <uri value="http://loinc.org/property/DisplayName"/> + <description value="A name that is more 'clinician-friendly' compared to the current LOINC Short Name, Long Common Name, and Fully Specified Name. It is created algorithmically from the manually crafted display text for each Part and is generally more concise than the Long Common Name."/> + <type value="string"/> + </property> + <property> + <code value="answer-list"/> + <uri value="http://loinc.org/property/answer-list"/> + <description value="An answer list associated with this LOINC code (if there are matching answer lists defined)."/> + <type value="Coding"/> + </property> + + <!-- + Secondary LOINC properties. + These properties also apply to the main LOINC codes, but not the Multiaxial Hierarchy, Answer lists, or the Part codes. + Notes: + These properties are defined in the LoincPartLink table. + --> + + <property> + <code value="analyte"/> + <uri value="http://loinc.org/property/analyte"/> + <description value="First sub-part of the Component, i.e., the part of the Component before the first carat"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-core"/> + <uri value="http://loinc.org/property/analyte-core"/> + <description value="The primary part of the analyte without the suffix"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-suffix"/> + <uri value="http://loinc.org/property/analyte-suffix"/> + <description value="The suffix part of the analyte, if present, e.g., Ab or DNA"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-numerator"/> + <uri value="http://loinc.org/property/analyte-numerator"/> + <description value="The numerator part of the analyte, i.e., everything before the slash in analytes that contain a divisor"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-divisor"/> + <uri value="http://loinc.org/property/analyte-divisor"/> + <description value="The divisor part of the analyte, if present, i.e., after the slash and before the first carat"/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-divisor-suffix"/> + <uri value="http://loinc.org/property/analyte-divisor-suffix"/> + <description value="The suffix part of the divisor, if present"/> + <type value="Coding"/> + </property> + <property> + <code value="challenge"/> + <uri value="http://loinc.org/property/challenge"/> + <description value="Second sub-part of the Component, i.e., after the first carat"/> + <type value="Coding"/> + </property> + <property> + <code value="adjustment"/> + <uri value="http://loinc.org/property/adjustment"/> + <description value="Third sub-part of the Component, i.e., after the second carat"/> + <type value="Coding"/> + </property> + <property> + <code value="count"/> + <uri value="http://loinc.org/property/count"/> + <description value="Fourth sub-part of the Component, i.e., after the third carat"/> + <type value="Coding"/> + </property> + <property> + <code value="time-core"/> + <uri value="http://loinc.org/property/time-core"/> + <description value="The primary part of the Time"/> + <type value="Coding"/> + </property> + <property> + <code value="time-modifier"/> + <uri value="http://loinc.org/property/time-modifier"/> + <description value="The modifier of the Time value, such as mean or max"/> + <type value="Coding"/> + </property> + <property> + <code value="system-core"/> + <uri value="http://loinc.org/property/system-core"/> + <description value="The primary part of the System, i.e., without the super system"/> + <type value="Coding"/> + </property> + <property> + <code value="super-system"/> + <uri value="http://loinc.org/property/super-system"/> + <description value="The super system part of the System, if present. The super system represents the source of the specimen when the source is someone or something other than the patient whose chart the result will be stored in. For example, fetus is the super system for measurements done on obstetric ultrasounds, because the fetus is being measured and that measurement is being recorded in the patient's (mother's) chart."/> + <type value="Coding"/> + </property> + <property> + <code value="analyte-gene"/> + <uri value="http://loinc.org/property/analyte-gene"/> + <description value="The specific gene represented in the analyte"/> + <type value="Coding"/> + </property> + <property> + <code value="category"/> + <uri value="http://loinc.org/property/category"/> + <description value="A single LOINC term can be assigned one or more categories based on both programmatic and manual tagging. Category properties also utilize LOINC Class Parts."/> + <type value="Coding"/> + </property> + <property> + <code value="search"/> + <uri value="http://loinc.org/property/search"/> + <description value="Synonyms, fragments, and other Parts that are linked to a term to enable more encompassing search results."/> + <type value="Coding"/> + </property> + + <!-- + LOINC/RSNA Radiology Playbook properties. These apply only to terms in the LOINC/RSNA Radiology Playbook File. + Notes: + Properties are specified as type "coding", which are represented by LOINC Part codes (LP-) and their display names. + The attribute names here use FHIR styled names rather than their original LOINC style names because the original names contain periods. + --> + + <property> + <code value="rad-modality-modality-type"/> + <uri value="http://loinc.org/property/rad-modality-modality-type"/> + <description value="Modality is used to represent the device used to acquire imaging information."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-modality-modality-subtype"/> + <uri value="http://loinc.org/property/rad-modality-modality-subtype"/> + <description value="Modality subtype may be optionally included to signify a particularly common or evocative configuration of the modality."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-anatomic-location-region-imaged"/> + <uri value="http://loinc.org/property/rad-anatomic-location-region-imaged"/> + <description value="The Anatomic Location Region Imaged attribute is used in two ways: as a coarse-grained descriptor of the area imaged and a grouper for finding related imaging exams; or, it is used just as a grouper."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-anatomic-location-imaging-focus"/> + <uri value="http://loinc.org/property/rad-anatomic-location-imaging-focus"/> + <description value="The Anatomic Location Imaging Focus is a more fine-grained descriptor of the specific target structure of an imaging exam. In many areas, the focus should be a specific organ."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-anatomic-location-laterality-presence"/> + <uri value="http://loinc.org/property/rad-anatomic-location-laterality-presence"/> + <description value="Radiology Exams that require laterality to be specified in order to be performed are signified with an Anatomic Location Laterality Presence attribute set to 'True'"/> + <type value="Coding"/> + </property> + <property> + <code value="rad-anatomic-location-laterality"/> + <uri value="http://loinc.org/property/rad-anatomic-location-laterality"/> + <description value="Radiology exam Laterality is specified as one of: Left, Right, Bilateral, Unilateral, Unspecified"/> + <type value="Coding"/> + </property> + <property> + <code value="rad-view-aggregation"/> + <uri value="http://loinc.org/property/rad-view-aggregation"/> + <description value="Aggregation describes the extent of the imaging performed, whether in quantitative terms (e.g., '3 or more views') or subjective terms (e.g., 'complete')."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-view-view-type"/> + <uri value="http://loinc.org/property/rad-view-view-type"/> + <description value="View type names specific views, such as 'lateral' or 'AP'."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-maneuver-maneuver-type"/> + <uri value="http://loinc.org/property/rad-maneuver-maneuver-type"/> + <description value="Maneuver type indicates an action taken with the goal of elucidating or testing a dynamic aspect of the anatomy."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-timing"/> + <uri value="http://loinc.org/property/rad-timing"/> + <description value="The Timing/Existence property used in conjunction with pharmaceutical and maneuver properties. It specifies whether or not the imaging occurs in the presence of the administered pharmaceutical or a maneuver designed to test some dynamic aspect of anatomy or physiology ."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-pharmaceutical-substance-given"/> + <uri value="http://loinc.org/property/rad-pharmaceutical-substance-given"/> + <description value="The Pharmaceutical Substance Given specifies administered contrast agents, radiopharmaceuticals, medications, or other clinically important agents and challenges during the imaging procedure."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-pharmaceutical-route"/> + <uri value="http://loinc.org/property/rad-pharmaceutical-route"/> + <description value="Route specifies the route of administration of the pharmaceutical."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-reason-for-exam"/> + <uri value="http://loinc.org/property/rad-reason-for-exam"/> + <description value="Reason for exam is used to describe a clinical indication or a purpose for the study."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-guidance-for-presence"/> + <uri value="http://loinc.org/property/rad-guidance-for-presence"/> + <description value="Guidance for.Presence indicates when a procedure is guided by imaging."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-guidance-for-approach"/> + <uri value="http://loinc.org/property/rad-guidance-for-approach"/> + <description value="Guidance for.Approach refers to the primary route of access used, such as percutaneous, transcatheter, or transhepatic."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-guidance-for-action"/> + <uri value="http://loinc.org/property/rad-guidance-for-action"/> + <description value="Guidance for.Action indicates the intervention performed, such as biopsy, aspiration, or ablation."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-guidance-for-object"/> + <uri value="http://loinc.org/property/rad-guidance-for-object"/> + <description value="Guidance for.Object specifies the target of the action, such as mass, abscess or cyst."/> + <type value="Coding"/> + </property> + <property> + <code value="rad-subject"/> + <uri value="http://loinc.org/property/rad-subject"/> + <description value="Subject is intended for use when there is a need to distinguish between the patient associated with an imaging study, and the target of the study."/> + <type value="Coding"/> + </property> + + <!-- + Document Ontology properties. + These apply only to terms in the LOINC Document Ontology File + Notes + Properties are specified as type "coding", which are represented by LOINC Part codes (LP-) and their display names. + The attribute names here use FHIR styled names rather than their original LOINC style names because those contain periods. + --> + + <property> + <code value="document-kind"/> + <uri value="http://loinc.org/property/document-kind"/> + <description value="Characterizes the general structure of the document at a macro level."/> + <type value="Coding"/> + </property> + <property> + <code value="document-role"/> + <uri value="http://loinc.org/property/document-role"/> + <description value="Characterizes the training or professional level of the author of the document, but does not break down to specialty or subspecialty."/> + <type value="Coding"/> + </property> + <property> + <code value="document-setting"/> + <uri value="http://loinc.org/property/document-setting"/> + <description value="Setting is a modest extension of CMS’s coarse definition of care settings, such as outpatient, hospital, etc. Setting is not equivalent to location, which typically has more locally defined meanings."/> + <type value="Coding"/> + </property> + <property> + <code value="document-subject-matter-domain"/> + <uri value="http://loinc.org/property/document-subject-matter-domain"/> + <description value="Characterizes the clinical domain that is the subject of the document. For example, Internal Medicine, Neurology, Physical Therapy, etc."/> + <type value="Coding"/> + </property> + <property> + <code value="document-type-of-service"/> + <uri value="http://loinc.org/property/document-type-of-service"/> + <description value="Characterizes the kind of service or activity provided to/for the patient (or other subject of the service) that is described in the document."/> + <type value="Coding"/> + </property> + + <!-- Answer list related properties --> + <property> + <code value="answers-for"/> + <uri value="http://loinc.org/property/answers-for"/> + <description value="A LOINC Code for which this answer list is used."/> + <type value="Coding"/> + </property> + + <!-- Note for future consideration. These are properties of LA codes in the context of a particular list. Not global properties. + <property> + <code value="sequence"/> + <uri value="http://loinc.org/property/sequence"/> + <description value="Sequence Number of a answer in a set of answers (LA- codes only)"/> + <type value="integer"/> + </property> + <property> + <code value="score"/> + <uri value="http://loinc.org/property/score"/> + <description value="Score assigned to an answer (LA- codes only)"/> + <type value="integer"/> + </property> + --> +</CodeSystem> + + From d372371f364bd2be97da0b5222526aef2f85fb68 Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" <juan.marchionatto@smilecdr.com> Date: Mon, 20 Sep 2021 08:51:51 -0400 Subject: [PATCH 13/31] Make sure a loinc CodeSystem always has a ForcedId --- .../fhir/jpa/dao/BaseHapiFhirResourceDao.java | 5 ++--- .../JpaPersistedResourceValidationSupport.java | 17 ++++++++++++++--- .../jpa/dao/r4/FhirResourceDaoCodeSystemR4.java | 16 ++++++++++++++++ .../jpa/term/TermCodeSystemStorageSvcImpl.java | 4 ++++ .../fhir/jpa/term/TermVersionAdapterSvcR4.java | 5 +++++ .../dao/r4/FhirResourceDaoR4ValidateTest.java | 13 ++++++++----- 6 files changed, 49 insertions(+), 11 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java index 2d2911b9f92..08bb18ae835 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java @@ -51,7 +51,6 @@ import ca.uhn.fhir.jpa.partition.SystemRequestDetails; import ca.uhn.fhir.jpa.patch.FhirPatch; import ca.uhn.fhir.jpa.patch.JsonPatchUtils; import ca.uhn.fhir.jpa.patch.XmlPatchUtils; -import ca.uhn.fhir.jpa.search.DatabaseBackedPagingProvider; import ca.uhn.fhir.jpa.search.PersistedJpaBundleProvider; import ca.uhn.fhir.jpa.search.cache.SearchCacheStatusEnum; import ca.uhn.fhir.jpa.search.reindex.IResourceReindexingSvc; @@ -169,7 +168,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B @Autowired private IRequestPartitionHelperSvc myRequestPartitionHelperService; @Autowired - private HapiTransactionService myTransactionService; + protected HapiTransactionService myTransactionService; @Autowired private MatchUrlService myMatchUrlService; @Autowired @@ -221,7 +220,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B /** * Called for FHIR create (POST) operations */ - private DaoMethodOutcome doCreateForPost(T theResource, String theIfNoneExist, boolean thePerformIndexing, TransactionDetails theTransactionDetails, RequestDetails theRequestDetails) { + protected DaoMethodOutcome doCreateForPost(T theResource, String theIfNoneExist, boolean thePerformIndexing, TransactionDetails theTransactionDetails, RequestDetails theRequestDetails) { if (theResource == null) { String msg = getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "missingBody"); throw new InvalidRequestException(msg); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java index 44b0b2582e2..06ede2ad0da 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java @@ -109,8 +109,10 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport public IBaseResource fetchCodeSystem(String theSystem) { if (myTermReadSvc.isLoincNotGenericUnversionedCodeSystem(theSystem)) { Optional<IBaseResource> currentCSOpt = getCodeSystemCurrentVersion(new UriType(theSystem)); - return currentCSOpt.orElseThrow(() -> new ResourceNotFoundException( - "Couldn't find current version CodeSystem for url: " + theSystem)); + if (! currentCSOpt.isPresent()) { + ourLog.info("Couldn't find current version of CodeSystem: " + theSystem); + } + return currentCSOpt.orElse(null); } return fetchResource(myCodeSystemType, theSystem); @@ -125,7 +127,16 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport IFhirResourceDao<? extends IBaseResource> valueSetResourceDao = myDaoRegistry.getResourceDao(myCodeSystemType); String forcedId = "loinc"; - IBaseResource codeSystem = valueSetResourceDao.read(new IdDt("CodeSystem", forcedId)); + + // try/catch ignores exception because we need code to fall back to other options + IBaseResource codeSystem; + try { + codeSystem = valueSetResourceDao.read(new IdDt("CodeSystem", forcedId)); + + } catch (Exception theE) { + return Optional.empty(); + } + return Optional.ofNullable(codeSystem); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoCodeSystemR4.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoCodeSystemR4.java index 37ec5745cf4..305b8a1c8fb 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoCodeSystemR4.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoCodeSystemR4.java @@ -25,6 +25,7 @@ import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult; import ca.uhn.fhir.context.support.ValidationSupportContext; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoCodeSystem; +import ca.uhn.fhir.jpa.api.model.DaoMethodOutcome; import ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao; import ca.uhn.fhir.jpa.model.cross.IBasePersistedResource; import ca.uhn.fhir.jpa.model.entity.ResourceTable; @@ -46,12 +47,14 @@ import org.hl7.fhir.r4.model.Coding; import org.springframework.beans.factory.annotation.Autowired; import javax.annotation.Nonnull; +import java.security.InvalidParameterException; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Set; import static ca.uhn.fhir.jpa.dao.FhirResourceDaoValueSetDstu2.toStringOrNull; +import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; public class FhirResourceDaoCodeSystemR4 extends BaseHapiFhirResourceDao<CodeSystem> implements IFhirResourceDaoCodeSystem<CodeSystem, Coding, CodeableConcept> { @@ -173,4 +176,17 @@ public class FhirResourceDaoCodeSystemR4 extends BaseHapiFhirResourceDao<CodeSys } + + @Override + public DaoMethodOutcome create(CodeSystem theResource, String theIfNoneExist, boolean thePerformIndexing, + @Nonnull TransactionDetails theTransactionDetails, RequestDetails theRequestDetails) { + // loinc CodeSystem must have an ID + if (isNotBlank(theResource.getUrl()) && theResource.getUrl().contains("loinc") + && isBlank(theResource.getIdElement().getIdPart())) { + throw new InvalidParameterException("'loinc' CodeSystem must have an ID"); + } + return myTransactionService.execute(theRequestDetails, theTransactionDetails, + tx -> doCreateForPost(theResource, theIfNoneExist, thePerformIndexing, theTransactionDetails, theRequestDetails)); + } + } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java index 6a4d72c0337..525eb9717e7 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java @@ -86,6 +86,7 @@ import java.util.UUID; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; +import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; public class TermCodeSystemStorageSvcImpl implements ITermCodeSystemStorageSvc { @@ -139,6 +140,9 @@ public class TermCodeSystemStorageSvcImpl implements ITermCodeSystemStorageSvc { CodeSystem codeSystemResource = new CodeSystem(); codeSystemResource.setUrl(theSystem); codeSystemResource.setContent(CodeSystem.CodeSystemContentMode.NOTPRESENT); + if (isBlank(codeSystemResource.getIdElement().getIdPart()) && theSystem.contains("loinc")) { + codeSystemResource.setId("loinc"); + } myTerminologyVersionAdapterSvc.createOrUpdateCodeSystem(codeSystemResource); cs = myCodeSystemDao.findByCodeSystemUri(theSystem); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4.java index be3cf92be7e..5326b1b49ac 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4.java @@ -33,6 +33,8 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.EventListener; +import java.security.InvalidParameterException; + import static org.apache.commons.lang3.StringUtils.isBlank; public class TermVersionAdapterSvcR4 extends BaseTermVersionAdapterSvcImpl implements ITermVersionAdapterSvc { @@ -63,6 +65,9 @@ public class TermVersionAdapterSvcR4 extends BaseTermVersionAdapterSvcImpl imple public IIdType createOrUpdateCodeSystem(org.hl7.fhir.r4.model.CodeSystem theCodeSystemResource, RequestDetails theRequestDetails) { validateCodeSystemForStorage(theCodeSystemResource); if (isBlank(theCodeSystemResource.getIdElement().getIdPart())) { + if (theCodeSystemResource.getUrl().contains("loinc")) { + throw new InvalidParameterException("LOINC CodeSystem must have an 'ID' element"); + } String matchUrl = "CodeSystem?url=" + UrlUtil.escapeUrlParam(theCodeSystemResource.getUrl()); return myCodeSystemResourceDao.update(theCodeSystemResource, matchUrl, theRequestDetails).getId(); } else { diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValidateTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValidateTest.java index 9925ea61f49..459e8f6af85 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValidateTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValidateTest.java @@ -501,7 +501,8 @@ public class FhirResourceDaoR4ValidateTest extends BaseJpaR4Test { cs.setContent(CodeSystem.CodeSystemContentMode.COMPLETE); cs.setUrl("http://loinc.org"); cs.addConcept().setCode("123-4").setDisplay("Code 123 4"); - myCodeSystemDao.create(cs); + cs.setId("loinc"); + myCodeSystemDao.update(cs); Group group = new Group(); group.setId("ABC"); @@ -567,8 +568,8 @@ public class FhirResourceDaoR4ValidateTest extends BaseJpaR4Test { CodeSystem cs = new CodeSystem(); cs.setContent(CodeSystem.CodeSystemContentMode.COMPLETE); cs.setUrl("http://loinc.org"); - cs.addConcept().setCode("123-4").setDisplay("Code 123 4"); - myCodeSystemDao.create(cs); + cs.addConcept().setCode("123-4").setDisplay("Code 123 4").setId("loinc"); + myCodeSystemDao.update(cs); Group group = new Group(); group.setId("ABC"); @@ -628,14 +629,15 @@ public class FhirResourceDaoR4ValidateTest extends BaseJpaR4Test { ValueSet vs = new ValueSet(); vs.setUrl("http://example.com/fhir/ValueSet/observation-vitalsignresult"); - vs.getCompose().addInclude().setSystem("http://loinc.org"); + vs.getCompose().addInclude().setSystem("http://loinc.org").setId("loinc"); myValueSetDao.create(vs); CodeSystem cs = new CodeSystem(); cs.setContent(CodeSystem.CodeSystemContentMode.COMPLETE); cs.setUrl("http://loinc.org"); cs.addConcept().setCode("123-4").setDisplay("Code 123 4"); - myCodeSystemDao.create(cs); + cs.setId("loinc"); + myCodeSystemDao.update(cs); Group group = new Group(); group.setId("ABC"); @@ -936,6 +938,7 @@ public class FhirResourceDaoR4ValidateTest extends BaseJpaR4Test { // Valid code obs.getText().setStatus(Narrative.NarrativeStatus.GENERATED); obs.getCode().getCodingFirstRep().setSystem("http://loinc.org").setCode("CODE3").setDisplay("Display 3"); + obs.getCode().getCodingFirstRep().setId("loinc"); oo = validateAndReturnOutcome(obs); assertEquals("No issues detected during validation", oo.getIssueFirstRep().getDiagnostics(), encode(oo)); From 1492b9220a0170a4a491c83a2b22432e44cbc16e Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" <juan.marchionatto@smilecdr.com> Date: Mon, 20 Sep 2021 11:15:53 -0400 Subject: [PATCH 14/31] Add test comment --- .../fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java index 2760086772c..9e4057fd1a0 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java @@ -158,6 +158,8 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { validateValueLookup(currentVersion, theExpectedVersions); validateValidateCode(currentVersion, theExpectedVersions); + + // nothing to test for subsumes operation as it works only for concepts which share CodeSystem and version } From 8a1d95f348b2f03d2da802dcce3b11a517eb2bcb Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" <juan.marchionatto@smilecdr.com> Date: Mon, 20 Sep 2021 17:14:42 -0400 Subject: [PATCH 15/31] Add service to get CodeSystem from its forcedId without forcing rollback by ResourceNotFoundException in case not found --- ...JpaPersistedResourceValidationSupport.java | 14 +----------- .../fhir/jpa/term/BaseTermReadSvcImpl.java | 22 +++++++++++++++++++ .../uhn/fhir/jpa/term/api/ITermReadSvc.java | 2 ++ 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java index 06ede2ad0da..f6234960c7f 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java @@ -125,19 +125,7 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport private Optional<IBaseResource> getCodeSystemCurrentVersion(UriType theUrl) { if (! theUrl.getValueAsString().contains("loinc")) return Optional.empty(); - IFhirResourceDao<? extends IBaseResource> valueSetResourceDao = myDaoRegistry.getResourceDao(myCodeSystemType); - String forcedId = "loinc"; - - // try/catch ignores exception because we need code to fall back to other options - IBaseResource codeSystem; - try { - codeSystem = valueSetResourceDao.read(new IdDt("CodeSystem", forcedId)); - - } catch (Exception theE) { - return Optional.empty(); - } - - return Optional.ofNullable(codeSystem); + return myTermReadSvc.readByForcedId("loinc"); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java index 10cbc569fdc..cd15e180327 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java @@ -28,6 +28,7 @@ import ca.uhn.fhir.context.support.ValueSetExpansionOptions; import ca.uhn.fhir.jpa.api.config.DaoConfig; import ca.uhn.fhir.jpa.api.dao.DaoRegistry; import ca.uhn.fhir.jpa.api.dao.IDao; +import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoCodeSystem; import ca.uhn.fhir.jpa.config.HibernatePropertiesProvider; import ca.uhn.fhir.jpa.dao.IFulltextSearchSvc; @@ -54,6 +55,7 @@ import ca.uhn.fhir.jpa.entity.TermConceptPropertyTypeEnum; import ca.uhn.fhir.jpa.entity.TermValueSet; import ca.uhn.fhir.jpa.entity.TermValueSetConcept; import ca.uhn.fhir.jpa.entity.TermValueSetPreExpansionStatusEnum; +import ca.uhn.fhir.jpa.model.entity.ForcedId; import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.jpa.model.sched.HapiJob; import ca.uhn.fhir.jpa.model.sched.ISchedulerService; @@ -139,6 +141,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.annotation.PostConstruct; import javax.persistence.EntityManager; +import javax.persistence.NonUniqueResultException; import javax.persistence.PersistenceContext; import javax.persistence.PersistenceContextType; import javax.persistence.TypedQuery; @@ -2552,4 +2555,23 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { return theReqLang.equalsIgnoreCase(theStoredLang); } + + + @Override + public Optional<IBaseResource> readByForcedId(String theForcedId) { + @SuppressWarnings("unchecked") + List<ResourceTable> resultList = (List<ResourceTable>) myEntityManager.createQuery( + "select f.myResource from ForcedId f " + + "where f.myResourceType = 'CodeSystem' and f.myForcedId = '" + theForcedId + "'").getResultList(); + if (resultList.isEmpty()) return Optional.empty(); + + if (resultList.size() > 1) throw new NonUniqueResultException( + "More than one CodeSystem is pointed by forcedId: " + theForcedId + ". Was constraint " + + ForcedId.IDX_FORCEDID_TYPE_FID + " removed?"); + + IFhirResourceDao<CodeSystem> csDao = myDaoRegistry.getResourceDao("CodeSystem"); + IBaseResource cs = csDao.toResource(resultList.get(0), false); + return Optional.of(cs ); + } + } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java index 43c4ab902cc..fe6adeffee9 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java @@ -136,4 +136,6 @@ public interface ITermReadSvc extends IValidationSupport { */ boolean isLoincNotGenericUnversionedValueSet(String theUrl); + Optional<IBaseResource> readByForcedId(String theForcedId); + } From 9c790a73741d019158aa025711209c37d32628dd Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" <juan.marchionatto@smilecdr.com> Date: Mon, 20 Sep 2021 17:18:11 -0400 Subject: [PATCH 16/31] Revert creation of test utility class finally not needed --- .../uhn/fhir/jpa/dao/dstu3/BaseJpaDstu3Test.java | 3 --- ...irResourceDaoDstu3ValueSetMultiVersionTest.java | 14 +++++++------- .../java/ca/uhn/fhir/jpa/dao/r4/BaseJpaR4Test.java | 5 +---- .../FhirResourceDaoR4ValueSetMultiVersionTest.java | 14 +++++++------- .../java/ca/uhn/fhir/jpa/dao/r5/BaseJpaR5Test.java | 3 --- .../FhirResourceDaoR5ValueSetMultiVersionTest.java | 14 +++++++------- 6 files changed, 22 insertions(+), 31 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/BaseJpaDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/BaseJpaDstu3Test.java index b5d3282435e..9c60bafa905 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/BaseJpaDstu3Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/BaseJpaDstu3Test.java @@ -30,7 +30,6 @@ import ca.uhn.fhir.jpa.dao.data.ITermConceptDao; import ca.uhn.fhir.jpa.dao.data.ITermConceptMapDao; import ca.uhn.fhir.jpa.dao.data.ITermConceptMapGroupElementTargetDao; import ca.uhn.fhir.jpa.dao.data.ITermValueSetDao; -import ca.uhn.fhir.jpa.dao.data.ITermValueSetDaoTestUtil; import ca.uhn.fhir.jpa.dao.dstu2.FhirResourceDaoDstu2SearchNoFtTest; import ca.uhn.fhir.jpa.dao.r4.BaseJpaR4Test; import ca.uhn.fhir.jpa.model.entity.ModelConfig; @@ -355,8 +354,6 @@ public abstract class BaseJpaDstu3Test extends BaseJpaTest { private IBulkDataExportSvc myBulkDataExportSvc; @Autowired protected ITermValueSetDao myTermValueSetDao; - @Autowired - protected ITermValueSetDaoTestUtil myTermValueSetDaoTestUtil; @AfterEach() public void afterCleanupDao() { diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3ValueSetMultiVersionTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3ValueSetMultiVersionTest.java index b57671507ce..25bb507169c 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3ValueSetMultiVersionTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3ValueSetMultiVersionTest.java @@ -82,7 +82,7 @@ public class FhirResourceDaoDstu3ValueSetMultiVersionTest extends BaseJpaDstu3Te public void testCreateVersionedValueSets() { Map<ValueSetVersions, DaoMethodOutcome> myValueSets = createVersionedValueSets(); - assertEquals(3, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(3, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); Optional<TermValueSet> optionalTermValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET); assertTrue(optionalTermValueSet.isPresent()); @@ -114,7 +114,7 @@ public class FhirResourceDaoDstu3ValueSetMultiVersionTest extends BaseJpaDstu3Te public void testUpdateVersionedValueSets() { Map<ValueSetVersions, DaoMethodOutcome> myValueSets = createVersionedValueSets(); - assertEquals(3, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(3, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); TermValueSet termValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET).orElseThrow(() -> new IllegalArgumentException("No TerValueSet found for " + URL_MY_VALUE_SET + " with null version")); assertEquals("ValueSet_noVersion", termValueSet.getName()); @@ -142,7 +142,7 @@ public class FhirResourceDaoDstu3ValueSetMultiVersionTest extends BaseJpaDstu3Te Long v2Version_resid = ((ResourceTable)v2Version_update_outcome.getEntity()).getId(); // Verify that ValueSets were updated. - assertEquals(3, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(3, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); termValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET).orElseThrow(() -> new IllegalArgumentException("No TerValueSet found for " + URL_MY_VALUE_SET + " with null version")); assertNotNull(nullVersion_resid); @@ -168,7 +168,7 @@ public class FhirResourceDaoDstu3ValueSetMultiVersionTest extends BaseJpaDstu3Te public void testDeleteVersionedValueSets() { Map<ValueSetVersions, DaoMethodOutcome> myValueSets = createVersionedValueSets(); - assertEquals(3, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(3, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); TermValueSet termValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET).orElseThrow(() -> new IllegalArgumentException("No TerValueSet found for " + URL_MY_VALUE_SET + " with null version")); assertEquals("ValueSet_noVersion", termValueSet.getName()); @@ -181,7 +181,7 @@ public class FhirResourceDaoDstu3ValueSetMultiVersionTest extends BaseJpaDstu3Te // Delete ValueSets myValueSetDao.delete(myValueSets.get(ValueSetVersions.NULL).getResource().getIdElement()); - assertEquals(2, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(2, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); Optional<TermValueSet> optionalTermValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET); if (optionalTermValueSet.isPresent()) { fail(); @@ -190,7 +190,7 @@ public class FhirResourceDaoDstu3ValueSetMultiVersionTest extends BaseJpaDstu3Te assertNotNull(myTermValueSetDao.findTermValueSetByUrlAndVersion(URL_MY_VALUE_SET, "v2").orElseThrow(() -> new IllegalArgumentException("No TerValueSet found for " + URL_MY_VALUE_SET + " version v2"))); myValueSetDao.delete(myValueSets.get(ValueSetVersions.V1).getResource().getIdElement()); - assertEquals(1, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(1, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); optionalTermValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET); if (optionalTermValueSet.isPresent()) { fail(); @@ -202,7 +202,7 @@ public class FhirResourceDaoDstu3ValueSetMultiVersionTest extends BaseJpaDstu3Te myTermValueSetDao.findTermValueSetByUrlAndVersion(URL_MY_VALUE_SET, "v2").orElseThrow(() -> new IllegalArgumentException("No TerValueSet found for " + URL_MY_VALUE_SET + " version v2")); myValueSetDao.delete(myValueSets.get(ValueSetVersions.V2).getResource().getIdElement()); - assertEquals(0, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(0, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); optionalTermValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET); if (optionalTermValueSet.isPresent()) { fail(); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/BaseJpaR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/BaseJpaR4Test.java index 295b8950700..95a9732fed5 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/BaseJpaR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/BaseJpaR4Test.java @@ -51,7 +51,6 @@ import ca.uhn.fhir.jpa.dao.data.ITermConceptPropertyDao; import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDao; import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDesignationDao; import ca.uhn.fhir.jpa.dao.data.ITermValueSetDao; -import ca.uhn.fhir.jpa.dao.data.ITermValueSetDaoTestUtil; import ca.uhn.fhir.jpa.dao.index.IdHelperService; import ca.uhn.fhir.jpa.entity.TermCodeSystem; import ca.uhn.fhir.jpa.entity.TermCodeSystemVersion; @@ -472,8 +471,6 @@ public abstract class BaseJpaR4Test extends BaseJpaTest implements ITestDataBuil @Autowired protected ITermValueSetDao myTermValueSetDao; @Autowired - protected ITermValueSetDaoTestUtil myTermValueSetDaoTestUtil; - @Autowired protected ITermValueSetConceptDao myTermValueSetConceptDao; @Autowired protected ITermValueSetConceptDesignationDao myTermValueSetConceptDesignationDao; @@ -836,7 +833,7 @@ public abstract class BaseJpaR4Test extends BaseJpaTest implements ITestDataBuil public List<String> getExpandedConceptsByValueSetUrl(String theValuesetUrl) { return runInTransaction(() -> { - List<TermValueSet> valueSets = myTermValueSetDaoTestUtil.findTermValueSetByUrl(Pageable.unpaged(), theValuesetUrl); + List<TermValueSet> valueSets = myTermValueSetDao.findTermValueSetByUrl(Pageable.unpaged(), theValuesetUrl); assertEquals(1, valueSets.size()); TermValueSet valueSet = valueSets.get(0); List<TermValueSetConcept> concepts = valueSet.getConcepts(); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValueSetMultiVersionTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValueSetMultiVersionTest.java index 612ba35d8be..82face9d5ad 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValueSetMultiVersionTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValueSetMultiVersionTest.java @@ -83,7 +83,7 @@ public class FhirResourceDaoR4ValueSetMultiVersionTest extends BaseJpaR4Test { public void testCreateVersionedValueSets() { Map<ValueSetVersions, DaoMethodOutcome> myValueSets = createVersionedValueSets(); - assertEquals(3, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(3, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); Optional<TermValueSet> optionalTermValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET); assertTrue(optionalTermValueSet.isPresent()); @@ -115,7 +115,7 @@ public class FhirResourceDaoR4ValueSetMultiVersionTest extends BaseJpaR4Test { public void testUpdateVersionedValueSets() { Map<ValueSetVersions, DaoMethodOutcome> myValueSets = createVersionedValueSets(); - assertEquals(3, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(3, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); TermValueSet termValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET).orElseThrow(() -> new IllegalArgumentException("No TerValueSet found for " + URL_MY_VALUE_SET + " with null version")); assertEquals("ValueSet_noVersion", termValueSet.getName()); @@ -143,7 +143,7 @@ public class FhirResourceDaoR4ValueSetMultiVersionTest extends BaseJpaR4Test { Long v2Version_resid = ((ResourceTable)v2Version_update_outcome.getEntity()).getId(); // Verify that ValueSets were updated. - assertEquals(3, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(3, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); termValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET).orElseThrow(() -> new IllegalArgumentException("No TerValueSet found for " + URL_MY_VALUE_SET + " with null version")); assertNotNull(nullVersion_resid); @@ -169,7 +169,7 @@ public class FhirResourceDaoR4ValueSetMultiVersionTest extends BaseJpaR4Test { public void testDeleteVersionedValueSets() { Map<ValueSetVersions, DaoMethodOutcome> myValueSets = createVersionedValueSets(); - assertEquals(3, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(3, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); TermValueSet termValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET).orElseThrow(() -> new IllegalArgumentException("No TerValueSet found for " + URL_MY_VALUE_SET + " with null version")); assertEquals("ValueSet_noVersion", termValueSet.getName()); @@ -182,7 +182,7 @@ public class FhirResourceDaoR4ValueSetMultiVersionTest extends BaseJpaR4Test { // Delete ValueSets myValueSetDao.delete(myValueSets.get(ValueSetVersions.NULL).getResource().getIdElement()); - assertEquals(2, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(2, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); Optional<TermValueSet> optionalTermValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET); if (optionalTermValueSet.isPresent()) { fail(); @@ -191,7 +191,7 @@ public class FhirResourceDaoR4ValueSetMultiVersionTest extends BaseJpaR4Test { assertNotNull(myTermValueSetDao.findTermValueSetByUrlAndVersion(URL_MY_VALUE_SET, "v2").orElseThrow(() -> new IllegalArgumentException("No TerValueSet found for " + URL_MY_VALUE_SET + " version v2"))); myValueSetDao.delete(myValueSets.get(ValueSetVersions.V1).getResource().getIdElement()); - assertEquals(1, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(1, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); optionalTermValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET); if (optionalTermValueSet.isPresent()) { fail(); @@ -203,7 +203,7 @@ public class FhirResourceDaoR4ValueSetMultiVersionTest extends BaseJpaR4Test { assertNotNull(myTermValueSetDao.findTermValueSetByUrlAndVersion(URL_MY_VALUE_SET, "v2").orElseThrow(() -> new IllegalArgumentException("No TerValueSet found for " + URL_MY_VALUE_SET + " version v2"))); myValueSetDao.delete(myValueSets.get(ValueSetVersions.V2).getResource().getIdElement()); - assertEquals(0, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(0, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); optionalTermValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET); if (optionalTermValueSet.isPresent()) { fail(); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r5/BaseJpaR5Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r5/BaseJpaR5Test.java index cafcb1ef39d..0ab9e18c19c 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r5/BaseJpaR5Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r5/BaseJpaR5Test.java @@ -44,7 +44,6 @@ import ca.uhn.fhir.jpa.dao.data.ITermConceptParentChildLinkDao; import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDao; import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDesignationDao; import ca.uhn.fhir.jpa.dao.data.ITermValueSetDao; -import ca.uhn.fhir.jpa.dao.data.ITermValueSetDaoTestUtil; import ca.uhn.fhir.jpa.dao.dstu2.FhirResourceDaoDstu2SearchNoFtTest; import ca.uhn.fhir.jpa.entity.TermValueSet; import ca.uhn.fhir.jpa.entity.TermValueSetConcept; @@ -392,8 +391,6 @@ public abstract class BaseJpaR5Test extends BaseJpaTest implements ITestDataBuil @Autowired protected ITermValueSetDao myTermValueSetDao; @Autowired - protected ITermValueSetDaoTestUtil myTermValueSetDaoTestUtil; - @Autowired protected ITermValueSetConceptDao myTermValueSetConceptDao; @Autowired protected ITermValueSetConceptDesignationDao myTermValueSetConceptDesignationDao; diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r5/FhirResourceDaoR5ValueSetMultiVersionTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r5/FhirResourceDaoR5ValueSetMultiVersionTest.java index a3372dcf5b1..d19800e7c7a 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r5/FhirResourceDaoR5ValueSetMultiVersionTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r5/FhirResourceDaoR5ValueSetMultiVersionTest.java @@ -82,7 +82,7 @@ public class FhirResourceDaoR5ValueSetMultiVersionTest extends BaseJpaR5Test { public void testCreateVersionedValueSets() { Map<ValueSetVersions, DaoMethodOutcome> myValueSets = createVersionedValueSets(); - assertEquals(3, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(3, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); Optional<TermValueSet> optionalTermValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET); assertTrue(optionalTermValueSet.isPresent()); @@ -114,7 +114,7 @@ public class FhirResourceDaoR5ValueSetMultiVersionTest extends BaseJpaR5Test { public void testUpdateVersionedValueSets() { Map<ValueSetVersions, DaoMethodOutcome> myValueSets = createVersionedValueSets(); - assertEquals(3, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(3, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); TermValueSet termValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET).orElseThrow(() -> new IllegalArgumentException("No TerValueSet found for " + URL_MY_VALUE_SET + " with null version")); assertEquals("ValueSet_noVersion", termValueSet.getName()); @@ -142,7 +142,7 @@ public class FhirResourceDaoR5ValueSetMultiVersionTest extends BaseJpaR5Test { Long v2Version_resid = ((ResourceTable)v2Version_update_outcome.getEntity()).getId(); // Verify that ValueSets were updated. - assertEquals(3, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(3, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); termValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET).orElseThrow(() -> new IllegalArgumentException("No TerValueSet found for " + URL_MY_VALUE_SET + " with null version")); assertNotNull(nullVersion_resid); @@ -168,7 +168,7 @@ public class FhirResourceDaoR5ValueSetMultiVersionTest extends BaseJpaR5Test { public void testDeleteVersionedValueSets() { Map<ValueSetVersions, DaoMethodOutcome> myValueSets = createVersionedValueSets(); - assertEquals(3, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(3, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); TermValueSet termValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET).orElseThrow(() -> new IllegalArgumentException("No TerValueSet found for " + URL_MY_VALUE_SET + " with null version")); assertEquals("ValueSet_noVersion", termValueSet.getName()); @@ -181,7 +181,7 @@ public class FhirResourceDaoR5ValueSetMultiVersionTest extends BaseJpaR5Test { // Delete ValueSets myValueSetDao.delete(myValueSets.get(ValueSetVersions.NULL).getResource().getIdElement()); - assertEquals(2, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(2, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); Optional<TermValueSet> optionalTermValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET); if (optionalTermValueSet.isPresent()) { fail(); @@ -190,7 +190,7 @@ public class FhirResourceDaoR5ValueSetMultiVersionTest extends BaseJpaR5Test { assertNotNull(myTermValueSetDao.findTermValueSetByUrlAndVersion(URL_MY_VALUE_SET, "v2").orElseThrow(() -> new IllegalArgumentException("No TerValueSet found for " + URL_MY_VALUE_SET + " version v2"))); myValueSetDao.delete(myValueSets.get(ValueSetVersions.V1).getResource().getIdElement()); - assertEquals(1, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(1, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); optionalTermValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET); if (optionalTermValueSet.isPresent()) { fail(); @@ -202,7 +202,7 @@ public class FhirResourceDaoR5ValueSetMultiVersionTest extends BaseJpaR5Test { assertNotNull(myTermValueSetDao.findTermValueSetByUrlAndVersion(URL_MY_VALUE_SET, "v2").orElseThrow(() -> new IllegalArgumentException("No TerValueSet found for " + URL_MY_VALUE_SET + " version v2"))); myValueSetDao.delete(myValueSets.get(ValueSetVersions.V2).getResource().getIdElement()); - assertEquals(0, myTermValueSetDaoTestUtil.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); + assertEquals(0, myTermValueSetDao.findTermValueSetByUrl(PageRequest.of(0, 10), URL_MY_VALUE_SET).size()); optionalTermValueSet = myTermValueSetDao.findTermValueSetByUrlAndNullVersion(URL_MY_VALUE_SET); if (optionalTermValueSet.isPresent()) { fail(); From 3d5c863276375a1ccdf83bc52242c4ee29982d29 Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" <juan.marchionatto@smilecdr.com> Date: Mon, 20 Sep 2021 17:18:45 -0400 Subject: [PATCH 17/31] Revert creation of test utility class finally not needed --- .../dao/data/ITermValueSetDaoTestUtil.java | 41 ------------------- .../jpa/term/ValueSetExpansionR4Test.java | 2 +- 2 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetDaoTestUtil.java diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetDaoTestUtil.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetDaoTestUtil.java deleted file mode 100644 index 91c361217f3..00000000000 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetDaoTestUtil.java +++ /dev/null @@ -1,41 +0,0 @@ -package ca.uhn.fhir.jpa.dao.data; - -/* - * #%L - * HAPI FHIR JPA Server - * %% - * Copyright (C) 2014 - 2021 Smile CDR, Inc. - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - -import ca.uhn.fhir.jpa.entity.TermValueSet; -import org.springframework.data.domain.Pageable; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; - -import java.util.List; - -/** - * Class includes a method which we wanted removed from DAO in production code, - * but was heavily used in tests, where it is OK as they test limited use cases. - */ -public interface ITermValueSetDaoTestUtil extends JpaRepository<TermValueSet, Long> { - - // todo: JM can this be just replaced by new class method? - @Query(value="SELECT vs FROM TermValueSet vs INNER JOIN ResourceTable r ON r.myId = vs.myResourcePid WHERE vs.myUrl = :url ORDER BY r.myUpdated DESC") - List<TermValueSet> findTermValueSetByUrl(Pageable thePage, @Param("url") String theUrl); - -} diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/ValueSetExpansionR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/ValueSetExpansionR4Test.java index cc2c8790d3c..a9062d7dcd5 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/ValueSetExpansionR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/ValueSetExpansionR4Test.java @@ -408,7 +408,7 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test { // Confirm we pre-expanded successfully runInTransaction(() -> { Pageable page = Pageable.unpaged(); - List<TermValueSet> valueSets = myTermValueSetDaoTestUtil.findTermValueSetByUrl(page, "http://foo/vs"); + List<TermValueSet> valueSets = myTermValueSetDao.findTermValueSetByUrl(page, "http://foo/vs"); assertEquals(1, valueSets.size()); assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, valueSets.get(0).getExpansionStatus()); }); From 371484a4eaf294e3c98787bf339a2561e4510ab5 Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" <juan.marchionatto@smilecdr.com> Date: Mon, 20 Sep 2021 17:19:31 -0400 Subject: [PATCH 18/31] Fix test to add now required id to loinc CodeSystem creation --- .../fhir/jpa/dao/r4/FhirResourceDaoR4ValidateTest.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValidateTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValidateTest.java index 459e8f6af85..351b384c5eb 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValidateTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValidateTest.java @@ -568,7 +568,8 @@ public class FhirResourceDaoR4ValidateTest extends BaseJpaR4Test { CodeSystem cs = new CodeSystem(); cs.setContent(CodeSystem.CodeSystemContentMode.COMPLETE); cs.setUrl("http://loinc.org"); - cs.addConcept().setCode("123-4").setDisplay("Code 123 4").setId("loinc"); + cs.addConcept().setCode("123-4").setDisplay("Code 123 4"); + cs.setId("loinc"); myCodeSystemDao.update(cs); Group group = new Group(); @@ -629,7 +630,7 @@ public class FhirResourceDaoR4ValidateTest extends BaseJpaR4Test { ValueSet vs = new ValueSet(); vs.setUrl("http://example.com/fhir/ValueSet/observation-vitalsignresult"); - vs.getCompose().addInclude().setSystem("http://loinc.org").setId("loinc"); + vs.getCompose().addInclude().setSystem("http://loinc.org"); myValueSetDao.create(vs); CodeSystem cs = new CodeSystem(); @@ -938,7 +939,6 @@ public class FhirResourceDaoR4ValidateTest extends BaseJpaR4Test { // Valid code obs.getText().setStatus(Narrative.NarrativeStatus.GENERATED); obs.getCode().getCodingFirstRep().setSystem("http://loinc.org").setCode("CODE3").setDisplay("Display 3"); - obs.getCode().getCodingFirstRep().setId("loinc"); oo = validateAndReturnOutcome(obs); assertEquals("No issues detected during validation", oo.getIssueFirstRep().getDiagnostics(), encode(oo)); @@ -1713,7 +1713,8 @@ public class FhirResourceDaoR4ValidateTest extends BaseJpaR4Test { cs.setUrl(ITermLoaderSvc.LOINC_URI); cs.setContent(CodeSystem.CodeSystemContentMode.COMPLETE); cs.addConcept().setCode("10013-1"); - myCodeSystemDao.create(cs); + cs.setId("loinc"); + myCodeSystemDao.update(cs); IValidationSupport.CodeValidationResult result = myValueSetDao.validateCode(new UriType("http://fooVs"), null, new StringType("10013-1"), new StringType(ITermLoaderSvc.LOINC_URI), null, null, null, mySrd); From ad5297b714a0b79e3f393252fd5dd6a8c68c5d5e Mon Sep 17 00:00:00 2001 From: Justin Dar <justin.dar@smilecdr.com> Date: Tue, 21 Sep 2021 13:09:08 -0700 Subject: [PATCH 19/31] fix for issue #3014 --- .../fhir/jpa/dao/BaseHapiFhirResourceDao.java | 8 ++++--- .../jpa/dao/expunge/DeleteExpungeDaoTest.java | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java index 2afd65245eb..54264fc136c 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java @@ -86,6 +86,7 @@ import ca.uhn.fhir.rest.server.IRestfulServerDefaults; import ca.uhn.fhir.rest.server.RestfulServerUtils; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.exceptions.MethodNotAllowedException; +import ca.uhn.fhir.rest.server.exceptions.NotImplementedOperationException; import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException; @@ -136,12 +137,9 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Date; -import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.UUID; @@ -588,6 +586,10 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B throw new MethodNotAllowedException("_expunge is not enabled on this server: " + getConfig().cannotDeleteExpungeReason()); } + if (theUrl.contains("_cascade")) { + throw new NotImplementedOperationException("_expunge cannot be used with _cascade"); + } + List<String> urlsToDeleteExpunge = Collections.singletonList(theUrl); try { JobExecution jobExecution = myDeleteExpungeJobSubmitter.submitJob(getConfig().getExpungeBatchSize(), urlsToDeleteExpunge, theRequest); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/expunge/DeleteExpungeDaoTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/expunge/DeleteExpungeDaoTest.java index c4b430c4e57..306f1f14e50 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/expunge/DeleteExpungeDaoTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/expunge/DeleteExpungeDaoTest.java @@ -7,6 +7,8 @@ import ca.uhn.fhir.jpa.batch.writer.SqlExecutorWriter; import ca.uhn.fhir.jpa.dao.r4.BaseJpaR4Test; import ca.uhn.fhir.jpa.model.util.JpaConstants; import ca.uhn.fhir.jpa.partition.SystemRequestDetails; +import ca.uhn.fhir.rest.api.Constants; +import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; import ca.uhn.fhir.test.utilities.BatchJobHelper; import ca.uhn.fhir.util.BundleBuilder; import org.hl7.fhir.instance.model.api.IIdType; @@ -27,6 +29,7 @@ import java.util.List; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; class DeleteExpungeDaoTest extends BaseJpaR4Test { @Autowired @@ -51,6 +54,25 @@ class DeleteExpungeDaoTest extends BaseJpaR4Test { myDaoConfig.setExpungeBatchSize(defaultDaoConfig.getExpungeBatchSize()); } + @Test + public void testDeleteCascadeExpungeReturns501() { + // Create new organization + Organization organization = new Organization(); + organization.setName("FOO"); + IIdType organizationId = myOrganizationDao.create(organization).getId().toUnqualifiedVersionless(); + + Patient patient = new Patient(); + patient.setManagingOrganization(new Reference(organizationId)); + IIdType patientId = myPatientDao.create(patient).getId().toUnqualifiedVersionless(); + + // Try to delete _cascade and _expunge on the organization + BaseServerResponseException e = assertThrows(BaseServerResponseException.class, () -> {myOrganizationDao + .deleteByUrl("Organization?" + "_cascade=true&" + JpaConstants.PARAM_DELETE_EXPUNGE + "=true", mySrd);}); + + // Get not implemented HTTP 501 error + assertEquals(Constants.STATUS_HTTP_501_NOT_IMPLEMENTED, e.getStatusCode()); + } + @Test public void testDeleteExpungeThrowExceptionIfForeignKeyLinksExists() { // setup From 81a4f0c78f34c9bfd71fdbdea366510ddcd9c93a Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" <juan.marchionatto@smilecdr.com> Date: Wed, 22 Sep 2021 09:40:25 -0400 Subject: [PATCH 20/31] Rename method for clarity. Increase test coverage. --- ...JpaPersistedResourceValidationSupport.java | 2 +- .../fhir/jpa/term/BaseTermReadSvcImpl.java | 2 +- .../uhn/fhir/jpa/term/api/ITermReadSvc.java | 2 +- ...ersistedResourceValidationSupportTest.java | 135 +++++++++++ .../jpa/term/TermVersionAdapterSvcR4Test.java | 77 +++++++ .../fhir/jpa/term/api/ITermReadSvcTest.java | 218 ++++++++++++++++++ 6 files changed, 433 insertions(+), 3 deletions(-) create mode 100644 hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupportTest.java create mode 100644 hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4Test.java create mode 100644 hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/api/ITermReadSvcTest.java diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java index f6234960c7f..d755a9cb9ba 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java @@ -125,7 +125,7 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport private Optional<IBaseResource> getCodeSystemCurrentVersion(UriType theUrl) { if (! theUrl.getValueAsString().contains("loinc")) return Optional.empty(); - return myTermReadSvc.readByForcedId("loinc"); + return myTermReadSvc.readCodeSystemByForcedId("loinc"); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java index cd15e180327..e403fe0717c 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java @@ -2558,7 +2558,7 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { @Override - public Optional<IBaseResource> readByForcedId(String theForcedId) { + public Optional<IBaseResource> readCodeSystemByForcedId(String theForcedId) { @SuppressWarnings("unchecked") List<ResourceTable> resultList = (List<ResourceTable>) myEntityManager.createQuery( "select f.myResource from ForcedId f " + diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java index fe6adeffee9..c619deb8f0e 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java @@ -136,6 +136,6 @@ public interface ITermReadSvc extends IValidationSupport { */ boolean isLoincNotGenericUnversionedValueSet(String theUrl); - Optional<IBaseResource> readByForcedId(String theForcedId); + Optional<IBaseResource> readCodeSystemByForcedId(String theForcedId); } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupportTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupportTest.java new file mode 100644 index 00000000000..20250d77327 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupportTest.java @@ -0,0 +1,135 @@ +package ca.uhn.fhir.jpa.dao; + +/*- + * #%L + * HAPI FHIR JPA Server + * %% + * Copyright (C) 2014 - 2021 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.context.support.IValidationSupport; +import ca.uhn.fhir.jpa.api.dao.DaoRegistry; +import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; +import ca.uhn.fhir.jpa.term.api.ITermReadSvc; +import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; +import com.github.benmanes.caffeine.cache.Cache; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.r4.model.CodeSystem; +import org.hl7.fhir.r4.model.ValueSet; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.test.util.ReflectionTestUtils; + +import java.util.function.Function; + +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@ExtendWith(MockitoExtension.class) +class JpaPersistedResourceValidationSupportTest { + + private FhirContext theFhirContext = FhirContext.forR4(); + + @Mock private ITermReadSvc myTermReadSvc; + @Mock private DaoRegistry myDaoRegistry; + @Mock private Cache<String, IBaseResource> myLoadCache; + @Mock private IFhirResourceDao<ValueSet> myValueSetResourceDao; + + + private IValidationSupport testedClass = + new JpaPersistedResourceValidationSupport(theFhirContext); + + private Class<? extends IBaseResource> myCodeSystemType = CodeSystem.class; + private Class<? extends IBaseResource> myValueSetType = ValueSet.class; + + + @BeforeEach + public void setup() { + ReflectionTestUtils.setField(testedClass, "myTermReadSvc", myTermReadSvc); + ReflectionTestUtils.setField(testedClass, "myDaoRegistry", myDaoRegistry); + ReflectionTestUtils.setField(testedClass, "myLoadCache", myLoadCache); + ReflectionTestUtils.setField(testedClass, "myCodeSystemType", myCodeSystemType); + ReflectionTestUtils.setField(testedClass, "myValueSetType", myValueSetType); + } + + + @Nested + public class FetchCodeSystemTests { + + @Test + void fetchCodeSystemMustUseForcedId() { + when(myTermReadSvc.isLoincNotGenericUnversionedCodeSystem(anyString())).thenReturn(true); + + testedClass.fetchCodeSystem("string-containing-loinc"); + + verify(myTermReadSvc, times(1)).readCodeSystemByForcedId("loinc"); + verify(myLoadCache, never()).get(anyString(), isA(Function.class)); + } + + + @Test + void fetchCodeSystemMustNotUseForcedId() { + when(myTermReadSvc.isLoincNotGenericUnversionedCodeSystem(anyString())).thenReturn(false); + + testedClass.fetchCodeSystem("string-not-containing-l-o-i-n-c"); + + verify(myTermReadSvc, never()).readCodeSystemByForcedId("loinc"); + verify(myLoadCache, times(1)).get(anyString(), isA(Function.class)); + } + + } + + + @Nested + public class FetchValueSetTests { + + @Test + void fetchValueSetMustUseForcedId() { + when(myTermReadSvc.isLoincNotGenericUnversionedValueSet(anyString())).thenReturn(true); + when(myDaoRegistry.getResourceDao(ValueSet.class)).thenReturn(myValueSetResourceDao); + + ResourceNotFoundException thrown = assertThrows( + ResourceNotFoundException.class, + () -> testedClass.fetchValueSet("string-containing-loinc")); + + assertTrue(thrown.getMessage().contains("Couldn't find current version ValueSet for url")); + } + + + @Test + void fetchValueSetMustNotUseForcedId() { + when(myTermReadSvc.isLoincNotGenericUnversionedValueSet(anyString())).thenReturn(false); + + testedClass.fetchValueSet("string-not-containing-l-o-i-n-c"); + + verify(myLoadCache, times(1)).get(anyString(), isA(Function.class)); + } + + } + + +} diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4Test.java new file mode 100644 index 00000000000..f942f1df0a2 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4Test.java @@ -0,0 +1,77 @@ +package ca.uhn.fhir.jpa.term; + +/*- + * #%L + * HAPI FHIR JPA Server + * %% + * Copyright (C) 2014 - 2021 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; +import ca.uhn.fhir.jpa.api.model.DaoMethodOutcome; +import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; +import org.hl7.fhir.r4.model.CodeSystem; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.test.util.ReflectionTestUtils; + +import java.security.InvalidParameterException; + +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + + +@ExtendWith(MockitoExtension.class) +class TermVersionAdapterSvcR4Test { + + private final TermVersionAdapterSvcR4 testedClass = new TermVersionAdapterSvcR4(); + + @Mock private IFhirResourceDao<CodeSystem> myCodeSystemResourceDao; + @Mock ServletRequestDetails theRequestDetails; + @Mock DaoMethodOutcome theDaoMethodOutcome; + + @Test + void createOrUpdateCodeSystemMustHaveId() { + org.hl7.fhir.r4.model.CodeSystem codeSystem = new CodeSystem(); + codeSystem.setUrl("a-loinc-system"); + + InvalidParameterException thrown = assertThrows( + InvalidParameterException.class, + () -> testedClass.createOrUpdateCodeSystem(codeSystem, new ServletRequestDetails())); + + assertTrue(thrown.getMessage().contains("LOINC CodeSystem must have an 'ID' element")); + } + + + @Test + void createOrUpdateCodeSystemWithIdNoException() { + ReflectionTestUtils.setField(testedClass, "myCodeSystemResourceDao", myCodeSystemResourceDao); + + org.hl7.fhir.r4.model.CodeSystem codeSystem = new CodeSystem(); + codeSystem.setUrl("a-loinc-system").setId("loinc"); + + when(myCodeSystemResourceDao.update(codeSystem, theRequestDetails)).thenReturn(theDaoMethodOutcome); + + testedClass.createOrUpdateCodeSystem(codeSystem, theRequestDetails); + + verify(myCodeSystemResourceDao, Mockito.times(1)).update(codeSystem, theRequestDetails); + } +} diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/api/ITermReadSvcTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/api/ITermReadSvcTest.java new file mode 100644 index 00000000000..d47e53736ec --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/api/ITermReadSvcTest.java @@ -0,0 +1,218 @@ +package ca.uhn.fhir.jpa.term.api; + +import ca.uhn.fhir.jpa.api.dao.DaoRegistry; +import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; +import ca.uhn.fhir.jpa.dao.data.ITermValueSetDao; +import ca.uhn.fhir.jpa.model.entity.ResourceTable; +import ca.uhn.fhir.jpa.term.TermReadSvcR4; +import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import com.google.common.collect.Lists; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.r4.model.CodeSystem; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Answers; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.data.domain.Pageable; +import org.springframework.test.util.ReflectionTestUtils; + +import javax.persistence.EntityManager; +import javax.persistence.NonUniqueResultException; +import java.util.Collections; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@ExtendWith(MockitoExtension.class) +class ITermReadSvcTest { + + private final ITermReadSvc testedClass = new TermReadSvcR4(); + + @Mock private ITermValueSetDao myTermValueSetDao; + @Mock private DaoRegistry myDaoRegistry; + @Mock private IFhirResourceDao<CodeSystem> myFhirResourceDao; + + + @Nested + public class FindCurrentTermValueSet { + + @BeforeEach + public void setup() { + ReflectionTestUtils.setField(testedClass, "myTermValueSetDao", myTermValueSetDao); + } + + @Test + void forLoinc() { + String valueSetId = "a-loinc-value-set"; + testedClass.findCurrentTermValueSet("http://loinc.org/vs/" + valueSetId); + + verify(myTermValueSetDao, times(1)).findTermValueSetByForcedId(valueSetId); + verify(myTermValueSetDao, never()).findTermValueSetByUrl(isA(Pageable.class), anyString()); + } + + @Test + void forNotLoinc() { + String valueSetId = "not-a-loin-c-value-set"; + testedClass.findCurrentTermValueSet("http://not-loin-c.org/vs/" + valueSetId); + + verify(myTermValueSetDao, never()).findTermValueSetByForcedId(valueSetId); + verify(myTermValueSetDao, times(1)).findTermValueSetByUrl(isA(Pageable.class), anyString()); + } + } + + + @Nested + public class MustReturnEmptyValueSet { + + @Test + void doesntStartWithGenericVSReturnsTrue() { + boolean ret = testedClass.mustReturnEmptyValueSet("http://boing.org"); + assertTrue(ret); + } + + @Test + void doesntStartWithGenericVSPlusSlashThrows() { + InternalErrorException thrown = assertThrows( + InternalErrorException.class, + () -> testedClass.mustReturnEmptyValueSet("http://loinc.org/vs-no-slash-after-vs")); + + assertTrue(thrown.getMessage().contains("Don't know how to extract ForcedId from url:")); + } + + @Test + void blankVsIdReturnsTrue() { + boolean ret = testedClass.mustReturnEmptyValueSet("http://loinc.org/vs/"); + assertTrue(ret); + } + + @Test + void startsWithGenericPlusSlashPlusIdReturnsFalse() { + boolean ret = testedClass.mustReturnEmptyValueSet("http://loinc.org/vs/some-vs-id"); + assertFalse(ret); + } + + } + + + @Nested + public class IsLoincNotGenericUnversionedCodeSystem { + + @Test + void doesntContainLoincReturnsFalse() { + boolean ret = testedClass.isLoincNotGenericUnversionedCodeSystem("http://boing.org"); + assertFalse(ret); + } + + @Test + void hasVersionReturnsFalse() { + boolean ret = testedClass.isLoincNotGenericUnversionedCodeSystem("http://boing.org|v2.68"); + assertFalse(ret); + } + + @Test + void containsLoincAndNoVersionReturnsTrue() { + boolean ret = testedClass.isLoincNotGenericUnversionedCodeSystem("http://anything-plus-loinc.org"); + assertTrue(ret); + } + } + + @Nested + public class IsLoincNotGenericUnversionedValueSet { + + @Test + void notLoincReturnsFalse() { + boolean ret = testedClass.isLoincNotGenericUnversionedValueSet("http://anything-but-loin-c.org"); + assertFalse(ret); + } + + @Test + void isLoincAndHasVersionReturnsFalse() { + boolean ret = testedClass.isLoincNotGenericUnversionedValueSet("http://loinc.org|v2.67"); + assertFalse(ret); + } + + @Test + void isLoincNoVersionButEqualsGenericValueSetUrlReturnsFalse() { + boolean ret = testedClass.isLoincNotGenericUnversionedValueSet("http://loinc.org/vs"); + assertFalse(ret); + } + + @Test + void isLoincNoVersionStartsWithGenericValueSetPlusSlashPlusIdReturnsTrue() { + boolean ret = testedClass.isLoincNotGenericUnversionedValueSet("http://loinc.org/vs/vs-id"); + assertTrue(ret); + } + + } + + + @Nested + public class ReadByForcedId { + + @Mock(answer = Answers.RETURNS_DEEP_STUBS) + private EntityManager myEntityManager; + + @Mock private ResourceTable resource1; + @Mock private ResourceTable resource2; + @Mock private IBaseResource myCodeSystemResource; + + + @BeforeEach + public void setup() { + ReflectionTestUtils.setField(testedClass, "myEntityManager", myEntityManager); + } + + + @Test + void getNoneReturnsOptionalEmpty() { + when(myEntityManager.createQuery(anyString()).getResultList()) + .thenReturn(Collections.emptyList()); + + Optional<IBaseResource> result = testedClass.readCodeSystemByForcedId("a-cs-id"); + assertFalse(result.isPresent()); + } + + @Test + void getMultipleThrows() { + when(myEntityManager.createQuery(anyString()).getResultList()) + .thenReturn(Lists.newArrayList(resource1, resource2)); + + NonUniqueResultException thrown = assertThrows( + NonUniqueResultException.class, + () -> testedClass.readCodeSystemByForcedId("a-cs-id")); + + assertTrue(thrown.getMessage().contains("More than one CodeSystem is pointed by forcedId:")); + } + + @Test + void getOneConvertToResource() { + ReflectionTestUtils.setField(testedClass, "myDaoRegistry", myDaoRegistry); + + when(myEntityManager.createQuery(anyString()).getResultList()) + .thenReturn(Lists.newArrayList(resource1)); + when(myDaoRegistry.getResourceDao("CodeSystem")).thenReturn(myFhirResourceDao); + when(myFhirResourceDao.toResource(resource1, false)).thenReturn(myCodeSystemResource); + + + testedClass.readCodeSystemByForcedId("a-cs-id"); + + + verify(myFhirResourceDao, times(1)).toResource(any(), eq(false)); + } + + } + +} From c9137075990ef2f7b312ab117cedcabf7da7ab14 Mon Sep 17 00:00:00 2001 From: Jimmy Deng <jimmy@smilecdr.com> Date: Wed, 22 Sep 2021 10:15:22 -0400 Subject: [PATCH 21/31] added header check --- .../java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java | 2 +- .../ca/uhn/fhir/jpa/dao/expunge/DeleteExpungeDaoTest.java | 3 ++- .../main/java/ca/uhn/fhir/jpa/model/util/JpaConstants.java | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java index 54264fc136c..c1605a90183 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java @@ -586,7 +586,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B throw new MethodNotAllowedException("_expunge is not enabled on this server: " + getConfig().cannotDeleteExpungeReason()); } - if (theUrl.contains("_cascade")) { + if (theUrl.contains(JpaConstants.PARAM_DELETE_CASACADE) || theRequest.getHeader("X-Cascade").equals("delete")) { throw new NotImplementedOperationException("_expunge cannot be used with _cascade"); } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/expunge/DeleteExpungeDaoTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/expunge/DeleteExpungeDaoTest.java index 306f1f14e50..fd1fa912677 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/expunge/DeleteExpungeDaoTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/expunge/DeleteExpungeDaoTest.java @@ -67,10 +67,11 @@ class DeleteExpungeDaoTest extends BaseJpaR4Test { // Try to delete _cascade and _expunge on the organization BaseServerResponseException e = assertThrows(BaseServerResponseException.class, () -> {myOrganizationDao - .deleteByUrl("Organization?" + "_cascade=true&" + JpaConstants.PARAM_DELETE_EXPUNGE + "=true", mySrd);}); + .deleteByUrl("Organization?" + "_cascade=delete&" + JpaConstants.PARAM_DELETE_EXPUNGE + "=true", mySrd);}); // Get not implemented HTTP 501 error assertEquals(Constants.STATUS_HTTP_501_NOT_IMPLEMENTED, e.getStatusCode()); + assertEquals("_expunge cannot be used with _cascade", e.getMessage()); } @Test diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/util/JpaConstants.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/util/JpaConstants.java index 823c3a42cd3..c3a1f35722e 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/util/JpaConstants.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/util/JpaConstants.java @@ -200,6 +200,12 @@ public class JpaConstants { public static final String PARAM_DELETE_EXPUNGE = "_expunge"; + /** + * Parameter for delete to indicate the resource should be cascading delete + */ + + public static final String PARAM_DELETE_CASACADE = "_cascade"; + /** * URL for extension on a SearchParameter indicating that text values should not be indexed */ From 48f73fa1d184de3f3d3bf3533fe4367051aaa62b Mon Sep 17 00:00:00 2001 From: Jimmy Deng <jimmy@smilecdr.com> Date: Wed, 22 Sep 2021 10:25:57 -0400 Subject: [PATCH 22/31] typo --- .../main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java | 2 +- .../src/main/java/ca/uhn/fhir/jpa/model/util/JpaConstants.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java index c1605a90183..16ff7b45fb6 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java @@ -586,7 +586,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B throw new MethodNotAllowedException("_expunge is not enabled on this server: " + getConfig().cannotDeleteExpungeReason()); } - if (theUrl.contains(JpaConstants.PARAM_DELETE_CASACADE) || theRequest.getHeader("X-Cascade").equals("delete")) { + if (theUrl.contains(JpaConstants.PARAM_DELETE_CASCADE) || theRequest.getHeader("X-Cascade").equals("delete")) { throw new NotImplementedOperationException("_expunge cannot be used with _cascade"); } diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/util/JpaConstants.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/util/JpaConstants.java index c3a1f35722e..845c6d0d8c1 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/util/JpaConstants.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/util/JpaConstants.java @@ -204,7 +204,7 @@ public class JpaConstants { * Parameter for delete to indicate the resource should be cascading delete */ - public static final String PARAM_DELETE_CASACADE = "_cascade"; + public static final String PARAM_DELETE_CASCADE = "_cascade"; /** * URL for extension on a SearchParameter indicating that text values should not be indexed From 9a18422173e796dce0355cba69de656d17922961 Mon Sep 17 00:00:00 2001 From: Jimmy Deng <jimmy@smilecdr.com> Date: Wed, 22 Sep 2021 11:09:50 -0400 Subject: [PATCH 23/31] fix review --- .../5_6_0/3014-prevent-delete-expunge-and-cascade.yaml | 0 .../java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java | 3 ++- .../main/java/ca/uhn/fhir/jpa/model/util/JpaConstants.java | 6 ------ 3 files changed, 2 insertions(+), 7 deletions(-) create mode 100644 hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3014-prevent-delete-expunge-and-cascade.yaml diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3014-prevent-delete-expunge-and-cascade.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3014-prevent-delete-expunge-and-cascade.yaml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java index 16ff7b45fb6..3b1b64ba9e8 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java @@ -92,6 +92,7 @@ import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException; import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails; +import ca.uhn.fhir.rest.server.provider.ProviderConstants; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.rest.server.util.CompositeInterceptorBroadcaster; import ca.uhn.fhir.util.ObjectUtil; @@ -586,7 +587,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B throw new MethodNotAllowedException("_expunge is not enabled on this server: " + getConfig().cannotDeleteExpungeReason()); } - if (theUrl.contains(JpaConstants.PARAM_DELETE_CASCADE) || theRequest.getHeader("X-Cascade").equals("delete")) { + if (theUrl.contains(Constants.PARAMETER_CASCADE_DELETE) || theRequest.getHeader(Constants.HEADER_CASCADE).equals(Constants.CASCADE_DELETE)) { throw new NotImplementedOperationException("_expunge cannot be used with _cascade"); } diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/util/JpaConstants.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/util/JpaConstants.java index 845c6d0d8c1..823c3a42cd3 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/util/JpaConstants.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/util/JpaConstants.java @@ -200,12 +200,6 @@ public class JpaConstants { public static final String PARAM_DELETE_EXPUNGE = "_expunge"; - /** - * Parameter for delete to indicate the resource should be cascading delete - */ - - public static final String PARAM_DELETE_CASCADE = "_cascade"; - /** * URL for extension on a SearchParameter indicating that text values should not be indexed */ From 26ac6499460cfc376681eac567bd3b8df24e1d4d Mon Sep 17 00:00:00 2001 From: Jimmy Deng <jimmy@smilecdr.com> Date: Wed, 22 Sep 2021 11:11:10 -0400 Subject: [PATCH 24/31] changelog --- .../5_6_0/3014-prevent-delete-expunge-and-cascade.yaml | 4 ++++ .../java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java | 3 +-- .../ca/uhn/fhir/jpa/dao/expunge/DeleteExpungeDaoTest.java | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3014-prevent-delete-expunge-and-cascade.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3014-prevent-delete-expunge-and-cascade.yaml index e69de29bb2d..4dc59bc95aa 100644 --- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3014-prevent-delete-expunge-and-cascade.yaml +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3014-prevent-delete-expunge-and-cascade.yaml @@ -0,0 +1,4 @@ +--- +type: change +jira: SMILE-3128 +title: "Prevent _expunge and _cascade from being used on the same DELETE operation" diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java index 3b1b64ba9e8..d7bd6077fbf 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java @@ -92,7 +92,6 @@ import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException; import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails; -import ca.uhn.fhir.rest.server.provider.ProviderConstants; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.rest.server.util.CompositeInterceptorBroadcaster; import ca.uhn.fhir.util.ObjectUtil; @@ -588,7 +587,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B } if (theUrl.contains(Constants.PARAMETER_CASCADE_DELETE) || theRequest.getHeader(Constants.HEADER_CASCADE).equals(Constants.CASCADE_DELETE)) { - throw new NotImplementedOperationException("_expunge cannot be used with _cascade"); + throw new InvalidRequestException("_expunge cannot be used with _cascade"); } List<String> urlsToDeleteExpunge = Collections.singletonList(theUrl); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/expunge/DeleteExpungeDaoTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/expunge/DeleteExpungeDaoTest.java index fd1fa912677..bb28b8dd050 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/expunge/DeleteExpungeDaoTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/expunge/DeleteExpungeDaoTest.java @@ -55,7 +55,7 @@ class DeleteExpungeDaoTest extends BaseJpaR4Test { } @Test - public void testDeleteCascadeExpungeReturns501() { + public void testDeleteCascadeExpungeReturns400() { // Create new organization Organization organization = new Organization(); organization.setName("FOO"); @@ -69,8 +69,8 @@ class DeleteExpungeDaoTest extends BaseJpaR4Test { BaseServerResponseException e = assertThrows(BaseServerResponseException.class, () -> {myOrganizationDao .deleteByUrl("Organization?" + "_cascade=delete&" + JpaConstants.PARAM_DELETE_EXPUNGE + "=true", mySrd);}); - // Get not implemented HTTP 501 error - assertEquals(Constants.STATUS_HTTP_501_NOT_IMPLEMENTED, e.getStatusCode()); + // Get not implemented HTTP 400 error + assertEquals(Constants.STATUS_HTTP_400_BAD_REQUEST, e.getStatusCode()); assertEquals("_expunge cannot be used with _cascade", e.getMessage()); } From f9796b9e2a88243fb85199bc90483b0dc6091497 Mon Sep 17 00:00:00 2001 From: Jimmy Deng <jimmy@smilecdr.com> Date: Wed, 22 Sep 2021 12:52:28 -0400 Subject: [PATCH 25/31] fix test --- .../main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java index d7bd6077fbf..d43a08cdde1 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java @@ -586,7 +586,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B throw new MethodNotAllowedException("_expunge is not enabled on this server: " + getConfig().cannotDeleteExpungeReason()); } - if (theUrl.contains(Constants.PARAMETER_CASCADE_DELETE) || theRequest.getHeader(Constants.HEADER_CASCADE).equals(Constants.CASCADE_DELETE)) { + if (theUrl.contains(Constants.PARAMETER_CASCADE_DELETE) || (theRequest.getHeader(Constants.HEADER_CASCADE) != null && theRequest.getHeader(Constants.HEADER_CASCADE).equals(Constants.CASCADE_DELETE))) { throw new InvalidRequestException("_expunge cannot be used with _cascade"); } From 2436f748aaae00058a49ed98d4c6587b4e94056a Mon Sep 17 00:00:00 2001 From: Jimmy Deng <jimmy@smilecdr.com> Date: Wed, 22 Sep 2021 14:38:53 -0400 Subject: [PATCH 26/31] fix test --- .../jpa/dao/expunge/DeleteExpungeDaoTest.java | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/expunge/DeleteExpungeDaoTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/expunge/DeleteExpungeDaoTest.java index bb28b8dd050..ba7712066cb 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/expunge/DeleteExpungeDaoTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/expunge/DeleteExpungeDaoTest.java @@ -17,9 +17,11 @@ import org.hl7.fhir.r4.model.OperationOutcome; import org.hl7.fhir.r4.model.Organization; import org.hl7.fhir.r4.model.Patient; import org.hl7.fhir.r4.model.Reference; +import org.hl7.fhir.r5.model.StructureDefinition; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.mockito.stubbing.Answer; import org.springframework.batch.core.BatchStatus; import org.springframework.batch.core.JobExecution; import org.springframework.beans.factory.annotation.Autowired; @@ -30,6 +32,8 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.nullable; +import static org.mockito.Mockito.when; class DeleteExpungeDaoTest extends BaseJpaR4Test { @Autowired @@ -66,14 +70,29 @@ class DeleteExpungeDaoTest extends BaseJpaR4Test { IIdType patientId = myPatientDao.create(patient).getId().toUnqualifiedVersionless(); // Try to delete _cascade and _expunge on the organization - BaseServerResponseException e = assertThrows(BaseServerResponseException.class, () -> {myOrganizationDao - .deleteByUrl("Organization?" + "_cascade=delete&" + JpaConstants.PARAM_DELETE_EXPUNGE + "=true", mySrd);}); + BaseServerResponseException e = assertThrows(BaseServerResponseException.class, () -> { + myOrganizationDao + .deleteByUrl("Organization?" + "_cascade=delete&" + JpaConstants.PARAM_DELETE_EXPUNGE + "=true", mySrd); + }); + + // Get not implemented HTTP 400 error + assertEquals(Constants.STATUS_HTTP_400_BAD_REQUEST, e.getStatusCode()); + assertEquals("_expunge cannot be used with _cascade", e.getMessage()); + + + // Try to delete with header 'X-Cascade' = delete + when(mySrd.getHeader(Constants.HEADER_CASCADE)).thenReturn(Constants.CASCADE_DELETE); + e = assertThrows(BaseServerResponseException.class, () -> { + myOrganizationDao + .deleteByUrl("Organization?" + JpaConstants.PARAM_DELETE_EXPUNGE + "=true", mySrd); + }); // Get not implemented HTTP 400 error assertEquals(Constants.STATUS_HTTP_400_BAD_REQUEST, e.getStatusCode()); assertEquals("_expunge cannot be used with _cascade", e.getMessage()); } + @Test public void testDeleteExpungeThrowExceptionIfForeignKeyLinksExists() { // setup From 751c5d0d057c8b2dcf44dba6617ac88fbf1357d5 Mon Sep 17 00:00:00 2001 From: "juan.marchionatto" <juan.marchionatto@smilecdr.com> Date: Thu, 23 Sep 2021 11:55:50 -0400 Subject: [PATCH 27/31] Implement revision suggestions. Add changelog. --- ...erminology-valueset-parallel-versions.yaml | 4 ++ ...JpaPersistedResourceValidationSupport.java | 19 +++--- .../dao/r4/FhirResourceDaoCodeSystemR4.java | 3 +- .../fhir/jpa/term/BaseTermReadSvcImpl.java | 44 ++----------- .../term/TermCodeSystemStorageSvcImpl.java | 5 +- .../ca/uhn/fhir/jpa/term/TermReadSvcUtil.java | 62 +++++++++++++++++++ .../jpa/term/TermVersionAdapterSvcR4.java | 5 +- .../uhn/fhir/jpa/term/api/ITermReadSvc.java | 12 ---- ...ersistedResourceValidationSupportTest.java | 27 +++----- .../dao/r4/FhirResourceDaoR4ValidateTest.java | 9 +-- .../jpa/term/TermVersionAdapterSvcR4Test.java | 9 +-- .../term/TerminologyLoaderSvcLoincTest.java | 4 +- ...erminologySvcImplCurrentVersionR4Test.java | 3 +- .../jpa/term/TerminologySvcImplDstu3Test.java | 5 +- .../fhir/jpa/term/api/ITermReadSvcTest.java | 45 ++++++++++---- .../support/ValidationConstants.java | 32 ++++++++++ 16 files changed, 179 insertions(+), 109 deletions(-) create mode 100644 hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/2851-updated-terminology-valueset-parallel-versions.yaml create mode 100644 hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermReadSvcUtil.java create mode 100644 hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/support/ValidationConstants.java diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/2851-updated-terminology-valueset-parallel-versions.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/2851-updated-terminology-valueset-parallel-versions.yaml new file mode 100644 index 00000000000..0ed0e3d4237 --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/2851-updated-terminology-valueset-parallel-versions.yaml @@ -0,0 +1,4 @@ +--- +type: add +issue: 2851 +title: "Allows to upload not-current version of LOINC ValueSet(s)." diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java index d755a9cb9ba..bb27591070a 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java @@ -26,6 +26,7 @@ import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.jpa.api.dao.DaoRegistry; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; +import ca.uhn.fhir.jpa.term.TermReadSvcUtil; import ca.uhn.fhir.jpa.term.api.ITermReadSvc; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.api.SortOrderEnum; @@ -62,6 +63,8 @@ import java.util.concurrent.TimeUnit; import java.util.function.Supplier; import static org.apache.commons.lang3.StringUtils.isBlank; +import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_GENERIC_VALUESET_URL_PLUS_SLASH; +import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_LOW; /** * This class is a {@link IValidationSupport Validation support} module that loads @@ -73,10 +76,6 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport private static final Logger ourLog = LoggerFactory.getLogger(JpaPersistedResourceValidationSupport.class); - public static final String LOINC_GENERIC_CODE_SYSTEM_URL = "http://loinc.org"; - public static final String LOINC_GENERIC_VALUESET_URL = LOINC_GENERIC_CODE_SYSTEM_URL + "/vs"; - public static final String LOINC_GENERIC_VALUESET_URL_PLUS_SLASH = LOINC_GENERIC_VALUESET_URL + "/"; - private final FhirContext myFhirContext; private final IBaseResource myNoMatch; @@ -107,7 +106,7 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport @Override public IBaseResource fetchCodeSystem(String theSystem) { - if (myTermReadSvc.isLoincNotGenericUnversionedCodeSystem(theSystem)) { + if (TermReadSvcUtil.isLoincNotGenericUnversionedCodeSystem(theSystem)) { Optional<IBaseResource> currentCSOpt = getCodeSystemCurrentVersion(new UriType(theSystem)); if (! currentCSOpt.isPresent()) { ourLog.info("Couldn't find current version of CodeSystem: " + theSystem); @@ -123,18 +122,18 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport * version is always pointed by the ForcedId for the no-versioned CS */ private Optional<IBaseResource> getCodeSystemCurrentVersion(UriType theUrl) { - if (! theUrl.getValueAsString().contains("loinc")) return Optional.empty(); + if (! theUrl.getValueAsString().contains(LOINC_LOW)) return Optional.empty(); - return myTermReadSvc.readCodeSystemByForcedId("loinc"); + return myTermReadSvc.readCodeSystemByForcedId(LOINC_LOW); } @Override public IBaseResource fetchValueSet(String theSystem) { - if (myTermReadSvc.isLoincNotGenericUnversionedValueSet(theSystem)) { + if (TermReadSvcUtil.isLoincNotGenericUnversionedValueSet(theSystem)) { Optional<IBaseResource> currentVSOpt = getValueSetCurrentVersion(new UriType(theSystem)); return currentVSOpt.orElseThrow(() -> new ResourceNotFoundException( - "Couldn't find current version ValueSet for url: " + theSystem)); + "Unable to find current version of ValueSet for url: " + theSystem)); } return fetchResource(myValueSetType, theSystem); @@ -145,7 +144,7 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport * version is always pointed by the ForcedId for the no-versioned VS */ private Optional<IBaseResource> getValueSetCurrentVersion(UriType theUrl) { - if (myTermReadSvc.mustReturnEmptyValueSet(theUrl.getValueAsString())) return Optional.empty(); + if (TermReadSvcUtil.mustReturnEmptyValueSet(theUrl.getValueAsString())) return Optional.empty(); String forcedId = theUrl.getValue().substring(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH.length()); if (StringUtils.isBlank(forcedId)) return Optional.empty(); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoCodeSystemR4.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoCodeSystemR4.java index 305b8a1c8fb..b639c026754 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoCodeSystemR4.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoCodeSystemR4.java @@ -56,6 +56,7 @@ import java.util.Set; import static ca.uhn.fhir.jpa.dao.FhirResourceDaoValueSetDstu2.toStringOrNull; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; +import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_LOW; public class FhirResourceDaoCodeSystemR4 extends BaseHapiFhirResourceDao<CodeSystem> implements IFhirResourceDaoCodeSystem<CodeSystem, Coding, CodeableConcept> { @@ -181,7 +182,7 @@ public class FhirResourceDaoCodeSystemR4 extends BaseHapiFhirResourceDao<CodeSys public DaoMethodOutcome create(CodeSystem theResource, String theIfNoneExist, boolean thePerformIndexing, @Nonnull TransactionDetails theTransactionDetails, RequestDetails theRequestDetails) { // loinc CodeSystem must have an ID - if (isNotBlank(theResource.getUrl()) && theResource.getUrl().contains("loinc") + if (isNotBlank(theResource.getUrl()) && theResource.getUrl().contains(LOINC_LOW) && isBlank(theResource.getIdElement().getIdPart())) { throw new InvalidParameterException("'loinc' CodeSystem must have an ID"); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java index e403fe0717c..5b185c5726d 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseTermReadSvcImpl.java @@ -173,8 +173,6 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Supplier; import java.util.stream.Collectors; -import static ca.uhn.fhir.jpa.dao.JpaPersistedResourceValidationSupport.LOINC_GENERIC_VALUESET_URL; -import static ca.uhn.fhir.jpa.dao.JpaPersistedResourceValidationSupport.LOINC_GENERIC_VALUESET_URL_PLUS_SLASH; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; import static org.apache.commons.lang3.StringUtils.defaultString; import static org.apache.commons.lang3.StringUtils.isBlank; @@ -183,6 +181,8 @@ import static org.apache.commons.lang3.StringUtils.isNoneBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; import static org.apache.commons.lang3.StringUtils.lowerCase; import static org.apache.commons.lang3.StringUtils.startsWithIgnoreCase; +import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_GENERIC_VALUESET_URL_PLUS_SLASH; +import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_LOW; public abstract class BaseTermReadSvcImpl implements ITermReadSvc { public static final int DEFAULT_FETCH_SIZE = 250; @@ -2342,14 +2342,14 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { /** - * When the search is for no-version loinc system it uses the forcedId to obtain the current + * When the search is for unversioned loinc system it uses the forcedId to obtain the current * version, as it is not necessarily the last one anymore. * For other cases it keeps on considering the last uploaded as the current */ @Override public Optional<TermValueSet> findCurrentTermValueSet(String theUrl) { - if (isLoincNotGenericUnversionedValueSet(theUrl)) { - if (mustReturnEmptyValueSet(theUrl)) return Optional.empty(); + if (TermReadSvcUtil.isLoincNotGenericUnversionedValueSet(theUrl)) { + if (TermReadSvcUtil.mustReturnEmptyValueSet(theUrl)) return Optional.empty(); String forcedId = theUrl.substring(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH.length()); if (StringUtils.isBlank(forcedId)) return Optional.empty(); @@ -2363,38 +2363,6 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { } - @Override - public boolean mustReturnEmptyValueSet(String theUrl) { - if (! theUrl.startsWith(LOINC_GENERIC_VALUESET_URL)) return true; - - if (! theUrl.startsWith(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH)) { - throw new InternalErrorException("Don't know how to extract ForcedId from url: " + theUrl); - } - - String forcedId = theUrl.substring(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH.length()); - return StringUtils.isBlank(forcedId); - } - - - @Override - public boolean isLoincNotGenericUnversionedValueSet(String theUrl) { - boolean isLoincCodeSystem = StringUtils.containsIgnoreCase(theUrl, "loinc"); - boolean isNoVersion = ! theUrl.contains("|"); - boolean isNotLoincGenericValueSet = ! theUrl.equals(LOINC_GENERIC_VALUESET_URL); - - return isLoincCodeSystem && isNoVersion && isNotLoincGenericValueSet; - } - - - @Override - public boolean isLoincNotGenericUnversionedCodeSystem(String theUrl) { - boolean isLoincCodeSystem = StringUtils.containsIgnoreCase(theUrl, "loinc"); - boolean isNoVersion = ! theUrl.contains("|"); - - return isLoincCodeSystem && isNoVersion; - } - - @SuppressWarnings("unchecked") private CodeValidationResult codeSystemValidateCode(String theCodeSystemUrl, String theCodeSystemVersion, String theCode, String theDisplay) { @@ -2426,7 +2394,7 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc { if (isNoneBlank(theCodeSystemVersion)) { predicates.add(criteriaBuilder.equal(systemVersionJoin.get("myCodeSystemVersionId"), theCodeSystemVersion)); } else { - if (theCodeSystemUrl.toLowerCase(Locale.ROOT).contains("loinc")) { + if (theCodeSystemUrl.toLowerCase(Locale.ROOT).contains(LOINC_LOW)) { predicates.add(criteriaBuilder.isNull(systemVersionJoin.get("myCodeSystemVersionId"))); } else { query.orderBy(criteriaBuilder.desc(root.get("myUpdated"))); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java index 525eb9717e7..10b50bccab5 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java @@ -88,6 +88,7 @@ import java.util.stream.Collectors; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; +import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_LOW; public class TermCodeSystemStorageSvcImpl implements ITermCodeSystemStorageSvc { private static final Logger ourLog = LoggerFactory.getLogger(TermCodeSystemStorageSvcImpl.class); @@ -140,8 +141,8 @@ public class TermCodeSystemStorageSvcImpl implements ITermCodeSystemStorageSvc { CodeSystem codeSystemResource = new CodeSystem(); codeSystemResource.setUrl(theSystem); codeSystemResource.setContent(CodeSystem.CodeSystemContentMode.NOTPRESENT); - if (isBlank(codeSystemResource.getIdElement().getIdPart()) && theSystem.contains("loinc")) { - codeSystemResource.setId("loinc"); + if (isBlank(codeSystemResource.getIdElement().getIdPart()) && theSystem.contains(LOINC_LOW)) { + codeSystemResource.setId(LOINC_LOW); } myTerminologyVersionAdapterSvc.createOrUpdateCodeSystem(codeSystemResource); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermReadSvcUtil.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermReadSvcUtil.java new file mode 100644 index 00000000000..d45872a048e --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermReadSvcUtil.java @@ -0,0 +1,62 @@ +package ca.uhn.fhir.jpa.term; + +/*- + * #%L + * HAPI FHIR JPA Server + * %% + * Copyright (C) 2014 - 2021 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import org.apache.commons.lang3.StringUtils; + +import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_GENERIC_VALUESET_URL; +import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_GENERIC_VALUESET_URL_PLUS_SLASH; +import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_LOW; + +public class TermReadSvcUtil { + + public static boolean mustReturnEmptyValueSet(String theUrl) { + if (! theUrl.startsWith(LOINC_GENERIC_VALUESET_URL)) return true; + + if (! theUrl.startsWith(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH)) { + throw new InternalErrorException("Don't know how to extract ValueSet's ForcedId from url: " + theUrl); + } + + String forcedId = theUrl.substring(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH.length()); + return StringUtils.isBlank(forcedId); + } + + + public static boolean isLoincNotGenericUnversionedValueSet(String theUrl) { + boolean isLoincCodeSystem = StringUtils.containsIgnoreCase(theUrl, LOINC_LOW); + boolean isNoVersion = ! theUrl.contains("|"); + boolean isNotLoincGenericValueSet = ! theUrl.equals(LOINC_GENERIC_VALUESET_URL); + + return isLoincCodeSystem && isNoVersion && isNotLoincGenericValueSet; + } + + + public static boolean isLoincNotGenericUnversionedCodeSystem(String theUrl) { + boolean isLoincCodeSystem = StringUtils.containsIgnoreCase(theUrl, LOINC_LOW); + boolean isNoVersion = ! theUrl.contains("|"); + + return isLoincCodeSystem && isNoVersion; + } + + + +} diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4.java index 5326b1b49ac..38fbbd7a6d4 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4.java @@ -36,6 +36,7 @@ import org.springframework.context.event.EventListener; import java.security.InvalidParameterException; import static org.apache.commons.lang3.StringUtils.isBlank; +import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_LOW; public class TermVersionAdapterSvcR4 extends BaseTermVersionAdapterSvcImpl implements ITermVersionAdapterSvc { private IFhirResourceDao<ConceptMap> myConceptMapResourceDao; @@ -65,8 +66,8 @@ public class TermVersionAdapterSvcR4 extends BaseTermVersionAdapterSvcImpl imple public IIdType createOrUpdateCodeSystem(org.hl7.fhir.r4.model.CodeSystem theCodeSystemResource, RequestDetails theRequestDetails) { validateCodeSystemForStorage(theCodeSystemResource); if (isBlank(theCodeSystemResource.getIdElement().getIdPart())) { - if (theCodeSystemResource.getUrl().contains("loinc")) { - throw new InvalidParameterException("LOINC CodeSystem must have an 'ID' element"); + if (theCodeSystemResource.getUrl().contains(LOINC_LOW)) { + throw new InvalidParameterException("'loinc' CodeSystem must have an 'ID' element"); } String matchUrl = "CodeSystem?url=" + UrlUtil.escapeUrlParam(theCodeSystemResource.getUrl()); return myCodeSystemResourceDao.update(theCodeSystemResource, matchUrl, theRequestDetails).getId(); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java index c619deb8f0e..b02ffa30740 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java @@ -124,18 +124,6 @@ public interface ITermReadSvc extends IValidationSupport { /** * Version independent */ - boolean mustReturnEmptyValueSet(String theUrl); - - /** - * Version independent - */ - boolean isLoincNotGenericUnversionedCodeSystem(String theSystem); - - /** - * Version independent - */ - boolean isLoincNotGenericUnversionedValueSet(String theUrl); - Optional<IBaseResource> readCodeSystemByForcedId(String theForcedId); } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupportTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupportTest.java index 20250d77327..8be940c8dae 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupportTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupportTest.java @@ -34,12 +34,14 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.test.util.ReflectionTestUtils; import java.util.function.Function; +import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_LOW; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.anyString; @@ -47,7 +49,6 @@ import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class JpaPersistedResourceValidationSupportTest { @@ -59,7 +60,7 @@ class JpaPersistedResourceValidationSupportTest { @Mock private Cache<String, IBaseResource> myLoadCache; @Mock private IFhirResourceDao<ValueSet> myValueSetResourceDao; - + @InjectMocks private IValidationSupport testedClass = new JpaPersistedResourceValidationSupport(theFhirContext); @@ -69,10 +70,6 @@ class JpaPersistedResourceValidationSupportTest { @BeforeEach public void setup() { - ReflectionTestUtils.setField(testedClass, "myTermReadSvc", myTermReadSvc); - ReflectionTestUtils.setField(testedClass, "myDaoRegistry", myDaoRegistry); - ReflectionTestUtils.setField(testedClass, "myLoadCache", myLoadCache); - ReflectionTestUtils.setField(testedClass, "myCodeSystemType", myCodeSystemType); ReflectionTestUtils.setField(testedClass, "myValueSetType", myValueSetType); } @@ -82,22 +79,18 @@ class JpaPersistedResourceValidationSupportTest { @Test void fetchCodeSystemMustUseForcedId() { - when(myTermReadSvc.isLoincNotGenericUnversionedCodeSystem(anyString())).thenReturn(true); - testedClass.fetchCodeSystem("string-containing-loinc"); - verify(myTermReadSvc, times(1)).readCodeSystemByForcedId("loinc"); + verify(myTermReadSvc, times(1)).readCodeSystemByForcedId(LOINC_LOW); verify(myLoadCache, never()).get(anyString(), isA(Function.class)); } @Test void fetchCodeSystemMustNotUseForcedId() { - when(myTermReadSvc.isLoincNotGenericUnversionedCodeSystem(anyString())).thenReturn(false); - testedClass.fetchCodeSystem("string-not-containing-l-o-i-n-c"); - verify(myTermReadSvc, never()).readCodeSystemByForcedId("loinc"); + verify(myTermReadSvc, never()).readCodeSystemByForcedId(LOINC_LOW); verify(myLoadCache, times(1)).get(anyString(), isA(Function.class)); } @@ -109,21 +102,17 @@ class JpaPersistedResourceValidationSupportTest { @Test void fetchValueSetMustUseForcedId() { - when(myTermReadSvc.isLoincNotGenericUnversionedValueSet(anyString())).thenReturn(true); - when(myDaoRegistry.getResourceDao(ValueSet.class)).thenReturn(myValueSetResourceDao); - + final String valueSetId = "string-containing-loinc"; ResourceNotFoundException thrown = assertThrows( ResourceNotFoundException.class, - () -> testedClass.fetchValueSet("string-containing-loinc")); + () -> testedClass.fetchValueSet(valueSetId)); - assertTrue(thrown.getMessage().contains("Couldn't find current version ValueSet for url")); + assertTrue(thrown.getMessage().contains("Unable to find current version of ValueSet for url: " + valueSetId)); } @Test void fetchValueSetMustNotUseForcedId() { - when(myTermReadSvc.isLoincNotGenericUnversionedValueSet(anyString())).thenReturn(false); - testedClass.fetchValueSet("string-not-containing-l-o-i-n-c"); verify(myLoadCache, times(1)).get(anyString(), isA(Function.class)); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValidateTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValidateTest.java index 351b384c5eb..ae1488533af 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValidateTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ValidateTest.java @@ -81,6 +81,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.not; +import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_LOW; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.fail; @@ -501,7 +502,7 @@ public class FhirResourceDaoR4ValidateTest extends BaseJpaR4Test { cs.setContent(CodeSystem.CodeSystemContentMode.COMPLETE); cs.setUrl("http://loinc.org"); cs.addConcept().setCode("123-4").setDisplay("Code 123 4"); - cs.setId("loinc"); + cs.setId(LOINC_LOW); myCodeSystemDao.update(cs); Group group = new Group(); @@ -569,7 +570,7 @@ public class FhirResourceDaoR4ValidateTest extends BaseJpaR4Test { cs.setContent(CodeSystem.CodeSystemContentMode.COMPLETE); cs.setUrl("http://loinc.org"); cs.addConcept().setCode("123-4").setDisplay("Code 123 4"); - cs.setId("loinc"); + cs.setId(LOINC_LOW); myCodeSystemDao.update(cs); Group group = new Group(); @@ -637,7 +638,7 @@ public class FhirResourceDaoR4ValidateTest extends BaseJpaR4Test { cs.setContent(CodeSystem.CodeSystemContentMode.COMPLETE); cs.setUrl("http://loinc.org"); cs.addConcept().setCode("123-4").setDisplay("Code 123 4"); - cs.setId("loinc"); + cs.setId(LOINC_LOW); myCodeSystemDao.update(cs); Group group = new Group(); @@ -1713,7 +1714,7 @@ public class FhirResourceDaoR4ValidateTest extends BaseJpaR4Test { cs.setUrl(ITermLoaderSvc.LOINC_URI); cs.setContent(CodeSystem.CodeSystemContentMode.COMPLETE); cs.addConcept().setCode("10013-1"); - cs.setId("loinc"); + cs.setId(LOINC_LOW); myCodeSystemDao.update(cs); IValidationSupport.CodeValidationResult result = myValueSetDao.validateCode(new UriType("http://fooVs"), null, new StringType("10013-1"), new StringType(ITermLoaderSvc.LOINC_URI), null, null, null, mySrd); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4Test.java index f942f1df0a2..915ead7dcf1 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TermVersionAdapterSvcR4Test.java @@ -33,6 +33,7 @@ import org.springframework.test.util.ReflectionTestUtils; import java.security.InvalidParameterException; +import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_LOW; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.verify; @@ -50,14 +51,14 @@ class TermVersionAdapterSvcR4Test { @Test void createOrUpdateCodeSystemMustHaveId() { - org.hl7.fhir.r4.model.CodeSystem codeSystem = new CodeSystem(); + CodeSystem codeSystem = new CodeSystem(); codeSystem.setUrl("a-loinc-system"); InvalidParameterException thrown = assertThrows( InvalidParameterException.class, () -> testedClass.createOrUpdateCodeSystem(codeSystem, new ServletRequestDetails())); - assertTrue(thrown.getMessage().contains("LOINC CodeSystem must have an 'ID' element")); + assertTrue(thrown.getMessage().contains("'loinc' CodeSystem must have an 'ID' element")); } @@ -65,8 +66,8 @@ class TermVersionAdapterSvcR4Test { void createOrUpdateCodeSystemWithIdNoException() { ReflectionTestUtils.setField(testedClass, "myCodeSystemResourceDao", myCodeSystemResourceDao); - org.hl7.fhir.r4.model.CodeSystem codeSystem = new CodeSystem(); - codeSystem.setUrl("a-loinc-system").setId("loinc"); + CodeSystem codeSystem = new CodeSystem(); + codeSystem.setUrl("a-loinc-system").setId(LOINC_LOW); when(myCodeSystemResourceDao.update(codeSystem, theRequestDetails)).thenReturn(theDaoMethodOutcome); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologyLoaderSvcLoincTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologyLoaderSvcLoincTest.java index 23feac7194b..8d30f018d32 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologyLoaderSvcLoincTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologyLoaderSvcLoincTest.java @@ -25,7 +25,6 @@ import org.hl7.fhir.r4.model.CodeSystem; import org.hl7.fhir.r4.model.ConceptMap; import org.hl7.fhir.r4.model.Enumerations; import org.hl7.fhir.r4.model.ValueSet; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; @@ -75,6 +74,7 @@ import static org.hamcrest.Matchers.containsString; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import static org.mockito.ArgumentMatchers.any; @@ -930,7 +930,7 @@ public class TerminologyLoaderSvcLoincTest extends BaseLoaderTest { testProps.put(LOINC_CODESYSTEM_MAKE_CURRENT.getCode(), "false"); doReturn(mockFileDescriptors).when(testedSvc).getLoadedFileDescriptors(mockFileDescriptorList); - InvalidRequestException thrown = Assertions.assertThrows(InvalidRequestException.class, + InvalidRequestException thrown = assertThrows(InvalidRequestException.class, () -> testedSvc.loadLoinc(mockFileDescriptorList, mySrd) ); assertEquals("'" + LOINC_CODESYSTEM_VERSION.getCode() + "' property is required when '" + diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java index 9e4057fd1a0..b34d1e008de 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplCurrentVersionR4Test.java @@ -77,6 +77,7 @@ import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_UPLOAD_ import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_XML_FILE; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_LOW; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -440,7 +441,7 @@ public class TerminologySvcImplCurrentVersionR4Test extends BaseJpaR4Test { // for CodeSystem: // _ current CS is present and has no version - CodeSystem codeSystem = myCodeSystemDao.read(new IdType("loinc")); + CodeSystem codeSystem = myCodeSystemDao.read(new IdType(LOINC_LOW)); String csString = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem); ourLog.info("CodeSystem:\n" + csString); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplDstu3Test.java index 5d29b99a1d4..34d94192a4c 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplDstu3Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplDstu3Test.java @@ -42,6 +42,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.empty; +import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_LOW; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertSame; @@ -406,7 +407,7 @@ public class TerminologySvcImplDstu3Test extends BaseJpaDstu3Test { .addFilter() .setProperty("copyright") .setOp(ValueSet.FilterOperator.EQUAL) - .setValue("loinc"); + .setValue(LOINC_LOW); outcome = myTermSvc.expandValueSet(null, vs); codes = toCodesContains(outcome.getExpansion().getContains()); assertThat(codes, containsInAnyOrder("47239-9")); @@ -478,7 +479,7 @@ public class TerminologySvcImplDstu3Test extends BaseJpaDstu3Test { .addFilter() .setProperty("copyright") .setOp(ValueSet.FilterOperator.EQUAL) - .setValue("loinc"); + .setValue(LOINC_LOW); outcome = myTermSvc.expandValueSet(null, vs); codes = toCodesContains(outcome.getExpansion().getContains()); assertThat(codes, containsInAnyOrder("50015-7", "43343-3", "43343-4")); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/api/ITermReadSvcTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/api/ITermReadSvcTest.java index d47e53736ec..c695bf8c0aa 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/api/ITermReadSvcTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/api/ITermReadSvcTest.java @@ -1,10 +1,31 @@ package ca.uhn.fhir.jpa.term.api; +/*- + * #%L + * HAPI FHIR JPA Server + * %% + * Copyright (C) 2014 - 2021 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import ca.uhn.fhir.jpa.api.dao.DaoRegistry; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.dao.data.ITermValueSetDao; import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.jpa.term.TermReadSvcR4; +import ca.uhn.fhir.jpa.term.TermReadSvcUtil; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import com.google.common.collect.Lists; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -79,7 +100,7 @@ class ITermReadSvcTest { @Test void doesntStartWithGenericVSReturnsTrue() { - boolean ret = testedClass.mustReturnEmptyValueSet("http://boing.org"); + boolean ret = TermReadSvcUtil.mustReturnEmptyValueSet("http://boing.org"); assertTrue(ret); } @@ -87,20 +108,20 @@ class ITermReadSvcTest { void doesntStartWithGenericVSPlusSlashThrows() { InternalErrorException thrown = assertThrows( InternalErrorException.class, - () -> testedClass.mustReturnEmptyValueSet("http://loinc.org/vs-no-slash-after-vs")); + () -> TermReadSvcUtil.mustReturnEmptyValueSet("http://loinc.org/vs-no-slash-after-vs")); - assertTrue(thrown.getMessage().contains("Don't know how to extract ForcedId from url:")); + assertTrue(thrown.getMessage().contains("Don't know how to extract ValueSet's ForcedId from url:")); } @Test void blankVsIdReturnsTrue() { - boolean ret = testedClass.mustReturnEmptyValueSet("http://loinc.org/vs/"); + boolean ret = TermReadSvcUtil.mustReturnEmptyValueSet("http://loinc.org/vs/"); assertTrue(ret); } @Test void startsWithGenericPlusSlashPlusIdReturnsFalse() { - boolean ret = testedClass.mustReturnEmptyValueSet("http://loinc.org/vs/some-vs-id"); + boolean ret = TermReadSvcUtil.mustReturnEmptyValueSet("http://loinc.org/vs/some-vs-id"); assertFalse(ret); } @@ -112,19 +133,19 @@ class ITermReadSvcTest { @Test void doesntContainLoincReturnsFalse() { - boolean ret = testedClass.isLoincNotGenericUnversionedCodeSystem("http://boing.org"); + boolean ret = TermReadSvcUtil.isLoincNotGenericUnversionedCodeSystem("http://boing.org"); assertFalse(ret); } @Test void hasVersionReturnsFalse() { - boolean ret = testedClass.isLoincNotGenericUnversionedCodeSystem("http://boing.org|v2.68"); + boolean ret = TermReadSvcUtil.isLoincNotGenericUnversionedCodeSystem("http://boing.org|v2.68"); assertFalse(ret); } @Test void containsLoincAndNoVersionReturnsTrue() { - boolean ret = testedClass.isLoincNotGenericUnversionedCodeSystem("http://anything-plus-loinc.org"); + boolean ret = TermReadSvcUtil.isLoincNotGenericUnversionedCodeSystem("http://anything-plus-loinc.org"); assertTrue(ret); } } @@ -134,25 +155,25 @@ class ITermReadSvcTest { @Test void notLoincReturnsFalse() { - boolean ret = testedClass.isLoincNotGenericUnversionedValueSet("http://anything-but-loin-c.org"); + boolean ret = TermReadSvcUtil.isLoincNotGenericUnversionedValueSet("http://anything-but-loin-c.org"); assertFalse(ret); } @Test void isLoincAndHasVersionReturnsFalse() { - boolean ret = testedClass.isLoincNotGenericUnversionedValueSet("http://loinc.org|v2.67"); + boolean ret = TermReadSvcUtil.isLoincNotGenericUnversionedValueSet("http://loinc.org|v2.67"); assertFalse(ret); } @Test void isLoincNoVersionButEqualsGenericValueSetUrlReturnsFalse() { - boolean ret = testedClass.isLoincNotGenericUnversionedValueSet("http://loinc.org/vs"); + boolean ret = TermReadSvcUtil.isLoincNotGenericUnversionedValueSet("http://loinc.org/vs"); assertFalse(ret); } @Test void isLoincNoVersionStartsWithGenericValueSetPlusSlashPlusIdReturnsTrue() { - boolean ret = testedClass.isLoincNotGenericUnversionedValueSet("http://loinc.org/vs/vs-id"); + boolean ret = TermReadSvcUtil.isLoincNotGenericUnversionedValueSet("http://loinc.org/vs/vs-id"); assertTrue(ret); } diff --git a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/support/ValidationConstants.java b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/support/ValidationConstants.java new file mode 100644 index 00000000000..27a3b266f44 --- /dev/null +++ b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/support/ValidationConstants.java @@ -0,0 +1,32 @@ +package org.hl7.fhir.common.hapi.validation.support; + +/*- + * #%L + * HAPI FHIR JPA Server + * %% + * Copyright (C) 2014 - 2021 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +public class ValidationConstants { + + public static final String LOINC_LOW = "loinc"; + public static final String LOINC_GENERIC_CODE_SYSTEM_URL = "http://loinc.org"; + public static final String LOINC_GENERIC_VALUESET_URL = LOINC_GENERIC_CODE_SYSTEM_URL + "/vs"; + public static final String LOINC_GENERIC_VALUESET_URL_PLUS_SLASH = LOINC_GENERIC_VALUESET_URL + "/"; + + // not to be instantiated + private ValidationConstants() { } +} From 53c7476daead1e4f06098e6e47f989921a771642 Mon Sep 17 00:00:00 2001 From: Ken Stevens <khstevens@gmail.com> Date: Thu, 23 Sep 2021 22:04:46 -0400 Subject: [PATCH 28/31] hapi storage (#3024) * first pass moving core storage classes to storage-api * move term service apis * nearly done * rename hapi-fhir-storage-api to hapi-fhir-storage and move transaction processor * rename hapi-fhir-storage-api to hapi-fhir-storage and move transaction processor * create new SearchConstants class to store platform independent search constants * move a couple of subscription services * move transaction processor adapter to storage * version bump * move searchparam * fix test * fix compile includes * fix text * fix docs --- hapi-deployable-pom/pom.xml | 2 +- hapi-fhir-android/pom.xml | 2 +- hapi-fhir-base/pom.xml | 2 +- .../ca/uhn/fhir/i18n/hapi-messages.properties | 60 +++--- hapi-fhir-batch/pom.xml | 2 +- hapi-fhir-bom/pom.xml | 4 +- hapi-fhir-cli/hapi-fhir-cli-api/pom.xml | 2 +- hapi-fhir-cli/hapi-fhir-cli-app/pom.xml | 2 +- hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml | 2 +- hapi-fhir-cli/pom.xml | 2 +- hapi-fhir-client-okhttp/pom.xml | 2 +- hapi-fhir-client/pom.xml | 2 +- hapi-fhir-converter/pom.xml | 2 +- hapi-fhir-dist/pom.xml | 2 +- hapi-fhir-docs/pom.xml | 2 +- ...-resolved-placeholder-identifier-true.yaml | 2 +- .../uhn/hapi/fhir/docs/appendix/javadocs.md | 2 +- .../fhir/docs/server_jpa/configuration.md | 4 +- .../ca/uhn/hapi/fhir/docs/server_jpa/lastn.md | 2 +- .../uhn/hapi/fhir/docs/server_jpa/schema.md | 10 +- .../fhir/docs/server_jpa_mdm/mdm_expansion.md | 4 +- .../docs/server_jpa_mdm/mdm_operations.md | 2 +- .../server_jpa_partitioning/partitioning.md | 2 +- .../repository_validating_interceptor.md | 7 +- hapi-fhir-jacoco/pom.xml | 4 +- hapi-fhir-jaxrsserver-base/pom.xml | 2 +- hapi-fhir-jpa/pom.xml | 2 +- hapi-fhir-jpaserver-base/pom.xml | 2 +- .../ca/uhn/fhir/jpa/config/BaseConfig.java | 3 +- .../uhn/fhir/jpa/config/BaseDstu2Config.java | 5 +- .../jpa/config/dstu3/BaseDstu3Config.java | 4 +- .../uhn/fhir/jpa/config/r4/BaseR4Config.java | 4 +- .../uhn/fhir/jpa/config/r5/BaseR5Config.java | 4 +- .../ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java | 37 +--- .../fhir/jpa/dao/BaseHapiFhirResourceDao.java | 34 ++-- ...ansactionProcessorVersionAdapterDstu2.java | 2 +- .../predicate/PredicateBuilderReference.java | 11 +- .../TransactionProcessorVersionAdapterR5.java | 4 +- .../jpa/delete/DeleteConflictService.java | 77 +++----- .../fhir/jpa/search/builder/QueryStack.java | 8 +- .../jpa/search/builder/SearchBuilder.java | 8 +- .../ResourceLinkPredicateBuilder.java | 6 +- .../jpa/dao/TransactionProcessorTest.java | 2 +- .../dao/dstu2/FhirResourceDaoDstu2Test.java | 20 +- .../jpa/dao/r4/FhirResourceDaoR4Test.java | 8 +- ...sitoryValidatingInterceptorHttpR4Test.java | 3 +- ...RepositoryValidatingInterceptorR4Test.java | 3 +- ...tionMessageSuppressingInterceptorTest.java | 4 +- hapi-fhir-jpaserver-cql/pom.xml | 2 +- hapi-fhir-jpaserver-mdm/pom.xml | 2 +- hapi-fhir-jpaserver-model/pom.xml | 2 +- hapi-fhir-jpaserver-searchparam/pom.xml | 2 +- hapi-fhir-jpaserver-subscription/pom.xml | 4 +- hapi-fhir-jpaserver-test-utilities/pom.xml | 2 +- hapi-fhir-jpaserver-uhnfhirtest/pom.xml | 2 +- hapi-fhir-server-mdm/pom.xml | 4 +- hapi-fhir-server-openapi/pom.xml | 2 +- hapi-fhir-server/pom.xml | 2 +- .../SearchPreferHandlingInterceptor.java | 2 +- ...AdditionalCompartmentSearchParameters.java | 21 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../hapi-fhir-spring-boot-samples/pom.xml | 2 +- .../hapi-fhir-spring-boot-starter/pom.xml | 2 +- hapi-fhir-spring-boot/pom.xml | 2 +- hapi-fhir-sql-migrate/pom.xml | 2 +- .../ca/uhn/fhir/jpa/migrate/BaseMigrator.java | 2 +- .../uhn/fhir/jpa/migrate/DriverTypeEnum.java | 2 +- .../fhir/jpa/migrate/FlywayMigrationTask.java | 2 +- .../uhn/fhir/jpa/migrate/FlywayMigrator.java | 2 +- .../ca/uhn/fhir/jpa/migrate/IMigrator.java | 2 +- .../ca/uhn/fhir/jpa/migrate/JdbcUtils.java | 2 +- .../jpa/migrate/MigrationTaskSkipper.java | 2 +- .../ca/uhn/fhir/jpa/migrate/Migrator.java | 2 +- .../uhn/fhir/jpa/migrate/SchemaMigrator.java | 2 +- .../fhir/jpa/migrate/TaskOnlyMigrator.java | 2 +- .../jpa/migrate/taskdef/AddColumnTask.java | 2 +- .../migrate/taskdef/AddForeignKeyTask.java | 2 +- .../migrate/taskdef/AddIdGeneratorTask.java | 2 +- .../jpa/migrate/taskdef/AddIndexTask.java | 2 +- .../migrate/taskdef/AddTableByColumnTask.java | 2 +- .../migrate/taskdef/AddTableRawSqlTask.java | 2 +- .../jpa/migrate/taskdef/ArbitrarySqlTask.java | 2 +- .../taskdef/BaseColumnCalculatorTask.java | 2 +- .../migrate/taskdef/BaseTableColumnTask.java | 2 +- .../taskdef/BaseTableColumnTypeTask.java | 2 +- .../jpa/migrate/taskdef/BaseTableTask.java | 2 +- .../fhir/jpa/migrate/taskdef/BaseTask.java | 2 +- .../migrate/taskdef/CalculateHashesTask.java | 2 +- .../taskdef/CalculateOrdinalDatesTask.java | 2 +- .../jpa/migrate/taskdef/ColumnTypeEnum.java | 2 +- .../ColumnTypeToDriverTypeToSqlType.java | 2 +- .../jpa/migrate/taskdef/DropColumnTask.java | 2 +- .../migrate/taskdef/DropForeignKeyTask.java | 2 +- .../migrate/taskdef/DropIdGeneratorTask.java | 2 +- .../jpa/migrate/taskdef/DropIndexTask.java | 2 +- .../jpa/migrate/taskdef/DropTableTask.java | 2 +- .../migrate/taskdef/ExecuteRawSqlTask.java | 2 +- .../migrate/taskdef/InitializeSchemaTask.java | 2 +- .../jpa/migrate/taskdef/ModifyColumnTask.java | 2 +- .../uhn/fhir/jpa/migrate/taskdef/NopTask.java | 2 +- .../jpa/migrate/taskdef/RenameColumnTask.java | 2 +- .../jpa/migrate/taskdef/RenameIndexTask.java | 2 +- .../tasks/SchemaInitializationProvider.java | 2 +- .../migrate/tasks/api/BaseMigrationTasks.java | 2 +- .../fhir/jpa/migrate/tasks/api/Builder.java | 2 +- .../api/ISchemaInitializationProvider.java | 2 +- .../pom.xml | 4 +- .../ca/uhn/fhir/jpa/api/config/DaoConfig.java | 2 +- .../ca/uhn/fhir/jpa/api/dao/DaoRegistry.java | 2 +- .../java/ca/uhn/fhir/jpa/api/dao/IDao.java | 2 +- .../fhir/jpa/api/dao/IFhirResourceDao.java | 2 +- .../api/dao/IFhirResourceDaoCodeSystem.java | 2 +- .../api/dao/IFhirResourceDaoComposition.java | 2 +- .../api/dao/IFhirResourceDaoConceptMap.java | 2 +- .../api/dao/IFhirResourceDaoEncounter.java | 2 +- .../dao/IFhirResourceDaoMessageHeader.java | 2 +- .../api/dao/IFhirResourceDaoObservation.java | 2 +- .../jpa/api/dao/IFhirResourceDaoPatient.java | 2 +- .../dao/IFhirResourceDaoSearchParameter.java | 2 +- .../IFhirResourceDaoStructureDefinition.java | 2 +- .../api/dao/IFhirResourceDaoSubscription.java | 2 +- .../jpa/api/dao/IFhirResourceDaoValueSet.java | 2 +- .../uhn/fhir/jpa/api/dao/IFhirSystemDao.java | 2 +- .../java/ca/uhn/fhir/jpa/api/dao/IJpaDao.java | 2 +- .../dao/MetadataKeyCurrentlyReindexing.java | 2 +- .../jpa/api/dao/MetadataKeyResourcePid.java | 2 +- .../fhir/jpa/api/model/DaoMethodOutcome.java | 2 +- .../fhir/jpa/api/model/DeleteConflict.java | 2 +- .../jpa/api/model/DeleteConflictList.java | 2 +- .../jpa/api/model/DeleteMethodOutcome.java | 2 +- .../fhir/jpa/api/model/ExpungeOptions.java | 2 +- .../fhir/jpa/api/model/ExpungeOutcome.java | 2 +- .../jpa/api/model/HistoryCountModeEnum.java | 2 +- .../jpa/api/model/LazyDaoMethodOutcome.java | 2 +- ...urceVersionConflictResolutionStrategy.java | 2 +- .../fhir/jpa/api/model/TranslationQuery.java | 2 +- .../jpa/api/model/TranslationRequest.java | 2 +- .../fhir/jpa/api/model/WarmCacheEntry.java | 2 +- .../jpa/api/svc/ISearchCoordinatorSvc.java | 2 +- .../bulk/imprt/api/IBulkDataImportSvc.java | 2 +- .../imprt/model/BulkImportJobFileJson.java | 2 +- .../bulk/imprt/model/BulkImportJobJson.java | 2 +- .../imprt/model/BulkImportJobStatusEnum.java | 2 +- .../model/JobFileRowProcessingModeEnum.java | 2 +- .../imprt/model/ParsedBulkImportRecord.java | 2 +- .../ca/uhn/fhir/jpa/dao/BaseStorageDao.java | 90 ++++++--- .../jpa/dao/BaseTransactionProcessor.java | 186 +++++++----------- .../ca/uhn/fhir/jpa/dao/DaoFailureUtil.java | 2 +- .../fhir/jpa/dao/DaoSearchParamProvider.java | 6 +- .../java/ca/uhn/fhir/jpa/dao/GZipUtil.java | 2 +- .../ITransactionProcessorVersionAdapter.java | 78 ++++++++ .../fhir/jpa/dao/MatchResourceUrlService.java | 2 +- ...ansactionProcessorVersionAdapterDstu3.java | 6 +- .../TransactionProcessorVersionAdapterR4.java | 6 +- .../jpa/dao/tx/HapiTransactionService.java | 25 +-- .../fhir/jpa/delete/DeleteConflictUtil.java | 65 ++++++ ...questRetryVersionConflictsInterceptor.java | 2 +- .../interceptor/validation/BaseTypedRule.java | 2 +- .../validation/IRepositoryValidatingRule.java | 34 ++-- .../jpa/interceptor/validation/IRuleRoot.java | 2 +- .../RepositoryValidatingInterceptor.java | 2 +- .../RepositoryValidatingRuleBuilder.java | 3 +- .../validation/RequireValidationRule.java | 4 +- .../validation/RuleDisallowProfile.java | 2 +- .../RuleRequireProfileDeclaration.java | 8 +- .../jpa/partition/SystemRequestDetails.java | 2 +- .../fhir/jpa/provider/BaseJpaProvider.java | 2 +- .../jpa/provider/BaseJpaResourceProvider.java | 2 +- .../fhir/jpa/provider/IJpaSystemProvider.java | 2 +- .../SubscriptionTriggeringProvider.java | 2 +- .../uhn/fhir/jpa/search/SearchConstants.java | 28 +++ .../channel/api/BaseChannelSettings.java | 2 +- .../channel/api/ChannelConsumerSettings.java | 2 +- .../channel/api/ChannelProducerSettings.java | 2 +- .../channel/api/IChannelFactory.java | 12 +- .../channel/api/IChannelProducer.java | 2 +- .../channel/api/IChannelReceiver.java | 4 +- .../channel/api/IChannelSettings.java | 2 +- .../config/SubscriptionChannelConfig.java | 2 +- .../channel/impl/LinkedBlockingChannel.java | 2 +- .../impl/LinkedBlockingChannelFactory.java | 4 +- ...roadcastingSubscribableChannelWrapper.java | 68 +++---- .../channel/subscription/IChannelNamer.java | 4 +- .../SubscriptionChannelFactory.java | 2 +- .../matching/IResourceModifiedConsumer.java | 2 +- .../SubscriptionMatchingStrategy.java | 2 +- .../registry/SubscriptionCanonicalizer.java | 2 +- .../match/registry/SubscriptionConstants.java | 2 +- .../model/CanonicalSubscription.java | 2 +- .../CanonicalSubscriptionChannelType.java | 58 +++--- .../model/ResourceDeliveryJsonMessage.java | 2 +- .../model/ResourceDeliveryMessage.java | 2 +- .../model/ResourceModifiedJsonMessage.java | 2 +- .../model/ResourceModifiedMessage.java | 2 +- .../ISubscriptionTriggeringSvc.java | 2 +- .../uhn/fhir/jpa/term/UploadStatistics.java | 2 +- .../uhn/fhir/jpa/term/api/ITermLoaderSvc.java | 2 +- .../uhn/fhir/jpa/util/MemoryCacheService.java | 34 ++-- .../jpa/validation/ValidationSettings.java | 2 +- .../validation/ValidatorResourceFetcher.java | 2 +- .../main/java/ca/uhn/fhir/mdm/log/Logs.java | 2 +- .../src/main/resources/.keep-jpaserver-api | 0 .../src/test/java/.keep | 0 .../src/test/resources/.keep | 0 hapi-fhir-structures-dstu2.1/pom.xml | 2 +- hapi-fhir-structures-dstu2/pom.xml | 2 +- hapi-fhir-structures-dstu3/pom.xml | 2 +- hapi-fhir-structures-hl7org-dstu2/pom.xml | 2 +- hapi-fhir-structures-r4/pom.xml | 2 +- hapi-fhir-structures-r5/pom.xml | 2 +- hapi-fhir-test-utilities/pom.xml | 2 +- hapi-fhir-testpage-overlay/pom.xml | 2 +- .../pom.xml | 2 +- hapi-fhir-validation-resources-dstu2/pom.xml | 2 +- hapi-fhir-validation-resources-dstu3/pom.xml | 2 +- hapi-fhir-validation-resources-r4/pom.xml | 2 +- hapi-fhir-validation-resources-r5/pom.xml | 2 +- hapi-fhir-validation/pom.xml | 2 +- hapi-tinder-plugin/pom.xml | 16 +- hapi-tinder-test/pom.xml | 2 +- pom.xml | 4 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- 227 files changed, 777 insertions(+), 681 deletions(-) rename {hapi-fhir-storage-api => hapi-fhir-storage}/pom.xml (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java (99%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/dao/DaoRegistry.java (99%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/dao/IDao.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDao.java (99%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoCodeSystem.java (99%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoComposition.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoConceptMap.java (97%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoEncounter.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoMessageHeader.java (97%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoObservation.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoPatient.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoSearchParameter.java (97%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoStructureDefinition.java (97%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoSubscription.java (97%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoValueSet.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirSystemDao.java (99%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/dao/IJpaDao.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/dao/MetadataKeyCurrentlyReindexing.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/dao/MetadataKeyResourcePid.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/model/DaoMethodOutcome.java (99%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflict.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflictList.java (99%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteMethodOutcome.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/model/ExpungeOptions.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/model/ExpungeOutcome.java (97%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/model/HistoryCountModeEnum.java (97%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/model/LazyDaoMethodOutcome.java (99%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/model/ResourceVersionConflictResolutionStrategy.java (97%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationQuery.java (99%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationRequest.java (99%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/model/WarmCacheEntry.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/api/svc/ISearchCoordinatorSvc.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/api/IBulkDataImportSvc.java (99%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobFileJson.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobJson.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobStatusEnum.java (97%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/JobFileRowProcessingModeEnum.java (97%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/ParsedBulkImportRecord.java (98%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/dao/BaseStorageDao.java (90%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java (94%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/dao/DaoFailureUtil.java (97%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/dao/DaoSearchParamProvider.java (92%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/dao/GZipUtil.java (98%) create mode 100644 hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/ITransactionProcessorVersionAdapter.java rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/dao/MatchResourceUrlService.java (99%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/TransactionProcessorVersionAdapterDstu3.java (97%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/dao/r4/TransactionProcessorVersionAdapterR4.java (95%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/dao/tx/HapiTransactionService.java (85%) create mode 100644 hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/delete/DeleteConflictUtil.java rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/interceptor/UserRequestRetryVersionConflictsInterceptor.java (99%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/BaseTypedRule.java (98%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/IRepositoryValidatingRule.java (99%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/IRuleRoot.java (97%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptor.java (99%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingRuleBuilder.java (99%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RequireValidationRule.java (99%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleDisallowProfile.java (99%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleRequireProfileDeclaration.java (86%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/partition/SystemRequestDetails.java (99%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaProvider.java (99%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaResourceProvider.java (99%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/provider/IJpaSystemProvider.java (96%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/provider/SubscriptionTriggeringProvider.java (99%) create mode 100644 hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/search/SearchConstants.java rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/BaseChannelSettings.java (97%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/ChannelConsumerSettings.java (97%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/ChannelProducerSettings.java (97%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelFactory.java (81%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelProducer.java (97%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelReceiver.java (95%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelSettings.java (96%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/config/SubscriptionChannelConfig.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannel.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannelFactory.java (99%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/BroadcastingSubscribableChannelWrapper.java (50%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/IChannelNamer.java (92%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/SubscriptionChannelFactory.java (99%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/matching/IResourceModifiedConsumer.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/matching/SubscriptionMatchingStrategy.java (97%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionCanonicalizer.java (99%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionConstants.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscription.java (99%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscriptionChannelType.java (99%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryJsonMessage.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryMessage.java (99%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedJsonMessage.java (98%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedMessage.java (99%) rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/subscription/triggering/ISubscriptionTriggeringSvc.java (97%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/term/UploadStatistics.java (98%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/term/api/ITermLoaderSvc.java (99%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/util/MemoryCacheService.java (99%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/validation/ValidationSettings.java (99%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/validation/ValidatorResourceFetcher.java (99%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/mdm/log/Logs.java (97%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/main/resources/.keep-jpaserver-api (100%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/test/java/.keep (100%) rename {hapi-fhir-storage-api => hapi-fhir-storage}/src/test/resources/.keep (100%) diff --git a/hapi-deployable-pom/pom.xml b/hapi-deployable-pom/pom.xml index 575868e3c45..247d5d7e525 100644 --- a/hapi-deployable-pom/pom.xml +++ b/hapi-deployable-pom/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/hapi-fhir-android/pom.xml b/hapi-fhir-android/pom.xml index 2526578113b..11b22ff9719 100644 --- a/hapi-fhir-android/pom.xml +++ b/hapi-fhir-android/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-base/pom.xml b/hapi-fhir-base/pom.xml index b4dba9128fd..9108ca2e4be 100644 --- a/hapi-fhir-base/pom.xml +++ b/hapi-fhir-base/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties index 28f28049461..1599b5547b2 100644 --- a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties +++ b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties @@ -73,7 +73,6 @@ ca.uhn.fhir.jpa.bulk.export.svc.BulkDataExportSvcImpl.unknownResourceType=Unknow ca.uhn.fhir.jpa.config.HapiFhirHibernateJpaDialect.resourceVersionConstraintFailure=The operation has failed with a version constraint failure. This generally means that two clients/threads were trying to update the same resource at the same time, and this request was chosen as the failing request. ca.uhn.fhir.jpa.config.HapiFhirHibernateJpaDialect.resourceIndexedCompositeStringUniqueConstraintFailure=The operation has failed with a unique index constraint failure. This probably means that the operation was trying to create/update a resource that would have resulted in a duplicate value for a unique index. ca.uhn.fhir.jpa.config.HapiFhirHibernateJpaDialect.forcedIdConstraintFailure=The operation has failed with a client-assigned ID constraint failure. This typically means that multiple client threads are trying to create a new resource with the same client-assigned ID at the same time, and this thread was chosen to be rejected. It can also happen when a request disables the Upsert Existence Check. - ca.uhn.fhir.jpa.dao.BaseHapiFhirDao.externalizedBinaryStorageExtensionFoundInRequestBody=Illegal extension found in request payload - URL "{0}" and value "{1}" ca.uhn.fhir.jpa.dao.BaseHapiFhirDao.incomingNoopInTransaction=Transaction contains resource with operation NOOP. This is only valid as a response operation, not in a request ca.uhn.fhir.jpa.dao.BaseHapiFhirDao.invalidMatchUrlInvalidResourceType=Invalid match URL "{0}" - Unknown resource type: "{1}" @@ -83,48 +82,41 @@ ca.uhn.fhir.jpa.dao.BaseHapiFhirDao.transactionOperationWithMultipleMatchFailure ca.uhn.fhir.jpa.dao.BaseHapiFhirDao.transactionOperationFailedNoId=Failed to {0} resource in transaction because no ID was provided ca.uhn.fhir.jpa.dao.BaseHapiFhirDao.transactionOperationFailedUnknownId=Failed to {0} resource in transaction because no resource could be found with ID {1} ca.uhn.fhir.jpa.dao.BaseHapiFhirDao.uniqueIndexConflictFailure=Can not create resource of type {0} as it would create a duplicate unique index matching query: {1} (existing index belongs to {2}, new unique index created by {3}) - -ca.uhn.fhir.jpa.dao.BaseHapiFhirSystemDao.transactionContainsMultipleWithDuplicateId=Transaction bundle contains multiple resources with ID: {0} -ca.uhn.fhir.jpa.dao.BaseHapiFhirSystemDao.transactionEntryHasInvalidVerb=Transaction bundle entry has missing or invalid HTTP Verb specified in Bundle.entry({1}).request.method. Found value: "{0}" -ca.uhn.fhir.jpa.dao.BaseHapiFhirSystemDao.transactionMissingUrl=Unable to perform {0}, no URL provided. -ca.uhn.fhir.jpa.dao.BaseHapiFhirSystemDao.transactionInvalidUrl=Unable to perform {0}, URL provided is invalid: {1} - -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.cantValidateWithNoResource=No resource supplied for $validate operation (resource is required unless mode is \"delete\") -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.deleteBlockedBecauseDisabled=Resource deletion is not permitted on this server -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.duplicateCreateForcedId=Can not create entity with ID[{0}], a resource with this ID already exists -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.failedToCreateWithInvalidId=Can not process entity with ID[{0}], this is not a valid FHIR ID -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.incorrectResourceType=Incorrect resource type detected for endpoint, found {0} but expected {1} -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.failedToCreateWithClientAssignedNumericId=Can not create resource with ID[{0}], no resource with this ID exists and clients may only assign IDs which contain at least one non-numeric character -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.failedToCreateWithClientAssignedId=Can not create resource with ID[{0}], ID must not be supplied on a create (POST) operation -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.failedToCreateWithClientAssignedIdNotAllowed=No resource exists on this server resource with ID[{0}], and client-assigned IDs are not enabled. -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.invalidParameterChain=Invalid parameter chain: {0} -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.invalidVersion=Version "{0}" is not valid for resource {1} -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.multipleParamsWithSameNameOneIsMissingTrue=This server does not know how to handle multiple "{0}" parameters where one has a value of :missing=true -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.missingBody=No body was supplied in request -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.unableToDeleteNotFound=Unable to find resource matching URL "{0}". Deletion failed. -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.successfulCreate=Successfully created resource "{0}" in {1}ms -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.successfulUpdate=Successfully updated resource "{0}" in {1}ms -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.successfulDeletes=Successfully deleted {0} resource(s) in {1}ms -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.invalidSearchParameter=Unknown search parameter "{0}" for resource type "{1}". Valid search parameters for this search are: {2} -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.invalidSortParameter=Unknown _sort parameter value "{0}" for resource type "{1}" (Note: sort parameters values must use a valid Search Parameter). Valid values for this search are: {2} -ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.updateWithNoId=Can not update resource of type {0} as it has no ID - +ca.uhn.fhir.jpa.dao.BaseStorageDao.transactionContainsMultipleWithDuplicateId=Transaction bundle contains multiple resources with ID: {0} +ca.uhn.fhir.jpa.dao.BaseStorageDao.transactionEntryHasInvalidVerb=Transaction bundle entry has missing or invalid HTTP Verb specified in Bundle.entry({1}).request.method. Found value: "{0}" +ca.uhn.fhir.jpa.dao.BaseStorageDao.transactionMissingUrl=Unable to perform {0}, no URL provided. +ca.uhn.fhir.jpa.dao.BaseStorageDao.transactionInvalidUrl=Unable to perform {0}, URL provided is invalid: {1} +ca.uhn.fhir.jpa.dao.BaseStorageDao.cantValidateWithNoResource=No resource supplied for $validate operation (resource is required unless mode is \"delete\") +ca.uhn.fhir.jpa.dao.BaseStorageDao.deleteBlockedBecauseDisabled=Resource deletion is not permitted on this server +ca.uhn.fhir.jpa.dao.BaseStorageDao.duplicateCreateForcedId=Can not create entity with ID[{0}], a resource with this ID already exists +ca.uhn.fhir.jpa.dao.BaseStorageDao.failedToCreateWithInvalidId=Can not process entity with ID[{0}], this is not a valid FHIR ID +ca.uhn.fhir.jpa.dao.BaseStorageDao.incorrectResourceType=Incorrect resource type detected for endpoint, found {0} but expected {1} +ca.uhn.fhir.jpa.dao.BaseStorageDao.failedToCreateWithClientAssignedNumericId=Can not create resource with ID[{0}], no resource with this ID exists and clients may only assign IDs which contain at least one non-numeric character +ca.uhn.fhir.jpa.dao.BaseStorageDao.failedToCreateWithClientAssignedId=Can not create resource with ID[{0}], ID must not be supplied on a create (POST) operation +ca.uhn.fhir.jpa.dao.BaseStorageDao.failedToCreateWithClientAssignedIdNotAllowed=No resource exists on this server resource with ID[{0}], and client-assigned IDs are not enabled. +ca.uhn.fhir.jpa.dao.BaseStorageDao.invalidParameterChain=Invalid parameter chain: {0} +ca.uhn.fhir.jpa.dao.BaseStorageDao.invalidVersion=Version "{0}" is not valid for resource {1} +ca.uhn.fhir.jpa.dao.BaseStorageDao.multipleParamsWithSameNameOneIsMissingTrue=This server does not know how to handle multiple "{0}" parameters where one has a value of :missing=true +ca.uhn.fhir.jpa.dao.BaseStorageDao.missingBody=No body was supplied in request +ca.uhn.fhir.jpa.dao.BaseStorageDao.unableToDeleteNotFound=Unable to find resource matching URL "{0}". Deletion failed. +ca.uhn.fhir.jpa.dao.BaseStorageDao.successfulCreate=Successfully created resource "{0}" in {1}ms +ca.uhn.fhir.jpa.dao.BaseStorageDao.successfulUpdate=Successfully updated resource "{0}" in {1}ms +ca.uhn.fhir.jpa.dao.BaseStorageDao.successfulDeletes=Successfully deleted {0} resource(s) in {1}ms +ca.uhn.fhir.jpa.dao.BaseStorageDao.invalidSearchParameter=Unknown search parameter "{0}" for resource type "{1}". Valid search parameters for this search are: {2} +ca.uhn.fhir.jpa.dao.BaseStorageDao.invalidSortParameter=Unknown _sort parameter value "{0}" for resource type "{1}" (Note: sort parameters values must use a valid Search Parameter). Valid values for this search are: {2} +ca.uhn.fhir.jpa.dao.BaseStorageDao.updateWithNoId=Can not update resource of type {0} as it has no ID ca.uhn.fhir.jpa.dao.BaseStorageDao.invalidBundleTypeForStorage=Unable to store a Bundle resource on this server with a Bundle.type value of: {0}. Note that if you are trying to perform a FHIR 'transaction' or 'batch' operation you should POST the Bundle resource to the Base URL of the server, not to the '/Bundle' endpoint. - ca.uhn.fhir.rest.api.PatchTypeEnum.missingPatchContentType=Missing or invalid content type for PATCH operation ca.uhn.fhir.rest.api.PatchTypeEnum.invalidPatchContentType=Invalid Content-Type for PATCH operation: {0} ca.uhn.fhir.jpa.dao.BaseTransactionProcessor.unsupportedResourceType=Resource {0} is not supported on this server. Supported resource types: {1} -ca.uhn.fhir.jpa.dao.TransactionProcessor.missingMandatoryResource=Missing required resource in Bundle.entry[{1}].resource for operation {0} -ca.uhn.fhir.jpa.dao.TransactionProcessor.missingPatchBody=Unable to determine PATCH body from request -ca.uhn.fhir.jpa.dao.TransactionProcessor.fhirPatchShouldNotUseBinaryResource=Binary PATCH detected with FHIR content type. FHIR Patch should use Parameters resource. - +ca.uhn.fhir.jpa.dao.BaseTransactionProcessor.missingMandatoryResource=Missing required resource in Bundle.entry[{1}].resource for operation {0} +ca.uhn.fhir.jpa.dao.BaseTransactionProcessor.missingPatchBody=Unable to determine PATCH body from request +ca.uhn.fhir.jpa.dao.BaseTransactionProcessor.fhirPatchShouldNotUseBinaryResource=Binary PATCH detected with FHIR content type. FHIR Patch should use Parameters resource. ca.uhn.fhir.jpa.patch.FhirPatch.invalidInsertIndex=Invalid insert index {0} for path {1} - Only have {2} existing entries ca.uhn.fhir.jpa.patch.FhirPatch.invalidMoveSourceIndex=Invalid move source index {0} for path {1} - Only have {2} existing entries ca.uhn.fhir.jpa.patch.FhirPatch.invalidMoveDestinationIndex=Invalid move destination index {0} for path {1} - Only have {2} existing entries - ca.uhn.fhir.jpa.searchparam.extractor.BaseSearchParamExtractor.externalReferenceNotAllowed=Resource contains external reference to URL "{0}" but this server is not configured to allow external references ca.uhn.fhir.jpa.searchparam.extractor.BaseSearchParamExtractor.failedToExtractPaths=Failed to extract values from resource using FHIRPath "{0}": {1} - ca.uhn.fhir.jpa.dao.LegacySearchBuilder.invalidQuantityPrefix=Unable to handle quantity prefix "{0}" for value: {1} ca.uhn.fhir.jpa.dao.LegacySearchBuilder.invalidNumberPrefix=Unable to handle number prefix "{0}" for value: {1} ca.uhn.fhir.jpa.dao.LegacySearchBuilder.sourceParamDisabled=The _source parameter is disabled on this server diff --git a/hapi-fhir-batch/pom.xml b/hapi-fhir-batch/pom.xml index 97d413f1a3c..e8af94401f8 100644 --- a/hapi-fhir-batch/pom.xml +++ b/hapi-fhir-batch/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-bom/pom.xml b/hapi-fhir-bom/pom.xml index 0ef10754ac7..4d1e5975e53 100644 --- a/hapi-fhir-bom/pom.xml +++ b/hapi-fhir-bom/pom.xml @@ -3,14 +3,14 @@ <modelVersion>4.0.0</modelVersion> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-bom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <packaging>pom</packaging> <name>HAPI FHIR BOM</name> <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml b/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml index 59e3eea4001..da163e01160 100644 --- a/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml +++ b/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml b/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml index 66280895c25..f609bf8f2d2 100644 --- a/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml +++ b/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-cli</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml b/hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml index bc64a5bba36..794cce25b1a 100644 --- a/hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml +++ b/hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../../hapi-deployable-pom</relativePath> </parent> diff --git a/hapi-fhir-cli/pom.xml b/hapi-fhir-cli/pom.xml index 887b3a49219..d8b4ef1c668 100644 --- a/hapi-fhir-cli/pom.xml +++ b/hapi-fhir-cli/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/hapi-fhir-client-okhttp/pom.xml b/hapi-fhir-client-okhttp/pom.xml index d81caa143c1..7045feee158 100644 --- a/hapi-fhir-client-okhttp/pom.xml +++ b/hapi-fhir-client-okhttp/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-client/pom.xml b/hapi-fhir-client/pom.xml index 0f6c971115a..3a2ce464076 100644 --- a/hapi-fhir-client/pom.xml +++ b/hapi-fhir-client/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-converter/pom.xml b/hapi-fhir-converter/pom.xml index e7127e92765..c61c0471ef8 100644 --- a/hapi-fhir-converter/pom.xml +++ b/hapi-fhir-converter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-dist/pom.xml b/hapi-fhir-dist/pom.xml index e3236999149..fdc23648ead 100644 --- a/hapi-fhir-dist/pom.xml +++ b/hapi-fhir-dist/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/hapi-fhir-docs/pom.xml b/hapi-fhir-docs/pom.xml index ff4b66f1152..0c2a614165d 100644 --- a/hapi-fhir-docs/pom.xml +++ b/hapi-fhir-docs/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_4_0/2446-issues-with-placeholder-reference-targets-need-to-be-resolved-placeholder-identifier-true.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_4_0/2446-issues-with-placeholder-reference-targets-need-to-be-resolved-placeholder-identifier-true.yaml index 51ac0bab5bb..79487fdff53 100644 --- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_4_0/2446-issues-with-placeholder-reference-targets-need-to-be-resolved-placeholder-identifier-true.yaml +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_4_0/2446-issues-with-placeholder-reference-targets-need-to-be-resolved-placeholder-identifier-true.yaml @@ -1,5 +1,5 @@ --- type: change issue: 2446 -title: "DaoConfig setting for [Populate Identifier In Auto Created Placeholder Reference Targets](https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-storage-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setPopulateIdentifierInAutoCreatedPlaceholderReferenceTargets(boolean)) +title: "DaoConfig setting for [Populate Identifier In Auto Created Placeholder Reference Targets](https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-storage/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setPopulateIdentifierInAutoCreatedPlaceholderReferenceTargets(boolean)) now defaults to `true`." diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/appendix/javadocs.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/appendix/javadocs.md index 00491ff2338..29922996a05 100644 --- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/appendix/javadocs.md +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/appendix/javadocs.md @@ -9,7 +9,7 @@ See the [Modules Page](/docs/getting_started/modules.html) for more information * [Model API (R5)](/apidocs/hapi-fhir-structures-r5/) - hapi-fhir-structures-r5 * [Client API](/apidocs/hapi-fhir-client/) - hapi-fhir-client * [Plain Server API](/apidocs/hapi-fhir-server/) - hapi-fhir-server -* [JPA Server - API](/apidocs/hapi-fhir-storage-api/) - hapi-fhir-storage-api +* [JPA Server - API](/apidocs/hapi-fhir-storage/) - hapi-fhir-storage * [JPA Server - Model](/apidocs/hapi-fhir-jpaserver-model/) - hapi-fhir-jpaserver-model * [JPA Server - Base](/apidocs/hapi-fhir-jpaserver-base/) - hapi-fhir-jpaserver-base * [Version Converter API](/apidocs/hapi-fhir-converter/) - hapi-fhir-converter diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/configuration.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/configuration.md index 1e3fe814321..d927d12d64a 100644 --- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/configuration.md +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/configuration.md @@ -61,7 +61,7 @@ but rather that this is an identifier for a ValueSet where `ValueSet.url` has th HAPI can be configured to treat certain URI/URL patterns as logical by using the DaoConfig#setTreatReferencesAsLogical property ( -see [JavaDoc](/hapi-fhir/apidocs/hapi-fhir-storage-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setTreatReferencesAsLogical(java.util.Set))) +see [JavaDoc](/hapi-fhir/apidocs/hapi-fhir-storage/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setTreatReferencesAsLogical(java.util.Set))) . For example: @@ -137,5 +137,5 @@ X-Retry-On-Version-Conflict: retry; max-retries=100 Delete with expunge submits a job to delete and expunge the requested resources. This is done in batches. If the DELETE ?_expunge=true syntax is used to trigger the delete expunge, then the batch size will be determined by the value -of [Expunge Batch Size](/apidocs/hapi-fhir-storage-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#getExpungeBatchSize()) +of [Expunge Batch Size](/apidocs/hapi-fhir-storage/ca/uhn/fhir/jpa/api/config/DaoConfig.html#getExpungeBatchSize()) property. diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/lastn.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/lastn.md index 1dbc3476d61..676da230bb1 100644 --- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/lastn.md +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/lastn.md @@ -26,7 +26,7 @@ The grouping of Observation resources by `Observation.code` means that the `$las The `$lastn` operation is disabled by default. The operation can be enabled by setting the DaoConfig#setLastNEnabled property ( -see [JavaDoc](/hapi-fhir/apidocs/hapi-fhir-storage-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setLastNEnabled(boolean))) +see [JavaDoc](/hapi-fhir/apidocs/hapi-fhir-storage/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setLastNEnabled(boolean))) . In addition, the Elasticsearch client service, `ElasticsearchSvcImpl` will need to be instantiated with parameters diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/schema.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/schema.md index dc167281c69..30800580674 100644 --- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/schema.md +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/schema.md @@ -246,11 +246,11 @@ an **HFJ_FORCED_ID** row exists corresponding to the equivalent **HFJ_RESOURCE** visible or usable by FHIR clients and it becomes purely an internal ID to the JPA server. If the server has been configured with -a [Resource Server ID Strategy](/apidocs/hapi-fhir-storage-api/undefined/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setResourceServerIdStrategy(ca.uhn.fhir.jpa.api.config.DaoConfig.IdStrategyEnum)) -of [UUID](/apidocs/hapi-fhir-storage-api/undefined/ca/uhn/fhir/jpa/api/config/DaoConfig.IdStrategyEnum.html#UUID), or -the server has been configured with -a [Resource Client ID Strategy](/apidocs/hapi-fhir-storage-api/undefined/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setResourceClientIdStrategy(ca.uhn.fhir.jpa.api.config.DaoConfig.ClientIdStrategyEnum)) -of [ANY](/apidocs/hapi-fhir-storage-api/undefined/ca/uhn/fhir/jpa/api/config/DaoConfig.ClientIdStrategyEnum.html#ANY) +a [Resource Server ID Strategy](/apidocs/hapi-fhir-storage/undefined/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setResourceServerIdStrategy(ca.uhn.fhir.jpa.api.config.DaoConfig.IdStrategyEnum)) +of [UUID](/apidocs/hapi-fhir-storage/undefined/ca/uhn/fhir/jpa/api/config/DaoConfig.IdStrategyEnum.html#UUID), or the +server has been configured with +a [Resource Client ID Strategy](/apidocs/hapi-fhir-storage/undefined/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setResourceClientIdStrategy(ca.uhn.fhir.jpa.api.config.DaoConfig.ClientIdStrategyEnum)) +of [ANY](/apidocs/hapi-fhir-storage/undefined/ca/uhn/fhir/jpa/api/config/DaoConfig.ClientIdStrategyEnum.html#ANY) the server will create a Forced ID for all resources (not only resources having textual IDs). ## Columns diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_mdm/mdm_expansion.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_mdm/mdm_expansion.md index d5f4747ed07..00cf855df21 100644 --- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_mdm/mdm_expansion.md +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_mdm/mdm_expansion.md @@ -26,8 +26,8 @@ One important caveat is that chaining is currently not supported when using this ## Enabling MDM Expansion On top of needing to instantiate an MDM module, you must enable this feature in -the [DaoConfig](/hapi-fhir/apidocs/hapi-fhir-storage-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html) bean, using -the [Allow MDM Expansion](/hapi-fhir/apidocs/hapi-fhir-storage-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setAllowMdmExpansion(boolean)) +the [DaoConfig](/hapi-fhir/apidocs/hapi-fhir-storage/ca/uhn/fhir/jpa/api/config/DaoConfig.html) bean, using +the [Allow MDM Expansion](/hapi-fhir/apidocs/hapi-fhir-storage/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setAllowMdmExpansion(boolean)) property. <div class="helpWarningCalloutBox"> diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_mdm/mdm_operations.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_mdm/mdm_operations.md index 8a291853cf2..369ae007b9d 100644 --- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_mdm/mdm_operations.md +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_mdm/mdm_operations.md @@ -601,7 +601,7 @@ This operation takes two optional Parameters. <td>0..1</td> <td> The number of links that should be deleted at a time. If ommitted, then the batch size will be determined by the value -of [Expunge Batch Size](/apidocs/hapi-fhir-storage-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#getExpungeBatchSize()) +of [Expunge Batch Size](/apidocs/hapi-fhir-storage/ca/uhn/fhir/jpa/api/config/DaoConfig.html#getExpungeBatchSize()) property. </td> </tr> diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_partitioning/partitioning.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_partitioning/partitioning.md index 5fda22365d2..4ab1a4c4e98 100644 --- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_partitioning/partitioning.md +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_partitioning/partitioning.md @@ -57,7 +57,7 @@ This fact can have security implications: in use in another partition. * In a server using the default configuration of - SEQUENTIAL_NUMERIC [Server ID Strategy](/hapi-fhir/apidocs/hapi-fhir-storage-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setResourceServerIdStrategy(ca.uhn.fhir.jpa.api.config.DaoConfig.IdStrategyEnum)) + SEQUENTIAL_NUMERIC [Server ID Strategy](/hapi-fhir/apidocs/hapi-fhir-storage/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setResourceServerIdStrategy(ca.uhn.fhir.jpa.api.config.DaoConfig.IdStrategyEnum)) a client may be able to infer the IDs of resources in other partitions based on the ID they were assigned. These considerations can be addressed by using UUID Server ID Strategy, and disallowing client-assigned IDs. diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/validation/repository_validating_interceptor.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/validation/repository_validating_interceptor.md index b73ca302aa4..2ff77b30efd 100644 --- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/validation/repository_validating_interceptor.md +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/validation/repository_validating_interceptor.md @@ -38,7 +38,12 @@ This means that: # Using the Repository Validating Interceptor -Using the repository validating interceptor is as simple as creating a new instance of [RepositoryValidatingInterceptor](/hapi-fhir/apidocs/hapi-fhir-jpaserver-base/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptor.html) and registering it with the interceptor registry. The only tricky part is initializing your rules, which must be done using a [RepositoryValidatingRuleBuilder](/hapi-fhir/apidocs/hapi-fhir-jpaserver-base/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingRuleBuilder.html). +Using the repository validating interceptor is as simple as creating a new instance +of [RepositoryValidatingInterceptor](/hapi-fhir/apidocs/hapi-fhir-storage/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptor.html) +and registering it with the interceptor registry. The only tricky part is initializing your rules, which must be done +using +a [RepositoryValidatingRuleBuilder](/hapi-fhir/apidocs/hapi-fhir-storage/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingRuleBuilder.html) +. The rule builder must be obtained from the Spring context, as shown below: diff --git a/hapi-fhir-jacoco/pom.xml b/hapi-fhir-jacoco/pom.xml index b3b32b8b321..b87e058dc54 100644 --- a/hapi-fhir-jacoco/pom.xml +++ b/hapi-fhir-jacoco/pom.xml @@ -11,7 +11,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> @@ -118,7 +118,7 @@ </dependency> <dependency> <groupId>ca.uhn.hapi.fhir</groupId> - <artifactId>hapi-fhir-storage-api</artifactId> + <artifactId>hapi-fhir-storage</artifactId> <version>${project.version}</version> </dependency> </dependencies> diff --git a/hapi-fhir-jaxrsserver-base/pom.xml b/hapi-fhir-jaxrsserver-base/pom.xml index 4e860ecd4b0..75151eb29a6 100644 --- a/hapi-fhir-jaxrsserver-base/pom.xml +++ b/hapi-fhir-jaxrsserver-base/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-jpa/pom.xml b/hapi-fhir-jpa/pom.xml index 149ee8cb261..9950baea97b 100644 --- a/hapi-fhir-jpa/pom.xml +++ b/hapi-fhir-jpa/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/hapi-fhir-jpaserver-base/pom.xml b/hapi-fhir-jpaserver-base/pom.xml index 807371d55f8..82d92844f39 100644 --- a/hapi-fhir-jpaserver-base/pom.xml +++ b/hapi-fhir-jpaserver-base/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java index f2a6ccfe046..95564aa7f73 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java @@ -217,7 +217,6 @@ public abstract class BaseConfig { public static final String PERSISTED_JPA_SEARCH_FIRST_PAGE_BUNDLE_PROVIDER = "PersistedJpaSearchFirstPageBundleProvider"; public static final String SEARCH_BUILDER = "SearchBuilder"; public static final String HISTORY_BUILDER = "HistoryBuilder"; - public static final String REPOSITORY_VALIDATING_RULE_BUILDER = "repositoryValidatingRuleBuilder"; private static final String HAPI_DEFAULT_SCHEDULER_GROUP = "HAPI"; @Autowired protected Environment myEnv; @@ -639,7 +638,7 @@ public abstract class BaseConfig { return new PersistedJpaSearchFirstPageBundleProvider(theSearch, theSearchTask, theSearchBuilder, theRequest); } - @Bean(name = REPOSITORY_VALIDATING_RULE_BUILDER) + @Bean(name = RepositoryValidatingRuleBuilder.REPOSITORY_VALIDATING_RULE_BUILDER) @Scope("prototype") public RepositoryValidatingRuleBuilder repositoryValidatingRuleBuilder() { return new RepositoryValidatingRuleBuilder(); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseDstu2Config.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseDstu2Config.java index aebba0133b4..82aaf6fef7b 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseDstu2Config.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseDstu2Config.java @@ -6,10 +6,9 @@ import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao; import ca.uhn.fhir.jpa.dao.FulltextSearchSvcImpl; import ca.uhn.fhir.jpa.dao.IFulltextSearchSvc; +import ca.uhn.fhir.jpa.dao.ITransactionProcessorVersionAdapter; import ca.uhn.fhir.jpa.dao.JpaPersistedResourceValidationSupport; -import ca.uhn.fhir.jpa.dao.TransactionProcessor; import ca.uhn.fhir.jpa.dao.TransactionProcessorVersionAdapterDstu2; -import ca.uhn.fhir.jpa.dao.r4.TransactionProcessorVersionAdapterR4; import ca.uhn.fhir.jpa.term.TermReadSvcDstu2; import ca.uhn.fhir.jpa.term.api.ITermReadSvc; import ca.uhn.fhir.jpa.util.ResourceCountCache; @@ -97,7 +96,7 @@ public class BaseDstu2Config extends BaseConfig { } @Bean - public TransactionProcessor.ITransactionProcessorVersionAdapter transactionProcessorVersionFacade() { + public ITransactionProcessorVersionAdapter transactionProcessorVersionFacade() { return new TransactionProcessorVersionAdapterDstu2(); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/dstu3/BaseDstu3Config.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/dstu3/BaseDstu3Config.java index 92529b25f5b..8f490c06417 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/dstu3/BaseDstu3Config.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/dstu3/BaseDstu3Config.java @@ -6,7 +6,7 @@ import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao; import ca.uhn.fhir.jpa.config.BaseConfigDstu3Plus; import ca.uhn.fhir.jpa.dao.FulltextSearchSvcImpl; import ca.uhn.fhir.jpa.dao.IFulltextSearchSvc; -import ca.uhn.fhir.jpa.dao.TransactionProcessor; +import ca.uhn.fhir.jpa.dao.ITransactionProcessorVersionAdapter; import ca.uhn.fhir.jpa.dao.dstu3.TransactionProcessorVersionAdapterDstu3; import ca.uhn.fhir.jpa.provider.GraphQLProvider; import ca.uhn.fhir.jpa.term.TermLoaderSvcImpl; @@ -83,7 +83,7 @@ public class BaseDstu3Config extends BaseConfigDstu3Plus { } @Bean - public TransactionProcessor.ITransactionProcessorVersionAdapter transactionProcessorVersionFacade() { + public ITransactionProcessorVersionAdapter transactionProcessorVersionFacade() { return new TransactionProcessorVersionAdapterDstu3(); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/r4/BaseR4Config.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/r4/BaseR4Config.java index 6879d7dfd1b..fedd7e1b886 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/r4/BaseR4Config.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/r4/BaseR4Config.java @@ -6,7 +6,7 @@ import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao; import ca.uhn.fhir.jpa.config.BaseConfigDstu3Plus; import ca.uhn.fhir.jpa.dao.FulltextSearchSvcImpl; import ca.uhn.fhir.jpa.dao.IFulltextSearchSvc; -import ca.uhn.fhir.jpa.dao.TransactionProcessor; +import ca.uhn.fhir.jpa.dao.ITransactionProcessorVersionAdapter; import ca.uhn.fhir.jpa.dao.r4.TransactionProcessorVersionAdapterR4; import ca.uhn.fhir.jpa.provider.GraphQLProvider; import ca.uhn.fhir.jpa.term.TermLoaderSvcImpl; @@ -78,7 +78,7 @@ public class BaseR4Config extends BaseConfigDstu3Plus { } @Bean - public TransactionProcessor.ITransactionProcessorVersionAdapter transactionProcessorVersionFacade() { + public ITransactionProcessorVersionAdapter transactionProcessorVersionFacade() { return new TransactionProcessorVersionAdapterR4(); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/r5/BaseR5Config.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/r5/BaseR5Config.java index c217a864907..db9d36c38e2 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/r5/BaseR5Config.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/r5/BaseR5Config.java @@ -6,7 +6,7 @@ import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao; import ca.uhn.fhir.jpa.config.BaseConfigDstu3Plus; import ca.uhn.fhir.jpa.dao.FulltextSearchSvcImpl; import ca.uhn.fhir.jpa.dao.IFulltextSearchSvc; -import ca.uhn.fhir.jpa.dao.TransactionProcessor; +import ca.uhn.fhir.jpa.dao.ITransactionProcessorVersionAdapter; import ca.uhn.fhir.jpa.dao.r5.TransactionProcessorVersionAdapterR5; import ca.uhn.fhir.jpa.provider.GraphQLProvider; import ca.uhn.fhir.jpa.term.TermLoaderSvcImpl; @@ -76,7 +76,7 @@ public class BaseR5Config extends BaseConfigDstu3Plus { } @Bean - public TransactionProcessor.ITransactionProcessorVersionAdapter transactionProcessorVersionFacade() { + public ITransactionProcessorVersionAdapter transactionProcessorVersionFacade() { return new TransactionProcessorVersionAdapterR5(); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java index d612b88fe50..ee6ac476fc1 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java @@ -25,6 +25,7 @@ import ca.uhn.fhir.jpa.dao.expunge.ExpungeService; import ca.uhn.fhir.jpa.dao.index.DaoSearchParamSynchronizer; import ca.uhn.fhir.jpa.dao.index.IdHelperService; import ca.uhn.fhir.jpa.dao.index.SearchParamWithInlineReferencesExtractor; +import ca.uhn.fhir.jpa.dao.tx.HapiTransactionService; import ca.uhn.fhir.jpa.delete.DeleteConflictService; import ca.uhn.fhir.jpa.entity.PartitionEntity; import ca.uhn.fhir.jpa.entity.ResourceSearchView; @@ -77,7 +78,6 @@ import ca.uhn.fhir.rest.api.RestSearchParameterTypeEnum; import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; -import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; @@ -181,14 +181,8 @@ public abstract class BaseHapiFhirDao<T extends IBaseResource> extends BaseStora public static final long INDEX_STATUS_INDEXED = 1L; public static final long INDEX_STATUS_INDEXING_FAILED = 2L; public static final String NS_JPA_PROFILE = "https://github.com/hapifhir/hapi-fhir/ns/jpa/profile"; - public static final String OO_SEVERITY_ERROR = "error"; - public static final String OO_SEVERITY_INFO = "information"; - public static final String OO_SEVERITY_WARN = "warning"; - public static final String XACT_USERDATA_KEY_RESOLVED_TAG_DEFINITIONS = BaseHapiFhirDao.class.getName() + "_RESOLVED_TAG_DEFINITIONS"; - public static final String XACT_USERDATA_KEY_EXISTING_SEARCH_PARAMS = BaseHapiFhirDao.class.getName() + "_EXISTING_SEARCH_PARAMS"; private static final Logger ourLog = LoggerFactory.getLogger(BaseHapiFhirDao.class); private static final Map<FhirVersionEnum, FhirContext> ourRetrievalContexts = new HashMap<>(); - private static final String PROCESSING_SUB_REQUEST = "BaseHapiFhirDao.processingSubRequest"; private static boolean ourValidationDisabledForUnitTest; private static boolean ourDisableIncrementOnUpdateForUnitTest = false; @@ -429,7 +423,7 @@ public abstract class BaseHapiFhirDao<T extends IBaseResource> extends BaseStora if (retVal == null) { - HashMap<MemoryCacheService.TagDefinitionCacheKey, TagDefinition> resolvedTagDefinitions = theTransactionDetails.getOrCreateUserData(XACT_USERDATA_KEY_RESOLVED_TAG_DEFINITIONS, () -> new HashMap<>()); + HashMap<MemoryCacheService.TagDefinitionCacheKey, TagDefinition> resolvedTagDefinitions = theTransactionDetails.getOrCreateUserData(HapiTransactionService.XACT_USERDATA_KEY_RESOLVED_TAG_DEFINITIONS, () -> new HashMap<>()); retVal = resolvedTagDefinitions.get(key); if (retVal == null) { @@ -508,19 +502,6 @@ public abstract class BaseHapiFhirDao<T extends IBaseResource> extends BaseStora return LogicalReferenceHelper.isLogicalReference(myConfig.getModelConfig(), theId); } - public void notifyInterceptors(RestOperationTypeEnum theOperationType, ActionRequestDetails theRequestDetails) { - if (theRequestDetails.getId() != null && theRequestDetails.getId().hasResourceType() && isNotBlank(theRequestDetails.getResourceType())) { - if (theRequestDetails.getId().getResourceType().equals(theRequestDetails.getResourceType()) == false) { - throw new InternalErrorException( - "Inconsistent server state - Resource types don't match: " + theRequestDetails.getId().getResourceType() + " / " + theRequestDetails.getResourceType()); - } - } - - if (theRequestDetails.getUserData().get(PROCESSING_SUB_REQUEST) == Boolean.TRUE) { - theRequestDetails.notifyIncomingRequestPreHandled(theOperationType); - } - } - /** * Returns true if the resource has changed (either the contents or the tags) */ @@ -1195,7 +1176,7 @@ public abstract class BaseHapiFhirDao<T extends IBaseResource> extends BaseStora // CREATE or UPDATE - IdentityHashMap<ResourceTable, ResourceIndexedSearchParams> existingSearchParams = theTransactionDetails.getOrCreateUserData(XACT_USERDATA_KEY_EXISTING_SEARCH_PARAMS, () -> new IdentityHashMap<>()); + IdentityHashMap<ResourceTable, ResourceIndexedSearchParams> existingSearchParams = theTransactionDetails.getOrCreateUserData(HapiTransactionService.XACT_USERDATA_KEY_EXISTING_SEARCH_PARAMS, () -> new IdentityHashMap<>()); existingParams = existingSearchParams.get(entity); if (existingParams == null) { existingParams = new ResourceIndexedSearchParams(entity); @@ -1682,18 +1663,6 @@ public abstract class BaseHapiFhirDao<T extends IBaseResource> extends BaseStora return retVal.toString(); } - public static void clearRequestAsProcessingSubRequest(RequestDetails theRequestDetails) { - if (theRequestDetails != null) { - theRequestDetails.getUserData().remove(PROCESSING_SUB_REQUEST); - } - } - - public static void markRequestAsProcessingSubRequest(RequestDetails theRequestDetails) { - if (theRequestDetails != null) { - theRequestDetails.getUserData().put(PROCESSING_SUB_REQUEST, Boolean.TRUE); - } - } - public static void populateFullTextFields(final FhirContext theContext, final IBaseResource theResource, ResourceTable theEntity) { if (theEntity.getDeleted() != null) { theEntity.setNarrativeText(null); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java index 6b13d9c7da2..cf808379a17 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java @@ -36,7 +36,7 @@ import ca.uhn.fhir.jpa.api.model.ExpungeOutcome; import ca.uhn.fhir.jpa.api.model.LazyDaoMethodOutcome; import ca.uhn.fhir.jpa.dao.index.IdHelperService; import ca.uhn.fhir.jpa.dao.tx.HapiTransactionService; -import ca.uhn.fhir.jpa.delete.DeleteConflictService; +import ca.uhn.fhir.jpa.delete.DeleteConflictUtil; import ca.uhn.fhir.jpa.model.entity.BaseHasResource; import ca.uhn.fhir.jpa.model.entity.BaseTag; import ca.uhn.fhir.jpa.model.entity.ForcedId; @@ -223,7 +223,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B */ protected DaoMethodOutcome doCreateForPost(T theResource, String theIfNoneExist, boolean thePerformIndexing, TransactionDetails theTransactionDetails, RequestDetails theRequestDetails) { if (theResource == null) { - String msg = getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "missingBody"); + String msg = getContext().getLocalizer().getMessage(BaseStorageDao.class, "missingBody"); throw new InvalidRequestException(msg); } @@ -383,7 +383,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B outcome.setId(theResource.getIdElement()); } - String msg = getContext().getLocalizer().getMessageSanitized(BaseHapiFhirResourceDao.class, "successfulCreate", outcome.getId(), w.getMillisAndRestart()); + String msg = getContext().getLocalizer().getMessageSanitized(BaseStorageDao.class, "successfulCreate", outcome.getId(), w.getMillisAndRestart()); outcome.setOperationOutcome(createInfoOperationOutcome(msg)); String forcedId = null; @@ -415,7 +415,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B } protected String getMessageSanitized(String theKey, String theIdPart) { - return getContext().getLocalizer().getMessageSanitized(BaseHapiFhirResourceDao.class, theKey, theIdPart); + return getContext().getLocalizer().getMessageSanitized(BaseStorageDao.class, theKey, theIdPart); } private boolean isSystemRequest(RequestDetails theRequest) { @@ -448,7 +448,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B DaoMethodOutcome retVal = delete(theId, deleteConflicts, theRequestDetails, transactionDetails); - DeleteConflictService.validateDeleteConflictsEmptyOrThrowException(getContext(), deleteConflicts); + DeleteConflictUtil.validateDeleteConflictsEmptyOrThrowException(getContext(), deleteConflicts); ourLog.debug("Processed delete on {} in {}ms", theId.getValue(), w.getMillisAndRestart()); return retVal; @@ -475,7 +475,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B outcome.setId(id); IBaseOperationOutcome oo = OperationOutcomeUtil.newInstance(getContext()); - String message = getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "successfulDeletes", 1, 0); + String message = getContext().getLocalizer().getMessage(BaseStorageDao.class, "successfulDeletes", 1, 0); String severity = "information"; String code = "informational"; OperationOutcomeUtil.addIssue(getContext(), oo, severity, message, null, code); @@ -524,7 +524,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B DaoMethodOutcome outcome = toMethodOutcome(theRequestDetails, savedEntity, resourceToDelete).setCreated(true); IBaseOperationOutcome oo = OperationOutcomeUtil.newInstance(getContext()); - String message = getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "successfulDeletes", 1, w.getMillis()); + String message = getContext().getLocalizer().getMessage(BaseStorageDao.class, "successfulDeletes", 1, w.getMillis()); String severity = "information"; String code = "informational"; OperationOutcomeUtil.addIssue(getContext(), oo, severity, message, null, code); @@ -547,7 +547,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B return myTransactionService.execute(theRequest, transactionDetails, tx -> { DeleteConflictList deleteConflicts = new DeleteConflictList(); DeleteMethodOutcome outcome = deleteByUrl(theUrl, deleteConflicts, theRequest); - DeleteConflictService.validateDeleteConflictsEmptyOrThrowException(getContext(), deleteConflicts); + DeleteConflictUtil.validateDeleteConflictsEmptyOrThrowException(getContext(), deleteConflicts); return outcome; }); } @@ -657,7 +657,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B OperationOutcomeUtil.addIssue(getContext(), oo, severity, message, null, code); } else { oo = OperationOutcomeUtil.newInstance(getContext()); - String message = getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "successfulDeletes", deletedResources.size(), w.getMillis()); + String message = getContext().getLocalizer().getMessage(BaseStorageDao.class, "successfulDeletes", deletedResources.size(), w.getMillis()); String severity = "information"; String code = "informational"; OperationOutcomeUtil.addIssue(getContext(), oo, severity, message, null, code); @@ -673,7 +673,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B private void validateDeleteEnabled() { if (!getConfig().isDeleteEnabled()) { - String msg = getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "deleteBlockedBecauseDisabled"); + String msg = getContext().getLocalizer().getMessage(BaseStorageDao.class, "deleteBlockedBecauseDisabled"); throw new PreconditionFailedException(msg); } } @@ -1267,7 +1267,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B if (theId.hasVersionIdPart()) { if (theId.isVersionIdPartValidLong() == false) { - throw new ResourceNotFoundException(getContext().getLocalizer().getMessageSanitized(BaseHapiFhirResourceDao.class, "invalidVersion", theId.getVersionIdPart(), theId.toUnqualifiedVersionless())); + throw new ResourceNotFoundException(getContext().getLocalizer().getMessageSanitized(BaseStorageDao.class, "invalidVersion", theId.getVersionIdPart(), theId.toUnqualifiedVersionless())); } if (entity.getVersion() != theId.getVersionIdPartAsLong()) { entity = null; @@ -1283,7 +1283,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B try { entity = q.getSingleResult(); } catch (NoResultException e) { - throw new ResourceNotFoundException(getContext().getLocalizer().getMessageSanitized(BaseHapiFhirResourceDao.class, "invalidVersion", theId.getVersionIdPart(), theId.toUnqualifiedVersionless())); + throw new ResourceNotFoundException(getContext().getLocalizer().getMessageSanitized(BaseStorageDao.class, "invalidVersion", theId.getVersionIdPart(), theId.toUnqualifiedVersionless())); } } } @@ -1588,12 +1588,12 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B @Override public DaoMethodOutcome update(T theResource, String theMatchUrl, boolean thePerformIndexing, boolean theForceUpdateVersion, RequestDetails theRequest, @Nonnull TransactionDetails theTransactionDetails) { if (theResource == null) { - String msg = getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "missingBody"); + String msg = getContext().getLocalizer().getMessage(BaseStorageDao.class, "missingBody"); throw new InvalidRequestException(msg); } if (!theResource.getIdElement().hasIdPart() && isBlank(theMatchUrl)) { String type = myFhirContext.getResourceType(theResource); - String msg = myFhirContext.getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "updateWithNoId", type); + String msg = myFhirContext.getLocalizer().getMessage(BaseStorageDao.class, "updateWithNoId", type); throw new InvalidRequestException(msg); } @@ -1733,7 +1733,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B outcome.setId(id); } - String msg = getContext().getLocalizer().getMessageSanitized(BaseHapiFhirResourceDao.class, "successfulUpdate", outcome.getId(), w.getMillisAndRestart()); + String msg = getContext().getLocalizer().getMessageSanitized(BaseStorageDao.class, "successfulUpdate", outcome.getId(), w.getMillisAndRestart()); outcome.setOperationOutcome(createInfoOperationOutcome(msg)); ourLog.debug(msg); @@ -1762,7 +1762,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B if (getConfig().isEnforceReferentialIntegrityOnDelete()) { myDeleteConflictService.validateOkToDelete(deleteConflicts, entity, true, theRequest, new TransactionDetails()); } - DeleteConflictService.validateDeleteConflictsEmptyOrThrowException(getContext(), deleteConflicts); + DeleteConflictUtil.validateDeleteConflictsEmptyOrThrowException(getContext(), deleteConflicts); IBaseOperationOutcome oo = createInfoOperationOutcome("Ok to delete"); return new MethodOutcome(new IdDt(theId.getValue()), oo); @@ -1790,7 +1790,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends B if (resourceToValidateById != null) { result = validator.validateWithResult(resourceToValidateById, options); } else { - String msg = getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "cantValidateWithNoResource"); + String msg = getContext().getLocalizer().getMessage(BaseStorageDao.class, "cantValidateWithNoResource"); throw new InvalidRequestException(msg); } } else if (isNotBlank(theRawResource)) { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/TransactionProcessorVersionAdapterDstu2.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/TransactionProcessorVersionAdapterDstu2.java index b1b87a079e1..63b914e2200 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/TransactionProcessorVersionAdapterDstu2.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/TransactionProcessorVersionAdapterDstu2.java @@ -38,7 +38,7 @@ import org.hl7.fhir.instance.model.api.IBaseResource; import java.util.Date; import java.util.List; -public class TransactionProcessorVersionAdapterDstu2 implements TransactionProcessor.ITransactionProcessorVersionAdapter<Bundle, Bundle.Entry> { +public class TransactionProcessorVersionAdapterDstu2 implements ITransactionProcessorVersionAdapter<Bundle, Bundle.Entry> { @Override public void setResponseStatus(Bundle.Entry theBundleEntry, String theStatus) { theBundleEntry.getResponse().setStatus(theStatus); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/predicate/PredicateBuilderReference.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/predicate/PredicateBuilderReference.java index 62ebba77afc..2f6d1bacaea 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/predicate/PredicateBuilderReference.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/predicate/PredicateBuilderReference.java @@ -34,7 +34,7 @@ import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.api.config.DaoConfig; import ca.uhn.fhir.jpa.api.dao.DaoRegistry; import ca.uhn.fhir.jpa.api.dao.IDao; -import ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao; +import ca.uhn.fhir.jpa.dao.BaseStorageDao; import ca.uhn.fhir.jpa.dao.LegacySearchBuilder; import ca.uhn.fhir.jpa.dao.index.IdHelperService; import ca.uhn.fhir.jpa.model.config.PartitionSettings; @@ -48,9 +48,7 @@ import ca.uhn.fhir.jpa.model.search.StorageProcessingMessage; import ca.uhn.fhir.jpa.searchparam.MatchUrlService; import ca.uhn.fhir.jpa.searchparam.ResourceMetaParams; import ca.uhn.fhir.jpa.searchparam.util.JpaParamUtil; -import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; import ca.uhn.fhir.jpa.searchparam.util.SourceParam; -import ca.uhn.fhir.rest.server.util.CompositeInterceptorBroadcaster; import ca.uhn.fhir.model.api.IQueryParameterAnd; import ca.uhn.fhir.model.api.IQueryParameterOr; import ca.uhn.fhir.model.api.IQueryParameterType; @@ -75,6 +73,8 @@ import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; +import ca.uhn.fhir.rest.server.util.CompositeInterceptorBroadcaster; +import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; import com.google.common.collect.Lists; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -96,7 +96,6 @@ import javax.persistence.criteria.Subquery; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.HashSet; import java.util.List; import java.util.ListIterator; import java.util.Set; @@ -347,7 +346,7 @@ class PredicateBuilderReference extends BasePredicateBuilder { } if (!foundChainMatch) { - throw new InvalidRequestException(myContext.getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "invalidParameterChain", theParamName + '.' + theReferenceParam.getChain())); + throw new InvalidRequestException(myContext.getLocalizer().getMessage(BaseStorageDao.class, "invalidParameterChain", theParamName + '.' + theReferenceParam.getChain())); } if (candidateTargetTypes.size() > 1) { @@ -684,7 +683,7 @@ class PredicateBuilderReference extends BasePredicateBuilder { } else { Collection<String> validNames = mySearchParamRegistry.getValidSearchParameterNamesIncludingMeta(theResourceName); - String msg = myContext.getLocalizer().getMessageSanitized(BaseHapiFhirResourceDao.class, "invalidSearchParameter", theParamName, theResourceName, validNames); + String msg = myContext.getLocalizer().getMessageSanitized(BaseStorageDao.class, "invalidSearchParameter", theParamName, theResourceName, validNames); throw new InvalidRequestException(msg); } } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r5/TransactionProcessorVersionAdapterR5.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r5/TransactionProcessorVersionAdapterR5.java index f51f8e6bba9..07e2696a9c7 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r5/TransactionProcessorVersionAdapterR5.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r5/TransactionProcessorVersionAdapterR5.java @@ -21,7 +21,7 @@ package ca.uhn.fhir.jpa.dao.r5; */ import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.jpa.dao.TransactionProcessor; +import ca.uhn.fhir.jpa.dao.ITransactionProcessorVersionAdapter; import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import org.hl7.fhir.exceptions.FHIRException; @@ -34,7 +34,7 @@ import org.hl7.fhir.r5.model.Resource; import java.util.Date; import java.util.List; -public class TransactionProcessorVersionAdapterR5 implements TransactionProcessor.ITransactionProcessorVersionAdapter<Bundle, Bundle.BundleEntryComponent> { +public class TransactionProcessorVersionAdapterR5 implements ITransactionProcessorVersionAdapter<Bundle, Bundle.BundleEntryComponent> { @Override public void setResponseStatus(Bundle.BundleEntryComponent theBundleEntry, String theStatus) { theBundleEntry.getResponse().setStatus(theStatus); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/delete/DeleteConflictService.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/delete/DeleteConflictService.java index 6bcd1f488c0..4a586a3a6b2 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/delete/DeleteConflictService.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/delete/DeleteConflictService.java @@ -27,16 +27,16 @@ import ca.uhn.fhir.interceptor.api.Pointcut; import ca.uhn.fhir.jpa.api.config.DaoConfig; import ca.uhn.fhir.jpa.api.model.DeleteConflict; import ca.uhn.fhir.jpa.api.model.DeleteConflictList; -import ca.uhn.fhir.jpa.dao.BaseHapiFhirDao; +import ca.uhn.fhir.jpa.dao.BaseStorageDao; import ca.uhn.fhir.jpa.dao.data.IResourceLinkDao; import ca.uhn.fhir.jpa.model.entity.ResourceLink; import ca.uhn.fhir.jpa.model.entity.ResourceTable; -import ca.uhn.fhir.rest.server.util.CompositeInterceptorBroadcaster; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; import ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; +import ca.uhn.fhir.rest.server.util.CompositeInterceptorBroadcaster; import ca.uhn.fhir.util.OperationOutcomeUtil; import com.google.common.annotations.VisibleForTesting; import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; @@ -64,35 +64,6 @@ public class DeleteConflictService { @Autowired private FhirContext myFhirContext; - public int validateOkToDelete(DeleteConflictList theDeleteConflicts, ResourceTable theEntity, boolean theForValidate, RequestDetails theRequest, TransactionDetails theTransactionDetails) { - - // We want the list of resources that are marked to be the same list even as we - // drill into conflict resolution stacks.. this allows us to not get caught by - // circular references - DeleteConflictList newConflicts = new DeleteConflictList(theDeleteConflicts); - - // In most cases, there will be no hooks, and so we only need to check if there is at least FIRST_QUERY_RESULT_COUNT conflict and populate that. - // Only in the case where there is a hook do we need to go back and collect larger batches of conflicts for processing. - - DeleteConflictOutcome outcome = findAndHandleConflicts(theRequest, newConflicts, theEntity, theForValidate, FIRST_QUERY_RESULT_COUNT, theTransactionDetails); - - int retryCount = 0; - while (outcome != null) { - int shouldRetryCount = Math.min(outcome.getShouldRetryCount(), MAX_RETRY_ATTEMPTS); - if (!(retryCount < shouldRetryCount)) break; - newConflicts = new DeleteConflictList(newConflicts); - outcome = findAndHandleConflicts(theRequest, newConflicts, theEntity, theForValidate, myDaoConfig.getMaximumDeleteConflictQueryCount(), theTransactionDetails); - ++retryCount; - } - theDeleteConflicts.addAll(newConflicts); - if (retryCount >= MAX_RETRY_ATTEMPTS && !theDeleteConflicts.isEmpty()) { - IBaseOperationOutcome oo = OperationOutcomeUtil.newInstance(myFhirContext); - OperationOutcomeUtil.addIssue(myFhirContext, oo, BaseHapiFhirDao.OO_SEVERITY_ERROR, MAX_RETRY_ATTEMPTS_EXCEEDED_MSG, null, "processing"); - throw new ResourceVersionConflictException(MAX_RETRY_ATTEMPTS_EXCEEDED_MSG, oo); - } - return retryCount; - } - private DeleteConflictOutcome findAndHandleConflicts(RequestDetails theRequest, DeleteConflictList theDeleteConflicts, ResourceTable theEntity, boolean theForValidate, int theMinQueryResultCount, TransactionDetails theTransactionDetails) { List<ResourceLink> resultList = myDeleteConflictFinderService.findConflicts(theEntity, theMinQueryResultCount); if (resultList.isEmpty()) { @@ -139,35 +110,33 @@ public class DeleteConflictService { } } - public static void validateDeleteConflictsEmptyOrThrowException(FhirContext theFhirContext, DeleteConflictList theDeleteConflicts) { - IBaseOperationOutcome oo = null; - String firstMsg = null; + public int validateOkToDelete(DeleteConflictList theDeleteConflicts, ResourceTable theEntity, boolean theForValidate, RequestDetails theRequest, TransactionDetails theTransactionDetails) { - for (DeleteConflict next : theDeleteConflicts) { + // We want the list of resources that are marked to be the same list even as we + // drill into conflict resolution stacks.. this allows us to not get caught by + // circular references + DeleteConflictList newConflicts = new DeleteConflictList(theDeleteConflicts); - if (theDeleteConflicts.isResourceIdToIgnoreConflict(next.getTargetId())) { - continue; - } + // In most cases, there will be no hooks, and so we only need to check if there is at least FIRST_QUERY_RESULT_COUNT conflict and populate that. + // Only in the case where there is a hook do we need to go back and collect larger batches of conflicts for processing. - String msg = "Unable to delete " + - next.getTargetId().toUnqualifiedVersionless().getValue() + - " because at least one resource has a reference to this resource. First reference found was resource " + - next.getSourceId().toUnqualifiedVersionless().getValue() + - " in path " + - next.getSourcePath(); + DeleteConflictOutcome outcome = findAndHandleConflicts(theRequest, newConflicts, theEntity, theForValidate, FIRST_QUERY_RESULT_COUNT, theTransactionDetails); - if (firstMsg == null) { - firstMsg = msg; - oo = OperationOutcomeUtil.newInstance(theFhirContext); - } - OperationOutcomeUtil.addIssue(theFhirContext, oo, BaseHapiFhirDao.OO_SEVERITY_ERROR, msg, null, "processing"); + int retryCount = 0; + while (outcome != null) { + int shouldRetryCount = Math.min(outcome.getShouldRetryCount(), MAX_RETRY_ATTEMPTS); + if (!(retryCount < shouldRetryCount)) break; + newConflicts = new DeleteConflictList(newConflicts); + outcome = findAndHandleConflicts(theRequest, newConflicts, theEntity, theForValidate, myDaoConfig.getMaximumDeleteConflictQueryCount(), theTransactionDetails); + ++retryCount; } - - if (firstMsg == null) { - return; + theDeleteConflicts.addAll(newConflicts); + if (retryCount >= MAX_RETRY_ATTEMPTS && !theDeleteConflicts.isEmpty()) { + IBaseOperationOutcome oo = OperationOutcomeUtil.newInstance(myFhirContext); + OperationOutcomeUtil.addIssue(myFhirContext, oo, BaseStorageDao.OO_SEVERITY_ERROR, MAX_RETRY_ATTEMPTS_EXCEEDED_MSG, null, "processing"); + throw new ResourceVersionConflictException(MAX_RETRY_ATTEMPTS_EXCEEDED_MSG, oo); } - - throw new ResourceVersionConflictException(firstMsg, oo); + return retryCount; } @VisibleForTesting diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/QueryStack.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/QueryStack.java index 82bf3d886fe..475cba4758b 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/QueryStack.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/QueryStack.java @@ -24,7 +24,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.RuntimeSearchParam; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.api.config.DaoConfig; -import ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao; +import ca.uhn.fhir.jpa.dao.BaseStorageDao; import ca.uhn.fhir.jpa.dao.LegacySearchBuilder; import ca.uhn.fhir.jpa.dao.predicate.PredicateBuilderToken; import ca.uhn.fhir.jpa.dao.predicate.SearchFilterParser; @@ -109,11 +109,9 @@ import java.util.Collection; import java.util.Collections; import java.util.EnumSet; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -443,7 +441,7 @@ public class QueryStack { RuntimeSearchParam searchParam = mySearchParamRegistry.getActiveSearchParam(theResourceName, paramName); if (searchParam == null) { Collection<String> validNames = mySearchParamRegistry.getValidSearchParameterNamesIncludingMeta(theResourceName); - String msg = myFhirContext.getLocalizer().getMessageSanitized(BaseHapiFhirResourceDao.class, "invalidSearchParameter", paramName, theResourceName, validNames); + String msg = myFhirContext.getLocalizer().getMessageSanitized(BaseStorageDao.class, "invalidSearchParameter", paramName, theResourceName, validNames); throw new InvalidRequestException(msg); } RestSearchParameterTypeEnum typeEnum = searchParam.getParamType(); @@ -1204,7 +1202,7 @@ public class QueryStack { } } else { - String msg = myFhirContext.getLocalizer().getMessageSanitized(BaseHapiFhirResourceDao.class, "invalidSearchParameter", theParamName, theResourceName, mySearchParamRegistry.getValidSearchParameterNamesIncludingMeta(theResourceName)); + String msg = myFhirContext.getLocalizer().getMessageSanitized(BaseStorageDao.class, "invalidSearchParameter", theParamName, theResourceName, mySearchParamRegistry.getValidSearchParameterNamesIncludingMeta(theResourceName)); throw new InvalidRequestException(msg); } } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/SearchBuilder.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/SearchBuilder.java index 5d117ed14bb..7c82ae84f09 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/SearchBuilder.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/SearchBuilder.java @@ -35,7 +35,7 @@ import ca.uhn.fhir.jpa.api.dao.IDao; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.config.HapiFhirLocalContainerEntityManagerFactoryBean; import ca.uhn.fhir.jpa.config.HibernatePropertiesProvider; -import ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao; +import ca.uhn.fhir.jpa.dao.BaseStorageDao; import ca.uhn.fhir.jpa.dao.IFulltextSearchSvc; import ca.uhn.fhir.jpa.dao.IResultIterator; import ca.uhn.fhir.jpa.dao.ISearchBuilder; @@ -51,6 +51,7 @@ import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.jpa.model.entity.ResourceTag; import ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails; import ca.uhn.fhir.jpa.model.search.StorageProcessingMessage; +import ca.uhn.fhir.jpa.search.SearchConstants; import ca.uhn.fhir.jpa.search.builder.sql.GeneratedSql; import ca.uhn.fhir.jpa.search.builder.sql.SearchQueryBuilder; import ca.uhn.fhir.jpa.search.builder.sql.SearchQueryExecutor; @@ -138,7 +139,8 @@ public class SearchBuilder implements ISearchBuilder { * for an explanation of why we use the constant 800 */ // NB: keep public - public static final int MAXIMUM_PAGE_SIZE = 800; + @Deprecated + public static final int MAXIMUM_PAGE_SIZE = SearchConstants.MAX_PAGE_SIZE; public static final int MAXIMUM_PAGE_SIZE_FOR_TESTING = 50; private static final Logger ourLog = LoggerFactory.getLogger(SearchBuilder.class); private static final ResourcePersistentId NO_MORE = new ResourcePersistentId(-1L); @@ -547,7 +549,7 @@ public class SearchBuilder implements ISearchBuilder { RuntimeSearchParam param = mySearchParamRegistry.getActiveSearchParam(myResourceName, theSort.getParamName()); if (param == null) { - String msg = myContext.getLocalizer().getMessageSanitized(BaseHapiFhirResourceDao.class, "invalidSortParameter", theSort.getParamName(), getResourceName(), mySearchParamRegistry.getValidSearchParameterNamesIncludingMeta(getResourceName())); + String msg = myContext.getLocalizer().getMessageSanitized(BaseStorageDao.class, "invalidSortParameter", theSort.getParamName(), getResourceName(), mySearchParamRegistry.getValidSearchParameterNamesIncludingMeta(getResourceName())); throw new InvalidRequestException(msg); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/ResourceLinkPredicateBuilder.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/ResourceLinkPredicateBuilder.java index d18f2a87f46..50e6de2a610 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/ResourceLinkPredicateBuilder.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/ResourceLinkPredicateBuilder.java @@ -34,7 +34,7 @@ import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.api.config.DaoConfig; import ca.uhn.fhir.jpa.api.dao.DaoRegistry; import ca.uhn.fhir.jpa.api.dao.IDao; -import ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao; +import ca.uhn.fhir.jpa.dao.BaseStorageDao; import ca.uhn.fhir.jpa.dao.index.IdHelperService; import ca.uhn.fhir.jpa.dao.predicate.PredicateBuilderReference; import ca.uhn.fhir.jpa.dao.predicate.SearchFilterParser; @@ -400,7 +400,7 @@ public class ResourceLinkPredicateBuilder extends BaseJoiningPredicateBuilder { } if (!foundChainMatch) { - throw new InvalidRequestException(getFhirContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "invalidParameterChain", theParamName + '.' + theReferenceParam.getChain())); + throw new InvalidRequestException(getFhirContext().getLocalizer().getMessage(BaseStorageDao.class, "invalidParameterChain", theParamName + '.' + theReferenceParam.getChain())); } candidateTargetTypes.add(nextType); @@ -414,7 +414,7 @@ public class ResourceLinkPredicateBuilder extends BaseJoiningPredicateBuilder { } if (candidateTargetTypes.isEmpty()) { - throw new InvalidRequestException(getFhirContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "invalidParameterChain", theParamName + '.' + theReferenceParam.getChain())); + throw new InvalidRequestException(getFhirContext().getLocalizer().getMessage(BaseStorageDao.class, "invalidParameterChain", theParamName + '.' + theReferenceParam.getChain())); } if (candidateTargetTypes.size() > 1) { diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/TransactionProcessorTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/TransactionProcessorTest.java index 02a797f60f6..83b38ad4a17 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/TransactionProcessorTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/TransactionProcessorTest.java @@ -144,7 +144,7 @@ public class TransactionProcessorTest { } @Bean - public BaseTransactionProcessor.ITransactionProcessorVersionAdapter<Bundle, Bundle.BundleEntryComponent> versionAdapter() { + public ITransactionProcessorVersionAdapter<Bundle, Bundle.BundleEntryComponent> versionAdapter() { return new TransactionProcessorVersionAdapterR4(); } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu2/FhirResourceDaoDstu2Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu2/FhirResourceDaoDstu2Test.java index 71c2af076fc..1cae885a51b 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu2/FhirResourceDaoDstu2Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu2/FhirResourceDaoDstu2Test.java @@ -3,7 +3,7 @@ package ca.uhn.fhir.jpa.dao.dstu2; import ca.uhn.fhir.jpa.api.config.DaoConfig; import ca.uhn.fhir.jpa.api.model.HistoryCountModeEnum; import ca.uhn.fhir.jpa.dao.BaseHapiFhirDao; -import ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao; +import ca.uhn.fhir.jpa.dao.BaseStorageDao; import ca.uhn.fhir.jpa.dao.data.IForcedIdDao; import ca.uhn.fhir.jpa.dao.dstu3.FhirResourceDaoDstu3Test; import ca.uhn.fhir.jpa.model.entity.ResourceIndexedSearchParamString; @@ -416,15 +416,15 @@ public class FhirResourceDaoDstu2Test extends BaseJpaDstu2Test { * If any of this ever fails, it means that one of the OperationOutcome issue severity codes has changed code value across versions. We store the string as a constant, so something will need to * be fixed. */ - assertEquals(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.ERROR.toCode(), BaseHapiFhirResourceDao.OO_SEVERITY_ERROR); - assertEquals(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.ERROR.toCode(), BaseHapiFhirResourceDao.OO_SEVERITY_ERROR); - assertEquals(ca.uhn.fhir.model.dstu2.valueset.IssueSeverityEnum.ERROR.getCode(), BaseHapiFhirResourceDao.OO_SEVERITY_ERROR); - assertEquals(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.INFORMATION.toCode(), BaseHapiFhirResourceDao.OO_SEVERITY_INFO); - assertEquals(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.INFORMATION.toCode(), BaseHapiFhirResourceDao.OO_SEVERITY_INFO); - assertEquals(ca.uhn.fhir.model.dstu2.valueset.IssueSeverityEnum.INFORMATION.getCode(), BaseHapiFhirResourceDao.OO_SEVERITY_INFO); - assertEquals(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.WARNING.toCode(), BaseHapiFhirResourceDao.OO_SEVERITY_WARN); - assertEquals(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.WARNING.toCode(), BaseHapiFhirResourceDao.OO_SEVERITY_WARN); - assertEquals(ca.uhn.fhir.model.dstu2.valueset.IssueSeverityEnum.WARNING.getCode(), BaseHapiFhirResourceDao.OO_SEVERITY_WARN); + assertEquals(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.ERROR.toCode(), BaseStorageDao.OO_SEVERITY_ERROR); + assertEquals(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.ERROR.toCode(), BaseStorageDao.OO_SEVERITY_ERROR); + assertEquals(ca.uhn.fhir.model.dstu2.valueset.IssueSeverityEnum.ERROR.getCode(), BaseStorageDao.OO_SEVERITY_ERROR); + assertEquals(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.INFORMATION.toCode(), BaseStorageDao.OO_SEVERITY_INFO); + assertEquals(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.INFORMATION.toCode(), BaseStorageDao.OO_SEVERITY_INFO); + assertEquals(ca.uhn.fhir.model.dstu2.valueset.IssueSeverityEnum.INFORMATION.getCode(), BaseStorageDao.OO_SEVERITY_INFO); + assertEquals(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.WARNING.toCode(), BaseStorageDao.OO_SEVERITY_WARN); + assertEquals(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.WARNING.toCode(), BaseStorageDao.OO_SEVERITY_WARN); + assertEquals(ca.uhn.fhir.model.dstu2.valueset.IssueSeverityEnum.WARNING.getCode(), BaseStorageDao.OO_SEVERITY_WARN); } @Test diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4Test.java index e6794b6caea..c16ee84372d 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4Test.java @@ -5,7 +5,7 @@ import ca.uhn.fhir.jpa.api.config.DaoConfig; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.api.model.HistoryCountModeEnum; import ca.uhn.fhir.jpa.dao.BaseHapiFhirDao; -import ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao; +import ca.uhn.fhir.jpa.dao.BaseStorageDao; import ca.uhn.fhir.jpa.dao.JpaResourceDao; import ca.uhn.fhir.jpa.entity.TermConcept; import ca.uhn.fhir.jpa.model.entity.NormalizedQuantitySearchLevel; @@ -1014,13 +1014,13 @@ public class FhirResourceDaoR4Test extends BaseJpaR4Test { * be fixed. */ assertEquals(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.ERROR.toCode(), BaseHapiFhirDao.OO_SEVERITY_ERROR); - assertEquals(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.ERROR.toCode(), BaseHapiFhirResourceDao.OO_SEVERITY_ERROR); + assertEquals(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.ERROR.toCode(), BaseStorageDao.OO_SEVERITY_ERROR); assertEquals(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.ERROR.toCode(), BaseHapiFhirDao.OO_SEVERITY_ERROR); assertEquals(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.INFORMATION.toCode(), BaseHapiFhirDao.OO_SEVERITY_INFO); - assertEquals(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.INFORMATION.toCode(), BaseHapiFhirResourceDao.OO_SEVERITY_INFO); + assertEquals(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.INFORMATION.toCode(), BaseStorageDao.OO_SEVERITY_INFO); assertEquals(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.INFORMATION.toCode(), BaseHapiFhirDao.OO_SEVERITY_INFO); assertEquals(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.WARNING.toCode(), BaseHapiFhirDao.OO_SEVERITY_WARN); - assertEquals(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.WARNING.toCode(), BaseHapiFhirResourceDao.OO_SEVERITY_WARN); + assertEquals(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.WARNING.toCode(), BaseStorageDao.OO_SEVERITY_WARN); assertEquals(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.WARNING.toCode(), BaseHapiFhirDao.OO_SEVERITY_WARN); } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptorHttpR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptorHttpR4Test.java index cc5c9bc8795..ef3c36dfa05 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptorHttpR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptorHttpR4Test.java @@ -1,7 +1,6 @@ package ca.uhn.fhir.jpa.interceptor.validation; import ca.uhn.fhir.context.FhirVersionEnum; -import ca.uhn.fhir.jpa.config.BaseConfig; import ca.uhn.fhir.jpa.dao.r4.BaseJpaR4Test; import ca.uhn.fhir.jpa.rp.r4.ObservationResourceProvider; import ca.uhn.fhir.rest.api.MethodOutcome; @@ -76,7 +75,7 @@ public class RepositoryValidatingInterceptorHttpR4Test extends BaseJpaR4Test { } private RepositoryValidatingRuleBuilder newRuleBuilder() { - return myApplicationContext.getBean(BaseConfig.REPOSITORY_VALIDATING_RULE_BUILDER, RepositoryValidatingRuleBuilder.class); + return myApplicationContext.getBean(RepositoryValidatingRuleBuilder.REPOSITORY_VALIDATING_RULE_BUILDER, RepositoryValidatingRuleBuilder.class); } } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptorR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptorR4Test.java index ca49294dcda..f5187b4f36d 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptorR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptorR4Test.java @@ -1,6 +1,5 @@ package ca.uhn.fhir.jpa.interceptor.validation; -import ca.uhn.fhir.jpa.config.BaseConfig; import ca.uhn.fhir.jpa.dao.r4.BaseJpaR4Test; import ca.uhn.fhir.rest.api.PatchTypeEnum; import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException; @@ -388,7 +387,7 @@ public class RepositoryValidatingInterceptorR4Test extends BaseJpaR4Test { private RepositoryValidatingRuleBuilder newRuleBuilder() { - return myApplicationContext.getBean(BaseConfig.REPOSITORY_VALIDATING_RULE_BUILDER, RepositoryValidatingRuleBuilder.class); + return myApplicationContext.getBean(RepositoryValidatingRuleBuilder.REPOSITORY_VALIDATING_RULE_BUILDER, RepositoryValidatingRuleBuilder.class); } } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/ValidationMessageSuppressingInterceptorTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/ValidationMessageSuppressingInterceptorTest.java index abe8b152ee4..693e1809f14 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/ValidationMessageSuppressingInterceptorTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/ValidationMessageSuppressingInterceptorTest.java @@ -1,7 +1,6 @@ package ca.uhn.fhir.jpa.interceptor.validation; import ca.uhn.fhir.context.support.IValidationSupport; -import ca.uhn.fhir.jpa.config.BaseConfig; import ca.uhn.fhir.jpa.provider.r4.BaseResourceProviderR4Test; import ca.uhn.fhir.rest.api.MethodOutcome; import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException; @@ -23,7 +22,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import java.io.IOException; -import java.util.Collections; import java.util.List; import static org.hamcrest.MatcherAssert.assertThat; @@ -118,7 +116,7 @@ public class ValidationMessageSuppressingInterceptorTest extends BaseResourcePro public void testRepositoryValidation() { createPatient(withActiveTrue(), withId("A")); - List<IRepositoryValidatingRule> rules = myApplicationContext.getBean(BaseConfig.REPOSITORY_VALIDATING_RULE_BUILDER, RepositoryValidatingRuleBuilder.class) + List<IRepositoryValidatingRule> rules = myApplicationContext.getBean(RepositoryValidatingRuleBuilder.REPOSITORY_VALIDATING_RULE_BUILDER, RepositoryValidatingRuleBuilder.class) .forResourcesOfType("Encounter") .requireValidationToDeclaredProfiles().withBestPracticeWarningLevel(IResourceValidator.BestPracticeWarningLevel.Ignore) .build(); diff --git a/hapi-fhir-jpaserver-cql/pom.xml b/hapi-fhir-jpaserver-cql/pom.xml index 79b0f8682a9..fcbc21eb860 100644 --- a/hapi-fhir-jpaserver-cql/pom.xml +++ b/hapi-fhir-jpaserver-cql/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-jpaserver-mdm/pom.xml b/hapi-fhir-jpaserver-mdm/pom.xml index 22fa4dceb98..f6bbb7dd1b5 100644 --- a/hapi-fhir-jpaserver-mdm/pom.xml +++ b/hapi-fhir-jpaserver-mdm/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-jpaserver-model/pom.xml b/hapi-fhir-jpaserver-model/pom.xml index 075066b6827..e14c335440b 100644 --- a/hapi-fhir-jpaserver-model/pom.xml +++ b/hapi-fhir-jpaserver-model/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-jpaserver-searchparam/pom.xml b/hapi-fhir-jpaserver-searchparam/pom.xml index 6a029def188..dbfe5575e7a 100755 --- a/hapi-fhir-jpaserver-searchparam/pom.xml +++ b/hapi-fhir-jpaserver-searchparam/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-jpaserver-subscription/pom.xml b/hapi-fhir-jpaserver-subscription/pom.xml index 1fb86ca9421..efdc95a67aa 100644 --- a/hapi-fhir-jpaserver-subscription/pom.xml +++ b/hapi-fhir-jpaserver-subscription/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> @@ -22,7 +22,7 @@ </dependency> <dependency> <groupId>ca.uhn.hapi.fhir</groupId> - <artifactId>hapi-fhir-storage-api</artifactId> + <artifactId>hapi-fhir-storage</artifactId> <version>${project.version}</version> </dependency> <dependency> diff --git a/hapi-fhir-jpaserver-test-utilities/pom.xml b/hapi-fhir-jpaserver-test-utilities/pom.xml index 4cbb297b273..5bd99907195 100644 --- a/hapi-fhir-jpaserver-test-utilities/pom.xml +++ b/hapi-fhir-jpaserver-test-utilities/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-jpaserver-uhnfhirtest/pom.xml b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml index 74a95489730..12d711a736a 100644 --- a/hapi-fhir-jpaserver-uhnfhirtest/pom.xml +++ b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/hapi-fhir-server-mdm/pom.xml b/hapi-fhir-server-mdm/pom.xml index a152ba8887e..40bace61494 100644 --- a/hapi-fhir-server-mdm/pom.xml +++ b/hapi-fhir-server-mdm/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> @@ -29,7 +29,7 @@ </dependency> <dependency> <groupId>ca.uhn.hapi.fhir</groupId> - <artifactId>hapi-fhir-storage-api</artifactId> + <artifactId>hapi-fhir-storage</artifactId> <version>${project.version}</version> </dependency> <dependency> diff --git a/hapi-fhir-server-openapi/pom.xml b/hapi-fhir-server-openapi/pom.xml index d4fae64c88b..00ac44f96b4 100644 --- a/hapi-fhir-server-openapi/pom.xml +++ b/hapi-fhir-server-openapi/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-server/pom.xml b/hapi-fhir-server/pom.xml index 56a785466bc..c9d6c6e8ad0 100644 --- a/hapi-fhir-server/pom.xml +++ b/hapi-fhir-server/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/SearchPreferHandlingInterceptor.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/SearchPreferHandlingInterceptor.java index e9f0e2757e7..8030ab7320b 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/SearchPreferHandlingInterceptor.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/SearchPreferHandlingInterceptor.java @@ -142,7 +142,7 @@ public class SearchPreferHandlingInterceptor { // Strict handling List<String> allowedParams = searchParamRetriever.getActiveSearchParams(resourceName).keySet().stream().sorted().distinct().collect(Collectors.toList()); HapiLocalizer localizer = theRequestDetails.getFhirContext().getLocalizer(); - String msg = localizer.getMessage("ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.invalidSearchParameter", paramName, resourceName, allowedParams); + String msg = localizer.getMessage("ca.uhn.fhir.jpa.dao.BaseStorageDao.invalidSearchParameter", paramName, resourceName, allowedParams); throw new InvalidRequestException(msg); } diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AdditionalCompartmentSearchParameters.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AdditionalCompartmentSearchParameters.java index 39e1927e3a5..0db972ee989 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AdditionalCompartmentSearchParameters.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AdditionalCompartmentSearchParameters.java @@ -1,10 +1,29 @@ package ca.uhn.fhir.rest.server.interceptor.auth; +/*- + * #%L + * HAPI FHIR - Server Framework + * %% + * Copyright (C) 2014 - 2021 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import javax.annotation.Nonnull; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; -import java.util.Locale; import java.util.Map; import java.util.Set; diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-autoconfigure/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-autoconfigure/pom.xml index 3447508f8a1..27d720630a4 100644 --- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-autoconfigure/pom.xml +++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-autoconfigure/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-apache/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-apache/pom.xml index 7e39b57ee6a..e3179fe630b 100644 --- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-apache/pom.xml +++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-apache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-spring-boot-samples</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> </parent> <artifactId>hapi-fhir-spring-boot-sample-client-apache</artifactId> diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-okhttp/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-okhttp/pom.xml index 2bc8878adba..07ade17468c 100644 --- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-okhttp/pom.xml +++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-okhttp/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-spring-boot-samples</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> </parent> <artifactId>hapi-fhir-spring-boot-sample-client-okhttp</artifactId> diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-server-jersey/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-server-jersey/pom.xml index 672ce4ae812..fa2568e1d17 100644 --- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-server-jersey/pom.xml +++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-server-jersey/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-spring-boot-samples</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> </parent> <artifactId>hapi-fhir-spring-boot-sample-server-jersey</artifactId> diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/pom.xml index 86d5f76bf7d..e87e9323efd 100644 --- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/pom.xml +++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-spring-boot</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> </parent> <artifactId>hapi-fhir-spring-boot-samples</artifactId> diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-starter/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-starter/pom.xml index ecf05d548c6..636159bb25a 100644 --- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-starter/pom.xml +++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-spring-boot/pom.xml b/hapi-fhir-spring-boot/pom.xml index 01db97a81f7..54e7d58d9ff 100644 --- a/hapi-fhir-spring-boot/pom.xml +++ b/hapi-fhir-spring-boot/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/hapi-fhir-sql-migrate/pom.xml b/hapi-fhir-sql-migrate/pom.xml index e995ed778ee..7f32afd64ad 100644 --- a/hapi-fhir-sql-migrate/pom.xml +++ b/hapi-fhir-sql-migrate/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/BaseMigrator.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/BaseMigrator.java index 18ed02ade1d..110ed65f977 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/BaseMigrator.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/BaseMigrator.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/DriverTypeEnum.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/DriverTypeEnum.java index 89369665502..075b4d6c5ba 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/DriverTypeEnum.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/DriverTypeEnum.java @@ -20,7 +20,7 @@ import java.sql.SQLException; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrationTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrationTask.java index 176b97a1e06..c8993985c7a 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrationTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrationTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrator.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrator.java index 1ed7b1b1971..208b67b9073 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrator.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrator.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/IMigrator.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/IMigrator.java index 770136a5186..9266bf23428 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/IMigrator.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/IMigrator.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java index df3c904f687..110417e4a19 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationTaskSkipper.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationTaskSkipper.java index 5c881e24fd7..ecd5052aa95 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationTaskSkipper.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationTaskSkipper.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/Migrator.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/Migrator.java index 89cbc42aab5..22e2d954814 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/Migrator.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/Migrator.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/SchemaMigrator.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/SchemaMigrator.java index bd844e64149..9ae24ebd650 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/SchemaMigrator.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/SchemaMigrator.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/TaskOnlyMigrator.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/TaskOnlyMigrator.java index 51d7239811f..9068bc2c17a 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/TaskOnlyMigrator.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/TaskOnlyMigrator.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddColumnTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddColumnTask.java index 3680addf24f..c7218af43d6 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddColumnTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddColumnTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddForeignKeyTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddForeignKeyTask.java index b5114fbd198..fed2f4e2c37 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddForeignKeyTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddForeignKeyTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIdGeneratorTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIdGeneratorTask.java index 1bee77991a7..cf85cf4115e 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIdGeneratorTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIdGeneratorTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java index 99e199d46a8..a7f434596c5 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTask.java index d8ac45ae539..56b3c69729a 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableRawSqlTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableRawSqlTask.java index c2a14f44b7b..04e10a899bb 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableRawSqlTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableRawSqlTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ArbitrarySqlTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ArbitrarySqlTask.java index 6b4cd0a8880..1e5929d383d 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ArbitrarySqlTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ArbitrarySqlTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseColumnCalculatorTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseColumnCalculatorTask.java index 4a5163cb398..34894a663b1 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseColumnCalculatorTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseColumnCalculatorTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableColumnTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableColumnTask.java index 8c7fb6050d9..15b8a8b846b 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableColumnTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableColumnTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableColumnTypeTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableColumnTypeTask.java index e693ad81e95..af9e772c835 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableColumnTypeTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableColumnTypeTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableTask.java index ee198c50101..ed2b2ced6b5 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTask.java index 8a19d22beed..b03174c712d 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/CalculateHashesTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/CalculateHashesTask.java index 9bbf22ca633..e14e6c3ed84 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/CalculateHashesTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/CalculateHashesTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/CalculateOrdinalDatesTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/CalculateOrdinalDatesTask.java index 5229c67d203..9d8f5fa0b27 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/CalculateOrdinalDatesTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/CalculateOrdinalDatesTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ColumnTypeEnum.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ColumnTypeEnum.java index 7a552491560..ca6228a8374 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ColumnTypeEnum.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ColumnTypeEnum.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ColumnTypeToDriverTypeToSqlType.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ColumnTypeToDriverTypeToSqlType.java index 3c24d5a281c..1e39671c191 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ColumnTypeToDriverTypeToSqlType.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ColumnTypeToDriverTypeToSqlType.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropColumnTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropColumnTask.java index 3989e420920..c5fe8ab793a 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropColumnTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropColumnTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropForeignKeyTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropForeignKeyTask.java index dbabb523e3c..a7184387d0b 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropForeignKeyTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropForeignKeyTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIdGeneratorTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIdGeneratorTask.java index a5820d4c416..f8467ff83bb 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIdGeneratorTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIdGeneratorTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTask.java index 17634257e17..4a9a7acee6c 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropTableTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropTableTask.java index 7a80a978a2e..c775ba8b674 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropTableTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropTableTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ExecuteRawSqlTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ExecuteRawSqlTask.java index 3964d15645d..f69d4b18b63 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ExecuteRawSqlTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ExecuteRawSqlTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/InitializeSchemaTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/InitializeSchemaTask.java index f573471acff..999d6072dfa 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/InitializeSchemaTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/InitializeSchemaTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ModifyColumnTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ModifyColumnTask.java index 1f665475909..1c62d1e4901 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ModifyColumnTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ModifyColumnTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/NopTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/NopTask.java index c356f38a8a6..acc58f2ac22 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/NopTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/NopTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/RenameColumnTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/RenameColumnTask.java index 7c0401dfedf..9e789c01d71 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/RenameColumnTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/RenameColumnTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/RenameIndexTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/RenameIndexTask.java index 413e2aea409..d2335358645 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/RenameIndexTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/RenameIndexTask.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/SchemaInitializationProvider.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/SchemaInitializationProvider.java index 56444de2d71..8f1b5fbb93d 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/SchemaInitializationProvider.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/SchemaInitializationProvider.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.tasks; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/BaseMigrationTasks.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/BaseMigrationTasks.java index 7af302cc867..7f690a2f04e 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/BaseMigrationTasks.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/BaseMigrationTasks.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.tasks.api; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java index ddceda8a6a3..124af79c7a5 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.tasks.api; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/ISchemaInitializationProvider.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/ISchemaInitializationProvider.java index 1fe70b237e9..25f9a89acf2 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/ISchemaInitializationProvider.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/ISchemaInitializationProvider.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.tasks.api; /*- * #%L - * HAPI FHIR JPA Server - Migration + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/pom.xml b/hapi-fhir-storage/pom.xml similarity index 98% rename from hapi-fhir-storage-api/pom.xml rename to hapi-fhir-storage/pom.xml index e9870a401b0..66dc9f63f7a 100644 --- a/hapi-fhir-storage-api/pom.xml +++ b/hapi-fhir-storage/pom.xml @@ -5,11 +5,11 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> - <artifactId>hapi-fhir-storage-api</artifactId> + <artifactId>hapi-fhir-storage</artifactId> <packaging>jar</packaging> <name>HAPI FHIR Storage api</name> diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java similarity index 99% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java index 062ce21426e..afe94b78c72 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java @@ -27,7 +27,7 @@ import java.util.TreeSet; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/DaoRegistry.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/DaoRegistry.java similarity index 99% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/DaoRegistry.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/DaoRegistry.java index 550cb973e0c..4cfafa237c2 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/DaoRegistry.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/DaoRegistry.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.dao; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IDao.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IDao.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IDao.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IDao.java index fe3e49c5f85..527f08e1552 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IDao.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IDao.java @@ -10,7 +10,7 @@ import java.util.Collection; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDao.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDao.java similarity index 99% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDao.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDao.java index ff8fa2a2303..d95554cc08a 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDao.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDao.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.dao; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoCodeSystem.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoCodeSystem.java similarity index 99% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoCodeSystem.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoCodeSystem.java index bfee55a9d61..f79d0594f8e 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoCodeSystem.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoCodeSystem.java @@ -15,7 +15,7 @@ import java.util.List; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoComposition.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoComposition.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoComposition.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoComposition.java index 94162351315..3059e01f901 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoComposition.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoComposition.java @@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletRequest; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoConceptMap.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoConceptMap.java similarity index 97% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoConceptMap.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoConceptMap.java index ea2b0551037..b4aa162fde2 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoConceptMap.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoConceptMap.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.dao; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoEncounter.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoEncounter.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoEncounter.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoEncounter.java index 66913a3fa58..8da3b33537b 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoEncounter.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoEncounter.java @@ -11,7 +11,7 @@ import javax.servlet.http.HttpServletRequest; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoMessageHeader.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoMessageHeader.java similarity index 97% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoMessageHeader.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoMessageHeader.java index 6c15c9553f1..2ae27309d49 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoMessageHeader.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoMessageHeader.java @@ -4,7 +4,7 @@ import org.hl7.fhir.instance.model.api.IBaseResource; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoObservation.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoObservation.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoObservation.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoObservation.java index 88f6283e72f..c78df02fb88 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoObservation.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoObservation.java @@ -9,7 +9,7 @@ import javax.servlet.http.HttpServletResponse; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoPatient.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoPatient.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoPatient.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoPatient.java index 61b34359226..072d84e1da2 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoPatient.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoPatient.java @@ -13,7 +13,7 @@ import javax.servlet.http.HttpServletRequest; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoSearchParameter.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoSearchParameter.java similarity index 97% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoSearchParameter.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoSearchParameter.java index 63e6d004c7c..1710e15ce9a 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoSearchParameter.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoSearchParameter.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.dao; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoStructureDefinition.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoStructureDefinition.java similarity index 97% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoStructureDefinition.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoStructureDefinition.java index 271b518f388..c08e525d374 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoStructureDefinition.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoStructureDefinition.java @@ -4,7 +4,7 @@ import org.hl7.fhir.instance.model.api.IBaseResource; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoSubscription.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoSubscription.java similarity index 97% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoSubscription.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoSubscription.java index 99e3f1133b6..53350039ba9 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoSubscription.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoSubscription.java @@ -7,7 +7,7 @@ import org.hl7.fhir.instance.model.api.IIdType; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoValueSet.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoValueSet.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoValueSet.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoValueSet.java index c0765bf3a46..0a974c578dd 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoValueSet.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoValueSet.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.dao; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirSystemDao.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirSystemDao.java similarity index 99% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirSystemDao.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirSystemDao.java index ff3a34fc4eb..26cfae738b3 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirSystemDao.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirSystemDao.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.dao; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IJpaDao.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IJpaDao.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IJpaDao.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IJpaDao.java index 595b33a0c3e..9dd79d7befb 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/IJpaDao.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IJpaDao.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.dao; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/MetadataKeyCurrentlyReindexing.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/MetadataKeyCurrentlyReindexing.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/MetadataKeyCurrentlyReindexing.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/MetadataKeyCurrentlyReindexing.java index d059f5de23a..79bb531d071 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/MetadataKeyCurrentlyReindexing.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/MetadataKeyCurrentlyReindexing.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.dao; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/MetadataKeyResourcePid.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/MetadataKeyResourcePid.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/MetadataKeyResourcePid.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/MetadataKeyResourcePid.java index 9a8d77c5fc1..1be84d12450 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/dao/MetadataKeyResourcePid.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/MetadataKeyResourcePid.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.dao; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/DaoMethodOutcome.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/DaoMethodOutcome.java similarity index 99% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/DaoMethodOutcome.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/DaoMethodOutcome.java index c40846bc46d..6979cf5d712 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/DaoMethodOutcome.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/DaoMethodOutcome.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.model; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflict.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflict.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflict.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflict.java index 6181e3cd7af..8250edbf597 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflict.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflict.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.model; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflictList.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflictList.java similarity index 99% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflictList.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflictList.java index 154321f24d0..5d708ed0a2d 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflictList.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflictList.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.model; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteMethodOutcome.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteMethodOutcome.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteMethodOutcome.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteMethodOutcome.java index 00b5aef2fc4..d756dab8253 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteMethodOutcome.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteMethodOutcome.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.model; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/ExpungeOptions.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/ExpungeOptions.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/ExpungeOptions.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/ExpungeOptions.java index cbe1223d839..06db1abf8a4 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/ExpungeOptions.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/ExpungeOptions.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.model; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/ExpungeOutcome.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/ExpungeOutcome.java similarity index 97% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/ExpungeOutcome.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/ExpungeOutcome.java index 07b3f20773a..5f44312a6a8 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/ExpungeOutcome.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/ExpungeOutcome.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.model; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/HistoryCountModeEnum.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/HistoryCountModeEnum.java similarity index 97% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/HistoryCountModeEnum.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/HistoryCountModeEnum.java index f1415d8c282..8bf02a9a93d 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/HistoryCountModeEnum.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/HistoryCountModeEnum.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.model; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/LazyDaoMethodOutcome.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/LazyDaoMethodOutcome.java similarity index 99% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/LazyDaoMethodOutcome.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/LazyDaoMethodOutcome.java index 07caf13ad19..c76c333d7df 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/LazyDaoMethodOutcome.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/LazyDaoMethodOutcome.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.model; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/ResourceVersionConflictResolutionStrategy.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/ResourceVersionConflictResolutionStrategy.java similarity index 97% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/ResourceVersionConflictResolutionStrategy.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/ResourceVersionConflictResolutionStrategy.java index fedff9b9f8c..3441750d16d 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/ResourceVersionConflictResolutionStrategy.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/ResourceVersionConflictResolutionStrategy.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.model; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationQuery.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationQuery.java similarity index 99% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationQuery.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationQuery.java index d8ebd91f0cd..28c89dd9b0f 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationQuery.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationQuery.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.model; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationRequest.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationRequest.java similarity index 99% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationRequest.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationRequest.java index 295e3eeae6f..491c946d199 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationRequest.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationRequest.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.model; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/WarmCacheEntry.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/WarmCacheEntry.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/WarmCacheEntry.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/WarmCacheEntry.java index 0ce5641b023..4b6c75f0982 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/model/WarmCacheEntry.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/WarmCacheEntry.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.model; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/svc/ISearchCoordinatorSvc.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/ISearchCoordinatorSvc.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/svc/ISearchCoordinatorSvc.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/ISearchCoordinatorSvc.java index 5a7f1c003f5..ede20bdd86b 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/api/svc/ISearchCoordinatorSvc.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/ISearchCoordinatorSvc.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.api.svc; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/api/IBulkDataImportSvc.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/api/IBulkDataImportSvc.java similarity index 99% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/api/IBulkDataImportSvc.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/api/IBulkDataImportSvc.java index bee8178441d..73e339c4d8f 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/api/IBulkDataImportSvc.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/api/IBulkDataImportSvc.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.bulk.imprt.api; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobFileJson.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobFileJson.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobFileJson.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobFileJson.java index bc44aea61d1..6bb0c09c108 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobFileJson.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobFileJson.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.bulk.imprt.model; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobJson.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobJson.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobJson.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobJson.java index 32e541cb620..c0fd522c955 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobJson.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobJson.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.bulk.imprt.model; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobStatusEnum.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobStatusEnum.java similarity index 97% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobStatusEnum.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobStatusEnum.java index e13c2ebd92b..17c02242d05 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobStatusEnum.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobStatusEnum.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.bulk.imprt.model; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/JobFileRowProcessingModeEnum.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/JobFileRowProcessingModeEnum.java similarity index 97% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/JobFileRowProcessingModeEnum.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/JobFileRowProcessingModeEnum.java index fd9365dfb9d..9742c7141fb 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/JobFileRowProcessingModeEnum.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/JobFileRowProcessingModeEnum.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.bulk.imprt.model; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/ParsedBulkImportRecord.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/ParsedBulkImportRecord.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/ParsedBulkImportRecord.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/ParsedBulkImportRecord.java index bb32691449f..0913e9cdc07 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/ParsedBulkImportRecord.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/ParsedBulkImportRecord.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.bulk.imprt.model; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseStorageDao.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/BaseStorageDao.java similarity index 90% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseStorageDao.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/BaseStorageDao.java index a8ee4cf93e7..4ba839e0c33 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseStorageDao.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/BaseStorageDao.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.dao; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% @@ -39,6 +39,7 @@ import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; import ca.uhn.fhir.jpa.searchparam.util.JpaParamUtil; import ca.uhn.fhir.model.api.IQueryParameterAnd; import ca.uhn.fhir.rest.api.QualifiedParamList; +import ca.uhn.fhir.rest.api.RestOperationTypeEnum; import ca.uhn.fhir.rest.api.server.IPreResourceAccessDetails; import ca.uhn.fhir.rest.api.server.IPreResourceShowDetails; import ca.uhn.fhir.rest.api.server.RequestDetails; @@ -47,10 +48,12 @@ import ca.uhn.fhir.rest.api.server.SimplePreResourceShowDetails; import ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId; import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; import ca.uhn.fhir.rest.param.QualifierDetails; +import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.exceptions.ResourceGoneException; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; +import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.rest.server.util.CompositeInterceptorBroadcaster; import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; @@ -80,12 +83,15 @@ import java.util.Map; import java.util.Set; import java.util.function.Supplier; -import static ca.uhn.fhir.jpa.dao.BaseHapiFhirDao.OO_SEVERITY_ERROR; -import static ca.uhn.fhir.jpa.dao.BaseHapiFhirDao.OO_SEVERITY_INFO; import static org.apache.commons.lang3.StringUtils.defaultString; import static org.apache.commons.lang3.StringUtils.isNotBlank; public abstract class BaseStorageDao { + public static final String OO_SEVERITY_ERROR = "error"; + public static final String OO_SEVERITY_INFO = "information"; + public static final String OO_SEVERITY_WARN = "warning"; + private static final String PROCESSING_SUB_REQUEST = "BaseStorageDao.processingSubRequest"; + @Autowired protected ISearchParamRegistry mySearchParamRegistry; @Autowired @@ -99,6 +105,42 @@ public abstract class BaseStorageDao { @Autowired protected DaoConfig myDaoConfig; + /** + * @see ModelConfig#getAutoVersionReferenceAtPaths() + */ + @Nonnull + public static Set<IBaseReference> extractReferencesToAutoVersion(FhirContext theFhirContext, ModelConfig theModelConfig, IBaseResource theResource) { + Map<IBaseReference, Object> references = Collections.emptyMap(); + if (!theModelConfig.getAutoVersionReferenceAtPaths().isEmpty()) { + String resourceName = theFhirContext.getResourceType(theResource); + for (String nextPath : theModelConfig.getAutoVersionReferenceAtPathsByResourceType(resourceName)) { + List<IBaseReference> nextReferences = theFhirContext.newTerser().getValues(theResource, nextPath, IBaseReference.class); + for (IBaseReference next : nextReferences) { + if (next.getReferenceElement().hasVersionIdPart()) { + continue; + } + if (references.isEmpty()) { + references = new IdentityHashMap<>(); + } + references.put(next, null); + } + } + } + return references.keySet(); + } + + public static void clearRequestAsProcessingSubRequest(RequestDetails theRequestDetails) { + if (theRequestDetails != null) { + theRequestDetails.getUserData().remove(PROCESSING_SUB_REQUEST); + } + } + + public static void markRequestAsProcessingSubRequest(RequestDetails theRequestDetails) { + if (theRequestDetails != null) { + theRequestDetails.getUserData().put(PROCESSING_SUB_REQUEST, Boolean.TRUE); + } + } + @VisibleForTesting public void setSearchParamRegistry(ISearchParamRegistry theSearchParamRegistry) { mySearchParamRegistry = theSearchParamRegistry; @@ -140,7 +182,7 @@ public abstract class BaseStorageDao { private void verifyResourceTypeIsAppropriateForDao(IBaseResource theResource) { String type = getContext().getResourceType(theResource); if (getResourceName() != null && !getResourceName().equals(type)) { - throw new InvalidRequestException(getContext().getLocalizer().getMessageSanitized(BaseHapiFhirResourceDao.class, "incorrectResourceType", type, getResourceName())); + throw new InvalidRequestException(getContext().getLocalizer().getMessageSanitized(BaseStorageDao.class, "incorrectResourceType", type, getResourceName())); } } @@ -150,7 +192,7 @@ public abstract class BaseStorageDao { private void verifyResourceIdIsValid(IBaseResource theResource) { if (theResource.getIdElement().hasIdPart()) { if (!theResource.getIdElement().isIdPartValid()) { - throw new InvalidRequestException(getContext().getLocalizer().getMessageSanitized(BaseHapiFhirResourceDao.class, "failedToCreateWithInvalidId", theResource.getIdElement().getIdPart())); + throw new InvalidRequestException(getContext().getLocalizer().getMessageSanitized(BaseStorageDao.class, "failedToCreateWithInvalidId", theResource.getIdElement().getIdPart())); } } } @@ -230,8 +272,7 @@ public abstract class BaseStorageDao { // but autcreateplaceholders is on // then the version will be 1 (the first version) version = 1L; - } - else { + } else { // resource not found // and no autocreateplaceholders set... // we throw @@ -307,7 +348,7 @@ public abstract class BaseStorageDao { outcome.setEntitySupplier(theEntity); outcome.setIdSupplier(theIdSupplier); - outcome.setEntitySupplierUseCallback(()->{ + outcome.setEntitySupplierUseCallback(() -> { // Interceptor broadcast: STORAGE_PREACCESS_RESOURCES if (outcome.getResource() != null) { SimplePreResourceAccessDetails accessDetails = new SimplePreResourceAccessDetails(outcome.getResource()); @@ -341,7 +382,6 @@ public abstract class BaseStorageDao { return outcome; } - protected void doCallHooks(TransactionDetails theTransactionDetails, RequestDetails theRequestDetails, Pointcut thePointcut, HookParams theParams) { if (theTransactionDetails.isAcceptingDeferredInterceptorBroadcasts(thePointcut)) { theTransactionDetails.addDeferredInterceptorBroadcast(thePointcut, theParams); @@ -406,7 +446,7 @@ public abstract class BaseStorageDao { RuntimeSearchParam param = searchParams.get(qualifiedParamName.getParamName()); if (param == null) { Collection<String> validNames = mySearchParamRegistry.getValidSearchParameterNamesIncludingMeta(getResourceName()); - String msg = getContext().getLocalizer().getMessageSanitized(BaseHapiFhirResourceDao.class, "invalidSearchParameter", qualifiedParamName.getParamName(), getResourceName(), validNames); + String msg = getContext().getLocalizer().getMessageSanitized(BaseStorageDao.class, "invalidSearchParameter", qualifiedParamName.getParamName(), getResourceName(), validNames); throw new InvalidRequestException(msg); } @@ -423,28 +463,16 @@ public abstract class BaseStorageDao { } } - /** - * @see ModelConfig#getAutoVersionReferenceAtPaths() - */ - @Nonnull - public static Set<IBaseReference> extractReferencesToAutoVersion(FhirContext theFhirContext, ModelConfig theModelConfig, IBaseResource theResource) { - Map<IBaseReference, Object> references = Collections.emptyMap(); - if (!theModelConfig.getAutoVersionReferenceAtPaths().isEmpty()) { - String resourceName = theFhirContext.getResourceType(theResource); - for (String nextPath : theModelConfig.getAutoVersionReferenceAtPathsByResourceType(resourceName)) { - List<IBaseReference> nextReferences = theFhirContext.newTerser().getValues(theResource, nextPath, IBaseReference.class); - for (IBaseReference next : nextReferences) { - if (next.getReferenceElement().hasVersionIdPart()) { - continue; - } - if (references.isEmpty()) { - references = new IdentityHashMap<>(); - } - references.put(next, null); - } + public void notifyInterceptors(RestOperationTypeEnum theOperationType, IServerInterceptor.ActionRequestDetails theRequestDetails) { + if (theRequestDetails.getId() != null && theRequestDetails.getId().hasResourceType() && isNotBlank(theRequestDetails.getResourceType())) { + if (theRequestDetails.getId().getResourceType().equals(theRequestDetails.getResourceType()) == false) { + throw new InternalErrorException( + "Inconsistent server state - Resource types don't match: " + theRequestDetails.getId().getResourceType() + " / " + theRequestDetails.getResourceType()); } } - return references.keySet(); - } + if (theRequestDetails.getUserData().get(PROCESSING_SUB_REQUEST) == Boolean.TRUE) { + theRequestDetails.notifyIncomingRequestPreHandled(theOperationType); + } + } } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java similarity index 94% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java index a5830be5107..c5f1c77f992 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.dao; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% @@ -39,7 +39,7 @@ import ca.uhn.fhir.jpa.api.model.LazyDaoMethodOutcome; import ca.uhn.fhir.jpa.cache.IResourceVersionSvc; import ca.uhn.fhir.jpa.cache.ResourcePersistentIdMap; import ca.uhn.fhir.jpa.dao.tx.HapiTransactionService; -import ca.uhn.fhir.jpa.delete.DeleteConflictService; +import ca.uhn.fhir.jpa.delete.DeleteConflictUtil; import ca.uhn.fhir.jpa.model.cross.IBasePersistedResource; import ca.uhn.fhir.jpa.model.entity.ModelConfig; import ca.uhn.fhir.jpa.model.entity.ResourceTable; @@ -92,7 +92,6 @@ import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseBinary; import org.hl7.fhir.instance.model.api.IBaseBundle; -import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; import org.hl7.fhir.instance.model.api.IBaseParameters; import org.hl7.fhir.instance.model.api.IBaseReference; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -139,8 +138,8 @@ public abstract class BaseTransactionProcessor { public static final String URN_PREFIX = "urn:"; public static final Pattern UNQUALIFIED_MATCH_URL_START = Pattern.compile("^[a-zA-Z0-9_]+="); - private static final Logger ourLog = LoggerFactory.getLogger(TransactionProcessor.class); - private BaseHapiFhirDao myDao; + private static final Logger ourLog = LoggerFactory.getLogger(BaseTransactionProcessor.class); + private BaseStorageDao myDao; @Autowired private PlatformTransactionManager myTxManager; @Autowired @@ -164,11 +163,22 @@ public abstract class BaseTransactionProcessor { @Autowired private SearchParamMatcher mySearchParamMatcher; - private TaskExecutor myExecutor ; + private TaskExecutor myExecutor; @Autowired private IResourceVersionSvc myResourceVersionSvc; + public static boolean isPlaceholder(IIdType theId) { + if (theId != null && theId.getValue() != null) { + return theId.getValue().startsWith("urn:oid:") || theId.getValue().startsWith("urn:uuid:"); + } + return false; + } + + private static String toStatusString(int theStatusCode) { + return theStatusCode + " " + defaultString(Constants.HTTP_STATUS_NAMES.get(theStatusCode)); + } + @VisibleForTesting public void setDaoConfig(DaoConfig theDaoConfig) { myDaoConfig = theDaoConfig; @@ -307,7 +317,8 @@ public abstract class BaseTransactionProcessor { } - /** Method which populates entry in idToPersistedOutcome. + /** + * Method which populates entry in idToPersistedOutcome. * Will store whatever outcome is sent, unless the key already exists, then we only replace an instance if we find that the instance * we are replacing with is non-lazy. This allows us to evaluate later more easily, as we _know_ we need access to these. */ @@ -350,16 +361,16 @@ public abstract class BaseTransactionProcessor { return defaultString(theId.getValue()).startsWith(URN_PREFIX); } - public void setDao(BaseHapiFhirDao theDao) { + public void setDao(BaseStorageDao theDao) { myDao = theDao; } private IBaseBundle processTransactionAsSubRequest(RequestDetails theRequestDetails, IBaseBundle theRequest, String theActionName, boolean theNestedMode) { - BaseHapiFhirDao.markRequestAsProcessingSubRequest(theRequestDetails); + BaseStorageDao.markRequestAsProcessingSubRequest(theRequestDetails); try { return processTransaction(theRequestDetails, theRequest, theActionName, theNestedMode); } finally { - BaseHapiFhirDao.clearRequestAsProcessingSubRequest(theRequestDetails); + BaseStorageDao.clearRequestAsProcessingSubRequest(theRequestDetails); } } @@ -378,17 +389,17 @@ public abstract class BaseTransactionProcessor { IBaseBundle response = myVersionAdapter.createBundle(org.hl7.fhir.r4.model.Bundle.BundleType.BATCHRESPONSE.toCode()); Map<Integer, Object> responseMap = new ConcurrentHashMap<>(); - + List<IBase> requestEntries = myVersionAdapter.getEntries(theRequest); int requestEntriesSize = requestEntries.size(); - // And execute for each entry in parallel as a mini-transaction in its + // And execute for each entry in parallel as a mini-transaction in its // own database transaction so that if one fails, it doesn't prevent others. // The result is keep in the map to save the original position CountDownLatch completionLatch = new CountDownLatch(requestEntriesSize); IBase nextRequestEntry = null; - for (int i=0; i<requestEntriesSize; i++ ) { + for (int i = 0; i < requestEntriesSize; i++) { nextRequestEntry = requestEntries.get(i); RetriableBundleTask retriableBundleTask = new RetriableBundleTask(completionLatch, theRequestDetails, responseMap, i, nextRequestEntry, theNestedMode); getTaskExecutor().execute(retriableBundleTask); @@ -396,24 +407,24 @@ public abstract class BaseTransactionProcessor { // waiting for all tasks to be completed AsyncUtil.awaitLatchAndIgnoreInterrupt(completionLatch, 300L, TimeUnit.SECONDS); - + // Now, create the bundle response in original order Object nextResponseEntry; - for (int i=0; i<requestEntriesSize; i++ ) { - + for (int i = 0; i < requestEntriesSize; i++) { + nextResponseEntry = responseMap.get(i); if (nextResponseEntry instanceof BaseServerResponseExceptionHolder) { - BaseServerResponseExceptionHolder caughtEx = (BaseServerResponseExceptionHolder)nextResponseEntry; + BaseServerResponseExceptionHolder caughtEx = (BaseServerResponseExceptionHolder) nextResponseEntry; if (caughtEx.getException() != null) { IBase nextEntry = myVersionAdapter.addEntry(response); populateEntryWithOperationOutcome(caughtEx.getException(), nextEntry); myVersionAdapter.setResponseStatus(nextEntry, toStatusString(caughtEx.getException().getStatusCode())); - } + } } else { - myVersionAdapter.addEntry(response, (IBase)nextResponseEntry); + myVersionAdapter.addEntry(response, (IBase) nextResponseEntry); } } - + long delay = System.currentTimeMillis() - start; ourLog.info("Batch completed in {}ms", delay); @@ -463,7 +474,7 @@ public abstract class BaseTransactionProcessor { IBase nextReqEntry = requestEntries.get(i); String verb = myVersionAdapter.getEntryRequestVerb(myContext, nextReqEntry); if (verb == null || !isValidVerb(verb)) { - throw new InvalidRequestException(myContext.getLocalizer().getMessage(BaseHapiFhirSystemDao.class, "transactionEntryHasInvalidVerb", verb, i)); + throw new InvalidRequestException(myContext.getLocalizer().getMessage(BaseStorageDao.class, "transactionEntryHasInvalidVerb", verb, i)); } } @@ -612,7 +623,7 @@ public abstract class BaseTransactionProcessor { TransactionDetails theTransactionDetails, StopWatch theTransactionStopWatch, IBaseBundle theResponse, IdentityHashMap<IBase, Integer> theOriginalRequestOrder, List<IBase> theEntries) { - + TransactionWriteOperationsDetails writeOperationsDetails = null; if (haveWriteOperationsHooks(theRequestDetails)) { writeOperationsDetails = buildWriteOperationsDetails(theEntries); @@ -665,12 +676,11 @@ public abstract class BaseTransactionProcessor { CompositeInterceptorBroadcaster.doCallHooks(myInterceptorBroadcaster, theRequestDetails, thePointcut, params); } - private TransactionWriteOperationsDetails buildWriteOperationsDetails(List<IBase> theEntries) { TransactionWriteOperationsDetails writeOperationsDetails; List<String> updateRequestUrls = new ArrayList<>(); List<String> conditionalCreateRequestUrls = new ArrayList<>(); - //Extract + //Extract for (IBase nextEntry : theEntries) { String method = myVersionAdapter.getEntryRequestVerb(myContext, nextEntry); if ("PUT".equals(method)) { @@ -804,14 +814,15 @@ public abstract class BaseTransactionProcessor { /** * Retrieves the next resource id (IIdType) from the base resource and next request entry. + * * @param theBaseResource - base resource * @param theNextReqEntry - next request entry - * @param theAllIds - set of all IIdType values + * @param theAllIds - set of all IIdType values * @return */ private IIdType getNextResourceIdFromBaseResource(IBaseResource theBaseResource, - IBase theNextReqEntry, - Set<IIdType> theAllIds) { + IBase theNextReqEntry, + Set<IIdType> theAllIds) { IIdType nextResourceId = null; if (theBaseResource != null) { nextResourceId = theBaseResource.getIdElement(); @@ -840,12 +851,12 @@ public abstract class BaseTransactionProcessor { */ if (isPlaceholder(nextResourceId)) { if (!theAllIds.add(nextResourceId)) { - throw new InvalidRequestException(myContext.getLocalizer().getMessage(BaseHapiFhirSystemDao.class, "transactionContainsMultipleWithDuplicateId", nextResourceId)); + throw new InvalidRequestException(myContext.getLocalizer().getMessage(BaseStorageDao.class, "transactionContainsMultipleWithDuplicateId", nextResourceId)); } } else if (nextResourceId.hasResourceType() && nextResourceId.hasIdPart()) { IIdType nextId = nextResourceId.toUnqualifiedVersionless(); if (!theAllIds.add(nextId)) { - throw new InvalidRequestException(myContext.getLocalizer().getMessage(BaseHapiFhirSystemDao.class, "transactionContainsMultipleWithDuplicateId", nextId)); + throw new InvalidRequestException(myContext.getLocalizer().getMessage(BaseStorageDao.class, "transactionContainsMultipleWithDuplicateId", nextId)); } } @@ -854,8 +865,8 @@ public abstract class BaseTransactionProcessor { return nextResourceId; } - /** After pre-hooks have been called - * + /** + * After pre-hooks have been called */ protected Map<IBase, IIdType> doTransactionWriteOperations(final RequestDetails theRequest, String theActionName, TransactionDetails theTransactionDetails, Set<IIdType> theAllIds, @@ -882,7 +893,7 @@ public abstract class BaseTransactionProcessor { /* * Look for duplicate conditional creates and consolidate them */ - consolidateDuplicateConditionals(theEntries); + consolidateDuplicateConditionals(theEntries); /* * Loop through the request and process any entries of type @@ -1034,7 +1045,7 @@ public abstract class BaseTransactionProcessor { contentType = binary.getContentType(); patchType = PatchTypeEnum.forContentTypeOrThrowInvalidRequestException(myContext, contentType); if (patchType == PatchTypeEnum.FHIR_PATCH_JSON || patchType == PatchTypeEnum.FHIR_PATCH_XML) { - String msg = myContext.getLocalizer().getMessage(TransactionProcessor.class, "fhirPatchShouldNotUseBinaryResource"); + String msg = myContext.getLocalizer().getMessage(BaseTransactionProcessor.class, "fhirPatchShouldNotUseBinaryResource"); throw new InvalidRequestException(msg); } } else if (res instanceof IBaseParameters) { @@ -1044,7 +1055,7 @@ public abstract class BaseTransactionProcessor { if (patchBodyParameters == null) { if (isBlank(patchBody)) { - String msg = myContext.getLocalizer().getMessage(TransactionProcessor.class, "missingPatchBody"); + String msg = myContext.getLocalizer().getMessage(BaseTransactionProcessor.class, "missingPatchBody"); throw new InvalidRequestException(msg); } } @@ -1165,6 +1176,7 @@ public abstract class BaseTransactionProcessor { /** * After transaction processing and resolution of indexes and references, we want to validate that the resources that were stored _actually_ * match the conditional URLs that they were brought in on. + * * @param theIdToPersistedOutcome * @param conditionalUrlToIdMap */ @@ -1183,7 +1195,8 @@ public abstract class BaseTransactionProcessor { if (match.supported()) { if (!match.matched()) { throw new PreconditionFailedException("Invalid conditional URL \"" + matchUrl + "\". The given resource is not matched by this URL."); - }; + } + ; } } }); @@ -1191,13 +1204,14 @@ public abstract class BaseTransactionProcessor { /** * Checks for any delete conflicts. - * @param theDeleteConflicts - set of delete conflicts + * + * @param theDeleteConflicts - set of delete conflicts * @param theDeletedResources - set of deleted resources * @param theUpdatedResources - list of updated resources */ private void checkForDeleteConflicts(DeleteConflictList theDeleteConflicts, - Set<String> theDeletedResources, - List<IBaseResource> theUpdatedResources) { + Set<String> theDeletedResources, + List<IBaseResource> theUpdatedResources) { for (Iterator<DeleteConflict> iter = theDeleteConflicts.iterator(); iter.hasNext(); ) { DeleteConflict nextDeleteConflict = iter.next(); @@ -1233,7 +1247,7 @@ public abstract class BaseTransactionProcessor { } } } - DeleteConflictService.validateDeleteConflictsEmptyOrThrowException(myContext, theDeleteConflicts); + DeleteConflictUtil.validateDeleteConflictsEmptyOrThrowException(myContext, theDeleteConflicts); } /** @@ -1527,7 +1541,7 @@ public abstract class BaseTransactionProcessor { private void validateResourcePresent(IBaseResource theResource, Integer theOrder, String theVerb) { if (theResource == null) { - String msg = myContext.getLocalizer().getMessage(TransactionProcessor.class, "missingMandatoryResource", theVerb, theOrder); + String msg = myContext.getLocalizer().getMessage(BaseTransactionProcessor.class, "missingMandatoryResource", theVerb, theOrder); throw new InvalidRequestException(msg); } } @@ -1568,7 +1582,7 @@ public abstract class BaseTransactionProcessor { private String extractTransactionUrlOrThrowException(IBase nextEntry, String verb) { String url = myVersionAdapter.getEntryRequestUrl(nextEntry); if (isBlank(url)) { - throw new InvalidRequestException(myContext.getLocalizer().getMessage(BaseHapiFhirSystemDao.class, "transactionMissingUrl", verb)); + throw new InvalidRequestException(myContext.getLocalizer().getMessage(BaseStorageDao.class, "transactionMissingUrl", verb)); } return url; } @@ -1578,7 +1592,7 @@ public abstract class BaseTransactionProcessor { try { resType = myContext.getResourceDefinition(theParts.getResourceType()); } catch (DataFormatException e) { - String msg = myContext.getLocalizer().getMessage(BaseHapiFhirSystemDao.class, "transactionInvalidUrl", theVerb, theUrl); + String msg = myContext.getLocalizer().getMessage(BaseStorageDao.class, "transactionInvalidUrl", theVerb, theUrl); throw new InvalidRequestException(msg); } IFhirResourceDao<? extends IBaseResource> dao = null; @@ -1586,15 +1600,10 @@ public abstract class BaseTransactionProcessor { dao = myDaoRegistry.getResourceDao(resType.getImplementingClass()); } if (dao == null) { - String msg = myContext.getLocalizer().getMessage(BaseHapiFhirSystemDao.class, "transactionInvalidUrl", theVerb, theUrl); + String msg = myContext.getLocalizer().getMessage(BaseStorageDao.class, "transactionInvalidUrl", theVerb, theUrl); throw new InvalidRequestException(msg); } - // if (theParts.getResourceId() == null && theParts.getParams() == null) { - // String msg = getContext().getLocalizer().getMessage(BaseHapiFhirSystemDao.class, "transactionInvalidUrl", theVerb, theUrl); - // throw new InvalidRequestException(msg); - // } - return dao; } @@ -1616,51 +1625,16 @@ public abstract class BaseTransactionProcessor { return null; } - public interface ITransactionProcessorVersionAdapter<BUNDLE extends IBaseBundle, BUNDLEENTRY extends IBase> { + private static class BaseServerResponseExceptionHolder { + private BaseServerResponseException myException; - void setResponseStatus(BUNDLEENTRY theBundleEntry, String theStatus); + public BaseServerResponseException getException() { + return myException; + } - void setResponseLastModified(BUNDLEENTRY theBundleEntry, Date theLastModified); - - void setResource(BUNDLEENTRY theBundleEntry, IBaseResource theResource); - - IBaseResource getResource(BUNDLEENTRY theBundleEntry); - - String getBundleType(BUNDLE theRequest); - - void populateEntryWithOperationOutcome(BaseServerResponseException theCaughtEx, BUNDLEENTRY theEntry); - - BUNDLE createBundle(String theBundleType); - - List<BUNDLEENTRY> getEntries(BUNDLE theRequest); - - void addEntry(BUNDLE theBundle, BUNDLEENTRY theEntry); - - BUNDLEENTRY addEntry(BUNDLE theBundle); - - String getEntryRequestVerb(FhirContext theContext, BUNDLEENTRY theEntry); - - String getFullUrl(BUNDLEENTRY theEntry); - - String getEntryIfNoneExist(BUNDLEENTRY theEntry); - - String getEntryRequestUrl(BUNDLEENTRY theEntry); - - void setResponseLocation(BUNDLEENTRY theEntry, String theResponseLocation); - - void setResponseETag(BUNDLEENTRY theEntry, String theEtag); - - String getEntryRequestIfMatch(BUNDLEENTRY theEntry); - - String getEntryRequestIfNoneExist(BUNDLEENTRY theEntry); - - String getEntryRequestIfNoneMatch(BUNDLEENTRY theEntry); - - void setResponseOutcome(BUNDLEENTRY theEntry, IBaseOperationOutcome theOperationOutcome); - - void setRequestVerb(BUNDLEENTRY theEntry, String theVerb); - - void setRequestUrl(BUNDLEENTRY theEntry, String theUrl); + public void setException(BaseServerResponseException myException) { + this.myException = myException; + } } /** @@ -1755,29 +1729,6 @@ public abstract class BaseTransactionProcessor { } - private static class BaseServerResponseExceptionHolder { - private BaseServerResponseException myException; - - public BaseServerResponseException getException() { - return myException; - } - - public void setException(BaseServerResponseException myException) { - this.myException = myException; - } - } - - public static boolean isPlaceholder(IIdType theId) { - if (theId != null && theId.getValue() != null) { - return theId.getValue().startsWith("urn:oid:") || theId.getValue().startsWith("urn:uuid:"); - } - return false; - } - - private static String toStatusString(int theStatusCode) { - return theStatusCode + " " + defaultString(Constants.HTTP_STATUS_NAMES.get(theStatusCode)); - } - public class RetriableBundleTask implements Runnable { private final CountDownLatch myCompletedLatch; @@ -1804,7 +1755,7 @@ public abstract class BaseTransactionProcessor { IBaseBundle nextResponseBundle = processTransactionAsSubRequest(myRequestDetails, subRequestBundle, "Batch sub-request", myNestedMode); - IBase subResponseEntry = (IBase) myVersionAdapter.getEntries(nextResponseBundle).get(0); + IBase subResponseEntry = (IBase) myVersionAdapter.getEntries(nextResponseBundle).get(0); myResponseMap.put(myResponseOrder, subResponseEntry); /* @@ -1815,9 +1766,10 @@ public abstract class BaseTransactionProcessor { myResponseMap.put(myResponseOrder, nextResponseBundleFirstEntry); } } + private boolean processBatchEntryWithRetry() { - int maxAttempts =3; - for (int attempt = 1;; attempt++) { + int maxAttempts = 3; + for (int attempt = 1; ; attempt++) { try { processBatchEntry(); return true; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/DaoFailureUtil.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/DaoFailureUtil.java similarity index 97% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/DaoFailureUtil.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/DaoFailureUtil.java index ad27290f96c..51896e78f3c 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/DaoFailureUtil.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/DaoFailureUtil.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.dao; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/DaoSearchParamProvider.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/DaoSearchParamProvider.java similarity index 92% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/DaoSearchParamProvider.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/DaoSearchParamProvider.java index 66889dd7b3e..3d4c854eff8 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/DaoSearchParamProvider.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/DaoSearchParamProvider.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.dao; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% @@ -29,11 +29,7 @@ import ca.uhn.fhir.rest.api.server.IBundleProvider; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Primary; -import org.springframework.stereotype.Service; -@Service -@Primary public class DaoSearchParamProvider implements ISearchParamProvider { @Autowired diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/dao/GZipUtil.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/GZipUtil.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/dao/GZipUtil.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/GZipUtil.java index f038024e684..2bab0d164d9 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/dao/GZipUtil.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/GZipUtil.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.dao; /* * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/ITransactionProcessorVersionAdapter.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/ITransactionProcessorVersionAdapter.java new file mode 100644 index 00000000000..c19583e642b --- /dev/null +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/ITransactionProcessorVersionAdapter.java @@ -0,0 +1,78 @@ +package ca.uhn.fhir.jpa.dao; + +/*- + * #%L + * HAPI FHIR Storage api + * %% + * Copyright (C) 2014 - 2021 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; +import org.hl7.fhir.instance.model.api.IBase; +import org.hl7.fhir.instance.model.api.IBaseBundle; +import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; +import org.hl7.fhir.instance.model.api.IBaseResource; + +import java.util.Date; +import java.util.List; + +public interface ITransactionProcessorVersionAdapter<BUNDLE extends IBaseBundle, BUNDLEENTRY extends IBase> { + + void setResponseStatus(BUNDLEENTRY theBundleEntry, String theStatus); + + void setResponseLastModified(BUNDLEENTRY theBundleEntry, Date theLastModified); + + void setResource(BUNDLEENTRY theBundleEntry, IBaseResource theResource); + + IBaseResource getResource(BUNDLEENTRY theBundleEntry); + + String getBundleType(BUNDLE theRequest); + + void populateEntryWithOperationOutcome(BaseServerResponseException theCaughtEx, BUNDLEENTRY theEntry); + + BUNDLE createBundle(String theBundleType); + + List<BUNDLEENTRY> getEntries(BUNDLE theRequest); + + void addEntry(BUNDLE theBundle, BUNDLEENTRY theEntry); + + BUNDLEENTRY addEntry(BUNDLE theBundle); + + String getEntryRequestVerb(FhirContext theContext, BUNDLEENTRY theEntry); + + String getFullUrl(BUNDLEENTRY theEntry); + + String getEntryIfNoneExist(BUNDLEENTRY theEntry); + + String getEntryRequestUrl(BUNDLEENTRY theEntry); + + void setResponseLocation(BUNDLEENTRY theEntry, String theResponseLocation); + + void setResponseETag(BUNDLEENTRY theEntry, String theEtag); + + String getEntryRequestIfMatch(BUNDLEENTRY theEntry); + + String getEntryRequestIfNoneExist(BUNDLEENTRY theEntry); + + String getEntryRequestIfNoneMatch(BUNDLEENTRY theEntry); + + void setResponseOutcome(BUNDLEENTRY theEntry, IBaseOperationOutcome theOperationOutcome); + + void setRequestVerb(BUNDLEENTRY theEntry, String theVerb); + + void setRequestUrl(BUNDLEENTRY theEntry, String theUrl); +} diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/MatchResourceUrlService.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/MatchResourceUrlService.java similarity index 99% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/MatchResourceUrlService.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/MatchResourceUrlService.java index 83c544f0c1c..9ba74bb5921 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/MatchResourceUrlService.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/MatchResourceUrlService.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.dao; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/TransactionProcessorVersionAdapterDstu3.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/TransactionProcessorVersionAdapterDstu3.java similarity index 97% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/TransactionProcessorVersionAdapterDstu3.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/TransactionProcessorVersionAdapterDstu3.java index 511ad73d8bd..73af50d3171 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/TransactionProcessorVersionAdapterDstu3.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/TransactionProcessorVersionAdapterDstu3.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.dao.dstu3; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% @@ -21,7 +21,7 @@ package ca.uhn.fhir.jpa.dao.dstu3; */ import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.jpa.dao.TransactionProcessor; +import ca.uhn.fhir.jpa.dao.ITransactionProcessorVersionAdapter; import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.util.BundleUtil; @@ -37,7 +37,7 @@ import java.util.List; import static org.apache.commons.lang3.StringUtils.isBlank; -public class TransactionProcessorVersionAdapterDstu3 implements TransactionProcessor.ITransactionProcessorVersionAdapter<Bundle, Bundle.BundleEntryComponent> { +public class TransactionProcessorVersionAdapterDstu3 implements ITransactionProcessorVersionAdapter<Bundle, Bundle.BundleEntryComponent> { @Override public void setResponseStatus(Bundle.BundleEntryComponent theBundleEntry, String theStatus) { theBundleEntry.getResponse().setStatus(theStatus); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/TransactionProcessorVersionAdapterR4.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/r4/TransactionProcessorVersionAdapterR4.java similarity index 95% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/TransactionProcessorVersionAdapterR4.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/r4/TransactionProcessorVersionAdapterR4.java index 4a9987266d4..c2a61f67c5a 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/TransactionProcessorVersionAdapterR4.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/r4/TransactionProcessorVersionAdapterR4.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.dao.r4; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% @@ -21,7 +21,7 @@ package ca.uhn.fhir.jpa.dao.r4; */ import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.jpa.dao.TransactionProcessor; +import ca.uhn.fhir.jpa.dao.ITransactionProcessorVersionAdapter; import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import org.hl7.fhir.exceptions.FHIRException; @@ -34,7 +34,7 @@ import org.hl7.fhir.r4.model.Resource; import java.util.Date; import java.util.List; -public class TransactionProcessorVersionAdapterR4 implements TransactionProcessor.ITransactionProcessorVersionAdapter<Bundle, Bundle.BundleEntryComponent> { +public class TransactionProcessorVersionAdapterR4 implements ITransactionProcessorVersionAdapter<Bundle, Bundle.BundleEntryComponent> { @Override public void setResponseStatus(Bundle.BundleEntryComponent theBundleEntry, String theStatus) { theBundleEntry.getResponse().setStatus(theStatus); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/tx/HapiTransactionService.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/tx/HapiTransactionService.java similarity index 85% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/tx/HapiTransactionService.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/tx/HapiTransactionService.java index 200ac7a6861..923f0e0ecf2 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/tx/HapiTransactionService.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/tx/HapiTransactionService.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.dao.tx; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% @@ -24,7 +24,6 @@ import ca.uhn.fhir.interceptor.api.HookParams; import ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster; import ca.uhn.fhir.interceptor.api.Pointcut; import ca.uhn.fhir.jpa.api.model.ResourceVersionConflictResolutionStrategy; -import ca.uhn.fhir.jpa.dao.BaseHapiFhirDao; import ca.uhn.fhir.jpa.dao.DaoFailureUtil; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; @@ -48,6 +47,8 @@ import javax.annotation.PostConstruct; public class HapiTransactionService { + public static final String XACT_USERDATA_KEY_RESOLVED_TAG_DEFINITIONS = HapiTransactionService.class.getName() + "_RESOLVED_TAG_DEFINITIONS"; + public static final String XACT_USERDATA_KEY_EXISTING_SEARCH_PARAMS = HapiTransactionService.class.getName() + "_EXISTING_SEARCH_PARAMS"; private static final Logger ourLog = LoggerFactory.getLogger(HapiTransactionService.class); @Autowired protected IInterceptorBroadcaster myInterceptorBroadcaster; @@ -90,13 +91,13 @@ public class HapiTransactionService { int maxRetries = 0; - /* - * If two client threads both concurrently try to add the same tag that isn't - * known to the system already, they'll both try to create a row in HFJ_TAG_DEF, - * which is the tag definition table. In that case, a constraint error will be - * thrown by one of the client threads, so we auto-retry in order to avoid - * annoying spurious failures for the client. - */ + /* + * If two client threads both concurrently try to add the same tag that isn't + * known to the system already, they'll both try to create a row in HFJ_TAG_DEF, + * which is the tag definition table. In that case, a constraint error will be + * thrown by one of the client threads, so we auto-retry in order to avoid + * annoying spurious failures for the client. + */ if (DaoFailureUtil.isTagStorageFailure(e)) { maxRetries = 3; } @@ -112,11 +113,11 @@ public class HapiTransactionService { } if (i < maxRetries) { - theTransactionDetails.getRollbackUndoActions().forEach(t->t.run()); + theTransactionDetails.getRollbackUndoActions().forEach(t -> t.run()); theTransactionDetails.clearRollbackUndoActions(); theTransactionDetails.clearResolvedItems(); - theTransactionDetails.clearUserData(BaseHapiFhirDao.XACT_USERDATA_KEY_RESOLVED_TAG_DEFINITIONS); - theTransactionDetails.clearUserData(BaseHapiFhirDao.XACT_USERDATA_KEY_EXISTING_SEARCH_PARAMS); + theTransactionDetails.clearUserData(XACT_USERDATA_KEY_RESOLVED_TAG_DEFINITIONS); + theTransactionDetails.clearUserData(XACT_USERDATA_KEY_EXISTING_SEARCH_PARAMS); double sleepAmount = (250.0d * i) * Math.random(); long sleepAmountLong = (long) sleepAmount; TestUtil.sleepAtLeast(sleepAmountLong, false); diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/delete/DeleteConflictUtil.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/delete/DeleteConflictUtil.java new file mode 100644 index 00000000000..49ecd7490fe --- /dev/null +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/delete/DeleteConflictUtil.java @@ -0,0 +1,65 @@ +package ca.uhn.fhir.jpa.delete; + +/*- + * #%L + * HAPI FHIR Storage api + * %% + * Copyright (C) 2014 - 2021 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.jpa.api.model.DeleteConflict; +import ca.uhn.fhir.jpa.api.model.DeleteConflictList; +import ca.uhn.fhir.jpa.dao.BaseStorageDao; +import ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException; +import ca.uhn.fhir.util.OperationOutcomeUtil; +import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; + +public final class DeleteConflictUtil { + private DeleteConflictUtil() { + } + + public static void validateDeleteConflictsEmptyOrThrowException(FhirContext theFhirContext, DeleteConflictList theDeleteConflicts) { + IBaseOperationOutcome oo = null; + String firstMsg = null; + + for (DeleteConflict next : theDeleteConflicts) { + + if (theDeleteConflicts.isResourceIdToIgnoreConflict(next.getTargetId())) { + continue; + } + + String msg = "Unable to delete " + + next.getTargetId().toUnqualifiedVersionless().getValue() + + " because at least one resource has a reference to this resource. First reference found was resource " + + next.getSourceId().toUnqualifiedVersionless().getValue() + + " in path " + + next.getSourcePath(); + + if (firstMsg == null) { + firstMsg = msg; + oo = OperationOutcomeUtil.newInstance(theFhirContext); + } + OperationOutcomeUtil.addIssue(theFhirContext, oo, BaseStorageDao.OO_SEVERITY_ERROR, msg, null, "processing"); + } + + if (firstMsg == null) { + return; + } + + throw new ResourceVersionConflictException(firstMsg, oo); + } +} diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/UserRequestRetryVersionConflictsInterceptor.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/UserRequestRetryVersionConflictsInterceptor.java similarity index 99% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/UserRequestRetryVersionConflictsInterceptor.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/UserRequestRetryVersionConflictsInterceptor.java index c5e84ea27f8..30cf347bec0 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/UserRequestRetryVersionConflictsInterceptor.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/UserRequestRetryVersionConflictsInterceptor.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.interceptor; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/BaseTypedRule.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/BaseTypedRule.java similarity index 98% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/BaseTypedRule.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/BaseTypedRule.java index 85859e17e10..fdf72fc9ba5 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/BaseTypedRule.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/BaseTypedRule.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.interceptor.validation; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/IRepositoryValidatingRule.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/IRepositoryValidatingRule.java similarity index 99% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/IRepositoryValidatingRule.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/IRepositoryValidatingRule.java index 267494170e1..e8397fd1796 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/IRepositoryValidatingRule.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/IRepositoryValidatingRule.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.interceptor.validation; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% @@ -52,22 +52,6 @@ public interface IRepositoryValidatingRule { myOperationOutcome = theOperationOutcome; } - public IBaseOperationOutcome getOperationOutcome() { - return myOperationOutcome; - } - - public IRepositoryValidatingRule getRule() { - return myRule; - } - - public boolean isPasses() { - return myPasses; - } - - public String getFailureDescription() { - return myFailureDescription; - } - static RuleEvaluation forSuccess(IRepositoryValidatingRule theRule) { Validate.notNull(theRule); return new RuleEvaluation(theRule, true, null, null); @@ -85,5 +69,21 @@ public interface IRepositoryValidatingRule { return new RuleEvaluation(theRule, false, null, theOperationOutcome); } + public IBaseOperationOutcome getOperationOutcome() { + return myOperationOutcome; + } + + public IRepositoryValidatingRule getRule() { + return myRule; + } + + public boolean isPasses() { + return myPasses; + } + + public String getFailureDescription() { + return myFailureDescription; + } + } } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/IRuleRoot.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/IRuleRoot.java similarity index 97% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/IRuleRoot.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/IRuleRoot.java index fc2f46bbc5c..0d5e87dc7f4 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/IRuleRoot.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/IRuleRoot.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.interceptor.validation; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptor.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptor.java similarity index 99% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptor.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptor.java index b2c5cb50b50..e25625e3df5 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptor.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptor.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.interceptor.validation; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingRuleBuilder.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingRuleBuilder.java similarity index 99% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingRuleBuilder.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingRuleBuilder.java index f1d2241eec3..ffacc9c294c 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingRuleBuilder.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingRuleBuilder.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.interceptor.validation; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% @@ -47,6 +47,7 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank; */ public final class RepositoryValidatingRuleBuilder implements IRuleRoot { + public static final String REPOSITORY_VALIDATING_RULE_BUILDER = "repositoryValidatingRuleBuilder"; private final List<IRepositoryValidatingRule> myRules = new ArrayList<>(); @Autowired diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RequireValidationRule.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RequireValidationRule.java similarity index 99% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RequireValidationRule.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RequireValidationRule.java index a24bd436916..05d1cfe6d58 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RequireValidationRule.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RequireValidationRule.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.interceptor.validation; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% @@ -23,10 +23,10 @@ package ca.uhn.fhir.jpa.interceptor.validation; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster; -import ca.uhn.fhir.rest.server.util.CompositeInterceptorBroadcaster; import ca.uhn.fhir.jpa.validation.ValidatorResourceFetcher; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.interceptor.ValidationResultEnrichingInterceptor; +import ca.uhn.fhir.rest.server.util.CompositeInterceptorBroadcaster; import ca.uhn.fhir.validation.FhirValidator; import ca.uhn.fhir.validation.ResultSeverityEnum; import ca.uhn.fhir.validation.SingleValidationMessage; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleDisallowProfile.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleDisallowProfile.java similarity index 99% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleDisallowProfile.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleDisallowProfile.java index cc620e6add5..4cec838b6c6 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleDisallowProfile.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleDisallowProfile.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.interceptor.validation; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleRequireProfileDeclaration.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleRequireProfileDeclaration.java similarity index 86% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleRequireProfileDeclaration.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleRequireProfileDeclaration.java index 5ad81127ecc..158cd8cea25 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleRequireProfileDeclaration.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleRequireProfileDeclaration.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.interceptor.validation; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% @@ -40,7 +40,7 @@ class RuleRequireProfileDeclaration extends BaseTypedRule { @Nonnull @Override - public RuleEvaluation evaluate(RequestDetails theRequestDetails, @Nonnull IBaseResource theResource) { + public IRepositoryValidatingRule.RuleEvaluation evaluate(RequestDetails theRequestDetails, @Nonnull IBaseResource theResource) { Optional<String> matchingProfile = theResource .getMeta() .getProfile() @@ -49,10 +49,10 @@ class RuleRequireProfileDeclaration extends BaseTypedRule { .filter(t -> myProfileOptions.contains(t)) .findFirst(); if (matchingProfile.isPresent()) { - return RuleEvaluation.forSuccess(this); + return IRepositoryValidatingRule.RuleEvaluation.forSuccess(this); } String msg = getFhirContext().getLocalizer().getMessage(RuleRequireProfileDeclaration.class, "noMatchingProfile", getResourceType(), myProfileOptions); - return RuleEvaluation.forFailure(this, msg); + return IRepositoryValidatingRule.RuleEvaluation.forFailure(this, msg); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/SystemRequestDetails.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/partition/SystemRequestDetails.java similarity index 99% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/SystemRequestDetails.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/partition/SystemRequestDetails.java index caa82cbdd5f..c8cf2d87134 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/SystemRequestDetails.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/partition/SystemRequestDetails.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.partition; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaProvider.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaProvider.java similarity index 99% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaProvider.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaProvider.java index 4f772f60abf..88a9ca0442f 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaProvider.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaProvider.java @@ -23,7 +23,7 @@ import java.util.TreeSet; /* * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaResourceProvider.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaResourceProvider.java similarity index 99% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaResourceProvider.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaResourceProvider.java index 5ffbabdaeed..10ff8e18690 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaResourceProvider.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaResourceProvider.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.provider; /* * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/IJpaSystemProvider.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/provider/IJpaSystemProvider.java similarity index 96% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/IJpaSystemProvider.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/provider/IJpaSystemProvider.java index 25f07b2d775..efbaa358084 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/IJpaSystemProvider.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/provider/IJpaSystemProvider.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.provider; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/SubscriptionTriggeringProvider.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/provider/SubscriptionTriggeringProvider.java similarity index 99% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/SubscriptionTriggeringProvider.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/provider/SubscriptionTriggeringProvider.java index e36b046bbd7..14c0f80dae4 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/SubscriptionTriggeringProvider.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/provider/SubscriptionTriggeringProvider.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.provider; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/search/SearchConstants.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/search/SearchConstants.java new file mode 100644 index 00000000000..dd19be9cbf5 --- /dev/null +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/search/SearchConstants.java @@ -0,0 +1,28 @@ +package ca.uhn.fhir.jpa.search; + +/*- + * #%L + * HAPI FHIR Storage api + * %% + * Copyright (C) 2014 - 2021 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +public final class SearchConstants { + public static final int MAX_PAGE_SIZE = 800; + + private SearchConstants() { + } +} diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/BaseChannelSettings.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/BaseChannelSettings.java similarity index 97% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/BaseChannelSettings.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/BaseChannelSettings.java index 1fe8aa5ef87..083576e457f 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/BaseChannelSettings.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/BaseChannelSettings.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.channel.api; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/ChannelConsumerSettings.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/ChannelConsumerSettings.java similarity index 97% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/ChannelConsumerSettings.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/ChannelConsumerSettings.java index ef3c1fc1113..5adfad2eec2 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/ChannelConsumerSettings.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/ChannelConsumerSettings.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.channel.api; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/ChannelProducerSettings.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/ChannelProducerSettings.java similarity index 97% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/ChannelProducerSettings.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/ChannelProducerSettings.java index 24573d9de8a..14f98dc5273 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/ChannelProducerSettings.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/ChannelProducerSettings.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.channel.api; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelFactory.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelFactory.java similarity index 81% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelFactory.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelFactory.java index d35f5ebaebf..a6ff2972653 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelFactory.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelFactory.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.channel.api; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% @@ -36,9 +36,9 @@ public interface IChannelFactory { * when invoked with the same {@literal theChannelName} if they need to, or they can create a new instance. * </p> * - * @param theChannelName The actual underlying queue name - * @param theMessageType The object type that will be placed on this queue. Objects will be Jackson-annotated structures. - * @param theChannelSettings Contains the configuration for subscribers. + * @param theChannelName The actual underlying queue name + * @param theMessageType The object type that will be placed on this queue. Objects will be Jackson-annotated structures. + * @param theChannelSettings Contains the configuration for subscribers. */ IChannelReceiver getOrCreateReceiver(String theChannelName, Class<?> theMessageType, ChannelConsumerSettings theChannelSettings); @@ -50,8 +50,8 @@ public interface IChannelFactory { * when invoked with the same {@literal theChannelName} if they need to, or they can create a new instance. * </p> * - * @param theChannelName The actual underlying queue name - * @param theMessageType The object type that will be placed on this queue. Objects will be Jackson-annotated structures. + * @param theChannelName The actual underlying queue name + * @param theMessageType The object type that will be placed on this queue. Objects will be Jackson-annotated structures. * @param theChannelSettings Contains the configuration for senders. */ IChannelProducer getOrCreateProducer(String theChannelName, Class<?> theMessageType, ChannelProducerSettings theChannelSettings); diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelProducer.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelProducer.java similarity index 97% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelProducer.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelProducer.java index 333196341b6..5f98ac783ad 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelProducer.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelProducer.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.channel.api; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelReceiver.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelReceiver.java similarity index 95% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelReceiver.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelReceiver.java index 65b50e5a2f7..98a0a8cdb7d 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelReceiver.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelReceiver.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.channel.api; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% @@ -25,5 +25,5 @@ import org.springframework.messaging.SubscribableChannel; import org.springframework.messaging.support.InterceptableChannel; public interface IChannelReceiver extends SubscribableChannel, InterceptableChannel, DisposableBean { - String getName(); + String getName(); } diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelSettings.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelSettings.java similarity index 96% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelSettings.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelSettings.java index d1138a8e10c..7c207a0eb89 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelSettings.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelSettings.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.channel.api; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/config/SubscriptionChannelConfig.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/config/SubscriptionChannelConfig.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/config/SubscriptionChannelConfig.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/config/SubscriptionChannelConfig.java index d6ca470a18e..cfc5e7b4e4e 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/config/SubscriptionChannelConfig.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/config/SubscriptionChannelConfig.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.channel.config; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannel.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannel.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannel.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannel.java index 728e27fe5d8..026908eb861 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannel.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannel.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.channel.impl; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannelFactory.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannelFactory.java similarity index 99% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannelFactory.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannelFactory.java index 65da0f82288..dbe3b50a29b 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannelFactory.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannelFactory.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.channel.impl; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% @@ -47,8 +47,8 @@ import java.util.concurrent.TimeUnit; public class LinkedBlockingChannelFactory implements IChannelFactory { private static final Logger ourLog = LoggerFactory.getLogger(LinkedBlockingChannelFactory.class); - private Map<String, LinkedBlockingChannel> myChannels = Collections.synchronizedMap(new HashMap<>()); private final IChannelNamer myChannelNamer; + private Map<String, LinkedBlockingChannel> myChannels = Collections.synchronizedMap(new HashMap<>()); public LinkedBlockingChannelFactory(IChannelNamer theChannelNamer) { myChannelNamer = theChannelNamer; diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/BroadcastingSubscribableChannelWrapper.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/BroadcastingSubscribableChannelWrapper.java similarity index 50% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/BroadcastingSubscribableChannelWrapper.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/BroadcastingSubscribableChannelWrapper.java index bb32e1cc266..1ffeca5fb7b 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/BroadcastingSubscribableChannelWrapper.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/BroadcastingSubscribableChannelWrapper.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.channel.subscription; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% @@ -32,44 +32,44 @@ import java.util.Set; public class BroadcastingSubscribableChannelWrapper extends AbstractSubscribableChannel implements IChannelReceiver { - private final IChannelReceiver myWrappedChannel; - private final MessageHandler myHandler; + private final IChannelReceiver myWrappedChannel; + private final MessageHandler myHandler; - public BroadcastingSubscribableChannelWrapper(IChannelReceiver theChannel) { - myHandler = message -> send(message); - theChannel.subscribe(myHandler); - myWrappedChannel = theChannel; - } + public BroadcastingSubscribableChannelWrapper(IChannelReceiver theChannel) { + myHandler = message -> send(message); + theChannel.subscribe(myHandler); + myWrappedChannel = theChannel; + } - public SubscribableChannel getWrappedChannel() { - return myWrappedChannel; - } + public SubscribableChannel getWrappedChannel() { + return myWrappedChannel; + } - @Override - protected boolean sendInternal(Message<?> theMessage, long timeout) { - Set<MessageHandler> subscribers = getSubscribers(); - Validate.isTrue(subscribers.size() > 0, "Channel has zero subscribers"); - for (MessageHandler next : subscribers) { - next.handleMessage(theMessage); - } - return true; - } + @Override + protected boolean sendInternal(Message<?> theMessage, long timeout) { + Set<MessageHandler> subscribers = getSubscribers(); + Validate.isTrue(subscribers.size() > 0, "Channel has zero subscribers"); + for (MessageHandler next : subscribers) { + next.handleMessage(theMessage); + } + return true; + } - @Override - public void destroy() throws Exception { - myWrappedChannel.destroy(); - myWrappedChannel.unsubscribe(myHandler); - } + @Override + public void destroy() throws Exception { + myWrappedChannel.destroy(); + myWrappedChannel.unsubscribe(myHandler); + } - @Override - public void addInterceptor(ChannelInterceptor interceptor) { - super.addInterceptor(interceptor); - myWrappedChannel.addInterceptor(interceptor); - } + @Override + public void addInterceptor(ChannelInterceptor interceptor) { + super.addInterceptor(interceptor); + myWrappedChannel.addInterceptor(interceptor); + } - @Override - public String getName() { - return myWrappedChannel.getName(); - } + @Override + public String getName() { + return myWrappedChannel.getName(); + } } diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/IChannelNamer.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/IChannelNamer.java similarity index 92% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/IChannelNamer.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/IChannelNamer.java index 36efd627d24..b3f8c3c4444 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/IChannelNamer.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/IChannelNamer.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.channel.subscription; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% @@ -26,7 +26,7 @@ public interface IChannelNamer { /** * Channel factories call this service to qualify the channel name before sending it to the channel factory. * - * @param theNameComponent the component of the queue or topic name + * @param theNameComponent the component of the queue or topic name * @param theChannelSettings * @return the fully qualified the channel factory will use to name the queue or topic */ diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/SubscriptionChannelFactory.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/SubscriptionChannelFactory.java similarity index 99% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/SubscriptionChannelFactory.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/SubscriptionChannelFactory.java index 0b29c28c895..df4dad8c206 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/SubscriptionChannelFactory.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/SubscriptionChannelFactory.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.channel.subscription; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/matching/IResourceModifiedConsumer.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/matching/IResourceModifiedConsumer.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/matching/IResourceModifiedConsumer.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/matching/IResourceModifiedConsumer.java index 0bc77f57d8c..0db2a1034cd 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/matching/IResourceModifiedConsumer.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/matching/IResourceModifiedConsumer.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.match.matcher.matching; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/matching/SubscriptionMatchingStrategy.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/matching/SubscriptionMatchingStrategy.java similarity index 97% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/matching/SubscriptionMatchingStrategy.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/matching/SubscriptionMatchingStrategy.java index f4a4cef739b..1d07bf94d52 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/matching/SubscriptionMatchingStrategy.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/matching/SubscriptionMatchingStrategy.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.match.matcher.matching; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionCanonicalizer.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionCanonicalizer.java similarity index 99% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionCanonicalizer.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionCanonicalizer.java index 4122b0f8c09..a81423f6fb6 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionCanonicalizer.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionCanonicalizer.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.match.registry; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionConstants.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionConstants.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionConstants.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionConstants.java index 0291279821f..9e988944d1d 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionConstants.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionConstants.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.match.registry; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscription.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscription.java similarity index 99% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscription.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscription.java index 12881a30b8c..3d80e904db3 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscription.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscription.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.model; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscriptionChannelType.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscriptionChannelType.java similarity index 99% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscriptionChannelType.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscriptionChannelType.java index dfda8619bf0..b8235d7b8f8 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscriptionChannelType.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscriptionChannelType.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.model; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% @@ -54,6 +54,34 @@ public enum CanonicalSubscriptionChannelType { */ NULL; + public static CanonicalSubscriptionChannelType fromCode(@Nullable String theSystem, @Nonnull String codeString) throws FHIRException { + if (isBlank(codeString)) { + return null; + } else if ("rest-hook".equals(codeString)) { + if (theSystem == null || theSystem.equals("http://terminology.hl7.org/CodeSystem/subscription-channel-type")) { + return RESTHOOK; + } + } else if ("websocket".equals(codeString)) { + if (theSystem == null || theSystem.equals("http://terminology.hl7.org/CodeSystem/subscription-channel-type")) { + return WEBSOCKET; + } + } else if ("email".equals(codeString)) { + if (theSystem == null || theSystem.equals("http://terminology.hl7.org/CodeSystem/subscription-channel-type")) { + return EMAIL; + } + } else if ("sms".equals(codeString)) { + if (theSystem == null || theSystem.equals("http://terminology.hl7.org/CodeSystem/subscription-channel-type")) { + return SMS; + } + } else if ("message".equals(codeString)) { + if (theSystem == null || theSystem.equals("http://terminology.hl7.org/CodeSystem/subscription-channel-type")) { + return MESSAGE; + } + } + + throw new FHIRException("Unknown SubscriptionChannelType code '" + codeString + "'"); + } + public String toCode() { switch (this) { case RESTHOOK: @@ -125,32 +153,4 @@ public enum CanonicalSubscriptionChannelType { public Subscription.SubscriptionChannelType toCanonical() { return Subscription.SubscriptionChannelType.fromCode(toCode()); } - - public static CanonicalSubscriptionChannelType fromCode(@Nullable String theSystem, @Nonnull String codeString) throws FHIRException { - if (isBlank(codeString)) { - return null; - } else if ("rest-hook".equals(codeString)) { - if (theSystem == null || theSystem.equals("http://terminology.hl7.org/CodeSystem/subscription-channel-type")) { - return RESTHOOK; - } - } else if ("websocket".equals(codeString)) { - if (theSystem == null || theSystem.equals("http://terminology.hl7.org/CodeSystem/subscription-channel-type")) { - return WEBSOCKET; - } - } else if ("email".equals(codeString)) { - if (theSystem == null || theSystem.equals("http://terminology.hl7.org/CodeSystem/subscription-channel-type")) { - return EMAIL; - } - } else if ("sms".equals(codeString)) { - if (theSystem == null || theSystem.equals("http://terminology.hl7.org/CodeSystem/subscription-channel-type")) { - return SMS; - } - } else if ("message".equals(codeString)) { - if (theSystem == null || theSystem.equals("http://terminology.hl7.org/CodeSystem/subscription-channel-type")) { - return MESSAGE; - } - } - - throw new FHIRException("Unknown SubscriptionChannelType code '" + codeString + "'"); - } } diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryJsonMessage.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryJsonMessage.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryJsonMessage.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryJsonMessage.java index 23cebaef2d9..518111ea8ab 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryJsonMessage.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryJsonMessage.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.model; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryMessage.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryMessage.java similarity index 99% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryMessage.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryMessage.java index b9819585a73..3b111bd737d 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryMessage.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryMessage.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.model; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedJsonMessage.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedJsonMessage.java similarity index 98% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedJsonMessage.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedJsonMessage.java index 0e7020eb94b..623ecaeb6df 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedJsonMessage.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedJsonMessage.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.model; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedMessage.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedMessage.java similarity index 99% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedMessage.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedMessage.java index 820ce3fc496..8be72522a95 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedMessage.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedMessage.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.model; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/triggering/ISubscriptionTriggeringSvc.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/triggering/ISubscriptionTriggeringSvc.java similarity index 97% rename from hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/triggering/ISubscriptionTriggeringSvc.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/triggering/ISubscriptionTriggeringSvc.java index 6125b28af23..9f2d9acc8d6 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/triggering/ISubscriptionTriggeringSvc.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/triggering/ISubscriptionTriggeringSvc.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.subscription.triggering; /*- * #%L - * HAPI FHIR Subscription Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/UploadStatistics.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/term/UploadStatistics.java similarity index 98% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/UploadStatistics.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/term/UploadStatistics.java index 51f938d81d0..c448da1dca5 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/UploadStatistics.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/term/UploadStatistics.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.term; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermLoaderSvc.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/term/api/ITermLoaderSvc.java similarity index 99% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermLoaderSvc.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/term/api/ITermLoaderSvc.java index 87d2d060598..92d2f7a61db 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermLoaderSvc.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/term/api/ITermLoaderSvc.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.term.api; /* * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/MemoryCacheService.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/MemoryCacheService.java similarity index 99% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/MemoryCacheService.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/MemoryCacheService.java index e8968aac543..86b09951622 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/MemoryCacheService.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/MemoryCacheService.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.util; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% @@ -110,7 +110,7 @@ public class MemoryCacheService { /** * Fetch an item from the cache if it exists, and use the loading function to * obtain it otherwise. - * + * <p> * This method will put the value into the cache using {@link #putAfterCommit(CacheEnum, Object, Object)}. */ public <K, T> T getThenPutAfterCommit(CacheEnum theCache, K theKey, Function<K, T> theSupplier) { @@ -140,7 +140,7 @@ public class MemoryCacheService { * if and when the current database transaction successfully commits. If the * transaction is rolled back, the key+value passed into this method will * not be added to the cache. - * + * <p> * This is useful for situations where you want to store something that has been * resolved in the DB during the current transaction, but it's not yet guaranteed * that this item will successfully save to the DB. Use this method in that case @@ -247,6 +247,20 @@ public class MemoryCacheService { myHashCode = new HashCodeBuilder().append(myTypeName).append(myInstanceId).toHashCode(); } + public static HistoryCountKey forSystem() { + return new HistoryCountKey(null, null); + } + + public static HistoryCountKey forType(@Nonnull String theType) { + assert isNotBlank(theType); + return new HistoryCountKey(theType, null); + } + + public static HistoryCountKey forInstance(@Nonnull Long theInstanceId) { + assert theInstanceId != null; + return new HistoryCountKey(null, theInstanceId); + } + @Override public boolean equals(Object theO) { boolean retVal = false; @@ -262,20 +276,6 @@ public class MemoryCacheService { return myHashCode; } - public static HistoryCountKey forSystem() { - return new HistoryCountKey(null, null); - } - - public static HistoryCountKey forType(@Nonnull String theType) { - assert isNotBlank(theType); - return new HistoryCountKey(theType, null); - } - - public static HistoryCountKey forInstance(@Nonnull Long theInstanceId) { - assert theInstanceId != null; - return new HistoryCountKey(null, theInstanceId); - } - } } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/validation/ValidationSettings.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/validation/ValidationSettings.java similarity index 99% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/validation/ValidationSettings.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/validation/ValidationSettings.java index df3300dbed7..56707443461 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/validation/ValidationSettings.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/validation/ValidationSettings.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.validation; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/validation/ValidatorResourceFetcher.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/validation/ValidatorResourceFetcher.java similarity index 99% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/validation/ValidatorResourceFetcher.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/validation/ValidatorResourceFetcher.java index 290adfab468..8256aae493e 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/validation/ValidatorResourceFetcher.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/validation/ValidatorResourceFetcher.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.validation; /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/mdm/log/Logs.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/mdm/log/Logs.java similarity index 97% rename from hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/mdm/log/Logs.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/mdm/log/Logs.java index 1abc94d5593..573ad48ce9a 100644 --- a/hapi-fhir-storage-api/src/main/java/ca/uhn/fhir/mdm/log/Logs.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/mdm/log/Logs.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.mdm.log; /*- * #%L - * HAPI FHIR JPA API + * HAPI FHIR Storage api * %% * Copyright (C) 2014 - 2021 Smile CDR, Inc. * %% diff --git a/hapi-fhir-storage-api/src/main/resources/.keep-jpaserver-api b/hapi-fhir-storage/src/main/resources/.keep-jpaserver-api similarity index 100% rename from hapi-fhir-storage-api/src/main/resources/.keep-jpaserver-api rename to hapi-fhir-storage/src/main/resources/.keep-jpaserver-api diff --git a/hapi-fhir-storage-api/src/test/java/.keep b/hapi-fhir-storage/src/test/java/.keep similarity index 100% rename from hapi-fhir-storage-api/src/test/java/.keep rename to hapi-fhir-storage/src/test/java/.keep diff --git a/hapi-fhir-storage-api/src/test/resources/.keep b/hapi-fhir-storage/src/test/resources/.keep similarity index 100% rename from hapi-fhir-storage-api/src/test/resources/.keep rename to hapi-fhir-storage/src/test/resources/.keep diff --git a/hapi-fhir-structures-dstu2.1/pom.xml b/hapi-fhir-structures-dstu2.1/pom.xml index ef2bbef3f7e..bf94bc5a065 100644 --- a/hapi-fhir-structures-dstu2.1/pom.xml +++ b/hapi-fhir-structures-dstu2.1/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-structures-dstu2/pom.xml b/hapi-fhir-structures-dstu2/pom.xml index 2c81d57e6a9..e5e3e7e3567 100644 --- a/hapi-fhir-structures-dstu2/pom.xml +++ b/hapi-fhir-structures-dstu2/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-structures-dstu3/pom.xml b/hapi-fhir-structures-dstu3/pom.xml index b5a91f0ea57..8f86004e960 100644 --- a/hapi-fhir-structures-dstu3/pom.xml +++ b/hapi-fhir-structures-dstu3/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-structures-hl7org-dstu2/pom.xml b/hapi-fhir-structures-hl7org-dstu2/pom.xml index f62d30af447..85364d85658 100644 --- a/hapi-fhir-structures-hl7org-dstu2/pom.xml +++ b/hapi-fhir-structures-hl7org-dstu2/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-structures-r4/pom.xml b/hapi-fhir-structures-r4/pom.xml index a5b1177c900..cfc56be95f2 100644 --- a/hapi-fhir-structures-r4/pom.xml +++ b/hapi-fhir-structures-r4/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-structures-r5/pom.xml b/hapi-fhir-structures-r5/pom.xml index 63da59f558d..4bf070eca08 100644 --- a/hapi-fhir-structures-r5/pom.xml +++ b/hapi-fhir-structures-r5/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-test-utilities/pom.xml b/hapi-fhir-test-utilities/pom.xml index 17157ff1753..1e49272ee88 100644 --- a/hapi-fhir-test-utilities/pom.xml +++ b/hapi-fhir-test-utilities/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-testpage-overlay/pom.xml b/hapi-fhir-testpage-overlay/pom.xml index 5ab492a17c8..c1a4cb75a5d 100644 --- a/hapi-fhir-testpage-overlay/pom.xml +++ b/hapi-fhir-testpage-overlay/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/hapi-fhir-validation-resources-dstu2.1/pom.xml b/hapi-fhir-validation-resources-dstu2.1/pom.xml index 1635076b1e0..8895cb77810 100644 --- a/hapi-fhir-validation-resources-dstu2.1/pom.xml +++ b/hapi-fhir-validation-resources-dstu2.1/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-validation-resources-dstu2/pom.xml b/hapi-fhir-validation-resources-dstu2/pom.xml index cbace5aa862..685fe3c5f0f 100644 --- a/hapi-fhir-validation-resources-dstu2/pom.xml +++ b/hapi-fhir-validation-resources-dstu2/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-validation-resources-dstu3/pom.xml b/hapi-fhir-validation-resources-dstu3/pom.xml index e0ebab22cb0..8e350d1f617 100644 --- a/hapi-fhir-validation-resources-dstu3/pom.xml +++ b/hapi-fhir-validation-resources-dstu3/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-validation-resources-r4/pom.xml b/hapi-fhir-validation-resources-r4/pom.xml index 0b6dc70c454..97406693424 100644 --- a/hapi-fhir-validation-resources-r4/pom.xml +++ b/hapi-fhir-validation-resources-r4/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-validation-resources-r5/pom.xml b/hapi-fhir-validation-resources-r5/pom.xml index 18fee1725e9..f384daa3316 100644 --- a/hapi-fhir-validation-resources-r5/pom.xml +++ b/hapi-fhir-validation-resources-r5/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-fhir-validation/pom.xml b/hapi-fhir-validation/pom.xml index 2765d4804a5..7324dd9affd 100644 --- a/hapi-fhir-validation/pom.xml +++ b/hapi-fhir-validation/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-deployable-pom</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../hapi-deployable-pom/pom.xml</relativePath> </parent> diff --git a/hapi-tinder-plugin/pom.xml b/hapi-tinder-plugin/pom.xml index ce03bcdfc4b..8926337ddbd 100644 --- a/hapi-tinder-plugin/pom.xml +++ b/hapi-tinder-plugin/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> @@ -58,37 +58,37 @@ <dependency> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-structures-dstu3</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> </dependency> <dependency> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-structures-hl7org-dstu2</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> </dependency> <dependency> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-structures-r4</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> </dependency> <dependency> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-structures-r5</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> </dependency> <dependency> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-validation-resources-dstu2</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> </dependency> <dependency> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-validation-resources-dstu3</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> </dependency> <dependency> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-validation-resources-r4</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> </dependency> <dependency> <groupId>org.apache.velocity</groupId> diff --git a/hapi-tinder-test/pom.xml b/hapi-tinder-test/pom.xml index f4c47e7ea09..defeb81e95b 100644 --- a/hapi-tinder-test/pom.xml +++ b/hapi-tinder-test/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/pom.xml b/pom.xml index 1aca1b4d3a7..fb8d1b3c045 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir</artifactId> <packaging>pom</packaging> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <modules> <module>hapi-fhir-jpa</module> </modules> @@ -2775,7 +2775,7 @@ <module>hapi-fhir-validation-resources-r4</module> <module>hapi-fhir-structures-r5</module> <module>hapi-fhir-validation-resources-r5</module> - <module>hapi-fhir-storage-api</module> + <module>hapi-fhir-storage</module> <module>hapi-fhir-jpaserver-cql</module> <module>hapi-fhir-jpaserver-model</module> <module>hapi-fhir-jpaserver-searchparam</module> diff --git a/tests/hapi-fhir-base-test-jaxrsserver-kotlin/pom.xml b/tests/hapi-fhir-base-test-jaxrsserver-kotlin/pom.xml index 365ce8e7c26..69067d0d06e 100644 --- a/tests/hapi-fhir-base-test-jaxrsserver-kotlin/pom.xml +++ b/tests/hapi-fhir-base-test-jaxrsserver-kotlin/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> diff --git a/tests/hapi-fhir-base-test-mindeps-client/pom.xml b/tests/hapi-fhir-base-test-mindeps-client/pom.xml index a8df44b7045..de95a77b6d1 100644 --- a/tests/hapi-fhir-base-test-mindeps-client/pom.xml +++ b/tests/hapi-fhir-base-test-mindeps-client/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> diff --git a/tests/hapi-fhir-base-test-mindeps-server/pom.xml b/tests/hapi-fhir-base-test-mindeps-server/pom.xml index 545ebba468a..84008fce624 100644 --- a/tests/hapi-fhir-base-test-mindeps-server/pom.xml +++ b/tests/hapi-fhir-base-test-mindeps-server/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir</artifactId> - <version>5.6.0-PRE6-SNAPSHOT</version> + <version>5.6.0-PRE7-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> From 0db40c6118a69662a7c2f403c4151ac6673f943c Mon Sep 17 00:00:00 2001 From: Ken Stevens <khstevens@gmail.com> Date: Fri, 24 Sep 2021 00:39:15 -0400 Subject: [PATCH 29/31] support non-jpa batch --- .../fhir/jpa/batch/config/BatchConstants.java | 2 ++ .../ca/uhn/fhir/jpa/config/BaseConfig.java | 3 +- .../reindex/ResourceReindexingSvcImpl.java | 25 +-------------- hapi-fhir-storage/pom.xml | 5 +++ .../java/ca/uhn/fhir/jpa/batch/log/Logs.java | 0 .../bulk/export/api/IBulkDataExportSvc.java | 0 .../job/CreateBulkExportEntityTasklet.java | 0 .../export/job/GroupIdPresentValidator.java | 9 +++--- .../export/model/BulkExportJobStatusEnum.java | 0 .../export/model/BulkExportResponseJson.java | 0 .../provider/BulkDataExportProvider.java | 2 +- .../fhir/jpa/search/reindex/BlockPolicy.java | 32 +++++++++++++++++++ .../fhir/jpa/util/JsonDateDeserializer.java | 0 .../uhn/fhir/jpa/util/JsonDateSerializer.java | 0 14 files changed, 47 insertions(+), 31 deletions(-) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/batch/log/Logs.java (100%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/bulk/export/api/IBulkDataExportSvc.java (100%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/CreateBulkExportEntityTasklet.java (100%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/GroupIdPresentValidator.java (80%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/bulk/export/model/BulkExportJobStatusEnum.java (100%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/bulk/export/model/BulkExportResponseJson.java (100%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/bulk/export/provider/BulkDataExportProvider.java (100%) create mode 100644 hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/search/reindex/BlockPolicy.java rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/util/JsonDateDeserializer.java (100%) rename {hapi-fhir-jpaserver-base => hapi-fhir-storage}/src/main/java/ca/uhn/fhir/jpa/util/JsonDateSerializer.java (100%) diff --git a/hapi-fhir-batch/src/main/java/ca/uhn/fhir/jpa/batch/config/BatchConstants.java b/hapi-fhir-batch/src/main/java/ca/uhn/fhir/jpa/batch/config/BatchConstants.java index 6071b7679b5..6eb9d0398c4 100644 --- a/hapi-fhir-batch/src/main/java/ca/uhn/fhir/jpa/batch/config/BatchConstants.java +++ b/hapi-fhir-batch/src/main/java/ca/uhn/fhir/jpa/batch/config/BatchConstants.java @@ -54,6 +54,8 @@ public final class BatchConstants { * MDM Clear */ public static final String MDM_CLEAR_JOB_NAME = "mdmClearJob"; + public static final String BULK_EXPORT_READ_CHUNK_PARAMETER = "readChunkSize"; + public static final String BULK_EXPORT_GROUP_ID_PARAMETER = "groupId"; /** * This Set contains the step names across all job types that are appropriate for * someone to look at the write count for that given step in order to determine the diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java index 95564aa7f73..94894a90974 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java @@ -123,6 +123,7 @@ import ca.uhn.fhir.jpa.search.cache.DatabaseSearchResultCacheSvcImpl; import ca.uhn.fhir.jpa.search.cache.ISearchCacheSvc; import ca.uhn.fhir.jpa.search.cache.ISearchResultCacheSvc; import ca.uhn.fhir.jpa.search.elastic.IndexNamePrefixLayoutStrategy; +import ca.uhn.fhir.jpa.search.reindex.BlockPolicy; import ca.uhn.fhir.jpa.search.reindex.IResourceReindexingSvc; import ca.uhn.fhir.jpa.search.reindex.ResourceReindexer; import ca.uhn.fhir.jpa.search.reindex.ResourceReindexingSvcImpl; @@ -403,7 +404,7 @@ public abstract class BaseConfig { asyncTaskExecutor.setQueueCapacity(0); asyncTaskExecutor.setAllowCoreThreadTimeOut(true); asyncTaskExecutor.setThreadNamePrefix("JobLauncher-"); - asyncTaskExecutor.setRejectedExecutionHandler(new ResourceReindexingSvcImpl.BlockPolicy()); + asyncTaskExecutor.setRejectedExecutionHandler(new BlockPolicy()); asyncTaskExecutor.initialize(); return asyncTaskExecutor; } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/reindex/ResourceReindexingSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/reindex/ResourceReindexingSvcImpl.java index 8f9c583ce23..ce362dd59df 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/reindex/ResourceReindexingSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/reindex/ResourceReindexingSvcImpl.java @@ -42,7 +42,6 @@ import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.apache.commons.lang3.time.DateUtils; import org.hl7.fhir.r4.model.InstantType; -import javax.annotation.Nullable; import org.quartz.JobExecutionContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -54,6 +53,7 @@ import org.springframework.transaction.TransactionDefinition; import org.springframework.transaction.support.TransactionCallback; import org.springframework.transaction.support.TransactionTemplate; +import javax.annotation.Nullable; import javax.annotation.PostConstruct; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; @@ -142,29 +142,6 @@ public class ResourceReindexingSvcImpl implements IResourceReindexingSvc { ); } - /** - * A handler for rejected tasks that will have the caller block until space is available. - * This was stolen from old hibernate search(5.X.X), as it has been removed in HS6. We can probably come up with a better solution though. - */ - public static class BlockPolicy implements RejectedExecutionHandler { - - /** - * Puts the Runnable to the blocking queue, effectively blocking the delegating thread until space is available. - * - * @param r the runnable task requested to be executed - * @param e the executor attempting to execute this task - */ - @Override - public void rejectedExecution(Runnable r, ThreadPoolExecutor e) { - try { - e.getQueue().put( r ); - } catch (InterruptedException e1) { - ourLog.error("Interrupted Execption for task: {}",r, e1 ); - Thread.currentThread().interrupt(); - } - } - } - public void scheduleJob() { ScheduledJobDefinition jobDetail = new ScheduledJobDefinition(); diff --git a/hapi-fhir-storage/pom.xml b/hapi-fhir-storage/pom.xml index 66dc9f63f7a..67e2263beed 100644 --- a/hapi-fhir-storage/pom.xml +++ b/hapi-fhir-storage/pom.xml @@ -34,6 +34,11 @@ <artifactId>hapi-fhir-server</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>ca.uhn.hapi.fhir</groupId> + <artifactId>hapi-fhir-batch</artifactId> + <version>${project.version}</version> + </dependency> <dependency> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-structures-dstu2</artifactId> diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/log/Logs.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/batch/log/Logs.java similarity index 100% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/log/Logs.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/batch/log/Logs.java diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/api/IBulkDataExportSvc.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/export/api/IBulkDataExportSvc.java similarity index 100% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/api/IBulkDataExportSvc.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/export/api/IBulkDataExportSvc.java diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/CreateBulkExportEntityTasklet.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/CreateBulkExportEntityTasklet.java similarity index 100% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/CreateBulkExportEntityTasklet.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/CreateBulkExportEntityTasklet.java diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/GroupIdPresentValidator.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/GroupIdPresentValidator.java similarity index 80% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/GroupIdPresentValidator.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/GroupIdPresentValidator.java index 8e662049b5c..2c98567738d 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/GroupIdPresentValidator.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/GroupIdPresentValidator.java @@ -20,13 +20,12 @@ package ca.uhn.fhir.jpa.bulk.export.job; * #L% */ +import ca.uhn.fhir.jpa.batch.config.BatchConstants; import org.slf4j.Logger; import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.JobParametersInvalidException; import org.springframework.batch.core.JobParametersValidator; - -import static ca.uhn.fhir.jpa.bulk.export.job.BulkExportJobConfig.*; import static org.slf4j.LoggerFactory.getLogger; public class GroupIdPresentValidator implements JobParametersValidator { @@ -35,10 +34,10 @@ public class GroupIdPresentValidator implements JobParametersValidator { @Override public void validate(JobParameters theJobParameters) throws JobParametersInvalidException { - if (theJobParameters == null || theJobParameters.getString(GROUP_ID_PARAMETER) == null) { - throw new JobParametersInvalidException("Group Bulk Export jobs must have a " + GROUP_ID_PARAMETER + " attribute"); + if (theJobParameters == null || theJobParameters.getString(BatchConstants.BULK_EXPORT_GROUP_ID_PARAMETER) == null) { + throw new JobParametersInvalidException("Group Bulk Export jobs must have a " + BatchConstants.BULK_EXPORT_GROUP_ID_PARAMETER + " attribute"); } else { - ourLog.debug("detected we are running in group mode with group id [{}]", theJobParameters.getString(GROUP_ID_PARAMETER)); + ourLog.debug("detected we are running in group mode with group id [{}]", theJobParameters.getString(BatchConstants.BULK_EXPORT_GROUP_ID_PARAMETER)); } } } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/model/BulkExportJobStatusEnum.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/export/model/BulkExportJobStatusEnum.java similarity index 100% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/model/BulkExportJobStatusEnum.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/export/model/BulkExportJobStatusEnum.java diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/model/BulkExportResponseJson.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/export/model/BulkExportResponseJson.java similarity index 100% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/model/BulkExportResponseJson.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/export/model/BulkExportResponseJson.java diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/provider/BulkDataExportProvider.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/export/provider/BulkDataExportProvider.java similarity index 100% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/provider/BulkDataExportProvider.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/export/provider/BulkDataExportProvider.java index 466bbdfd7d8..283f3b0d9d7 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/provider/BulkDataExportProvider.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/export/provider/BulkDataExportProvider.java @@ -21,7 +21,6 @@ package ca.uhn.fhir.jpa.bulk.export.provider; */ import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.rest.api.server.bulk.BulkDataExportOptions; import ca.uhn.fhir.jpa.bulk.export.api.IBulkDataExportSvc; import ca.uhn.fhir.jpa.bulk.export.model.BulkExportResponseJson; import ca.uhn.fhir.jpa.model.util.JpaConstants; @@ -31,6 +30,7 @@ import ca.uhn.fhir.rest.annotation.OperationParam; import ca.uhn.fhir.rest.api.CacheControlDirective; import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.api.PreferHeader; +import ca.uhn.fhir.rest.api.server.bulk.BulkDataExportOptions; import ca.uhn.fhir.rest.server.RestfulServerUtils; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/search/reindex/BlockPolicy.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/search/reindex/BlockPolicy.java new file mode 100644 index 00000000000..a7512e16a51 --- /dev/null +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/search/reindex/BlockPolicy.java @@ -0,0 +1,32 @@ +package ca.uhn.fhir.jpa.search.reindex; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.concurrent.RejectedExecutionHandler; +import java.util.concurrent.ThreadPoolExecutor; + +/** + * A handler for rejected tasks that will have the caller block until space is available. + * This was stolen from old hibernate search(5.X.X), as it has been removed in HS6. We can probably come up with a better solution though. + */ +// TODO KHS consolidate with the other BlockPolicy class this looks like it is a duplicate of +public class BlockPolicy implements RejectedExecutionHandler { + private static final Logger ourLog = LoggerFactory.getLogger(BlockPolicy.class); + + /** + * Puts the Runnable to the blocking queue, effectively blocking the delegating thread until space is available. + * + * @param r the runnable task requested to be executed + * @param e the executor attempting to execute this task + */ + @Override + public void rejectedExecution(Runnable r, ThreadPoolExecutor e) { + try { + e.getQueue().put(r); + } catch (InterruptedException e1) { + ourLog.error("Interrupted Execption for task: {}", r, e1); + Thread.currentThread().interrupt(); + } + } +} diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/JsonDateDeserializer.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/JsonDateDeserializer.java similarity index 100% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/JsonDateDeserializer.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/JsonDateDeserializer.java diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/JsonDateSerializer.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/JsonDateSerializer.java similarity index 100% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/JsonDateSerializer.java rename to hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/JsonDateSerializer.java From 4c28b1b552d9d614e518778fe2663b63f4451016 Mon Sep 17 00:00:00 2001 From: Jason Roberts <jason.roberts@smilecdr.com> Date: Fri, 24 Sep 2021 09:46:48 -0400 Subject: [PATCH 30/31] fix npe --- .../fhir/changelog/5_6_0/3031-index-migration-npe.yaml | 5 +++++ .../main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3031-index-migration-npe.yaml diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3031-index-migration-npe.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3031-index-migration-npe.yaml new file mode 100644 index 00000000000..579d3ebe95c --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3031-index-migration-npe.yaml @@ -0,0 +1,5 @@ +--- +type: fix +issue: 3031 +jira: SMILE-3178 +title: "Fixes a bug that was causing a null pointer exception to be thrown during database migrations that add or drop indexes." diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java index 110417e4a19..b2edc322230 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java @@ -61,6 +61,7 @@ import java.util.List; import java.util.Locale; import java.util.Objects; import java.util.Set; +import java.util.stream.Collectors; public class JdbcUtils { private static final Logger ourLog = LoggerFactory.getLogger(JdbcUtils.class); @@ -86,7 +87,6 @@ public class JdbcUtils { while (indexes.next()) { ourLog.debug("*** Next index: {}", new ColumnMapRowMapper().mapRow(indexes, 0)); String indexName = indexes.getString("INDEX_NAME"); - indexName = indexName.toUpperCase(Locale.US); indexNames.add(indexName); } @@ -94,11 +94,15 @@ public class JdbcUtils { while (indexes.next()) { ourLog.debug("*** Next index: {}", new ColumnMapRowMapper().mapRow(indexes, 0)); String indexName = indexes.getString("INDEX_NAME"); - indexName = indexName.toUpperCase(Locale.US); indexNames.add(indexName); } - indexNames.removeIf(i -> i == null); + indexNames = indexNames + .stream() + .filter(Objects::nonNull) // filter out the nulls first + .map(s -> s.toUpperCase(Locale.US)) // then convert the non-null entries to upper case + .collect(Collectors.toSet()); + return indexNames; } catch (SQLException e) { From 81288d952600ba986b79575d17ed2611fe0e567c Mon Sep 17 00:00:00 2001 From: Jason Roberts <jason.roberts@smilecdr.com> Date: Fri, 24 Sep 2021 11:08:55 -0400 Subject: [PATCH 31/31] improve test coverage --- .../uhn/fhir/jpa/migrate/JdbcUtilsTest.java | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/JdbcUtilsTest.java b/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/JdbcUtilsTest.java index cdc9fb01a1f..3ffc8e6aed7 100644 --- a/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/JdbcUtilsTest.java +++ b/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/JdbcUtilsTest.java @@ -10,10 +10,14 @@ import javax.sql.DataSource; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; +import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Types; +import java.util.Set; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) @@ -64,4 +68,45 @@ public class JdbcUtilsTest { assertEquals(theExpectedColumnType, testColumnType.getColumnTypeEnum()); } + + @Test + public void testGetIndexNames_verifyNullHandling() throws SQLException { + + // setup + ResultSet mockTableResultSet = mock(ResultSet.class); + when(mockTableResultSet.next()).thenReturn(true, false); + when(mockTableResultSet.getString("TABLE_NAME")).thenReturn("TEST_TABLE"); + when(mockTableResultSet.getString("TABLE_TYPE")).thenReturn("USER TABLE"); + + ResultSetMetaData mockResultSetMetaData = mock(ResultSetMetaData.class); + when(mockResultSetMetaData.getColumnCount()).thenReturn(0); + + ResultSet mockIndicesResultSet = mock(ResultSet.class); + when(mockIndicesResultSet.next()).thenReturn(true, true, true, false); + when(mockIndicesResultSet.getString("INDEX_NAME")).thenReturn("IDX_1", null, "idx_2"); + when(mockIndicesResultSet.getMetaData()).thenReturn(mockResultSetMetaData); + + ResultSet mockUniqueIndicesResultSet = mock(ResultSet.class); + when(mockUniqueIndicesResultSet.next()).thenReturn(true, true, false); + when(mockUniqueIndicesResultSet.getString("INDEX_NAME")).thenReturn(null, "Idx_3"); + when(mockUniqueIndicesResultSet.getMetaData()).thenReturn(mockResultSetMetaData); + + when(myDatabaseMetaData.getTables("Catalog", "Schema", null, null)).thenReturn(mockTableResultSet); + when(myDatabaseMetaData.getIndexInfo("Catalog", "Schema", "TEST_TABLE", false, true)).thenReturn(mockIndicesResultSet); + when(myDatabaseMetaData.getIndexInfo("Catalog", "Schema", "TEST_TABLE", true, true)).thenReturn(mockUniqueIndicesResultSet); + when(myConnection.getMetaData()).thenReturn(myDatabaseMetaData); + when(myConnection.getCatalog()).thenReturn("Catalog"); + when(myConnection.getSchema()).thenReturn("Schema"); + when(myDataSource.getConnection()).thenReturn(myConnection); + DriverTypeEnum.ConnectionProperties myConnectionProperties = DriverTypeEnum.H2_EMBEDDED.newConnectionProperties(myDataSource); + + //execute + Set<String> indexNames = JdbcUtils.getIndexNames(myConnectionProperties, "TEST_TABLE"); + + // verify + assertEquals(3, indexNames.size()); + assertTrue(indexNames.contains("IDX_1")); + assertTrue(indexNames.contains("IDX_2")); + assertTrue(indexNames.contains("IDX_3")); + } }