2024-12-25 03:04:59 +00:00
< ? php
use common\models\ApproveStatus ;
use common\models\CytoPapConsult ;
use common\models\CytoPapDiagnosis ;
use yii\data\ActiveDataProvider ;
use yii\grid\GridView ;
use yii\helpers\Html ;
use yii\widgets\ActiveForm ;
$this -> title = 'Cyto Gyn Case: ' . $case_pap -> id_case ;
$this -> params [ 'breadcrumbs' ][] = $this -> title ;
?>
< div class = " card md-4 " >
< div class = " card-body " >
< div class = " common-action md-4 " >
< ? php // Html::a('<i class="ri-contrast-drop-line"></i> สั่งย้อมพิเศษ', ['/pathologist/order/staining', 'id_case' => $case_pap->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_pap->id_case], ['class' => 'btn btn-info', 'target' => '_blank']) ?>
2024-12-25 03:04:59 +00:00
< ? php // Html::a('<i class="fa fa-comments"></i> Remark Report', ['/pathologist/order/remark-report', 'id_case' => $case_pap->id_case], ['class' => 'btn btn-block btn-info', 'target' => '_blank'])
?>
2025-03-24 02:04:57 +00:00
< ? = Html :: a ( '<i class="ri-question-answer-line"></i> Consult' , [ '/pathologist/order/pap-consult' , 'id_case' => $case_pap -> id_case ], [ 'class' => 'btn btn-primary' ]) ?>
2024-12-25 03:04:59 +00:00
<!--
< ? php /* if ( $pap_diagnosis ) { ?>
< ? = Html :: a ( '<i class="fa fa-comments"></i> Consult' , [ '/pathologist/order/pap-consult' , 'id_case' => $case_pap -> id_case ], [ 'class' => 'btn btn-info' ]) ?>
< ? php } */ ?>
-->
</ div >
< br />
< div class = " report-action " >
< ? = Html :: a ( '<i class="ri-file-text-line"></i> Final Report' , [ '/pathologist/do/pap-final' , 'id_case' => $case_pap -> id_case , 'type' => 'final' ], [ 'class' => 'btn btn-success' ]) ?>
< ? php if ( null != ( CytoPapDiagnosis :: find () -> where ([ 'id_case' => $case_pap -> id_case ]) -> andWhere ([ 'in' , 'report_type' , [ 'consult' , 'outlab' , 'consult-outlab' ]]) -> one ())) { ?>
2025-03-23 20:10:17 +00:00
< ? php
2024-12-25 03:04:59 +00:00
$consult = CytoPapConsult :: findOne ([ 'id_case' => $case_pap -> id_case , 'status' => 2 ]);
if ( isset ( $consult ) && $consult -> diagnosis_by == 1 ) { ?>
2025-03-23 20:10:17 +00:00
< ? = Html :: a ( '<i class="ri-chat-new-line"></i> Consult Report' , [ '/pathologist/do/pap-consult' , 'id_case' => $case_pap -> id_case , 'type' => 'consult' ], [ 'class' => 'btn btn-block btn-primary' ]) ?>
< ? php } ?>
< ? = Html :: a ( '<i class="ri-file-text-line"></i> Outlab Report' , [ '/pathologist/do/pap-outlab' , 'id_case' => $case_pap -> id_case , 'type' => 'outlab' ], [ 'class' => 'btn btn-block btn-warning' ]) ?>
< ? = Html :: a ( '<i class="ri-file-text-line"></i> Consult Outlab Report' , [ '/pathologist/do/pap-consult-outlab' , 'id_case' => $case_pap -> id_case , 'type' => 'consult-outlab' ], [ 'class' => 'btn btn-block btn-warning' ]) ?>
2024-12-25 03:04:59 +00:00
< ? php } ?>
</ div >
</ div >
</ div >
2025-03-25 17:48:16 +00:00
<!--
2024-12-25 03:04:59 +00:00
< div class = " card shadow 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_pap->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_pap,]) ?>
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 shadow 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_pap -> getFullname ()) ?> / <?= $case_pap->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_pap' , [ 'model' => $case_pap ]) ?>
</ div >
<!-- card body -->
</ div >
<!-- collapse -->
</ div >
<!--
< div class = " card shadow " >
< div class = " card-header " role = " tab " id = " headingFour " >
< h5 class = " card-title mb-0 " >
< a role = " button " data - toggle = " collapse " data - parent = " #accordion " href = " #collapseFour "
aria - expanded = " false " aria - controls = " collapseFour " >
< i data - feather = " user " style = " margin-top: -10px " ></ i > Specimen Information
: < ? = Html :: encode ( $case_pap -> getFullname ()) ?> / <?= $case_pap->id_case ?>
</ a >
</ h5 >
</ div >
< div id = " collapseFour " class = " panel-collapse collapse show in " role = " tabpanel "
aria - labelledby = " headingFour " >
< div class = " card-body " >
< ? php /* DetailView :: widget ([
'model' => $case_pap ,
'condensed' => false ,
'hover' => true ,
'mode' => DetailView :: MODE_VIEW ,
'panel' => false ,
'enableEditMode' => false ,
'attributes' => [
[
'columns' => [
[
'attribute' => 'clinical_diagnosis' ,
'format' => 'html' ,
'valueColOptions' => [ 'style' => 'width:90%' ]
],
],
],
[
'columns' => [
[
'attribute' => 'collection_at' ,
'format' => 'raw' ,
'valueColOptions' => [ 'style' => 'width:90%' ]
],
]
],
[
'columns' => [
[
'attribute' => 'gross_id' ,
'value' => isset ( $case_pap -> gross ) ? Html :: encode ( $case_pap -> gross -> realname ) : '' ,
'valueColOptions' => [ 'style' => 'width:30%' ]
],
[
'attribute' => 'gross_at'
]
]
],
]
]) */ ?>
</ div >
</ div >
</ div >
-->
<!-- card -->
</ div >
< div class = " card shadow 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-text-line " ></ i > Pathology Report
: < ? = Html :: encode ( $case_pap -> getFullname ()) ?> / <?= $case_pap->id_case ?>
</ a >
</ h5 >
</ div >
< div id = " collapseTwo " class = " panel-collapse collapse show in " role = " tabpanel " aria - labelledby = " headingTwo " >
< div class = " card-body " >
< ? php //= $form->errorSummary($case_surgical)
?>
< ? php //= $form->field($case_surgical, 'is_critical_diagnosis')->checkbox()
?>
< div class = " row " >
< div class = " col-sm-6 " >
< ? php //= Html::submitButton('<i class="fa fa-save"></i> Save', ['class' => 'btn btn-success btn-lg', 'value' => 'save', 'name' => 'surgical'])
?>
</ div >
< div class = " col-sm-6 text-right " >
</ div >
</ div >
< div class = " mb-5 " ></ div >
< ul class = " nav nav-tabs mb-3 " id = " nav-tab " role = " tablist " >
< li class = " nav-item " role = " presentation " >
< a class = " nav-link active " id = " nav-final-tab " data - bs - toggle = " tab " href = " #nav-final " role = " tab "
aria - controls = " nav-final " aria - selected = " false " > Final Report </ a >
</ li >
</ ul >
< div class = " tab-content " id = " pills-tabContent " >
< div class = " tab-pane fade show active " id = " nav-final " role = " tabpanel " aria - labelledby = " nav-final-tab " >
<!--
< ? php /*
$case_final = SurgicalDiagnosis :: findOne ([ 'id_case' => $case_surgical -> id_case ,
'report_type' => 'final' ,
'status_id' => 5 ,]);
if ( $case_final ) { ?>
< iframe src = " <?= Url::to(['/report/case/surgical-pdf-preview', 'id_case' => $case_surgical->id_case , 'report_type' => 'final', 'id' => $case_final->id ]) ?> "
frameborder = " 0 " height = " 800 " width = " 100% " ></ iframe >
< ? php } */ ?>
-->
< ? php if ( CytoPapDiagnosis :: find () -> where ([
'id_case' => $case_pap -> id_case ,
'report_type' => 'final'
]) -> count () > 0 ) { ?>
2025-03-23 20:10:17 +00:00
< ? = GridView :: widget ([
2024-12-25 03:04:59 +00:00
'dataProvider' => new ActiveDataProvider ([
'query' => CytoPapDiagnosis :: find () -> andFilterWhere ([
'id_case' => $case_pap -> id_case ,
'report_type' => 'final' ,
'status_id' => 5
])
]),
'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 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 >= 5 ) {
$case_type = Yii :: $app -> pathology -> getCaseType ( $model -> id_case );
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-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 ( $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 , 'watermark' => false ], [ 'class' => 'btn btn-sm btn-success btn-block' , 'target' => '_blank' ]) . $ap ;
}
}
},
],
] */
[
'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-pdf-2-line"></i> View Report' , Yii :: getAlias ( '@web' ) . '/' . $model -> uploadReportFolder . '/' . $val , [ 'class' => 'btn btn-sm btn-info btn-block' , 'target' => '_blank' ]);
}
} elseif ( $model -> report_type == 'consult-outlab' ) {
foreach ( $model -> getConsultReport () as $file => $val ) {
return Html :: a ( '<i class="ri-file-pdf-2-line"></i> View Report' , Yii :: getAlias ( '@web' ) . '/' . $model -> uploadConsultReportFolder . '/' . $val , [ 'class' => 'btn btn-sm btn-info btn-block' , 'target' => '_blank' ]);
}
} else {
return Html :: a ( '<i class="ri-file-pdf-2-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-sm btn-info btn-block' , 'target' => '_blank' ]) . $ap ;
}
}
},
],
]
]
]) ?>
< ? php } ?>
</ div >
< ? php //$this->registerJs("CKEDITOR.config.scayt_autoStartup = true;")
?>
</ div >
<!-- card body -->
</ div >
<!-- collapse -->
</ div >
<!-- card -->
</ div >
< ? php ActiveForm :: end () ?>
< ? php // $form->errorSummary([$case_pap])
?>
< ? php // $form->field($case_pap, 'id_case')->label(false)->hiddenInput()
?>