microsoft / microsoft/fhir-server

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

Open
#2,816 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug VSTS-Backlog
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.

  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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.