More loinc work
This commit is contained in:
parent
b9802d0101
commit
33554189a1
|
@ -1,5 +1,6 @@
|
|||
Database migration:
|
||||
update table TRM_CODESYSTEM_VER drop column RES_VERSION_ID;
|
||||
drop constraint IDX_CSV_RESOURCEPID_AND_VER from table TRM_CODESYSTEM_VER
|
||||
|
||||
TODO:
|
||||
In answer lists, figure out what to do with externally defined lists
|
||||
|
@ -54,3 +55,7 @@ Document Ontology
|
|||
- Need to define a URI for the document ontology ValueSet. Currently I am
|
||||
using "http://loinc.org/document-ontology-codes"
|
||||
|
||||
Top 2000
|
||||
- Need to define a URI for both ValueSets. Currently I am using
|
||||
"http://loinc.org/top-2000-lab-results-us" and
|
||||
"http://loinc.org/top-2000-lab-results-si"
|
||||
|
|
|
@ -33,7 +33,7 @@ public interface ITermCodeSystemVersionDao extends JpaRepository<TermCodeSystem
|
|||
@Query("SELECT cs FROM TermCodeSystemVersion cs WHERE cs.myResource.myId = :resource_id")
|
||||
List<TermCodeSystemVersion> findByCodeSystemResource(@Param("resource_id") Long theCodeSystemResourcePid);
|
||||
|
||||
@Query("SELECT cs FROM TermCodeSystemVersion cs WHERE cs.myResource.myId = :resource_id AND cs.myResourceVersionId = :version_id")
|
||||
TermCodeSystemVersion findByCodeSystemResourceAndVersion(@Param("resource_id") Long theCodeSystemResourcePid, @Param("version_id") Long theCodeSystemVersionPid);
|
||||
@Query("SELECT cs FROM TermCodeSystemVersion cs WHERE cs.myCodeSystemHavingThisVersionAsCurrentVersionIfAny.myResource.myId = :resource_id")
|
||||
TermCodeSystemVersion findCurrentVersionForCodeSystemResourcePid(@Param("resource_id") Long theCodeSystemResourcePid);
|
||||
|
||||
}
|
||||
|
|
|
@ -41,9 +41,9 @@ import javax.persistence.UniqueConstraint;
|
|||
import ca.uhn.fhir.util.CoverageIgnore;
|
||||
|
||||
//@formatter:off
|
||||
@Table(name="TRM_CODESYSTEM_VER", uniqueConstraints= {
|
||||
@UniqueConstraint(name="IDX_CSV_RESOURCEPID_AND_VER", columnNames= {"RES_ID", "RES_VERSION_ID"})
|
||||
})
|
||||
@Table(name="TRM_CODESYSTEM_VER"
|
||||
// Note, we used to have a constraint named IDX_CSV_RESOURCEPID_AND_VER (don't reuse this)
|
||||
)
|
||||
@Entity()
|
||||
//@formatter:on
|
||||
public class TermCodeSystemVersion implements Serializable {
|
||||
|
@ -65,6 +65,10 @@ public class TermCodeSystemVersion implements Serializable {
|
|||
@Column(name = "CS_VERSION_ID", nullable = true, updatable = false)
|
||||
private String myCodeSystemVersionId;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@OneToOne(mappedBy = "myCurrentVersion", optional = true)
|
||||
private TermCodeSystem myCodeSystemHavingThisVersionAsCurrentVersionIfAny;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
|
|
|
@ -60,7 +60,6 @@ public class TerminologyLoaderSvcImpl implements IHapiTerminologyLoaderSvc {
|
|||
public static final String SCT_FILE_CONCEPT = "Terminology/sct2_Concept_Full_";
|
||||
public static final String SCT_FILE_DESCRIPTION = "Terminology/sct2_Description_Full-en";
|
||||
public static final String SCT_FILE_RELATIONSHIP = "Terminology/sct2_Relationship_Full";
|
||||
private static final int LOG_INCREMENT = 100000;
|
||||
public static final String LOINC_ANSWERLIST_FILE = "AnswerList_Beta_1.csv";
|
||||
public static final String LOINC_ANSWERLIST_LINK_FILE = "LoincAnswerListLink_Beta_1.csv";
|
||||
public static final String LOINC_DOCUMENT_ONTOLOGY_FILE = "DocumentOntology.csv";
|
||||
|
@ -70,7 +69,9 @@ public class TerminologyLoaderSvcImpl implements IHapiTerminologyLoaderSvc {
|
|||
public static final String LOINC_PART_LINK_FILE = "LoincPartLink_Beta_1.csv";
|
||||
public static final String LOINC_PART_RELATED_CODE_MAPPING_FILE = "PartRelatedCodeMapping_Beta_1.csv";
|
||||
public static final String LOINC_RSNA_PLAYBOOK_FILE = "LoincRsnaRadiologyPlaybook.csv";
|
||||
|
||||
public static final String TOP2000_COMMON_LAB_RESULTS_US_FILE = "Top2000CommonLabResultsUS.csv";
|
||||
public static final String TOP2000_COMMON_LAB_RESULTS_SI_FILE = "Top2000CommonLabResultsSI.csv";
|
||||
private static final int LOG_INCREMENT = 100000;
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(TerminologyLoaderSvcImpl.class);
|
||||
@Autowired
|
||||
private IHapiTerminologySvc myTermSvc;
|
||||
|
@ -249,6 +250,14 @@ public class TerminologyLoaderSvcImpl implements IHapiTerminologyLoaderSvc {
|
|||
handler = new LoincRsnaPlaybookHandler(codeSystemVersion, code2concept, propertyNames, valueSets, conceptMaps);
|
||||
iterateOverZipFile(theZipBytes, LOINC_RSNA_PLAYBOOK_FILE, handler, ',', QuoteMode.NON_NUMERIC);
|
||||
|
||||
// Top 2000 Codes - US
|
||||
handler = new LoincTop2000LabResultsUsHandler(code2concept, valueSets);
|
||||
iterateOverZipFile(theZipBytes, TOP2000_COMMON_LAB_RESULTS_US_FILE, handler, ',', QuoteMode.NON_NUMERIC);
|
||||
|
||||
// Top 2000 Codes - SI
|
||||
handler = new LoincTop2000LabResultsSiHandler(code2concept, valueSets);
|
||||
iterateOverZipFile(theZipBytes, TOP2000_COMMON_LAB_RESULTS_SI_FILE, handler, ',', QuoteMode.NON_NUMERIC);
|
||||
|
||||
theZipBytes.clear();
|
||||
|
||||
for (Entry<String, TermConcept> next : code2concept.entrySet()) {
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
package ca.uhn.fhir.jpa.term.loinc;
|
||||
|
||||
import ca.uhn.fhir.jpa.entity.TermConcept;
|
||||
import ca.uhn.fhir.jpa.term.IRecordHandler;
|
||||
import org.hl7.fhir.r4.model.Enumerations;
|
||||
import org.hl7.fhir.r4.model.ValueSet;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.isBlank;
|
||||
|
||||
abstract class BaseHandler implements IRecordHandler {
|
||||
|
||||
private final List<ValueSet> myValueSets;
|
||||
private final Map<String, ValueSet> myIdToValueSet = new HashMap<>();
|
||||
private final Map<String, TermConcept> myCode2Concept;
|
||||
|
||||
BaseHandler(Map<String, TermConcept> theCode2Concept, List<ValueSet> theValueSets) {
|
||||
myValueSets = theValueSets;
|
||||
myCode2Concept = theCode2Concept;
|
||||
}
|
||||
|
||||
void addCodeAsIncludeToValueSet(ValueSet theVs, String theCodeSystemUrl, String theCode, String theDisplayName) {
|
||||
ValueSet.ConceptSetComponent include = null;
|
||||
for (ValueSet.ConceptSetComponent next : theVs.getCompose().getInclude()) {
|
||||
if (next.getSystem().equals(theCodeSystemUrl)) {
|
||||
include = next;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (include == null) {
|
||||
include = theVs.getCompose().addInclude();
|
||||
include.setSystem(theCodeSystemUrl);
|
||||
}
|
||||
|
||||
boolean found = false;
|
||||
for (ValueSet.ConceptReferenceComponent next : include.getConcept()) {
|
||||
if (next.getCode().equals(theCode)) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
|
||||
String displayName = theDisplayName;
|
||||
if (isBlank(displayName)) {
|
||||
for (TermConcept next : myCode2Concept.values()) {
|
||||
if (next.getCode().equals(theCode)) {
|
||||
displayName = next.getDisplay();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
include
|
||||
.addConcept()
|
||||
.setCode(theCode)
|
||||
.setDisplay(displayName);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ValueSet getValueSet(String theValueSetId, String theValueSetUri, String theValueSetName) {
|
||||
ValueSet vs;
|
||||
if (!myIdToValueSet.containsKey(theValueSetId)) {
|
||||
vs = new ValueSet();
|
||||
vs.setUrl(theValueSetUri);
|
||||
vs.setId(theValueSetId);
|
||||
vs.setName(theValueSetName);
|
||||
vs.setStatus(Enumerations.PublicationStatus.ACTIVE);
|
||||
myIdToValueSet.put(theValueSetId, vs);
|
||||
myValueSets.add(vs);
|
||||
} else {
|
||||
vs = myIdToValueSet.get(theValueSetId);
|
||||
}
|
||||
return vs;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package ca.uhn.fhir.jpa.term.loinc;
|
||||
|
||||
import ca.uhn.fhir.jpa.entity.TermConcept;
|
||||
import ca.uhn.fhir.jpa.term.IHapiTerminologyLoaderSvc;
|
||||
import ca.uhn.fhir.jpa.term.IRecordHandler;
|
||||
import org.apache.commons.csv.CSVRecord;
|
||||
import org.hl7.fhir.r4.model.ValueSet;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.trim;
|
||||
|
||||
public class BaseLoincTop2000LabResultsHandler extends BaseHandler implements IRecordHandler {
|
||||
|
||||
private String myValueSetId;
|
||||
private String myValueSetUri;
|
||||
private String myValueSetName;
|
||||
|
||||
public BaseLoincTop2000LabResultsHandler(Map<String, TermConcept> theCode2concept, List<ValueSet> theValueSets, String theValueSetId, String theValueSetUri, String theValueSetName) {
|
||||
super(theCode2concept, theValueSets);
|
||||
myValueSetId = theValueSetId;
|
||||
myValueSetUri = theValueSetUri;
|
||||
myValueSetName = theValueSetName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(CSVRecord theRecord) {
|
||||
String loincNumber = trim(theRecord.get("LOINC #"));
|
||||
String displayName = trim(theRecord.get("Long Common Name"));
|
||||
|
||||
ValueSet valueSet = getValueSet(myValueSetId, myValueSetUri, myValueSetName);
|
||||
addCodeAsIncludeToValueSet(valueSet, IHapiTerminologyLoaderSvc.LOINC_URL, loincNumber, displayName);
|
||||
}
|
||||
|
||||
}
|
|
@ -13,7 +13,7 @@ import java.util.*;
|
|||
|
||||
import static org.apache.commons.lang3.StringUtils.trim;
|
||||
|
||||
public class LoincDocumentOntologyHandler implements IRecordHandler {
|
||||
public class LoincDocumentOntologyHandler extends BaseHandler implements IRecordHandler {
|
||||
|
||||
public static final String DOCUMENT_ONTOLOGY_CODES_VS_ID = "DOCUMENT_ONTOLOGY_CODES_VS";
|
||||
public static final String DOCUMENT_ONTOLOGY_CODES_VS_URI = "http://loinc.org/document-ontology-codes";
|
||||
|
@ -21,15 +21,12 @@ public class LoincDocumentOntologyHandler implements IRecordHandler {
|
|||
private final Map<String, TermConcept> myCode2Concept;
|
||||
private final TermCodeSystemVersion myCodeSystemVersion;
|
||||
private final Set<String> myPropertyNames;
|
||||
private final List<ValueSet> myValueSets;
|
||||
private final Map<String, ValueSet> myIdToValueSet = new HashMap<>();
|
||||
private final Set<String> myCodesInDocumentOntologyValueSet = new HashSet<>();
|
||||
|
||||
public LoincDocumentOntologyHandler(TermCodeSystemVersion theCodeSystemVersion, Map<String, TermConcept> theCode2concept, Set<String> thePropertyNames, List<ValueSet> theValueSets) {
|
||||
super(theCode2concept, theValueSets);
|
||||
myCodeSystemVersion = theCodeSystemVersion;
|
||||
myCode2Concept = theCode2concept;
|
||||
myPropertyNames = thePropertyNames;
|
||||
myValueSets = theValueSets;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,35 +39,10 @@ public class LoincDocumentOntologyHandler implements IRecordHandler {
|
|||
String partName = trim(theRecord.get("PartName"));
|
||||
|
||||
// RSNA Codes VS
|
||||
ValueSet vs;
|
||||
if (!myIdToValueSet.containsKey(DOCUMENT_ONTOLOGY_CODES_VS_ID)) {
|
||||
vs = new ValueSet();
|
||||
vs.setUrl(DOCUMENT_ONTOLOGY_CODES_VS_URI);
|
||||
vs.setId(DOCUMENT_ONTOLOGY_CODES_VS_ID);
|
||||
vs.setName(DOCUMENT_ONTOLOGY_CODES_VS_NAME);
|
||||
vs.setStatus(Enumerations.PublicationStatus.ACTIVE);
|
||||
myIdToValueSet.put(DOCUMENT_ONTOLOGY_CODES_VS_ID, vs);
|
||||
myValueSets.add(vs);
|
||||
} else {
|
||||
vs = myIdToValueSet.get(DOCUMENT_ONTOLOGY_CODES_VS_ID);
|
||||
}
|
||||
|
||||
if (!myCodesInDocumentOntologyValueSet.contains(loincNumber)) {
|
||||
String loincDisplayName= null;
|
||||
if (myCode2Concept.containsKey(loincNumber)) {
|
||||
loincDisplayName = myCode2Concept.get(loincNumber).getDisplay();
|
||||
}
|
||||
|
||||
vs
|
||||
.getCompose()
|
||||
.getIncludeFirstRep()
|
||||
.setSystem(IHapiTerminologyLoaderSvc.LOINC_URL)
|
||||
.addConcept()
|
||||
.setCode(loincNumber)
|
||||
.setDisplay(loincDisplayName);
|
||||
myCodesInDocumentOntologyValueSet.add(loincNumber);
|
||||
}
|
||||
ValueSet vs = getValueSet(DOCUMENT_ONTOLOGY_CODES_VS_ID, DOCUMENT_ONTOLOGY_CODES_VS_URI, DOCUMENT_ONTOLOGY_CODES_VS_NAME);
|
||||
addCodeAsIncludeToValueSet(vs, IHapiTerminologyLoaderSvc.LOINC_URL, loincNumber, null);
|
||||
|
||||
// Part Properties
|
||||
String loincCodePropName;
|
||||
switch (partTypeName) {
|
||||
case "Document.Kind":
|
||||
|
@ -99,4 +71,6 @@ public class LoincDocumentOntologyHandler implements IRecordHandler {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package ca.uhn.fhir.jpa.term.loinc;
|
||||
|
||||
import ca.uhn.fhir.jpa.entity.TermConcept;
|
||||
import org.hl7.fhir.r4.model.ValueSet;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class LoincTop2000LabResultsSiHandler extends BaseLoincTop2000LabResultsHandler {
|
||||
|
||||
public static final String TOP_2000_SI_VS_ID = "TOP_2000_SI_VS_ID";
|
||||
public static final String TOP_2000_SI_VS_URI = "http://loinc.org/top-2000-lab-results-si";
|
||||
public static final String TOP_2000_SI_VS_NAME = "Top 2000 Lab Results SI";
|
||||
|
||||
public LoincTop2000LabResultsSiHandler(Map<String, TermConcept> theCode2concept, List<ValueSet> theValueSets) {
|
||||
super(theCode2concept, theValueSets, TOP_2000_SI_VS_ID, TOP_2000_SI_VS_URI, TOP_2000_SI_VS_NAME);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package ca.uhn.fhir.jpa.term.loinc;
|
||||
|
||||
import ca.uhn.fhir.jpa.entity.TermConcept;
|
||||
import org.hl7.fhir.r4.model.ValueSet;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class LoincTop2000LabResultsUsHandler extends BaseLoincTop2000LabResultsHandler {
|
||||
|
||||
public static final String TOP_2000_US_VS_ID = "TOP_2000_LABRESULTS_US";
|
||||
public static final String TOP_2000_US_VS_URI = "http://loinc.org/top-2000-lab-results-us";
|
||||
public static final String TOP_2000_US_VS_NAME = "Top 2000 Lab Results US";
|
||||
|
||||
public LoincTop2000LabResultsUsHandler(Map<String, TermConcept> theCode2concept, List<ValueSet> theValueSets) {
|
||||
super(theCode2concept, theValueSets, TOP_2000_US_VS_ID, TOP_2000_US_VS_URI, TOP_2000_US_VS_NAME);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -6,11 +6,14 @@ import org.junit.AfterClass;
|
|||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
public class TerminologyLoaderSvcIntegrationDstu3Test extends BaseJpaDstu3Test {
|
||||
|
||||
@Autowired
|
||||
private TerminologyLoaderSvcImpl myLoader;
|
||||
|
||||
@AfterClass
|
||||
|
@ -18,17 +21,14 @@ public class TerminologyLoaderSvcIntegrationDstu3Test extends BaseJpaDstu3Test {
|
|||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
}
|
||||
|
||||
@Before
|
||||
public void beforeInitTest() {
|
||||
myLoader = new TerminologyLoaderSvcImpl();
|
||||
myLoader.setTermSvcForUnitTests(myTermSvc);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void testLoadAndStoreLoinc() {
|
||||
List<byte[]> files;
|
||||
// myLoader.processSnomedCtFiles(files, mySrd);
|
||||
public void testLoadAndStoreLoinc() throws Exception {
|
||||
ZipCollectionBuilder files = new ZipCollectionBuilder();
|
||||
TerminologyLoaderSvcLoincTest.createLoincBundle(files);
|
||||
|
||||
myLoader.loadLoinc(files.getFiles(), mySrd);
|
||||
|
||||
Thread.sleep(120000);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,10 +2,7 @@ package ca.uhn.fhir.jpa.term;
|
|||
|
||||
import ca.uhn.fhir.jpa.entity.TermCodeSystemVersion;
|
||||
import ca.uhn.fhir.jpa.entity.TermConcept;
|
||||
import ca.uhn.fhir.jpa.term.loinc.LoincDocumentOntologyHandler;
|
||||
import ca.uhn.fhir.jpa.term.loinc.LoincPartHandler;
|
||||
import ca.uhn.fhir.jpa.term.loinc.LoincPartRelatedCodeMappingHandler;
|
||||
import ca.uhn.fhir.jpa.term.loinc.LoincRsnaPlaybookHandler;
|
||||
import ca.uhn.fhir.jpa.term.loinc.*;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.util.TestUtil;
|
||||
import org.hl7.fhir.r4.model.CodeSystem;
|
||||
|
@ -21,6 +18,7 @@ import org.mockito.Captor;
|
|||
import org.mockito.Mock;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -60,21 +58,13 @@ public class TerminologyLoaderSvcLoincTest {
|
|||
mySvc = new TerminologyLoaderSvcImpl();
|
||||
mySvc.setTermSvcForUnitTests(myTermSvc);
|
||||
mySvc.setTermSvcDstu3ForUnitTest(myTermSvcDstu3);
|
||||
|
||||
|
||||
myFiles = new ZipCollectionBuilder();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoadLoinc() throws Exception {
|
||||
myFiles.addFile("/loinc/", "loinc.csv", TerminologyLoaderSvcImpl.LOINC_FILE);
|
||||
myFiles.addFile("/loinc/", "hierarchy.csv", TerminologyLoaderSvcImpl.LOINC_HIERARCHY_FILE);
|
||||
myFiles.addFile("/loinc/", "AnswerList_Beta_1.csv", TerminologyLoaderSvcImpl.LOINC_ANSWERLIST_FILE);
|
||||
myFiles.addFile("/loinc/", TerminologyLoaderSvcImpl.LOINC_ANSWERLIST_LINK_FILE, TerminologyLoaderSvcImpl.LOINC_ANSWERLIST_LINK_FILE);
|
||||
myFiles.addFile("/loinc/", TerminologyLoaderSvcImpl.LOINC_PART_FILE, TerminologyLoaderSvcImpl.LOINC_PART_FILE);
|
||||
myFiles.addFile("/loinc/", TerminologyLoaderSvcImpl.LOINC_PART_LINK_FILE, TerminologyLoaderSvcImpl.LOINC_PART_LINK_FILE);
|
||||
myFiles.addFile("/loinc/", TerminologyLoaderSvcImpl.LOINC_PART_RELATED_CODE_MAPPING_FILE);
|
||||
myFiles.addFile("/loinc/", TerminologyLoaderSvcImpl.LOINC_DOCUMENT_ONTOLOGY_FILE);
|
||||
myFiles.addFile("/loinc/", TerminologyLoaderSvcImpl.LOINC_RSNA_PLAYBOOK_FILE);
|
||||
createLoincBundle(myFiles);
|
||||
|
||||
// Actually do the load
|
||||
mySvc.loadLoinc(myFiles.getFiles(), details);
|
||||
|
@ -240,14 +230,53 @@ public class TerminologyLoaderSvcLoincTest {
|
|||
assertEquals("US Retroperitoneum", group.getElement().get(0).getTarget().get(0).getDisplay());
|
||||
assertEquals(Enumerations.ConceptMapEquivalence.EQUAL, group.getElement().get(0).getTarget().get(0).getEquivalence());
|
||||
|
||||
// TOP 2000 - US
|
||||
vs = valueSets.get(LoincTop2000LabResultsUsHandler.TOP_2000_US_VS_ID);
|
||||
assertEquals(vs.getName(), LoincTop2000LabResultsUsHandler.TOP_2000_US_VS_NAME);
|
||||
assertEquals(vs.getUrl(), LoincTop2000LabResultsUsHandler.TOP_2000_US_VS_URI);
|
||||
assertEquals(1, vs.getCompose().getInclude().size());
|
||||
assertEquals(IHapiTerminologyLoaderSvc.LOINC_URL, vs.getCompose().getInclude().get(0).getSystem());
|
||||
assertEquals(9, vs.getCompose().getInclude().get(0).getConcept().size());
|
||||
assertEquals("2160-0", vs.getCompose().getInclude().get(0).getConcept().get(0).getCode());
|
||||
assertEquals("Creatinine [Mass/volume] in Serum or Plasma", vs.getCompose().getInclude().get(0).getConcept().get(0).getDisplay());
|
||||
assertEquals("718-7", vs.getCompose().getInclude().get(0).getConcept().get(1).getCode());
|
||||
assertEquals("Hemoglobin [Mass/volume] in Blood", vs.getCompose().getInclude().get(0).getConcept().get(1).getDisplay());
|
||||
|
||||
// TOP 2000 - SI
|
||||
vs = valueSets.get(LoincTop2000LabResultsSiHandler.TOP_2000_SI_VS_ID);
|
||||
assertEquals(vs.getName(), LoincTop2000LabResultsSiHandler.TOP_2000_SI_VS_NAME);
|
||||
assertEquals(vs.getUrl(), LoincTop2000LabResultsSiHandler.TOP_2000_SI_VS_URI);
|
||||
assertEquals(1, vs.getCompose().getInclude().size());
|
||||
assertEquals(IHapiTerminologyLoaderSvc.LOINC_URL, vs.getCompose().getInclude().get(0).getSystem());
|
||||
assertEquals(9, vs.getCompose().getInclude().get(0).getConcept().size());
|
||||
assertEquals("14682-9", vs.getCompose().getInclude().get(0).getConcept().get(0).getCode());
|
||||
assertEquals("Creatinine [Moles/volume] in Serum or Plasma", vs.getCompose().getInclude().get(0).getConcept().get(0).getDisplay());
|
||||
assertEquals("718-7", vs.getCompose().getInclude().get(0).getConcept().get(1).getCode());
|
||||
assertEquals("Hemoglobin [Mass/volume] in Blood", vs.getCompose().getInclude().get(0).getConcept().get(1).getDisplay());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@AfterClass
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
}
|
||||
|
||||
static void createLoincBundle(ZipCollectionBuilder theFiles) throws IOException {
|
||||
theFiles.addFile("/loinc/", "loinc.csv", TerminologyLoaderSvcImpl.LOINC_FILE);
|
||||
theFiles.addFile("/loinc/", "hierarchy.csv", TerminologyLoaderSvcImpl.LOINC_HIERARCHY_FILE);
|
||||
theFiles.addFile("/loinc/", "AnswerList_Beta_1.csv", TerminologyLoaderSvcImpl.LOINC_ANSWERLIST_FILE);
|
||||
theFiles.addFile("/loinc/", TerminologyLoaderSvcImpl.LOINC_ANSWERLIST_LINK_FILE, TerminologyLoaderSvcImpl.LOINC_ANSWERLIST_LINK_FILE);
|
||||
theFiles.addFile("/loinc/", TerminologyLoaderSvcImpl.LOINC_PART_FILE, TerminologyLoaderSvcImpl.LOINC_PART_FILE);
|
||||
theFiles.addFile("/loinc/", TerminologyLoaderSvcImpl.LOINC_PART_LINK_FILE, TerminologyLoaderSvcImpl.LOINC_PART_LINK_FILE);
|
||||
theFiles.addFile("/loinc/", TerminologyLoaderSvcImpl.LOINC_PART_RELATED_CODE_MAPPING_FILE);
|
||||
theFiles.addFile("/loinc/", TerminologyLoaderSvcImpl.LOINC_DOCUMENT_ONTOLOGY_FILE);
|
||||
theFiles.addFile("/loinc/", TerminologyLoaderSvcImpl.LOINC_RSNA_PLAYBOOK_FILE);
|
||||
/*
|
||||
* Top 2000 files have versions in the filename so don't use the
|
||||
* constant.. that way this is a better test
|
||||
*/
|
||||
theFiles.addFile("/loinc/", "LOINC_1.6_Top2000CommonLabResultsSI.csv");
|
||||
theFiles.addFile("/loinc/", "LOINC_1.6_Top2000CommonLabResultsUS.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
|
|
|
@ -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
|
|
Loading…
Reference in New Issue