Get patient charts data
GET
/patient-chartsRetrieves a patient's clinical chart — the structured clinical notes and record entries documented for the patient. Each item's type says which of its content fields is filled; the others are null. Image links on body and facial charts are temporary and expire one hour after the response. Scoped to your organization.
Code samples
Node.js
const fetch = require('node-fetch');
async function callApi() {
const apiKey = 'YOUR_API_KEY';
const patientId = 'your-patientId';
const queryString = new URLSearchParams({
patientId: patientId
}).toString();
const url = `https://account.lunahealth.app/api/patient-charts` + (queryString ? `?${queryString}` : '');
try {
const response = await fetch(url, {
method: 'GET',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
}
});
if (!response.ok) {
throw new Error(`API error: ${response.status}`);
}
const data = await response.json();
console.log(data);
return data;
} catch (error) {
console.error('Error calling API:', error);
throw error;
}
}
callApi();Python
import requests
def call_api():
api_key = 'YOUR_API_KEY'
url = 'https://account.lunahealth.app/api/patient-charts'
headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
}
params = {
'patientId': 'your-patientId'
}
try:
response = requests.get(
url,
headers=headers,
params=params
)
response.raise_for_status()
data = response.json()
print(data)
return data
except requests.exceptions.RequestException as e:
print(f'Error calling API: {e}')
raise
call_api()Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
patientId | query | string | Yes | — |
Responses
| Status | Description |
|---|---|
200 | Successful response |
400 | Invalid input data |
401 | Authorization not provided |
403 | Insufficient access |
404 | Not found |
500 | Internal server error |
200 — Successful response
Response fields
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | — |
status | string | Yes | — |
name | string | Yes | — |
description | stringnull | Yes | — |
created_at | string | Yes | — |
updated_at | string | Yes | — |
service_datetime | string | Yes | — |
signed_at | stringnull | Yes | — |
completed_date | stringnull | Yes | — |
type | string | Yes | — |
items | array<object> | Yes | — |
patient | object | null | Yes | — |
signed_by | object | null | Yes | — |
created_by | object | Yes | — |
template | object | null | Yes | — |
Example response
[
{
"id": "string",
"status": "CANCELED",
"name": "string",
"description": null,
"created_at": "string",
"updated_at": "string",
"service_datetime": "string",
"signed_at": null,
"completed_date": null,
"type": "string",
"items": [
{
"id": "string",
"type": "CHIEF_COMPLAINT",
"order": 0,
"note": {
"id": "string",
"label": null,
"value": null
},
"note_editor": {
"id": "string",
"label": null,
"value": null
},
"short_text": {
"id": "string",
"label": null,
"value": null
},
"text_block": {
"id": "string",
"label": null,
"content": null
},
"signature_pad": {
"id": "string",
"label": null
},
"chief_complaint": {
"id": "string",
"value": null
},
"range": {
"id": "string",
"label": null,
"value": null
},
"dropdown": {
"id": "string",
"label": null,
"value": null
},
"heading": {
"id": "string",
"value": null
},
"file": {
"id": "string"
},
"body_chart": {
"id": "string",
"points": null,
"image_url": null,
"annotated_image_url": null
},
"facial_chart": {
"id": "string",
"points": null,
"image_url": null,
"annotated_image_url": null
},
"checkboxes": {
"id": "string",
"value": null
},
"spine": {
"id": "string",
"value": null
},
"sketch": {
"id": "string"
},
"vitals": {
"id": "string",
"measurements": []
},
"allergy": {
"id": "string",
"name": "string",
"status": "string",
"reaction": null
},
"history": {
"id": "string",
"type": "string",
"condition": "string"
},
"problem": {
"id": "string",
"title": "string",
"status": "string"
},
"procedure": {
"id": "string",
"procedure_code": "string",
"title": "string",
"description": null,
"date_performed": "string",
"status": "string"
},
"speech_to_text": {
"id": "string",
"label": null,
"value": null,
"transcript": null,
"summary": null,
"language": null,
"duration": null,
"transcription_status": null
},
"review_of_systems": {
"id": "string",
"type": "CARDIOVASCULAR",
"findings": null,
"is_normal": true
},
"physical_examination": {
"id": "string",
"type": "GENERAL_APPEARANCE",
"findings": null,
"is_normal": true
},
"treatment_plan": {
"id": "string",
"therapeutic_indications": null,
"indicated_procedures": null,
"followup_plan": null,
"status": "ACTIVE"
},
"prognosis": {
"id": "string",
"expected_outcome": null,
"potential_complications": null
},
"insurance_header": {
"id": "string",
"report_number": null,
"claim_number": null,
"policy_number": null,
"insured_name": null
},
"accident_details": {
"id": "string",
"coverage_affected": null,
"is_passenger": true,
"is_driver": true,
"vehicle_type": null,
"trauma_type": null,
"trauma_location": null,
"trauma_mechanism": null
},
"hospitalization_info": {
"id": "string",
"hospital_name": null,
"admission_date": null,
"discharge_date": null,
"stay_type": null,
"stay_duration_days": null
},
"referral_info": {
"id": "string",
"referred_by_physician": null,
"referred_to_type": null,
"referred_to_name": null,
"recommends_transfer": null,
"discharge_type": null,
"treatment_status": null
},
"physician_signature_block": {
"id": "string",
"physician_name": null,
"specialty": null,
"professional_license": null,
"signed_at": null
}
}
],
"patient": {
"id": "string",
"first_name": null,
"last_name": null,
"email": null
},
"signed_by": {
"id": "string",
"first_name": null,
"last_name": null,
"email": null
},
"created_by": {
"id": "string",
"first_name": null,
"last_name": null,
"email": null
},
"template": {
"id": "string",
"name": "string",
"description": null,
"tags": [
"string"
],
"type": "CHART",
"created_at": "string",
"updated_at": "string"
}
}
]400 — Invalid input data
Response fields
| Name | Type | Required | Description |
|---|---|---|---|
message | string | Yes | The error message |
code | string | Yes | The error code |
issues | array<object> | No | An array of issues that were responsible for the error |
Example response
{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}401 — Authorization not provided
Response fields
| Name | Type | Required | Description |
|---|---|---|---|
message | string | Yes | The error message |
code | string | Yes | The error code |
issues | array<object> | No | An array of issues that were responsible for the error |
Example response
{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}403 — Insufficient access
Response fields
| Name | Type | Required | Description |
|---|---|---|---|
message | string | Yes | The error message |
code | string | Yes | The error code |
issues | array<object> | No | An array of issues that were responsible for the error |
Example response
{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}404 — Not found
Response fields
| Name | Type | Required | Description |
|---|---|---|---|
message | string | Yes | The error message |
code | string | Yes | The error code |
issues | array<object> | No | An array of issues that were responsible for the error |
Example response
{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}500 — Internal server error
Response fields
| Name | Type | Required | Description |
|---|---|---|---|
message | string | Yes | The error message |
code | string | Yes | The error code |
issues | array<object> | No | An array of issues that were responsible for the error |
Example response
{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}