From 4100315ee756cacc9beeca2b0a5890a322eb0730 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 16 Oct 2023 23:14:02 +1100 Subject: [PATCH] fix bug processing value sets containing URLs --- .../hl7/fhir/r5/terminologies/providers/URICodeSystem.java | 2 +- .../fhir/r5/terminologies/validation/ValueSetValidator.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/providers/URICodeSystem.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/providers/URICodeSystem.java index 8deb9897e..3b57c6e83 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/providers/URICodeSystem.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/providers/URICodeSystem.java @@ -9,7 +9,7 @@ public class URICodeSystem extends SpecialCodeSystem { @Override public ConceptDefinitionComponent findConcept(Coding code) { if (Utilities.isAbsoluteUrl(code.getCode())) { - return new ConceptDefinitionComponent(code.getCode()); + return new ConceptDefinitionComponent(code.getCode()).setDisplay(code.hasDisplay() ? code.getDisplay() : code.getCode()); } else { return null; } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/validation/ValueSetValidator.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/validation/ValueSetValidator.java index 24f29a319..207f0e261 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/validation/ValueSetValidator.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/validation/ValueSetValidator.java @@ -1265,7 +1265,9 @@ public class ValueSetValidator extends ValueSetProcessBase { public boolean validateCodeInConceptList(String code, CodeSystem def, List list, AlternateCodesProcessingRules altCodeRules) { opContext.deadCheck(); - if (def.getCaseSensitive()) { + if (def.hasUserData("tx.cs.special")) { + return ((SpecialCodeSystem) def.getUserData("tx.cs.special")).findConcept(new Coding().setCode(code)) != null; + } else if (def.getCaseSensitive()) { for (ConceptDefinitionComponent cc : list) { if (cc.getCode().equals(code)) { return true;