Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid emitting warning when unfolding multiple-profile element when setting implied properties on an Instance #1504

Open
mint-thompson opened this issue Aug 28, 2024 · 0 comments

Comments

@mint-thompson
Copy link
Collaborator

When a profile has an element, and that element itself has several allowed profiles, a warning is emitted when that element is unfolded. However, this may not necessarily be a useful warning to emit. Consider this example FSH, taken from the Zulip conversation linked at the end of this issue:

Alias: $au-core-patient = http://hl7.org.au/fhir/core/StructureDefinition/au-core-patient
Alias: $au-ihi = http://hl7.org.au/fhir/StructureDefinition/au-ihi
Profile: XYZPatient
Parent: $au-core-patient
Id: xyz-patient
Title: "XYZ Patient"
Description: "XYZ Patient Profile"
* ^abstract = false
* ^status = #draft
* ^date = "2024-08-24T10:00:00+10:00"
* id MS
* identifier[ihi] only $au-ihi


Instance: XYZPatientPatientDonaldDuck
InstanceOf: XYZPatient
Title: "XYZPatient Patient"
Description: "Example of a patient used for placing a diagnostic requests"

* identifier[ihi].type.coding[+] = $v2-0203#NI
* identifier[ihi].type.coding[=].system = "http://terminology.hl7.org/CodeSystem/v2-0203"
* identifier[ihi].type.coding[=].code = #NI
* identifier[ihi].type.text = "IHI Number"
* identifier[ihi].system = "http://ns.electronichealth.net.au/id/hi/ihi/1.0"
* identifier[ihi].value = "8003608833357361"

The identifier element has several profiles on it based on the definition of the au-core-patient profile. The identifier element is also required: it has a minimum of 1, so when creating the XYZPatientPatientDonaldDuck Instance, it is checked for fixed values. This element is unfolded to check for child elements that have fixed values. When unfolding it, the warning is emitted. However, there's nothing the author can do here to avoid getting that warning. So, when unfolding it to check for fixed values, it might be best to not emit the warning at all.

There are variations on this scenario which are also important to consider. For example, if identifier has a minimum of 0, it would still be checked for fixed values (and unfolded) in this example, because there are rules on the Instance that create an identifier. If the rule is on identifier[ihi] or some other defined slice, should the warning be avoided? If the rule is on identifier and does not refer to a defined slice, should the warning be avoided?

See also original Zulip conversation: https://chat.fhir.org/#narrow/stream/215610-shorthand/topic/Base.20element.20type.20will.20be.20used.20instead.20of.20any.20profiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant