Stream: fhir/infrastructure-wg
Topic: FHIR Validator bug for capability statements
Sahil Malhotra (Nov 23 2021 at 14:56):
I think there may be an issue with the invariants for capability statements which is causing the FHIR validator to give errors as mentioned below
Sahil Malhotra said:
I'm having some issues with the validator relating to capability statements. The capability statement that is returned is of kind "instance" and has both the software and implementation fields set, however despite that I see the below errors complaining about the kind field. The validator is being used in a JAVA springboot server and is loaded from import ca.uhn.fhir.validation.FhirValidator. I didn't use to have this issue before, it just started popping up and is now causing my test cases to fail. Any thoughts or advice on how to fix this?
[SingleValidationMessage[col=-1,row=-1,locationString=CapabilityStatement,message=[error] in /*:CapabilityStatement[namespace-uri()='http://hl7.org/fhir'][1] @ CapabilityStatement cpb-16: If kind = requirements, implementation and software must be absent Test=not(f:kind/@value='instance') or (not(exists(f:implementation)) and not(exists(f:software))),severity=error]
SingleValidationMessage[col=-1,row=-1,locationString=CapabilityStatement,message=[error] in /*:CapabilityStatement[namespace-uri()='http://hl7.org/fhir'][1] @ CapabilityStatement cpb-15: If kind = capability, implementation must be absent, software must be present Test=not(f:kind/@value='instance') or (not(exists(f:implementation)) and exists(f:software)),severity=error]]
Edit: I think the tests being run for the validation and need to be changes as follows
Test=not(f:kind/@value='instance') or (not(exists(f:implementation)) and not(exists(f:software))) ---> Test=(f:kind/@value='requirements') and (not(exists(f:implementation)) and not(exists(f:software)))
Test=not(f:kind/@value='instance') or (not(exists(f:implementation)) and exists(f:software)) ---> Test=(f:kind/@value='capability') and (not(exists(f:implementation)) and exists(f:software))
Last updated: Apr 12 2022 at 19:14 UTC