---
title: "Discover patient's accounts"
method: POST
path: "/v0.5/care-contexts/discover"
tags: ["discovery", "cm facing"]
---

# Discover patient's accounts

`POST /v0.5/care-contexts/discover`

Request for patient care context discover, made by CM for a specific HIP. It is expected that HIP will subsequently return either zero or one patient record with (potentially masked) associated care contexts
  1. **At least one of the verified identifier matches**
  2. **Name (fuzzy), gender matches**
  3. **If YoB was given, age band(+-2) matches**
  4. **If unverified identifiers were given, one of them matches**
  5. **If more than one patient records would be found after aforementioned steps, then patient who matches most verified and unverified identifiers would be returned.**
  6. **If there would be still more than one patients (after ranking) error would be returned**
  7. **Intended HIP should be able to resolve and identify results returned in the subsequent link confirmation request via the specified transactionId**
  8. **Intended HIP should store the discovery results with transactionId and care contexts discovered for subsequent link initiation**

## Headers

- `Authorization` string, required
- `X-HIP-ID` string, required

## Request body

- PatientDiscoveryRequest
  - `patient` object, required
    - `gender` 'M' | 'F' | 'O' | 'U', required
    - `id` string, required — Identifier of patient at consent manager
    - `name` string, required
    - `unverifiedIdentifiers` Identifier[]
      - `type` 'MOBILE' | 'MR' | 'NDHM_HEALTH_NUMBER' | 'HEALTH_ID'
      - `value` string
    - `verifiedIdentifiers` Identifier[], required
      - `type` 'MOBILE' | 'MR' | 'NDHM_HEALTH_NUMBER' | 'HEALTH_ID'
      - `value` string
    - `yearOfBirth` integer, required
  - `requestId` string, uuid, required — a nonce, unique for each HTTP request.
  - `timestamp` string, date-time, required — Date time format in UTC, includes miliseconds YYYY-MM-DDThh:mm:ss.vZ
  - `transactionId` string, uuid, required — correlation-Id for patient discovery and subsequent care context linkage

## Response `202`

Request accepted

## Other responses

- `400` — **Causes:** * Empty verified identifiers. * Format mismatch of any of attributes. | type | Format/Allowed Values| | ------- | ---------------- | | gender | M/F/O/U | | MOBILE | valid mobile number with proper country code |
- `401` — **Causes:** * Unauthorized request
- `500` — **Causes:** * Downstream system(s) is down. * Unhandled exceptions.

---

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