Documentation
How Cari protects patient data and meets healthcare regulatory requirements.
Technical safeguards for protecting electronic Protected Health Information (ePHI).
Cari implements technical safeguards required by the Health Insurance Portability and Accountability Act (HIPAA) for protecting electronic Protected Health Information (ePHI).
sub (subject) claim./api/clinical/audit that records creation, reads, updates, and deletions of clinical records./api/clinical-records/:id/audit./api/clinical/audit/user/:user_id./api/clinical/audit/search./api/auth/mfa/enroll. The implementation follows NIST SP 800-63B AAL2 guidelines.Data subject rights under the EU General Data Protection Regulation.
Cari implements the rights granted to data subjects under the EU General Data Protection Regulation (GDPR) through dedicated API endpoints in the Patients service.
Patients can request complete deletion of their personal data. Erasure requests are submitted and tracked through a formal workflow:
// Submit an erasure request
POST /api/patients/:id/erasure-request
Authorization: Bearer v4.public.eyJ...
Content-Type: application/json
{
"reason": "I no longer wish to use the platform",
"confirm": true
}
// List all data subject requests for a patient
GET /api/patients/:id/dsr
Authorization: Bearer v4.public.eyJ...Patients can export their complete health record in a machine-readable format:
// Export all patient data GET /api/patients/:id/export Authorization: Bearer v4.public.eyJ... // Returns structured JSON with all clinical records, // prescriptions, lab results, appointments, and demographics
Cari implements granular consent management that tracks what data a patient has consented to share and with whom. Consent can be granted, requested, approved, and revoked:
POST/api/consent/grant
Patient grants consent proactively
POST/api/consent/request
Provider requests consent from patient
POST/api/consent/:id/approve
Patient approves a consent request
POST/api/consent/:id/revoke
Patient revokes previously granted consent
GET/api/consent
Patient views all their consent records
GET/api/organizations/:org_id/consents
Organization views consents within their scope
The session recording system has its own consent layer at /api/sessions/consents to manage consent for clinical session recording and AI transcription.
Information security management controls aligned with ISO 27001.
Cari's security architecture aligns with ISO 27001 information security management controls:
Two-level enforcement at the API gateway and individual service middleware.
Cari enforces RBAC at two levels: the API gateway and individual service middleware. The gateway checks roles before proxying requests to downstream services, and services apply additional role checks via shared middleware from cari-core.
SUPER:ADMINPlatform super administrator. Full access to all resources including MPI, public health data, and user management.
APP:ADMINApplication administrator. Access to administrative functions, MPI, and public health data.
ORG:ADMINOrganization administrator. Manages their organization's settings, members, patients, and clinical data.
ORG:DOCTORDoctor within an organization. Access to clinical records, prescriptions, session recordings, and clinical tools.
ORG:STAFFNon-clinical staff. Access to scheduling, administrative functions, and non-clinical data.
BASE:DOCTORIndependent doctor not attached to an organization. Access to their own clinical workflows.
BASE:PATIENTPatients. Access to their own health records, appointments, consent management, and GDPR rights.
Services use these shared middleware functions from cari-core:
require_authenticated
Any valid PASETO token
require_doctor
BASE:DOCTOR or ORG:DOCTOR
require_patient
BASE:PATIENT or ORG:PATIENT
require_clinician
Doctors or org admins
require_org_staff
Any org-scoped staff role
require_org_admin
ORG:ADMIN, SUPER:ADMIN, or APP:ADMIN
require_admin
SUPER:ADMIN or APP:ADMIN only
The gateway applies path-based role requirements before proxying requests:
/api/mpi/*Platform admins only
SUPER:ADMIN, APP:ADMIN
/api/sessions/*Doctors only
Recording/extraction context
/api/clinical/dictation, /dicom, /prescriptionsDoctors only
Clinical tools
/api/public-health/*Admins only
MOH-level data
/api/surveillance/*Admins only
Epidemiological data
/cds-hooks/*Clinicians only
CDS hook invocation
/api/cds/drug-interactionsAdmins only
Data mutation
Encryption in transit and at rest for all patient data.
Comprehensive audit logs for clinical data access and modifications.
Cari maintains comprehensive audit logs for clinical data access and modifications. The audit system captures:
Who
Authenticated user ID from the PASETO token
What
Resource type, resource ID, and action performed
When
Timestamp of the event
Where
Service and endpoint that processed the request
Context
IP address, user agent, organization context
// Log a clinical audit event
POST /api/clinical/audit
Authorization: Bearer v4.public.eyJ...
Content-Type: application/json
{
"resource_type": "ClinicalRecord",
"resource_id": "record-uuid",
"action": "read",
"metadata": { "reason": "Patient consultation" }
}
// Get audit trail for a specific resource
GET /api/clinical/audit/resource/ClinicalRecord/{resource_id}
// Get all audit events for a user
GET /api/clinical/audit/user/{user_id}
// Search audit events
GET /api/clinical/audit/search?action=update&from=2026-04-01&to=2026-04-18Per-IP rate limits using Redis-backed sliding window counters.
Auth endpoints
/api/auth/*
300 req/min
All other endpoints
Every other API path
600 req/min
When a rate limit is exceeded, the API returns HTTP 429 (Too Many Requests). Rate limiting can be disabled for testing by setting RATE_LIMITING_ENABLED=false.
Capture and retry failed asynchronous events to prevent silent data loss.
Failed asynchronous events (e.g., user creation notifications, organization member added events) are captured in a Dead Letter Queue (DLQ) to prevent silent data loss. Administrators can review, retry, or discard failed events:
/admin/dlq
List all failed events
/admin/dlq/depth
Current DLQ depth and alert status
/admin/dlq/:id/retry
Re-queue a failed event for processing
/admin/dlq/:id
Discard a failed event
Monitor /admin/dlq/depth regularly. A growing DLQ depth may indicate a downstream service issue that needs attention.