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

Warnings for Instance rules referencing a named slice without the slice name are skipped the first time they occur for a given InstanceOf #1488

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

Comments

@mint-thompson
Copy link
Collaborator

Transferred from internal JIRA issue originally created 2024-03-26.

When exporting an Instance, rules are validated against the InstanceOf StructureDefinition. During this validation step, there is a check for paths that refer to named slices without using the slice name. This involves checking if the element at the path is a “preloaded slice,” which it is if it contains required descendants with fixed or pattern values. Elements are not unfolded during these checks. Warnings are emitted for these paths.

Later in the export process, implied values from the StructureDefinition are assigned to the Instance definition. As part of this step, elements on the StructureDefinition may be unfolded. This unfolding may add elements that are required and have fixed or pattern values. This means these elements should have been found during the validation step, creating a warning. But, since they didn’t exist, the warning was not generated.

If another Instance uses the same StructureDefinition, it will already have those unfolded elements on it during the rule validation step. So, it will correctly generate a warning for a similar-looking rule.

This pattern was observed in (https://github.com/nightingaleproject/vital_records_fhir_messaging_ig/tree/main). Specifically, consider Instances defined in examples/EX_DeathCertificateDocument.fsh. In both Instances of DeathCertificateDocument, rules are set at entry.resource, which should refer to the required slice. No warnings are emitted for the first Instance of this Profile, but warnings are emitted for the second Instance. A third Instance with a similar structure would emit similar warnings.

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