Add resource type to messages for clarity + fix typos in messages

This commit is contained in:
Grahame Grieve 2020-04-05 20:35:22 +10:00
parent a3be26f356
commit 42461e6162
4 changed files with 23 additions and 37 deletions

View File

@ -142,23 +142,23 @@ Terminology_TX_Error_CodeableConcept = Error {0} validating CodeableConcept
Terminology_TX_Error_CodeableConcept_Max = Error {0} validating CodeableConcept using maxValueSet Terminology_TX_Error_CodeableConcept_Max = Error {0} validating CodeableConcept using maxValueSet
Terminology_TX_Error_Coding1 = Error {0} validating Coding Terminology_TX_Error_Coding1 = Error {0} validating Coding
Terminology_TX_Error_Coding2 = Error {0} validating Coding: {1} Terminology_TX_Error_Coding2 = Error {0} validating Coding: {1}
Terminology_TX_NoValid_1 = None of the codes provided are in the value set {0} ({1}, and a code from this value set is required) (codes = {2}) Terminology_TX_NoValid_1 = None of the codes provided are in the value set {0} ({1}), and a code from this value set is required) (codes = {2})
Terminology_TX_NoValid_10 = The code provided is not in the maximum value set {0} ({1}, and a code from this value set is required) (code = {2}#{3}) Terminology_TX_NoValid_10 = The code provided is not in the maximum value set {0} ({1}), and a code from this value set is required) (code = {2}#{3})
Terminology_TX_NoValid_11 = The code provided is not in the maximum value set {0} ({1}{2} Terminology_TX_NoValid_11 = The code provided is not in the maximum value set {0} ({1}{2})
Terminology_TX_NoValid_12 = The Coding provided is not in the value set {0}, and a code is required from this value set. {1} Terminology_TX_NoValid_12 = The Coding provided is not in the value set {0}, and a code is required from this value set. {1}
Terminology_TX_NoValid_13 = The Coding provided is not in the value set {0}, and a code should come from this value set unless it has no suitable code. {1} Terminology_TX_NoValid_13 = The Coding provided is not in the value set {0}, and a code should come from this value set unless it has no suitable code. {1}
Terminology_TX_NoValid_14 = The Coding provided is not in the value set {0}, and a code is recommended to come from this value set. {1} Terminology_TX_NoValid_14 = The Coding provided is not in the value set {0}, and a code is recommended to come from this value set. {1}
Terminology_TX_NoValid_15 = The value provided ("{0}") could not be validated in the absence of a terminology server Terminology_TX_NoValid_15 = The value provided ("{0}") could not be validated in the absence of a terminology server
Terminology_TX_NoValid_16 = The value provided ("{0}") is not in the value set {1} ({2}, and a code is required from this value set){3} Terminology_TX_NoValid_16 = The value provided ("{0}") is not in the value set {1} ({2}), and a code is required from this value set){3}
Terminology_TX_NoValid_17 = The value provided ("{0}") is not in the value set {1} ({2}, and a code should come from this value set unless it has no suitable code){3} Terminology_TX_NoValid_17 = The value provided ("{0}") is not in the value set {1} ({2}), and a code should come from this value set unless it has no suitable code){3}
Terminology_TX_NoValid_18 = The value provided ("{0}") is not in the value set {1} ({2}, and a code is recommended to come from this value set){3} Terminology_TX_NoValid_18 = The value provided ("{0}") is not in the value set {1} ({2}), and a code is recommended to come from this value set){3}
Terminology_TX_NoValid_2 = None of the codes provided are in the value set {0} ({1}, and a code should come from this value set unless it has no suitable code) (codes = {2}) Terminology_TX_NoValid_2 = None of the codes provided are in the value set {0} ({1}), and a code should come from this value set unless it has no suitable code) (codes = {2})
Terminology_TX_NoValid_3 = None of the codes provided are in the value set {0} ({1}, and a code is recommended to come from this value set) (codes = {2}) Terminology_TX_NoValid_3 = None of the codes provided are in the value set {0} ({1}), and a code is recommended to come from this value set) (codes = {2})
Terminology_TX_NoValid_4 = The Coding provided is not in the value set {0}, and a code is required from this value set{1} Terminology_TX_NoValid_4 = The Coding provided is not in the value set {0}, and a code is required from this value set{1}
Terminology_TX_NoValid_5 = The Coding provided is not in the value set {0}, and a code should come from this value set unless it has no suitable code{1} Terminology_TX_NoValid_5 = The Coding provided is not in the value set {0}, and a code should come from this value set unless it has no suitable code{1}
Terminology_TX_NoValid_6 = The Coding provided is not in the value set {0}, and a code is recommended to come from this value set{1} Terminology_TX_NoValid_6 = The Coding provided is not in the value set {0}, and a code is recommended to come from this value set{1}
Terminology_TX_NoValid_7 = None of the codes provided could be validated against the maximum value set {0} ({1}), (error = {2}) Terminology_TX_NoValid_7 = None of the codes provided could be validated against the maximum value set {0} ({1}), (error = {2})
Terminology_TX_NoValid_8 = None of the codes provided are in the maximum value set {0} ({1}, and a code from this value set is required) (codes = {2}) Terminology_TX_NoValid_8 = None of the codes provided are in the maximum value set {0} ({1}), and a code from this value set is required) (codes = {2})
Terminology_TX_NoValid_9 = The code provided could not be validated against the maximum value set {0} ({1}), (error = {2}) Terminology_TX_NoValid_9 = The code provided could not be validated against the maximum value set {0} ({1}), (error = {2})
Terminology_TX_System_Invalid = Invalid System URI: {0} Terminology_TX_System_Invalid = Invalid System URI: {0}
Terminology_TX_System_NotKnown = Code System URI "{0}" is unknown so the code cannot be validated Terminology_TX_System_NotKnown = Code System URI "{0}" is unknown so the code cannot be validated

