From 026aa8669714a0287da60c2ddc02646a27e0c569 Mon Sep 17 00:00:00 2001 From: Oliver Egger Date: Mon, 21 Oct 2019 13:31:22 +0200 Subject: [PATCH] snapshot for logical model and enxp parsing --- .../java/org/hl7/fhir/r5/conformance/ProfileUtilities.java | 6 +++++- .../main/java/org/hl7/fhir/r5/elementmodel/XmlParser.java | 2 +- 2 files changed, 6 insertions(+), 2 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 8bbb1f519..6f21f06b1 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 @@ -463,7 +463,11 @@ public class ProfileUtilities extends TranslatingUtilities { StructureDefinitionDifferentialComponent diff = cloneDiff(derived.getDifferential()); // we make a copy here because we're sometimes going to hack the differential while processing it. Have to migrate user data back afterwards StructureDefinitionSnapshotComponent baseSnapshot = base.getSnapshot(); if (derived.getDerivation().equals(TypeDerivationRule.SPECIALIZATION)) { - baseSnapshot = cloneSnapshot(baseSnapshot, base.getType(), derived.getType()); + String derivedType = derived.getType(); + if (StructureDefinitionKind.LOGICAL.equals(derived.getKind()) && derived.getType().contains("/")) { + derivedType = derivedType.substring(derivedType.lastIndexOf("/")+1); + } + baseSnapshot = cloneSnapshot(baseSnapshot, base.getType(), derivedType); } processPaths("", derived.getSnapshot(), baseSnapshot, diff, baseCursor, diffCursor, baseSnapshot.getElement().size()-1, derived.getDifferential().hasElement() ? derived.getDifferential().getElement().size()-1 : -1, url, webUrl, derived.present(), null, null, false, base.getUrl(), null, false, new ArrayList(), base); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/XmlParser.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/XmlParser.java index a5643ad5a..433c2459c 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/XmlParser.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/XmlParser.java @@ -245,7 +245,7 @@ public class XmlParser extends ParserBase { if (!Utilities.noString(text)) { Property property = getTextProp(properties); if (property != null) { - if ("ED.data[x]".equals(property.getDefinition().getId())) { + if ("ED.data[x]".equals(property.getDefinition().getId()) || (property.getDefinition()!=null && property.getDefinition().getBase()!=null && "ED.data[x]".equals(property.getDefinition().getBase().getPath()))) { if ("B64".equals(node.getAttribute("representation"))) { context.getChildren().add(new Element("dataBase64Binary", property, "base64Binary", text).markLocation(line(node), col(node))); } else {