168 lines
6.6 KiB
PHP
168 lines
6.6 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
<title>One</title>
|
|
<link rel="stylesheet" href="../../../libs/vendor/css/google-fonts.css">
|
|
<link rel="stylesheet" href="../../../libs/vendor/css/vuetify.min.css">
|
|
</head>
|
|
|
|
<body>
|
|
<div v-cloak id="app">
|
|
<v-app id="smartApp" >
|
|
<one-navbar></one-navbar>
|
|
<v-content class="blue lighten-5" >
|
|
<v-container fluid pt-2 pb-2 pl-1 pr-1>
|
|
<v-layout column>
|
|
<v-flex xs12 pr-1>
|
|
<one-process-worklist-list-px></one-process-worklist-list-px>
|
|
</v-flex>
|
|
</v-layout>
|
|
</v-container>
|
|
</v-content>
|
|
<v-snackbar v-model="snackbar" :multi-line="true" class="box-info black--text" :timeout="4000" >
|
|
<span v-html="message_info"></span>
|
|
</v-snackbar>
|
|
<one-footer> </one-footer>
|
|
</v-app>
|
|
</div>
|
|
|
|
<!-- Vendor -->
|
|
<script src="../../../libs/vendor/axios.min.js"></script>
|
|
<script src="../../../libs/vendor/lodash.js"></script>
|
|
<script src="../../../libs/vendor/moment.min.js"></script>
|
|
<script src="../../../libs/vendor/moment-locale-id.js"></script>
|
|
<script src="../../../libs/vendor/vue.js"></script>
|
|
<script src="../../../libs/vendor/vuex.js"></script>
|
|
<script src="../../../libs/vendor/vuetify.js"></script>
|
|
<script src="../../../libs/vendor/httpVueLoader.js"></script>
|
|
<script src="../../../libs/one_global.js"></script>
|
|
<script src="../../../libs/vendor/socket.io.js"></script>
|
|
<!-- App Script -->
|
|
<?php
|
|
$ts = "?ts=" . Date("ymdhis");
|
|
?>
|
|
<script type="module">
|
|
|
|
import { store } from './store.js<?php echo $ts ?>';
|
|
//for testing
|
|
window.store = store;
|
|
var socketIoUrl = "http://" + window.location.host + ":9090/";
|
|
|
|
new Vue({
|
|
store,
|
|
el: '#app',
|
|
components: {
|
|
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
|
|
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
|
'one-process-worklist-list-px': httpVueLoader('./components/oneProcessWorklistListPx.vue'),
|
|
},
|
|
computed : {
|
|
},
|
|
data : {
|
|
socket : io.connect(socketIoUrl,{forceNew:false}),
|
|
message_info : '',
|
|
snackbar: false
|
|
},
|
|
methods : {
|
|
show_info(msg) {
|
|
this.$data.message_info = msg + "<br/>";
|
|
this.$data.snackbar = true;
|
|
},
|
|
search_px() {
|
|
this.$store.dispatch('worklist_patient/search_px')
|
|
},
|
|
async process_barcode(p,barcode,testID) {
|
|
|
|
let pre_msg = "Barcode : <b>" + barcode.toUpperCase() + "</b><br/>" +
|
|
"Patient : " + p.number + ", <b>" + p.name + '</b><br/>';
|
|
if (p.speciment_handling == 'N' ) {
|
|
this.show_info(pre_msg + 'Speciment <b>' + barcode + ' </b> belum selesai di proses di <b>Speciment Handling</b>')
|
|
return;
|
|
}
|
|
if ( p.requirements != null && p.is_confirm != 'Y' ) {
|
|
this.show_info(pre_msg + 'Speciment <b>' + barcode + '</b> memiliki catatan dan belum di konfirmasi! ')
|
|
return
|
|
}
|
|
/*
|
|
let analytics = this.$store.state.pre_analytic.pre_analytic
|
|
let idx = _.findIndex(analytics, function(a) { return a.T_TestID == testID } )
|
|
if (idx < 0 ) {
|
|
this.show_info(pre_msg + 'Pre-Analytic belum di lakukan!')
|
|
return
|
|
}
|
|
*/
|
|
if (p.speciment_handling == 'Y' && p.is_received == 'N' || p.is_received == null ) {
|
|
let prm = { T_OrderHeaderID : p.id, T_SampleTypeID : p.T_SampleTypeID }
|
|
await this.$store.dispatch("pre_analytic/receive",prm)
|
|
this.show_info(pre_msg + 'Speciment <b>' + barcode + '</b> sudah di terima! ')
|
|
this.search_px()
|
|
return
|
|
}
|
|
if ( p.is_received == 'Y' ) {
|
|
let prm = { T_OrderHeaderID : p.id, T_TestID : testID, T_SampleTypeID : p.T_SampleTypeID }
|
|
await this.$store.dispatch("pre_analytic/suggest",prm)
|
|
this.show_info(pre_msg + 'Speciment <b>' + barcode + '</b> disarankan ke ' +
|
|
this.$store.state.pre_analytic.suggested_worklist )
|
|
}
|
|
}
|
|
},
|
|
mounted () {
|
|
document.addEventListener('keypress',logKeyboard)
|
|
window.key_enter = ''
|
|
var self = this
|
|
async function logKeyboard(e) {
|
|
window.key_enter = (window.key_enter + e.key).toUpperCase()
|
|
if(e.key == 'Enter') {
|
|
let barcode = window.key_enter.replace('ENTER','');
|
|
window.key_enter = ''
|
|
if ( barcode.substr(0,3) == 'STF') {
|
|
self.$store.dispatch('staff/search',{search : barcode})
|
|
return
|
|
}
|
|
for(let i=0; i< self.$store.state.worklist_patient.pxs.length ; i++) {
|
|
let px = self.$store.state.worklist_patient.pxs[i];
|
|
let testID = px.T_TestID;
|
|
let pat = _.find(px.patients,{barcode: barcode.toUpperCase()})
|
|
if (pat) {
|
|
self.process_barcode(pat,barcode,testID)
|
|
return
|
|
}
|
|
}
|
|
self.show_info('Barcode : <b>' + barcode +'</b> tidak ditemukan');
|
|
}
|
|
|
|
}
|
|
self.socket.on("notification", async function(msg) {
|
|
switch(msg.type) {
|
|
case "specimen-col-receive" :
|
|
case "sample-handling-done" :
|
|
//await self.$store.dispatch('worklist_patient/search')
|
|
//await self.$store.dispatch('pre_analytic/getrequirements')
|
|
//await self.$store.dispatch('pre_analytic/get')
|
|
//if (self.$store.state.worklist_patient.worklists.length > 0 ) {
|
|
// let v = self.$store.state.worklist_patient.worklists[0]
|
|
// self.$store.commit('worklist_patient/update_selected_worklist', v)
|
|
self.$store.dispatch('worklist_patient/search_px')
|
|
//}
|
|
break;
|
|
}
|
|
});
|
|
}
|
|
})
|
|
</script>
|
|
<style>
|
|
[v-cloak] {
|
|
display: none
|
|
}
|
|
.box-info .v-snack__content {
|
|
background-color : rgb(255, 230, 255);
|
|
}
|
|
</style>
|
|
</body>
|
|
|
|
</html>
|