_include parameter is not properly processing
# support
y
Copy code
curl --location 'https://api.medplum.com/fhir/R4/Patient?_id=92ea5729-298e-4610-af0e-97c7dd7a4a2b&_include=Patient%253AmanagingOrganization%253AOrganization' \
--header 'Content-Type: application/fhir+json;charset=utf-8' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer  token_was_replaced'
fails with
Copy code
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "error",
      "code": "invalid",
      "details": {
        "text": "Invalid include parameter: Patient:managingOrganization:Organization"
      }
    }
  ]
}
Copy code
curl --location 'https://api.medplum.com/fhir/R4/Patient?_id=92ea5729-298e-4610-af0e-97c7dd7a4a2b&_include=MedicationRequest%3Arequester' \
--header 'Content-Type: application/fhir+json;charset=utf-8' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token_was_replaced'
fails with 500 and Internal Server Error
r
Hi @yury.starav , thank you for the question! The main issue here seems to be the use of
managingOrganization
.
When using
_include
, you need to use search parameters of the source resource.
Looking at the
Patient
docs , the corresponding search parameter for the field
Patient.managingOrganzation
is called `organization`(https://www.medplum.com/docs/api/fhir/resources/patient#search-parameters)
y
FYI, it works well with Cerner and EPIC
157 Views