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 slice-specific constraints #2501

Closed
jduteau opened this issue Jun 11, 2021 · 2 comments
Closed

Support slice-specific constraints #2501

jduteau opened this issue Jun 11, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@jduteau
Copy link

jduteau commented Jun 11, 2021

I have a number of profiles where we do slicing and then we have constraints that are specific to one of the slices. It appears that the IBM validation applies all the constraints to all of the slices. If the constraint is expressed assuming the slice discriminator holds true, then this results in validation occurring when it shouldn't.

As an example, we sliced Organization.identifier based on the identifier system. We then had slice-specific validation based on the slices.

In slice A, we said that the identifier.value needed to be 9 digits
In slice B, we said that the identifier.value needed to be 5 or 7 digits.

When we ran examples against the validation, both constraints fired in both slices which raised errors.

The workaround was to include the slice discriminator in the constraint.

This resulted in the constraint changing from 'value.length() = 9' to 'system = 'X' implies value.length() = 9'. We could have also moved the constraint to identifier but we left it at the slice level for documentation purposes, i.e. it reads better if the constraint is specific to the slice.

Acceptance Criteria

  1. GIVEN a constraint attached to one slice and not the others WHEN a resource is submitted for validation that includes elements in multiple slices THEN the constraint is only validated against the slice it is attached to AND not the other slices.

NOTE: I have included a sample StructureDefinition that shows the constraint attached to the specific slice.
StructureDefinition-IdentifiedOrganization.txt

@prb112 prb112 added the enhancement New feature or request label Jun 11, 2021
@jduteau
Copy link
Author

jduteau commented Jun 17, 2021

Here is an example of an IdentifiedOrganization.
Organization-SampleIdentifiedEstablishment.txt

JohnTimm added a commit that referenced this issue Jun 17, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
@lmsurpre lmsurpre added this to the Sprint 2021-08 milestone Jun 18, 2021
JohnTimm added a commit that referenced this issue Jun 18, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Jun 18, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Jun 21, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Jun 21, 2021
* Issue #2501 - add support for slice specific constraints

Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>

* Issue #2501, #2530 - updates

Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>

* Issue #2530 - generateProfileConstraint updates

Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>

* Issue #2501, #2530 - updates

Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
@prb112 prb112 modified the milestones: Sprint 2021-08, Sprint 2021-09 Jun 29, 2021
@prb112 prb112 modified the milestones: Sprint 2021-09, Sprint 2021-10 Jul 16, 2021
@prb112
Copy link
Contributor

prb112 commented Jul 28, 2021

We've upgraded to the latest, and I confirm the build is in 4.9.0, and we support slice specific constraints.

@prb112 prb112 closed this as completed Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants