From cec6425a7f4e2daa6e5f0c843ca96c9c953de9b4 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Sat, 11 Nov 2023 08:26:18 +1100 Subject: [PATCH 1/3] Add rendering of II.system --- .../java/org/hl7/fhir/r5/renderers/DataRenderer.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java index 2627640dd..fc18c91fb 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java @@ -19,6 +19,7 @@ import java.util.List; import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.FHIRFormatError; +import org.hl7.fhir.r5.context.ContextUtilities; import org.hl7.fhir.r5.context.IWorkerContext; import org.hl7.fhir.r5.context.IWorkerContext.ValidationResult; import org.hl7.fhir.r5.model.Address; @@ -53,6 +54,7 @@ import org.hl7.fhir.r5.model.IdType; import org.hl7.fhir.r5.model.Identifier; import org.hl7.fhir.r5.model.MarkdownType; import org.hl7.fhir.r5.model.Money; +import org.hl7.fhir.r5.model.NamingSystem; import org.hl7.fhir.r5.model.Period; import org.hl7.fhir.r5.model.PrimitiveType; import org.hl7.fhir.r5.model.Quantity; @@ -1198,7 +1200,14 @@ public class DataRenderer extends Renderer implements CodeResolver { private String displayIdentifier(Identifier ii) { String s = Utilities.noString(ii.getValue()) ? "?ngen-9?" : ii.getValue(); - + NamingSystem ns = context.getContext().getNSUrlMap().get(ii.getSystem()); + if (ns != null) { + if (ns.hasWebPath()) { + s = ""+ns.present()+"#"+s; + } else { + s = ns.present()+"#"+s; + } + } if (ii.hasType()) { if (ii.getType().hasText()) s = ii.getType().getText()+":\u00A0"+s; From 7ce63343510d31836ce303a4a65c3e1b1937c860 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Sat, 11 Nov 2023 08:26:40 +1100 Subject: [PATCH 2/3] remove spurious error when profile discriminators have no value --- .../org/hl7/fhir/validation/instance/InstanceValidator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java index 4d013d967..2989e0a5f 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java @@ -4762,7 +4762,8 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } List list = discriminator.endsWith(".resolve()") || discriminator.equals("resolve()") ? criteriaElement.getType().get(0).getTargetProfile() : criteriaElement.getType().get(0).getProfile(); if (list.size() == 0) { - throw new DefinitionException(context.formatMessage(I18nConstants.PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_A_TYPE_WITH_A_PROFILE__IN_PROFILE_, criteriaElement.getId(), profile.getVersionedUrl())); + // we don't have to find something + // throw new DefinitionException(context.formatMessage(I18nConstants.PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_A_TYPE_WITH_A_PROFILE__IN_PROFILE_, criteriaElement.getId(), profile.getVersionedUrl())); } else if (list.size() > 1) { CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(" or "); for (CanonicalType c : list) { From 89306e6ce3a73a58433aee8fca4281e1694c3611 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Sat, 11 Nov 2023 08:26:56 +1100 Subject: [PATCH 3/3] Remove wrong LOINC code from vital signs scan --- .../hl7/fhir/validation/instance/type/ObservationValidator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/ObservationValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/ObservationValidator.java index 80ccddbf3..08efb4d51 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/ObservationValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/ObservationValidator.java @@ -54,7 +54,7 @@ public class ObservationValidator extends BaseValidator { ok = checkObservationAgainstProfile(valContext,errors, element, stack, "http://hl7.org/fhir/StructureDefinition/bodytemp", "Body temperature", "LOINC", codes, pct, mode) && ok; } else if (hasLoincCode(code, codes, "8302-2", "3137-7", "3138-5", "8302-2", "8306-3", "8308-9")) { ok = checkObservationAgainstProfile(valContext,errors, element, stack, "http://hl7.org/fhir/StructureDefinition/bodyheight", "Body height", "LOINC", codes, pct, mode) && ok; - } else if (hasLoincCode(code, codes, "9843-4", "8287-5", "9843-4", "8289-1")) { + } else if (hasLoincCode(code, codes, "9843-4", "8287-5", "9843-4")) { ok = checkObservationAgainstProfile(valContext,errors, element, stack, "http://hl7.org/fhir/StructureDefinition/headcircum", "Head circumference", "LOINC", codes, pct, mode) && ok; } else if (hasLoincCode(code, codes, "29463-7", "29463-7", "3141-9", "3142-7", "75292-3", "79348-9", "8350-1", "8351-9")) { ok = checkObservationAgainstProfile(valContext,errors, element, stack, "http://hl7.org/fhir/StructureDefinition/bodyweight", "Body weight", "LOINC", codes, pct, mode) && ok;