# Triage, Consultation Audit and Staff Activation

Added to the outpatient workflow feature branch:
- Staff creation with a random inaccessible initial password and Laravel password-reset email for password setup.
- Guest token-based password setup form; token validation is delegated to Laravel password broker.
- Triage observations stored with tenant, facility, patient and recorder scope.
- Manual triage priority labels (not clinical decision support).
- Consultation creation, updates and completion generate audit metadata inside the same transaction.
- Isolation tests for cross-tenant triage and triage role checks.

## Setup

Configure a working SMTP mailer in the Laravel environment before creating staff. Set `APP_URL` correctly for the reset links. The earlier prototype default `MAIL_MAILER=log` **does not send email to staff**; change it for delivery.

Run:
```bash
php artisan migrate
php artisan route:list
php artisan test --filter=Hms
```

## Unfinished risk controls

- Password reset and initial activation share the Laravel default password broker.
- No email verification, MFA, staff suspension, invitation expiration policy beyond broker tokens, or cross-tenant pre-existing account linking.
- Clinical notes audit records the changed field names but **not immutable note content or signed revisions**.
- Audit is application-level and does not prevent a privileged database administrator from tampering with records.
- Clinical role/privilege verification and facility-specific authorization remain unimplemented.
- No medical safety validation for triage priorities and vital-sign ranges; only input validation.
- Use synthetic data only; no real patient-care deployment.
