FHIR Chat · Poor fhirpath in EOB-inst-careTeam constraints · CARIN IG for Blue Button®

Stream: CARIN IG for Blue Button®

Topic: Poor fhirpath in EOB-inst-careTeam constraints


view this post on Zulip 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?

view this post on Zulip 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)

view this post on Zulip Lee Surprenant (Sep 10 2020 at 21:09):

each of these is broken in various ways

view this post on Zulip 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

view this post on Zulip 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.

view this post on Zulip 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

view this post on Zulip 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

view this post on Zulip Lee Surprenant (Sep 10 2020 at 21:17):

  1. I added a lot of .where(criteria).exists() stuff
  2. I moved them to be top-level
  3. I used union instead of or

view this post on Zulip 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)

view this post on Zulip Josh Lamb (Sep 10 2020 at 21:19):

@Amol Vyas @Saul Kravitz FYI

view this post on Zulip 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)

view this post on Zulip Saul Kravitz (Sep 10 2020 at 21:25):

THX!

view this post on Zulip Lee Surprenant (Sep 14 2020 at 15:27):

I opened FHIR#28530 to track this issue

view this post on Zulip 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?

view this post on Zulip Lee Surprenant (Sep 16 2020 at 14:40):

Certainly possible, have a link handy?

view this post on Zulip 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.

view this post on Zulip 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.

view this post on Zulip 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...

view this post on Zulip 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