# Record vitals for a patient

Operation ID: `vitals.recordVitals`

Submit one or more vital-sign readings for a patient; each populated field is written as its own FHIR Observation. Only temperature, weight_kg, height_cm, heart_rate, systolic+diastolic (together), and oxygen_saturation are currently read by this endpoint — systolic and diastolic must both be supplied to record a blood pressure reading; supplying only one is silently ignored. For an Athena-linked patient, supported observations are also mirrored best-effort to the Athena chart after the FHIR write; height has no proven Athena clinical-element mapping and is not exported.

## Public method

`record`

Signature: `vitals.record(patientId, request)`

Return type: `Promise<SubmitVitalsResponse>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`POST /patients/{patient_id}/vitals`

## Path parameters

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

## Query parameters

None.

## Body parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `body` | [`VitalsRecordRequest`](../models/VitalsRecordRequest.md) | No |  |  |  | Yes |  |

Request model: [`VitalsRecordRequest`](../models/VitalsRecordRequest.md)

## Request example

```json
{
  "blood_glucose": 0,
  "diastolic": 0,
  "diastolic_bp": 0,
  "encounter_id": "string",
  "heart_rate": 0,
  "height": 0,
  "height_cm": 0,
  "oxygen_saturation": 0,
  "pain_score": 0,
  "respiratory_rate": 0,
  "spo2": 0,
  "systolic": 0,
  "systolic_bp": 0,
  "temperature": 0,
  "weight": 0,
  "weight_kg": 0
}
```

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `201` | [`RecordVitalsResponse`](../models/RecordVitalsResponse.md) | application/json | Vitals recorded |

## Success response examples

### 201

```json
{
  "athena_vitals": {
    "created": 0,
    "error": "string",
    "failed_readings": [
      {
        "clinicalelementid": "string",
        "error": "string",
        "loinc": "",
        "readingtaken": "string",
        "value": "string"
      }
    ],
    "skipped": 0,
    "status": "synced"
  },
  "observations": 0,
  "patient_id": "string"
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `400` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | A supplied vital value failed validation (sanitized example) |
| `401` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | Authorization required — missing or invalid Bearer JWT |

## Error examples

### 400 — A vital value was out of the accepted range (sanitized example)

```json
{
  "error": "systolic: Input should be less than or equal to 350"
}
```

### 401 — Missing or invalid access token

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

## NodeJS / TypeScript implementation

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

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

const request = {
  "blood_glucose": 0,
  "diastolic": 0,
  "diastolic_bp": 0,
  "encounter_id": "string",
  "heart_rate": 0,
  "height": 0,
  "height_cm": 0,
  "oxygen_saturation": 0,
  "pain_score": 0,
  "respiratory_rate": 0,
  "spo2": 0,
  "systolic": 0,
  "systolic_bp": 0,
  "temperature": 0,
  "weight": 0,
  "weight_kg": 0
};

const result = await vitals.record(patientId, request);
```

## cURL

```bash
curl -X POST \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"blood_glucose":0,"diastolic":0,"diastolic_bp":0,"encounter_id":"string","heart_rate":0,"height":0,"height_cm":0,"oxygen_saturation":0,"pain_score":0,"respiratory_rate":0,"spo2":0,"systolic":0,"systolic_bp":0,"temperature":0,"weight":0,"weight_kg":0}' \
  'https://dev-api-vitals.health.cloud/patients/%3CPATIENT_ID%3E/vitals'
```

## 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.
