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

conformsTo generates validation errors even when used inside an "or" #1452

Closed
lmsurpre opened this issue Aug 27, 2020 · 0 comments
Closed

conformsTo generates validation errors even when used inside an "or" #1452

lmsurpre opened this issue Aug 27, 2020 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@lmsurpre
Copy link
Member

Describe the bug
for one of the PlanNet extensions we generate the following constraint:

value.as(Reference).exists() and 
value.as(Reference).resolve().conformsTo('http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/plannet-PractitionerRole') or 
value.as(Reference).resolve().conformsTo('http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/plannet-OrganizationAffiliation') or 
value.as(Reference).resolve().conformsTo('http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/plannet-Location') or 
value.as(Reference).resolve().conformsTo('http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/plannet-Organization')

For a reference of type Organization, we'll execute the conformsTo statements in order and we'll hit this on the first 3:

generateIssue(evaluationContext, IssueSeverity.ERROR, IssueType.INVALID, "Conformance check failed: profile (or base definition) '" + url + "' is not applicable to type: " + ModelSupport.getTypeName(modelClass), node.path());

To Reproduce
Run ExamplesValidationTest from #1441

Expected behavior
This should only generate an error if NONE of the or expressions are true.

Additional context
Similar, but different, from #1426

@lmsurpre lmsurpre added the bug Something isn't working label Aug 27, 2020
@lmsurpre lmsurpre added this to the Sprint 17 milestone Aug 27, 2020
@lmsurpre lmsurpre self-assigned this Aug 27, 2020
@lmsurpre lmsurpre modified the milestones: Sprint 17, Sprint 16 Aug 27, 2020
@lmsurpre lmsurpre pinned this issue Aug 31, 2020
@lmsurpre lmsurpre unpinned this issue Aug 31, 2020
lmsurpre added a commit that referenced this issue Aug 31, 2020
constraint failed

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Aug 31, 2020
constraint failed

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Aug 31, 2020
constraint failed

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Sep 1, 2020
constraint is true

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Sep 1, 2020
Previously, we added supplemental issues with a Severity of ERROR when
the conformance check failed.
However, we also return false in these cases and so it should be the
caller's responsibility to determine if that will result in an error or
not.
Instead, the detail in these supplemental issues is really just extra
information about the failed conformance check and thus these now have a
severity of "information".

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Sep 1, 2020
On the affected tests there will now be one fewer error issue and one
additional "information" issue.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
JohnTimm pushed a commit that referenced this issue Sep 1, 2020
…1466)

* issue #1452 - reduce severity of supplemental issues in conformsTo

Previously, we added supplemental issues with a Severity of ERROR when
the conformance check failed.
However, we also return false in these cases and so it should be the
caller's responsibility to determine if that will result in an error or
not.
Instead, the detail in these supplemental issues is really just extra
information about the failed conformance check and thus these now have a
severity of "information".

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>

* issue #1452 - fix test expectations

On the affected tests there will now be one fewer error issue and one
additional "information" issue.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
@prb112 prb112 closed this as completed Sep 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants