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

## Changes

- **2024-07-09** `6318c0ca72c8` — 2 warning, 10 info
  - added the new `DV_DATE_TIME` enum value to the `time_created/_type` response property for the response status `200`
  - added the new `DV_DURATION` enum value to the `time_created/allOf[subschema #1: DV_TEMPORAL]/accuracy/_type` response property for the response status `200`
  - the `_type` response's property default value `DV_DATE_TIME` was removed for the status `200`
  - the `_type` response's property default value `DV_DURATION` was removed for the status `200`
  - …8 more
- **2024-07-09** `77021c873a72` — 8 breaking, 2 warning, 6 info
  - the response property `ehr_access/id` became optional for the status `200`
  - the response property `ehr_status/id` became optional for the status `200`
  - removed the required property `ehr_access/id/value` from the response with the `200` status
  - removed the required property `ehr_access/namespace` from the response with the `200` status
  - …12 more
- …earlier changes not shown

[Full 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/6318c0ca72c8/schema)
