Overview
This guide covers permission configuration, role assignments, audit considerations, and data management for the Patient Registration feature (PM-01).Permission Key Reference
Default Role Assignments
These assignments are seeded by the PM-01 database migration (pf_role_permissions):
Note: The org_admin role automatically receives all active permissions via the platform trigger. Custom roles can be configured in Settings > Permissions.
Managing PM Permissions
- Navigate to Settings > Permissions (requires
org_adminrole). - Select the Practice Management module from the module list.
- Assign or revoke permissions per role using the toggle interface.
- Changes take effect immediately for newly issued tokens; existing sessions refresh on next page load.
MPI Duplicate Override Audit
When a staff member overrides a duplicate warning during patient registration:- The override reason is stored in the patient’s
custom_fieldsJSONB column under the keympi_override_reason. - The
created_bycolumn records which user performed the registration. - The
created_attimestamp provides the exact time of registration.
Soft Delete vs. Permanent Delete
Patient records and child records (addresses, contacts, guarantors) use soft deletion — thedeleted_at column is set to the current timestamp, and records are hidden from standard views.
Soft delete behavior:
- Records remain in the database for audit and recovery.
- Application queries filter
deleted_at IS NULL. - RLS policies enforce this at the database level.
Module Settings
Thepm_module_settings table contains organization-specific configuration for the PM module. Currently, the settings UI is not exposed (Phase 3). Direct database edits can be made for:
To view current settings:
Database Tables
All tables have RLS enabled with
FORCE ROW LEVEL SECURITY. SECURITY DEFINER helpers (pm_has_org_access, pm_can_access_patient, pm_can_modify_patient) prevent RLS recursion.
Related Resources
- User Guide
- PM-01 Specification
- Implementation Log
- Platform Permissions:
src/platform/permissions/constants.ts