Searching CareTeam by participant in REST API
# support
s
Hello! I am running into a confusing scenario in the REST API that I can't seem to figure out. The CareTeam resource states clearly that searching by participant is a valid search mechanism however I'm unable to get that to work. I'm making a GET request to /fhir/R4/CareTeam/patient=some-patient-uuid to get a valid CareTeam, I then take the practitioner id of one of the participants in that result and make a GET request to /fhir/R4/CareTeam/participant=the-participant-uuid-from-the-care-team-response The result is:
Copy code
{
  "resourceType": "Bundle",
  "type": "searchset",
  "entry": [],
  "link": [
    {
      "relation": "self",
      "url": "https://api.medplum.com/fhir/R4/CareTeam?_count=20&participant=08f3066b-0602-4de8-8b32-403498f43e57"
    },
    {
      "relation": "first",
      "url": "https://api.medplum.com/fhir/R4/CareTeam?_count=20&_offset=0&participant=08f3066b-0602-4de8-8b32-403498f43e57"
    }
  ]
}
zero entries, am I missing something obvious here? Thanks!
r
Hi @stefant1707 - do you have an example
CareTeam
resource, (non-PII) that I can use to repro?
I was able to perform this search successfully https://app.medplum.com/CareTeam?participant=Practitioner/442a2596-656e-40f3-bf38-e94791d5684b
Copy code
{  
  "subject": {
    "reference": "Patient/f04fde56-88cf-4713-a11a-cbe8ee9f2242"
  },
  "encounter": {
    "reference": "Encounter/dee5f23e-22d2-4cb9-87da-f577dc5ecb24"
  },
  "participant": [
    {
      "role": [
        {
          "coding": [
            {
              "system": "http://snomed.info/sct",
              "code": "116154003",
              "display": "Patient"
            }
          ],
          "text": "Patient"
        }
      ],
      "member": {
        "reference": "Patient/f04fde56-88cf-4713-a11a-cbe8ee9f2242",
        "display": "Mr. Lucien408 Bosco882"
      }
    },
    {
      "role": [
        {
          "coding": [
            {
              "system": "http://snomed.info/sct",
              "code": "223366009",
              "display": "Healthcare professional (occupation)"
            }
          ],
          "text": "Healthcare professional (occupation)"
        }
      ],
      "member": {
        "reference": "Practitioner/442a2596-656e-40f3-bf38-e94791d5684b",
        "display": "Dr. Willena258 Oberbrunner298"
      }
    },
    {
      "role": [
        {
          "coding": [
            {
              "system": "http://snomed.info/sct",
              "code": "224891009",
              "display": "Healthcare services (qualifier value)"
            }
          ],
          "text": "Healthcare services (qualifier value)"
        }
      ],
      "member": {
        "reference": "Organization/89414e2a-fc3f-4e07-8450-00925c23da32",
        "display": "LOWELL GENERAL HOSPITAL"
      }
    }
  ]
  "resourceType": "CareTeam"
}
s
I think so, let me find one
hopefully that came through, it said the message was too long
@rahul1 can you try a query where the participant is a practitioner instead of a patient? that might be the difference here
r
Hi @stefant1707 , that was the search I ran here: >
https://app.medplum.com/CareTeam?participant=Practitioner/442a2596-656e-40f3-bf38-e94791d5684b
One thing I noticed about the search you sent was that you didn't specify the resourceType in your search by reference: >
GET {{medplum_host}}/fhir/R4/CareTeam?participant=f83cfbd2-4080-44dc-9142-dd89217dca60
should be >
GET {{medplum_host}}/fhir/R4/CareTeam?participant=Practitioner/f83cfbd2-4080-44dc-9142-dd89217dca60
You can see our docs on "Search by Reference" for more information: https://www.medplum.com/docs/search/basic-search#searching-by-reference
s
ohhhhhh that might explain it
ah yep that did it
thanks for your help!
155 Views