-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Referenced to contained resources are always validated, ignoring policyAdvisor #1903
Comments
After discussion with @grahamegrieve, the However, the ReferenceValidationPolicy policyForReference(
IResourceValidator validator,
Object appContext,
String path,
String url,
ReferenceType referenceType
);
public enum ReferenceType {
CONTAINED,
REMOTE,
BUNDLED
} This would allow the implementation of IValidationPolicyAdvisor to define logic depending on the type of reference being validated. |
Hi @grahamegrieve, Thanks for looking into this! That being said, I'm a little curious as to why the |
it's a lineball call, I think, but it's about least surprise. policyForContained concerns hitting a contained resource while iterating the resource directly. That's self evident policyForReference concerns what do when hitting a reference, and deciding whether it should be validated or not So when a reference points to a contained resource, which has precedence? I think that policyForReference should behave consistently irrespective of the location of the target, whether it's contained or not. What would be good is to document this explicitly, so I'll do that |
If a reference is made to a contained resource, the core validator ignores the policyAdvisor.policyForContained method, and always validates the contained resource.
The logic appears to be here:
org.hl7.fhir.core/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java
Line 4273 in 3cf2a06
A test case that illustrates this has been created here: FHIR/fhir-test-cases#216
The text was updated successfully, but these errors were encountered: