when rendering turtle to HTML
\ No newline at end of file
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 532fef47d..fbb99dd77 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
@@ -3245,14 +3245,22 @@ public class ProfileUtilities extends TranslatingUtilities {
tl = t;
if (t.hasTarget()) {
c.getPieces().add(gen.new Piece(corePath+"references.html", t.getWorkingCode(), null));
+ if (isMustSupportDirect(t) && e.getMustSupport()) {
+ c.addPiece(gen.new Piece(null, " ", null));
+ c.addStyledText(translate("sd.table", "This type must be supported"), "S", "white", "red", null, false);
+ }
c.getPieces().add(gen.new Piece(null, "(", null));
boolean tfirst = true;
- for (UriType u : t.getTargetProfile()) {
+ for (CanonicalType u : t.getTargetProfile()) {
if (tfirst)
tfirst = false;
else
c.addPiece(gen.new Piece(null, " | ", null));
genTargetLink(gen, profileBaseFileName, corePath, c, t, u.getValue());
+ if (isMustSupport(u) && e.getMustSupport()) {
+ c.addPiece(gen.new Piece(null, " ", null));
+ c.addStyledText(translate("sd.table", "This target must be supported"), "S", "white", "red", null, false);
+ }
}
c.getPieces().add(gen.new Piece(null, ")", null));
if (t.getAggregation().size() > 0) {
@@ -3289,6 +3297,10 @@ public class ProfileUtilities extends TranslatingUtilities {
}
} else
c.addPiece(checkForNoChange(t, gen.new Piece((p.getValue().startsWith(corePath)? corePath: "")+ref, t.getWorkingCode(), null)));
+ if (isMustSupport(p) && e.getMustSupport()) {
+ c.addPiece(gen.new Piece(null, " ", null));
+ c.addStyledText(translate("sd.table", "This profile must be supported"), "S", "white", "red", null, false);
+ }
}
} else {
String tc = t.getWorkingCode();
@@ -3301,8 +3313,13 @@ public class ProfileUtilities extends TranslatingUtilities {
}
} else if (pkp != null && pkp.hasLinkFor(tc)) {
c.addPiece(checkForNoChange(t, gen.new Piece(pkp.getLinkFor(corePath, tc), tc, null)));
- } else
+ } else {
c.addPiece(checkForNoChange(t, gen.new Piece(null, tc, null)));
+ }
+ if (isMustSupportDirect(t) && e.getMustSupport()) {
+ c.addPiece(gen.new Piece(null, " ", null));
+ c.addStyledText(translate("sd.table", "This type must be supported"), "S", "white", "red", null, false);
+ }
}
}
return c;
@@ -3931,6 +3948,10 @@ public class ProfileUtilities extends TranslatingUtilities {
c.getPieces().add(gen.new Piece(corePath+"datatypes.html#canonical", "canonical", null));
else
c.getPieces().add(gen.new Piece(corePath+"references.html#Reference", "Reference", null));
+ if (isMustSupportDirect(tr) && element.getMustSupport()) {
+ c.addPiece(gen.new Piece(null, " ", null));
+ c.addStyledText(translate("sd.table", "This type must be supported"), "S", "white", "red", null, false);
+ }
c.getPieces().add(gen.new Piece(null, "(", null));
}
boolean first = true;
@@ -3938,6 +3959,10 @@ public class ProfileUtilities extends TranslatingUtilities {
if (!first)
c.getPieces().add(gen.new Piece(null, " | ", null));
genTargetLink(gen, profileBaseFileName, corePath, c, tr, rt.getValue());
+ if (isMustSupport(rt) && element.getMustSupport()) {
+ c.addPiece(gen.new Piece(null, " ", null));
+ c.addStyledText(translate("sd.table", "This target must be supported"), "S", "white", "red", null, false);
+ }
first = false;
}
if (first)
@@ -3956,20 +3981,23 @@ public class ProfileUtilities extends TranslatingUtilities {
choicerow.getCells().add(gen.new Cell());
choicerow.getCells().add(gen.new Cell(null, null, "", null, null));
choicerow.setIcon("icon_primitive.png", HierarchicalTableGenerator.TEXT_ICON_PRIMITIVE);
- choicerow.getCells().add(gen.new Cell(null, corePath+"datatypes.html#"+t, sd.getType(), null, null));
- // } else if (definitions.getConstraints().contthnsKey(t)) {
- // ProfiledType pt = definitions.getConstraints().get(t);
- // choicerow.getCells().add(gen.new Cell(null, null, e.getName().replace("[x]", Utilities.capitalize(pt.getBaseType())), definitions.getTypes().containsKey(t) ? definitions.getTypes().get(t).getDefinition() : null, null));
- // choicerow.getCells().add(gen.new Cell());
- // choicerow.getCells().add(gen.new Cell(null, null, "", null, null));
- // choicerow.setIcon("icon_datatype.gif", HierarchicalTableGenerator.TEXT_ICON_DATATYPE);
- // choicerow.getCells().add(gen.new Cell(null, definitions.getSrcFile(t)+".html#"+t.replace("*", "open"), t, null, null));
+ Cell c = gen.new Cell(null, corePath+"datatypes.html#"+t, sd.getType(), null, null);
+ choicerow.getCells().add(c);
+ if (isMustSupport(tr) && element.getMustSupport()) {
+ c.addPiece(gen.new Piece(null, " ", null));
+ c.addStyledText(translate("sd.table", "This type must be supported"), "S", "white", "red", null, false);
+ }
} else {
choicerow.getCells().add(gen.new Cell(null, null, tail(element.getPath()).replace("[x]", Utilities.capitalize(t)), sd.getDescription(), null));
choicerow.getCells().add(gen.new Cell());
choicerow.getCells().add(gen.new Cell(null, null, "", null, null));
choicerow.setIcon("icon_datatype.gif", HierarchicalTableGenerator.TEXT_ICON_DATATYPE);
- choicerow.getCells().add(gen.new Cell(null, pkp.getLinkFor(corePath, t), sd.getType(), null, null));
+ Cell c = gen.new Cell(null, pkp.getLinkFor(corePath, t), sd.getType(), null, null);
+ choicerow.getCells().add(c);
+ if (isMustSupport(tr) && element.getMustSupport()) {
+ c.addPiece(gen.new Piece(null, " ", null));
+ c.addStyledText(translate("sd.table", "This type must be supported"), "S", "white", "red", null, false);
+ }
}
if (tr.hasProfile()) {
Cell typeCell = choicerow.getCells().get(3);
@@ -3982,6 +4010,10 @@ public class ProfileUtilities extends TranslatingUtilities {
typeCell.addPiece(gen.new Piece(null, "?gen-e2?", null));
else
typeCell.addPiece(gen.new Piece(psd.getUserString("path"), psd.getName(), psd.present()));
+ if (isMustSupport(pt) && element.getMustSupport()) {
+ typeCell.addPiece(gen.new Piece(null, " ", null));
+ typeCell.addStyledText(translate("sd.table", "This profile must be supported"), "S", "white", "red", null, false);
+ }
}
typeCell.addPiece(gen.new Piece(null, ")", null));
@@ -6177,6 +6209,32 @@ public class ProfileUtilities extends TranslatingUtilities {
return grp;
}
+ public static boolean isMustSupportDirect(TypeRefComponent tr) {
+ return ("true".equals(ToolingExtensions.readStringExtension(tr, ToolingExtensions.EXT_MUST_SUPPORT)));
+ }
+ public static boolean isMustSupport(TypeRefComponent tr) {
+ if ("true".equals(ToolingExtensions.readStringExtension(tr, ToolingExtensions.EXT_MUST_SUPPORT))) {
+ return true;
+ }
+ if (isMustSupport(tr.getProfile())) {
+ return true;
+ }
+ return isMustSupport(tr.getTargetProfile());
+ }
+
+ public static boolean isMustSupport(List profiles) {
+ for (CanonicalType ct : profiles) {
+ if (isMustSupport(ct)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ public static boolean isMustSupport(CanonicalType profile) {
+ return "true".equals(ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_MUST_SUPPORT));
+ }
}
\ No newline at end of file
diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java
index 40f5f73f6..175fec654 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java
@@ -180,6 +180,7 @@ public class ToolingExtensions {
public static final String EXT_OLD_CONCEPTMAP_EQUIVALENCE = "http://hl7.org/fhir/1.0/StructureDefinition/extension-ConceptMap.element.target.equivalence";
public static final String EXT_EXP_FRAGMENT = "http://hl7.org/fhir/tools/StructureDefinition/expansion-codesystem-fragment";
public static final String EXT_EXP_TOOCOSTLY = "http://hl7.org/fhir/StructureDefinition/valueset-toocostly";
+ public static final String EXT_MUST_SUPPORT = "http://hl7.org/fhir/StructureDefinition/elementdefinition-type-must-support";
// specific extension helpers
@@ -335,6 +336,8 @@ public class ToolingExtensions {
return ((DecimalType) ex.getValue()).asStringValue();
if ((ex.getValue() instanceof MarkdownType))
return ((MarkdownType) ex.getValue()).getValue();
+ if ((ex.getValue() instanceof PrimitiveType))
+ return ((PrimitiveType) ex.getValue()).primitiveValue();
if (!(ex.getValue() instanceof StringType))
return null;
return ((StringType) ex.getValue()).getValue();
diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nConstants.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nConstants.java
index 1d5359d76..4d9da697d 100644
--- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nConstants.java
+++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nConstants.java
@@ -341,6 +341,8 @@ public class I18nConstants {
public static final String RESOURCE_TYPE_MISMATCH_FOR___ = "Resource_type_mismatch_for___";
public static final String SAME_ID_ON_MULTIPLE_ELEMENTS__IN_ = "Same_id_on_multiple_elements__in_";
public static final String SD_MUST_HAVE_DERIVATION = "SD_MUST_HAVE_DERIVATION";
+ public static final String SD_NESTED_MUST_SUPPORT_DIFF = "SD_NESTED_MUST_SUPPORT_DIFF";
+ public static final String SD_NESTED_MUST_SUPPORT_SNAPSHOT = "SD_NESTED_MUST_SUPPORT_SNAPSHOT";
public static final String SEARCHPARAMETER_BASE_WRONG = "SEARCHPARAMETER_BASE_WRONG";
public static final String SEARCHPARAMETER_EXP_WRONG = "SEARCHPARAMETER_EXP_WRONG";
public static final String SEARCHPARAMETER_NOTFOUND = "SEARCHPARAMETER_NOTFOUND";
diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/turtle/Turtle.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/turtle/Turtle.java
index a92f03c66..a555698a3 100644
--- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/turtle/Turtle.java
+++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/turtle/Turtle.java
@@ -384,12 +384,12 @@ public class Turtle {
public String asHtml() throws Exception {
StringBuilder b = new StringBuilder();
- b.append("\r\n");
+ b.append("\r\n");
commitPrefixes(b);
for (Section s : sections) {
commitSection(b, s);
}
- b.append("
\r\n");
+ b.append("
\r\n");
b.append("\r\n");
return b.toString();
}
diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages.properties b/org.hl7.fhir.utilities/src/main/resources/Messages.properties
index 562e34887..18bee95a6 100644
--- a/org.hl7.fhir.utilities/src/main/resources/Messages.properties
+++ b/org.hl7.fhir.utilities/src/main/resources/Messages.properties
@@ -608,4 +608,7 @@ REFERENCE_REF_SUSPICIOUS = The syntax of the reference ''{0}'' looks incorrect,
TYPE_SPECIFIC_CHECKS_DT_QTY_NO_ANNOTATIONS = UCUM Codes that contain human readable annotations like {0} can be misleading. Best Practice is not to use annotations in the UCUM code, and rather to make sure that Quantity.unit is correctly human readable
XHTML_XHTML_ELEMENT_ILLEGAL_IN_PARA = Illegal element name inside in a paragraph in the XHTML (''{0}'')
UNSUPPORTED_IDENTIFIER_PATTERN_PROPERTY_NOT_SUPPORTED_FOR_DISCRIMINATOR_FOR_SLICE = Unsupported property {3} on type {2} for pattern for discriminator({0}) for slice {1}
-UNSUPPORTED_IDENTIFIER_PATTERN_NO_PROPERTY_NOT_SUPPORTED_FOR_DISCRIMINATOR_FOR_SLICE = Unsupported: no properties with values found on type {2} for pattern for discriminator({0}) for slice {1}
\ No newline at end of file
+UNSUPPORTED_IDENTIFIER_PATTERN_NO_PROPERTY_NOT_SUPPORTED_FOR_DISCRIMINATOR_FOR_SLICE = Unsupported: no properties with values found on type {2} for pattern for discriminator({0}) for slice {1}
+SD_NESTED_MUST_SUPPORT_DIFF = The element {0} has types/profiles/targets that are marked as must support, but the element itself is not marked as must-support. The inner must-supports will be ignored unless the element inherits must-support = true
+SD_NESTED_MUST_SUPPORT_SNAPSHOT = The element {0} has types/profiles/targets that are marked as must support, but the element itself is not marked as must-support
+
\ No newline at end of file
diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java
index 9e1bd5dd3..c36db51d3 100644
--- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java
+++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java
@@ -296,9 +296,10 @@ public class BaseValidator {
* Set this parameter to false
if the validation does not pass
* @return Returns thePass
(in other words, returns true
if the rule did not fail validation)
*/
- protected boolean hint(List