This commit adds comprehensive audit logging for specimen requests and sample collection activities across all roles. Changes Summary: New Features: - Added AUDIT_EVENTS table schema for tracking validation and sample collection events - Created ApiRequestsAuditController with /api/requests/(:any)/audit endpoint to retrieve audit history - Added dialog_audit.php view component for displaying audit trails in UI - Integrated audit logging into validation workflow (VAL1, VAL2, UNVAL events) Database: - Created AUDIT_EVENTS table with columns: ACCESSNUMBER, EVENT_TYPE, USERID, EVENT_AT, REASON - Supports tracking validation events and sample collection actions Controllers: - RequestsController: Now inserts audit records for all validation operations - ApiRequestsAuditController: New API controller returning validation and sample collection history Routes: - Added GET /api/requests/(:any)/audit endpoint for retrieving audit trail - Removed DELETE /api/samples/collect/(:any) endpoint (uncollect functionality) Views Refactoring: - Consolidated dashboard layouts into shared components: - layout.php (from layout_dashboard.php) - script_requests.php (from script_dashboard.php) - script_validation.php (from script_validate.php) - content_requests.php (from dashboard_table.php) - content_validation.php (from dashboard_validate.php) - Added content_validation_new.php for enhanced validation interface
75 lines
2.4 KiB
PHP
75 lines
2.4 KiB
PHP
<?php
|
|
/**
|
|
* Dashboard Role Configuration
|
|
*
|
|
* Defines role-specific settings for dashboard views to eliminate code duplication.
|
|
*
|
|
* Configuration Schema:
|
|
* - title: Dashboard title displayed in navbar
|
|
* - columns: Column visibility settings
|
|
* - lab: Show "No Lab" column (SP_ACCESSNUMBER)
|
|
* - resto: Show "ResTo" column (ODR_CRESULT_TO)
|
|
* - register: Show "No Register" column (HOSTORDERNUMBER)
|
|
* - sampleDialog: Sample dialog behavior
|
|
* - commentEditable: Allow editing the comment textarea
|
|
* - showCollectButtons: Show Collect/Un-Coll/Un-Recv buttons
|
|
* - menuItems: Navigation menu items
|
|
*/
|
|
|
|
return [
|
|
'admin' => [
|
|
'title' => 'Admin Dashboard',
|
|
'sampleDialog' => [
|
|
'commentEditable' => true,
|
|
'showCollectButtons' => true,
|
|
],
|
|
'menuItems' => [
|
|
['label' => 'Dashboard', 'href' => 'admin', 'icon' => 'chart-bar'],
|
|
['label' => 'Validate', 'href' => 'admin/validate', 'icon' => 'check-circle'],
|
|
],
|
|
],
|
|
'cs' => [
|
|
'title' => 'CS Dashboard',
|
|
'sampleDialog' => [
|
|
'commentEditable' => false,
|
|
'showCollectButtons' => false,
|
|
],
|
|
'menuItems' => [
|
|
['label' => 'Dashboard', 'href' => 'cs', 'icon' => 'chart-bar'],
|
|
],
|
|
],
|
|
'lab' => [
|
|
'title' => 'Lab Analyst Dashboard',
|
|
'sampleDialog' => [
|
|
'commentEditable' => true,
|
|
'showCollectButtons' => true,
|
|
],
|
|
'menuItems' => [
|
|
['label' => 'Dashboard', 'href' => 'lab', 'icon' => 'chart-bar'],
|
|
['label' => 'Validate', 'href' => 'lab/validate', 'icon' => 'check-circle'],
|
|
],
|
|
],
|
|
'phlebo' => [
|
|
'title' => 'Phlebotomist Dashboard',
|
|
'sampleDialog' => [
|
|
'commentEditable' => false,
|
|
'showCollectButtons' => false,
|
|
],
|
|
'menuItems' => [
|
|
['label' => 'Dashboard', 'href' => 'phlebo', 'icon' => 'chart-bar'],
|
|
],
|
|
],
|
|
'superuser' => [
|
|
'title' => 'Superuser Dashboard',
|
|
'sampleDialog' => [
|
|
'commentEditable' => true,
|
|
'showCollectButtons' => true,
|
|
],
|
|
'menuItems' => [
|
|
['label' => 'Dashboard', 'href' => 'superuser', 'icon' => 'chart-bar'],
|
|
['label' => 'Validate', 'href' => 'superuser/validate', 'icon' => 'check-circle'],
|
|
['label' => 'Users', 'href' => 'superuser/users', 'icon' => 'users'],
|
|
],
|
|
],
|
|
];
|