diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/FormatUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/FormatUtilities.java index 91dcf9622..8cea98eb4 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/FormatUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/FormatUtilities.java @@ -80,7 +80,11 @@ public abstract class FormatUtilities { public static final String XHTML_NS = "http://www.w3.org/1999/xhtml"; public static final String NS_XSI = "http://www.w3.org/2001/XMLSchema-instance"; private static final int MAX_SCAN_LENGTH = 1000; // how many characters to scan into content when autodetermining format - + + public static final String MAP_ATTRIBUTE_NAME = "mapAttribute"; + public static final String PROPERTY_NAME = "property"; + public static String WORKING_CM_PROP_NAME = PROPERTY_NAME; + protected String toString(String value) { return value; } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/JsonParser.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/JsonParser.java index 0d63655c0..11c998e02 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/JsonParser.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/JsonParser.java @@ -9418,10 +9418,10 @@ public class JsonParser extends JsonParserBase { protected void parseConceptMapOtherElementComponentProperties(JsonObject json, ConceptMap.OtherElementComponent res) throws IOException, FHIRFormatError { parseBackboneElementProperties(json, res); - if (json.has("property")) - res.setPropertyElement(parseUri(json.get("property").getAsString())); - if (json.has("_property")) - parseElementProperties(getJObject(json, "_property"), res.getPropertyElement()); + if (json.has(FormatUtilities.WORKING_CM_PROP_NAME)) + res.setPropertyElement(parseUri(json.get(FormatUtilities.WORKING_CM_PROP_NAME).getAsString())); + if (json.has("_"+FormatUtilities.WORKING_CM_PROP_NAME)) + parseElementProperties(getJObject(json, "_"+FormatUtilities.WORKING_CM_PROP_NAME), res.getPropertyElement()); DataType value = parseType("value", json); if (value != null) res.setValue(value); @@ -44920,8 +44920,8 @@ public class JsonParser extends JsonParserBase { protected void composeOtherElementComponentProperties(ConceptMap.OtherElementComponent element) throws IOException { composeBackboneElementProperties(element); if (element.hasPropertyElement()) { - composeUriCore("property", element.getPropertyElement(), false); - composeUriExtras("property", element.getPropertyElement(), false); + composeUriCore(FormatUtilities.WORKING_CM_PROP_NAME, element.getPropertyElement(), false); + composeUriExtras(FormatUtilities.WORKING_CM_PROP_NAME, element.getPropertyElement(), false); } if (element.hasValue()) { composeType("value", element.getValue()); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/XmlParser.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/XmlParser.java index acb18bb8c..488c9d41a 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/XmlParser.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/XmlParser.java @@ -8204,7 +8204,7 @@ public class XmlParser extends XmlParserBase { } protected boolean parseConceptMapOtherElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap.OtherElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError { - if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) { + if (eventType == XmlPullParser.START_TAG && xpp.getName().equals(FormatUtilities.WORKING_CM_PROP_NAME)) { res.setPropertyElement(parseUri(xpp)); } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) { res.setValue(parseType("value", xpp)); @@ -38972,7 +38972,7 @@ public class XmlParser extends XmlParserBase { protected void composeConceptMapOtherElementComponentElements(ConceptMap.OtherElementComponent element) throws IOException { composeBackboneElementElements(element); if (element.hasPropertyElement()) { - composeUri("property", element.getPropertyElement()); + composeUri(FormatUtilities.WORKING_CM_PROP_NAME, element.getPropertyElement()); } if (element.hasValue()) { composeType("value", element.getValue()); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java index ef8f00e36..d2e959539 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java @@ -212,7 +212,7 @@ public class ConceptMapRenderer extends TerminologyRenderer { } else tr.td().b().tx("Code"); for (String s : sources.keySet()) { - if (!s.equals("code")) { + if (s != null && !s.equals("code")) { if (sources.get(s).size() == 1) { String url = sources.get(s).iterator().next(); renderCSDetailsLink(tr, url, false); @@ -229,7 +229,7 @@ public class ConceptMapRenderer extends TerminologyRenderer { } else tr.td().b().tx("Code"); for (String s : targets.keySet()) { - if (!s.equals("code")) { + if (s != null && !s.equals("code")) { if (targets.get(s).size() == 1) { String url = targets.get(s).iterator().next(); renderCSDetailsLink(tr, url, false); @@ -291,7 +291,7 @@ public class ConceptMapRenderer extends TerminologyRenderer { td.style("border-top-style: none; border-left-width: 0px"); } for (String s : sources.keySet()) { - if (!s.equals("code")) { + if (s != null && !s.equals("code")) { td = tr.td(); if (first) { td.addText(getValue(ccm.getDependsOn(), s, sources.get(s).size() != 1)); @@ -323,7 +323,7 @@ public class ConceptMapRenderer extends TerminologyRenderer { tr.td().style("border-left-width: 0px").tx(display == null ? "" : display); for (String s : targets.keySet()) { - if (!s.equals("code")) { + if (s != null && !s.equals("code")) { td = tr.td(); td.addText(getValue(ccm.getProduct(), s, targets.get(s).size() != 1)); display = getDisplay(ccm.getProduct(), s);