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

FHIR Search for Provenance with Target Reference returns results matching incorrect resourceType/ID combination #5840

Open
RaymondSmileCdr opened this issue Apr 11, 2024 · 0 comments

Comments

@RaymondSmileCdr
Copy link

RaymondSmileCdr commented Apr 11, 2024

Describe the bug
All 3 of these queries return the same provenance resource.

  • The 1st example is expected.
  • The 2nd example is most egregious since it does not respect the correct resourceType part of the reference.
  • The 3rd example has been described here as an unqualified bare id, and is technically valid
/Provenance/?target=Patient/1234
/Provenance/?target=Organization/1234
/Provenance/?target=1234

To Reproduce
Steps to reproduce the behavior:

  1. Create a Patient (or any resource), note the ID
  2. Create an Organization (or any resource), note the ID
  3. Create a Provenance resource with 2 targets
    i. set 1st target to reference: Patient/[ID from Step 1]
    ii. set 2nd target to reference: Organization/[ID from Step 2]
  4. Do a parameter query for target using the 3 provided examples from the description above. Note the responses.

Sample Provenance Resource

{
    "resourceType": "Provenance",
    "target": [
        {
            "reference": "Patient/1234"
        },
        {
            "reference": "Organization/5678"
        }
    ]
}

Expected behavior

  1. A search bundle should return with 1 result containing the Patient/[ID from Step 1]
  2. No result should be returned
  3. A search bundle should return with 1 result containing the Patient/[ID from Step 1]
  4. Extra: Even combinations of incorrect resourceType/ID will return invalid response. As if the search omits the resourceType completely
    i: Example: /Provenance/?target=Patient/5678&target=Organization/1234

Actual behavior

  1. A bundle is returned (as expected)
  2. A bundle is returned (not as expected)
  3. A bundle is returned (as described in the spec)
  4. A bundle is returned (not as expected)

Environment

  • HAPI FHIR Version: 7.1.6-SNAPSHOT
  • Postman: Version 10.24.11
  • Apache Maven 3.9.0 (9b58d2bad23a66be161c4664ef21ce219c2c8584)
  • Java version: 17.0.4, vendor: Amazon.com Inc.
  • Default locale: en_CA, platform encoding: UTF-8
  • OS name: "mac os x", version: "12.0.1", arch: "x86_64", family: "mac"

Additional context
This behaviour is not an issue with resources create by PUT, only resources with autogenerated IDs.

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

1 participant