# Get a patient's consolidated health record

Operation ID: `ehr.getHealthRecord`

Return a consolidated view of a patient's clinical record — conditions, allergies, medications, procedures, immunizations, family history, and directives from the EHR service, plus encounters, vitals, questionnaire responses, and diagnostics fetched from their respective services. Aggregation is best-effort per resource type: if one downstream fetch fails, that resource type comes back as an empty list rather than failing the whole request — the response is not proof that a resource type genuinely has zero records.

## Public method

`getHealthRecord`

Signature: `ehr.getHealthRecord(patientId)`

Return type: `Promise<GetHealthRecordResponse>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`GET /patients/{patient_id}/record`

## Path parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `patient_id` | `string` | Yes |  |  |  | No |  |

## Query parameters

None.

## Body parameters

None.

Request model: None.

## Request example

None declared in canonical OpenAPI.

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`GetHealthRecordResponse`](../models/GetHealthRecordResponse.md) | application/json | Consolidated patient health record |

## Success response examples

### 200

```json
{
  "patient_id": "patient-example-001",
  "resources": {},
  "totals": {}
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `401` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | Authorization required — missing or invalid Bearer JWT |
| `500` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | Internal server error |

## Error examples

### 401 — Missing or invalid access token

```json
{
  "error": "Authorization required"
}
```

### 500 — Unexpected service failure (sanitized example)

```json
{
  "error": "Internal server error"
}
```

## NodeJS / TypeScript implementation

```ts
import { HCSDK } from "@healthcloudai/hc-sdk";
```

```ts
const patientId = "<PATIENT_ID>";

const result = await ehr.getHealthRecord(patientId);
```

## cURL

```bash
curl -X GET \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  'https://dev-api-ehr.health.cloud/patients/%3CPATIENT_ID%3E/record'
```

## Notes

None.

## Prepared Test Console scenario

No canonical scenario is currently associated.

## Real response

No approved real integration response is currently published. Unapproved candidates are never rendered as examples.
