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 808f256b2..c73fdaf6f 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 @@ -2087,6 +2087,8 @@ public class ProfileUtilities extends TranslatingUtilities { private void removeStatusExtensions(ElementDefinition outcome) { outcome.removeExtension(ToolingExtensions.EXT_FMM_LEVEL); + outcome.removeExtension(ToolingExtensions.EXT_FMM_SUPPORT); + outcome.removeExtension(ToolingExtensions.EXT_FMM_DERIVED); outcome.removeExtension(ToolingExtensions.EXT_STANDARDS_STATUS); outcome.removeExtension(ToolingExtensions.EXT_NORMATIVE_VERSION); outcome.removeExtension(ToolingExtensions.EXT_WORKGROUP); 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 998205f4c..db77f5ba3 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 @@ -1139,9 +1139,11 @@ public class DataRenderer extends Renderer { protected String displayQuantity(Quantity q) { StringBuilder s = new StringBuilder(); - s.append("(system = '").append(TerminologyRenderer.describeSystem(q.getSystem())) - .append("' code ").append(q.getCode()) - .append(" = '").append(lookupCode(q.getSystem(), null, q.getCode())).append("')"); + s.append(q.hasValue() ? q.getValue() : "?"); + if (q.hasUnit()) + s.append(" ").append(q.getUnit()); + else if (q.hasCode()) + s.append(" ").append(q.getCode()); return s.toString(); } @@ -1158,26 +1160,33 @@ public class DataRenderer extends Renderer { } if (q.hasUnit()) x.tx(" "+q.getUnit()); - else if (q.hasCode()) - x.tx(" "+q.getCode()); + else if (q.hasCode() && q.hasSystem()) { + // if there's a code there *shall* be a system, so if we've got one and not the other, things are invalid and we won't bother trying to render + if (q.hasSystem() && q.getSystem().equals("http://unitsofmeasure.org")) + x.tx(" "+q.getCode()); + else + x.tx("(unit "+q.getCode()+" from "+q.getSystem()+")"); + } if (showCodeDetails && q.hasCode()) { x.span("background: LightGoldenRodYellow", null).tx(" (Details: "+TerminologyRenderer.describeSystem(q.getSystem())+" code "+q.getCode()+" = '"+lookupCode(q.getSystem(), null, q.getCode())+"')"); } } public String displayRange(Range q) { + if (!q.hasLow() && !q.hasHigh()) + return "?"; + StringBuilder b = new StringBuilder(); - if (q.hasLow()) - b.append(q.getLow().getValue().toString()); - else - b.append("?"); - b.append("-"); - if (q.hasHigh()) - b.append(q.getHigh().getValue().toString()); - else - b.append("?"); - if (q.getLow().hasUnit()) - b.append(" "+q.getLow().getUnit()); + + boolean sameUnits = (q.getLow().hasUnit() && q.getHigh().hasUnit() && q.getLow().getUnit().equals(q.getHigh().getUnit())) + || (q.getLow().hasCode() && q.getHigh().hasCode() && q.getLow().getCode().equals(q.getHigh().getCode())); + String low = "?"; + if (q.hasLow() && q.getLow().hasValue()) + low = sameUnits ? q.getLow().getValue().toString() : displayQuantity(q.getLow()); + String high = displayQuantity(q.getHigh()); + if (high.isEmpty()) + high = "?"; + b.append(low).append("\u00A0to\u00A0").append(high); return b.toString(); } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java index 8285a81ba..14b034793 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java @@ -142,6 +142,7 @@ public class ValueSetCheckerSimple extends ValueSetWorker implements ValueSetChe } } } + Coding foundCoding = null; if (valueset != null && options.getValueSetMode() != ValueSetMode.NO_MEMBERSHIP_CHECK) { Boolean result = false; for (Coding c : code.getCoding()) { @@ -150,6 +151,7 @@ public class ValueSetCheckerSimple extends ValueSetWorker implements ValueSetChe result = null; } else if (ok) { result = true; + foundCoding = c; } } if (result == null) { @@ -162,8 +164,10 @@ public class ValueSetCheckerSimple extends ValueSetWorker implements ValueSetChe return new ValidationResult(IssueSeverity.ERROR, errors.toString()); } else if (warnings.size() > 0) { return new ValidationResult(IssueSeverity.WARNING, warnings.toString()); - } else { - return new ValidationResult(IssueSeverity.INFORMATION, null); + } else { + ConceptDefinitionComponent cd = new ConceptDefinitionComponent(foundCoding.getCode()); + cd.setDisplay(foundCoding.getDisplay()); + return new ValidationResult(foundCoding.getSystem(), cd); } }