microsoft / microsoft/fhir-server
Patient-everything operation didn't return related devices and patients referenced by "seealso" links
Nobody has claimed this yet.
- Dominant language
- TSQL
- Stars
- 1.4k
- Forks
- 592
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 41
Description
Describe the bug
I was trying the patient-everything feature, but I encountered some unexpected behaviors.
- 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. - 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
_typewith the valueDeviceto 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the R4 GET /Patient/{id}/$everything request and following its returned next link, then compare it with the _type=Device request. The issue expects Patient 2, RelatedPerson, CarePlan, Procedure, and Device in the bundle; no source files or tests are identified, so locate the Patient $everything operation and its continuation handling first.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100