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

- **2024-07-09** `ae0a3717128c` — 6 warning, 2 info
  - added the new `DV_CODED_TEXT` enum value to the `time_created/allOf[subschema #1: DV_TEMPORAL]/accuracy/allOf[subschema #1: DV_AMOUNT]/allOf[subschema #1: DV_QUANTIFIED]/allOf[subschema #1: DV_ORDERED]/other_reference_ranges/items/meaning/_type` response property for the response status `200`
  - added the new `DV_CODED_TEXT` enum value to the `time_created/allOf[subschema #1: DV_TEMPORAL]/accuracy/allOf[subschema #1: DV_AMOUNT]/allOf[subschema #1: DV_QUANTIFIED]/allOf[subschema #1: DV_ORDERED]/other_reference_ranges/items/meaning/mappings/items/purpose/_type` response property for the response status `200`
  - added the new `DV_CODED_TEXT` enum value to the `time_created/allOf[subschema #1: DV_TEMPORAL]/allOf[subschema #1: DV_QUANTIFIED]/allOf[subschema #1: DV_ORDERED]/other_reference_ranges/items/meaning/_type` response property for the response status `200`
  - added the new `DV_CODED_TEXT` enum value to the `time_created/allOf[subschema #1: DV_TEMPORAL]/allOf[subschema #1: DV_QUANTIFIED]/allOf[subschema #1: DV_ORDERED]/other_reference_ranges/items/meaning/mappings/items/purpose/_type` response property for the response status `200`
  - …4 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/d1fa5ee68050/schema)
