From c8f0e0047f118ddba56c29892f487d3c151546bf Mon Sep 17 00:00:00 2001 From: James Agnew Date: Thu, 5 Jul 2018 19:17:06 -0400 Subject: [PATCH] Test fixes --- .../ca/uhn/fhir/jpa/term/TerminologyLoaderSvcImpl.java | 3 +++ .../term/loinc/LoincPartRelatedCodeMappingHandler.java | 2 +- .../uhn/fhir/jpa/term/TerminologyLoaderSvcLoincTest.java | 8 ++++---- .../src/test/resources/logback-test.xml | 1 - .../src/test/resources/loinc/Part.csv | 5 +++++ 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TerminologyLoaderSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TerminologyLoaderSvcImpl.java index 968d8e1b7d5..0f647f57b4c 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TerminologyLoaderSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TerminologyLoaderSvcImpl.java @@ -162,6 +162,9 @@ public class TerminologyLoaderSvcImpl implements IHapiTerminologyLoaderSvc { int nextLoggedCount = 0; while (iter.hasNext()) { CSVRecord nextRecord = iter.next(); + if (nextRecord.isConsistent()==false) { + continue; + } theHandler.accept(nextRecord); count++; if (count >= nextLoggedCount) { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincPartRelatedCodeMappingHandler.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincPartRelatedCodeMappingHandler.java index 5f8045ece24..20e65c5a76d 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincPartRelatedCodeMappingHandler.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincPartRelatedCodeMappingHandler.java @@ -43,7 +43,7 @@ public class LoincPartRelatedCodeMappingHandler extends BaseLoincHandler impleme public static final String LOINC_TERM_TO_RPID_PART_MAP_ID = "loinc-term-to-rpids"; public static final String LOINC_TERM_TO_RPID_PART_MAP_URI = "http://loinc.org/cm/loinc-to-rpids"; public static final String LOINC_TERM_TO_RPID_PART_MAP_NAME = "LOINC Terms to RadLex RPIDs"; - public static final String LOINC_PART_TO_RID_PART_MAP_ID = "loinc-term-to-rpids"; + public static final String LOINC_PART_TO_RID_PART_MAP_ID = "loinc-part-to-rids"; public static final String LOINC_PART_TO_RID_PART_MAP_URI = "http://loinc.org/cm/loinc-to-rpids"; public static final String LOINC_PART_TO_RID_PART_MAP_NAME = "LOINC Parts to RadLex RIDs"; private static final String LOINC_SCT_PART_MAP_NAME = "LOINC Part Map to SNOMED CT"; 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 365dde789a6..d551eb33a2e 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 @@ -246,11 +246,11 @@ public class TerminologyLoaderSvcLoincTest { // all entries have the same source and target so these should be null assertEquals(IHapiTerminologyLoaderSvc.LOINC_URI, group.getSource()); assertEquals(LoincRsnaPlaybookHandler.RPID_CS_URI, group.getTarget()); - assertEquals("LP199995-4", group.getElement().get(0).getCode()); - assertEquals("Neck", group.getElement().get(0).getDisplay()); + assertEquals("24531-6", group.getElement().get(0).getCode()); + assertEquals("US Retroperitoneum", group.getElement().get(0).getDisplay()); assertEquals(1, group.getElement().get(0).getTarget().size()); - assertEquals("RID7488", group.getElement().get(0).getTarget().get(0).getCode()); - assertEquals("neck", group.getElement().get(0).getTarget().get(0).getDisplay()); + assertEquals("RPID2142", group.getElement().get(0).getTarget().get(0).getCode()); + 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 diff --git a/hapi-fhir-jpaserver-base/src/test/resources/logback-test.xml b/hapi-fhir-jpaserver-base/src/test/resources/logback-test.xml index 91f8a74d3e2..b426d227835 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/logback-test.xml +++ b/hapi-fhir-jpaserver-base/src/test/resources/logback-test.xml @@ -1,5 +1,4 @@ - INFO diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc/Part.csv b/hapi-fhir-jpaserver-base/src/test/resources/loinc/Part.csv index 85a4fed2c90..d5816ead286 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc/Part.csv +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc/Part.csv @@ -39,3 +39,8 @@ "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" +