Skip to main content

Registration Service — Security Model

Status: populated Owner: TBD Last updated: 2026-04-17 Companion: Service Template · 13 security

1. RBAC/ABAC Matrix

RoleCreate PatientRead PatientUpdate DemographicsVital StatusMerge/UnmergeBreak-glass SearchPortrait WriteExtension Schema Admin
FRONT_DESK
NURSE
PHYSICIAN / DOCTOR
CLINICIAN
SUPERVISOR
ADMIN / TENANT_ADMIN
LAB_TECH / VIEWER✓ (masked)
patient (self)Own record only

ABAC additions:

  • National identifier values are masked for roles below FRONT_DESK / NURSE / CLINICIAN.
  • Extension x-privacyTier: restricted fields masked for VIEWER / LAB_TECH / portal roles.
  • Break-glass header adds audit event regardless of role.

2. Encryption Classes

DataClassificationEncryption
Demographics (names, DOB, sex)PHI Class IIAES-256-GCM at rest (PostgreSQL encrypted volume)
National ID valuesPHI Class III (sensitive)Masked in API responses; encrypted at rest
Portrait binaryPHI Class IIIAES-256-GCM at rest; optional REGISTRATION_PORTRAIT_ENCRYPTION_KEY per-blob
Extension payload (sensitive tiers)PHI Class II–IIIEncrypted at rest; masked on read by role
NATS event payloadsPHI Class IITLS in transit; minimal PII in events (IDs only)
Audit eventsPHI Class IIAppend-only; encrypted at rest in audit-service

3. Audit Events

ActionAudit codeWho triggers
Patient createdPATIENT_CREATEDRegisterPatientUseCase
Patient updatedPATIENT_UPDATEDUpdatePatientUseCase
Patient searchedPATIENT_SEARCHSearchPatientsUseCase
Vital status recorded/correctedPATIENT_VITAL_STATUS_UPDATEDRecordVitalStatusUseCase
Patient mergedPATIENT_MERGEDMergePatientUseCase
Patient unmergedPATIENT_UNMERGEDUnmergePatientUseCase
Portrait accessedPATIENT_PORTRAIT_ACCESSEDGetPortraitUseCase
CDS overrideN/A (owned by orders-service)
Break-glass searchPATIENT_SEARCH + breakGlass.reasonAudit client on search use case

All audit events include: tenantId, actorId (JWT sub), patientId, action, timestamp, detail object.

4. GDPR Participation

RightImplementation
Right to accessGET /api/v1/patients/:id returns all held data for the patient
Right to erasureLogical deletion only; physical purge handled by data governance workflow (not in-service API)
Right to rectificationPUT /api/v1/patients/:id with version lock
Data minimizationMinimum-necessary patient search enforced by criteria rules
Consent captureconsentFlags[] per patient; PATCH /vital-status consent attestation in portrait

5. Data Residency

JurisdictionPolicy
Afghanistan (MoPH)All patient data must remain in-country; no cross-border replication
UAEData residency per customer agreement
Multi-countryTenant-per-region deployment; no cross-tenant data leakage via RLS

6. Module Entitlement

All routes are guarded by ModuleEntitlementGuard checking ehr.registration license key. A missing or expired license returns 403 with a stable module error code.