24 Commits

Author SHA1 Message Date
2aa2ef50f2 feat: add v2 dashboards and server-side request pagination
Introduces v2 role routes/views and moves request list filtering, sorting, and pagination to the backend for better performance. Also switches shared pages to a generated Tailwind CSS bundle with supporting npm assets.
2026-04-02 13:02:29 +07:00
5262808860 fix report style 2026-04-02 09:12:48 +07:00
42d5abc25a Update printer configuration, label controller, and shared views 2026-02-26 12:42:49 +07:00
2843ddd392 Migrate PDF generation from legacy spooler_db to CI4 + node_spooler
BREAKING CHANGE: Remove public/spooler_db/ legacy system

Changes:
- Migrate validation preview from http://glenlis/spooler_db/main_dev.php to CI4 /report/{accessnumber}
- Add ReportController::preview() for HTML preview in validation dialog
- Add ReportController::generatePdf() to queue PDF generation via node_spooler at http://glenlis:3030
- Add ReportController::checkPdfStatus() to poll spooler job status
- Add ReportController::postToSpooler() helper for curl requests to spooler API
- Add routes: GET /report/(:num)/preview, GET /report/(:num)/pdf, GET /report/status/(:any)
- Delete public/spooler_db/ directory (40+ legacy files)
- Compact node_spooler/README.md from 577 to 342 lines

Technical Details:
- New architecture: CI4 Controller -> node_spooler (port 3030) -> Chrome CDP (port 42020)
- API endpoints: POST /api/pdf/generate, GET /api/pdf/status/:jobId, GET /api/queue/stats
- Features: Max 5 concurrent jobs, max 100 in queue, auto-cleanup after 60 min
- Error handling: Chrome crash detection, manual error review in data/error/
- PDF infrastructure ready, frontend PDF buttons to be updated later in production

Migration verified:
- No external code references spooler_db
- All assets duplicated in public/assets/report/
- Syntax checks passed for ReportController.php and Routes.php

Refs: node_spooler/README.md
2026-02-03 11:33:55 +07:00
848d8d663f feat: Extend report access to CS role and refactor report generation
This commit expands report generation capabilities to Customer Service (CS) role
and refactors the report system for better maintainability and PDF support.

Changes Summary:

Access Control:
- Extended report access from Lab, Admin, Superuser to include CS role (filter: 0,1,2,4)
- Removed separate CS-only print routes, consolidated into unified report routes
- Routes now support /report/:num, /report/:num/eng, /report/:num/print, /report/:num/print/eng

Controller Refactoring (ReportController):
- Refactored generate() and print() methods to share common renderReport() logic
- Removed separate preview() method - preview now handled via preview parameter
- Added ispdf parameter support for PDF generation mode
- Print functionality now logs audit events to AUDIT_REQUESTS table

Database Queries (ReportHelper):
- Improved SQL queries with explicit aliases for better readability and maintainability
- Fixed date formatting issue: changed date_format() to date() with strtotime()
- Added getValData() method to retrieve validation user information (VAL1USER, VAL2USER)
- Added null coalescing operators (?? '') for safer array access

View Updates (report/template.php):
- Conditional CSS loading: uses pdf.css when ispdf=1, otherwise style.css
- Removed "PREVIEW ONLY - DO NOT PRINT" watermark
- Conditional header/footer images - only display when generating PDF
- Added validation user display: "Val1 By : {user} | Val2 By : {user}"
- Replaced signature placeholder with "This result is valid without signature" statement
- Improved footer layout spacing

Styling Adjustments (public/assets/report/style.css):
- Adjusted margins for better print layout: dinfo (2cm), dresult (17.5cm), footer (2cm)
- Increased footer width from 17cm to 18cm
- Added responsive image classes: .img and .img-footer with max-width: 100%
- Set footer image max-height to 2.5cm

Security:
- Maintained role-based access control with proper authentication checks
- All database queries use parameterized statements (no interpolation)
- Print actions still logged to AUDIT_REQUESTS for audit trail
2026-02-03 07:26:41 +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
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
d3534e62a1 add change password per user 2025-12-10 16:37:51 +07:00
mikael-zakaria
cb0c01fba2 Update ENG & Print2 2025-12-04 15:50:00 +07:00
mikael-zakaria
386e1ae7a2 Update ENG & Print 2025-12-04 15:46:29 +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
c69043cfbf prework 1 2025-11-30 20:34:19 +07:00
53a9a8db53 go go alpine 2025-11-28 16:52:44 +07:00
6dc1f24bb3 pre finish 2025-11-26 10:18:06 +07:00
346433bf6d prework 2025-11-26 06:49:30 +07:00
40d7754876 prework 2025-11-25 14:14:14 +07:00
11111aeed3 add label creation 2025-11-18 16:20:31 +07:00
75062e00a5 add val counter 2025-11-18 14:15:41 +07:00
5c81a67f18 prework 2025-11-13 16:42:43 +07:00
mikael-zakaria
de54d81fd3 Remove public/.htaccess from tracking 2025-11-12 08:40:12 +07:00
mikael-zakaria
9a5370af8e Update gitignore 2025-11-12 08:36:27 +07:00
3772b59d10 Update Prod 2025-11-11 15:24:52 +07:00
mikael-zakaria
77f15bfc94 first commit 2025-11-11 09:14:25 +07:00