Stream: tooling
Topic: FHIR Validator bug for capability statements
Sahil Malhotra (Nov 22 2021 at 19:58):
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))
Grahame Grieve (Nov 22 2021 at 21:26):
why this suddenly started happening is something that we can't help you with. It looks like it should happen from the POV of the validator. If the invariants are wrong, that's a subject to take up on #fhir/infrastructure-wg (I think)
Sahil Malhotra (Nov 23 2021 at 14:55):
I'll try forwarding this post in #fhir/infrastructure-wg then to see if anyone there can help me out
Last updated: Apr 12 2022 at 19:14 UTC