540 lines
25 KiB
Vue
540 lines
25 KiB
Vue
<template>
|
|
<div>
|
|
<v-dialog v-model="dialogprintlang" persistent max-width="450">
|
|
<v-card class="align-center justify-center">
|
|
<v-card-title style="padding:0px;" primary-title dark color="blue-grey" class="blue-grey white--text">
|
|
<v-subheader style="color:#fff!important">PILIH BAHASA</v-subheader>
|
|
</v-card-title>
|
|
<v-card-text>
|
|
<!--<v-select class="ma-1 mini-select" :items="dialoglangs"
|
|
item-text="name"
|
|
return-object
|
|
v-model="xselectedlang"
|
|
label="Bahasa" outline hide-details>
|
|
</v-select>-->
|
|
<v-switch style="margin-top:0;padding-top:0" @change="changeSwitch(lang.chex,index)" v-for="(lang,index) in dialoglangs" v-model="lang.chex === 'Y'" :label="lang.name"></v-switch>
|
|
</v-card-text>
|
|
<v-card-actions>
|
|
<v-spacer></v-spacer>
|
|
<v-btn color="grey ligthen-1" flat @click="dialogprintlang = false">Batal</v-btn>
|
|
<v-btn color="blue-grey" flat @click="doPrintAfterLang()">Cetak</v-btn>
|
|
|
|
</v-card-actions>
|
|
</v-card>
|
|
</v-dialog>
|
|
<v-dialog v-model="xdialogaction" persistent max-width="350">
|
|
<v-card>
|
|
<v-card-title color="warning" class="headline">Konfirmasi</v-card-title>
|
|
<v-card-text v-html="xmsgaction">
|
|
|
|
</v-card-text>
|
|
<v-card-actions>
|
|
<v-spacer></v-spacer>
|
|
<v-btn color="primary darken-1" flat @click="closeDialogAction()">Ya</v-btn>
|
|
<v-btn color="error darken-1" flat @click="xdialogaction = false">Tutup</v-btn>
|
|
</v-card-actions>
|
|
</v-card>
|
|
</v-dialog>
|
|
<v-dialog v-model="xdialogimage" persistent max-width="650" max-height="500">
|
|
<v-card color="amber lighten-5">
|
|
<v-container grid-list-sm fluid>
|
|
<v-layout row wrap>
|
|
<v-flex>
|
|
<v-card flat tile class="d-flex">
|
|
<v-img
|
|
:src="ximage"
|
|
aspect-ratio="1"
|
|
class="grey lighten-2"
|
|
>
|
|
<template v-slot:placeholder>
|
|
<v-layout
|
|
fill-height
|
|
align-center
|
|
justify-center
|
|
ma-0
|
|
>
|
|
<v-progress-circular indeterminate color="grey lighten-5"></v-progress-circular>
|
|
</v-layout>
|
|
</template>
|
|
</v-img>
|
|
</v-card>
|
|
</v-flex>
|
|
</v-layout>
|
|
</v-container>
|
|
<v-card-actions>
|
|
|
|
<v-spacer></v-spacer>
|
|
<v-btn color="black" dark @click="xdialogimage = false">Tutup</v-btn>
|
|
</v-card-actions>
|
|
<v-card>
|
|
</v-dialog>
|
|
<v-layout row mb-2 wrap>
|
|
<v-flex xs12 pr-1>
|
|
<v-card>
|
|
<v-layout class="align-center" pt-1 pb-1 row>
|
|
<v-flex pt-1 pb-1 pl-2 pr-2 xs12>
|
|
<span class="left" style="font-size:x-large;padding-top: 3px;">NO REG : {{patient.ordernumber}}</span>
|
|
<span class="right">
|
|
<v-chip label color="pink" text-color="white">
|
|
{{patient.deliveries}}
|
|
</v-chip>
|
|
</span>
|
|
</v-flex>
|
|
</v-layout>
|
|
<v-divider></v-divider>
|
|
<v-layout pt-1 pb-2 row>
|
|
<v-flex pt-1 pb-1 pl-2 xs4>
|
|
<v-text-field ma-1
|
|
label="NAMA PASIEN"
|
|
class="text-uppercase"
|
|
:value="patient.patient_fullname"
|
|
hide-details
|
|
></v-text-field>
|
|
</v-flex>
|
|
<v-flex pt-1 pb-1 pl-2 xs2>
|
|
<v-text-field ma-1
|
|
label="JENIS KELAMIN"
|
|
class="text-uppercase"
|
|
:value="patient.sexname"
|
|
hide-details
|
|
></v-text-field>
|
|
</v-flex>
|
|
<v-flex pt-1 pb-1 pl-2 pr-1 xs4>
|
|
<v-text-field ma-1
|
|
label="UMUR"
|
|
class="text-uppercase"
|
|
:value="patient.umur"
|
|
hide-details
|
|
></v-text-field>
|
|
</v-flex>
|
|
<v-flex pt-1 pb-1 pl-2 pr-1 xs3>
|
|
<v-text-field ma-1
|
|
label="PENGIRIM"
|
|
class="text-uppercase"
|
|
:value="patient.doctor_sender"
|
|
hide-details
|
|
></v-text-field>
|
|
</v-flex>
|
|
</v-layout>
|
|
</v-card>
|
|
</v-flex>
|
|
</v-layout>
|
|
<v-layout mb-2 row v-for="(test,index) in xtests" wrap>
|
|
<v-flex xs12 pr-1>
|
|
<v-card>
|
|
<v-layout row>
|
|
<v-flex xs12>
|
|
<v-subheader red--text text--lighten-1>
|
|
<v-chip v-if="test.status === 'NEW'" label color="grey" text-color="white">
|
|
<v-icon left>label</v-icon>{{test.test_name}}
|
|
</v-chip>
|
|
<v-chip v-if="test.status === 'VAL1'" label color="warning" text-color="white">
|
|
<v-icon left>label</v-icon>{{test.test_name}}
|
|
</v-chip>
|
|
<v-chip v-if="test.status === 'VAL2'" label color="success" text-color="white">
|
|
<v-icon left>label</v-icon>{{test.test_name}}
|
|
</v-chip>
|
|
<v-chip label color="info" outline >
|
|
<v-icon left>assignment_ind</v-icon>{{test.doctor_fullname}}
|
|
</v-chip>
|
|
<v-menu
|
|
bottom
|
|
origin="center center"
|
|
transition="scale-transition"
|
|
>
|
|
<template v-slot:activator="{ on }">
|
|
<v-btn
|
|
color="primary"
|
|
dark
|
|
depressed
|
|
style="margin-left:4px;height:32px;padding:2px 8px"
|
|
small
|
|
v-on="on"
|
|
>
|
|
{{selectedlangName(test)}}
|
|
</v-btn>
|
|
</template>
|
|
|
|
<v-list>
|
|
<v-list-tile
|
|
v-for="(lang, i) in xlangs(test)"
|
|
:key="i"
|
|
@click="selectLang(test,lang)"
|
|
>
|
|
<v-list-tile-title>{{ lang.name }}</v-list-tile-title>
|
|
</v-list-tile>
|
|
</v-list>
|
|
</v-menu>
|
|
<v-tooltip right>
|
|
<template v-slot:activator="{ on }">
|
|
<v-icon v-on="on" @click="pasteTemplate(test,index)" style="cursor: pointer;" large>assignment</v-icon>
|
|
</template>
|
|
<span>pasang template</span>
|
|
</v-tooltip>
|
|
<v-flex text-md-right>
|
|
<span v-if="test.status === 'VAL1' || test.status === 'VAL2'" @click="print(test,'print')" class="icon-medium-fill-base-small xs1 white--text blue-grey icon-print"></span>
|
|
<!--<v-btn v-if="test.status === 'VAL2'" @click="unval2(test,'unval2')" small outline class="icon-unval" color="success"></v-btn>-->
|
|
<!--<span v-if="test.status === 'VAL2'" @click="unval2(test,'unval2')" class="icon-medium-fill-base-small xs1 white--text success icon-unval"></span>-->
|
|
<!--<v-btn v-if="test.status === 'VAL1'" @click="val2(test,'val2')" small color="success">Validasi</v-btn>-->
|
|
<!--<span v-if="test.status === 'VAL1'" @click="val2(test,'val2')" class="icon-medium-fill-base-small xs1 white--text success icon-vv"></span>-->
|
|
<!--<v-btn v-if="test.status === 'VAL1'" @click="unval1(test,'unval1')" small outline color="warning">Batalkan Verifikasi</v-btn>-->
|
|
<span v-if="test.status === 'VAL1'" @click="unval1(test,'unval1')" class="icon-medium-fill-base-small xs1 white--text warning icon-unval"></span>
|
|
<!--<v-btn v-if="test.status === 'NEW'" @click="val1(test,'val1')" small color="warning">Verifikasi</v-btn>-->
|
|
<span v-if="test.status === 'NEW' && check_saved(test)" @click="val1(test,'val1')" class="icon-medium-fill-base-small xs1 white--text warning icon-v"></span>
|
|
<!--<v-btn v-if="test.status === 'NEW'" @click="saveResult(test,'save')" small color="info">Simpan</v-btn>-->
|
|
<span v-if="test.status === 'NEW'" @click="saveResult(test,'save')" class="icon-medium-fill-base-small xs1 white--text info icon-save"></span>
|
|
</v-flex>
|
|
</v-subheader>
|
|
<v-divider></v-divider>
|
|
<v-layout row wrap>
|
|
<v-flex xs12 pa-2 pt-1>
|
|
<v-layout align-center justify-center v-for="(result,idxresult) in test.details" row>
|
|
<v-flex class="text-xs-center" xs1>
|
|
<v-tooltip left>
|
|
<template v-slot:activator="{ on }">
|
|
<v-icon v-on="on" @click="pasteTemplate(result,index)" style="cursor: pointer;" large>assignment</v-icon>
|
|
</template>
|
|
<span>pasang template</span>
|
|
</v-tooltip>
|
|
|
|
</v-flex>
|
|
<v-flex xs10 pa-1>
|
|
<v-textarea
|
|
filled
|
|
outline
|
|
hide-details
|
|
:label="result.result_label"
|
|
@change="changeResult()"
|
|
:disabled="test.status !== 'NEW' || test.doctor_id === '0'"
|
|
v-model="result.result_value"
|
|
rows="3"
|
|
></v-textarea>
|
|
</v-flex>
|
|
<v-flex class="text-xs-center" xs1>
|
|
<v-switch
|
|
v-model="result.flag_print === 'Y'"
|
|
@change="changeFlagPrint(result.flag_print,idxresult,index)"
|
|
></v-switch>
|
|
|
|
</v-flex>
|
|
</v-layout>
|
|
</v-flex>
|
|
</v-layout>
|
|
<v-divider></v-divider>
|
|
</v-flex>
|
|
</v-flex>
|
|
</v-card>
|
|
</v-flex>
|
|
</v-layout>
|
|
<one-dialog-print :title="printtitle" :width="printwidth" :height="500" :status="openprint" :urlprint="urlprint" @close-dialog-print="closePrint"></one-dialog-print>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
table, td, th {
|
|
border: 1px solid #ddd;
|
|
text-align: left;
|
|
}
|
|
|
|
table {
|
|
border-collapse: collapse;
|
|
width: 100%;
|
|
}
|
|
|
|
th, td {
|
|
padding-top: 5px;
|
|
padding-bottom: 5px;
|
|
padding-left: 8px;
|
|
padding-right: 5px;
|
|
}
|
|
|
|
.mini-input .v-input{
|
|
margin-top: 0px;
|
|
}
|
|
|
|
.mini-input .v-input, .mini-input .v-input--selection-controls,.mini-input .v-input__slot{
|
|
margin-top: 0px;
|
|
margin-bottom:0px;
|
|
margin-left:3px;
|
|
}
|
|
.mini-input .v-messages{
|
|
min-height:0px;
|
|
}
|
|
input.fhm-input{
|
|
border: 1px solid black;
|
|
border-radius: 2px;
|
|
-webkit-box-shadow:
|
|
inset 0 0 2px rgba(0,0,0,0.1),
|
|
0 0 4px rgba(0,0,0,0.1);
|
|
-moz-box-shadow:
|
|
inset 0 0 2px rgba(0,0,0,0.1),
|
|
0 0 4px rgba(0,0,0,0.1);
|
|
box-shadow:
|
|
inset 0 0 2px rgba(0,0,0,0.1),
|
|
0 0 4px rgba(0,0,0,0.1);
|
|
padding: 2px 4px;
|
|
background: rgba(255,255,255,0.5);
|
|
margin: 0 0 1px 0;
|
|
width:30px;
|
|
text-align:center;
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
module.exports = {
|
|
components : {
|
|
'one-dialog-print':httpVueLoader('../../common/oneDialogPrintX.vue')
|
|
},
|
|
data: () => ({
|
|
openprint:false,
|
|
urlprint:'',
|
|
printtitle:'',
|
|
printwidth:600
|
|
}),
|
|
computed: {
|
|
xdialogaction:{
|
|
get() {
|
|
return this.$store.state.sample.dialog_action
|
|
},
|
|
set(val) {
|
|
this.$store.commit("sample/update_dialog_action",val)
|
|
}
|
|
},
|
|
xmsgaction:{
|
|
get() {
|
|
return this.$store.state.sample.msg_action
|
|
},
|
|
set(val) {
|
|
this.$store.commit("sample/update_msg_action",val)
|
|
}
|
|
},
|
|
xtests(){
|
|
return this.$store.state.sample.selected_transaction.details
|
|
},
|
|
patient(){
|
|
return this.$store.state.sample.selected_transaction
|
|
},
|
|
xdialogimage:{
|
|
get() {
|
|
return this.$store.state.sample.dialog_image
|
|
},
|
|
set(val) {
|
|
this.$store.commit("sample/update_dialog_image",val)
|
|
}
|
|
},
|
|
ximage() {
|
|
return this.$store.state.sample.image
|
|
},
|
|
dialoglangs:{
|
|
get() {
|
|
return this.$store.state.sample.langs
|
|
},
|
|
set(val) {
|
|
this.$store.commit("sample/update_item_langs",val)
|
|
}
|
|
},
|
|
xselectedlang:{
|
|
get() {
|
|
return this.$store.state.sample.selected_lang
|
|
},
|
|
set(val) {
|
|
this.$store.commit("sample/update_selected_lang",val)
|
|
}
|
|
},
|
|
dialogprintlang:{
|
|
get() {
|
|
return this.$store.state.sample.dialog_print_lang
|
|
},
|
|
set(val) {
|
|
this.$store.commit("sample/update_dialog_print_lang",val)
|
|
}
|
|
},
|
|
},
|
|
methods : {
|
|
changeSwitch(value,idx){
|
|
//console.log(value)
|
|
_.forEach(this.dialoglangs, function(num) { num.chex = 'N' })
|
|
this.dialoglangs[idx].chex = value === 'Y' ?'N':'Y'
|
|
},
|
|
changeFlagPrint(value,rst_idx,test_idx){
|
|
var selected_patient = this.$store.state.sample.selected_transaction
|
|
console.log(selected_patient)
|
|
selected_patient.details[test_idx].details[rst_idx].flag_print = value === 'Y' ?'N':'Y'
|
|
//console.log(selected_patient[test_idx][rst_idx])
|
|
this.$store.dispatch("sample/save_flagprint",{selected_trx:selected_patient,row:selected_patient.details[test_idx].details[rst_idx]})
|
|
},
|
|
xlangs(test){
|
|
return test.langs
|
|
},
|
|
check_saved(test){
|
|
var arrdetails = test.details
|
|
var notempty = _.filter(arrdetails, function(o) { return o.result_value_before !== '' })
|
|
//console.log(notempty)
|
|
if(notempty.length === 0)
|
|
return false
|
|
else
|
|
return true
|
|
},
|
|
selectedLang(value){
|
|
return {id:value.language_id,name:value.language_name}
|
|
},
|
|
selectedlangName(value){
|
|
return value.language_name
|
|
},
|
|
selectLang(trx,lang){
|
|
console.log(trx)
|
|
var arr = this.$store.state.sample.selected_transaction
|
|
var arrdetails = arr.details
|
|
let idx = _.findIndex(arrdetails, function(o) { return o.trx_id == trx.trx_id })
|
|
//console.log("aye")
|
|
this.$store.dispatch("sample/getrstbylang",{
|
|
trx:trx,
|
|
lang:lang,
|
|
selected_trx:this.$store.state.sample.selected_transaction,
|
|
idx:idx,
|
|
detail:arrdetails[idx]})
|
|
},
|
|
changeResult(){
|
|
this.$store.commit("sample/update_no_save",1)
|
|
},
|
|
saveResult(trx,act){
|
|
var ar = this.$store.state.sample.transactions
|
|
var arr = this.$store.state.sample.selected_transaction
|
|
let idx = _.findIndex(ar, function(o) { return o.trx_id == arr.trx_id })
|
|
this.$store.dispatch("sample/saveresult",{
|
|
startdate:this.$store.state.sample.start_date,
|
|
enddate: this.$store.state.sample.end_date,
|
|
search:this.$store.state.sample.name_lab,
|
|
stationid:this.$store.state.sample.selected_station.id,
|
|
groupid:this.$store.state.sample.select_item_group.id,
|
|
subgroupid:this.$store.state.sample.select_item_subgroup.id,
|
|
lastid:arr.trx_id,
|
|
trx:trx,
|
|
trx_numbering:arr.ordernumber,
|
|
act:act
|
|
})
|
|
},
|
|
val1(trx,act){
|
|
console.log(act)
|
|
this.$store.commit("sample/update_act",act)
|
|
this.$store.commit("sample/update_last_trx",trx)
|
|
var arr = this.$store.state.sample.selected_transaction
|
|
var msg = "Anda yakin akan melakukan validasi untuk pemeriksaan "+trx.test_name+" dari pasien "+arr.patient_fullname+" ?"
|
|
this.$store.commit("sample/update_msg_action",msg)
|
|
this.$store.commit("sample/update_dialog_action",true)
|
|
},
|
|
unval1(trx,act){
|
|
console.log(act)
|
|
this.$store.commit("sample/update_act",act)
|
|
this.$store.commit("sample/update_last_trx",trx)
|
|
var arr = this.$store.state.sample.selected_transaction
|
|
var msg = "Anda yakin akan membatalkan validasi untuk pemeriksaan "+trx.test_name+" dari pasien "+arr.patient_fullname+" ?"
|
|
this.$store.commit("sample/update_msg_action",msg)
|
|
this.$store.commit("sample/update_dialog_action",true)
|
|
},
|
|
val2(trx,act){
|
|
console.log(act)
|
|
this.$store.commit("sample/update_act",act)
|
|
this.$store.commit("sample/update_last_trx",trx)
|
|
var arr = this.$store.state.sample.selected_transaction
|
|
var msg = "Anda yakin akan melakukan validasi untuk pemeriksaan "+trx.test_name+" dari pasien "+arr.patient_fullname+" ?"
|
|
this.$store.commit("sample/update_msg_action",msg)
|
|
this.$store.commit("sample/update_dialog_action",true)
|
|
},
|
|
unval2(trx,act){
|
|
console.log(act)
|
|
this.$store.commit("sample/update_act",act)
|
|
this.$store.commit("sample/update_last_trx",trx)
|
|
var arr = this.$store.state.sample.selected_transaction
|
|
var msg = "Anda yakin akan membatalkan validasi untuk pemeriksaan "+trx.test_name+" dari pasien "+arr.patient_fullname+" ?"
|
|
this.$store.commit("sample/update_msg_action",msg)
|
|
this.$store.commit("sample/update_dialog_action",true)
|
|
},
|
|
doPrintAfterLang(){
|
|
this.dialogprintlang = false
|
|
var trx = this.$store.state.sample.selected_test
|
|
var idx_true = _.findIndex(this.dialoglangs, item => item.chex === 'Y')
|
|
this.xselectedlang = this.dialoglangs[idx_true]
|
|
this.printwidth = 1028
|
|
this.printtitle = ""
|
|
let idx = trx.orderid
|
|
let user = one_user()
|
|
var d = new Date();
|
|
var n = d.getTime()
|
|
var rptname = ''
|
|
if(trx.type === 'xray')
|
|
rptname = 'rpt_hasil_so_xray'
|
|
if(trx.type === 'usg')
|
|
rptname = 'rpt_hasil_so_usg'
|
|
if(trx.type === 'bdm')
|
|
rptname = 'rpt_hasil_so_bdm'
|
|
if(this.xselectedlang.code === 'EN'){
|
|
if(trx.type === 'xray')
|
|
rptname = 'rpt_hasil_so_xray_eng'
|
|
if(trx.type === 'usg')
|
|
rptname = 'rpt_hasil_so_usg_eng'
|
|
if(trx.type === 'bdm')
|
|
rptname = 'rpt_hasil_so_bdm_eng'
|
|
}
|
|
// rptname = 'rpt_hasil_so_eng'
|
|
|
|
this.urlprint = "/birt/run?__report=report/one/lab/"+rptname+".rptdesign&__format=pdf&username="+user.M_UserUsername+"&PID="+idx+'&PLang='+trx.language_id+'&tm='+n
|
|
|
|
this.openprint = true
|
|
},
|
|
print(trx,act){
|
|
// console.log(trx)
|
|
this.dialogprintlang = true
|
|
var nowlang = trx.langs
|
|
_.forEach(nowlang, function(num) { num.chex = 'N' })
|
|
var lang_idx = _.findIndex(nowlang, function(o) { return o.id == trx.language_id })
|
|
nowlang[lang_idx].chex = 'Y'
|
|
this.$store.commit("sample/update_item_langs",nowlang )
|
|
this.xselectedlang = trx.langs[0]
|
|
this.$store.commit("sample/update_selected_test",trx)
|
|
this.$store.commit("sample/update_act",act)
|
|
this.$store.commit("sample/update_last_trx",trx)
|
|
|
|
},
|
|
closePrint(){
|
|
this.openprint = false
|
|
var prm = this.$store.state.sample.last_trx
|
|
this.$store.dispatch("sample/printcount",prm)
|
|
},
|
|
closeDialogAction(){
|
|
var trx = this.$store.state.sample.last_trx
|
|
var act = this.$store.state.sample.act
|
|
this.saveResult(trx,act)
|
|
},
|
|
openImage(value){
|
|
this.$store.commit("sample/update_selected_photo",value)
|
|
this.$store.commit("sample/update_image",value.newname)
|
|
this.$store.commit("sample/update_dialog_image",true)
|
|
},
|
|
pasteTemplate(rst,idx){
|
|
var seltrx = this.$store.state.sample.selected_transaction
|
|
var datax = seltrx.details[idx]
|
|
if(datax.status === 'NEW'){
|
|
if(!rst.result_value){
|
|
var prm = {
|
|
seltrx:seltrx,
|
|
idx:idx,
|
|
seltmp:rst,
|
|
trx_id:rst.trx_id,
|
|
template_detail_id:rst.template_detail_id,
|
|
doctor_id:datax.doctor_id,
|
|
language_id:datax.language_id,
|
|
test_id:datax.test_id}
|
|
this.$store.dispatch("sample/gettemplate",prm)
|
|
}else{
|
|
var msg = "Sudah ada isinya dong ... dihapus dulu"
|
|
this.$store.commit("sample/update_msg_info",msg)
|
|
this.$store.commit("sample/update_open_dialog_info",true)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
</script>
|