Patients
Get Patient
Reads a patient by external patient id.
GET
/
api
/
patient
/
{patientId}
cURL
curl --request GET \
--url https://forecaster.cairhealth.com/api/patient/{patientId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://forecaster.cairhealth.com/api/patient/{patientId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://forecaster.cairhealth.com/api/patient/{patientId}', 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://forecaster.cairhealth.com/api/patient/{patientId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://forecaster.cairhealth.com/api/patient/{patientId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://forecaster.cairhealth.com/api/patient/{patientId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://forecaster.cairhealth.com/api/patient/{patientId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {}
}Overview
Reads a patient record by external patient id, the same identifier used by the professional claim endpoints.Authentication
JWT Bearer token from/api/token.
Path Parameters
string
required
External patient id.
Example
curl "https://forecaster.cairhealth.com/api/patient/EXT-PAT-123" \
-H "Authorization: Bearer $ACCESS_TOKEN"
Response
Returns the FHIRPatient resource for the matching patient.
{
"success": true,
"data": {
"resourceType": "Patient",
"id": "fhir-patient-id",
"active": true,
"identifier": [
{
"system": "https://fhir.cairhealth.com/fhir/identifier/customer-patient-id",
"value": "EXT-PAT-123"
}
],
"name": [
{ "use": "usual", "family": "Doe", "given": ["Jane"] }
],
"gender": "female",
"birthDate": "1990-01-02",
"telecom": [{ "system": "email", "value": "jane@example.com" }],
"address": [
{
"line": ["1 Main St"],
"city": "Springfield",
"state": "IL",
"postalCode": "62704"
}
]
}
}
404 when no patient matches the external id.⌘I
cURL
curl --request GET \
--url https://forecaster.cairhealth.com/api/patient/{patientId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://forecaster.cairhealth.com/api/patient/{patientId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://forecaster.cairhealth.com/api/patient/{patientId}', 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://forecaster.cairhealth.com/api/patient/{patientId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://forecaster.cairhealth.com/api/patient/{patientId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://forecaster.cairhealth.com/api/patient/{patientId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://forecaster.cairhealth.com/api/patient/{patientId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {}
}
