Batch 6a: application controllers base
This commit is contained in:
434
application/controllers/process/Amr_limit.php
Normal file
434
application/controllers/process/Amr_limit.php
Normal file
@@ -0,0 +1,434 @@
|
||||
<?php
|
||||
class Amr_limit extends MY_Controller
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
function corss()
|
||||
{
|
||||
global $_SERVER;
|
||||
if (isset($_SERVER["HTTP_ORIGIN"])) {
|
||||
header("Access-Control-Allow-Origin: " . $_SERVER["HTTP_ORIGIN"]);
|
||||
} else {
|
||||
header("Access-Control-Allow-Origin: */*");
|
||||
}
|
||||
header("Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS");
|
||||
header(
|
||||
"Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization"
|
||||
);
|
||||
if (
|
||||
isset($_SERVER["REQUEST_METHOD"]) &&
|
||||
$_SERVER["REQUEST_METHOD"] == "OPTIONS"
|
||||
) {
|
||||
http_response_code(200);
|
||||
echo json_encode("OK");
|
||||
exit();
|
||||
}
|
||||
}
|
||||
function update()
|
||||
{
|
||||
$this->corss();
|
||||
$userID = $this->sys_user["M_UserID"];
|
||||
if (!($userID > 0)) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" => "Invalid Token, please re-login",
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
$cvID = $this->sys_input["criticalValueID"];
|
||||
$reportedTo = $this->sys_input["reportedTo"];
|
||||
$adviseNote = $this->sys_input["adviseNote"];
|
||||
$sql = "select * from critical_value where criticalValueID=?";
|
||||
$qry = $this->db->query($sql, [$cvID]);
|
||||
if (!$qry) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" => $this->db->error()["message"],
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
if (count($rows) > 0 && $rows[0]["CriticalValueReportedTo"] != "") {
|
||||
// update advise
|
||||
$sql = "update critical_value set CriticalValueAdvisedNote =? , CriticalValueAdvicedM_UserID= ?,
|
||||
CriticalValueIsAdvised = 'Y',
|
||||
CriticalValueAdvisedDate = now() where CriticalValueID = ?";
|
||||
$qry = $this->db->query($sql, [$adviseNote, $userID, $cvID]);
|
||||
if (!$qry) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" => $this->db->error()["message"],
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
} else {
|
||||
if ($reportedTo != "") {
|
||||
$sql = "update critical_value set CriticalValueReportedTo=? , CriticalValueReportedM_UserID= ?,
|
||||
CriticalValueIsReported = 'Y',
|
||||
CriticalValueReportedDate= now() where CriticalValueID = ?";
|
||||
$qry = $this->db->query($sql, [$reportedTo, $userID, $cvID]);
|
||||
if (!$qry) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" => $this->db->error()["message"],
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
echo json_encode(["status" => "OK", "message" => "data updated"]);
|
||||
}
|
||||
function auto_get()
|
||||
{
|
||||
$sql = "select T_OrderHeaderID, T_OrderHeaderDate, T_OrderHeaderLabNumber,
|
||||
fn_get_patient_atribute(T_OrderHeaderM_PatientID) patient,
|
||||
T_TestName,critical_value.*
|
||||
from critical_value
|
||||
join t_orderdetail on
|
||||
CriticalValueIsActive='Y'
|
||||
and (
|
||||
CriticalValueIsReported = 'N'
|
||||
or
|
||||
CriticalValueIsAdvised = 'N'
|
||||
)
|
||||
and CriticalValueT_OrderDetailID = T_OrderDetailID
|
||||
and CriticalValueCreated + interval 10 day > now()
|
||||
join t_test on T_OrderDetailT_TestID = T_TestID
|
||||
join t_orderheader on CriticalValueT_OrderHeaderID = T_OrderHeaderID
|
||||
order by T_OrderDetailT_TestSasCode,CriticalValueCreated desc
|
||||
limit 0,10";
|
||||
$qry = $this->db->query($sql);
|
||||
if (!$qry) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" =>
|
||||
$this->db->error()["message"] .
|
||||
"|\n" .
|
||||
$this->db->last_query(),
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
$result = [];
|
||||
foreach ($rows as $r) {
|
||||
$id = $r["T_OrderHeaderID"];
|
||||
$j_pat = json_decode($r["patient"], true);
|
||||
$pat_name = $j_pat["patient_fullname"];
|
||||
if (
|
||||
$r["CriticalValueIsAdvised"] == "Y" &&
|
||||
$r["CriticalValueIsReported"] == "Y"
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (!isset($result[$id])) {
|
||||
$result[$id] = [
|
||||
"labNo" => $r["T_OrderHeaderLabNumber"],
|
||||
"date" => $r["T_OrderHeaderDate"],
|
||||
"patient" => $pat_name,
|
||||
"test" => [],
|
||||
];
|
||||
}
|
||||
$result[$id]["test"][] = [
|
||||
"px" => $r["T_TestName"],
|
||||
"note" => $r["CriticalValueDescription"],
|
||||
"IsReported" => $r["CriticalValueIsReported"],
|
||||
"IsAdvised" => $r["CriticalValueIsAdvised"],
|
||||
];
|
||||
}
|
||||
$xresult = [];
|
||||
foreach ($result as $v) {
|
||||
$xresult[] = $v;
|
||||
}
|
||||
echo json_encode(["status" => "OK", "data" => $xresult]);
|
||||
}
|
||||
function auto_update()
|
||||
{
|
||||
$s_headerID = "";
|
||||
$s_detailID = "";
|
||||
foreach ($this->sys_input["cv"] as $r) {
|
||||
if ($s_headerID != "") {
|
||||
$s_headerID .= ",";
|
||||
}
|
||||
$s_headerID .= $r["headerID"];
|
||||
foreach ($r["details"] as $d) {
|
||||
if ($s_detailID != "") {
|
||||
$s_detailID .= ",";
|
||||
}
|
||||
$s_detailID .= $d;
|
||||
}
|
||||
}
|
||||
if ($s_headerID == "" || $s_detailID == "") {
|
||||
echo json_encode(["status" => "OK", "haveUpdate" => "N"]);
|
||||
exit();
|
||||
}
|
||||
$sql = "select
|
||||
T_OrderDetailID, T_TestName, min(NatMultiruleExtraLow) ExtraLow, max(NatMultiruleExtraHigh) ExtraHigh,
|
||||
T_OrderDetailResult, T_OrderDetailT_OrderHeaderID
|
||||
from t_orderdetail
|
||||
join t_test on T_OrderDetailID in ( $s_detailID )
|
||||
and T_OrderDetailIsActive = 'Y'
|
||||
and T_OrderDetailT_TestID = T_TestID
|
||||
and T_TestIsResult = 'Y'
|
||||
and T_TestIsQuantitative='Y'
|
||||
and T_OrderDetailResult <> ''
|
||||
and T_OrderDetailID not in (
|
||||
select CriticalValueT_OrderDetailID
|
||||
from critical_value
|
||||
where CriticalValueT_OrderHeaderID in ( $s_headerID )
|
||||
)
|
||||
join nat_multirule on T_TestNat_TestID = NatMultiruleNat_TestID
|
||||
group by T_OrderDetailID";
|
||||
$this->corss();
|
||||
$qry = $this->db->query($sql);
|
||||
if (!$qry) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" =>
|
||||
$this->db->error()["message"] .
|
||||
"|\n" .
|
||||
$this->db->last_query(),
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
foreach ($rows as $idx => $r) {
|
||||
$status = "X";
|
||||
if ($r["T_OrderDetailResult"] == "") {
|
||||
$rows[$idx]["status"] = "X";
|
||||
$rows[$idx]["note"] = "Result Empty";
|
||||
continue;
|
||||
}
|
||||
if (!is_numeric($r["T_OrderDetailResult"])) {
|
||||
$rows[$idx]["status"] = "X";
|
||||
$rows[$idx]["note"] = "Result Not Numeric";
|
||||
continue;
|
||||
}
|
||||
if (
|
||||
is_numeric($r["ExtraLow"]) &&
|
||||
floatval($r["ExtraLow"]) > floatval($r["T_OrderDetailResult"])
|
||||
) {
|
||||
$rows[$idx]["status"] = "N";
|
||||
$rows[$idx][
|
||||
"note"
|
||||
] = "Result {$r["T_OrderDetailResult"]} < Extra Low {$r["ExtraLow"]}";
|
||||
continue;
|
||||
}
|
||||
if (
|
||||
is_numeric($r["ExtraHigh"]) &&
|
||||
floatval($r["ExtraHigh"]) < floatval($r["T_OrderDetailResult"])
|
||||
) {
|
||||
$rows[$idx]["status"] = "N";
|
||||
$rows[$idx][
|
||||
"note"
|
||||
] = "Result {$r["T_OrderDetailResult"]} > Extra High {$r["ExtraHigh"]}";
|
||||
continue;
|
||||
}
|
||||
$rows[$idx]["status"] = "Y";
|
||||
$status = "";
|
||||
if (is_numeric($r["ExtraLow"]) && is_numeric($r["ExtraHigh"])) {
|
||||
$rows[$idx][
|
||||
"note"
|
||||
] = "Result dalama range ExtraLow {$r["ExtraLow"]} - Extra High {$r["ExtraHigh"]}";
|
||||
continue;
|
||||
}
|
||||
if (!is_numeric($r["ExtraLow"])) {
|
||||
$status .= $r["ExtraLow"] . " ExtraLow not numeric ";
|
||||
}
|
||||
if (!is_numeric($r["ExtraHigh"])) {
|
||||
$status .= $r["ExtraHigh"] . " ExtraHigh not numeric ";
|
||||
}
|
||||
$rows[$idx]["note"] = $status;
|
||||
}
|
||||
$result = array_filter($rows, function ($r) {
|
||||
return $r["status"] == "N";
|
||||
});
|
||||
$sql = "insert into critical_value(CriticalValueT_OrderHeaderID,CriticalValueT_OrderDetailID,CriticalValueDescription)
|
||||
values(?,?,?)
|
||||
on duplicate key update
|
||||
CriticalValueID = CriticalValueID
|
||||
";
|
||||
$this->db->trans_begin();
|
||||
$updateID = [];
|
||||
foreach ($result as $r) {
|
||||
$qry = $this->db->query($sql, [
|
||||
$r["T_OrderDetailT_OrderHeaderID"],
|
||||
$r["T_OrderDetailID"],
|
||||
$r["note"],
|
||||
]);
|
||||
if (!$qry) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" =>
|
||||
$this->db->error()["message"] .
|
||||
"|\n" .
|
||||
$this->db->last_query(),
|
||||
]);
|
||||
$this->db->trans_rollback();
|
||||
exit();
|
||||
}
|
||||
$updateID[] = $this->db->insert_id();
|
||||
}
|
||||
$this->db->trans_commit();
|
||||
echo json_encode(["status" => "OK", "haveUpdate" => "Y"]);
|
||||
}
|
||||
function get($orderHeaderID)
|
||||
{
|
||||
$sql = "select
|
||||
T_OrderDetailID, T_TestName, min(NatMultiruleExtraLow) ExtraLow, max(NatMultiruleExtraHigh) ExtraHigh,
|
||||
T_OrderDetailResult
|
||||
from t_orderdetail
|
||||
join t_test on T_OrderDetailT_OrderHeaderID = ?
|
||||
and T_OrderDetailIsActive = 'Y'
|
||||
and T_OrderDetailT_TestID = T_TestID
|
||||
and T_TestIsResult = 'Y'
|
||||
and T_TestIsQuantitative='Y'
|
||||
and T_OrderDetailResult <> ''
|
||||
and T_OrderDetailID not in (
|
||||
select CriticalValueT_OrderDetailID
|
||||
from critical_value
|
||||
where CriticalValueT_OrderHeaderID = ?
|
||||
)
|
||||
join nat_multirule on T_TestNat_TestID = NatMultiruleNat_TestID
|
||||
group by T_OrderDetailID";
|
||||
$this->corss();
|
||||
$qry = $this->db->query($sql, [$orderHeaderID, $orderHeaderID]);
|
||||
if (!$qry) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" =>
|
||||
$this->db->error()["message"] .
|
||||
"|\n" .
|
||||
$this->db->last_query(),
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
foreach ($rows as $idx => $r) {
|
||||
$status = "X";
|
||||
if ($r["T_OrderDetailResult"] == "") {
|
||||
$rows[$idx]["status"] = "X";
|
||||
$rows[$idx]["note"] = "Result Empty";
|
||||
continue;
|
||||
}
|
||||
if (!is_numeric($r["T_OrderDetailResult"])) {
|
||||
$rows[$idx]["status"] = "X";
|
||||
$rows[$idx]["note"] = "Result Not Numeric";
|
||||
continue;
|
||||
}
|
||||
if (
|
||||
is_numeric($r["ExtraLow"]) &&
|
||||
floatval($r["ExtraLow"]) > floatval($r["T_OrderDetailResult"])
|
||||
) {
|
||||
$rows[$idx]["status"] = "N";
|
||||
$rows[$idx][
|
||||
"note"
|
||||
] = "Result {$r["T_OrderDetailResult"]} < Extra Low {$r["ExtraLow"]}";
|
||||
continue;
|
||||
}
|
||||
if (
|
||||
is_numeric($r["ExtraHigh"]) &&
|
||||
floatval($r["ExtraHigh"]) < floatval($r["T_OrderDetailResult"])
|
||||
) {
|
||||
$rows[$idx]["status"] = "N";
|
||||
$rows[$idx][
|
||||
"note"
|
||||
] = "Result {$r["T_OrderDetailResult"]} > Extra High {$r["ExtraHigh"]}";
|
||||
continue;
|
||||
}
|
||||
$rows[$idx]["status"] = "Y";
|
||||
$status = "";
|
||||
if (is_numeric($r["ExtraLow"]) && is_numeric($r["ExtraHigh"])) {
|
||||
$rows[$idx][
|
||||
"note"
|
||||
] = "Result dalama range ExtraLow {$r["ExtraLow"]} - Extra High {$r["ExtraHigh"]}";
|
||||
continue;
|
||||
}
|
||||
if (!is_numeric($r["ExtraLow"])) {
|
||||
$status .= $r["ExtraLow"] . " ExtraLow not numeric ";
|
||||
}
|
||||
if (!is_numeric($r["ExtraHigh"])) {
|
||||
$status .= $r["ExtraHigh"] . " ExtraHigh not numeric ";
|
||||
}
|
||||
$rows[$idx]["note"] = $status;
|
||||
}
|
||||
$result = array_filter($rows, function ($r) {
|
||||
return $r["status"] == "N";
|
||||
});
|
||||
$sql = "insert into critical_value(CriticalValueT_OrderHeaderID,CriticalValueT_OrderDetailID,CriticalValueDescription)
|
||||
values(?,?,?)
|
||||
on duplicate key update
|
||||
CriticalValueID = CriticalValueID
|
||||
";
|
||||
$this->db->trans_begin();
|
||||
foreach ($result as $r) {
|
||||
$qry = $this->db->query($sql, [
|
||||
$orderHeaderID,
|
||||
$r["T_OrderDetailID"],
|
||||
$r["note"],
|
||||
]);
|
||||
if (!$qry) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" =>
|
||||
$this->db->error()["message"] .
|
||||
"|\n" .
|
||||
$this->db->last_query(),
|
||||
]);
|
||||
$this->db->trans_rollback();
|
||||
exit();
|
||||
}
|
||||
}
|
||||
$this->db->trans_commit();
|
||||
$sql = "select T_TestName,critical_value.*,
|
||||
M_UserUserName ReportUserName
|
||||
from critical_value
|
||||
join t_orderdetail on
|
||||
CriticalValueT_OrderHeaderID =? and CriticalValueIsActive='Y'
|
||||
and CriticalValueT_OrderDetailID = T_OrderDetailID
|
||||
join t_test on T_OrderDetailT_TestID = T_TestID
|
||||
left join m_user on CriticalValueReportedM_UserID = M_UserID";
|
||||
|
||||
$qry = $this->db->query($sql, [$orderHeaderID]);
|
||||
if (!$qry) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" =>
|
||||
$this->db->error()["message"] .
|
||||
"|\n" .
|
||||
$this->db->last_query(),
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
echo json_encode(["status" => "OK", "data" => $rows]);
|
||||
}
|
||||
}
|
||||
/*
|
||||
drop table if exists critical_value;
|
||||
create table critical_value(
|
||||
CriticalValueID int not null auto_increment primary key,
|
||||
CriticalValueT_OrderHeaderID int,
|
||||
CriticalValueT_OrderDetailID int,
|
||||
CriticalValueDescription text,
|
||||
CriticalValueCreated datetime default current_timestamp(),
|
||||
CriticalValueIsReported varchar(1) default 'N',
|
||||
CriticalValueReportedM_UserID int,
|
||||
CriticalValueReportedDate datetime,
|
||||
CriticalValueReportedTo varchar(50),
|
||||
CriticalValueIsAdvised varchar(1) default 'N',
|
||||
CriticalValueAdvisedDate datetime,
|
||||
CriticalValueAdvisedBy varchar(50),
|
||||
CriticalValueAdvisedNote varchar(100),
|
||||
CriticalValueAdvicedM_UserID int,
|
||||
CriticalValueIsActive varchar(1) default 'Y',
|
||||
key (CriticalValueIsActive),
|
||||
key (CriticalValueT_OrderHeaderID),
|
||||
key (CriticalValueT_OrderDetailID),
|
||||
key (CriticalValueAdvicedM_UserID),
|
||||
key (CriticalValueReportedM_UserID),
|
||||
unique(CriticalValueT_OrderDetailID,CriticalValueIsActive)
|
||||
);
|
||||
*/
|
||||
?>
|
||||
2693
application/controllers/process/Auto_valid.php
Normal file
2693
application/controllers/process/Auto_valid.php
Normal file
File diff suppressed because it is too large
Load Diff
1121
application/controllers/process/Auto_verif.php
Normal file
1121
application/controllers/process/Auto_verif.php
Normal file
File diff suppressed because it is too large
Load Diff
495
application/controllers/process/Auto_verif_valid.php
Normal file
495
application/controllers/process/Auto_verif_valid.php
Normal file
@@ -0,0 +1,495 @@
|
||||
<?php
|
||||
class Auto_verif_valid extends MY_Controller
|
||||
{
|
||||
function cors()
|
||||
{
|
||||
global $_SERVER;
|
||||
if (isset($_SERVER["HTTP_ORIGIN"])) {
|
||||
header("Access-Control-Allow-Origin: " . $_SERVER["HTTP_ORIGIN"]);
|
||||
} else {
|
||||
header("Access-Control-Allow-Origin: */*");
|
||||
}
|
||||
header("Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS");
|
||||
header(
|
||||
"Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization"
|
||||
);
|
||||
if (
|
||||
isset($_SERVER["REQUEST_METHOD"]) &&
|
||||
$_SERVER["REQUEST_METHOD"] == "OPTIONS"
|
||||
) {
|
||||
http_response_code(200);
|
||||
echo json_encode("OK");
|
||||
exit();
|
||||
}
|
||||
}
|
||||
function extract_image($inp, $debug = "")
|
||||
{
|
||||
$mapimg = file_get_contents("http://localhost" . $inp);
|
||||
if ($debug != "") {
|
||||
echo "<br/>";
|
||||
echo $mapimg;
|
||||
}
|
||||
if (strpos($mapimg, "<img src=\"") > -1) {
|
||||
$mapimg = substr($mapimg, strpos($mapimg, "<img src=\"") + 10);
|
||||
$mapimg = substr($mapimg, 0, strpos($mapimg, "\""));
|
||||
$mapimg = "/charts/" . htmlspecialchars_decode($mapimg);
|
||||
return $mapimg;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
function info_valid($detailID)
|
||||
{
|
||||
$this->cors();
|
||||
|
||||
$sql = "select auto_valid_v2.*, autoVerifImage
|
||||
from auto_valid_v2
|
||||
join auto_verif_v2 on AutoValidT_OrderDetailID = AutoVerifT_OrderDetailID
|
||||
and AutoValidT_OrderDetailID = ?";
|
||||
$qry = $this->db->query($sql, [$detailID]);
|
||||
|
||||
if (!$qry) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" => $this->db->error()["message"],
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
if (count($rows) > 0) {
|
||||
//AutoValid V2
|
||||
$r = $rows[0];
|
||||
$note = $this->print_table_style();
|
||||
$xrows = [];
|
||||
$isStatusOk = true;
|
||||
if ($r["AutoValidAutoVerifIsOK"] == "Y") {
|
||||
$xrows[] = "Auto Verif terpenuhi. <i>" . "</i>";
|
||||
} else {
|
||||
$xrows[] = "Auto Verif tidak terpenuhi. <i>" . "</i>";
|
||||
$isStatusOk = $isStatusOk && false;
|
||||
}
|
||||
if ($isStatusOk) {
|
||||
if ($r["AutoValidIsInReviewRange"] == "Y") {
|
||||
$xrows[] =
|
||||
"Masuk dalam review range. <i>" .
|
||||
$r["AutoValidInReviewRangeNote"] .
|
||||
"</i>";
|
||||
$isStatusOk = $isStatusOk && false;
|
||||
} else {
|
||||
$xrows[] =
|
||||
"Tidak masuk dalam review range. <i>" .
|
||||
$r["AutoValidInReviewRangeNote"] .
|
||||
"</i>";
|
||||
}
|
||||
}
|
||||
if ($isStatusOk) {
|
||||
if ($r["AutoValidIsInconsistencyOK"] == "N") {
|
||||
$xrows[] =
|
||||
"Inkonsistensi rule tidak terpenuhi. <i>" .
|
||||
$r["AutoValidInconsistencyNote"] .
|
||||
"</i>";
|
||||
$isStatusOk = $isStatusOk && false;
|
||||
} else {
|
||||
$xrows[] =
|
||||
"Inkonsistensi rule terpenuhi. <i>" .
|
||||
$r["AutoValidInconsistencyNote"] .
|
||||
"</i>";
|
||||
}
|
||||
}
|
||||
if ($isStatusOk) {
|
||||
if ($r["AutoValidIsDeltacheckOK"] == "N") {
|
||||
$xrows[] =
|
||||
"Delta check tidak terpenuhi. <i>" .
|
||||
$r["AutoValidDeltaCheckNote"] .
|
||||
"</i>";
|
||||
$isStatusOk = $isStatusOk && false;
|
||||
} else {
|
||||
$xrows[] =
|
||||
"Delta check terpenuhi. <i>" .
|
||||
$r["AutoValidDeltaCheckNote"] .
|
||||
"</i>";
|
||||
}
|
||||
}
|
||||
if ($isStatusOk) {
|
||||
if ($r["AutoValidReflexTestIsOK"] == "N") {
|
||||
$xrows[] =
|
||||
"Reflex Test tidak terpenuhi. <i>" .
|
||||
$r["AutoValidReflexTestNote"] .
|
||||
"</i>";
|
||||
$isStatusOk = $isStatusOk && false;
|
||||
} else {
|
||||
$xrows[] =
|
||||
"Reflex Test terpenuhi. <i>" .
|
||||
str_ireplace(
|
||||
"|",
|
||||
"<br/>",
|
||||
$r["AutoValidReflexTestNote"]
|
||||
) .
|
||||
"</i>";
|
||||
}
|
||||
}
|
||||
$note = $this->print_table_style();
|
||||
$note .= $this->print_table_one_column($xrows);
|
||||
if (false) {
|
||||
echo "Img : " . $r["autoVerifImage"];
|
||||
echo "<br/><br/>extract : " .
|
||||
$this->extract_image($r["autoVerifImage"], "1");
|
||||
}
|
||||
echo json_encode([
|
||||
"status" => "OK",
|
||||
"note" => $note, //$r["AutoVerifDeltaCheckNote"],
|
||||
"raw_image" => $r["autoVerifImage"],
|
||||
"image" => $this->extract_image($r["autoVerifImage"]),
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
$sql = "select auto_valid.*,
|
||||
AutoVerifTrendAnalysisImage
|
||||
from auto_valid
|
||||
join auto_verif on AutoValidT_OrderDetailID =?
|
||||
and AutoValidT_OrderDetailID = AutoVerifT_OrderDetailID";
|
||||
$qry = $this->db->query($sql, [$detailID]);
|
||||
if (!$qry) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" => $this->db->error()["message"],
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
if (count($rows) == 0) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" => "Informasi Auto Valid tidak ada",
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
$r = $rows[0];
|
||||
echo json_encode([
|
||||
"status" => "OK",
|
||||
"note" => $r["AutoValidNote"],
|
||||
"raw_image" => $r["AutoVerifTrendAnalysisImage"],
|
||||
"image" => $this->extract_image($r["AutoVerifTrendAnalysisImage"]),
|
||||
]);
|
||||
}
|
||||
function info_verif($detailID, $debug = "")
|
||||
{
|
||||
$this->cors();
|
||||
|
||||
$sql = "select * from auto_verif_v2 where AutoVerifT_OrderDetailID = ?";
|
||||
$qry = $this->db->query($sql, [$detailID]);
|
||||
|
||||
if (!$qry) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" => $this->db->error()["message"],
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
if (count($rows) > 0) {
|
||||
//AutoVerif V2
|
||||
$r = $rows[0];
|
||||
$note = $this->print_table_style();
|
||||
$xrows = [];
|
||||
$isStatusOk = true;
|
||||
if ($r["autoVerifIsPanicValue"] == "Y") {
|
||||
$xrows[] =
|
||||
"Ada Panic Value. <i>" .
|
||||
$r["autoVerifPanicValueNote"] .
|
||||
"</i>";
|
||||
$isStatusOk = $isStatusOk && false;
|
||||
} else {
|
||||
$xrows[] =
|
||||
"Tidak ada Panic Value. <i>" .
|
||||
$r["autoVerifPanicValueNote"] .
|
||||
"</i>";
|
||||
}
|
||||
if ($isStatusOk) {
|
||||
if ($r["autoVerifIsPreAnalityc"] == "Y") {
|
||||
$xrows[] =
|
||||
"Ada ketidaksesuaian. <i>" .
|
||||
$r["autoVerifPreAnalitycNote"] .
|
||||
"</i>";
|
||||
$isStatusOk = $isStatusOk && false;
|
||||
} else {
|
||||
$xrows[] =
|
||||
"Tidak ada ketidaksesuaian persyaratan preanalitik. <i>" .
|
||||
$r["autoVerifPreAnalitycNote"] .
|
||||
"</i>";
|
||||
}
|
||||
}
|
||||
if ($isStatusOk) {
|
||||
if ($r["autoVerifIsInAmr"] == "N") {
|
||||
$xrows[] =
|
||||
"Tidak masuk dalam range AMR. <i>" .
|
||||
$r["autoVerifAmrNote"] .
|
||||
"</i>";
|
||||
$isStatusOk = $isStatusOk && false;
|
||||
} else {
|
||||
$xrows[] =
|
||||
"Masuk dalam range AMR. <i>" .
|
||||
$r["autoVerifAmrNote"] .
|
||||
"</i>";
|
||||
}
|
||||
}
|
||||
if ($isStatusOk) {
|
||||
if ($r["autoVerifIsUjiTrendOK"] == "N") {
|
||||
$xrows[] =
|
||||
"Rata-rata harian tidak masuk dalam rentang AON. <i>" .
|
||||
$r["autoVerifUjiTrendNote"] .
|
||||
"</i>";
|
||||
$isStatusOk = $isStatusOk && false;
|
||||
} else {
|
||||
$xrows[] =
|
||||
"Rata-rata harian masuk dalam rentang AON. <i>" .
|
||||
$r["autoVerifUjiTrendNote"] .
|
||||
"</i>";
|
||||
}
|
||||
}
|
||||
$note = $this->print_table_style();
|
||||
$note .= $this->print_table_one_column($xrows);
|
||||
if ($debug != "") {
|
||||
echo "Img : " . $r["autoVerifImage"];
|
||||
echo "<br/><br/>extract : " .
|
||||
$this->extract_image($r["autoVerifImage"], "1");
|
||||
}
|
||||
echo json_encode([
|
||||
"status" => "OK",
|
||||
"note" => $note, //$r["AutoVerifDeltaCheckNote"],
|
||||
"raw_image" => $r["autoVerifImage"],
|
||||
"image" => $this->extract_image($r["autoVerifImage"]),
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
|
||||
$sql = "select * from auto_verif where AutoVerifT_OrderDetailID = ?";
|
||||
$qry = $this->db->query($sql, [$detailID]);
|
||||
if (!$qry) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" => $this->db->error()["message"],
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
if (count($rows) == 0) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" => "Informasi Auto Verif tidak ada",
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
$r = $rows[0];
|
||||
if ($debug != "") {
|
||||
print_r($r);
|
||||
}
|
||||
$note = "";
|
||||
if ($r["AutoVerifHaveReq"] == "Y") {
|
||||
$note =
|
||||
"<font color='brown'>*</font>) Ada Requirement checklist. <br/>";
|
||||
} else {
|
||||
$note =
|
||||
"<font color='brown'>*</font>) Tidak ada Requirement checklist. <br/>";
|
||||
}
|
||||
if ($r["AutoVerifReviewRangeIsOK"] != "Y") {
|
||||
if ($note != "") {
|
||||
$note .= "<br/>";
|
||||
}
|
||||
$note .=
|
||||
"<font color='brown'>*</font>) Review Range tidak terpenuhi. <br/>";
|
||||
} else {
|
||||
if ($note != "") {
|
||||
$note .= "<br/>";
|
||||
}
|
||||
$note .=
|
||||
"<font color='brown'>*</font>) Review Range terpenuhi. <br/>";
|
||||
}
|
||||
$note .= $r["AutoVerifTrendAnalysisNote"];
|
||||
echo json_encode([
|
||||
"status" => "OK",
|
||||
"note" => $note, //$r["AutoVerifDeltaCheckNote"],
|
||||
"raw_image" => $r["AutoVerifTrendAnalysisImage"],
|
||||
"image" => $this->extract_image($r["AutoVerifTrendAnalysisImage"]),
|
||||
]);
|
||||
}
|
||||
function status($orderHeaderID)
|
||||
{
|
||||
$this->cors();
|
||||
$sql = "select auto_verif_v2.* from auto_verif_v2
|
||||
join t_orderdetail on AutoVerifT_OrderDetailID = T_OrderDetailID
|
||||
and T_OrderDetailT_OrderHeaderID = ?";
|
||||
$qry = $this->db->query($sql, [$orderHeaderID]);
|
||||
if (!$qry) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" => $this->db->error()["message"],
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
$result = ["autoVerif" => [], "autoValid" => []];
|
||||
if (count($rows) > 0) {
|
||||
// auto Verif v2
|
||||
foreach ($rows as $r) {
|
||||
if (
|
||||
$r["autoVerifIsPanicValue"] == "N" &&
|
||||
$r["autoVerifIsPreAnalityc"] == "N" &&
|
||||
$r["autoVerifIsInAmr"] == "Y" &&
|
||||
$r["autoVerifIsUjiTrendOK"] == "Y"
|
||||
) {
|
||||
$result["autoVerif"][] = [
|
||||
"id" => $r["AutoVerifT_OrderDetailID"],
|
||||
"status" => true,
|
||||
];
|
||||
} else {
|
||||
$result["autoVerif"][] = [
|
||||
"id" => $r["AutoVerifT_OrderDetailID"],
|
||||
"status" => false,
|
||||
];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$sql = "select auto_verif.* from auto_verif
|
||||
join t_orderdetail on AutoVerifT_OrderDetailID = T_OrderDetailID
|
||||
and T_OrderDetailT_OrderHeaderID = ?";
|
||||
$qry = $this->db->query($sql, [$orderHeaderID]);
|
||||
if (!$qry) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" => $this->db->error()["message"],
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
foreach ($rows as $r) {
|
||||
if (
|
||||
$r["AutoVerifHaveReq"] == "N" &&
|
||||
//$r["AutoVerifDeltaCheckStatus"] == "Y" &&
|
||||
$r["AutoVerifReviewRangeIsOK"] == "Y" &&
|
||||
$r["AutoVerifTrendAnalysisStatus"] == "Y"
|
||||
) {
|
||||
$result["autoVerif"][] = [
|
||||
"id" => $r["AutoVerifT_OrderDetailID"],
|
||||
"status" => true,
|
||||
];
|
||||
} else {
|
||||
$result["autoVerif"][] = [
|
||||
"id" => $r["AutoVerifT_OrderDetailID"],
|
||||
"status" => false,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "select auto_valid_v2.* from auto_valid_v2
|
||||
join t_orderdetail on AutoValidT_OrderDetailID = T_OrderDetailID
|
||||
and T_OrderDetailT_OrderHeaderID = ?";
|
||||
$qry = $this->db->query($sql, [$orderHeaderID]);
|
||||
if (!$qry) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" => $this->db->error()["message"],
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
if (count($rows) > 0) {
|
||||
// auto valid v2
|
||||
foreach ($rows as $r) {
|
||||
if (
|
||||
$r["AutoValidAutoVerifIsOK"] == "Y" &&
|
||||
$r["AutoValidIsInReviewRange"] == "N" &&
|
||||
$r["AutoValidIsInconsistencyOK"] == "Y" &&
|
||||
$r["AutoValidReflexTestIsOK"] == "Y" &&
|
||||
$r["AutoValidIsDeltacheckOK"] == "Y"
|
||||
) {
|
||||
$result["autoValid"][] = [
|
||||
"id" => $r["AutoValidT_OrderDetailID"],
|
||||
"status" => true,
|
||||
];
|
||||
} else {
|
||||
$result["autoValid"][] = [
|
||||
"id" => $r["AutoValidT_OrderDetailID"],
|
||||
"status" => false,
|
||||
];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$sql = "select auto_valid.* from auto_valid
|
||||
join t_orderdetail on AutoValidT_OrderDetailID = T_OrderDetailID
|
||||
and T_OrderDetailT_OrderHeaderID = ?";
|
||||
$qry = $this->db->query($sql, [$orderHeaderID]);
|
||||
if (!$qry) {
|
||||
echo json_encode([
|
||||
"status" => "ERR",
|
||||
"message" => $this->db->error()["message"],
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
foreach ($rows as $r) {
|
||||
if (
|
||||
$r["AutoValidHaveReq"] == "N" &&
|
||||
$r["AutoValidIsOk"] == "Y"
|
||||
) {
|
||||
$result["autoValid"][] = [
|
||||
"id" => $r["AutoValidT_OrderDetailID"],
|
||||
"status" => true,
|
||||
];
|
||||
} else {
|
||||
$result["autoValid"][] = [
|
||||
"id" => $r["AutoValidT_OrderDetailID"],
|
||||
"status" => false,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
echo json_encode(["status" => "OK", "data" => $result]);
|
||||
}
|
||||
function print_table_style()
|
||||
{
|
||||
return "
|
||||
<style>
|
||||
th, td {
|
||||
padding: 15px;
|
||||
text-align: left;
|
||||
}
|
||||
tr:nth-child(even) {background-color: #f2f2f2;}
|
||||
table {
|
||||
border: solid 1px ;
|
||||
min-width:600px;
|
||||
margin-left:auto;
|
||||
margin-right:auto;
|
||||
}
|
||||
</style>
|
||||
";
|
||||
}
|
||||
public function print_table_one_column($rows)
|
||||
{
|
||||
$rst = "<table>";
|
||||
foreach ($rows as $r) {
|
||||
$rst .= "<tr>";
|
||||
$rst .= "<td>" . $r . "</td>";
|
||||
$rst .= "</tr>";
|
||||
}
|
||||
$rst .= "</table>";
|
||||
return $rst;
|
||||
}
|
||||
public function print_table($rows, $keys)
|
||||
{
|
||||
echo "<table>";
|
||||
echo "<tr>";
|
||||
foreach ($keys as $k) {
|
||||
echo "<td>$k</td>";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
foreach ($rows as $r) {
|
||||
echo "<tr>";
|
||||
foreach ($keys as $k) {
|
||||
echo "<td>" . $r[$k] . "</td>";
|
||||
}
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
}
|
||||
123
application/controllers/process/Check_valid.php
Normal file
123
application/controllers/process/Check_valid.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
class Check_valid extends MY_Controller
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
function do($nolab, $px)
|
||||
{
|
||||
$nolab = "%" . $nolab;
|
||||
$sql = "select T_OrderHeaderID,T_OrderHeaderLabNumber,T_OrderHeaderDate
|
||||
from t_orderheader where T_OrderHeaderLabNumber like ?";
|
||||
$qry = $this->db->query($sql, [$nolab]);
|
||||
if (!$qry) {
|
||||
echo "<h3> Error t_orderheader : " .
|
||||
$this->db->error()["message"] .
|
||||
"</h3>";
|
||||
exit();
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
if (count($rows) == 0) {
|
||||
echo "<h3> Order not found $nolab</h3>";
|
||||
exit();
|
||||
}
|
||||
$orderID = [];
|
||||
foreach ($rows as $idx => $r) {
|
||||
$orderID[] = $r["T_OrderHeaderID"];
|
||||
unset($rows[$idx]["T_OrderHeaderID"]);
|
||||
}
|
||||
$this->print_table_style();
|
||||
$this->print_table($rows, array_keys($rows[0]));
|
||||
$sids = implode(",", $orderID);
|
||||
|
||||
$sql = "select T_OrderHeaderLabNumber, T_OrderDetailID,T_OrderDetailT_TestName,
|
||||
T_OrderDetailID,T_OrderDetailResult,T_OrderDetailValUserID, T_OrderDetailValDate,T_OrderHeaderID
|
||||
from
|
||||
t_orderdetail
|
||||
join t_orderheader on T_OrderDetailT_OrderHeaderID in ({$sids})
|
||||
and T_OrderHeaderID = T_OrderDetailT_OrderHeaderID
|
||||
and T_OrderDetailIsActive = 'Y'
|
||||
order by T_OrderHeaderLabNumber";
|
||||
$qry = $this->db->query($sql);
|
||||
if (!$qry) {
|
||||
echo "<h3> Error Get Order Detail : " .
|
||||
$this->db->error()["message"] .
|
||||
"|" .
|
||||
$this->db->last_query() .
|
||||
"</h3>";
|
||||
exit();
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
$rows = array_filter($rows, function ($d) use ($px) {
|
||||
return preg_match("/{$px}*/", $d["T_OrderDetailT_TestName"]) == 1;
|
||||
});
|
||||
$sql = "select * from auto_valid where AutoValidT_OrderDetailID = ?";
|
||||
foreach ($rows as $idx => $r) {
|
||||
echo "<h4> {$r["T_OrderHeaderLabNumber"]} | {$r["T_OrderDetailT_TestName"]} |
|
||||
{$r["T_OrderDetailValUserID"]} | {$r["T_OrderDetailValDate"]} AutoVerif :</h4> \n";
|
||||
$qry = $this->db->query($sql, [$r["T_OrderDetailID"]]);
|
||||
if (!$qry) {
|
||||
echo "<h3> Error Get Auto Valid : " .
|
||||
$this->db->error()["message"] .
|
||||
"</h3>";
|
||||
exit();
|
||||
}
|
||||
$drows = $qry->result_array();
|
||||
$this->print_table($drows, array_keys($drows[0]));
|
||||
$url =
|
||||
"http://localhost/one-api/process/auto_verif_valid/info_valid/" .
|
||||
$r["T_OrderDetailID"];
|
||||
$info = file_get_contents($url);
|
||||
$ainfo = json_decode($info, true);
|
||||
echo "<pre>INFO: [{$r["T_OrderDetailID"]}] \n";
|
||||
print_r($ainfo);
|
||||
echo "</pre>";
|
||||
if ($info["image"] != "") {
|
||||
$url_img = $ainfo["image"];
|
||||
echo "<img src='{$url_img}'>";
|
||||
}
|
||||
$url_status =
|
||||
"http://localhost/one-api/process/auto_verif_valid/status/" .
|
||||
$r["T_OrderHeaderID"];
|
||||
$status = file_get_contents($url_status);
|
||||
$astatus = json_decode($status, true);
|
||||
echo "<pre>STATUS: $url_status \n";
|
||||
print_r($astatus);
|
||||
echo "<pre>";
|
||||
}
|
||||
}
|
||||
public function print_table_style()
|
||||
{
|
||||
echo "
|
||||
<style>
|
||||
th, td {
|
||||
padding: 15px;
|
||||
text-align: left;
|
||||
}
|
||||
tr:nth-child(even) {background-color: #f2f2f2;}
|
||||
table {
|
||||
border: solid 1px ;
|
||||
min-width:600px;
|
||||
}
|
||||
</style>
|
||||
";
|
||||
}
|
||||
public function print_table($rows, $keys)
|
||||
{
|
||||
echo "<table>";
|
||||
echo "<tr>";
|
||||
foreach ($keys as $k) {
|
||||
echo "<td>$k</td>";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
foreach ($rows as $r) {
|
||||
echo "<tr>";
|
||||
foreach ($keys as $k) {
|
||||
echo "<td>" . $r[$k] . "</td>";
|
||||
}
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
}
|
||||
126
application/controllers/process/Check_verif.php
Normal file
126
application/controllers/process/Check_verif.php
Normal file
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
class Check_verif extends MY_Controller
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
function do($nolab, $px)
|
||||
{
|
||||
$nolab = "%" . $nolab;
|
||||
$sql = "select T_OrderHeaderID,T_OrderHeaderLabNumber,T_OrderHeaderDate
|
||||
from t_orderheader where T_OrderHeaderLabNumber like ?";
|
||||
$qry = $this->db->query($sql, [$nolab]);
|
||||
if (!$qry) {
|
||||
echo "<h3> Error t_orderheader : " .
|
||||
$this->db->error()["message"] .
|
||||
"</h3>";
|
||||
exit();
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
if (count($rows) == 0) {
|
||||
echo "<h3> Order not found $nolab</h3>";
|
||||
exit();
|
||||
}
|
||||
$orderID = [];
|
||||
foreach ($rows as $idx => $r) {
|
||||
$orderID[] = $r["T_OrderHeaderID"];
|
||||
unset($rows[$idx]["T_OrderHeaderID"]);
|
||||
}
|
||||
$this->print_table_style();
|
||||
$this->print_table($rows, array_keys($rows[0]));
|
||||
$sids = implode(",", $orderID);
|
||||
|
||||
$sql = "select T_OrderHeaderLabNumber, T_OrderDetailID,T_OrderDetailT_TestName,
|
||||
T_OrderDetailID,T_OrderDetailResult,T_OrderDetailVerUserID, T_OrderDetailVerDate,T_OrderHeaderID
|
||||
from
|
||||
t_orderdetail
|
||||
join t_orderheader on T_OrderDetailT_OrderHeaderID in ({$sids})
|
||||
and T_OrderHeaderID = T_OrderDetailT_OrderHeaderID
|
||||
and T_OrderDetailIsActive = 'Y'
|
||||
order by T_OrderHeaderLabNumber";
|
||||
$qry = $this->db->query($sql);
|
||||
if (!$qry) {
|
||||
echo "<h3> Error Get Order Detail : " .
|
||||
$this->db->error()["message"] .
|
||||
"|" .
|
||||
$this->db->last_query() .
|
||||
"</h3>";
|
||||
exit();
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
$rows = array_filter($rows, function ($d) use ($px) {
|
||||
return preg_match("/{$px}*/", $d["T_OrderDetailT_TestName"]) == 1;
|
||||
});
|
||||
$sql = "select * from auto_verif where AutoVerifT_OrderDetailID = ?";
|
||||
foreach ($rows as $idx => $r) {
|
||||
echo "<h4> {$r["T_OrderHeaderLabNumber"]} | {$r["T_OrderDetailT_TestName"]} | {$r["T_OrderDetailVerUserID"]} | {$r["T_OrderDetailVerDate"]} AutoVerif :</h4> \n";
|
||||
$qry = $this->db->query($sql, [$r["T_OrderDetailID"]]);
|
||||
if (!$qry) {
|
||||
echo "<h3> Error Get Auto Verif : " .
|
||||
$this->db->error()["message"] .
|
||||
"</h3>";
|
||||
exit();
|
||||
}
|
||||
$drows = $qry->result_array();
|
||||
foreach ($drows as $didx => $xr) {
|
||||
unset($drows[$didx]["AutoVerifAmrIsOk"]);
|
||||
unset($drows[$didx]["AutoVerifAmrNote"]);
|
||||
}
|
||||
$this->print_table($drows, array_keys($drows[0]));
|
||||
$url =
|
||||
"http://localhost/one-api/process/auto_verif_valid/info_verif/" .
|
||||
$r["T_OrderDetailID"];
|
||||
$info = file_get_contents($url);
|
||||
$ainfo = json_decode($info, true);
|
||||
echo "<pre>INFO: [{$r["T_OrderDetailID"]}] \n";
|
||||
print_r($ainfo);
|
||||
echo "</pre>";
|
||||
if ($info["image"] != "") {
|
||||
$url_img = $ainfo["image"];
|
||||
echo "<img src='{$url_img}'>";
|
||||
}
|
||||
$url_status =
|
||||
"http://localhost/one-api/process/auto_verif_valid/status/" .
|
||||
$r["T_OrderHeaderID"];
|
||||
$status = file_get_contents($url_status);
|
||||
$astatus = json_decode($status, true);
|
||||
echo "<pre>STATUS: $url_status \n";
|
||||
print_r($astatus);
|
||||
echo "<pre>";
|
||||
}
|
||||
}
|
||||
public function print_table_style()
|
||||
{
|
||||
echo "
|
||||
<style>
|
||||
th, td {
|
||||
padding: 15px;
|
||||
text-align: left;
|
||||
}
|
||||
tr:nth-child(even) {background-color: #f2f2f2;}
|
||||
table {
|
||||
border: solid 1px ;
|
||||
min-width:600px;
|
||||
}
|
||||
</style>
|
||||
";
|
||||
}
|
||||
public function print_table($rows, $keys)
|
||||
{
|
||||
echo "<table>";
|
||||
echo "<tr>";
|
||||
foreach ($keys as $k) {
|
||||
echo "<td>$k</td>";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
foreach ($rows as $r) {
|
||||
echo "<tr>";
|
||||
foreach ($keys as $k) {
|
||||
echo "<td>" . $r[$k] . "</td>";
|
||||
}
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user