4 Commits

Author SHA1 Message Date
caf8b332f4 feat: rewrite batch PDF script to use curl endpoint with localhost bypass
Changes:
- app/Filters/RoleFilter.php: Add localhost/127.0.0.1 bypass at start of before()
- app/Controllers/ReportController.php: Add localhost bypass in generatePdf()
- script.php: Rewrite to use curl to http://glenlis/cmod/report/{accessnumber}/pdf

Benefits:
- Eliminates 94-second CLI database queries
- Uses optimized web endpoint (fast database connections)
- Simple curl-based implementation, no CI4 bootstrapping
- Maintains all existing logging (AUDIT_REQUESTS, ORU files)
2026-03-11 09:11:47 +07:00
eb7729478e debug: add timing info to identify bottlenecks in batch PDF generation
Add millisecond timing for each step:
- Database check
- Report data fetching (ReportHelper)
- HTML template rendering
- Spooler API call
- Total time per accessnumber
2026-03-11 08:56:53 +07:00
0b569c58d9 fix: add progress output and better timeout handling for batch PDF script
- Add flush() after each echo to show progress in real-time
- Increase curl timeout to 30 seconds with 10 second connect timeout
- Add curl error handling to diagnose connection issues
- Add progress messages (generating HTML, sending to spooler)
2026-03-11 08:54:49 +07:00
f35d6647c5 feat: add batch PDF generator CLI script
Add script.php for batch generating PDFs from a list of accessnumbers.
Features:
- Reads accessnumbers from text file (one per line)
- Validates requests exist and are validated (ISVAL2=1)
- Uses REPORT_LANG to determine language
- Sends to PDF spooler and logs to AUDIT_REQUESTS
- Creates ORU files for HL7 integration
- Outputs progress and saves detailed log

Usage: php script.php accessnumbers.txt
2026-03-11 08:52:06 +07:00