POST
/
medical
/
v1
/
patient
/
{id}
/
consolidated
/
query

When executed, this endpoint triggers an asynchronous query to retrieve a Patient’s consolidated data in either FHIR JSON format, or a rendered PDF or HTML Medical Record Summary.

Once the data is is ready for consumption, a consolidated-data Webhook message will be sent to your configured URL - this message will contain a URL to download the data, based on the parameters used to trigger the query.

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.

Path Params

id
string
required

The ID of the Patient.

Query Params

conversionType
string
required

The format of the resulting data. Can be one of json, pdf, or html.

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 for a list of supported resources.

resources
string

A comma separated, case sensitive list of resources to be returned. If none are provided all resources will be included. Metriport will automatically hydrate the initially filtered resources with referenced ones to create bundle consistency. The list of accepted resources can be accessed here.

dateFrom
string

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.

dateTo
string

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.

Body

metadata
object

Metadata holds a record of up to 50 custom string key-value pairs. Key names can be up to 40 characters long and values up to 500 characters long. You may use this to attach whatever metadata is relevant for your business use case - for example, external IDs. This metadata will be returned in the webhook response.

{
  "metadata": {
     "youCan": "putAny",
     "stringKeyValue": "pairsHere",
  }
}

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
string
required

The ID of the request.

status
string
required

The status of the request. Can be one of processing, completed, or failed.

startedAt
string

The date and time the request was started - formatted YYYY-MM-DDTHH:MM:SSZ as per ISO 8601.

resources
string[]

Comma-separated list of resource types.

dateFrom
string

The start date (inclusive) for which to filter resources to count - formatted YYYY-MM-DD as per ISO 8601.

dateFrom
string

The end date (inclusive) for which to filter resources to count - formatted YYYY-MM-DD as per ISO 8601.

conversionType
string

The format of the resulting data. Can be one of pdf, html, or json.

{
  "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"
}

Rate Limits

See limits and throttling

Available FHIR resources

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

Other resources referenced in the bundle will be automatically added to the bundle. This could include resources like Location, Organization, Practitioner, Medication, and others.