From 07652540246d6e85036645f79972490c09b4082a Mon Sep 17 00:00:00 2001 From: Diederik Muylwyk Date: Mon, 26 Aug 2019 18:32:21 -0400 Subject: [PATCH] Making LOINC filenames configurable; initial commit. --- .../jpa/term/TerminologyLoaderSvcImpl.java | 4 +-- .../fhir/jpa/term/loinc/BaseLoincHandler.java | 2 +- .../term/loinc/LoincAnswerListHandler.java | 2 +- .../resources/loinc/loincupload.properties | 32 +++++++++++++++++-- 4 files changed, 33 insertions(+), 7 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 af8110b43bb..ca95641e4aa 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 @@ -472,13 +472,13 @@ public class TerminologyLoaderSvcImpl implements IHapiTerminologyLoaderSvc { Properties uploadProperties = new Properties(); for (FileDescriptor next : theDescriptors.getUncompressedFileDescriptors()) { - if (next.getFilename().endsWith("loincupload.properties")) { + if (next.getFilename().endsWith(LOINC_UPLOAD_PROPERTIES_FILE)) { try { try (InputStream inputStream = next.getInputStream()) { uploadProperties.load(inputStream); } } catch (IOException e) { - throw new InternalErrorException("Failed to read loincupload.properties", e); + throw new InternalErrorException("Failed to read " + LOINC_UPLOAD_PROPERTIES_FILE, e); } } } 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 57ca69fd2d8..fcd788c35b6 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 @@ -114,7 +114,7 @@ public abstract class BaseLoincHandler implements IRecordHandler { conceptMap.setId(theMapping.getConceptMapId()); conceptMap.setUrl(theMapping.getConceptMapUri()); conceptMap.setName(theMapping.getConceptMapName()); - conceptMap.setVersion(myUploadProperties.getProperty("conceptmap.version")); + conceptMap.setVersion(myUploadProperties.getProperty("loinc.conceptmap.version")); conceptMap.setPublisher(REGENSTRIEF_INSTITUTE_INC); conceptMap.addContact() .setName(REGENSTRIEF_INSTITUTE_INC) 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 b8e7dc20166..204609eb332 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 @@ -72,7 +72,7 @@ public class LoincAnswerListHandler extends BaseLoincHandler { } // Answer list ValueSet - ValueSet vs = getValueSet(answerListId, "http://loinc.org/vs/" + answerListId, answerListName, "answerlist.version"); + ValueSet vs = getValueSet(answerListId, "http://loinc.org/vs/" + answerListId, answerListName, "loinc.answerlist.version"); if (vs.getIdentifier().isEmpty()) { vs.addIdentifier() .setSystem("urn:ietf:rfc:3986") diff --git a/hapi-fhir-jpaserver-base/src/test/resources/loinc/loincupload.properties b/hapi-fhir-jpaserver-base/src/test/resources/loinc/loincupload.properties index 7a7aab2ab36..b442c7264bc 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/loinc/loincupload.properties +++ b/hapi-fhir-jpaserver-base/src/test/resources/loinc/loincupload.properties @@ -1,7 +1,33 @@ - +loinc.answerlist.file=AnswerList.csv +loinc.answerlist.link.file=LoincAnswerListLink.csv # This is the version identifier for the AnswerList file -answerlist.version=Beta.1 +loinc.answerlist.version=Beta.1 # This is the version identifier for uploaded ConceptMap resources -conceptmap.version=Beta.1 +loinc.conceptmap.version=Beta.1 +loinc.document.ontology.file=DocumentOntology.csv + +loinc.file=LoincTable/Loinc.csv + +loinc.group.file=Group.csv +loinc.group.terms.file=GroupLoincTerms.csv + +loinc.hierarchy.file=MultiAxialHierarchy.csv + +loinc.ieee.medical.device.code.mapping.table.csv=LoincIeeeMedicalDeviceCodeMappingTable.csv + +loinc.imaging.document.codes.file=ImagingDocumentCodes.csv + +loinc.parent.group.file=ParentGroup.csv + +loinc.part.file=Part.csv +loinc.part.link.file=LoincPartLink.csv +loinc.part.related.code.mapping.file=PartRelatedCodeMapping.csv + +loinc.rsna.playbook.file=LoincRsnaRadiologyPlaybook.csv + +loinc.top2000.common.lab.results.si.file=Top2000CommonLabResultsSi.csv +loinc.top2000.common.lab.results.us.file=Top2000CommonLabResultsUs.csv + +loinc.universal.lab.order.valueset.file=LoincUniversalLabOrdersValueSet.csv