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 use of contained resources in Explanation of Benefit Medicare #3

Closed RichardTON closed 2 years ago

RichardTON commented 3 years ago

Prerequisites

The bug

In Explanation of Benefit Medicare the elements referral and prescription are required to refer to contained resources.

This assertion was made due to a misunderstanding of contained resources and prevents using this resource as intended.

The most serious problem is that it is impossible to validly include a prescription in Explanation of Benefit Medicare. This is because the element prescription is a contained reference to Medication Request Pharmaceutical Benefits Scheme; it has a required element, medicationReference, which is also a contained reference, and contained resources cannot be nested.

What I expected to happen

Redesign with business owners a solution with less or no containment. Relax requirements for containment.

Workarounds

Do not validate against the profile.

dtr-agency commented 2 years ago

The solution is to remove the aggregation rule from Medication Request Pharmaceutical Benefits Scheme - Medication and MedicationRequest can be contained in the ExplanationOfBenefit resource.

Need to check however if the contained is forcing Medication to be contained in MedicationRequest or if a contained resource reference is sufficient where both resources MedicationRequest and Medication are contained in ExplanationOfBenefit.

dtr-agency commented 2 years ago

This is not an error, the behaviour is as desired, references are to contained resources - it does not force nested contains.