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

Support fully defining resources using caret rules #1530

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mint-thompson
Copy link
Collaborator

Description:

A contained resource can be defined within another resource one rule at a time using caret rules. By setting the resourceType of the contained resource, SUSHI will be able to correctly validate other rules that build up the contained resource. Most of the logic for this already existed, but some additional code was needed in order to collect information about inline resource types. Additionally, if an instance is assigned with a caret rule, further caret rules may be used to modify the contained resource. This gets a little complicated when exporting a StructureDefinition.

A ValueSet may refer to a CodeSystem that is defined with caret rules on the ValueSet. The resulting compose element will look the same as if the inline CodeSystem were defined separately.

Log a warning when an example instance is assigned within a conformance resource.

Update object definitions for inline instance tests so that the Instances are, in fact, inline.

Testing Instructions:
Please check for completeness of test cases. This change involves a lot of small variations in possible input scenarios, and while the code coverage tool reports that my new code is covered by the new tests, there may be unique combinations that merit their own tests.

The new warning message for example instances within conformance instances might need some revision. It's maybe a little too casual right now.

The changes to the exporters are similar, but not always the same. But, there may be some opportunities to pull out similar blocks into shared functions.

Additionally, I left a question in my implementation in StructureDefinitionExporter in regards to re-cleaning contained resources. Please consider whether a different strategy for re-cleaning would be necessary or useful.

An initial regression of the 100 most recently updated projects showed no changes. This isn't too surprising, as this change is mostly to allow for new things that currently do not work.

Related Issue:
Fixes #1404.

A contained resource can be defined within another resource one rule at
a time using caret rules. By setting the resourceType of the contained
resource, SUSHI will be able to correctly validate other rules that
build up the contained resource. Most of the logic for this already
existed, but some additional code was needed in order to collect
information about inline resource types. Additionally, if an instance is
assigned with a caret rule, further caret rules may be used to modify
the contained resource. This gets a little complicated when exporting a
StructureDefinition.

A ValueSet may refer to a CodeSystem that is defined with caret rules on
the ValueSet. The resulting compose element will look the same as if the
inline CodeSystem were defined separately.

Log a warning when an example instance is assigned within a conformance
resource.

Update object definitions for inline instance tests so that the
Instances are, in fact, inline.
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.

Support fully defining contained resources using caret rules
1 participant