Patients
Check patient name exists
Check patient name exists using Ovok’s Slim API.
| Method | Path |
|---|---|
POST | /v1/slim/patient/check-name-exists |
Authentication · Access policies
Checks whether a Resident ID (the resident's nickname) is already used in your project. Use it to validate the Resident ID field before you create or rename a resident.
Auth: Bearer token. The caller must be a practitioner, an admin, a super admin, or hold the "System Owner" access policy. The access policy must grant Patient:read (admins and super admins skip this check).
Scope: Residents in the caller's project (from the token).
Request
Body
| Name | Type | Required | Description |
|---|---|---|---|
name | object[] | Yes | The names to check. At least 1 entry. Only the entry with use: "nickname" is compared. |
name[].use | "official" | "nickname" | "maiden" | Yes | Kind of name. |
name[].given | string[] | No | Given names, in order. At least 1 entry when sent. Each entry is a non-empty string. |
name[].family | string | No | Family name. Non-empty when sent. |
excludePatientId | string | No | Id of a resident to ignore, usually the resident you are editing. |
Behaviour
- Read-only.
- Only the
nameentry withuse: "nickname"is compared. Official and maiden names are ignored. Without a nickname entry the answer isexists: false. - A match needs the same
giventokens in the same order and the samefamily(or nofamilyon both sides). Tokens are trimmed and compared case-insensitively. - When you edit an existing resident, pass their id as
excludePatientIdso their own record does not count as a match. - The create and update routes run the same check, so a
truehere means those requests would be refused with a 422.
Example
curl -X POST 'https://api.sandbox.ovok.com/v1/slim/patient/check-name-exists' \
-H "Authorization: Bearer ${OVOK_TOKEN}" \
-H 'Content-Type: application/json' \
-d '{
"name": [{ "use": "nickname", "given": ["demo-resident"] }],
"excludePatientId": "3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21"
}'| Field | Type | Meaning |
|---|---|---|
exists | boolean | true when a matching Resident ID is already used in the project. |
Successful response
201 — Result of the name existence check.
{ "exists": false }| Field | Type | Description |
|---|---|---|
exists | boolean | true when another resident in the project already has this Resident ID. |
Errors
Last updated on