hl7-eu / laboratory

HL7 Europe Laboratory Report HL7 FHIR IG
Creative Commons Zero v1.0 Universal
9 stars 8 forks source link

fix rule eu-lab-1 and eu-lab-2 error #51 #52

Closed oliveregger closed 1 year ago

oliveregger commented 1 year ago

The problem is that in the java fhirpath implementation the or seems to have precedence over the in, if an additional paranthesis is added the invariant is working as expected:

original: status in ('registered'|'cancelled') or value.exists() or hasMember.exists() or component.exists() or dataAbsentReason.exists()

modified: (status in ('registered'|'cancelled')) or value.exists() or hasMember.exists() or component.exists() or dataAbsentReason.exists()

kruzikh commented 1 year ago

I updated both invariants according to the proposal from @oliveregger, however the second invariant still results in a QA error. So, I made following changes and moved second invariant one level up (to observation level):

Invariant: eu-lab-1 Description: "If observation status is other then \"registered\" or \"cancelled\", at least one of these Observation elements shall be provided: \"value\", \"dataAbsentReason\", \"hasMember\" or \"component\"" Severity: #error Expression: "(status in ('registered'|'cancelled')) or value.exists() or hasMember.exists() or component.exists() or dataAbsentReason.exists()"

Invariant: eu-lab-2 Description: "If observation has components and observation status is other then \"registered\" or \"cancelled\", at least one of these Observation.component elements shall be provided: \"value\" or \"dataAbsentReason\"" Severity: #error Expression: "component.exists() implies (status in ('registered'|'cancelled')) or component.value.exists() or component.dataAbsentReason.exists()" I propose to close this PR.