mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-02-09 06:14:45 +00:00
allow code system declared proporties to be self-referential
This commit is contained in:
parent
1d913459fe
commit
a28ba7ee2e
@ -272,7 +272,7 @@ public class CodeSystemValidator extends BaseValidator {
|
||||
ukp = KnownProperty.ItemWeight;
|
||||
break;
|
||||
default:
|
||||
ok = rule(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), isBaseSpec(cs.getNamedChildValue("url")), I18nConstants.CODESYSTEM_PROPERTY_BAD_HL7_URI, uri);
|
||||
ok = rule(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), isBaseSpec(cs.getNamedChildValue("url")) || isSelfRef(cs.getNamedChildValue("url"), uri), I18nConstants.CODESYSTEM_PROPERTY_BAD_HL7_URI, uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -370,6 +370,10 @@ public class CodeSystemValidator extends BaseValidator {
|
||||
return url.startsWith("http://hl7.org/fhir/") && !url.substring(20).contains("/");
|
||||
}
|
||||
|
||||
private boolean isSelfRef(String url, String uri) {
|
||||
return (url != null) && uri.startsWith(url);
|
||||
}
|
||||
|
||||
private boolean checkConcept(List<ValidationMessage> errors, Element cs, NodeStack stack, boolean caseSensitive, String hierarchyMeaning, CodeSystem csB, Element concept, Set<String> codes, Map<String, PropertyDef> properties) {
|
||||
boolean ok = true;
|
||||
String code = concept.getNamedChildValue("code");
|
||||
|
Loading…
x
Reference in New Issue
Block a user