---
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
    - `namespace` string, required
    - `type` string, required
    - `id` ObjectId, required
      - `_type` string
      - `value` string, required
  - `ehr_access` ObjectRef
    - `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-17** `e344ca2dcbe6` — 2 info
  - added `#/components/schemas/DvTemporal` to the `time_created` response property `allOf` list for the response status `200`
  - removed `#/components/schemas/DataValue` from the `time_created` response property `allOf` list for the response status `200`
- **2022-11-16** `f880b1a097df` — 1 info
  - added `DV_BOOLEAN, DV_QUANTITY, DV_ORDINAL, DV_SCALE, DV_COUNT, DV_PROPORTION` discriminator mapping keys to the `time_created/allOf[subschema #1: DATA_VALUE]/` response property for the response status `200`
- **2022-11-16** `8c14d344f94c` — 2 warning, 2 info
  - removed the optional property `ehr_access/_type` from the response with the `200` status
  - removed the optional property `ehr_status/_type` from the response with the `200` status
  - removed discriminator from `ehr_access` response property for the response status `200`
  - removed discriminator from `ehr_status` response property for the response status `200`
- **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/e344ca2dcbe6/schema)
