Before you start
- The clinic’s
patientsdata area is on, and patient-data access was accepted for your credential. Otherwise every call here answers403 DATA_AREA_OFFor403 PATIENT_DATA_CONSENT_REQUIRED. - Your key holds
patients.administrative.read, and.create,.updateor.archivefor the writes. - Every patient record you receive counts toward the 2,000 records per hour ceiling of your credential.
Search
search matches name, email, phone, patient code, internal code or ID number, the same as Brelio’s search box:
Response
status (active, inactive, discharged). Results are sorted by last name and paginated.
Read one
Create
Search first so you do not create a duplicate. OnlyfirstName is required.
201 Created
sextakesmale,femaleorother.centerIdlinks the patient to a center; it defaults to the clinic’s default center.- The same plan limits as the web apply, such as the active-patient limit.
Update
Send only the fields that change, with theversion you read as expectedVersion. null clears a field; lastName cannot be cleared.
version. A stale expectedVersion answers 409 VERSION_CONFLICT; read the patient again. See concurrency.
Archive
Archiving retires a patient: it disappears from lists and searches, andGET /v1/patients/{id} answers 404 PATIENT_NOT_FOUND, but its history is kept and it can be restored in Brelio.
Response
status and archivedAt are independent: an archived patient keeps its last status. There is no delete.
Sync patients into another system
sync_patients.py