From e7cacba1c3162eda663514b363c8ba9cc8fd9036 Mon Sep 17 00:00:00 2001
From: mahdahar <89adham@gmail.com>
Date: Mon, 19 Jan 2026 16:46:05 +0700
Subject: [PATCH] feature : - add table sort - add sidebar menu - remove IND,
ENG on Preview
---
CHECKLIST.md | 82 +++
PROJECT_BACKLOG.md | 120 ----
app/Views/admin/dialog_preview.php | 31 +-
app/Views/admin/index.php | 873 +++++++++++++++++------------
app/Views/admin/main.php | 101 ++--
app/Views/lab/index.php | 443 ++++++++-------
app/Views/lab/main.php | 93 ++-
7 files changed, 994 insertions(+), 749 deletions(-)
create mode 100644 CHECKLIST.md
delete mode 100644 PROJECT_BACKLOG.md
diff --git a/CHECKLIST.md b/CHECKLIST.md
new file mode 100644
index 0000000..67060c8
--- /dev/null
+++ b/CHECKLIST.md
@@ -0,0 +1,82 @@
+# Project Checklist: Glen RME & Lab Management System
+
+**Last Updated:** January 19, 2026
+**Source:** PROJECT_BACKLOG.md
+
+---
+
+## P0 - Critical (Access Control & Security)
+
+_Must be completed first to ensure basic process flow is correct._
+
+- [ ] **T-002:** Hide/Disable 'Validation' button after 2nd validation
+ - Prevent redundant validation actions
+- [ ] **T-003:** Restrict Print/Save-to-PDF to CS Role only
+ - Lab can only preview, CS can print/save
+- [ ] **T-004:** Update User Role levels
+ - Standardize roles: Superuser, Admin, Lab, Phlebo, CS
+
+---
+
+## P1 - High (Dashboard & UI Improvements)
+
+_Features that improve speed and correctness of lab operations._
+
+- [ ] **T-005:** Role-Based Dashboard Filtering
+ - Filter by patient_status or service_type (Klinik+Lab vs Lab Only)
+- [ ] **T-006:** Create Clinical Patients Dashboard
+ - Hide "No Lab" column for clinical workflows
+- [X] **T-007:** Fix Table Sorting
+ - Enable sorting by "No Register" and "Patient Name"
+- [X] **T-008:** Fix Language Toggle (ID/EN)
+ - Toggle lab result preview between Indonesian and English
+- [X] **T-009:** Apply Row Color-Coding
+ - Color-code "No Register" column (Yellow/Blue/Green)
+- [ ] **T-010:** Update PDF Report Metadata
+ - Replace 'Printed By' with validating user's name
+ - Add 'Finish Validation' status per sample
+- [X] **T-011:** Initialize RME Sidebar Menu
+ - Create menu items: Dashboard, Patient, Hasil Lab, Validation, Unreceived, Report, Sample Collection, User Management, Unvalidate
+- [ ] **T-012:** Create 'Detail Unvalidated' History Log/View
+ - Log unvalidation actions with timestamp, user ID, and reason
+- [ ] **T-013:** Enhanced Patient Detail Logging
+ - Track: Sample Collection Time, Sample Received Time, Print History
+
+---
+
+## P2 - Medium (Maintenance & UX)
+
+_UI improvements and backend optimizations._
+
+- [ ] **T-014:** Add Dedicated Print Button
+ - Trigger browser/system print dialog
+- [ ] **T-015:** Add Error Handling for Preview Button
+ - Handle empty data gracefully
+- [ ] **T-016:** Ensure 'Uncollect' Feature Functional
+ - Maintain Uncollect feature functionality
+- [ ] **T-017:** Backend Performance & Connectivity
+ - Investigate intermittent connection issues with Server 253
+ - Plan SSD upgrade for database server
+ - Verify API integration: GDC_cmod, GDC_CS2, Report2
+- [X] **T-018: Delayed** Dashboard Performance
+ - When getting data more than 100 rows, it load too slow.
+ - Answer : Its Alpine Limitation, later will create pagination for dashboard.
+
+---
+
+## Quick Progress Summary
+
+| Priority | Total | Completed |
+|----------|-------|-----------|
+| P0 - Critical | 4 | 0 |
+| P1 - High | 9 | 0 |
+| P2 - Medium | 4 | 0 |
+| **Total** | **17** | **0** |
+
+---
+
+## Legend
+
+- Tasks are ordered by priority (P0 → P1 → P2)
+- Check items as you complete them
+- Refer to PROJECT_BACKLOG.md for detailed technical specifications
diff --git a/PROJECT_BACKLOG.md b/PROJECT_BACKLOG.md
deleted file mode 100644
index a8557f9..0000000
--- a/PROJECT_BACKLOG.md
+++ /dev/null
@@ -1,120 +0,0 @@
-# Project Backlog: Glen RME & Lab Management System
-
-**Last Updated:** January 19, 2026
-**Sources:** TODO.md, TODO.json
-
----
-
-## P0 - Critical (Access Control & Security)
-
-_Must be completed first to ensure basic process flow is correct._
-
-| ID | Task | Source | Status |
-|----|------|--------|--------|
-| T-001 | **Restrict 'Unvalidate' button to specific User IDs**
User Story: As an Admin, I want an "Unvalidate" menu to revert finalized records in case of data entry errors.
Technical: Only Doctors and Bu Yani should have access. | Both | Pending |
-| T-002 | **Hide/Disable 'Validation' button after 2nd validation**
User Story: As a Lab Validator, I want the "Validate" button to disappear or disable once 2-level validation is complete to prevent redundant actions. | Both | Pending |
-| T-003 | **Restrict Print/Save-to-PDF to CS Role only**
User Story: As a Manager, I want to restrict the "Print Result" permission to the CS Role only, so that the Lab team cannot bypass the official release process.
Technical: Lab can only preview, CS can print/save. | Both | Pending |
-| T-004 | **Update User Role levels**
Technical: Standardize roles to: Superuser, Admin, Lab, Phlebo, and CS. | JSON | Pending |
-
----
-
-## P1 - High (Dashboard & UI Improvements)
-
-_Features that improve speed and correctness of lab operations._
-
-| ID | Task | Source | Status |
-|----|------|--------|--------|
-| T-005 | **Role-Based Dashboard Filtering**
User Story: As a Lab Staff, I want the dashboard to only show "Klinik+Lab" or "Lab Only" patients so I can focus on relevant tasks.
User Story: As a CS Staff, I want to see all patients to monitor the entire facility flow.
Technical: Implement filter logic based on patient_status or service_type field. | MD | Pending |
-| T-006 | **Create Clinical Patients Dashboard**
Technical: Dedicated dashboard that hides the "No Lab" column for clinical workflows. | JSON | Pending |
-| T-007 | **Fix Table Sorting**
User Story: As a User, I want to sort dashboard tables by "No Register" and "Patient Name" to find specific records quickly.
Technical: Fix sorting functionality on all table headers. | Both | Pending |
-| T-008 | **Fix Language Toggle (ID/EN)**
User Story: As a Lab Staff, I want to toggle the lab result preview between Indonesian and English so I can provide reports for international requirements. | Both | Pending |
-| T-009 | **Apply Row Color-Coding**
User Story: As a User, I want the "No Register" column to be color-coded (Yellow/Blue/Green) based on legacy system logic for quick status recognition. | Both | Pending |
-| T-010 | **Update PDF Report Metadata**
Technical: Replace 'Printed By' with name of validating user. Add 'Finish Validation' status per sample in PDF output. | JSON | Pending |
-
----
-
-## P1 - High (RME Module Development)
-
-| ID | Task | Source | Status |
-|----|------|--------|--------|
-| T-011 | **Initialize RME Sidebar Menu**
Technical: Create menu items for Dashboard, Patient, Hasil Lab, Validation, Unreceived, Report, Sample Collection, User Management, and Unvalidate. | JSON | Pending |
-| T-012 | **Create 'Detail Unvalidated' History Log/View**
User Story: As a User, I want the "Reason for Unvalidation" to be visible in the Patient Detail view so I know why a record was reopened.
Technical: Log all unvalidation actions with timestamp, user ID, and reason. | Both | Pending |
-| T-013 | **Enhanced Patient Detail Logging**
User Story: As a Staff member, I want to see a detailed history in the patient profile including:
- Sample Collection Time (categorized by type: EDTA, Serum, etc.) - Sample Received Time - Print History (Who printed and when) | MD | Pending |
-
----
-
-## P2 - Medium (Maintenance & UX)
-
-_UI improvements and backend optimizations._
-
-| ID | Task | Source | Status |
-|----|------|--------|--------|
-| T-014 | **Add Dedicated Print Button**
User Story: As a User, I want a clear "Print" button that triggers the browser/system print dialog, as standard shortcuts (Ctrl+P) are currently unreliable in the app. | MD | Pending |
-| T-015 | **Add Error Handling for Preview Button**
Technical: Ensure Preview doesn't crash when data is empty. | JSON | Pending |
-| T-016 | **Ensure 'Uncollect' Feature Functional**
Technical: Maintain Uncollect feature functionality in current phase. | JSON | Pending |
-| T-017 | **Backend Performance & Connectivity**
Technical Tasks: - Investigate intermittent connection issues with Server 253 - Plan and execute SSD Upgrade for database server - Verify API integration between GDC_cmod, GDC_CS2, and Report2 for sample reception module | MD | Pending |
-
----
-
-## Management Notes
-
-| ID | Note | Source |
-|----|------|--------|
-| NOTE-001 | Mas Rizqi is the IT person in charge. | JSON |
-| NOTE-002 | Merging of 'Hasil' and 'Validation' menus is pending management approval. | JSON |
-
----
-
-## Acceptance Criteria Summary
-
-### Code Consistency
-- All new UI elements (buttons/toggles) must match the existing design system.
-
-### Audit Trail
-- Every status change (Validate/Unvalidate) must be logged with a timestamp and user ID.
-
-### Cross-Browser
-- The "Print" functionality must work across Chrome and Edge browsers.
-
----
-
-## Source Mapping Appendix
-
-| Task ID | Source | Original Description |
-|---------|--------|---------------------|
-| T-001 | TODO.json | Restrict 'Unvalidate' button to specific User IDs |
-| T-002 | Both | Hide/disable Validation button after 2nd validation |
-| T-003 | Both | Restrict Print/Save-to-PDF to CS Role only |
-| T-004 | TODO.json | Update User Role levels |
-| T-005 | TODO.md | Role-Based Dashboard Filtering |
-| T-006 | TODO.json | Create Clinical Patients Dashboard |
-| T-007 | Both | Fix Table Sorting |
-| T-008 | Both | Fix Language Toggle (ID/EN) |
-| T-009 | Both | Apply row color-coding |
-| T-010 | TODO.json | Update PDF reports metadata |
-| T-011 | TODO.json | Initialize RME Sidebar Menu |
-| T-012 | Both | Detail Unvalidated history log/view |
-| T-013 | TODO.md | Enhanced Patient Detail Logging |
-| T-014 | TODO.md | Dedicated Print Button |
-| T-015 | TODO.json | Error handling for Preview button |
-| T-016 | TODO.json | Ensure Uncollect feature functional |
-| T-017 | TODO.md | Backend Performance & Connectivity |
-
----
-
-## Quick Reference: Task Count by Priority
-
-| Priority | Count | Items |
-|----------|-------|-------|
-| P0 - Critical | 4 | T-001 through T-004 |
-| P1 - High | 9 | T-005 through T-013 |
-| P2 - Medium | 4 | T-014 through T-017 |
-| **Total** | **17** | |
-
----
-
-## Legend
-
-- **MD** = TODO.md (User story focused)
-- **JSON** = TODO.json (Developer task focused)
-- **Both** = Content merged from both sources
diff --git a/app/Views/admin/dialog_preview.php b/app/Views/admin/dialog_preview.php
index d6f3e1f..493d542 100644
--- a/app/Views/admin/dialog_preview.php
+++ b/app/Views/admin/dialog_preview.php
@@ -4,16 +4,24 @@
-
- Preview
+
+ Preview
-
-
-
-
-
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/app/Views/admin/index.php b/app/Views/admin/index.php
index e8efed8..062b649 100644
--- a/app/Views/admin/index.php
+++ b/app/Views/admin/index.php
@@ -1,401 +1,566 @@
= $this->extend('admin/main'); ?>
= $this->section('content') ?>
-
-
-
-
-
-
-
-
-
- Requests Overview
-
-
-
-
-
-
- All
-
-
- Pending
-
-
- Coll
-
-
- Recv
-
-
- Inc
-
-
- Fin
-
-
- Val
-
-
+
+
+
+
+
+
+
+
+
+ Requests Overview
+
-
-
-
-
-
-
- -
-
-
-
-
-
- Search
- Reset
-
-
-
-
-
-
-
+
+
+
+ All
+
+
+ Pending
+
+
+ Coll
+
+
+ Recv
+
+
+ Inc
+
+
+ Fin
+
+
+ Val
+