---
title: "Get EHR by subject id"
method: GET
path: "/ehr"
tags: ["EHR"]
---

# Get EHR by subject id

`GET /ehr`

Retrieve the EHR with the specified `subject_id` and `subject_namespace`.

These subject parameters will be matched against EHR's EHR_STATUS.subject.external_ref.id.value and 
EHR_STATUS.subject.external_ref.namespace values.

## Query parameters

- `subject_id` string, required
- `subject_namespace` string, required

## Headers

- `Accept` 'application/json' | 'application/xml'

## Response `200`

`200 OK` is returned when the requested EHR resource is successfully retrieved.

- Ehr — An EHR resource
  - `system_id` HierObjectId
    - `_type` string
    - `value` string, required
  - `ehr_id` HierObjectId
    - `_type` string
    - `value` string, required
  - `ehr_status` ObjectRefOfObjectVersionId
    - `namespace` string, required
    - `type` string, required
    - `id` ObjectId, required
      - `_type` string
      - `value` string, required
  - `ehr_access` ObjectRefOfObjectVersionId
    - `namespace` string, required
    - `type` string, required
    - `id` ObjectId, required
      - `_type` string
      - `value` string, required
  - `time_created` DvDateTime
    - `_type` string

## Other responses

- `404` — `404 Not Found` is returned when an EHR with supplied subject parameters does not exist.

---

[API](https://skmtc.net/openehr/apis/ehr-api.md) · [All operations](https://skmtc.net/openehr/apis/ehr-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openehr/ehr-api/versions/a0e37a217524/schema)
