Change rules about how maxValueSet is validated

This commit is contained in:
Grahame Grieve 2019-09-02 16:04:21 +10:00
parent 7926644893
commit 1a14bfc9e8
2 changed files with 7 additions and 3 deletions

View File

@ -1027,8 +1027,12 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (!cc.hasCoding()) {
if (binding.getStrength() == BindingStrength.REQUIRED)
rule(errors, IssueType.CODEINVALID, element.line(), element.col(), path, false, "No code provided, and a code is required from the value set " + describeReference(binding.getValueSet()) + " (" + valueset.getUrl());
else if (binding.getStrength() == BindingStrength.EXTENSIBLE)
warning(errors, IssueType.CODEINVALID, element.line(), element.col(), path, false, "No code provided, and a code should be provided from the value set " + describeReference(binding.getValueSet()) + " (" + valueset.getUrl());
else if (binding.getStrength() == BindingStrength.EXTENSIBLE) {
if (binding.hasExtension("http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet"))
rule(errors, IssueType.CODEINVALID, element.line(), element.col(), path, false, "No code provided, and a code must be provided from the value set " + describeReference(ToolingExtensions.readStringExtension(binding, "http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet")) + " (max value set " + valueset.getUrl()+")");
else
warning(errors, IssueType.CODEINVALID, element.line(), element.col(), path, false, "No code provided, and a code should be provided from the value set " + describeReference(binding.getValueSet()) + " (" + valueset.getUrl()+")");
}
} else {
long t = System.nanoTime();

View File

@ -872,7 +872,7 @@
"errorCount": 0,
"profile": {
"source": "maxvalueset-profile.xml",
"errorCount": 0
"errorCount": 1
}
},
"observation-maxvs-wrong.xml": {