Skip to content

Fix slicing cardinality validation#952

Merged
cmoesel merged 4 commits intomasterfrom
fix-slicing-cardinality-validation
Nov 12, 2021
Merged

Fix slicing cardinality validation#952
cmoesel merged 4 commits intomasterfrom
fix-slicing-cardinality-validation

Conversation

@ngfreiter
Copy link
Contributor

This makes it so that if a single element is sliced, we allow it as long as it is inherited from a parent element. But if the FSH tries to apply a contains rule on a single element, we log an error.

For example, this should be an error:

Profile: V
Parent: Immunization
* vaccineCode ^slicing.discriminator.type = #pattern
* vaccineCode ^slicing.discriminator.path = "$this"
* vaccineCode ^slicing.rules = #open
* vaccineCode ^slicing.description = "Slicing example"
* vaccineCode contains slice1 0..1 and slice2 0..1

But if you test the similar situation in the https://github.com/hl7ch/ch-etoc IG on the ChEtocImmunizationSection, which inherits from the ChVacdImmunizationSection profile, it should log no error, because the slicing is introduced in a dependency, not in the FSH itself.

Copy link
Member

@cmoesel cmoesel left a comment

Choose a reason for hiding this comment

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

This works well. I only have a couple of minor suggestions regarding the error itself.

Copy link
Member

@cmoesel cmoesel 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! @mint-thompson or @julianxcarter -- can we get a second review on this by mid-afternoon-ish?

@julianxcarter julianxcarter self-assigned this Nov 12, 2021
Copy link
Contributor

@julianxcarter julianxcarter left a comment

Choose a reason for hiding this comment

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

Works well!

@cmoesel cmoesel merged commit b44cc3d into master Nov 12, 2021
@cmoesel cmoesel deleted the fix-slicing-cardinality-validation branch November 12, 2021 18:50
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.

3 participants