Change Dashboard(Reff# menjadi Visit#, Hilangkan 0 pada Patnumber) dan Header Laporan REF menjadi Visit

This commit is contained in:
mikael-zakaria 2025-03-12 23:09:53 +08:00
parent 206ee53221
commit fefe36db53
5 changed files with 9 additions and 7 deletions

View File

@ -11,15 +11,16 @@ class API_Dashboard extends ResourceController {
// Mengetahui Apakah User Login adalah Bali atau Surabaya // Mengetahui Apakah User Login adalah Bali atau Surabaya
$cityid = session()->get('usercityid'); $cityid = session()->get('usercityid');
if ($cityid == 1) { if ($cityid == 1) {
$filter_query = " AND (sr.HOSTORDERNUMBER LIKE 'B%' OR sr.HOSTORDERNUMBER LIKE 'Z%')"; $filter_query = " AND (tr.REQNUMBER LIKE 'B%' OR tr.REQNUMBER LIKE 'Z%')";
} elseif ($cityid == 2) { } elseif ($cityid == 2) {
$filter_query = " AND (sr.HOSTORDERNUMBER LIKE 'S%' OR sr.HOSTORDERNUMBER LIKE 'X%')"; $filter_query = " AND (tr.REQNUMBER LIKE 'S%' OR tr.REQNUMBER LIKE 'X%')";
} else { $filter_query = " "; } } else { $filter_query = " "; }
$db = \Config\Database::connect(); $db = \Config\Database::connect();
$date1 = $this->request->getPost('date1'); $date1 = $this->request->getPost('date1');
$date2 = $this->request->getPost('date2'); $date2 = $this->request->getPost('date2');
$sql = "select sr.COLLECTIONDATE, sr.SP_ACCESSNUMBER, sr.HOSTORDERNUMBER, p.PATNUMBER, concat(p.FIRSTNAMESK, ' ', p.NAME) as NAME, $sql = "SELECT
sr.COLLECTIONDATE, sr.SP_ACCESSNUMBER, tr.REQNUMBER as HOSTORDERNUMBER, p.PATNUMBER, concat(p.FIRSTNAMESK, ' ', p.NAME) as NAME,
TESTS=stuff(( select ', '+'('+T.SP_TESTCODE+')' from TESTS=stuff(( select ', '+'('+T.SP_TESTCODE+')' from
( select T.SP_TESTCODE from SP_TESTS T ( select T.SP_TESTCODE from SP_TESTS T
where T.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER where T.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER
@ -60,6 +61,7 @@ class API_Dashboard extends ResourceController {
from SP_REQUESTS sr from SP_REQUESTS sr
left join PATIENTS p on p.PATID=sr.PATID left join PATIENTS p on p.PATID=sr.PATID
left join REQUESTS r on r.ACCESSNUMBER=sr.SP_ACCESSNUMBER left join REQUESTS r on r.ACCESSNUMBER=sr.SP_ACCESSNUMBER
left join cmod.dbo.CM_TM_REQUESTS tr on tr.REFFID = sr.HOSTORDERNUMBER
where sr.COLLECTIONDATE between '$date1 00:00' and '$date2 23:59'" where sr.COLLECTIONDATE between '$date1 00:00' and '$date2 23:59'"
.$filter_query. .$filter_query.
"order by sr.COLLECTIONDATE desc"; "order by sr.COLLECTIONDATE desc";

View File

@ -962,7 +962,7 @@ class PrintResult extends BaseController {
p.FIRSTNAMESK AS FIRSTNAME, p.FIRSTNAMESK AS FIRSTNAME,
p.NAME, p.NAME,
p.BIRTHDATE, p.BIRTHDATE,
sr.HOSTORDERNUMBER, ctr.REQNUMBER as HOSTORDERNUMBER,
sr.COLLECTIONDATE, sr.COLLECTIONDATE,
sr.SP_ACCESSNUMBER, sr.SP_ACCESSNUMBER,
p.SEX, p.SEX,

View File

@ -33,7 +33,7 @@
<th width="12%">Patient#</th> <th width="12%">Patient#</th>
<th width="17%">Patient Name</th> <th width="17%">Patient Name</th>
<th class='text-start' width="10%">Access#</th> <th class='text-start' width="10%">Access#</th>
<th width="9%">Reff#</th> <th width="9%">Visit#</th>
<th>Test</th> <th>Test</th>
<th>Status</th> <th>Status</th>
<th></th> <th></th>

View File

@ -33,7 +33,7 @@
<th width="12%">Patient#</th> <th width="12%">Patient#</th>
<th width="17%">Patient Name</th> <th width="17%">Patient Name</th>
<th class='text-start' width="10%">Access#</th> <th class='text-start' width="10%">Access#</th>
<th width="9%">Reff#</th> <th width="9%">Visit#</th>
<th>Test</th> <th>Test</th>
<th>Status</th> <th>Status</th>
<th></th> <th></th>

View File

@ -33,7 +33,7 @@
<th width="12%">Patient#</th> <th width="12%">Patient#</th>
<th width="17%">Patient Name</th> <th width="17%">Patient Name</th>
<th class='text-start' width="10%">Access#</th> <th class='text-start' width="10%">Access#</th>
<th width="9%">Reff#</th> <th width="9%">Visit#</th>
<th>Test</th> <th>Test</th>
<th>Status</th> <th>Status</th>
<th></th> <th></th>