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

Patient-everything operation didn't return related devices and patients referenced by "seealso" links #2816

Open
Alan-Kuan opened this issue Sep 21, 2022 · 3 comments
Labels
Bug Bug bug bug. VSTS-Backlog On VSTS Backlog

Comments

@Alan-Kuan
Copy link
Contributor

Alan-Kuan commented Sep 21, 2022

Describe the bug
I was trying the patient-everything feature, but I encountered some unexpected behaviors.

  1. I got only the same patient in the returned bundle as I sepcified when performing GET /Patient/{{ patient.id }}/$everything. I could retrieve more resources with the provided "next" link; however, I was not sure whether this was a normal behavior.
  2. As mentioned here, devices that reference the patient and resources (except "RelatedPerson") that are directly referenced by the patient with "seealso" links will also be returned in the bundle. However, I didn't see them after I sent the request. Nonetheless, I could retrieve the devices by adding the parameter _type with the value Device to the GET request (GET /Patient/{{ patient.id }}/$everything?_type=Device).

FHIR Version?
R4

Data provider?
SQL Server

To Reproduce
These are resources in my DB:

  • Patient 1
    • reference Patient 2 with a "seealso" link
  • Patient 2
    • referenced by Patient 1
  • RelatedPerson
    • reference Patient 1
  • CarePlan
    • reference Patient 1
  • Procedure
    • reference Patient 1
  • Device
    • reference Patient 1

I sent a request with the returned "next" link (GET /Patient/{{ patient.id }}/$everything?ct={{ continuation token }}).

Expected behavior
The returned bundle contained Patient 2, the RelatedPerson, the CarePlan, the Procedure, and the Device.

Actual behavior
The returned bundle contained only the RelatedPerson, the CarePlan, and the Procedure, which were all "Patient Compartment".

AB#95696

@Alan-Kuan Alan-Kuan added the Bug Bug bug bug. label Sep 21, 2022
@brendankowitz
Copy link
Member

Hi @Alan-Kuan, with the current implementation you must complete all bundle pages to have the complete set of results. If you have a scenario that isn't working it would be ideal if you could provide a sample to repo the behavior. We have an http script (see https://github.com/microsoft/fhir-server/blob/main/docs/rest/Readme.md for setup) that walks through the current behavior: https://github.com/microsoft/fhir-server/blob/main/docs/rest/PatientEverythingLinks.http

@EXPEkesheth EXPEkesheth added Feedback-Need more info More information is needed. and removed Bug Bug bug bug. labels Sep 29, 2022
@Alan-Kuan
Copy link
Contributor Author

Hi @brendankowitz,

Sorry for the late reply. I got sick last week.

I followed the sample today, but I still encountered the issue I described.

line 592

###
# Run Patient $everything on the Patient "mum" and continue to follow the "next" link
# in the returned bundles to retrieve all the results.
# This should return:
# - The Patient "mum" resource and the HL7 organization that it references directly
# - The patient's compartment resources: the cashew allergy intolerance and the appendectomy procedure
# - The device-mum device
# Then, it should run Patient $everything on the Patient "mother", which should return:
# - The Patient "mother" resource
# - The device-mother device
GET https://{{hostname}}/Patient/{{mum.response.body.id}}/$everything
Authorization: Bearer {{bearer.response.body.access_token}}

After I sent the request, I expected the response would contain those things metioned in the comment at once. However, I only saw the Patient "mum" and the HL7 organization.

line 596

###
# Paste the "next" link below
GET <paste next link here>
Authorization: Bearer {{bearer.response.body.access_token}}

After I sent this request with the next link, I received the cashew allergy intolerance and the appendectomy procedure this time. However, I did not receive the device-mum device.

line 601

###
# Run Patient $everything, but only request Device resources.
# This should return:
# - The device-mum device
# - The device-mother device
GET https://{{hostname}}/Patient/{{mum.response.body.id}}/$everything?_type=Device
Authorization: Bearer {{bearer.response.body.access_token}}

I had to send the request with the parameter ?_type=Device explicitly to retrieve device resources.

For retrieving the Patient "mother" and device-mother device, I had to send the request with the parameter _type=Patient and _type=Device respectively and the continuation token.

My question is that whether what I saw was actually normal or unusual?

@EXPEkesheth EXPEkesheth added the Review Tag for PM/Dev Review label Mar 13, 2023
@EXPEkesheth
Copy link
Contributor

@fhibf - Is this something you were looking into already ?

@EXPEkesheth EXPEkesheth added Bug Bug bug bug. and removed Feedback-Need more info More information is needed. labels Mar 13, 2023
@EXPEkesheth EXPEkesheth added VSTS-Backlog On VSTS Backlog and removed Review Tag for PM/Dev Review labels Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug bug bug. VSTS-Backlog On VSTS Backlog
Projects
None yet
Development

No branches or pull requests

3 participants