13 Commits

Author SHA1 Message Date
cfb81201a2 feat: Implement configurable printer system and enhance UAT workflow
Add comprehensive printer configuration support:
- New Printers.php config with role-based printer defaults (lab, phlebo, reception)
- Update LabelController for configurable printer routing with error handling
- Add ResponseTrait for proper JSON responses (success/error status)
- Update routes to accept optional printer parameter for label printing
- Add default printer configuration per role in shared config

Enhance report generation workflow:
- Support REPORT_LANG from CM_REQUESTS table for language preference
- Prioritize URL parameter, then database value, then default
- Add language info to PDF generation response (Indonesian/English)
- Update all report methods (view, eng, preview, generate) with unified logic

Improve UI and user experience:
- Add dialog_results_generate to all role dashboards (superuser, admin, lab, phlebo, cs)
- Update skeleton loading states widths in content requests
- Add printer selection capability in sample collection flow

Add comprehensive UAT documentation:
- New UAT_GDC_CMOD_Checklist.md with 150+ test cases
- Cover all roles: superuser, admin, lab, phlebo, cs, and cross-role scenarios
- Include acceptance criteria (functional, security, performance, usability, data integrity)
- Test categories: authentication, user management, validation, sample management, audit trail, reporting
- Detailed sign-off structure for stakeholders

Add barcode printing documentation:
- docs/barcode_print_all.php - all labels printing implementation
- docs/barcode_print_coll.php - collection label implementation
- docs/barcode_print_disp.php - dispatch label implementation

Update TODO tracking:
- Mark Reprint Label and PDF Generation as completed
- Update pending tasks for testing and audit trails
2026-02-05 06:21:08 +07:00
31acb6bf33 feat: Implement comprehensive report generation system with role-based access control
Add native CodeIgniter 4 report generation functionality replacing legacy spooler_db system.
Provides centralized report generation with audit logging and multi-language support.

New Features:
- Report generation with Indonesian and English language support
- Role-based access control (Lab, Admin, Superuser: generate; CS: print only)
- Preview mode for validation workflow
- Print audit logging to AUDIT_REQUESTS table
- Multi-page report support with proper pagination
- Dual unit system (Conventional and International units)

Controllers:
- ReportController: Main controller for report generation, preview, and print
  - generate(): Full report with audit logging
  - preview(): Preview mode without audit logging
  - print(): Print-only access for CS role
- Home::printReport(): Route handler redirecting based on user role

Libraries:
- ReportHelper: Comprehensive report data retrieval
  - Patient information (name, MR number, demographics, referral)
  - Test results with reference ranges and unit conversions
  - Collection and reception data with timestamps
  - Validation status and validator information
  - Special handling for pending samples and Chinese translations

Routes:
- /report/(:num) - Generate report (Lab, Admin, Superuser)
- /report/(:num)/preview - Preview without audit logging
- /report/(:num)/eng - English language report
- /report/print/(:num) - Print-only access (CS role)
- /print/(:num) - Redirect based on role (all roles)

Views:
- report/template.php: Professional lab report template with Gleneagles branding
  - Header and footer images
  - Patient information table
  - Test results with dual unit columns
  - Collection and reception timestamps
  - Authorization signature area
  - Preview watermark

Role Index Views:
- Removed dialog_preview.php inclusion from all role dashboards
- Consolidated print button directly linking to new report routes

Assets:
- Report-specific CSS files (normalize.min.css, style.css, pdf.css, style_qr.css)
- Gleneagles header and footer images
- Legacy spooler_db files preserved in public/spooler_db/ for reference

Tests:
- ReportTest.php: Unit tests for report generation functionality

Database:
- Uses existing tables: REQUESTS, TESTS, DICT_TESTS, SP_REQUESTS, PATIENTS
- Inserts print audit records into AUDIT_REQUESTS table

Security:
- Parameterized queries throughout (SQL injection prevention)
- Role-based access control enforced at route level
- Proper output escaping with esc() in views
2026-02-02 16:54:22 +07:00
3cf4cc7f3f feat: Implement audit trail system for dual-level validation workflow
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
2026-01-23 16:41:12 +07:00
33ccb976cc Refactor: Consolidate duplicate dashboard views into shared components
- Created shared dashboard components in app/Views/shared/:
  - dashboard_config.php, dashboard_table.php, dashboard_validate.php
  - dialog_sample.php, dialog_val.php, script_dashboard.php, script_validate.php
  - layout_dashboard.php
- Removed duplicate views from role-specific directories (admin, cs, lab, phlebo, superuser)
- Consolidated 575-line duplicate index.php files into shared components
- Updated controllers to use new shared view structure
- Added ApiValidateController for validation endpoints
- Reduced code duplication across 5 role-based dashboards

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-01-22 18:32:53 +07:00
02762bb355 Fix Superuser User Management and Refactor Dashboard Layouts
- Refactor 'app/Views/superuser/users.php' to fix user creation/editing logic using Alpine.js.
- Ensure efficient form state management (userid, username, password handling) in user modal.
- Standardize dashboard layouts and script initialization (window.BASEURL) across 'admin', 'cs', 'lab', 'phlebo', and 'superuser' main views.
- Remove redundant 'app/Views/admin/users.php' to consolidate user management.
2026-01-21 17:00:05 +07:00
mikael-zakaria
13591da5b4 Update Tampilan Yang beda antara 1 role dengan yang lain 2026-01-21 13:32:37 +07:00
mikael-zakaria
207948aeb3 Update semua role pada tempatnya done 2026-01-20 10:53:11 +07:00
mikael-zakaria
ddb76d4570 Update Role User (superuser, admin, lab, phlebo, cs) dan pengelompokan controller dan views 2026-01-20 09:56:16 +07:00
b29f807295 Refactor: Remove V2 namespace and consolidate role-based architecture
- Moved all V2 controllers (Lab, Requests, Samples, Users) to App\Controllers
- Removed deprecated role controllers (Admin, Doctor, Analyst, CustomerService)
- Simplified routes by removing /v2 prefix
- Added AGENTS.md with project conventions and TODO.md with task tracking
- Updated README.md with RBAC documentation
- Fixed hardcoded dates, status color mappings, and duplicate database calls
2026-01-19 10:55:10 +07:00
mikael-zakaria
4b84f60a6a Pernaikan tampilan CS 2025-12-04 15:58:49 +07:00
mikael-zakaria
fff385d7c6 Update Print dan Eng Laporan 2025-12-04 15:40:54 +07:00
mikael-zakaria
754ac8d734 Update Alur Lengkap & UserRole 2025-12-04 15:28:38 +07:00
mikael-zakaria
77f15bfc94 first commit 2025-11-11 09:14:25 +07:00