Menampilkan nama lengkap pasien di dashboard dan dashboard view cukup tekan status saja
This commit is contained in:
parent
3e6db15d58
commit
0af3f4d7eb
@ -19,50 +19,50 @@ class API_Dashboard extends ResourceController {
|
||||
$db = \Config\Database::connect();
|
||||
$date1 = $this->request->getPost('date1');
|
||||
$date2 = $this->request->getPost('date2');
|
||||
$sql = "select sr.COLLECTIONDATE, sr.SP_ACCESSNUMBER, sr.HOSTORDERNUMBER, p.PATNUMBER, p.NAME,
|
||||
TESTS=stuff(( select ', '+'('+T.SP_TESTCODE+')' from
|
||||
( select T.SP_TESTCODE from SP_TESTS T
|
||||
where T.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER
|
||||
and T.DEPTH=0 AND T.SP_TESTCODE <> 'Q'
|
||||
) as T
|
||||
for xml path('')),1,1,''),
|
||||
case
|
||||
when exists (select 1 from AUDIT_TRAIL at where at.ATR_ACCESSNUMBER=sr.SP_ACCESSNUMBER and at.STEPTYPE=2 and at.LIS_SESSION='RFC' ) then
|
||||
case
|
||||
when exists (select 1 from SP_TUBES st where st.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER and st.TUBESTATUS=0 ) then 'PartRecv'
|
||||
when exists (select 1 from TESTS T where T.REQUESTID=r.REQUESTID and T.RESTYPE IN (null,'0') ) then 'Inc'
|
||||
--when exists (select 1 from TESTS T where T.REQUESTID=r.REQUESTID and T.RESTYPE IN (null,'0') and T.TESTID='1805' ) then 'Inc'
|
||||
else 'Comp'
|
||||
end
|
||||
-- inc
|
||||
when exists (select 1 from TESTS T where T.RESTYPE not in (0,4) and T.REQUESTID=r.REQUESTID ) then
|
||||
case
|
||||
when exists ( select 1 from cmod.dbo.CM_TUBES T where T.ACCESSNUMBER=sr.SP_ACCESSNUMBER and T.COLLSTATUS=0 ) then 'PartColl'
|
||||
when exists (select 1 from SP_TUBES st where st.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER and st.TUBESTATUS=0 ) then 'PartRecv'
|
||||
else 'Inc'
|
||||
end
|
||||
--rcv
|
||||
when not exists (select 1 from SP_TUBES st where st.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER and st.TUBESTATUS=0 ) then
|
||||
case
|
||||
when exists (select 1 from cmod.dbo.CM_TUBES T where T.ACCESSNUMBER=sr.SP_ACCESSNUMBER and T.COLLSTATUS=0 ) then 'PartColl'
|
||||
else 'Recv'
|
||||
end
|
||||
--coll
|
||||
when exists (select 1 FROM cmod.dbo.CM_TUBES T where T.ACCESSNUMBER=sr.SP_ACCESSNUMBER ) then
|
||||
case
|
||||
when exists (select 1 from SP_TUBES st where st.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER and st.TUBESTATUS=4 ) then 'PartRecv'
|
||||
when not exists (select 1 from cmod.dbo.CM_TUBES T where T.ACCESSNUMBER=sr.SP_ACCESSNUMBER and T.COLLSTATUS=0 ) then 'Coll'
|
||||
when exists (select 1 from cmod.dbo.CM_TUBES T where T.ACCESSNUMBER=sr.SP_ACCESSNUMBER and T.COLLSTATUS=1 ) then 'PartColl'
|
||||
else 'Pend'
|
||||
end
|
||||
else 'Pend'
|
||||
end STATS
|
||||
from SP_REQUESTS sr
|
||||
left join PATIENTS p on p.PATID=sr.PATID
|
||||
left join REQUESTS r on r.ACCESSNUMBER=sr.SP_ACCESSNUMBER
|
||||
where sr.COLLECTIONDATE between '$date1 00:00' and '$date2 23:59'"
|
||||
.$filter_query.
|
||||
"order by sr.COLLECTIONDATE desc";
|
||||
$sql = "select sr.COLLECTIONDATE, sr.SP_ACCESSNUMBER, sr.HOSTORDERNUMBER, p.PATNUMBER, concat(p.FIRSTNAMESK, ' ', p.NAME) as NAME,
|
||||
TESTS=stuff(( select ', '+'('+T.SP_TESTCODE+')' from
|
||||
( select T.SP_TESTCODE from SP_TESTS T
|
||||
where T.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER
|
||||
and T.DEPTH=0 AND T.SP_TESTCODE <> 'Q'
|
||||
) as T
|
||||
for xml path('')),1,1,''),
|
||||
case
|
||||
when exists (select 1 from AUDIT_TRAIL at where at.ATR_ACCESSNUMBER=sr.SP_ACCESSNUMBER and at.STEPTYPE=2 and at.LIS_SESSION='RFC' ) then
|
||||
case
|
||||
when exists (select 1 from SP_TUBES st where st.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER and st.TUBESTATUS=0 ) then 'PartRecv'
|
||||
when exists (select 1 from TESTS T where T.REQUESTID=r.REQUESTID and T.RESTYPE IN (null,'0') ) then 'Inc'
|
||||
--when exists (select 1 from TESTS T where T.REQUESTID=r.REQUESTID and T.RESTYPE IN (null,'0') and T.TESTID='1805' ) then 'Inc'
|
||||
else 'Comp'
|
||||
end
|
||||
-- inc
|
||||
when exists (select 1 from TESTS T where T.RESTYPE not in (0,4) and T.REQUESTID=r.REQUESTID ) then
|
||||
case
|
||||
when exists ( select 1 from cmod.dbo.CM_TUBES T where T.ACCESSNUMBER=sr.SP_ACCESSNUMBER and T.COLLSTATUS=0 ) then 'PartColl'
|
||||
when exists (select 1 from SP_TUBES st where st.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER and st.TUBESTATUS=0 ) then 'PartRecv'
|
||||
else 'Inc'
|
||||
end
|
||||
--rcv
|
||||
when not exists (select 1 from SP_TUBES st where st.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER and st.TUBESTATUS=0 ) then
|
||||
case
|
||||
when exists (select 1 from cmod.dbo.CM_TUBES T where T.ACCESSNUMBER=sr.SP_ACCESSNUMBER and T.COLLSTATUS=0 ) then 'PartColl'
|
||||
else 'Recv'
|
||||
end
|
||||
--coll
|
||||
when exists (select 1 FROM cmod.dbo.CM_TUBES T where T.ACCESSNUMBER=sr.SP_ACCESSNUMBER ) then
|
||||
case
|
||||
when exists (select 1 from SP_TUBES st where st.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER and st.TUBESTATUS=4 ) then 'PartRecv'
|
||||
when not exists (select 1 from cmod.dbo.CM_TUBES T where T.ACCESSNUMBER=sr.SP_ACCESSNUMBER and T.COLLSTATUS=0 ) then 'Coll'
|
||||
when exists (select 1 from cmod.dbo.CM_TUBES T where T.ACCESSNUMBER=sr.SP_ACCESSNUMBER and T.COLLSTATUS=1 ) then 'PartColl'
|
||||
else 'Pend'
|
||||
end
|
||||
else 'Pend'
|
||||
end STATS
|
||||
from SP_REQUESTS sr
|
||||
left join PATIENTS p on p.PATID=sr.PATID
|
||||
left join REQUESTS r on r.ACCESSNUMBER=sr.SP_ACCESSNUMBER
|
||||
where sr.COLLECTIONDATE between '$date1 00:00' and '$date2 23:59'"
|
||||
.$filter_query.
|
||||
"order by sr.COLLECTIONDATE desc";
|
||||
$query = $db->query($sql);
|
||||
$results = $query->getResultArray();
|
||||
$data['data'] = $results;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<?= $this->section('content') ?>
|
||||
|
||||
<style>
|
||||
#myTable {
|
||||
.pointercol {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
@ -107,7 +107,8 @@ function index() {
|
||||
$("#table-body").html("");
|
||||
var data = response['data'];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
colldate = data[i].COLLECTIONDATE.substr(0,16);
|
||||
colldate = data[i].COLLECTIONDATE.slice(0,10);
|
||||
colltime = data[i].COLLECTIONDATE.slice(10,16);
|
||||
|
||||
if (data[i].PATNUMBER != null) {
|
||||
patnumber = data[i].PATNUMBER.substr(-16,16);
|
||||
@ -154,9 +155,9 @@ function index() {
|
||||
datafilter = "data-filterrow='7'";
|
||||
stattext = 'Validated';
|
||||
}
|
||||
let datarow = "<tr onclick='viewAccess("+accessnumber+")' class='align-middle main_table'" + datafilter +" >" +
|
||||
"<td class='text-start'>" + colldate + '</td> <td>' + patnumber + '</td> <td>' + patname + "</td> <td class='text-start'>" + accessnumber + '</td> <td>' + hon + '</td> <td>' + tests + '</td>' +
|
||||
"<td role='button' class='"+bgcolor+" text-center align-middle'>"+stattext+"</td>" +
|
||||
let datarow = "<tr class='align-middle'" + datafilter +" >" +
|
||||
"<td class='text-start'>" + colldate + '<br>'+ colltime +'</td> <td>' + patnumber + '</td> <td>' + patname.trim() + "</td> <td class='text-start'>" + accessnumber + '</td> <td>' + hon + '</td> <td>' + tests + '</td>' +
|
||||
"<td role='button' class='"+bgcolor+" text-center align-middle pointercol' onclick='viewAccess("+accessnumber+")'>"+stattext+"</td>" +
|
||||
"<td role='button' class='text-center align-middle' onclick='resultPdfAccess("+accessnumber+ ",event" +")'> <h4 class='p-0 m-0'><i class='bi bi-filetype-pdf'></i></h4> </td>" +'</tr>';
|
||||
$("#table-body").append(datarow);
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<?= $this->section('content') ?>
|
||||
|
||||
<style>
|
||||
#myTable {
|
||||
.pointercol {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
@ -107,7 +107,8 @@ function index() {
|
||||
$("#table-body").html("");
|
||||
var data = response['data'];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
colldate = data[i].COLLECTIONDATE.substr(0,16);
|
||||
colldate = data[i].COLLECTIONDATE.slice(0,10);
|
||||
colltime = data[i].COLLECTIONDATE.slice(10,16);
|
||||
|
||||
if (data[i].PATNUMBER != null) {
|
||||
patnumber = data[i].PATNUMBER.substr(-16,16);
|
||||
@ -154,9 +155,9 @@ function index() {
|
||||
datafilter = "data-filterrow='7'";
|
||||
stattext = 'Validated';
|
||||
}
|
||||
let datarow = "<tr onclick='viewAccess("+accessnumber+")' class='align-middle main_table'" + datafilter +" >" +
|
||||
"<td class='text-start'>" + colldate + '</td> <td>' + patnumber + '</td> <td>' + patname + "</td> <td class='text-start'>" + accessnumber + '</td> <td>' + hon + '</td> <td>' + tests + '</td>' +
|
||||
"<td role='button' class='"+bgcolor+" text-center align-middle'>"+stattext+"</td>" +
|
||||
let datarow = "<tr class='align-middle'" + datafilter +" >" +
|
||||
"<td class='text-start'>" + colldate + '<br>'+ colltime +'</td> <td>' + patnumber + '</td> <td>' + patname.trim() + "</td> <td class='text-start'>" + accessnumber + '</td> <td>' + hon + '</td> <td>' + tests + '</td>' +
|
||||
"<td role='button' class='"+bgcolor+" text-center align-middle pointercol' onclick='viewAccess("+accessnumber+")'>"+stattext+"</td>" +
|
||||
"<td role='button' class='text-center align-middle' onclick='resultPdfAccess("+accessnumber+ ",event" +")'> <h4 class='p-0 m-0'><i class='bi bi-filetype-pdf'></i></h4> </td>" +'</tr>';
|
||||
$("#table-body").append(datarow);
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<?= $this->section('content') ?>
|
||||
|
||||
<style>
|
||||
#myTable {
|
||||
.pointercol {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
@ -107,7 +107,8 @@ function index() {
|
||||
$("#table-body").html("");
|
||||
var data = response['data'];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
colldate = data[i].COLLECTIONDATE.substr(0,16);
|
||||
colldate = data[i].COLLECTIONDATE.slice(0,10);
|
||||
colltime = data[i].COLLECTIONDATE.slice(10,16);
|
||||
|
||||
if (data[i].PATNUMBER != null) {
|
||||
patnumber = data[i].PATNUMBER.substr(-16,16);
|
||||
@ -154,9 +155,9 @@ function index() {
|
||||
datafilter = "data-filterrow='7'";
|
||||
stattext = 'Validated';
|
||||
}
|
||||
let datarow = "<tr onclick='viewAccess("+accessnumber+")' class='align-middle main_table'" + datafilter +" >" +
|
||||
"<td class='text-start'>" + colldate + '</td> <td>' + patnumber + '</td> <td>' + patname + "</td> <td class='text-start'>" + accessnumber + '</td> <td>' + hon + '</td> <td>' + tests + '</td>' +
|
||||
"<td role='button' class='"+bgcolor+" text-center align-middle'>"+stattext+"</td>" +
|
||||
let datarow = "<tr class='align-middle'" + datafilter +" >" +
|
||||
"<td class='text-start'>" + colldate + '<br>'+ colltime +'</td> <td>' + patnumber + '</td> <td>' + patname.trim() + "</td> <td class='text-start'>" + accessnumber + '</td> <td>' + hon + '</td> <td>' + tests + '</td>' +
|
||||
"<td role='button' class='"+bgcolor+" text-center align-middle pointercol' onclick='viewAccess("+accessnumber+")'>"+stattext+"</td>" +
|
||||
"<td role='button' class='text-center align-middle' onclick='resultPdfAccess("+accessnumber+ ",event" +")'> <h4 class='p-0 m-0'><i class='bi bi-filetype-pdf'></i></h4> </td>" +'</tr>';
|
||||
$("#table-body").append(datarow);
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<?= $this->section('content') ?>
|
||||
|
||||
<style>
|
||||
#myTable {
|
||||
.pointercol {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
@ -107,7 +107,8 @@ function index() {
|
||||
$("#table-body").html("");
|
||||
var data = response['data'];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
colldate = data[i].COLLECTIONDATE.substr(0,16);
|
||||
colldate = data[i].COLLECTIONDATE.slice(0,10);
|
||||
colltime = data[i].COLLECTIONDATE.slice(10,16);
|
||||
|
||||
if (data[i].PATNUMBER != null) {
|
||||
patnumber = data[i].PATNUMBER.substr(-16,16);
|
||||
@ -154,9 +155,9 @@ function index() {
|
||||
datafilter = "data-filterrow='7'";
|
||||
stattext = 'Validated';
|
||||
}
|
||||
let datarow = "<tr onclick='viewAccess("+accessnumber+")' class='align-middle main_table'" + datafilter +" >" +
|
||||
"<td class='text-start'>" + colldate + '</td> <td>' + patnumber + '</td> <td>' + patname + "</td> <td class='text-start'>" + accessnumber + '</td> <td>' + hon + '</td> <td>' + tests + '</td>' +
|
||||
"<td role='button' class='"+bgcolor+" text-center align-middle'>"+stattext+"</td>" +
|
||||
let datarow = "<tr class='align-middle'" + datafilter +" >" +
|
||||
"<td class='text-start'>" + colldate + '<br>'+ colltime +'</td> <td>' + patnumber + '</td> <td>' + patname.trim() + "</td> <td class='text-start'>" + accessnumber + '</td> <td>' + hon + '</td> <td>' + tests + '</td>' +
|
||||
"<td role='button' class='"+bgcolor+" text-center align-middle pointercol' onclick='viewAccess("+accessnumber+")'>"+stattext+"</td>" +
|
||||
"<td role='button' class='text-center align-middle' onclick='resultPdfAccess("+accessnumber+ ",event" +")'> <h4 class='p-0 m-0'><i class='bi bi-filetype-pdf'></i></h4> </td>" +'</tr>';
|
||||
$("#table-body").append(datarow);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user