Repository navigation
Don't allow new slices on a slicing closed by a parent - #1649
Open
drlalithapranathi wants to merge 1 commit into
Open
drlalithapranathi wants to merge 1 commit into
drlalithapranathi wants to merge 1 commit into
Conversation
A child profile could use a contains rule to add a slice to a slicing its parent had closed, and SUSHI said nothing. Now that's an error and the slice isn't added. Only new slices count. Closing a slicing and adding slices in the same profile still works, so does reslicing an existing slice, and restating a slice that already exists keeps the usual duplicate handling.
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:
Fixes #471. A child profile could use a contains rule to add a new slice to a slicing its parent closed, with no error or warning. The spec only lets a derived profile add new slices "if the slices are not already closed" (https://hl7.org/fhir/R4/profiling.html#reslicing).
Now a contains rule that adds a new slice to a slicing that was already closed before the profile's own rules ran gets an error, and the slice isn't added. It checks the element's captured original, so it only looks at what was inherited.
What stays the same:
Two open questions are in my comment on the issue: whether to also cover the places SUSHI adds slices implicitly (
validateValueAtPathandsliceMatchingValueX), and whether this should be an error or a warning.Testing Instructions:
npm run check. Seven new tests in the#ContainsRuleblock of test/export/StructureDefinitionExporter.test.ts. To see it by hand:Regression: no changes detected on these 12 repos, which all use closed slicing: gematik/fhir-profiles-erp, hl7ch/ch-emed, IHE/ITI.MHD, IHE/ITI.PMIR, ahdis/ch-elm, HL7-Poland/pl-fhir-lab, TWNHIFHIR/pas, HL7/fhir-shc-vaccination-ig, openimis/openimis_fhir_r5_ig, HL7/FHIR-us-pq-cmc-fda, medizininformatik-initiative/kerndatensatz-kardiologie, HL7/davinci-epdx.
Related Issue:
Fixes #471