Skip to main content

Check patient name exists

MethodPath
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).

Behaviour​

  • Read-only.
  • Only the name entry with use: "nickname" is compared. Official and maiden names are ignored. Without a nickname entry the answer is exists: false.
  • A match needs the same given tokens in the same order and the same family (or no family on both sides). Tokens are trimmed and compared case-insensitively.
  • When you edit an existing resident, pass their id as excludePatientId so their own record does not count as a match.
  • The create and update routes run the same check, so a true here 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"
}'
FieldTypeMeaning
existsbooleantrue when a matching Resident ID is already used in the project.

Successful response​

201 — Result of the name existence check.

Errors​

StatusMeaning
401Bearer token is missing, invalid or expired.
403You are not a practitioner, admin or System Owner, or you lack Patient:read.
422The body fails validation.