AuDigitalHealth/ci-medicare-records

Incorrect FHIRPath in Consent Australian Organ Donor Register inv-dh-cons-01 and -02

Closed this issue · 0 comments

Prerequisites

  • I have verified the problem exists in the available content
  • I have searched open and closed issues to make sure it isn't already reported
  • I have written a descriptive issue title

The bug

The invariants

inv-dh-cons-01: If donation decision is 'permit', there SHALL be a specific organ (except.data.reference).

and

inv-dh-cons-02: If donation decision is 'deny', there SHALL NOT be a specific organ (except.data.reference).

fail for valid examples. In the FHIRPath expressions the antecedents are always true, so e.g. an instance with donation-decision of 'permit' and with a specific organ (except.data.reference) will fail with an error against inv-dh-cons-02.

What I expected to happen

Correct the FHIRPath expression:

  1. In inv-dh-cons-01, replace

donationDecision.valueCodeableConcept.coding.code='160654005' implies except.exists()

with

extension.where(url='http://ns.electronichealth.net.au/ci/fhir/StructureDefinition/extension-donationdecision').value.coding.where(system='http://snomed.info/sct' and code='160654005').exists()

  1. In inv-dh-cons-02, replace

donationDecision.valueCodeableConcept.coding.code='161034004' implies except.empty()

with

extension.where(url='http://ns.electronichealth.net.au/ci/fhir/StructureDefinition/extension-donationdecision').value.coding.where(system='http://snomed.info/sct' and code='161034004').exists()

Workarounds

Do not validate against the profile.