Get Consolidated Data Query Status
curl --request GET \
--url https://api.sandbox.metriport.com/medical/v1/patient/{patientId}/consolidated/query \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sandbox.metriport.com/medical/v1/patient/{patientId}/consolidated/query"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sandbox.metriport.com/medical/v1/patient/{patientId}/consolidated/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.metriport.com/medical/v1/patient/{patientId}/consolidated/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.metriport.com/medical/v1/patient/{patientId}/consolidated/query"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.metriport.com/medical/v1/patient/{patientId}/consolidated/query")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.metriport.com/medical/v1/patient/{patientId}/consolidated/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyimport { MetriportMedicalApi } from "@metriport/api-sdk";
const metriport = new MetriportMedicalApi(apiToken);
const status = await metriport.getConsolidatedQueryStatus(patientId);
FHIR
Get Consolidated Data Query Status
Get the status of querying for patient’s consolidated data.
GET
/
medical
/
v1
/
patient
/
{patientId}
/
consolidated
/
query
Get Consolidated Data Query Status
curl --request GET \
--url https://api.sandbox.metriport.com/medical/v1/patient/{patientId}/consolidated/query \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sandbox.metriport.com/medical/v1/patient/{patientId}/consolidated/query"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sandbox.metriport.com/medical/v1/patient/{patientId}/consolidated/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.metriport.com/medical/v1/patient/{patientId}/consolidated/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.metriport.com/medical/v1/patient/{patientId}/consolidated/query"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.metriport.com/medical/v1/patient/{patientId}/consolidated/query")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.metriport.com/medical/v1/patient/{patientId}/consolidated/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyimport { MetriportMedicalApi } from "@metriport/api-sdk";
const metriport = new MetriportMedicalApi(apiToken);
const status = await metriport.getConsolidatedQueryStatus(patientId);
This endpoint returns all the queries that are currently in progress.
To return the status of a single query, see
Get Single Consolidated Data Query Status.
To trigger a new query you can
start a consolidated query.
Path Params
The ID of the Patient.
Response
Returns the status of the last query for consolidated data performed for the given patient.import { MetriportMedicalApi } from "@metriport/api-sdk";
const metriport = new MetriportMedicalApi(apiToken);
const status = await metriport.getConsolidatedQueryStatus(patientId);
Show ConsolidatedQuery properties
Show ConsolidatedQuery properties
The ID of the request.
The status of the request. Can be one of
processing, completed, or failed.The format of the resulting data. Can be one of
pdf, html, or json.The date and time the request was started - formatted
YYYY-MM-DDTHH:MM:SSZ as per ISO 8601.Comma-separated list of resource types.
The start date (inclusive) for which to filter resources to count - formatted
YYYY-MM-DD as per
ISO 8601.The end date (inclusive) for which to filter resources to count - formatted
YYYY-MM-DD as per
ISO 8601.An optional message for the request.
{
"queries": [
{
"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"
},
{
"requestId": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
"status": "completed",
"startedAt": "2023-01-01T00:00:00Z",
"dateFrom": "2023-01-01",
"dateTo": "2023-01-31",
"resources": ["MedicationRequest"],
"conversionType": "html"
}
],
"message": "Trigger a new query by POST /patient/:id/consolidated/query; data will be sent through Webhook"
}
⌘I