View File

@ -2827,6 +2827,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
rr.setFocus(res.getMatch()); rr.setFocus(res.getMatch());
rr.setExternal(false); rr.setExternal(false);
rr.setStack(stack.push(res.getMatch(), res.getIndex(), res.getMatch().getProperty().getDefinition(), res.getMatch().getProperty().getDefinition())); rr.setStack(stack.push(res.getMatch(), res.getIndex(), res.getMatch().getProperty().getDefinition(), res.getMatch().getProperty().getDefinition()));
rr.getStack().qualifyPath(".ofType("+stack.getElement().fhirType()+")");
return rr; return rr;
} }
} }
@ -2861,6 +2862,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
rr.setStack(stack.push(res.getEntry(), res.getIndex(), res.getEntry().getProperty().getDefinition(), rr.setStack(stack.push(res.getEntry(), res.getIndex(), res.getEntry().getProperty().getDefinition(),
res.getEntry().getProperty().getDefinition()).push(res.getMatch(), -1, res.getEntry().getProperty().getDefinition()).push(res.getMatch(), -1,
res.getMatch().getProperty().getDefinition(), res.getMatch().getProperty().getDefinition())); res.getMatch().getProperty().getDefinition(), res.getMatch().getProperty().getDefinition()));
rr.getStack().qualifyPath(".ofType("+rr.getResource().fhirType()+")");
return rr; return rr;
} }
} }
@ -2882,6 +2884,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
rr.setStack(new NodeStack(context, hostContext, validationLanguage).push(res.getEntry(), res.getIndex(), res.getEntry().getProperty().getDefinition(), rr.setStack(new NodeStack(context, hostContext, validationLanguage).push(res.getEntry(), res.getIndex(), res.getEntry().getProperty().getDefinition(),
res.getEntry().getProperty().getDefinition()).push(res.getMatch(), -1, res.getEntry().getProperty().getDefinition()).push(res.getMatch(), -1,
res.getMatch().getProperty().getDefinition(), res.getMatch().getProperty().getDefinition())); res.getMatch().getProperty().getDefinition(), res.getMatch().getProperty().getDefinition()));
rr.getStack().qualifyPath(".ofType("+rr.getResource().fhirType()+")");
return rr; return rr;
} }
} }
@ -3832,6 +3835,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
break; break;
} }
} }
stack.qualifyPath(".ofType("+resourceName+")");
if (trr == null) { if (trr == null) {
rule(errors, IssueType.INFORMATIONAL, element.line(), element.col(), stack.getLiteralPath(), false, I18nConstants.BUNDLE_BUNDLE_ENTRY_TYPE, resourceName); rule(errors, IssueType.INFORMATIONAL, element.line(), element.col(), stack.getLiteralPath(), false, I18nConstants.BUNDLE_BUNDLE_ENTRY_TYPE, resourceName);
} else if (isValidResourceType(resourceName, trr)) { } else if (isValidResourceType(resourceName, trr)) {

View File

@ -173,5 +173,10 @@ public class NodeStack {
return parent; return parent;
} }
public void qualifyPath(String qualifier) {
literalPath = literalPath + qualifier;
}
} }

View File

@ -146,35 +146,12 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
vCurr.loadIg(e.getAsString(), true); vCurr.loadIg(e.getAsString(), true);
} }
} }
if (content.has("questionnaire")) { if (content.has("supporting")) {
String filename = content.get("questionnaire").getAsString(); for (JsonElement e : content.getAsJsonArray("supporting")) {
String contents = TestingUtilities.loadTestResource("validator", filename); String filename = e.getAsString();
vCurr.getContext().cacheResource(loadResource(filename, contents));
}
if (content.has("measure")) {
String filename = content.get("measure").getAsString();
String contents = TestingUtilities.loadTestResource("validator", filename);
vCurr.getContext().cacheResource(loadResource(filename, contents));
}
if (content.has("library")) {
String filename = content.get("library").getAsString();
String contents = TestingUtilities.loadTestResource("validator", filename);
vCurr.getContext().cacheResource(loadResource(filename, contents));
}
if (content.has("codesystems")) {
for (JsonElement je : content.getAsJsonArray("codesystems")) {
String filename = je.getAsString();
String contents = TestingUtilities.loadTestResource("validator", filename); String contents = TestingUtilities.loadTestResource("validator", filename);
CodeSystem sd = (CodeSystem) loadResource(filename, contents); CanonicalResource mr = (CanonicalResource) loadResource(filename, contents);
val.getContext().cacheResource(sd); val.getContext().cacheResource(mr);
}
}
if (content.has("valuesets")) {
for (JsonElement je : content.getAsJsonArray("valuesets")) {
String filename = je.getAsString();
String contents = TestingUtilities.loadTestResource("validator", filename);
ValueSet vs = (ValueSet) loadResource(filename, contents);
val.getContext().cacheResource(vs);
} }
} }
if (content.has("profiles")) { if (content.has("profiles")) {