# List medications

Operation ID: `patient.listMedications`

Return the authenticated patient's medications, filtered by `resource_type` (defaults to `MedicationRequest`). Requires a patient Bearer JWT.

## Public method

`listMedications`

Signature: `patient.listMedications(query)`

Return type: `Promise<ListMedicationsResponse>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`GET /patients/medications`

## Path parameters

None.

## Query parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `resource_type` | `string` | No |  | MedicationRequest, MedicationStatement | `"MedicationRequest"` | No |  |

## Body parameters

None.

Request model: None.

## Request example

None declared in canonical OpenAPI.

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`patient.ListMedicationsResponse`](../models/patient.ListMedicationsResponse.md) | application/json | The patient's medications |

## Success response examples

### 200

```json
{
  "medications": [
    {
      "authored_on": "2026-08-10",
      "brand_name": "Amoxil",
      "discontinued_reason": null,
      "dosage": {
        "duration_days": 10,
        "frequency": "once_daily",
        "frequency_details": "Every morning with food",
        "instructions": "Take one tablet by mouth each morning with food.",
        "max_daily_dose": 1,
        "max_daily_dose_unit": "tablet",
        "unit": "tablet",
        "value": 1
      },
      "encounter_id": "167dd34e-1833-4260-a8b1-ea0b38229a1b",
      "end_date": "2026-08-20",
      "fhir_id": "190e6baa-28c6-41f7-99b6-7107347478c2",
      "generic_name": "amoxicillin",
      "indication": "Acute bacterial sinusitis",
      "intent": "order",
      "medication_id": "1ce998b0-0530-470f-89bd-3f722fe9bc34",
      "name": "SDK Test Medication",
      "ndc_code": "00093-2264-01",
      "notes": "Complete the full prescribed course.",
      "pharmacy": "Example Community Pharmacy",
      "prescriber_id": "provider-example-001",
      "prescriber_name": "Dr. Alex Smith",
      "problem_reference": "condition-example-001",
      "refills_authorized": 1,
      "refills_remaining": 1,
      "resource_type": "MedicationRequest",
      "route": "oral",
      "rxnorm_code": "723",
      "start_date": "2026-08-10",
      "status": "active"
    }
  ],
  "total": 1
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `400` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | resource_type is not a valid MedicationResourceType |
| `401` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | Authorization required — missing, invalid, expired, or non-patient Bearer JWT |
| `404` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | The authenticated patient has no FHIR Patient record |

## Error examples

### 400 — Unsupported resource_type

```json
{
  "error": "'not-a-real-type' is not a valid MedicationResourceType"
}
```

### 401 — Missing or invalid access token

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

### 404 — Patient not found

```json
{
  "error": "Patient not found"
}
```

## NodeJS / TypeScript implementation

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

```ts
const query = {
  "resource_type": "MedicationRequest"
};

const result = await patient.listMedications(query);
```

## cURL

```bash
curl -X GET \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  'https://dev-api-patient.health.cloud/patients/medications?resource_type=MedicationRequest'
```

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