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

## 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` ObjectRef
    - `_type` string
    - `namespace` string, required
    - `type` string, required
    - `id` ObjectId, required
      - `_type` string
      - `value` string, required
  - `ehr_access` ObjectRef
    - `_type` string
    - `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.

## Changes

- **2022-11-16** `0db68c21be77` — 2 breaking, 9 info
  - the `ehr_id/value` response's property type/format changed from `string`/`uuid` to `string`/`` for status `200`
  - the `system_id/value` response's property type/format changed from `string`/`uuid` to `string`/`` for status `200`
  - added the optional property `ehr_access/id/_type` to the response with the `200` status
  - added the optional property `ehr_id/allOf[subschema #1: UID_BASED_ID]/_type` to the response with the `200` status
  - …7 more

[Change history](https://skmtc.dev/openehr/apis/ehr-api/changes/ehr/get.md)

---

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