Update tests + fix 11073 codesystem

This commit is contained in:
dotasek 2022-11-03 16:33:56 -04:00
parent 6ecd4c70fe
commit 99bd733fe0
2 changed files with 11 additions and 2 deletions

View File

@ -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);

View File

@ -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 {