update view

master
mrkcp 2025-03-27 13:14:00 +07:00
parent 61647d94ad
commit 4d5a40c0c5
7 changed files with 899 additions and 20 deletions

View File

@ -8,6 +8,7 @@ return [
'version' => 'v202409001 ',
'HISSecret' => '931EF6D579FBA33803B3B3D81F2000FF',
'secret' => 'qSQNw67zUp0R0zZfluRzXXnGX9J9LQMv',
'report_key' => 'qSQNw67zUp0R0zZfluRzXXnGX9J9LQMv',
//'urlOffline' => 'http://172.16.0.101/',
//'urlOnline' => 'http://172.16.0.101/',
'digitCase' => 5,

View File

@ -1,6 +1,6 @@
<?php
namespace frontend\modules\api\controllers;
namespace frontend\modules\hospital\controllers;
use common\models\CaseDish;
use common\models\CaseNonGyn;
@ -27,7 +27,7 @@ use yii\web\NotFoundHttpException;
class ReportController extends Controller
{
/**
* View Report
@ -48,11 +48,18 @@ class ReportController extends Controller
throw new NotFoundHttpException('Wrong report key');
}
$user = User::findIdentityByAccessToken('7vq04fPZbLJGiXK2TrMKnZ0b8cuQGq6r');
$user = User::findIdentityByAccessToken('qSQNw67zUp0R0zZfluRzXXnGX9J9LQMv');
$case = null;
//$case = PatientCase::find()->where(['like', 'h_n', $hn])->one();
//var_dump($hn);
//var_dump($case);
//exit;
if ($user) {
Yii::$app->user->login($user, 60);
$case = PatientCase::find()->where(['h_n' => $hn])->one();
//$case = PatientCase::find()->where(['h_n' => $hn])->one();
$case = PatientCase::find()->where(['like', 'h_n', $hn])->one();
if (!$case || empty($case->id_case)) {
throw new NotFoundHttpException('Patient not found');
@ -60,9 +67,12 @@ class ReportController extends Controller
}
$dataProvider = new ActiveDataProvider([
'query' => PatientCase::find()->where(['h_n' => $hn]),
//'query' => PatientCase::find()->where(['h_n' => $hn]),
'query' => PatientCase::find()->where(['like', 'h_n', $hn]),
]);
Yii::$app->response->format = \yii\web\Response::FORMAT_HTML;
return $this->render('view', [
'case' => $case,
'dataProvider' => $dataProvider,

View File

@ -0,0 +1,40 @@
<?php
use common\models\ApproveStatus;
use common\models\CaseNonGyn;
use common\models\CasePap;
use common\models\CenterApprove;
use common\models\CytoNonGynConsult;
use common\models\CytoPapConsult;
use common\models\HistoStaining;
use common\models\ImmunoStaining;
use common\models\PathologistTransfer;
use common\models\PatientCase;
use common\models\SurgicalAdd;
use common\models\SurgicalConsult;
use common\models\SurgicalRecut;
use yii\db\Expression;
$asset = Yii::$app->assetManager->getPublishedUrl('@frontend/themes/nikom/assets');
?>
<?php
$menuItems = [];
?>
<?= \common\widgets\Menu::widget([
'activateParents' => true,
'activeCssClass' => 'active current-page',
'items' => $menuItems,
'encodeLabels' => false,
'options' => [
//'id' => 'menu',
'class' => 'sidebar-menu'
],
'submenuTemplate' => "\n<ul class='treeview-menu'>\n{items}\n</ul>\n",
'linkTemplate' => '<a href="{url}" {linkoptions}>{label}</a>',
]) ?>

View File

@ -0,0 +1,354 @@
<?php
/** @var \yii\web\View $this */
/** @var string $content */
use yii\bootstrap5\Html;
use common\widgets\Alert;
use yii\bootstrap5\Breadcrumbs;
use frontend\themes\nikom\NikomAsset;
use diecoding\toastr\ToastrFlash;
NikomAsset::register($this);
$asset = Yii::$app->assetManager->getPublishedUrl('@frontend/themes/nikom/assets');
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
<meta charset="<?= Yii::$app->charset ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?= Html::encode($this->title) ?></title>
<!-- Meta -->
<link rel="icon" href="<?= Yii::getAlias('@web') ?>/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="<?= Yii::getAlias('@web') ?>/favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" sizes="57x57" href="<?= Yii::getAlias('@web') ?>/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="<?= Yii::getAlias('@web') ?>/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="<?= Yii::getAlias('@web') ?>/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="<?= Yii::getAlias('@web') ?>/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="<?= Yii::getAlias('@web') ?>/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="<?= Yii::getAlias('@web') ?>/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="<?= Yii::getAlias('@web') ?>/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="<?= Yii::getAlias('@web') ?>/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="<?= Yii::getAlias('@web') ?>/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="<?= Yii::getAlias('@web') ?>/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="<?= Yii::getAlias('@web') ?>/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="<?= Yii::getAlias('@web') ?>/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="<?= Yii::getAlias('@web') ?>/favicon-16x16.png">
<link rel="manifest" href="<?= Yii::getAlias('@web') ?>/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="<?= Yii::getAlias('@web') ?>/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<meta property="og:type" content="Website">
<?php $this->registerCsrfMetaTags() ?>
<?php $this->head() ?>
<?php $this->registerCssFile(Yii::getAlias('@web') . '/css/custom.css', ['depends' => ['\yii\bootstrap5\BootstrapAsset']]) ?>
<?php $this->registerCssFile(Yii::getAlias('@web') . '/css/fontawsome-all.css', ['depends' => 'yii\web\YiiAsset']) ?>
<?php $this->registerCss("
.btn-md {
font-size: 100% !important;
}
") ?>
<style>
body {
font-family: "Kanit";
font-size: 14px !important;
font-weight: 300;
}
</style>
</head>
<body>
<?php $this->beginBody() ?>
<!-- Loading starts -->
<!--<div id="loading-wrapper">
<div class='spin-wrapper'>
<div class='spin'>
<div class='inner'></div>
</div>
<div class='spin'>
<div class='inner'></div>
</div>
<div class='spin'>
<div class='inner'></div>
</div>
<div class='spin'>
<div class='inner'></div>
</div>
<div class='spin'>
<div class='inner'></div>
</div>
<div class='spin'>
<div class='inner'></div>
</div>
</div>
</div>-->
<!-- Loading ends -->
<!-- Page wrapper starts -->
<div class="page-wrapper">
<!-- App header starts -->
<div class="app-header d-flex align-items-center">
<!-- Toggle buttons starts -->
<div class="d-flex">
<button class="toggle-sidebar">
<i class="ri-menu-line"></i>
</button>
<button class="pin-sidebar">
<i class="ri-menu-line"></i>
</button>
</div>
<!-- Toggle buttons ends -->
<!-- App brand starts -->
<div class="app-brand ms-3">
<a href="<?= Yii::$app->homeUrl ?>" class="d-lg-block d-none">
<img src="<?= Yii::getAlias('@web') ?>/img/logo_font.png" class="logo" alt="<?= Yii::$app->name ?>">
</a>
<a href="<?= Yii::$app->homeUrl ?>" class="d-lg-none d-md-block">
<img src="<?= Yii::getAlias('@web') ?>/img/logo_font.png" class="logo" alt="<?= Yii::$app->name ?>">
</a>
</div>
<!-- App brand ends -->
<!-- App header actions starts -->
<div class="header-actions">
<?php
$this->registerJs('
function dateTime(time_now) {
var days = new Array("วันอาทิตย์ที่", "วันจันทร์ที่", "วันอังคารที่", "วันพุธที่", "วันพฤหัสบดีที่", "วันศุกร์ที่", "วันเสาร์ที่")
var month = new Array("มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม")
var current_time1 = new Date(time_now)
var current_time2 = current_time1.getTime() + 1000
var now = new Date(current_time2)
var hours = now.getHours()
var minutes = now.getMinutes()
var seconds = now.getSeconds()
var years = now.getYear()
if (minutes <= 9)
minutes = "0" + minutes
if (seconds <= 9)
seconds = "0" + seconds
var result = days[now.getDay()] + " "
result += now.getDate()
result += " " + month[now.getMonth()] + " พ.ศ. "
if (years)
{
add1 = 1900;
add2 = add1 + 543
}else{
add2 = 0
}
result += years + add2
result += " เวลา " + hours + ":"
result += " " + minutes + ":"
result += " " + seconds
//return result
$("#timebox").html(result)
window.setTimeout(function(){
dateTime(now.getTime())
}, 1000);
}
window.setTimeout(function(){
dateTime(\'' . date('Y-m-d H:i:s') . '\')
}, 1000);
') ?>
<p id="timebox" class="fw-light mb-1 text-nowrap text-truncate text-white"></p>
<!-- Header user settings starts -->
<div class="dropdown ms-2">
<a id="userSettings" class="dropdown-toggle d-flex align-items-center" href="#!" role="button"
data-bs-toggle="dropdown" aria-expanded="false">
<div class="avatar-box">
<i class="ri-user-line"></i>
<!--<img src="<?= isset(Yii::$app->user->identity) ? Yii::$app->user->identity->getPhoto() : '' ?>" width="40" class="img-shadow img-2x me-3 rounded-5" alt="<?= Yii::$app->user->identity->realname ?>">-->
<span class="status online"></span>
</div>
</a>
<div class="dropdown-menu dropdown-menu-end shadow-lg">
<div class="px-3 py-2">
<h6 class="m-0">
<?= Html::a('<i class="ri-user-line"></i> <span>ข้อมูลส่วนตัว</span>', ['/account/default/index']) ?>
</h6>
<div class="mt-3">
<h6 class="m-0">
<?= Html::a('<i class="ri-edit-2-line"></i> <span>แก้ไขข้อมูลส่วนตัว</span>', ['/account/default/update']) ?>
</h6>
</div>
<div class="mt-3">
<h6 class="m-0">
<?= Html::a('<i class="ri-list-settings-line"></i> <span>เปลี่ยนรหัสผ่าน</span>', ['/account/default/change-password']) ?>
</h6>
</div>
</div>
<div class="mx-3 my-2 d-grid">
<?= Html::beginForm(['/site/logout'], 'post', ['class' => 'mx-auto'])
. Html::submitButton(
'<i class="ri-lock-unlock-line"></i> ออกจากระบบ (' . Yii::$app->user->identity->username . ')',
['class' => 'btn btn-sm btn-danger text-decoration-none menu-text']
)
. Html::endForm() ?>
</div>
</div>
</div>
<!-- Header user settings ends -->
</div>
<!-- App header actions ends -->
</div>
<!-- App header ends -->
<!-- Main container starts -->
<div class="main-container">
<!-- Sidebar wrapper starts -->
<nav id="sidebar" class="sidebar-wrapper">
<!-- Sidebar profile starts -->
<div class="sidebar-profile">
<img src="<?php
if (isset(Yii::$app->user->identity)) {
echo Yii::$app->user->identity->getPhoto();
}
?>" class="img-shadow img-3x me-3 rounded-5" alt="Hospital Admin Templates">
<div class="m-0">
<h5 class="mb-1 profile-name text-nowrap text-truncate">
<?= isset(Yii::$app->user->identity->realname) ? Html::encode(Yii::$app->user->identity->realname) : '' ?>
</h5>
<p class="m-0 small profile-name text-nowrap text-truncate">
<?= isset(Yii::$app->user->identity->role) ? Html::encode(ucfirst(Yii::$app->user->identity->role)) : '' ?>
</p>
</div>
</div>
<!-- Sidebar profile ends -->
<!-- Sidebar menu starts -->
<div class="sidebarMenuScroll">
<?= $this->render('_menu') ?>
</div>
<!-- Sidebar menu ends -->
<!-- Sidebar contact starts -->
<div class="sidebar-contact">
<p class="m-1 lh-1 text-nowrap text-truncate"><?= Yii::$app->user->identity->realname ?></p>
<?= Html::beginForm(['/site/logout'], 'post', ['class' => 'mx-auto'])
. Html::submitButton(
'<i class="ri-lock-unlock-line"></i> ออกจากระบบ',
['class' => 'btn btn-sm btn-danger text-decoration-none menu-text btn-block']
)
. Html::endForm() ?>
</div>
<!-- Sidebar contact ends -->
</nav>
<!-- Sidebar wrapper ends -->
<!-- App container starts -->
<div class="app-container">
<!-- App hero header starts -->
<div class="app-hero-header d-flex align-items-center">
<!-- Breadcrumb starts -->
<?= Breadcrumbs::widget([
'tag' => 'ol',
'activeItemTemplate' => "<li class=\"breadcrumb-item active breadcrumb-item text-primary\">{link}</li>\n",
'itemTemplate' => "<li class=\"breadcrumb-item\">{link}</li>",
'homeLink' => ['label' => '<i class="ri-home-8-line lh-1 pe-3 me-3 border-end"></i> หน้าหลัก', 'url' => Yii::$app->homeUrl, 'encode' => false],
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]) ?>
<!-- Breadcrumb ends -->
</div>
<!-- App Hero header ends -->
<!-- App body starts -->
<div class="app-body">
<?php if (Yii::$app->controller->module->id == 'admin') { ?>
<?= Alert::widget() ?>
<div class="card mb-5">
<div class="card-header">
<h4 class="card-title"><?= Html::encode($this->title) ?></h4>
</div>
<div class="card-body">
<?= $content ?>
<div class="mb-4"></div>
</div>
</div>
<?php } else { ?>
<?= Alert::widget() ?>
<?= $content ?>
<?php } ?>
</div>
<!-- App body ends -->
<!-- App footer starts -->
<div class="app-footer bg-white">
<span>HANUMAN PATHOLOGY LIS v202411 ผลิตในประเทศไทย © 2024 <?php // date('Y')
?>
<?= Html::a('HANUMANIT Co., Ltd.', 'https://hanumanit.co.th', ['target' => '_blank']) ?></span>
</div>
<!-- App footer ends -->
</div>
<!-- App container ends -->
</div>
<!-- Main container ends -->
</div>
<!-- Page wrapper ends -->
<?= ToastrFlash::widget([
'options' => [
"closeButton" => true,
"debug" => false,
"newestOnTop" => true,
"progressBar" => true,
"positionClass" => "toast-top-center", //toast-top-center
"preventDuplicates" => false,
"onclick" => null,
"showDuration" => "8000",
"hideDuration" => "1000",
"timeOut" => "10000",
"extendedTimeOut" => "1000",
"showEasing" => "swing",
"hideEasing" => "linear",
"showMethod" => "fadeIn",
"hideMethod" => "fadeOut"
]
]) ?>
<?php //$this->registerJsFile(Yii::getAlias('@web').'/js/noti.js')
?>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage();

View File

@ -7,7 +7,7 @@ use common\models\SurgicalDiagnosis;
use yii\grid\GridView;
use yii\helpers\Html;
$this->title = Html::encode('View Report');
$this->title = 'ดูใบรายงานผล';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="card">
@ -17,7 +17,7 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="card-body">
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
//'filterModel' => $searchModel,
'pager' => ['class' => 'yii\bootstrap5\LinkPager'],
'tableOptions' => ['class' => 'table truncate align-middle'],
'layout' => "{summary}<div class='table-outer'><div class='table-responsive'>\n{items}\n</div></div><div class='d-flex justify-content-between align-items-center mt-4'>{pager}</div>",
@ -35,12 +35,14 @@ $this->params['breadcrumbs'][] = $this->title;
'view' => function ($url, $model, $key) {
if ($model->status_id == 18) {
return Html::a('<i class="ri-file-pdf-2-line"></i> View Reprot', ['/report/case/view', 'id_case' => $model->id_case, 'mode' => 'final'], ['class' => 'btn btn-sm btn-success btn-block', 'title' => 'View this Report', 'target' => '_blank', 'data-pjax' => '0']) .
return Html::a('<i class="ri-file-pdf-2-line"></i> View Reprot', ['/report/report-log/view-report', 'id_case' => $model->id_case, 'mode' => 'final'], ['class' => 'btn btn-sm btn-success btn-block', 'title' => 'View this Report', 'target' => '_blank', 'data-pjax' => '0']) .
'<br />' . /*$ap*/ (isset($open) ? '<span class="text-success"><small><br> เปิด: ' . $open->open_at . '</small></span><br />' : '');
}
if ($model->status_id == 16) {
return Html::a('<i class="ri-file-pdf-2-line"></i> View Report', ['/report/case/view', 'id_case' => $model->id_case, 'mode' => 'final'], ['class' => 'btn btn-sm btn-success btn-block', 'title' => 'View this Report', 'target' => '_blank', 'data-pjax' => '0']);
return Html::a('<i class="ri-file-pdf-2-line"></i> View Report', ['/report/report-log/view-report', 'id_case' => $model->id_case, 'mode' => 'final'], ['class' => 'btn btn-sm btn-success btn-block', 'title' => 'View this Report', 'target' => '_blank', 'data-pjax' => '0']);
}
/*return Html::a('<i class="ri-file-pdf-2-line"></i> View Reprot', ['/report/report-log/view-report', 'id_case' => $model->id_case, 'mode' => 'final'], ['class' => 'btn btn-sm btn-success btn-block', 'title' => 'View this Report', 'target' => '_blank', 'data-pjax' => '0']) .
(isset($open) ? '<span class="text-success"><small><br> เปิด: ' . $open->open_at . '</small></span><br />' : '');*/
},
]
],
@ -59,7 +61,7 @@ $this->params['breadcrumbs'][] = $this->title;
'headerOptions' => ['style' => 'text-align:center; width: 150;'],
'format' => 'raw',
'value' => function ($model) {
return $model->getFullname();
return $model->patient_name;
}
],
[

View File

@ -86,6 +86,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?php } ?>
<?php } // surgical
?>
<?php if (Yii::$app->pathology->getCaseType($model->id_case) == 'non-gyn') { ?>
<div class="col-12 text-center">
<h6 class="mt-4"><i class="ri-file-text-line"></i> Request File
@ -114,7 +115,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?= isset($center_approve->approveBy) ? $center_approve->approveBy->report_name : '' ?></small>
<?php } ?>
</h6>
<?php if (isset($center_approve) && $center_approve->approve_status == 4) { ?>
<?php /* if (isset($center_approve) && $center_approve->approve_status == 4) { ?>
<?php if (empty($center_approve->release_at)) { ?>
<div class="text-center"><span class="badge bg-danger">ตรวจสอบผลแล้วยังไม่ Release</span></div>
<?php } else { ?>
@ -141,6 +142,31 @@ $this->params['breadcrumbs'][] = $this->title;
<?php } ?>
<?php } else { ?>
<div class="text-center"><span class="badge bg-danger">รอตรวจสอบผล</span></div>
<?php } */ ?>
<?php if (isset($center_approve) && $center_approve->approve_status == 4) { ?>
<?php if (empty($center_approve->release_at)) { ?>
<div class="text-center"><span class="badge bg-danger">ตรวจสอบผลแล้วยังไม่ Release</span></div>
<?php } else { ?>
<?php if ($case->report_type == 'outlab') { ?>
<?php foreach ($case->getReport() as $file => $val) { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-red.png', ['width' => 30]), Yii::getAlias('@web') . '/' . $case->uploadReportFolder . '/' . $val, ['target' => '_blank', 'class' => 'text-success']); ?>
<?php } ?>
<?php } ?>
<?php if ($case->report_type == 'consult-outlab') { ?>
<?php foreach ($case->getConsultReport() as $file => $val) { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-red.png', ['width' => 30]), Yii::getAlias('@web') . '/' . $case->uploadConsultReportFolder . '/' . $val, ['target' => '_blank', 'class' => 'text-success']); ?>
<?php } ?>
<?php } ?>
<?php if (Yii::$app->user->can('system')) { ?>
<?php if (($case->report_type != 'outlab') && ($case->report_type != 'consult-outlab')) { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-red.png', ['width' => 30]), ['report-log/log-report-view', 'id_case' => $model->id_case, 'report_type' => $case->report_type, 'id' => $case->id, 'mode' => 'final', 'file' => false, 'watermark' => 1, 'pdf_type' => 'non-gyn'], ['target' => '_blank', 'class' => 'text-success']) ?>
<?php } ?>
<?php } elseif (($case->report_type != 'outlab') && ($case->report_type != 'consult-outlab')) { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-green.png', ['width' => 30]), ['report-log/log-report-view', 'id_case' => $model->id_case, 'report_type' => $case->report_type, 'id' => $case->id, 'mode' => 'final', 'file' => false, 'watermark' => false, 'pdf_type' => 'non-gyn'], ['target' => '_blank', 'class' => 'text-success']) ?>
<?php } ?>
<?php } ?>
<?php } else { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-red.png', ['width' => 30]), ['report-log/log-report-view', 'id_case' => $model->id_case, 'report_type' => $case->report_type, 'id' => $case->id, 'mode' => 'final', 'file' => false, 'watermark' => 1, 'pdf_type' => 'non-gyn'], ['target' => '_blank', 'class' => 'text-success']) ?>
<?php } ?>
</div>
@ -179,7 +205,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?= isset($center_approve->approveBy) ? $center_approve->approveBy->report_name : '' ?></small>
<?php } ?>
</h6>
<?php if (isset($center_approve) && $center_approve->approve_status == 4) { ?>
<?php /* if (isset($center_approve) && $center_approve->approve_status == 4) { ?>
<?php if (empty($center_approve->release_at)) { ?>
<div class="text-center"><span class="badge bg-danger">ตรวจสอบผลแล้วยังไม่ Release</span></div>
@ -210,6 +236,31 @@ $this->params['breadcrumbs'][] = $this->title;
<?php } else { ?>
<div class="text-center"><span class="badge bg-danger">รอตรวจสอบผล</span></div>
<?php } */ ?>
<?php if (isset($center_approve) && $center_approve->approve_status == 4) { ?>
<?php if (empty($center_approve->release_at)) { ?>
<div class="text-center"><span class="badge bg-danger">ตรวจสอบผลแล้วยังไม่ Release</span></div>
<?php } else { ?>
<?php if ($case->report_type == 'outlab') { ?>
<?php foreach ($case->getReport() as $file => $val) { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-red.png', ['width' => 30]), Yii::getAlias('@web') . '/' . $case->uploadReportFolder . '/' . $val, ['target' => '_blank', 'class' => 'text-success']); ?>
<?php } ?>
<?php } ?>
<?php if ($case->report_type == 'consult-outlab') { ?>
<?php foreach ($case->getConsultReport() as $file => $val) { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-red.png', ['width' => 30]), Yii::getAlias('@web') . '/' . $case->uploadConsultReportFolder . '/' . $val, ['target' => '_blank', 'class' => 'text-success']); ?>
<?php } ?>
<?php } ?>
<?php if (Yii::$app->user->can('system')) { ?>
<?php if (($case->report_type != 'outlab') && ($case->report_type != 'consult-outlab')) { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-red.png', ['width' => 30]), ['report-log/log-report-view', 'id_case' => $model->id_case, 'report_type' => $case->report_type, 'id' => $case->id, 'mode' => 'final', 'file' => false, 'watermark' => 1, 'pdf_type' => 'pap'], ['target' => '_blank', 'class' => 'text-success']) ?>
<?php } ?>
<?php } elseif (($case->report_type != 'outlab') && ($case->report_type != 'consult-outlab')) { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-green.png', ['width' => 30]), ['report-log/log-report-view', 'id_case' => $model->id_case, 'report_type' => $case->report_type, 'id' => $case->id, 'mode' => 'final', 'file' => false, 'watermark' => false, 'pdf_type' => 'pap'], ['target' => '_blank', 'class' => 'text-success']) ?>
<?php } ?>
<?php } ?>
<?php } else { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-red.png', ['width' => 30]), ['report-log/log-report-view', 'id_case' => $model->id_case, 'report_type' => $case->report_type, 'id' => $case->id, 'mode' => 'final', 'file' => false, 'watermark' => 1, 'pdf_type' => 'pap'], ['target' => '_blank', 'class' => 'text-success']) ?>
<?php } ?>
</div>
@ -249,18 +300,26 @@ $this->params['breadcrumbs'][] = $this->title;
<?php if (empty($center_approve->release_at)) { ?>
<div class="text-center"><span class="badge bg-danger">ตรวจสอบผลแล้วยังไม่ Release</span></div>
<?php } else { ?>
<?php if ($case->report_type == 'outlab') { ?>
<?php foreach ($model->getReport() as $file => $val) { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-red.png', ['width' => 30]), Yii::getAlias('@web') . '/' . $model->uploadReportFolder . '/' . $val, ['target' => '_blank', 'class' => 'text-success']); ?>
<?php foreach ($case->getReport() as $file => $val) { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-red.png', ['width' => 30]), Yii::getAlias('@web') . '/' . $case->uploadReportFolder . '/' . $val, ['target' => '_blank', 'class' => 'text-success']); ?>
<?php } ?>
<?php } else { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-red.png', ['width' => 30]), ['frozen-pdf', 'id_case' => $model->id_case, 'report_type' => $case->report_type, 'id' => $case->id, 'mode' => 'final', 'watermark' => 1, 'file' => false], ['target' => '_blank', 'class' => 'text-success']) ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-green.png', ['width' => 30]), ['frozen-pdf', 'id_case' => $model->id_case, 'report_type' => $case->report_type, 'id' => $case->id, 'mode' => 'final', 'file' => false, 'watermark' => false], ['target' => '_blank', 'class' => 'text-success']) ?>
<?php } ?>
<?php if ($case->report_type == 'consult-outlab') { ?>
<?php foreach ($case->getConsultReport() as $file => $val) { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-red.png', ['width' => 30]), Yii::getAlias('@web') . '/' . $case->uploadConsultReportFolder . '/' . $val, ['target' => '_blank', 'class' => 'text-success']); ?>
<?php } ?>
<?php } ?>
<?php if (Yii::$app->user->can('system')) { ?>
<?php if (($case->report_type != 'outlab') && ($case->report_type != 'consult-outlab')) { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-red.png', ['width' => 30]), ['report-log/log-report-view', 'id_case' => $model->id_case, 'report_type' => $case->report_type, 'id' => $case->id, 'mode' => 'final', 'file' => false, 'watermark' => 1, 'pdf_type' => 'frozen'], ['target' => '_blank', 'class' => 'text-success']) ?>
<?php } ?>
<?php } elseif (($case->report_type != 'outlab') && ($case->report_type != 'consult-outlab')) { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-green.png', ['width' => 30]), ['report-log/log-report-view', 'id_case' => $model->id_case, 'report_type' => $case->report_type, 'id' => $case->id, 'mode' => 'final', 'file' => false, 'watermark' => false, 'pdf_type' => 'frozen'], ['target' => '_blank', 'class' => 'text-success']) ?>
<?php } ?>
<?php } ?>
<?php } else { ?>
<div class="text-center"><span class="badge badge-danger">รอตรวจสอบผล</span></div>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-red.png', ['width' => 30]), ['report-log/log-report-view', 'id_case' => $model->id_case, 'report_type' => $case->report_type, 'id' => $case->id, 'mode' => 'final', 'file' => false, 'watermark' => 1, 'pdf_type' => 'frozen'], ['target' => '_blank', 'class' => 'text-success']) ?>
<?php } ?>
</div>
@ -435,6 +494,65 @@ $this->params['breadcrumbs'][] = $this->title;
<?php } ?>
<?php } // surgical
?>
<?php if (Yii::$app->pathology->getCaseType($model->id_case) == 'hpv') { ?>
<div class="col-12 text-center">
<h6 class="mt-4"><i class="ri-file-text-line"></i> Request File
</h6>
<ul class="mb-4">
<?php if (!empty($model->files)) { ?>
<?= $model->getFileLink() ?>
<?php } ?>
</ul>
</div>
<?php foreach (SurgicalDiagnosis::find()->where(['id_case' => $model->id_case])->all() as $case) {
$from_case = false;
$center_approve = CenterApprove::findOne([
'id_case' => $case->id_case,
'report_type' => $case->report_type,
'ref_id' => $case->id
]);
?>
<div class="col-md-3 text-center">
<h6>
<?= ucfirst($case->report_type) ?> Report<br />
<small><?= $case->pathologist_at ?></small>
<?php if ($model->is_outlab) { ?>
<br /><small>Upload By:
<?= isset($center_approve->approveBy) ? $center_approve->approveBy->report_name : '' ?></small>
<?php } ?>
</h6>
<?php if (isset($center_approve) && $center_approve->approve_status == 4) { ?>
<?php if (empty($center_approve->release_at)) { ?>
<div class="text-center"><span class="badge bg-danger">ตรวจสอบผลแล้วยังไม่ Release</span></div>
<?php } else { ?>
<?php if ($case->report_type == 'outlab') { ?>
<?php foreach ($case->getReport() as $file => $val) { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-red.png', ['width' => 30]), Yii::getAlias('@web') . '/' . $case->uploadReportFolder . '/' . $val, ['target' => '_blank', 'class' => 'text-success']); ?>
<?php } ?>
<?php } ?>
<?php if ($case->report_type == 'consult-outlab') { ?>
<?php foreach ($case->getConsultReport() as $file => $val) { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-red.png', ['width' => 30]), Yii::getAlias('@web') . '/' . $case->uploadConsultReportFolder . '/' . $val, ['target' => '_blank', 'class' => 'text-success']); ?>
<?php } ?>
<?php } ?>
<?php if (Yii::$app->user->can('system')) { ?>
<?php if (($case->report_type != 'outlab') && ($case->report_type != 'consult-outlab')) { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-red.png', ['width' => 30]), ['report-log/log-report-view', 'id_case' => $model->id_case, 'report_type' => $case->report_type, 'id' => $case->id, 'mode' => 'final', 'file' => false, 'watermark' => 1, 'pdf_type' => 'hpv'], ['target' => '_blank', 'class' => 'text-success']) ?>
<?php } ?>
<?php } elseif (($case->report_type != 'outlab') && ($case->report_type != 'consult-outlab')) { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-green.png', ['width' => 30]), ['report-log/log-report-view', 'id_case' => $model->id_case, 'report_type' => $case->report_type, 'id' => $case->id, 'mode' => 'final', 'file' => false, 'watermark' => false, 'pdf_type' => 'hpv'], ['target' => '_blank', 'class' => 'text-success']) ?>
<?php } ?>
<?php } ?>
<?php } else { ?>
<?= Html::a(Html::img(Yii::getAlias('@web') . '/img/icon/pdf-red.png', ['width' => 30]), ['report-log/log-report-view', 'id_case' => $model->id_case, 'report_type' => $case->report_type, 'id' => $case->id, 'mode' => 'final', 'file' => false, 'watermark' => 1, 'pdf_type' => 'hpv'], ['target' => '_blank', 'class' => 'text-success']) ?>
<?php } ?>
</div>
<?php } ?>
<?php } // HPV
?>
</div>
</div>
</div>

