Stream: conformance
Topic: missing data and invariants in profiles
Julian Sass (Apr 15 2021 at 12:28):
When validating some resources against the vital signs profiles in the core spec, the additional constraint on effective[x]
is raising a question for me, e.g. on http://hl7.org/fhir/StructureDefinition/bodyweight. I was expecting to be allowed to use the dataAbsentReason
extension on effectiveDateTime
in case the time is unknown, but the validator throws an error due to vs-1: if Observation.effective[x] is dateTime and has a value then that value shall be precise to the day
. I can see that with ($this as dateTime).toString().length() >= 8"
the extension is treated as dateTime which returns an empty result which is then evaluated and raises the error. Now from a conformance perspective, is the profile's intent here to make the actual value of type dateTime mandatory? Because my understanding of the invariant's human-readable description is less strict and would allow the use of extensions.
Lloyd McKenzie (Apr 15 2021 at 20:42):
The way the invariant is written, it doesn't allow for extensions. This is addressed in R5, but I'm afraid it's broken in R4.
Julian Sass (Apr 16 2021 at 07:03):
Thanks for the clarification
Julian Sass (Apr 16 2021 at 09:51):
@Cornelius Erbelding fyi
Alexander Zautke (Apr 29 2021 at 13:37):
Looking at J#29654 and the proposed solution here: https://chat.fhir.org/#narrow/stream/179309-inferno/topic/Single.20Patient.20API.20Observation.20Tests
Wouldn't it be necessary to add a hasValue check to the existence check for Observation.effectiveDateTime? Like "Observation.effectiveDateTime.hasValue() implies Observation.effectiveDateTime.toString().length() >= 8"?
Lloyd McKenzie (Apr 29 2021 at 14:37):
Yes. Can you post a comment to the issue?
Julian Sass (Apr 29 2021 at 14:39):
I put ($this.exists() is dateTime) implies ($this.exists().toString().length() >=8)
on effectiveDateTime and it seems to work. Never knew about the other solution :)
Lloyd McKenzie (Apr 29 2021 at 14:41):
exists would return a boolean and should never be dateTime. And exists().toString() ought to be 'true' or 'false' and thus never >= 8...
Julian Sass (Apr 29 2021 at 14:46):
Arg right, it doesn't check the date properly.
Andrea Essenwanger (Apr 29 2021 at 15:00):
ok.. how does implies
work exactly? I mean if I have (expression1) implies (expression2)
and expression1
is false, does implies
mean that expression2
won't have to be proven? Or does FHIRPath still look into expression2
anyways?
Alexander Zautke (Apr 29 2021 at 15:09):
See http://hl7.org/fhirpath/#implies
Last updated: Apr 12 2022 at 19:14 UTC