Obtener notas clínicas del paciente
GET
/patient-chartsRecupera el expediente clínico del paciente: las notas clínicas y los registros estructurados documentados para el paciente. Solo lectura y limitado a tu organización.
Ejemplos de código
Node.js
const fetch = require('node-fetch');
async function llamarApi() {
const claveApi = 'YOUR_API_KEY';
const patientId = 'su-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 ${claveApi}`,
'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 al llamar a la API:', error);
throw error;
}
}
llamarApi();Python
import requests
def llamarApi():
claveApi = 'YOUR_API_KEY'
url = 'https://account.lunahealth.app/api/patient-charts'
headers = {
'Authorization': f'Bearer {claveApi}',
'Content-Type': 'application/json'
}
params = {
'patientId': 'su-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 al llamar a la API: {e}')
raise
llamarApi()Parámetros
| Nombre | Ubicación | Tipo | Requerido | Descripción |
|---|---|---|---|---|
patientId | query | string | Sí | ID del paciente para filtrar los resultados |
Respuestas
| Estado | Descripción |
|---|---|
200 | Respuesta exitosa |
400 | Datos de entrada no válidos |
401 | Autorización no proporcionada |
403 | Acceso insuficiente |
404 | No encontrado |
500 | Error interno del servidor |
200 — Respuesta exitosa
Campos de la respuesta
| Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|
id | string | Sí | — |
type | string | Sí | — |
status | string | Sí | — |
name | string | Sí | — |
description | string | null | Sí | — |
created_at | string | Sí | — |
updated_at | string | Sí | — |
service_datetime | string | Sí | — |
signed_at | string | null | Sí | — |
completed_date | string | null | Sí | — |
items | array<object> | Sí | — |
user | object | null | Sí | — |
signed_by | object | null | Sí | — |
created_by | object | Sí | — |
template | object | null | Sí | — |
Ejemplo de respuesta
[
{
"id": "string",
"type": "CHART",
"status": "CANCELED",
"name": "string",
"description": "string",
"created_at": "string",
"updated_at": "string",
"service_datetime": "string",
"signed_at": "string",
"completed_date": "string",
"items": [
{
"id": "string",
"type": "CHIEF_COMPLAINT",
"order": 0,
"Note": {
"id": "string",
"label": null,
"value": null
},
"NoteEditor": {
"id": "string",
"label": null,
"value": null
},
"ShortText": {
"id": "string",
"label": null,
"value": null
},
"TextBlock": {
"id": "string",
"label": null,
"content": null
},
"SignaturePad": {
"id": "string",
"label": null
},
"ChiefComplaint": {
"id": "string",
"value": null
},
"Range": {
"id": "string",
"label": null,
"value": null
},
"Dropdown": {
"id": "string",
"label": null,
"value": null
},
"Heading": {
"id": "string",
"value": null
},
"FileEntity": {
"id": "string"
},
"BodyChart": {
"id": "string",
"points": null,
"signedUrl": null,
"renderedSignedUrl": null
},
"FacialChart": {
"id": "string",
"points": null,
"signedUrl": null,
"renderedSignedUrl": null
},
"CheckBox": {
"id": "string",
"value": null
},
"Spine": {
"id": "string",
"value": null
},
"Sketch": {
"id": "string"
},
"Vital": {
"id": "string",
"CustomVitals": []
},
"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"
},
"SpeechToText": {
"id": "string",
"label": null,
"value": null,
"transcript": null,
"summary": null,
"language": null,
"duration": null,
"transcription_status": null
},
"ReviewOfSystems": {
"id": "string",
"type": "CARDIOVASCULAR",
"findings": null,
"is_normal": true
},
"PhysicalExamination": {
"id": "string",
"type": "GENERAL_APPEARANCE",
"findings": null,
"is_normal": true
},
"TreatmentPlan": {
"id": "string",
"therapeutic_indications": null,
"indicated_procedures": null,
"followup_plan": null,
"status": "ACTIVE"
},
"Prognosis": {
"id": "string",
"expected_outcome": null,
"potential_complications": null
},
"InsuranceHeader": {
"id": "string",
"report_number": null,
"claim_number": null,
"policy_number": null,
"insured_name": null
},
"AccidentDetails": {
"id": "string",
"coverage_affected": null,
"is_passenger": true,
"is_driver": true,
"vehicle_type": null,
"trauma_type": null,
"trauma_location": null,
"trauma_mechanism": null
},
"HospitalizationInfo": {
"id": "string",
"hospital_name": null,
"admission_date": null,
"discharge_date": null,
"stay_type": null,
"stay_duration_days": null
},
"ReferralInfo": {
"id": "string",
"referred_by_physician": null,
"referred_to_type": null,
"referred_to_name": null,
"recommends_transfer": null,
"discharge_type": null,
"treatment_status": null
},
"PhysicianSignatureBlock": {
"id": "string",
"physician_name": null,
"specialty": null,
"professional_license": null,
"signed_at": null
}
}
],
"user": {
"id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"type": "STAFF"
},
"signed_by": {
"id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"type": "STAFF"
},
"created_by": {
"id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"type": "STAFF"
},
"template": {
"id": "string",
"name": "string",
"description": "string",
"tags": [
"string"
],
"type": "CHART",
"created_at": "string",
"updated_at": "string"
}
}
]400 — Datos de entrada no válidos
Campos de la respuesta
| Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|
message | string | Sí | The error message |
code | string | Sí | The error code |
issues | array<object> | No | An array of issues that were responsible for the error |
Ejemplo de respuesta
{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}401 — Autorización no proporcionada
Campos de la respuesta
| Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|
message | string | Sí | The error message |
code | string | Sí | The error code |
issues | array<object> | No | An array of issues that were responsible for the error |
Ejemplo de respuesta
{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}403 — Acceso insuficiente
Campos de la respuesta
| Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|
message | string | Sí | The error message |
code | string | Sí | The error code |
issues | array<object> | No | An array of issues that were responsible for the error |
Ejemplo de respuesta
{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}404 — No encontrado
Campos de la respuesta
| Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|
message | string | Sí | The error message |
code | string | Sí | The error code |
issues | array<object> | No | An array of issues that were responsible for the error |
Ejemplo de respuesta
{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}500 — Error interno del servidor
Campos de la respuesta
| Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|
message | string | Sí | The error message |
code | string | Sí | The error code |
issues | array<object> | No | An array of issues that were responsible for the error |
Ejemplo de respuesta
{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}