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

Overzealous resource reference validation #512

Closed
lmsurpre opened this issue Dec 17, 2019 · 0 comments
Closed

Overzealous resource reference validation #512

lmsurpre opened this issue Dec 17, 2019 · 0 comments
Assignees
Milestone

Comments

@lmsurpre
Copy link
Member

lmsurpre commented Dec 17, 2019

Describe the bug
A "type constraint" on a Reference is one where you constrain the allowed types to which that Reference can refer. In our current implementation, these reference type constraints are not validated in our base model (#511).

However, for profiles that further constrain the allowed types of a reference, we're currently generating FHIRPath constraints that will cause validation errors unless the Reference.reference meets the following criteria:

  • is present
  • has a value that "looks like" its of the type resource; or has a value that we cannot infer a type from

I don't think this is right. While using a valued Reference.reference is certainly preferred, I don't think we want to prohibit references to identifiers or even references with just a display value.

To Reproduce
Steps to reproduce the behavior:

  1. find or create a profile that constrains Reference
  2. create a resource instance that has a Reference with an Reference.identifier but no Reference.reference

Expected behavior
Even though there is no Reference.reference, it should pass validation.

JohnTimm added a commit that referenced this issue Dec 17, 2019
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
@lmsurpre lmsurpre added this to the Sprint 5 milestone Dec 17, 2019
lmsurpre added a commit that referenced this issue Dec 17, 2019
Issue #512 - loosen reference type validation
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

No branches or pull requests

2 participants