Stream: CARIN IG for Blue Button®
Topic: Poor fhirpath in EOB-inst-careTeam constraints
Lee Surprenant (Sep 10 2020 at 18:42):
I tried upgrading our server to the latest draft of this IG and its mostly working.
One thing I noticed is that the FHIRPath expressions for the EOB-inst-careTeam-practitioner
and EOB-inst-careTeam-organization
are rather broken.
Is there an existing tracker that covers this?
Lee Surprenant (Sep 10 2020 at 21:09):
from the latest draft they are:
EOB-inst-careTeam-practitioner: ( careTeam.role.coding.code in ('attending' or 'primary' or 'referring' or 'supervising')) implies careTeam.provider.reference.resolve().is(FHIR.Practitioner)
and
EOB-inst-careTeam-organization: ( careTeam.role.coding.code='performing') implies careTeam.provider.reference.resolve().is(FHIR.Organization)
Lee Surprenant (Sep 10 2020 at 21:09):
each of these is broken in various ways
Lee Surprenant (Sep 10 2020 at 21:12):
In either case, it ignores the cardinality of the elements. For repeating fields, these simple paths return a collection and then these expressions are using those collections with operators that only work when the left-hand operand is a singleton
Lee Surprenant (Sep 10 2020 at 21:15):
Additionally, the invariants are declared on the ExplanationOfBenefit.careTeam
element. In our server at least, this is the context of the evaluation. So they should not include careTeam.
in the expressions...they should either be moved to become top-level constraints (on the ExplanationOfBenefit element) or the paths should omit the careTeam
part.
Lee Surprenant (Sep 10 2020 at 21:16):
Finally, in the case of EOB-inst-careTeam-practitioner
, the in ('attending' or 'primary' or 'referring' or 'supervising')
is not right...I think that should be a union of literals rather than logical ors
Lee Surprenant (Sep 10 2020 at 21:16):
putting those things together, I tried my hand to "fix" these and came up with the following
Lee Surprenant (Sep 10 2020 at 21:17):
- I added a lot of
.where(criteria).exists()
stuff - I moved them to be top-level
- I used union instead of or
Lee Surprenant (Sep 10 2020 at 21:18):
EOB-inst-careTeam-practitioner:
careTeam.where(role.where(coding.where(code in ('attending' | 'primary' | 'referring' | 'supervising')).exists()).exists()).exists() implies
careTeam.where(role.where(coding.where(code in ('attending' | 'primary' | 'referring' | 'supervising')).exists()).exists()).provider.all(resolve() is Practitioner)
Josh Lamb (Sep 10 2020 at 21:19):
@Amol Vyas @Saul Kravitz FYI
Lee Surprenant (Sep 10 2020 at 21:19):
EOB-inst-careTeam-organization:
careTeam.where(role.where(coding.where(code='performing').exists()).exists()).exists() implies
careTeam.where(role.where(coding.where(code='performing').exists()).exists()).provider.all(resolve() is Organization)
Saul Kravitz (Sep 10 2020 at 21:25):
THX!
Lee Surprenant (Sep 14 2020 at 15:27):
I opened FHIR#28530 to track this issue
Saul Kravitz (Sep 16 2020 at 13:40):
@Lee Surprenant Doesn't this imply the need for similar rewrites of the other EOB careteam invariants?
Lee Surprenant (Sep 16 2020 at 14:40):
Certainly possible, have a link handy?
Lee Surprenant (Sep 16 2020 at 14:42):
I hit the above constraint issue because it was preventing us from validating some of the sample data. I certainly didn't do an extensive review of all constraints in the spec.
Saul Kravitz (Sep 16 2020 at 17:05):
In https://github.com/saulakravitz/carin-bb/tree/v0.1.4/fsh, I included your suggestions for the institutional careteam practitioner/organization, and I updated the facility profiles as you suggested so the invariant is on the profile, and not on the careteam field. I've made no other changes.
Lee Surprenant (Sep 16 2020 at 17:29):
ok, is that version published somewhere? if so, i'm happy to have a look. i did have one other issue we hit that i've been meaning to write up...
Lee Surprenant (Sep 16 2020 at 17:40):
ok, i found it, starting a new thread for it
Last updated: Apr 12 2022 at 19:14 UTC