2024-12-25 03:04:59 +00:00
< ? php
use common\models\ApproveStatus ;
use common\models\CytoNonGynConsult ;
use common\models\CytoNonGynDiagnosis ;
use yii\data\ActiveDataProvider ;
use yii\helpers\Html ;
use yii\bootstrap5\ActiveForm ;
use yii\grid\GridView ;
$this -> title = 'Non-Gyn Case: ' . $case_non_gyn -> id_case ;
$this -> params [ 'breadcrumbs' ][] = $this -> title ;
?>
< div class = " card md-4 " >
< div class = " card-body " >
< div class = " common-action md-4 " >
< ? = Html :: a ( '<i class="ri-contrast-drop-line"></i> สั่งย้อมพิเศษ' , [ '/pathologist/order/staining' , 'id_case' => $case_non_gyn -> id_case ], [ 'class' => 'btn btn-primary' , 'target' => '_blank' ]) ?>
2025-01-21 02:56:57 +00:00
< ? php // Html::a('<i class="ri-chat-1-line"></i> สอบถามเพิ่มเติม', ['/pathologist/order/chat', 'id_case' => $case_non_gyn->id_case], ['class' => 'btn btn-info', 'target' => '_blank']) ?>
2025-03-24 02:04:57 +00:00
< ? = Html :: a ( '<i class="ri-question-answer-line"></i> Consult' , [ '/pathologist/order/non-gyn-consult' , 'id_case' => $case_non_gyn -> id_case ], [ 'class' => 'btn btn-primary' ]) ?>
2024-12-25 03:04:59 +00:00
< ? php /*
$approve_final = CenterApprove :: find ()
-> andFilterWhere ([
'report_type' => 'preliminary' ,
'id_case' => $case_non_gyn -> id_case ,
'approve_status' => 4
]) -> orWhere ([
'report_type' => 'final' ,
'id_case' => $case_non_gyn -> id_case ,
'approve_status' => 4
])
-> one (); ?>
< ? php if ( $approve_final ) { ?>
< ? = Html :: a ( '<i class="fa fa-comments"></i> Consult' , [ '/pathologist/order/non-gyn-consult' , 'id_case' => $case_non_gyn -> id_case ], [ 'class' => 'btn btn-info' ]) ?>
< ? php } */ ?>
< ? php // Html::a('<i class="fa fa-comments"></i> Cell Block', ['/pathologist/cell-block/non-gyn-send-cell-block', 'id_case' => $case_non_gyn->id_case], ['class' => 'btn btn-warning'])
?>
< ? php // Html::a('<i class="fa fa-comments"></i> Remark Report', ['/pathologist/order/remark-report', 'id_case' => $case_non_gyn->id_case], ['class' => 'btn btn-block btn-info', 'target' => '_blank'])
?>
</ div >
< br />
< div class = " report-action " >
2025-03-23 19:42:42 +00:00
< ? php // Html::a('<i class="ri-file-text-line"></i> Preliminary Report', ['/pathologist/do/non-gyn-preliminary', 'id_case' => $case_non_gyn->id_case, 'type' => 'preliminary'], ['class' => 'btn btn-success']) ?>
2024-12-25 03:04:59 +00:00
< ? = Html :: a ( '<i class="ri-file-text-line"></i> Final Report' , [ '/pathologist/do/non-gyn-final' , 'id_case' => $case_non_gyn -> id_case , 'type' => 'final' ], [ 'class' => 'btn btn-danger' ]) ?>
< ? php if ( null != ( CytoNonGynDiagnosis :: find () -> where ([ 'id_case' => $case_non_gyn -> id_case ]) -> andWhere ([ 'in' , 'report_type' , [ 'final' , 'consult' , 'preliminary' , 'outlab' , 'consult-outlab' ]]) -> one ())) { ?>
2025-03-23 19:42:42 +00:00
< ? php // Html::a('<i class="fa fa-plus"></i> Addendum Report', ['/pathologist/do/non-gyn-addendum', 'id_case' => $case_non_gyn->id_case, 'type' => 'addendum'], ['class' => 'btn btn-primary']) ?>
<!--< div class = " btn-group " role = " group " >
< button id = " btnGroupCorrect1 " type = " button " class = " btn btn-warning dropdown-toggle "
data - bs - toggle = " dropdown " aria - haspopup = " true " aria - expanded = " false " >
< i class = " fa fa-check " ></ i > Corrected Report
</ button >
< ul class = " dropdown-menu " aria - labelledby = " btnGroupCorrect1 " >
< ? php /* foreach (
2024-12-25 03:04:59 +00:00
CytoNonGynDiagnosis :: find () -> where ([
'id_case' => $case_non_gyn -> id_case
]) -> andWhere ([ '>' , 'status_id' , 3 ]) -> orderBy ([ 'id' => SORT_ASC ]) -> all () as $case_correct
) {
$approve = CenterApprove :: find () -> where ([
'id_case' => $case_non_gyn -> id_case ,
'approve_status' => 4 ,
'ref_id' => $case_correct -> id ,
2025-03-23 19:42:42 +00:00
]) -> one (); ?>
< ? php if ( $approve ) { ?>
< li >
< ? = Html :: a ( $case_correct -> id_case . '[' . ucfirst ( $case_correct -> report_type ) . ']-' . $case_correct -> pathologist_at , [ '/pathologist/do/non-gyn-corrected' , 'id_case' => $case_non_gyn -> id_case , 'from_id' => $case_correct -> id ], [ 'class' => 'dropdown-item' ]) ?>
</ li >
< ? php } ?>
< ? php } ?>
</ ul >
</ div >
< ? php //= Html::a('<i class="fa fa-check-square-o"></i> Revised Report', ['/pathologist/do/surgical-revise', 'id_case' => $case_non_gyn->id_case, 'type' => 'revised'], ['class' => 'btn btn-md btn-danger']) ?>
< div class = " btn-group " role = " group " >
< button id = " btnGroupCorrect1 " type = " button " class = " btn btn-danger dropdown-toggle "
data - bs - toggle = " dropdown " aria - haspopup = " true " aria - expanded = " false " >
< i class = " fa fa-check " ></ i > Revised Report
</ button >
< ul class = " dropdown-menu " aria - labelledby = " btnGroupCorrect1 " >
< ? php foreach (
2024-12-25 03:04:59 +00:00
CytoNonGynDiagnosis :: find () -> where ([
'id_case' => $case_non_gyn -> id_case
]) -> andWhere ([ '>' , 'status_id' , 3 ]) -> orderBy ([ 'id' => SORT_ASC ]) -> all () as $case_revise
) {
$approve = CenterApprove :: find () -> where ([
'id_case' => $case_non_gyn -> id_case ,
'approve_status' => 4 ,
'ref_id' => $case_revise -> id ,
]) -> one ();
?>
2025-03-23 19:42:42 +00:00
< ? php if ( $approve ) { ?>
< li >
< ? = Html :: a ( $case_revise -> id_case . '[' . ucfirst ( $case_revise -> report_type ) . ']-' . $case_revise -> pathologist_at , [ '/pathologist/do/non-gyn-revised' , 'id_case' => $case_non_gyn -> id_case , 'from_id' => $case_revise -> id , 'type' => 'revised' ], [ 'class' => 'dropdown-item' ]) ?>
</ li >
< ? php } ?>
< ? php } */ ?>
</ ul >
</ div >-->
2024-12-25 03:04:59 +00:00
< ? php } ?>
< ? php if ( null != ( CytoNonGynDiagnosis :: find () -> where ([ 'id_case' => $case_non_gyn -> id_case ]) -> andWhere ([ 'in' , 'report_type' , [ 'outlab' ]]) -> one ())) { ?>
2025-03-23 19:42:42 +00:00
< ? = Html :: a ( '<i class="ri-file-text-line"></i> Outlab Report' , [ '/pathologist/do/non-gyn-outlab' , 'id_case' => $case_non_gyn -> id_case , 'type' => 'outlab' ], [ 'class' => 'btn btn-block btn-warning' ]) ?>
2024-12-25 03:04:59 +00:00
< ? php } ?>
< ? php /*
$diagnosis_outlab = CytoNonGynDiagnosis :: find () -> andFilterWhere ([
'report_type' => 'outlab' ,
'id_case' => $case_non_gyn -> id_case ,
]) -> one (); ?>
< ? php if ( $diagnosis_outlab ) { ?>
< ? = Html :: a ( '<i class="fa fa-file-text"></i> Outlab Report' , [ '/pathologist/do/non-gyn-outlab' , 'id_case' => $case_non_gyn -> id_case , 'type' => 'outlab' ], [ 'class' => 'btn btn-warning' ]) ?>
< ? php } */ ?>
< ? php
$consult = CytoNonGynConsult :: findOne ([ 'id_case' => $case_non_gyn -> id_case , 'status' => 2 ]);
if ( isset ( $consult ) && $consult -> diagnosis_by == 1 ) { ?>
2025-03-23 19:42:42 +00:00
< ? = Html :: a ( '<i class="ri-chat-new-line"></i> Consult Report' , [ '/pathologist/do/non-gyn-consult' , 'id_case' => $case_non_gyn -> id_case , 'type' => 'consult' ], [ 'class' => 'btn btn-info' ]) ?>
2024-12-25 03:04:59 +00:00
< ? php } ?>
</ div >
< div class = " report-action " >
< div class = " mt-4 " >
< ? php if ( null != ( CytoNonGynDiagnosis :: find () -> where ([ 'id_case' => $case_non_gyn -> id_case ]) -> andWhere ([ 'in' , 'report_type' , [ 'consult-outlab' ]]) -> one ())) { ?>
2025-03-23 19:42:42 +00:00
< ? = Html :: a ( '<i class="ri-file-text-line"></i> Consult Outlab Report' , [ '/pathologist/do/non-gyn-consult-outlab' , 'id_case' => $case_non_gyn -> id_case , 'type' => 'consult-outlab' ], [ 'class' => 'btn btn-block btn-warning' ]) ?>
2024-12-25 03:04:59 +00:00
< ? php } ?>
</ div >
</ div >
</ div >
</ div >
2025-03-25 17:48:16 +00:00
<!--
2024-12-25 03:04:59 +00:00
< div class = " card mt-3 " >
< div class = " card-header " >
< h5 class = " card-title " >< i class = " ri-file-history-line " ></ i >
ประวัติการส่งตรวจของคนไข้ :
2025-03-25 17:48:16 +00:00
< ? php // Html::encode($case_non_gyn->getFullname()) ?>
2024-12-25 03:04:59 +00:00
</ h5 >
</ div >
< div class = " card-body " >
< div class = " row " >
< div class = " col-md-12 " >
2025-03-25 17:48:16 +00:00
< ? php // $this->render('history', ['case' => $case_non_gyn,]) ?>
2024-12-25 03:04:59 +00:00
</ div >
</ div >
</ div >
</ div >
2025-03-25 17:48:16 +00:00
-->
2024-12-25 03:04:59 +00:00
< ? php $form = ActiveForm :: begin () ?>
< div class = " accordion " id = " accordion " role = " tablist " aria - multiselectable = " true " >
< div class = " card mt-3 " >
< div class = " card-header " role = " tab " id = " headingOne " >
< h5 class = " card-title mb-0 " >
< a role = " button " data - toggle = " collapse " data - parent = " #accordion " href = " #collapseOne "
aria - expanded = " false " aria - controls = " collapseOne " >
< i class = " ri-file-user-line " ></ i > Patient Information
: < ? = Html :: encode ( $case_non_gyn -> getFullname ()) ?> / <?= $case_non_gyn->id_case ?>
</ a >
</ h5 >
</ div >
< div id = " collapseOne " class = " panel-collapse collapse show in " role = " tabpanel " aria - labelledby = " headingOne " >
< div class = " card-body " >
< ? = $this -> render ( '../../../register/views/case/_patient_non_gyn' , [ 'model' => $case_non_gyn ]) ?>
</ div >
<!-- card body -->
</ div >
<!-- collapse -->
</ div >
< div class = " card mt-3 " >
< div class = " card-header " role = " tab " id = " headingOne " >
< h5 class = " card-title mb-0 " >
< a role = " button " data - toggle = " collapse " data - parent = " #accordion " href = " #collapseOne "
aria - expanded = " false " aria - controls = " collapseOne " >
< i class = " ri-checkbox-multiple-fill " ></ i > Special Staining
: < ? = Html :: encode ( $case_non_gyn -> getFullname ()) ?> / <?= $case_non_gyn->id_case ?>
</ a >
</ h5 >
</ div >
< div id = " collapseOne " class = " panel-collapse collapse show in " role = " tabpanel " aria - labelledby = " headingOne " >
< div class = " card-body " >
< ? = GridView :: widget ([
'summary' => false ,
'dataProvider' => $finance_histo ,
'tableOptions' => [ 'class' => 'table truncate m-0 align-middle dataTable no-footer' ],
'columns' => [
[ 'class' => 'yii\grid\SerialColumn' ],
[
//'attribute' => 'charge_id',
'label' => 'Code' ,
'value' => function ( $model ) {
return $model -> charge -> code ;
},
],
[
//'attribute' => 'charge_id',
'label' => 'รายการย้อม' ,
'value' => function ( $model ) {
return $model -> charge -> name ;
},
],
[
//'attribute' => 'charge_id',
'format' => 'raw' ,
'label' => 'สถานะ' ,
'value' => function ( $model ) {
$arr = [ 1 => '<span class="badge bg-danger"> New Request</span>' , 2 => '<span class="badge bg-warning"> Section Case</span>' , 3 => '<span class="badge bg-primary"> Staining Case</span>' , 4 => '<span class="badge bg-success"> Send Case</span>' ];
return isset ( $model -> histoStatus ) ? ( $arr [ $model -> histoStatus -> status_1 ]) : '' ;
},
],
]
]) ?>
</ div >
<!-- card body -->
</ div >
<!-- collapse -->
</ div >
< div class = " card mt-3 " >
< div class = " card-header " role = " tab " id = " headingOne " >
< h5 class = " card-title mb-0 " >
< a role = " button " data - toggle = " collapse " data - parent = " #accordion " href = " #collapseOne "
aria - expanded = " false " aria - controls = " collapseOne " >
< i class = " ri-checkbox-multiple-fill " ></ i > Immuno Staining
: < ? = Html :: encode ( $case_non_gyn -> getFullname ()) ?> / <?= $case_non_gyn->id_case ?>
</ a >
</ h5 >
</ div >
< div id = " collapseOne " class = " panel-collapse collapse show in " role = " tabpanel " aria - labelledby = " headingOne " >
< div class = " card-body " >
< ? = GridView :: widget ([
'summary' => false ,
'dataProvider' => $finance_immuno ,
'tableOptions' => [ 'class' => 'table truncate m-0 align-middle dataTable no-footer' ],
'columns' => [
[ 'class' => 'yii\grid\SerialColumn' ],
[
//'attribute' => 'charge_id',
'label' => 'Code' ,
'value' => function ( $model ) {
return $model -> charge -> code ;
},
],
[
//'attribute' => 'charge_id',
'label' => 'รายการย้อม' ,
'value' => function ( $model ) {
return $model -> charge -> name ;
},
],
[
//'attribute' => 'charge_id',
'format' => 'raw' ,
'label' => 'สถานะ' ,
'value' => function ( $model ) {
$arr = [ 1 => '<span class="badge bg-danger"> New Request</span>' , 2 => '<span class="badge bg-warning"> Section Case</span>' , 3 => '<span class="badge bg-primary"> Staining Case</span>' , 4 => '<span class="badge bg-success"> Send Case</span>' ];
return isset ( $model -> immunoStatus ) ? ( $arr [ $model -> immunoStatus -> status_1 ]) : '' ;
},
],
]
]) ?>
</ div >
<!-- card body -->
</ div >
<!-- collapse -->
</ div >
<!-- card -->
< div class = " card mt-3 " >
< div class = " card-header " role = " tab " id = " headingTwo " >
< h5 class = " card-title mb-0 " >
< a class = " collapsed " role = " button " data - toggle = " collapse " data - parent = " #accordion " href = " #collapseTwo "
aria - expanded = " true " aria - controls = " collapseTwo " >
< i class = " ri-file-pdf-2-line " ></ i > Pathology Report
: < ? = Html :: encode ( $case_non_gyn -> getFullname ()) ?> / <?= $case_non_gyn->id_case ?>
</ a >
</ h5 >
</ div >
< div id = " collapseTwo " class = " panel-collapse collapse show in " role = " tabpanel " aria - labelledby = " headingTwo " >
< div class = " card-body " >
< ? php if ( CytoNonGynDiagnosis :: find () -> where ([
'id_case' => $case_non_gyn -> id_case
]) -> count () > 0 ) { ?>
2025-03-23 19:42:42 +00:00
< ? = GridView :: widget ([
2024-12-25 03:04:59 +00:00
'dataProvider' => new ActiveDataProvider ([
'query' => CytoNonGynDiagnosis :: find () -> andFilterWhere ([
'id_case' => $case_non_gyn -> id_case
]),
'sort' => [
'defaultOrder' => [
'pathologist_at' => SORT_DESC
]
]
]),
'tableOptions' => [ 'class' => 'table truncate m-0 align-middle dataTable no-footer' ],
'columns' => [
[ 'class' => 'yii\grid\SerialColumn' ],
'id_case' ,
'pathologist_at' ,
[
'attribute' => 'status_id' ,
'value' => function ( $model ) {
// return isset($model->status) ? Html::encode($model->status->name) : '';
return isset ( $model -> status ) ? ( $model -> status -> name ) : '' ;
}
],
/* [
'class' => 'yii\grid\ActionColumn' ,
'template' => '{view}' ,
'buttons' => [
'view' => function ( $url , $model , $key ) {
if ( $model -> status_id >= 4 ) {
$case_type = Yii :: $app -> pathology -> getCaseType ( $model -> id_case );
$case = Yii :: $app -> pathology -> getCase ( $model -> id_case );
if ( $model -> report_type == 'outlab' ) {
foreach ( $case -> getReport () as $file => $val ) {
return Html :: a ( '<span class="fa fa-file-pdf-o"></span> View Report' , Yii :: getAlias ( '@web' ) . '/' . $case -> uploadReportFolder . '/' . $val , [ 'class' => 'btn btn-sm btn-success btn-block' , 'target' => '_blank' ]);
}
} else {
return Html :: a ( '<span class="fa fa-file-pdf-o"></span> View Report' , [ '/report/case/' . $case_type . '-pdf' , 'id_case' => $model -> id_case , 'report_type' => $model -> report_type , 'id' => $model -> id , 'mode' => 'final' , 'file' => false ], [ 'class' => 'btn btn-sm btn-success btn-block' , 'target' => '_blank' ]);
}
}
},
]
] */
[
'class' => 'yii\grid\ActionColumn' ,
'template' => '{view}' ,
'buttons' => [
'view' => function ( $url , $model , $key ) {
if ( $model -> status_id >= 4 ) {
$ap = '' ;
$approve = ApproveStatus :: findOne ([ 'id_case' => $model -> id_case , 'report_type' => $model -> report_type , 'ref_id' => $model -> id ]);
if ( $approve && $approve -> approve_status < 4 ) {
return '<span class="badge badge-danger">รอตรวจสอบ</span>' ;
}
$case_type = Yii :: $app -> pathology -> getCaseType ( $model -> id_case );
$case = Yii :: $app -> pathology -> getCase ( $model -> id_case );
if ( $model -> report_type == 'outlab' ) {
foreach ( $model -> getReport () as $file => $val ) {
return Html :: a ( '<i class="ri-file-text-line"></i> View Report' , Yii :: getAlias ( '@web' ) . '/' . $model -> uploadReportFolder . '/' . $val , [ 'class' => 'btn btn-info btn-block' , 'target' => '_blank' ]);
}
}
if ( $model -> report_type == 'consultoutlab' ) {
foreach ( $model -> getConsultReport () as $file => $val ) {
return Html :: a ( '<i class="ri-file-text-line"></i> View Report' , Yii :: getAlias ( '@web' ) . '/' . $model -> uploadConsultReportFolder . '/' . $val , [ 'class' => 'btn btn-info btn-block' , 'target' => '_blank' ]);
}
} else {
return Html :: a ( '<i class="ri-file-text-line"></i> View Report' , [ '/report/case/' . $case_type . '-pdf' , 'id_case' => $model -> id_case , 'report_type' => $model -> report_type , 'id' => $model -> id , 'mode' => 'final' , 'file' => false , 'watermark' => false ], [ 'class' => 'btn btn-info btn-block' , 'target' => '_blank' ]) . $ap ;
}
}
},
],
]
]
]) ?>
< ? php } ?>
</ div >
</ div >
< ? php //$this->registerJs("CKEDITOR.config.scayt_autoStartup = true;")
?>
</ div >
</ div >
< ? php ActiveForm :: end () ?>