From 99bd733fe0a3b4fd287fa910205c2468f136e934 Mon Sep 17 00:00:00 2001 From: dotasek Date: Thu, 3 Nov 2022 16:33:56 -0400 Subject: [PATCH] Update tests + fix 11073 codesystem --- .../java/org/hl7/fhir/r5/context/TerminologyCache.java | 4 ++-- .../org/hl7/fhir/r5/context/TerminologyCacheTests.java | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java index 2cfcc8ca6..4ec3c1452 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java @@ -141,6 +141,8 @@ public class TerminologyCache { return getVersionedSystem("ucum", systemVersion); if (systemBaseName.startsWith(HL7_SID_CODESYSTEM_BASE_URL)) return getVersionedSystem(normalizeBaseURL(HL7_SID_CODESYSTEM_BASE_URL, systemBaseName), systemVersion); + if (systemBaseName.equals(_11073_CODESYSTEM_URN)) + return getVersionedSystem("11073", systemVersion); if (systemBaseName.startsWith(ISO_CODESYSTEM_URN)) return getVersionedSystem("iso"+systemBaseName.substring(ISO_CODESYSTEM_URN.length()).replace(":", ""), systemVersion); if (systemBaseName.startsWith(HL7_TERMINOLOGY_CODESYSTEM_BASE_URL)) @@ -151,8 +153,6 @@ public class TerminologyCache { return getVersionedSystem("lang", systemVersion); if (systemBaseName.equals(MIMETYPES_CODESYSTEM_URN)) return getVersionedSystem("mimetypes", systemVersion); - if (systemBaseName.equals(_11073_CODESYSTEM_URN)) - return getVersionedSystem("11073", systemVersion); if (systemBaseName.equals(DICOM_CODESYSTEM_URL)) return getVersionedSystem("dicom", systemVersion); return getVersionedSystem(systemBaseName.replace("/", "_").replace(":", "_").replace("?", "X").replace("#", "X"), systemVersion); diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/context/TerminologyCacheTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/context/TerminologyCacheTests.java index 26909b687..116eff7e5 100644 --- a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/context/TerminologyCacheTests.java +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/context/TerminologyCacheTests.java @@ -464,6 +464,15 @@ public class TerminologyCacheTests implements ResourceLoaderTests { "http://hl7.org/fhir/sid/id,id", "http://www.nlm.nih.gov/research/umls/rxnorm,rxnorm", "http://snomed.info/sct,snomed", + "http://www.nlm.nih.gov/research/umls/rxnorm,rxnorm", + "http://loinc.org,loinc", + "http://unitsofmeasure.org,ucum", + "urn:iso:std:iso:id,isoid", + "urn:ietf:bcp:47,lang", + "urn:ietf:bcp:13,mimetypes", + "urn:iso:std:iso:11073:10101,11073", + "my://random/system?with#chars,my___random_systemXwithXchars", + "http://dicom.nema.org/resources/ontology/DCM,dicom" }) public void testCacheTokenGeneration(String system, String expectedName) throws IOException, URISyntaxException {