Files
FE_CPONE/test/vuex/one-process-resultverification-v21/components/oneProcessRePxList.vue
2026-04-27 10:13:31 +07:00

714 lines
24 KiB
Vue

<template>
<v-layout class="fill-height" column>
<v-card class="grow">
<!-- <v-subheader>
<h3 class="title">DAFTAR PASIEN</h3>
</v-subheader> -->
<hr style="border-top:0px solid #c8c8c8;" />
<v-data-table
:headers="headers" :items="pxs"
:loading="isLoading"
hide-actions class="xelevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pt-2 pb-2 pr-2 green--text" v-bind:class="[margin_left(props.item), verification_color(props.item)]"
@click="select(props.index, props.item)" v-if="props.item.is_result == 'N'" colspan="8">
{{ props.item.t_testname }}
</td>
<td class="text-xs-left pt-2 pb-2 pr-2 green--text" v-bind:class="[margin_left(props.item), verification_color(props.item)]"
@click="select(props.index, props.item)" v-if="props.item.is_result == 'Y'">
{{ props.item.t_testname }}
</td>
<td class="text-xs-left pa-2" v-bind:class="[is_selected(props.item), verification_color(props.item)]"
@click="select(props.index, props.item)" v-if="props.item.is_result == 'Y'" style="position: relative">
<span v-if="props.item.ResultGroupName === 'LAB'" class="body-1">{{init_result(props.item)}}
<v-btn style="width: 28px;padding-bottom: 10px;"
v-if="props.item.is_quantitative == 'Y' && props.item.result_instrument_n > 0 "
color="blue lighten-2" class="btn_rerun" icon flat small @click="rerun_me(props.index, props.item)">
<v-img :src="icon_info" aspect-ratio="1" height="15" contain></v-img>
</v-btn>
</span>
<span v-if="props.item.ResultGroupName === 'DFI'" class="body-1">{{init_result(props.item)}}
<v-btn fab
v-if="props.item.result === null || props.item.result === ''"
small color="grey" class="ma-0 ml-2">
<v-icon>description</v-icon>
</v-btn>
<v-btn fab
v-if="props.item.result !== null && props.item.result !== ''"
dark small color="#26c6da" class="ma-0 ml-2" @click="openDialogDNAFRagmentasi(props.item)">
<v-icon small>description</v-icon>
</v-btn>
</span>
<span v-if="props.item.ResultGroupName === 'FNA'" class="body-1">{{init_result(props.item)}}
<v-btn fab
v-if="props.item.result === null || props.item.result === ''"
small color="grey" class="ma-0 ml-2">
<v-icon>description</v-icon>
</v-btn>
<v-btn fab
v-if="props.item.result !== null && props.item.result !== ''"
dark small color="#26c6da" class="ma-0 ml-2" @click="openDialogFNA(props.item)">
<v-icon small>description</v-icon>
</v-btn>
</span>
<span v-if="props.item.ResultGroupName === 'Preparasi Sperma'" class="body-1">{{init_result(props.item)}}
<v-btn fab
v-if="props.item.result === null || props.item.result === ''"
small color="grey" class="ma-0 ml-2">
<v-icon>description</v-icon>
</v-btn>
<v-btn fab
v-if="props.item.result !== null && props.item.result !== ''"
dark small color="#26c6da" class="ma-0 ml-2" @click="openDialogPreparasiSperma(props.item)">
<v-icon small>description</v-icon>
</v-btn>
</span>
<span v-if="props.item.ResultGroupName === 'Cytologi'" class="body-1">{{init_result(props.item)}}
<v-btn fab
v-if="props.item.result === null || props.item.result === ''"
small color="grey" class="ma-0 ml-2">
<v-icon>description</v-icon>
</v-btn>
<v-btn fab
v-if="props.item.result !== null && props.item.result !== ''"
dark small color="#26c6da" class="ma-0 ml-2" @click="openDialogCytologi(props.item)">
<v-icon small>description</v-icon>
</v-btn>
</span>
<span v-if="props.item.ResultGroupName === 'Papsmear'" class="body-1">{{init_result(props.item)}}
<v-btn fab
v-if="props.item.result === null || props.item.result === ''"
small color="grey" class="ma-0 ml-2">
<v-icon>description</v-icon>
</v-btn>
<v-btn fab
v-if="props.item.result !== null && props.item.result !== ''"
dark small color="#26c6da" class="ma-0 ml-2" @click="openDialogPapsmear(props.item)">
<v-icon small>description</v-icon>
</v-btn>
</span>
<span v-if="props.item.ResultGroupName === 'Mikro'" class="body-1">{{init_result(props.item)}}
<v-btn fab
v-if="props.item.result === null || props.item.result === ''"
small color="grey" class="ma-0 ml-2">
<v-icon>description</v-icon>
</v-btn>
<v-btn fab
v-if="props.item.result !== null && props.item.result !== ''"
dark small color="#26c6da" class="ma-0 ml-2" @click="openDialogMikro(props.item)">
<v-icon small>description</v-icon>
</v-btn>
</span>
<span v-if="props.item.ResultGroupName === 'Pap Smear (Liquid C Prep)'" class="body-1">{{init_result(props.item)}}
<v-btn fab
v-if="props.item.result === null || props.item.result === ''"
small color="grey" class="ma-0 ml-2">
<v-icon>description</v-icon>
</v-btn>
<v-btn fab
v-if="props.item.result !== null && props.item.result !== ''"
dark small color="#26c6da" class="ma-0 ml-2" @click="openDialogLcprep(props.item)">
<v-icon small>description</v-icon>
</v-btn>
</span>
<!-- <v-textarea
label=""
solo
rows=1
hide-details
v-on:keyup="update_result(props.index, $event.target.value)"
:value="props.item.result"
flat
readonly
></v-textarea> -->
</td>
<td class="text-xs-left pa-2" v-bind:class="[is_selected(props.item), verification_color(props.item)]"
@click="select(props.index, props.item)" v-if="props.item.is_result == 'Y'">
<span v-if="props.item.is_result=='Y' "
class="one-critical-value" :data-detail-id="props.item.id" style="margin-right:20px"></span>
{{ !init_blank(props.item) ? props.item.result_flag : '' }}
</td>
<td class="text-xs-left pa-2" v-bind:class="[is_selected(props.item), verification_color(props.item)]"
@click="select(props.index, props.item)" v-if="props.item.is_result == 'Y'">
{{ !init_blank(props.item) ? props.item.normal_note : '' }}
</td>
<td class="text-xs-left pa-2" v-bind:class="[is_selected(props.item), verification_color(props.item)]"
@click="select(props.index, props.item)" v-if="props.item.is_result == 'Y'">
{{ !init_blank(props.item) ? props.item.unit_name : '' }}
</td>
<td class="text-xs-left pa-2" v-bind:class="[is_selected(props.item), verification_color(props.item)]"
@click="select(props.index, props.item)" v-if="props.item.is_result == 'Y'">
{{ !init_blank(props.item) ? props.item.methode_name : '' }}
</td>
<td class="text-xs-left pa-2" v-bind:class="[is_selected(props.item), verification_color(props.item)]"
@click="select(props.index, props.item)" v-if="props.item.is_result == 'Y'">
<span class="body-1">{{props.item.note}}</span>
</td>
<td class="text-xs-left pa-1" v-if="props.item.is_result == 'Y' && props.item.result != '' && props.item.result != null" @click="select(props.index, props.item)" v-bind:class="[verification_color(props.item)]">
<div class="text-xs-center">
<div class="text-xs-center">
<v-btn fab
:style="{visibility: props.item.CriticalValue == 'Y' ? 'hidden': 'visible'}"
:dark="props.item.verification_old != 'Y'"
:disabled="props.item.verification_old == 'Y'"
small color="red" class="ma-0 float-left" @click="reject(props.item)">
<v-icon>clear</v-icon>
</v-btn>
<v-btn fab
:style="{visibility: props.item.CriticalValue == 'Y' ? 'hidden': 'visible'}"
:dark="verification(props.item) == 'Y' && props.item.validation != 'Y'"
:disabled="props.item.validation == 'Y'"
small :color="verification(props.item) == 'Y' ? 'green' : 'white'" class="ml-1 ma-0 float-left" @click="verification_change(props.index)" >
<v-icon>done</v-icon>
</v-btn>
<!-- <v-checkbox label="" :input-value="verification(props.item)" value="Y" false-value="N" @change="verification_change($event, props.index)" class="mt-1 mr-1 ml-0 mb-0 cb-auto-ver" hide-details></v-checkbox> -->
<div style="left:-20px;position:relative;display:inline-block;min-width:80px;padding:0px;"
class="one-auto-vv" :data-header-id="props.item.T_OrderDetailT_OrderHeaderID"
:data-detail-id="props.item.id"> </div>
</div>
</div>
</td>
<td class="text-xs-left pa-1" v-if="props.item.is_result == 'Y' && (props.item.result == '' || props.item.result == null)" v-bind:class="[verification_color(props.item)]">
</td>
</template>
</v-data-table>
</v-card>
<one-process-re-rerun-result></one-process-re-rerun-result>
<one-process-re-history></one-process-re-history>
<v-snackbar
v-model="snackbar"
:timeout="5000"
bottom right
>
{{ save_text }}
<v-btn
color="pink"
flat
@click="snackbar = false"
>
Close
</v-btn>
</v-snackbar>
<v-snackbar
v-model="snackbar_err"
:timeout="5000"
bottom right
color="red"
>
{{ err_text }}
<v-btn
color="pink"
flat
@click="snackbar_err = false"
>
Close
</v-btn>
</v-snackbar>
<one-process-re-fna></one-process-re-fna>
<one-process-re-papsmear></one-process-re-papsmear>
<one-process-re-cytologi></one-process-re-cytologi>
<one-process-rv-dialog-trend></one-process-rv-dialog-trend>
<one-process-rv-dialog-pre></one-process-rv-dialog-pre>
<one-process-rv-dialog-reject></one-process-rv-dialog-reject>
<one-process-re-lcprep></one-process-re-lcprep>
<one-process-re-mikro></one-process-re-mikro>
<one-process-re-preparasisperma></one-process-re-preparasisperma>
<one-process-re-dnafragmentasi></one-process-re-dnafragmentasi>
</v-layout>
</template>
<style scoped>
div.v-table__overflow {
height:640px!important;
overflow-y:scroll;
}
.searchbox .v-input.v-text-field .v-input__slot{
min-height:60px;
}
.searchbox .v-btn {
min-height:60px;
}
table.v-table tbody td,table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
.btn_rerun {
position: absolute;
top: 4px;
right: 2px
}
.v-btn--floating {
border-radius: 0%;
}
.cb-auto-ver {
float: left;
}
.cb-auto-ver .v-icon {
font-size: 40px;
}
.v-btn--floating.v-btn--small {
height: 30px;
width: 30px;
}
.float-left {
float: left !important
}
.v-textarea.v-text-field--box.v-text-field--single-line .v-text-field__prefix, .v-textarea.v-text-field--box.v-text-field--single-line textarea, .v-textarea.v-text-field--enclosed.v-text-field--single-line .v-text-field__prefix, .v-textarea.v-text-field--enclosed.v-text-field--single-line textarea {
margin-top: 2px;
}
.v-textarea.v-text-field--solo .v-input__append-inner, .v-textarea.v-text-field--solo .v-input__append-outer, .v-textarea.v-text-field--solo .v-input__prepend-inner, .v-textarea.v-text-field--solo .v-input__prepend-outer {
align-self: flex-start;
margin-top: 3px;
}
.v-textarea.v-text-field--solo .v-input__append-inner .v-input__icon {
align-items: center;
display: inline-flex;
height: 24px;
flex: 1 0 auto;
justify-content: center;
min-width: 24px;
width: 24px;
padding-bottom: 6px;
padding-left: 18px;
}
.v-text-field.v-text-field--solo .v-input__append-outer, .v-text-field.v-text-field--solo .v-input__prepend-outer {
margin-top: 3px;
}
</style>
<script>
let ts = '?ts=' + moment().format('YYMMDDhhmmss')
module.exports = {
components : {
'one-process-re-rerun-result': httpVueLoader('./oneProcessReRerunResult.vue'+ ts ),
'one-process-re-history': httpVueLoader('./oneProcessReHistory.vue'+ ts ),
'one-process-rv-dialog-trend': httpVueLoader('./oneProcessRvDialogTrend.vue'+ ts ),
'one-process-rv-dialog-pre': httpVueLoader('./oneProcessRvDialogPre.vue'+ ts ),
'one-process-rv-dialog-reject': httpVueLoader('./oneProcessRvDialogReject.vue'+ ts ),
'one-process-re-fna': httpVueLoader('./oneResultFNA.vue'+ ts ),
'one-process-re-cytologi': httpVueLoader('./oneResultCytologi.vue' + ts ),
'one-process-re-papsmear': httpVueLoader('./oneResultPapsmear.vue'+ ts ),
'one-process-re-lcprep': httpVueLoader('./oneResultLcprep.vue' + ts ),
'one-process-re-mikro': httpVueLoader('./oneResultMikro.vue' + ts ),
'one-process-re-preparasisperma': httpVueLoader('./oneResultPreparasiSperma.vue' + ts ),
'one-process-re-dnafragmentasi': httpVueLoader('./oneResultDNAFragmentasi.vue' + ts )
},
data() {
return {
query: "",
save_text: "Data berhasil dikonfirmasi.",
err_text: "Tidak ada data yang perlu dikonfirmasi !",
items: [],
headers: [
{
text: "NAMA PEMERIKSAAN",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "HASIL",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "FLAG",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NILAI NORMAL",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "UNIT",
align: "left",
sortable: false,
value: "mr",
width: "7%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "METODE",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "CATATAN",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "VERIFIKASI",
align: "left",
sortable: false,
value: "mr",
width: "18%",
class: "pa-2 blue lighten-3 white--text"
}
],
};
},
methods : {
openDialogDNAFRagmentasi(value){
this.$store.dispatch("re_dnafragmentasi/get_dnafragmentasiresult",value)
},
openDialogCytologi(value){
this.$store.dispatch("re_cytologi/get_cytologiresult",value)
},
openDialogFNA(value){
this.$store.dispatch("re_fna/get_fnaresult",value)
},
openDialogPreparasiSperma(value){
this.$store.dispatch("re_preparasisperma/get_preparasispermaresult",value)
},
openDialogPapsmear(value){
this.$store.dispatch("re_papsmear/get_papsmearresult",value)
},
openDialogLcprep(value){
this.$store.commit("re_lcprep/update_selected_lcprep",value)
this.$store.dispatch("re_lcprep/get_lcprepresult",value)
},
openDialogMikro(value){
this.$store.commit("re_mikro/update_selected_mikro",value)
this.$store.dispatch("re_mikro/get_mikroresult",value)
},
oneMoment : function(d) {
return window.oneMoment(d)
},
select (idx, item) {
this.$store.commit('re_px/update_selected_px', item)
this.$store.commit('re_px/update_selected_px_idx', idx)
// this.$store.commit('ver_verification/update_selected_sent_sample', item)
},
is_selected (item) {
return ''
},
margin_left (item) {
if (item.level == 3 || item.level == 2)
return 'pl-5'
return 'pl-2'
},
rerun_me (idx,item) {
this.select(idx, item)
this.$store.commit('re_px/update_dialog_rerun', true)
},
update_result(idx, result) {
let x = this.$store.state.re_px.pxs
x[idx]['result'] = result
this.$store.commit('re_px/update_pxs', {records:x})
},
update_note(idx, note) {
let x = this.$store.state.re_px.pxs
x[idx]['note'] = note
this.$store.commit('re_px/update_pxs', {records:x})
},
verification(i) {
if (i.verification == "N" || i.verification == "Y")
return i.verification
//if (i.sample_handling_perfect != "Y")
// return "N"
//if (i.delta_check == "N" || i.trend_analysis == "N")
// return "N"
return "Y"
},
async verification_change(idx) {
let x = this.$store.state.re_px.pxs
let e = x[idx].verification
x[idx].verification = e == 'Y' ? 'N' : 'Y'
let prm = { order_id : x[idx].id , verification: x[idx].verification}
await this.$store.dispatch("re_px/single_verification",prm)
if ( e == 'Y' ) {
x[idx].verification_old = 'N'
} else {
x[idx].verification_old = 'Y'
}
this.$store.commit("re_px/update_pxs", {records:x})
},
verification_show(idx) {
this.$store.commit("re_verification/update_dialog_verification", true)
},
trend(x) {
this.$store.dispatch('re_px/trend_analysis');
},
requirement(x) {
let info = {title: 'Requirement for ' + x.t_testname,
image: '' , note : x.requirement.note }
this.$store.commit('re_px/update_info_trend', info)
this.$store.commit('re_px/update_dialog_trend', true)
},
delta(x) {
if (x.delta_check.is_normal_normal) {
let info = {title: 'Delta Check ' ,
image: '' , note : x.delta_check.note }
this.$store.commit('re_px/update_info_trend', info)
} else {
this.$store.dispatch('re_px/delta_check')
}
this.$store.commit('re_px/update_dialog_trend', true)
},
async show_preanalytic(item) {
let xinfo = 'Pre Analytic belum terpenuni'
let xload = true
let red = true
if (item.pre_analytic == 'Y' ) {
xinfo = 'Pre Analytic sudah terpenuhi'
xload = false
red = false
}
this.$store.commit('re_px/update_dialog_pre', true)
let info = {
title: 'PreAnalytic ' + item.t_testname,
note: xinfo,
red : red,
load: xload
};
this.$store.commit('re_px/update_info_pre',info)
if ( xload ) {
await this.$store.dispatch("re_px/pre_analytic");
info = this.$store.state.re_px.info_pre
info.load = false
this.$store.commit('re_px/update_info_pre',info)
}
},
pre_analytic_color(x) {
switch(x.pre_analytic){
case "Y":
return "green";
break;
case "N":
return "red";
break;
default:
return "grey"
}
},
trend_color(x) {
switch(x.trend_analysis.status){
case "Y":
return "green";
break;
case "N":
return "red";
break;
default:
return "grey"
}
},
show_requirement(x) {
return x.requirement.status == "X"
},
delta_color(x) {
switch(x.delta_check.status){
case "Y":
return "green";
break;
case "N":
return "red";
break;
default:
return "grey"
}
},
init_result(x) {
if (x.verification_old == "Y" || x.validation == "Y")
return x.result
// Override
if (x.resample == "Y") {
if (x.resample_status == "N")
return "Bahan belum"
if (x.resample_status == "R")
return "Hasil Menyusul"
if (x.resample_status == "W")
return x.result
}
if (x.sample_receive != 'Y')
return "Bahan belum"
if (x.sample_receive == 'Y' && !x.pre_analytic)
return "Belum Pre Analitik"
if (x.sample_receive == 'Y' && x.pre_analytic)
{
if (x.sample_worklist_receive == "Y")
return x.result
else
return "Hasil Menyusul"
}
},
init_blank(x) {
if (x.verification_old == "Y" || x.validation == "Y")
return false
// Override
if (x.resample == "Y") {
if (x.resample_status == "N" || x.resample_status == "R")
return true
}
if (x.sample_receive != 'Y' || !x.pre_analytic || x.sample_worklist_receive != "Y" ||
x.result == '' || x.result == null)
return true
return false
},
reject(x) {
this.$store.commit('re_px/update_dialog_reject', true)
},
verification_color(i) {
if (i.validation == "Y")
return "green lighten-4"
if (i.verification_old == "Y")
return "red lighten-4"
return""
}
},
computed : {
isLoading() {
return this.$store.state.re_px.search_status == 1
},
pxs () {
return this.$store.state.re_px.pxs
},
icon_info () {
return window.BASE_URL + '/one-ui/apps/image/info.png'
},
snackbar : {
get () { return this.$store.state.re_px.snackbar },
set (v) { this.$store.commit('re_px/update_snackbar', v) }
},
snackbar_err : {
get () { return this.$store.state.re_px.snackbar_err },
set (v) { this.$store.commit('re_px/update_snackbar_err', v) }
},
selected_patient() {
return this.$store.state.re_patient.selected_patient;
}
},
watch : {
selected_patient(n,o) {
let cv_itv_retry = 0;
let me = this;
let cv_itv = setInterval(function() {
if (window.render_one_critical_value != undefined && window.render_one_critical_value_header != undefined) {
clearInterval(cv_itv);
window.render_one_critical_value();
window.render_one_critical_value_header();
} else {
cv_itv_retry++;
}
},800);
// auto vv
let autovv_retry = 0;
let autovv_itv = setInterval(function() {
if (window.oneAutoVvRender != undefined && window.oneAutoVvStatusRender != undefined) {
clearInterval(autovv_itv);
console.log("AutoVV Retry",autovv_retry);
window.oneAutoVvStatusRender();
window.oneAutoVvRender();
} else{
autovv_retry++;
}
},1100);
}
},
mounted () {
// this.$store.dispatch('re_patient/search')
}
}
</script>