---
title: "Response to patient's account discovery request"
method: POST
path: "/v0.5/care-contexts/on-discover"
tags: ["discovery", "cm facing"]
---

# Response to patient's account discovery request

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

Result of patient care-context discovery request at HIP end. If a matching patient found with zero or more care contexts associated, it is specified as result attribute. If the prior discovery request, resulted in errors then it is specified in the error attribute. Reasons of errors can be 
  1. **more than one definitive match for the given request** 
  2. **no verified identifer was specified**

## Headers

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

## Request body

- PatientDiscoveryResult
  - `error` Error
    - `code` 1000 | 10001
    - `message` string
  - `patient` PatientRepresentation
    - `careContexts` CareContextRepresentation[]
      - `display` string, required
      - `referenceNumber` string, required
    - `display` string, required
    - `matchedBy` IdentifierType[]
    - `referenceNumber` string, required
  - `requestId` string, uuid, required — a nonce, unique for each HTTP request
  - `resp` RequestReference, required
    - `requestId` string, uuid, required — the requestId that was passed
  - `timestamp` string, date-time, required — Date time format in UTC, includes miliseconds YYYY-MM-DDThh:mm:ss.vZ
  - `transactionId` string, uuid, required

## Response `202`

Request accepted

## Other responses

- `400` — **Causes:** * Format mismatch of any of attributes.
- `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)
