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

Better error messages for bad conditional references #2556

Closed
lmsurpre opened this issue Jun 25, 2021 · 1 comment
Closed

Better error messages for bad conditional references #2556

lmsurpre opened this issue Jun 25, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@lmsurpre
Copy link
Member

Is your feature request related to a problem? Please describe.
Resolving conditional references as part of transaction bundle processing was implemented under #1329

When the conditional reference cannot be resolved (no matches) or resolves to multiple target resources, the server will now reject the create/update.

However, the error message is a fairly generic "conditional reference could not be resolved" or "conditional reference resolves to more than one resource" (or something like that).

Instead, it would be nice if we could include the path to the offending conditional reference (and/or the conditional reference’s value itself).

Describe the solution you'd like
At minimum: An expression in the OperationOutcomeIssue that specifies the path to the offending conditional reference

Bonus: the url of the conditional reference that failed in the detail message

Describe alternatives you've considered

Acceptance Criteria

  1. GIVEN a transaction bundle with a condition reference
    AND the conditional reference is bogus
    WHEN the bundle is posted
    THEN an operation outcome is returned
    AND it contains an issue that includes a path to the bogus conditional reference

  2. GIVEN a transaction bundle with a condition reference
    AND the conditional reference resolves to multiple resources
    WHEN the bundle is posted
    THEN an operation outcome is returned
    AND it contains an issue that includes a path to the bogus conditional reference

Additional context

@prb112 prb112 added the enhancement New feature or request label Jun 25, 2021
@lmsurpre lmsurpre self-assigned this Sep 15, 2021
lmsurpre added a commit that referenced this issue Sep 15, 2021
…details

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Sep 15, 2021
details

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Sep 15, 2021
details

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Sep 16, 2021
issue #2556 - add the conditional reference that failed to the error details
lmsurpre added a commit that referenced this issue Sep 17, 2021
I thought about also adding the Bundle.entry[] prefix to the issues
being returned, but for now I think this is a simple/safe step in the
right direction.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Sep 17, 2021
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Sep 17, 2021
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Sep 17, 2021
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Sep 17, 2021
issue #2556 - add the entry index to the error message
@kmbarton423
Copy link
Contributor

Confirmed issues created for conditional references in a transaction bundle for the following cases:

  • reference does not resolve
  • reference resolves to multiple
  • reference search is invalid

in all cases the resulting issue contains an expression indicating the location (Bundle.entry[x])
confirmed varied location of failure within the bundle were represented accurately

example:
{ "resourceType": "OperationOutcome", "id": "ac-11-0-2-1aafb23b-2ef4-4798-bb94-8fc5fe053f66", "issue": [ { "severity": "fatal", "code": "not-found", "details": { "text": "Error resolving conditional reference: search 'Patient?_id=PatientBogus' returned no results" }, "expression": [ "Bundle.entry[0]" ] } ] }

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

3 participants