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 1/2] 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 @@ extend('admin/main'); ?> section('content') ?> -
-
-
- - -
-
-
-

- Requests Overview -

-
- - -
- - - - - - - -
+
+
+
+ + +
+
+
+

+ Requests Overview +

- -
-
- -
- - - - -
-
- -
- - -
- - - -
- -
+ +
+ + + + + + +
-
- - - +
- + include('admin/dialog_sample'); ?> include('admin/dialog_val'); ?> include('admin/dialog_unval'); ?> - -
+ +
endSection(); ?> section('script') ?> - + endSection(); ?> \ No newline at end of file diff --git a/app/Views/lab/main.php b/app/Views/lab/main.php index bdfde16..f166d8b 100644 --- a/app/Views/lab/main.php +++ b/app/Views/lab/main.php @@ -1,5 +1,6 @@ + @@ -14,49 +15,81 @@ font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; font-size: 0.71rem; } + .navbar { padding: 0.2rem 1rem; min-height: 0rem; } - .card-body { + + .card-body { font-size: 0.71rem !important; - } + } - - + + + renderSection('content'); ?> + + - - renderSection('content');?> + +
+ + +
+ - - - renderSection('script');?> + renderSection('script'); ?> + \ No newline at end of file From ebc75097c19adb3eccb2fcacbcf3e725573acee6 Mon Sep 17 00:00:00 2001 From: mahdahar <89adham@gmail.com> Date: Tue, 20 Jan 2026 09:53:56 +0700 Subject: [PATCH 2/2] fix: - add filterTable $watch to reset pagination - add click handler to table cells (SP_ACCESSNUMBER, HOSTORDERNUMBER, STATS) - change STATS from button to text cell --- CHECKLIST.md | 10 ++-- app/Controllers/Request.php | 105 ------------------------------------ app/Views/admin/index.php | 13 +++-- 3 files changed, 16 insertions(+), 112 deletions(-) delete mode 100644 app/Controllers/Request.php diff --git a/CHECKLIST.md b/CHECKLIST.md index 67060c8..aab0d15 100644 --- a/CHECKLIST.md +++ b/CHECKLIST.md @@ -32,9 +32,6 @@ _Features that improve speed and correctness of lab operations._ - 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 @@ -64,6 +61,13 @@ _UI improvements and backend optimizations._ --- +## P3 - Onsite / Onprem Tasks + +- [ ] **T-010:** Update PDF Report Metadata + - Replace 'Printed By' with validating user's name + - Add 'Finish Validation' status per sample + +--- ## Quick Progress Summary | Priority | Total | Completed | diff --git a/app/Controllers/Request.php b/app/Controllers/Request.php deleted file mode 100644 index 326a2df..0000000 --- a/app/Controllers/Request.php +++ /dev/null @@ -1,105 +0,0 @@ -request->getGet('date1'); - $date2 = $this->request->getGet('date2'); - - $db = \Config\Database::connect(); - $sql = "SELECT * from GDC_CMOD.dbo.V_DASHBOARD_DEV where - COLLECTIONDATE between '$date1 00:00' and '$date2 23:59' - and ODR_DDATE between '$date1 00:00' and '$date2 23:59'"; - $rows = $db->query($sql)->getResultArray(); - foreach ($rows as &$row) { - $row['COLLECTIONDATE'] = date('Y-m-d H:i', strtotime($row['COLLECTIONDATE'])); - $row['ODR_DDATE'] = date('Y-m-d H:i', strtotime($row['ODR_DDATE'])); - $row['REQDATE'] = date('Y-m-d H:i', strtotime($row['REQDATE'])); - } - $data['data'] = $rows; - return $this->response->setJSON($data); - } - - - public function show($accessnumber) { - $db = db_connect(); - $data['accessnumber'] = $accessnumber; - $sql = "SELECT d.STATS, r.* FROM GDC_CMOD.dbo.V_DASHBOARD_DEV d - left join GDC_CMOD.dbo.CM_REQUESTS r ON r.ACCESSNUMBER=d.SP_ACCESSNUMBER - WHERE d.SP_ACCESSNUMBER='$accessnumber'"; - $result = $db - ->query($sql) - ->getResultArray(); - $data['val1'] = $result[0]['ISVAL1']; - $data['val1user'] = $result[0]['VAL1USER']; - $data['val2'] = $result[0]['ISVAL2']; - $data['val2user'] = $result[0]['VAL2USER']; - return view('admin/modal_request',$data); - } - - public function showUnval($accessnumber) { - $data['accessnumber'] = $accessnumber; - return view('admin/modal_unvalidate',$data); - } - - public function unval($accessnumber) { - $input = $this->request->getJSON(true); - $userid = $input['userid']; - $comment = $input['comment']; - $db = db_connect(); - $sql = "update GDC_CMOD.dbo.CM_REQUESTS set ISVAL1=null, VAL1USER=null, VAL1DATE=null, ISVAL2=null, VAL2USER=null, VAL2DATE=null, - ISPENDING=1, PENDINGTEXT='$comment', PENDINGUSER='$userid', PENDINGDATE=GETDATE() where ACCESSNUMBER='$accessnumber'"; - $db->query($sql); - $data = ['status' => 'success', 'message' => 'Data updated successfully', 'data' => "$accessnumber" ]; - - return $this->response->setJSON($data); - } - - public function val($accessnumber) { - $input = $this->request->getJSON(true); - $userid = $input['userid']; - $db = db_connect(); - //cek val - $sql = "select * from GDC_CMOD.dbo.CM_REQUESTS where ACCESSNUMBER='$accessnumber'"; - $result = $db->query($sql)->getResultArray(); - //$data['data'] = $result; - if(!isset($result[0])) { - $sql = "insert into GDC_CMOD.dbo.CM_REQUESTS(ACCESSNUMBER, ISVAL1, VAL1USER, VAL1DATE) VALUES ('$accessnumber', 1, '$userid', GETDATE())"; - $db->query($sql); - $data['val'] = 1; - $data['userid'] = $userid; - } else { - $row = $result[0]; - $isval1 = $row['ISVAL1']; - $isval2 = $row['ISVAL2']; - $val1user = $row['VAL1USER']; - if( $isval1 == 1 ) { - // val done - if ( $isval2 == 1 ) { return $this->response->setJSON(['message'=> 'validation done, not updating anything']); } - else { - // val2 if user val1 != userid - if($val1user != $userid) { - $sql = "update GDC_CMOD.dbo.CM_REQUESTS set ISVAL2=1, VAL2USER='$userid', VAL2DATE=GETDATE() where ACCESSNUMBER='$accessnumber'"; - $data['val'] = 2; - $data['userid'] = $userid; - } else { - $this->response->setStatusCode(500); - return $this->response->setJSON([ 'message'=> 'user already validate this request' ]); - } - } - } else { - // val1 - $sql = "update GDC_CMOD.dbo.CM_REQUESTS set ISVAL1=1, VAL1USER='$userid', VAL1DATE=GETDATE() where ACCESSNUMBER='$accessnumber'"; - $data['val'] = 1; - $data['userid'] = $userid; - } - $db->query($sql); - } - - return $this->response->setJSON($data); - } -} diff --git a/app/Views/admin/index.php b/app/Views/admin/index.php index 062b649..2f871d2 100644 --- a/app/Views/admin/index.php +++ b/app/Views/admin/index.php @@ -211,8 +211,10 @@ - - + + @@ -241,8 +243,8 @@ @click="openPreviewDialog(req.SP_ACCESSNUMBER, 'preview', req)">Preview - + @@ -359,6 +361,9 @@ this.today = new Date().toISOString().slice(0, 10); this.filter.date1 = this.today; this.filter.date2 = this.today; + this.$watch('filterTable', () => { + this.currentPage = 1; + }); this.fetchList(); },