Fixes to terminology loader.
This commit is contained in:
parent
47244c54dc
commit
1dc4a533d6
|
@ -42,6 +42,8 @@ public interface IFhirResourceDaoCodeSystem<T extends IBaseResource, CD, CC> ext
|
|||
|
||||
SubsumesResult subsumes(IPrimitiveType<String> theCodeA, IPrimitiveType<String> theCodeB, IPrimitiveType<String> theSystem, CD theCodingA, CD theCodingB, RequestDetails theRequestDetails);
|
||||
|
||||
IValidationSupport.CodeValidationResult validateCode(IIdType theCodeSystemId, IPrimitiveType<String> theCodeSystemUrl, IPrimitiveType<String> theVersion, IPrimitiveType<String> theCode, IPrimitiveType<String> theDisplay, CD theCoding, CC theCodeableConcept, RequestDetails theRequestDetails);
|
||||
|
||||
class SubsumesResult {
|
||||
|
||||
private final ConceptSubsumptionOutcome myOutcome;
|
||||
|
|
|
@ -129,6 +129,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;
|
||||
|
@ -147,7 +148,9 @@ import javax.persistence.PersistenceContextType;
|
|||
import javax.persistence.TypedQuery;
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Fetch;
|
||||
import javax.persistence.criteria.Join;
|
||||
import javax.persistence.criteria.JoinType;
|
||||
import javax.persistence.criteria.Predicate;
|
||||
import javax.persistence.criteria.Root;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
|
|
@ -480,7 +480,7 @@ public class TermLoaderSvcImpl implements ITermLoaderSvc {
|
|||
|
||||
IOUtils.closeQuietly(theDescriptors);
|
||||
|
||||
valueSets.add(getValueSetLoincAll());
|
||||
valueSets.add(getValueSetLoincAll(theUploadProperties));
|
||||
|
||||
for (Entry<String, TermConcept> next : code2concept.entrySet()) {
|
||||
TermConcept nextConcept = next.getValue();
|
||||
|
@ -499,12 +499,20 @@ public class TermLoaderSvcImpl implements ITermLoaderSvc {
|
|||
return new UploadStatistics(conceptCount, target);
|
||||
}
|
||||
|
||||
private ValueSet getValueSetLoincAll() {
|
||||
private ValueSet getValueSetLoincAll(Properties theUploadProperties) {
|
||||
ValueSet retVal = new ValueSet();
|
||||
|
||||
retVal.setId("loinc-all");
|
||||
String codeSystemVersionId = theUploadProperties.getProperty(LOINC_CODESYSTEM_VERSION.getCode());
|
||||
String valueSetId;
|
||||
if (codeSystemVersionId != null) {
|
||||
valueSetId = "loinc-all" + "-" + codeSystemVersionId;
|
||||
} else {
|
||||
valueSetId = "loinc-all";
|
||||
codeSystemVersionId = "1.0.0";
|
||||
}
|
||||
retVal.setId(valueSetId);
|
||||
retVal.setUrl("http://loinc.org/vs");
|
||||
retVal.setVersion("1.0.0");
|
||||
retVal.setVersion(codeSystemVersionId);
|
||||
retVal.setName("All LOINC codes");
|
||||
retVal.setStatus(Enumerations.PublicationStatus.ACTIVE);
|
||||
retVal.setDate(new Date());
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CONCEPTMAP_VERSION;
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CODESYSTEM_VERSION;
|
||||
import static org.apache.commons.lang3.StringUtils.trim;
|
||||
|
||||
public class BaseLoincTop2000LabResultsHandler extends BaseLoincHandler implements IRecordHandler {
|
||||
|
@ -42,7 +42,12 @@ public class BaseLoincTop2000LabResultsHandler extends BaseLoincHandler implemen
|
|||
|
||||
public BaseLoincTop2000LabResultsHandler(Map<String, TermConcept> theCode2concept, List<ValueSet> theValueSets, String theValueSetId, String theValueSetUri, String theValueSetName, List<ConceptMap> theConceptMaps, Properties theUploadProperties) {
|
||||
super(theCode2concept, theValueSets, theConceptMaps, theUploadProperties);
|
||||
myValueSetId = theValueSetId + "-" + myUploadProperties.getProperty(LOINC_CONCEPTMAP_VERSION.getCode());
|
||||
String versionId = myUploadProperties.getProperty(LOINC_CODESYSTEM_VERSION.getCode());
|
||||
if (versionId != null) {
|
||||
myValueSetId = theValueSetId + "-" + versionId;
|
||||
} else {
|
||||
myValueSetId = theValueSetId;
|
||||
}
|
||||
myValueSetUri = theValueSetUri;
|
||||
myValueSetName = theValueSetName;
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public class LoincAnswerListHandler extends BaseLoincHandler {
|
|||
public void accept(CSVRecord theRecord) {
|
||||
|
||||
// this is the code for the list (will repeat)
|
||||
String answerListId = trim(theRecord.get("AnswerListId")) + "-" + myUploadProperties.getProperty(LOINC_CONCEPTMAP_VERSION.getCode());
|
||||
String answerListId = trim(theRecord.get("AnswerListId"));
|
||||
String answerListName = trim(theRecord.get("AnswerListName"));
|
||||
String answerListOid = trim(theRecord.get("AnswerListOID"));
|
||||
String externallyDefined = trim(theRecord.get("ExtDefinedYN"));
|
||||
|
@ -74,7 +74,14 @@ public class LoincAnswerListHandler extends BaseLoincHandler {
|
|||
}
|
||||
|
||||
// Answer list ValueSet
|
||||
ValueSet vs = getValueSet(answerListId, "http://loinc.org/vs/" + answerListId, answerListName, LOINC_ANSWERLIST_VERSION.getCode());
|
||||
String valueSetId;
|
||||
String codeSystemVersionId = myUploadProperties.getProperty(LOINC_CODESYSTEM_VERSION.getCode());
|
||||
if (codeSystemVersionId != null) {
|
||||
valueSetId = answerListId + "-" + codeSystemVersionId;
|
||||
} else {
|
||||
valueSetId = answerListId;
|
||||
}
|
||||
ValueSet vs = getValueSet(valueSetId, "http://loinc.org/vs/" + answerListId, answerListName, LOINC_ANSWERLIST_VERSION.getCode());
|
||||
if (vs.getIdentifier().isEmpty()) {
|
||||
vs.addIdentifier()
|
||||
.setSystem("urn:ietf:rfc:3986")
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CONCEPTMAP_VERSION;
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CODESYSTEM_VERSION;
|
||||
import static org.apache.commons.lang3.StringUtils.trim;
|
||||
|
||||
public class LoincDocumentOntologyHandler extends BaseLoincHandler implements IRecordHandler {
|
||||
|
@ -58,8 +58,14 @@ public class LoincDocumentOntologyHandler extends BaseLoincHandler implements IR
|
|||
String partName = trim(theRecord.get("PartName"));
|
||||
|
||||
// RSNA Codes VS
|
||||
ValueSet vs = getValueSet(DOCUMENT_ONTOLOGY_CODES_VS_ID + "-" + myUploadProperties.getProperty(LOINC_CONCEPTMAP_VERSION.getCode()),
|
||||
DOCUMENT_ONTOLOGY_CODES_VS_URI, DOCUMENT_ONTOLOGY_CODES_VS_NAME, null);
|
||||
String valueSetId;
|
||||
String codeSystemVersionId = myUploadProperties.getProperty(LOINC_CODESYSTEM_VERSION.getCode());
|
||||
if (codeSystemVersionId != null) {
|
||||
valueSetId = DOCUMENT_ONTOLOGY_CODES_VS_ID + "-" + codeSystemVersionId;
|
||||
} else {
|
||||
valueSetId = DOCUMENT_ONTOLOGY_CODES_VS_ID;
|
||||
}
|
||||
ValueSet vs = getValueSet(valueSetId, DOCUMENT_ONTOLOGY_CODES_VS_URI, DOCUMENT_ONTOLOGY_CODES_VS_NAME, null);
|
||||
addCodeAsIncludeToValueSet(vs, ITermLoaderSvc.LOINC_URI, loincNumber, null);
|
||||
|
||||
// Part Properties
|
||||
|
|
|
@ -30,7 +30,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CONCEPTMAP_VERSION;
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CODESYSTEM_VERSION;
|
||||
import static org.apache.commons.lang3.StringUtils.trim;
|
||||
|
||||
public class LoincGroupFileHandler extends BaseLoincHandler implements IRecordHandler {
|
||||
|
@ -44,11 +44,22 @@ public class LoincGroupFileHandler extends BaseLoincHandler implements IRecordHa
|
|||
@Override
|
||||
public void accept(CSVRecord theRecord) {
|
||||
//"ParentGroupId","GroupId","Group","Archetype","Status","VersionFirstReleased"
|
||||
String parentGroupId = trim(theRecord.get("ParentGroupId")) + "-" + myUploadProperties.getProperty(LOINC_CONCEPTMAP_VERSION.getCode());
|
||||
String parentGroupId = trim(theRecord.get("ParentGroupId"));
|
||||
String groupId = trim(theRecord.get("GroupId"));
|
||||
String groupName = trim(theRecord.get("Group"));
|
||||
|
||||
ValueSet parentValueSet = getValueSet(parentGroupId, VS_URI_PREFIX + parentGroupId, null, null);
|
||||
String codeSystemVersionId = myUploadProperties.getProperty(LOINC_CODESYSTEM_VERSION.getCode());
|
||||
String parentGroupValueSetId;
|
||||
String groupValueSetId;
|
||||
if (codeSystemVersionId != null) {
|
||||
parentGroupValueSetId = parentGroupId + "-" + codeSystemVersionId;
|
||||
groupValueSetId = groupId + "-" + codeSystemVersionId;
|
||||
} else {
|
||||
parentGroupValueSetId = parentGroupId;
|
||||
groupValueSetId = groupId;
|
||||
}
|
||||
|
||||
ValueSet parentValueSet = getValueSet(parentGroupValueSetId, VS_URI_PREFIX + parentGroupId, null, null);
|
||||
parentValueSet
|
||||
.getCompose()
|
||||
.getIncludeFirstRep()
|
||||
|
@ -56,7 +67,7 @@ public class LoincGroupFileHandler extends BaseLoincHandler implements IRecordHa
|
|||
|
||||
// Create group to set its name (terms are added in a different
|
||||
// handler)
|
||||
getValueSet(groupId, VS_URI_PREFIX + groupId + "-" + myUploadProperties.getProperty(LOINC_CONCEPTMAP_VERSION.getCode()), groupName, null);
|
||||
getValueSet(groupValueSetId, VS_URI_PREFIX + groupId, groupName, null);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CODESYSTEM_VERSION;
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CONCEPTMAP_VERSION;
|
||||
import static org.apache.commons.lang3.StringUtils.trim;
|
||||
|
||||
|
@ -43,10 +44,17 @@ public class LoincGroupTermsFileHandler extends BaseLoincHandler implements IRec
|
|||
@Override
|
||||
public void accept(CSVRecord theRecord) {
|
||||
//"Category","GroupId","Archetype","LoincNumber","LongCommonName"
|
||||
String groupId = trim(theRecord.get("GroupId")) + "-" + myUploadProperties.getProperty(LOINC_CONCEPTMAP_VERSION.getCode());
|
||||
String groupId = trim(theRecord.get("GroupId"));
|
||||
String codeSystemVersionId = myUploadProperties.getProperty(LOINC_CODESYSTEM_VERSION.getCode());
|
||||
String valueSetId;
|
||||
if (codeSystemVersionId != null) {
|
||||
valueSetId = groupId + "-" + codeSystemVersionId;
|
||||
} else {
|
||||
valueSetId = groupId;
|
||||
}
|
||||
String loincNumber = trim(theRecord.get("LoincNumber"));
|
||||
|
||||
ValueSet valueSet = getValueSet(groupId, LoincGroupFileHandler.VS_URI_PREFIX + groupId, null, null);
|
||||
ValueSet valueSet = getValueSet(valueSetId, LoincGroupFileHandler.VS_URI_PREFIX + groupId, null, null);
|
||||
addCodeAsIncludeToValueSet(valueSet, ITermLoaderSvc.LOINC_URI, loincNumber, null);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CODESYSTEM_VERSION;
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CONCEPTMAP_VERSION;
|
||||
import static org.apache.commons.lang3.StringUtils.trim;
|
||||
|
||||
|
@ -61,9 +62,16 @@ public class LoincIeeeMedicalDeviceCodeHandler extends BaseLoincHandler implemen
|
|||
// LOINC Part -> IEEE 11073:10101 Mappings
|
||||
String sourceCodeSystemUri = ITermLoaderSvc.LOINC_URI;
|
||||
String targetCodeSystemUri = ITermLoaderSvc.IEEE_11073_10101_URI;
|
||||
String conceptMapId;
|
||||
String codeSystemVersionId = myUploadProperties.getProperty(LOINC_CODESYSTEM_VERSION.getCode());
|
||||
if (codeSystemVersionId != null) {
|
||||
conceptMapId = LOINC_IEEE_CM_ID + "-" + codeSystemVersionId;
|
||||
} else {
|
||||
conceptMapId = LOINC_IEEE_CM_ID;
|
||||
}
|
||||
addConceptMapEntry(
|
||||
new ConceptMapping()
|
||||
.setConceptMapId(LOINC_IEEE_CM_ID + "-" + myUploadProperties.getProperty(LOINC_CONCEPTMAP_VERSION.getCode()))
|
||||
.setConceptMapId(conceptMapId)
|
||||
.setConceptMapUri(LOINC_IEEE_CM_URI)
|
||||
.setConceptMapVersion(loincIeeeCmVersion)
|
||||
.setConceptMapName(LOINC_IEEE_CM_NAME)
|
||||
|
|
|
@ -31,12 +31,12 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CONCEPTMAP_VERSION;
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CODESYSTEM_VERSION;
|
||||
import static org.apache.commons.lang3.StringUtils.trim;
|
||||
|
||||
public class LoincImagingDocumentCodeHandler extends BaseLoincHandler implements IRecordHandler {
|
||||
|
||||
public final String VS_ID = "loinc-imaging-document-codes" + "-" + myUploadProperties.getProperty(LOINC_CONCEPTMAP_VERSION.getCode());
|
||||
public static final String VS_ID_BASE = "loinc-imaging-document-codes";
|
||||
public static final String VS_URI = "http://loinc.org/vs/loinc-imaging-document-codes";
|
||||
public static final String VS_NAME = "LOINC Imaging Document Codes";
|
||||
|
||||
|
@ -49,7 +49,15 @@ public class LoincImagingDocumentCodeHandler extends BaseLoincHandler implements
|
|||
String loincNumber = trim(theRecord.get("LOINC_NUM"));
|
||||
String displayName = trim(theRecord.get("LONG_COMMON_NAME"));
|
||||
|
||||
ValueSet valueSet = getValueSet(VS_ID, VS_URI, VS_NAME,null);
|
||||
String codeSystemVersionId = myUploadProperties.getProperty(LOINC_CODESYSTEM_VERSION.getCode());
|
||||
String valueSetId;
|
||||
if (codeSystemVersionId != null) {
|
||||
valueSetId = VS_ID_BASE + "-" + codeSystemVersionId;
|
||||
} else {
|
||||
valueSetId = VS_ID_BASE;
|
||||
}
|
||||
|
||||
ValueSet valueSet = getValueSet(valueSetId, VS_URI, VS_NAME,null);
|
||||
addCodeAsIncludeToValueSet(valueSet, ITermLoaderSvc.LOINC_URI, loincNumber, displayName);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CONCEPTMAP_VERSION;
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CODESYSTEM_VERSION;
|
||||
import static org.apache.commons.lang3.StringUtils.trim;
|
||||
|
||||
public class LoincParentGroupFileHandler extends BaseLoincHandler implements IRecordHandler {
|
||||
|
@ -42,10 +42,17 @@ public class LoincParentGroupFileHandler extends BaseLoincHandler implements IRe
|
|||
@Override
|
||||
public void accept(CSVRecord theRecord) {
|
||||
// "ParentGroupId","ParentGroup","Status"
|
||||
String parentGroupId = trim(theRecord.get("ParentGroupId")) + "-" + myUploadProperties.getProperty(LOINC_CONCEPTMAP_VERSION.getCode());
|
||||
String parentGroupId = trim(theRecord.get("ParentGroupId"));
|
||||
String codeSystemVersionId = myUploadProperties.getProperty(LOINC_CODESYSTEM_VERSION.getCode());
|
||||
String valueSetId;
|
||||
if (codeSystemVersionId != null) {
|
||||
valueSetId = parentGroupId + "-" + codeSystemVersionId;
|
||||
} else {
|
||||
valueSetId = parentGroupId;
|
||||
}
|
||||
String parentGroupName = trim(theRecord.get("ParentGroup"));
|
||||
|
||||
getValueSet(parentGroupId, LoincGroupFileHandler.VS_URI_PREFIX + parentGroupId, parentGroupName, null);
|
||||
getValueSet(valueSetId, LoincGroupFileHandler.VS_URI_PREFIX + parentGroupId, parentGroupName, null);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CODESYSTEM_VERSION;
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CONCEPTMAP_VERSION;
|
||||
import static org.apache.commons.lang3.StringUtils.defaultString;
|
||||
import static org.apache.commons.lang3.StringUtils.trim;
|
||||
|
@ -129,10 +130,17 @@ public class LoincPartRelatedCodeMappingHandler extends BaseLoincHandler impleme
|
|||
loincPartMapName = "Unknown Mapping";
|
||||
break;
|
||||
}
|
||||
String conceptMapId;
|
||||
String codeSystemVersionId = myUploadProperties.getProperty(LOINC_CODESYSTEM_VERSION.getCode());
|
||||
if (codeSystemVersionId != null) {
|
||||
conceptMapId = loincPartMapId + "-" + codeSystemVersionId;
|
||||
} else {
|
||||
conceptMapId = loincPartMapId;
|
||||
}
|
||||
|
||||
addConceptMapEntry(
|
||||
new ConceptMapping()
|
||||
.setConceptMapId(loincPartMapId + "-" + myUploadProperties.getProperty(LOINC_CONCEPTMAP_VERSION.getCode()))
|
||||
.setConceptMapId(conceptMapId)
|
||||
.setConceptMapUri(loincPartMapUri)
|
||||
.setConceptMapVersion(loincPartMapVersion)
|
||||
.setConceptMapName(loincPartMapName)
|
||||
|
|
|
@ -31,6 +31,7 @@ import org.hl7.fhir.r4.model.ValueSet;
|
|||
|
||||
import java.util.*;
|
||||
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CODESYSTEM_VERSION;
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CONCEPTMAP_VERSION;
|
||||
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||
import static org.apache.commons.lang3.StringUtils.trim;
|
||||
|
@ -174,11 +175,22 @@ public class LoincRsnaPlaybookHandler extends BaseLoincHandler implements IRecor
|
|||
code.addPropertyCoding(loincCodePropName, ITermLoaderSvc.LOINC_URI, partNumber, partName);
|
||||
}
|
||||
|
||||
String partConceptMapId;
|
||||
String termConceptMapId;
|
||||
String codeSystemVersionId = myUploadProperties.getProperty(LOINC_CODESYSTEM_VERSION.getCode());
|
||||
if (codeSystemVersionId != null) {
|
||||
partConceptMapId = LoincPartRelatedCodeMappingHandler.LOINC_PART_TO_RID_PART_MAP_ID + "-" + codeSystemVersionId;
|
||||
termConceptMapId = LoincPartRelatedCodeMappingHandler.LOINC_TERM_TO_RPID_PART_MAP_ID + "-" + codeSystemVersionId;
|
||||
} else {
|
||||
partConceptMapId = LoincPartRelatedCodeMappingHandler.LOINC_PART_TO_RID_PART_MAP_ID;
|
||||
termConceptMapId = LoincPartRelatedCodeMappingHandler.LOINC_TERM_TO_RPID_PART_MAP_ID;
|
||||
}
|
||||
|
||||
// LOINC Part -> Radlex RID code mappings
|
||||
if (isNotBlank(rid)) {
|
||||
addConceptMapEntry(
|
||||
new ConceptMapping()
|
||||
.setConceptMapId(LoincPartRelatedCodeMappingHandler.LOINC_PART_TO_RID_PART_MAP_ID + "-" + myUploadProperties.getProperty(LOINC_CONCEPTMAP_VERSION.getCode()))
|
||||
.setConceptMapId(partConceptMapId)
|
||||
.setConceptMapUri(LoincPartRelatedCodeMappingHandler.LOINC_PART_TO_RID_PART_MAP_URI)
|
||||
.setConceptMapVersion(loincRsnaCmVersion)
|
||||
.setConceptMapName(LoincPartRelatedCodeMappingHandler.LOINC_PART_TO_RID_PART_MAP_NAME)
|
||||
|
@ -196,7 +208,7 @@ public class LoincRsnaPlaybookHandler extends BaseLoincHandler implements IRecor
|
|||
if (isNotBlank(rpid)) {
|
||||
addConceptMapEntry(
|
||||
new ConceptMapping()
|
||||
.setConceptMapId(LoincPartRelatedCodeMappingHandler.LOINC_TERM_TO_RPID_PART_MAP_ID + "-" + myUploadProperties.getProperty(LOINC_CONCEPTMAP_VERSION.getCode()))
|
||||
.setConceptMapId(termConceptMapId)
|
||||
.setConceptMapUri(LoincPartRelatedCodeMappingHandler.LOINC_TERM_TO_RPID_PART_MAP_URI)
|
||||
.setConceptMapVersion(loincRsnaCmVersion)
|
||||
.setConceptMapName(LoincPartRelatedCodeMappingHandler.LOINC_TERM_TO_RPID_PART_MAP_NAME)
|
||||
|
|
|
@ -29,12 +29,12 @@ import org.hl7.fhir.r4.model.ValueSet;
|
|||
|
||||
import java.util.*;
|
||||
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CONCEPTMAP_VERSION;
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_CODESYSTEM_VERSION;
|
||||
import static org.apache.commons.lang3.StringUtils.trim;
|
||||
|
||||
public class LoincUniversalOrderSetHandler extends BaseLoincHandler implements IRecordHandler {
|
||||
|
||||
public final String VS_ID = "loinc-universal-order-set" + "-" + myUploadProperties.getProperty(LOINC_CONCEPTMAP_VERSION.getCode());
|
||||
public static final String VS_ID_BASE = "loinc-universal-order-set";
|
||||
public static final String VS_URI = "http://loinc.org/vs/loinc-universal-order-set";
|
||||
public static final String VS_NAME = "LOINC Universal Order Set";
|
||||
|
||||
|
@ -48,7 +48,15 @@ public class LoincUniversalOrderSetHandler extends BaseLoincHandler implements I
|
|||
String displayName = trim(theRecord.get("LONG_COMMON_NAME"));
|
||||
String orderObs = trim(theRecord.get("ORDER_OBS"));
|
||||
|
||||
ValueSet valueSet = getValueSet(VS_ID, VS_URI, VS_NAME, null);
|
||||
String codeSystemVersionId = myUploadProperties.getProperty(LOINC_CODESYSTEM_VERSION.getCode());
|
||||
String valueSetId;
|
||||
if (codeSystemVersionId != null) {
|
||||
valueSetId = VS_ID_BASE + "-" + codeSystemVersionId;
|
||||
} else {
|
||||
valueSetId = VS_ID_BASE;
|
||||
}
|
||||
|
||||
ValueSet valueSet = getValueSet(valueSetId, VS_URI, VS_NAME, null);
|
||||
addCodeAsIncludeToValueSet(valueSet, ITermLoaderSvc.LOINC_URI, loincNumber, displayName);
|
||||
}
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ public enum LoincUploadPropertiesEnum {
|
|||
/*
|
||||
* OPTIONAL
|
||||
*/
|
||||
// This is the version identifier for the answer list file
|
||||
// This is the version identifier for the LOINC code system
|
||||
LOINC_CODESYSTEM_VERSION("loinc.codesystem.version"),
|
||||
|
||||
// This is the version identifier for the answer list file
|
||||
|
|
|
@ -63,7 +63,7 @@ loinc.universal.lab.order.valueset.file=AccessoryFiles/LoincUniversalLabOrdersVa
|
|||
|
||||
# This is the version identifier for the LOINC code system
|
||||
## Key may be omitted if only a single version of LOINC is being kept.
|
||||
loinc.codesystem.version=2.68
|
||||
#loinc.codesystem.version=2.68
|
||||
|
||||
# This is the version identifier for the answer list file
|
||||
## Key may be omitted
|
||||
|
|
|
@ -274,7 +274,7 @@ public class TerminologyLoaderSvcLoincTest extends BaseLoaderTest {
|
|||
assertEquals("Hemoglobin [Mass/volume] in Blood", vs.getCompose().getInclude().get(0).getConcept().get(1).getDisplay());
|
||||
|
||||
// Universal lab order VS
|
||||
vs = valueSets.get(LoincUniversalOrderSetHandler.VS_ID);
|
||||
vs = valueSets.get(LoincUniversalOrderSetHandler.VS_ID_BASE);
|
||||
assertEquals(1, vs.getCompose().getInclude().size());
|
||||
assertEquals(ITermLoaderSvc.LOINC_URI, vs.getCompose().getInclude().get(0).getSystem());
|
||||
assertEquals(9, vs.getCompose().getInclude().get(0).getConcept().size());
|
||||
|
@ -314,7 +314,7 @@ public class TerminologyLoaderSvcLoincTest extends BaseLoaderTest {
|
|||
assertEquals("MDC_CONC_GLU_VENOUS_PLASMA", conceptMap.getGroup().get(0).getElement().get(4).getTarget().get(0).getDisplay());
|
||||
|
||||
// Imaging Document Codes
|
||||
vs = valueSets.get(LoincImagingDocumentCodeHandler.VS_ID);
|
||||
vs = valueSets.get(LoincImagingDocumentCodeHandler.VS_ID_BASE);
|
||||
assertEquals(LoincImagingDocumentCodeHandler.VS_URI, vs.getUrl());
|
||||
assertEquals(LoincImagingDocumentCodeHandler.VS_NAME, vs.getName());
|
||||
assertEquals(1, vs.getCompose().getInclude().size());
|
||||
|
|
|
@ -156,7 +156,7 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
|
|||
Builder.BuilderWithTableName trmValueSet = version.onTable("TRM_VALUESET");
|
||||
trmValueSet.addColumn("20200923.2", "VER").nullable().type(ColumnTypeEnum.STRING, TermValueSet.MAX_VER_LENGTH);
|
||||
trmValueSet.dropIndex("20200923.3", "IDX_VALUESET_URL");
|
||||
trmValueSet.addIndex("20200923.4", "IDX_VALUESET_URL").unique(true).withColumns("URL", "VAR");
|
||||
trmValueSet.addIndex("20200923.4", "IDX_VALUESET_URL").unique(true).withColumns("URL", "VER");
|
||||
}
|
||||
|
||||
protected void init510_20200725() {
|
||||
|
|
Loading…
Reference in New Issue