Poor fhirpath in EOB-inst-careTeam constraints

XMLWordPrintableJSON

    • Type: Change Request
    • Resolution: Persuasive
    • Priority: Medium

      Originally raised at https://chat.fhir.org/#narrow/stream/204607-CARIN-IG.20for.20Blue.20Button.C2.AE/topic/Poor.20fhirpath.20in.20EOB-inst-careTeam.20constraints

      The FHIRPath expressions for the EOB-inst-careTeam-practitioner and EOB-inst-careTeam-organization are broken:

      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)

      Each of these is broken in various ways.

      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.

      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.

      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 or.

      I also shared my suggested rewritten constraints on that thread.

      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)

      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)

            Assignee:
            Unassigned
            Reporter:
            lmsurprenant
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: