minor validation improvements

This commit is contained in:
Grahame Grieve 2022-09-26 23:49:32 -04:00
parent 9d308db001
commit 2285da5f8d
4 changed files with 8 additions and 5 deletions

View File

@ -522,11 +522,11 @@ SEARCHPARAMETER_NOTFOUND = Unable to find the base Search Parameter {0} so can''
SEARCHPARAMETER_BASE_WRONG = The resource type {1} is not listed as a base in the SearchParameter this is derived from ({0})
SEARCHPARAMETER_TYPE_WRONG = The type {1} is different to the type {0} in the derivedFrom SearchParameter
SEARCHPARAMETER_EXP_WRONG = The expression ''{2}'' is not compatible with the expression ''{1}'' in the derivedFrom SearchParameter {0}, and this likely indicates that the derivation relationship is not valid
VALUESET_NO_SYSTEM_WARNING = No System specified, so Concepts and Filters can''t be checked
VALUESET_NO_SYSTEM_WARNING = No System specified, so Concepts and Filters can't be checked
VALUESET_INCLUDE_INVALID_CONCEPT_CODE = The code {1} is not valid in the system {0}
VALUESET_INCLUDE_INVALID_CONCEPT_CODE_VER = The code {2} is not valid in the system {0} version {1}
VALUESET_UNC_SYSTEM_WARNING = Unknown System specified, so Concepts and Filters can''t be checked
VALUESET_UNC_SYSTEM_WARNING_VER = Unknown System/Version specified, so Concepts and Filters can''t be checked
VALUESET_UNC_SYSTEM_WARNING = Unknown System specified, so Concepts and Filters can't be checked
VALUESET_UNC_SYSTEM_WARNING_VER = Unknown System/Version specified, so Concepts and Filters can't be checked
Extension_PROF_Type = The Profile ''{0}'' definition allows for the type {1} but found type {2}
TYPE_CHECKS_PATTERN_CC = The pattern [system {0}, code {1}, and display ''{2}''] defined in the profile {3} not found. Issues: {4}
TYPE_CHECKS_PATTERN_CC_US = The pattern [system {0}, code {1}, display ''{2}'' and userSelected {5}] defined in the profile {3} not found. Issues: {4}

View File

@ -731,6 +731,9 @@ public class BaseValidator implements IValidationContextResourceLoader {
protected ValueSet resolveBindingReference(DomainResource ctxt, String reference, String uri) {
if (reference != null) {
if (reference.equals("http://www.rfc-editor.org/bcp/bcp13.txt")) {
reference = "http://hl7.org/fhir/ValueSet/mimetypes";
}
if (reference.startsWith("#")) {
for (Resource c : ctxt.getContained()) {
if (c.getId().equals(reference.substring(1)) && (c instanceof ValueSet))

View File

@ -2659,7 +2659,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
} else {
Set<Character> invalidChars = new HashSet<>();
for (char ch : value.toCharArray()) {
if (!(Character.isDigit(ch) || Character.isAlphabetic(ch) || Utilities.existsInList(ch, ';', '?', ':', '@', '&', '=', '+', '$', '.', ',', '/', '%', '-', '_', '~', '#', '[', ']', '!', '\'', '(', ')', '*' ))) {
if (!(Character.isDigit(ch) || Character.isAlphabetic(ch) || Utilities.existsInList(ch, ';', '?', ':', '@', '&', '=', '+', '$', '.', ',', '/', '%', '-', '_', '~', '#', '[', ']', '!', '\'', '(', ')', '*', '|' ))) {
invalidChars.add(ch);
}
}

View File

@ -169,7 +169,7 @@ public class ValueSetValidator extends BaseValidator {
}
cf++;
}
warning(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), systemOk, version == null ? I18nConstants.VALUESET_UNC_SYSTEM_WARNING : I18nConstants.VALUESET_UNC_SYSTEM_WARNING_VER);
warning(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), systemOk, version == null ? I18nConstants.VALUESET_UNC_SYSTEM_WARNING : I18nConstants.VALUESET_UNC_SYSTEM_WARNING_VER, system);
} else {
warning(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), filters.size() == 0 && concepts.size() == 0, I18nConstants.VALUESET_NO_SYSTEM_WARNING);
}