From bf9ead2c9ebff55c495aee054fabd81a1a257337 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 1 Aug 2019 11:38:09 +1000 Subject: [PATCH] fix rendering of special compiler types --- .../fhir/r5/conformance/ProfileUtilities.java | 14 ++++++++----- .../validation-examples/manifest.json | 20 +++++++++++++++++++ 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java index 9010a4b94..4c8a34308 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java @@ -2217,7 +2217,6 @@ public class ProfileUtilities extends TranslatingUtilities { return null; } - private static final int AGG_NONE = 0; private static final int AGG_IND = 1; private static final int AGG_GR = 2; @@ -2311,10 +2310,15 @@ public class ProfileUtilities extends TranslatingUtilities { } } else c.addPiece(checkForNoChange(t, gen.new Piece((t.getProfile().get(0).getValue().startsWith(corePath)? corePath: "")+ref, t.getCode(), null))); - } else if (pkp != null && pkp.hasLinkFor(t.getCode())) { - c.addPiece(checkForNoChange(t, gen.new Piece(pkp.getLinkFor(corePath, t.getCode()), t.getCode(), null))); - } else - c.addPiece(checkForNoChange(t, gen.new Piece(null, t.getCode(), null))); + } else { + String tc = t.getCode(); + if (Utilities.noString(tc) && t.getCodeElement().hasExtension(ToolingExtensions.EXT_JSON_TYPE)) + tc = "string"; + if (pkp != null && pkp.hasLinkFor(tc)) { + c.addPiece(checkForNoChange(t, gen.new Piece(pkp.getLinkFor(corePath, tc), tc, null))); + } else + c.addPiece(checkForNoChange(t, gen.new Piece(null, tc, null))); + } } return c; } diff --git a/org.hl7.fhir.validation/src/test/resources/validation-examples/manifest.json b/org.hl7.fhir.validation/src/test/resources/validation-examples/manifest.json index 34e580ec1..ec00bcef6 100644 --- a/org.hl7.fhir.validation/src/test/resources/validation-examples/manifest.json +++ b/org.hl7.fhir.validation/src/test/resources/validation-examples/manifest.json @@ -830,6 +830,26 @@ "errorCount": 1 } }, + "value-slicing-ok-1.xml": { + "errorCount": 0, + "profiles": [ + "profile-slicing-profile-1.xml", "profile-slicing-profile-2.xml", "profile-slicing-profile-3.xml" + ], + "profile": { + "source": "value-slicing-profile-open.xml", + "errorCount": 0 + } + }, + "value-slicing-bad-1.xml": { + "errorCount": 0, + "profiles": [ + "profile-slicing-profile-1.xml", "profile-slicing-profile-2.xml", "profile-slicing-profile-3.xml" + ], + "profile": { + "source": "value-slicing-profile-open.xml", + "errorCount": 1 + } + }, "bundle-local-refs.xml" : { "errorCount": 0, "warningCount": 0