View File

@ -0,0 +1,354 @@
<?php
/** @var \yii\web\View $this */
/** @var string $content */
use yii\bootstrap5\Html;
use common\widgets\Alert;
use yii\bootstrap5\Breadcrumbs;
use frontend\themes\nikom\NikomAsset;
use diecoding\toastr\ToastrFlash;
NikomAsset::register($this);
$asset = Yii::$app->assetManager->getPublishedUrl('@frontend/themes/nikom/assets');
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
<meta charset="<?= Yii::$app->charset ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?= Html::encode($this->title) ?></title>
<!-- Meta -->
<link rel="icon" href="<?= Yii::getAlias('@web') ?>/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="<?= Yii::getAlias('@web') ?>/favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" sizes="57x57" href="<?= Yii::getAlias('@web') ?>/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="<?= Yii::getAlias('@web') ?>/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="<?= Yii::getAlias('@web') ?>/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="<?= Yii::getAlias('@web') ?>/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="<?= Yii::getAlias('@web') ?>/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="<?= Yii::getAlias('@web') ?>/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="<?= Yii::getAlias('@web') ?>/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="<?= Yii::getAlias('@web') ?>/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="<?= Yii::getAlias('@web') ?>/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="<?= Yii::getAlias('@web') ?>/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="<?= Yii::getAlias('@web') ?>/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="<?= Yii::getAlias('@web') ?>/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="<?= Yii::getAlias('@web') ?>/favicon-16x16.png">
<link rel="manifest" href="<?= Yii::getAlias('@web') ?>/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="<?= Yii::getAlias('@web') ?>/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<meta property="og:type" content="Website">
<?php $this->registerCsrfMetaTags() ?>
<?php $this->head() ?>
<?php $this->registerCssFile(Yii::getAlias('@web') . '/css/custom.css', ['depends' => ['\yii\bootstrap5\BootstrapAsset']]) ?>
<?php $this->registerCssFile(Yii::getAlias('@web') . '/css/fontawsome-all.css', ['depends' => 'yii\web\YiiAsset']) ?>
<?php $this->registerCss("
.btn-md {
font-size: 100% !important;
}
") ?>
<style>
body {
font-family: "Kanit";
font-size: 14px !important;
font-weight: 300;
}
</style>
</head>
<body>
<?php $this->beginBody() ?>
<!-- Loading starts -->
<!--<div id="loading-wrapper">
<div class='spin-wrapper'>
<div class='spin'>
<div class='inner'></div>
</div>
<div class='spin'>
<div class='inner'></div>
</div>
<div class='spin'>
<div class='inner'></div>
</div>
<div class='spin'>
<div class='inner'></div>
</div>
<div class='spin'>
<div class='inner'></div>
</div>
<div class='spin'>
<div class='inner'></div>
</div>
</div>
</div>-->
<!-- Loading ends -->
<!-- Page wrapper starts -->
<div class="page-wrapper">
<!-- App header starts -->
<div class="app-header d-flex align-items-center">
<!-- Toggle buttons starts -->
<div class="d-flex">
<button class="toggle-sidebar">
<i class="ri-menu-line"></i>
</button>
<button class="pin-sidebar">
<i class="ri-menu-line"></i>
</button>
</div>
<!-- Toggle buttons ends -->
<!-- App brand starts -->
<div class="app-brand ms-3">
<a href="<?= Yii::$app->homeUrl ?>" class="d-lg-block d-none">
<img src="<?= Yii::getAlias('@web') ?>/img/logo_font.png" class="logo" alt="<?= Yii::$app->name ?>">
</a>
<a href="<?= Yii::$app->homeUrl ?>" class="d-lg-none d-md-block">
<img src="<?= Yii::getAlias('@web') ?>/img/logo_font.png" class="logo" alt="<?= Yii::$app->name ?>">
</a>
</div>
<!-- App brand ends -->
<!-- App header actions starts -->
<div class="header-actions">
<?php
$this->registerJs('
function dateTime(time_now) {
var days = new Array("วันอาทิตย์ที่", "วันจันทร์ที่", "วันอังคารที่", "วันพุธที่", "วันพฤหัสบดีที่", "วันศุกร์ที่", "วันเสาร์ที่")
var month = new Array("มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม")
var current_time1 = new Date(time_now)
var current_time2 = current_time1.getTime() + 1000
var now = new Date(current_time2)
var hours = now.getHours()
var minutes = now.getMinutes()
var seconds = now.getSeconds()
var years = now.getYear()
if (minutes <= 9)
minutes = "0" + minutes
if (seconds <= 9)
seconds = "0" + seconds
var result = days[now.getDay()] + " "
result += now.getDate()
result += " " + month[now.getMonth()] + " พ.ศ. "
if (years)
{
add1 = 1900;
add2 = add1 + 543
}else{
add2 = 0
}
result += years + add2
result += " เวลา " + hours + ":"
result += " " + minutes + ":"
result += " " + seconds
//return result
$("#timebox").html(result)
window.setTimeout(function(){
dateTime(now.getTime())
}, 1000);
}
window.setTimeout(function(){
dateTime(\'' . date('Y-m-d H:i:s') . '\')
}, 1000);
') ?>
<p id="timebox" class="fw-light mb-1 text-nowrap text-truncate text-white"></p>
<!-- Header user settings starts -->
<div class="dropdown ms-2">
<a id="userSettings" class="dropdown-toggle d-flex align-items-center" href="#!" role="button"
data-bs-toggle="dropdown" aria-expanded="false">
<div class="avatar-box">
<i class="ri-user-line"></i>
<!--<img src="<?= isset(Yii::$app->user->identity) ? Yii::$app->user->identity->getPhoto() : '' ?>" width="40" class="img-shadow img-2x me-3 rounded-5" alt="<?= Yii::$app->user->identity->realname ?>">-->
<span class="status online"></span>
</div>
</a>
<div class="dropdown-menu dropdown-menu-end shadow-lg">
<div class="px-3 py-2">
<h6 class="m-0">
<?= Html::a('<i class="ri-user-line"></i> <span>ข้อมูลส่วนตัว</span>', ['/account/default/index']) ?>
</h6>
<div class="mt-3">
<h6 class="m-0">
<?= Html::a('<i class="ri-edit-2-line"></i> <span>แก้ไขข้อมูลส่วนตัว</span>', ['/account/default/update']) ?>
</h6>
</div>
<div class="mt-3">
<h6 class="m-0">
<?= Html::a('<i class="ri-list-settings-line"></i> <span>เปลี่ยนรหัสผ่าน</span>', ['/account/default/change-password']) ?>
</h6>
</div>
</div>
<div class="mx-3 my-2 d-grid">
<?= Html::beginForm(['/site/logout'], 'post', ['class' => 'mx-auto'])
. Html::submitButton(
'<i class="ri-lock-unlock-line"></i> ออกจากระบบ (' . Yii::$app->user->identity->username . ')',
['class' => 'btn btn-sm btn-danger text-decoration-none menu-text']
)
. Html::endForm() ?>
</div>
</div>
</div>
<!-- Header user settings ends -->
</div>
<!-- App header actions ends -->
</div>
<!-- App header ends -->
<!-- Main container starts -->
<div class="main-container">
<!-- Sidebar wrapper starts -->
<nav id="sidebar" class="sidebar-wrapper">
<!-- Sidebar profile starts -->
<div class="sidebar-profile">
<img src="<?php
if (isset(Yii::$app->user->identity)) {
echo Yii::$app->user->identity->getPhoto();
}
?>" class="img-shadow img-3x me-3 rounded-5" alt="Hospital Admin Templates">
<div class="m-0">
<h5 class="mb-1 profile-name text-nowrap text-truncate">
<?= isset(Yii::$app->user->identity->realname) ? Html::encode(Yii::$app->user->identity->realname) : '' ?>
</h5>
<p class="m-0 small profile-name text-nowrap text-truncate">
<?= isset(Yii::$app->user->identity->role) ? Html::encode(ucfirst(Yii::$app->user->identity->role)) : '' ?>
</p>
</div>
</div>
<!-- Sidebar profile ends -->
<!-- Sidebar menu starts -->
<div class="sidebarMenuScroll">
<?= $this->render('_menu') ?>
</div>
<!-- Sidebar menu ends -->
<!-- Sidebar contact starts -->
<div class="sidebar-contact">
<p class="m-1 lh-1 text-nowrap text-truncate"><?= Yii::$app->user->identity->realname ?></p>
<?= Html::beginForm(['/site/logout'], 'post', ['class' => 'mx-auto'])
. Html::submitButton(
'<i class="ri-lock-unlock-line"></i> ออกจากระบบ',
['class' => 'btn btn-sm btn-danger text-decoration-none menu-text btn-block']
)
. Html::endForm() ?>
</div>
<!-- Sidebar contact ends -->
</nav>
<!-- Sidebar wrapper ends -->
<!-- App container starts -->
<div class="app-container">
<!-- App hero header starts -->
<div class="app-hero-header d-flex align-items-center">
<!-- Breadcrumb starts -->
<?= Breadcrumbs::widget([
'tag' => 'ol',
'activeItemTemplate' => "<li class=\"breadcrumb-item active breadcrumb-item text-primary\">{link}</li>\n",
'itemTemplate' => "<li class=\"breadcrumb-item\">{link}</li>",
'homeLink' => ['label' => '<i class="ri-home-8-line lh-1 pe-3 me-3 border-end"></i> หน้าหลัก', 'url' => Yii::$app->homeUrl, 'encode' => false],
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]) ?>
<!-- Breadcrumb ends -->
</div>
<!-- App Hero header ends -->
<!-- App body starts -->
<div class="app-body">
<?php if (Yii::$app->controller->module->id == 'admin') { ?>
<?= Alert::widget() ?>
<div class="card mb-5">
<div class="card-header">
<h4 class="card-title"><?= Html::encode($this->title) ?></h4>
</div>
<div class="card-body">
<?= $content ?>
<div class="mb-4"></div>
</div>
</div>
<?php } else { ?>
<?= Alert::widget() ?>
<?= $content ?>
<?php } ?>
</div>
<!-- App body ends -->
<!-- App footer starts -->
<div class="app-footer bg-white">
<span>HANUMAN PATHOLOGY LIS v202411 ผลิตในประเทศไทย © 2024 <?php // date('Y')
?>
<?= Html::a('HANUMANIT Co., Ltd.', 'https://hanumanit.co.th', ['target' => '_blank']) ?></span>
</div>
<!-- App footer ends -->
</div>
<!-- App container ends -->
</div>
<!-- Main container ends -->
</div>
<!-- Page wrapper ends -->
<?= ToastrFlash::widget([
'options' => [
"closeButton" => true,
"debug" => false,
"newestOnTop" => true,
"progressBar" => true,
"positionClass" => "toast-top-center", //toast-top-center
"preventDuplicates" => false,
"onclick" => null,
"showDuration" => "8000",
"hideDuration" => "1000",
"timeOut" => "10000",
"extendedTimeOut" => "1000",
"showEasing" => "swing",
"hideEasing" => "linear",
"showMethod" => "fadeIn",
"hideMethod" => "fadeOut"
]
]) ?>
<?php //$this->registerJsFile(Yii::getAlias('@web').'/js/noti.js')
?>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage();