Fix processing of slices on choice elements#1629
Open
cmoesel wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description: When manually creating slices on choice elements (e.g.,
Observation.value[x]), SUSHI runs into a few issues:only) and then constrain another by type (also usingonly), in some cases SUSHI emits an error like this: Type constraint on Observation.value[x] makes rules in ObservationWithValueAttachment obsolete for choices: valueString.These issues were discovered and discussed on Zulip: #shorthand > Slicing and extending with a xver extension @ 💬.
This PR resolves both issues by improving handling for the special case of slices on choice elements.
Testing Instructions: The unit tests show the issue, but you may also test manually using this XVerObsValueAttachment.zip project based on the Zulip thread use case. First run the release version of SUSHI to confirm the errors are being logged. Then run this PR branch (using
ts-node) to confirm the errors go away and the resulting StructureDefinition looks correct.Related Issue: See https://chat.fhir.org/#narrow/channel/215610-shorthand/topic/Slicing.20and.20extending.20with.20a.20xver.20extension/near/604137635.