Skip to content

Latest commit

 

History

History
179 lines (146 loc) · 8.15 KB

consolidated-data-query-post.mdx

File metadata and controls

179 lines (146 loc) · 8.15 KB
title description api
Start Consolidated Data Query
Trigger a consolidated data query for the given patient
POST /medical/v1/patient/{id}/consolidated/query

When executed, this endpoint triggers an asynchronous query to retrieve a Patient's consolidated data from the FHIR repository.

Once the data is consolidated and ready for consumption, webhook requests will be sent to your configured URL containing the Patient's data in FHIR-compliant format, based on the parameters used to trigger the query.

Webhook message type - see the respective section on the webhooks page for more details:

  • medical.consolidated-data: contains the patient's data in FHIR format.

You'll be able to query multiple times for the same Patient which will be added to the queue and processed in order. If the parameters are the same as a previous query that is still processing, the new query will be ignored and you'll get the status and request ID of the previous one.

You can check the status of the data query by calling get consolidated data query.

This endpoint also provides the ability to render a Medical Record Summary from the FHIR bundle as a PDF or HTML document. This will be returned via a webhook as a FHIR bundle with a DocumentReference resource that will contain a URL to retrieve the data from.

Path Params

The ID of the Patient.

Query Params

You can optionally filter resources by date, using the `dateFrom` and `dateTo` query params. Note that not all resources will support this filter - see the [FHIR R4 docs](https://www.hl7.org/fhir/R4/searchparameter-registry.html#clinical-date) for a list of supported resources. Some general resources, like `Practitioner` do not belong to a specific patient - when you query for these, all resources of that type will be returned. A comma separated, case sensitive list of resources to be returned. If none are provided all resources will be included. The start date (inclusive) for which to filter returned resources - formatted `YYYY-MM-DD` as per ISO 8601. If not provided, no start date filter will be applied. The end date (inclusive) for which to filter returned resources - formatted `YYYY-MM-DD` as per ISO 8601. If not provided, no end date filter will be applied. The format of the resulting data. Can be one of `pdf`, `html`, or `json`.

If provided, the Webhook will contain a URL to the file of chosen type. The URL is active for 3 minutes.

Otherwise, the data will be returned in JSON format in the Webhook payload (default).

Providing pdf or html results in a Medical Record Summary being sent.

You can scroll to the bottom of the page to view all [available resources](/medical-api/api-reference/fhir/get-patient-consolidated#available-fhir-resources).

Body

Response

Returns the filters used for this query, in addition to the identifier used by the system to uniquely identify this query (property requestId).

{
  "requestId": "5f4b3b4b-4b3b-4b3b-4b3b-4b3b4b3b4b3b",
  "status": "processing",
  "startedAt": "2021-01-01T00:00:00Z",
  "dateFrom": "2021-01-01",
  "dateTo": "2021-01-31",
  "resources": ["Observation", "MedicationRequest"],
  "conversionType": "pdf"
}

Available FHIR resources

This is the list of all available FHIR resources you can query for: