AuDigitalHealth / ci-medicare-records

Working drafts of HL7™ FHIR® artefacts authored and maintained by the Informatics Architecture team at the Australian Digital Health Agency that represent atomic Medicare records in the My Health Record system and related applications.
Other
1 stars 1 forks source link

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

Closed RichardTON closed 2 years ago

RichardTON commented 3 years ago

Prerequisites

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.