From 52e3c9496e72ceb5e2815e7c8b8a0f9698e5bba0 Mon Sep 17 00:00:00 2001 From: James Agnew Date: Tue, 26 Jun 2018 21:59:01 -0400 Subject: [PATCH] Fix slow upload --- .../ca/uhn/fhir/jpa/term/TerminologyLoaderSvcImpl.java | 2 +- .../java/ca/uhn/fhir/jpa/term/loinc/BaseLoincHandler.java | 7 +++---- 2 files changed, 4 insertions(+), 5 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 5eaa579c189..484be74afe3 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 @@ -81,7 +81,7 @@ public class TerminologyLoaderSvcImpl implements IHapiTerminologyLoaderSvc { public static final String LOINC_GROUP_FILE = "Group.csv"; public static final String LOINC_GROUP_TERMS_FILE = "GroupLoincTerms.csv"; public static final String LOINC_PARENT_GROUP_FILE = "ParentGroup.csv"; - private static final int LOG_INCREMENT = 100000; + private static final int LOG_INCREMENT = 1000; private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(TerminologyLoaderSvcImpl.class); @Autowired 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 227e174f39f..d1a4e9b6753 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 @@ -82,10 +82,9 @@ public abstract class BaseLoincHandler implements IRecordHandler { String displayName = theDisplayName; if (isBlank(displayName)) { - for (TermConcept next : myCode2Concept.values()) { - if (next.getCode().equals(theCode)) { - displayName = next.getDisplay(); - } + TermConcept concept = myCode2Concept.get(theCode); + if (concept != null) { + displayName = concept.getDisplay(); } }