Skip to content

Elements can be constrained with canonicals that contain versions#898

Merged
mint-thompson merged 3 commits intomasterfrom
cimpl-791-constrain-canonical-version
Aug 11, 2021
Merged

Elements can be constrained with canonicals that contain versions#898
mint-thompson merged 3 commits intomasterfrom
cimpl-791-constrain-canonical-version

Conversation

@mint-thompson
Copy link
Collaborator

Fixes #863 and completes task CIMPL-791.

The version provided with the canonical type on the type constraint is appended to the targetProfile on the element. When values are assigned to the element, the version is not checked. For example, if an element is constrained to Canonical(Patient|4.0.1), then any Patient instance can have its canonical assigned to the element, regardless of the version of the Patient profile it is an instance of.

Basically: authors are allowed to specify a version in the type constraint, and that version will appear in the FHIR resource, but the version does not affect SUSHI's type checks.

A version can be included as part of a canonical type in an OnlyRule.
This version is included in the target profiles of the type.
If an element with a canonical type is constrained with versioned types,
it is still possible to assign a value to that element as long as it
matches a target profile. The version provided in the constraint is not
checked when this value is assigned.
Copy link
Contributor

@ngfreiter ngfreiter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@julianxcarter julianxcarter self-assigned this Aug 11, 2021
@mint-thompson mint-thompson merged commit 555a143 into master Aug 11, 2021
@mint-thompson mint-thompson deleted the cimpl-791-constrain-canonical-version branch August 11, 2021 17:30
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

Successfully merging this pull request may close these issues.

Constraining Canonicals does not support canonicals w/ versions

3 participants