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
110 lines
4.1 KiB
Markdown
110 lines
4.1 KiB
Markdown
# CodeIgniter 4 Application Starter
|
|
|
|
## What is CodeIgniter?
|
|
|
|
CodeIgniter is a PHP full-stack web framework that is light, fast, flexible and secure.
|
|
More information can be found at the [official site](https://codeigniter.com).
|
|
|
|
This repository holds a composer-installable app starter.
|
|
It has been built from the
|
|
[development repository](https://github.com/codeigniter4/CodeIgniter4).
|
|
|
|
More information about the plans for version 4 can be found in [CodeIgniter 4](https://forum.codeigniter.com/forumdisplay.php?fid=28) on the forums.
|
|
|
|
You can read the [user guide](https://codeigniter.com/user_guide/)
|
|
corresponding to the latest version of the framework.
|
|
|
|
## Installation & updates
|
|
|
|
`composer create-project codeigniter4/appstarter` then `composer update` whenever
|
|
there is a new release of the framework.
|
|
|
|
When updating, check the release notes to see if there are any changes you might need to apply
|
|
to your `app` folder. The affected files can be copied or merged from
|
|
`vendor/codeigniter4/framework/app`.
|
|
|
|
## Setup
|
|
|
|
Copy `env` to `.env` and tailor for your app, specifically the baseURL
|
|
and any database settings.
|
|
|
|
## Role-Based Access Control
|
|
|
|
This application uses role-based access control with four user roles.
|
|
|
|
### User Roles
|
|
|
|
| Role | Level | Access |
|
|
|------|-------|--------|
|
|
| Admin | 1 | All functions |
|
|
| Lab | 2 | All functions |
|
|
| Phlebo | 3 | Specimen collection, Dashboard |
|
|
| CS | 4 | Dashboard |
|
|
|
|
### Feature Categories by Role
|
|
|
|
#### Admin
|
|
- **Dashboard** - View all requests with status filters (Pend, Coll, Recv, Inc, Fin, Val)
|
|
- **User Management** - Create, edit, delete users; assign roles
|
|
- **Request Management** - View, validate, unvalidate all requests
|
|
- **Sample Management** - Collect, receive, unreceive samples
|
|
- **Result Management** - Preview and print results
|
|
|
|
#### Lab
|
|
- **Dashboard** - View requests with status filters
|
|
- **Request Validation** - Validate/unvalidate requests (2-level validation)
|
|
- **Sample Management** - Collect samples, mark received
|
|
- **Result Preview** - Preview and print results
|
|
|
|
#### Phlebo
|
|
- **Dashboard** - View pending collections
|
|
- **Specimen Collection** - Log collected specimens
|
|
|
|
#### CS (Customer Service)
|
|
- **Dashboard** - View-only request tracking
|
|
- **Status Monitoring** - Filter by request status
|
|
- **Patient Inquiry** - View request details
|
|
|
|
### Route Prefixes
|
|
- Admin: `/admin`
|
|
- Lab: `/lab`
|
|
|
|
## Important Change with index.php
|
|
|
|
`index.php` is no longer in the root of the project! It has been moved inside the *public* folder,
|
|
for better security and separation of components.
|
|
|
|
This means that you should configure your web server to "point" to your project's *public* folder, and
|
|
not to the project root. A better practice would be to configure a virtual host to point there. A poor practice would be to point your web server to the project root and expect to enter *public/...*, as the rest of your logic and the
|
|
framework are exposed.
|
|
|
|
**Please** read the user guide for a better explanation of how CI4 works!
|
|
|
|
## Repository Management
|
|
|
|
We use GitHub issues, in our main repository, to track **BUGS** and to track approved **DEVELOPMENT** work packages.
|
|
We use our [forum](http://forum.codeigniter.com) to provide SUPPORT and to discuss
|
|
FEATURE REQUESTS.
|
|
|
|
This repository is a "distribution" one, built by our release preparation script.
|
|
Problems with it can be raised on our forum, or as issues in the main repository.
|
|
|
|
## Server Requirements
|
|
|
|
PHP version 8.1 or higher is required, with the following extensions installed:
|
|
|
|
- [intl](http://php.net/manual/en/intl.requirements.php)
|
|
- [mbstring](http://php.net/manual/en/mbstring.installation.php)
|
|
|
|
> [!WARNING]
|
|
> - The end of life date for PHP 7.4 was November 28, 2022.
|
|
> - The end of life date for PHP 8.0 was November 26, 2023.
|
|
> - If you are still using PHP 7.4 or 8.0, you should upgrade immediately.
|
|
> - The end of life date for PHP 8.1 will be December 31, 2025.
|
|
|
|
Additionally, make sure that the following extensions are enabled in your PHP:
|
|
|
|
- json (enabled by default - don't turn it off)
|
|
- [mysqlnd](http://php.net/manual/en/mysqlnd.install.php) if you plan to use MySQL
|
|
- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\CURLRequest library
|