Audit & PHI logging
How Tenelix structures clinical, billing, and admin audit — and how to query it.
Tenelix emits structured events for every clinical, billing, and admin action. Events flow into dedicated, append-only log channels and are tenant-aware.
Channels
| Channel | Purpose |
|---|---|
phi_access | PHI access — every read of a patient record |
rbac_audit | Role, permission, and user-role changes |
billing_audit | Invoice, payment, and adjustment lifecycle |
account_security | Phone-verify, trusted-device, and account-security events |
default | Application logs |
Per-module audit channels (inventory, donor program, gamete bank, migration, referrers) record lifecycle events for their own domains.
Event shape
All audit events share a base shape:
{
"tenant_id": "uuid",
"user_id": "uuid",
"request_id": "uuid",
"action": "patient.read",
"resource_type": "Patient",
"resource_id": "uuid",
"metadata": { ... },
"timestamp": "ISO-8601"
}
Every event carries tenant_id and request_id, so nothing slips through unattributed.
Override audit
Some actions support an admin override path — for example, clearing a
patient through Awaiting Payment without taking payment. Overrides leave
typed columns (override_by_user_id, override_reason,
override_marker = "[CLEARED WITHOUT PAYMENT]") on the affected
record. The override log is immutable.