Recompute filtered, sorted, and paginated validation state after a request is removed from the pending list.\nAdjust next-item selection so the dialog advances only when a valid next item exists, avoiding wraparound to stale entries.
Use the local accessnumber when queuing PDFs after val2, since the validation response does not include accessnumber. Add success and error toast feedback for the PDF generation request.
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.
- Update UnVal visibility condition from ISVAL check to VAL1USER && VAL2USER
- Fix validated-but-incomplete requests missing the UnVal action button
- Align isValidated() function with same logic for consistency
- Refactor AGENTS.md formatting
- Reduce cURL timeout from 10s to 3s total (2s connection)
- Add better error messages for spooler failures
- Continue processing remaining items if one fails
- Prevents getting stuck when spooler is slow/unreachable
- Create PdfBatchService class with generatePdf() method
- Extract PDF generation logic from ReportController for reuse
- Update SuperuserController to use direct method calls instead of HTTP/cURL
- Eliminates HTTP overhead for ~10x faster batch processing
Fixes 'Call to a member function getIPAddress() on null' error by calling
report/{id}/pdf endpoint via HTTP request instead of instantiating
ReportController directly, which ensures proper request initialization.
- Add /superuser/pdf-batch page with textarea input for access numbers
- Create API endpoint /api/superuser/pdf-batch to process batch PDF generation
- Use report/{id}/pdf endpoint for authenticated PDF generation
- Show results table with success/failed status, language, and type (new/regen)
- Remove deprecated /batch/pdf endpoint
- Add PDF Batch menu item to superuser navigation
Changes:
- app/Config/Routes.php: Add GET /batch/pdf/(:num) route without auth filter
- app/Controllers/ReportController.php: Add generatePdfNoAuth() method
- script.php: Update to use new batch/pdf endpoint with localhost URL
Usage: php script.php accessnumbers.txt
Endpoint: http://localhost/gdc_cmod/batch/pdf/{accessnumber}
No authentication required - for internal/batch processing only.
Add millisecond timing for each step:
- Database check
- Report data fetching (ReportHelper)
- HTML template rendering
- Spooler API call
- Total time per accessnumber
- 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)
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
- Add support for scanning sample numbers (8 digits) in addition to access numbers (10 digits)
- Backend: Detect input type based on length, extract sample code and access suffix
- Frontend: Auto-select matching sample and highlight with primary ring border
- When sample number scanned (e.g., 10135026), extracts sample code (101) and auto-checks it
PDFs were being saved based on collection date but links were using
REQDATE, causing mismatches. Updated both regular and English PDF
links to use COLLECTIONDATE for consistency.
- Add POST /api/requests/{accessnumber}/pdf endpoint (no auth required)
- Add setPdfFlag() method to update CM_REQUESTS.ISPDF to 1
- Log PDF_FLAG events to AUDIT_EVENTS table
- Include ISPDF field in dashboard API response
- Add PDF icon indicator in dashboard table (after Val column)
- Icon shows green when ISPDF=1, gray when null/0
- Pass accessnumber to PDF spooler for tracking
Files modified:
- app/Config/Routes.php: Add external PDF endpoint route
- app/Controllers/RequestsController.php: Add setPdfFlag method, include ISPDF in query
- app/Controllers/ReportController.php: Pass accessnumber to spooler
- app/Libraries/PdfHelper.php: Pass accessnumber to spooler
- app/Views/shared/content_requests.php: Add PDF column with icon
- Remove dialog_eng_result.php include from CS index view
- Add role-based status display for Phlebo (role 3) showing Ready/Pending badges
- Fix indentation inconsistencies in content_requests.php dropdown menus
- Add role restrictions: hide Generate Result and Create Eng Result buttons for CS (role 4) and Phlebo (role 3)
- Move status sorting logic from fetchList to computeSorted for proper Alpine.js reactivity
- Add statusOrder mapping (Pend -> Coll -> Recv -> Inc -> Fin) for consistent request sorting
- Simplify Actions dropdown for Phlebo role to show only status indicator
- Replace reactive watchers with explicit method calls
- Add setFilterKey() and setFilterTable() methods for manual updates
- Update sort(), nextPage(), prevPage() to trigger computations
- Update templates to use new setter methods
- Compute derived data explicitly after data loading
- Add toastTimeouts array to track and clear pending timeouts
- Consolidate duplicate watchers (sortCol, sortAsc, sorted, currentPage)
- Add destroy() method to clean up data structures and timeouts
- Cache audit events in _cachedAuditEvents instead of computed getter
- Clear item data when closing dialogs