Flatten nested repos

This commit is contained in:
sas.fajri
2026-04-27 10:13:31 +07:00
parent 01c2963a43
commit 8347aef8f4
17935 changed files with 5015229 additions and 3 deletions

View File

@@ -0,0 +1,75 @@
// API :
// search bank
// paramater : query , page , rowPerPage
const URL =
"/one-api/mockup/process/instrumentorder/";
export async function search_px(start_date, end_date, search, page) {
try {
var resp = await axios.post(URL + 'io_left/search_px', {
start_date: start_date,
end_date: end_date,
search: search,
page: page
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function search_patient(start_date, end_date, search, page) {
try {
var resp = await axios.post(URL + 'io_left/search_patient', {
start_date: start_date,
end_date: end_date,
search: search,
page: page
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function search_worklist(search, page) {
try {
var resp = await axios.post(URL + 'io_left/search_worklist', {
search: search,
page: page
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,97 @@
// API :
// search bank
// paramater : query , page , rowPerPage
const URL =
"/one-api/mockup/process/instrumentorder/";
export async function search_px(order_id, page) {
try {
var resp = await axios.post(URL + 'io_right/search_px', {
order_id: order_id,
page: page
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function search_patient(start_date, end_date, px_id, page) {
try {
var resp = await axios.post(URL + 'io_right/search_patient', {
start_date: start_date,
end_date: end_date,
px_id: px_id,
page: page
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function search_worklist_patient(start_date, end_date, worklist_id, page) {
try {
var resp = await axios.post(URL + 'io_right/search_worklist_patient', {
start_date: start_date,
end_date: end_date,
worklist_id: worklist_id,
page: page
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function send_orders(token, datax) {
try {
var resp = await axios.post(URL + 'io_right/send_orders', {
token: token,
data: datax
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,137 @@
<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:0patient solid #c8c8c8;" />
<v-data-table
:headers="headers" :items="patients"
:loading="isLoading"
hide-actions class="xelevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2 green--text" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
{{ props.item.order_number }}
</td>
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
{{ props.item.patient_name }}
</td>
</template>
</v-data-table>
<v-pagination
v-model="curr_patient_page"
:length="total_patient_page"
:total-visible="5"
@input="change_page"
></v-pagination>
</v-card>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot{
min-height:60patient;
}
.searchbox .v-btn {
min-height:60patient;
}
table.v-table tbody td,table.v-table tbody th {
height: 40patient;
}
table.v-table thead tr {
height: 40patient;
}
</style>
<script>
module.exports = {
data() {
return {
query: "",
items: [],
headers: [
{
text: "KODE",
align: "left",
sortable: false,
value: "mr",
width: "30%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
value: "mr",
width: "70%",
class: "pa-2 blue lighten-3 white--text"
}
],
isLoading: false
};
},
methods : {
oneMoment : function(d) {
return window.oneMoment(d)
},
select (item) {
this.$store.commit('io_left_patient_list/update_selected_patient', item)
this.$store.commit('io_left_patient_list/update_id', item.order_id)
this.$store.dispatch('io_right_px_list/search')
// this.$store.dispatch('re_patient/search')
// this.$store.commit('ver_verification/update_selected_sent_sample', item)
},
is_selected (item) {
let x = this.$store.state.io_left_patient_list.selected_patient
if (!x)
return ''
if (x.order_id == item.order_id)
return 'green lighten-4'
return ''
},
change_page(x) {
this.curr_patient_page = x
this.$store.dispatch('io_left_patient_list/search')
}
},
computed : {
patients () {
return this.$store.state.io_left_patient_list.patients
},
total_patient () {
return this.$store.state.io_left_patient_list.total_patient
},
total_patient_page () {
return this.$store.state.io_left_patient_list.total_patient_page
},
curr_patient_page : {
get () { return this.$store.state.io_left_patient_list.curr_patient_page },
set (v) { this.$store.commit('io_left_patient_list/update_curr_patient_page', v) }
}
},
mounted () {
let d = new Date().toISOString().substr(0, 10)
this.$store.commit('io_left_patient_list/update_sdate', d)
this.$store.commit('io_left_patient_list/update_edate', d)
this.$store.dispatch('io_left_patient_list/search')
}
}
</script>

View File

@@ -0,0 +1,235 @@
<template>
<v-layout class="fill-height" column>
<v-card class="grow">
<v-subheader style="min-height:81px">
<h3 class="title">DAFTAR PEMERIKSAAN BY ORDER <strong class="red--text">[ {{ patient_name }} ]</strong></h3>
<v-spacer></v-spacer>
<v-btn color="primary" dark @click="send_orders">Kirim ({{send_count}})</v-btn>
</v-subheader>
<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 pa-2 green--text" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
{{ props.item.t_testcode }}
</td>
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
{{ props.item.t_testname }}
</td>
<td class="text-xs-left pl-2 pr-2 pt-1 pb-1" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
<v-select
:items="props.item.instrument"
label=""
solo
@change="update_instrument_item(props.index, $event)"
:value="props.item.instrument_id"
item-value="T_InstrumentID"
item-text="T_InstrumentName"
hide-details
clearable
></v-select>
</td>
<td class="text-xs-center pa-2" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
<v-checkbox :value="props.item.send" true-value="Y" false-value="N"
@change="update_send_item(props.index, $event)"
:disabled="props.item.send_disabled"
class=" ml-2"></v-checkbox>
</td>
</template>
</v-data-table>
<v-pagination
v-model="curr_px_page"
:length="total_px_page"
:total-visible="5"
@input="change_page"
></v-pagination>
</v-card>
<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-layout>
</template>
<style scoped>
/* .searchbox .v-input.v-text-field .v-input__slot{
min-height:60px;
} */
/* .searchbox .v-btn {
min-height:60px;
} */
table.v-table thead tr {
height: 40px;
}
</style>
<script>
module.exports = {
data() {
return {
save_text: 'Data berhasil terkirim',
query: "",
items: [],
headers: [
{
text: "KODE PEMERIKSAAN",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NAMA PEMERIKSAAN",
align: "left",
sortable: false,
value: "mr",
width: "40%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "INSTRUMENT",
align: "left",
sortable: false,
value: "mr",
width: "30%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "KIRIM",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
}
],
isLoading: false
};
},
methods : {
oneMoment : function(d) {
return window.oneMoment(d)
},
select (item) {
},
is_selected (item) {
return ''
},
change_page(x) {
this.curr_px_page = x
this.$store.dispatch('io_right_px_list/search')
},
update_send_item(idx, val) {
if (val == null) val = "N"
let x = this.$store.state.io_right_px_list.pxs
x[idx].send = val
let total = this.$store.state.io_right_px_list.total_px
let total_page = this.$store.state.io_right_px_list.total_px_page
this.$store.commit('io_right_px_list/update_pxs',
{records:x, total:total, total_page:total_page})
},
update_instrument_item(idx, val) {
if (!val) val = 0
let x = this.$store.state.io_right_px_list.pxs
x[idx].instrument_id = val
if (val != 0) {
x[idx].send_disabled = false
x[idx].send = "Y"
}
else {
x[idx].send_disabled = true
x[idx].send = "N"
}
let total = this.$store.state.io_right_px_list.total_px
let total_page = this.$store.state.io_right_px_list.total_px_page
this.$store.commit('io_right_px_list/update_pxs',
{records:x, total:total, total_page:total_page})
},
send_orders () {
this.$store.dispatch('io_right_px_list/send_orders')
}
},
computed : {
pxs () {
return this.$store.state.io_right_px_list.pxs
},
total_px () {
return this.$store.state.io_right_px_list.total_px
},
total_px_page () {
return this.$store.state.io_right_px_list.total_px_page
},
curr_px_page : {
get () { return this.$store.state.io_right_px_list.curr_px_page },
set (v) { this.$store.commit('io_right_px_list/update_curr_px_page', v) }
},
patient_name() {
return this.$store.state.io_left_patient_list.selected_patient.patient_name
},
send_count() {
let x = this.$store.state.io_right_px_list.pxs
let y = 0
for (let i in x)
if (x[i].send == "Y")
y = y + 1
return y
},
snackbar : {
get () { return this.$store.state.io_right_px_list.snackbar },
set (v) { this.$store.commit('io_right_px_list/update_snackbar', v) }
}
},
mounted () {
}
}
</script>

View File

@@ -0,0 +1,77 @@
<template>
<v-card class="mb-1 pa-1">
<v-layout row>
<v-flex xs12>
<v-layout>
<one-date-picker
label="Start Date"
:date="null"
@change="startDateChange"
:data="null"
:max_date="null"
class="mr-4"
hint="DD-MM-YYYY"
></one-date-picker>
<v-layout>
<one-date-picker
label="End Date"
:date="null"
@change="endDateChange"
:data="null"
:max_date="null"
class="mr-4"
hint="DD-MM-YYYY"
></one-date-picker>
<v-text-field class="flex xs8 ma-1"
label=""
placeholder="Nama"
single-line
solo
hide-details
v-model="search"
></v-text-field>
<v-btn class="flex xs6 ma-1" color="success" @click="searchs" >
Search
</v-btn>
</v-layout>
</v-flex>
</v-layout>
</v-card>
</template>
<style scoped>
button {
height: 48px;
}
</style>
<script>
module.exports = {
components : {
'one-date-picker' : httpVueLoader('../oneDatePicker2.vue')
},
computed : {
search : {
get () { return '' },
set (v) { this.$store.commit('io_left_patient_list/update_search', v) }
}
},
methods : {
searchs() {
this.$store.dispatch('io_left_patient_list/search')
},
startDateChange(prm) {
this.$store.commit('io_left_patient_list/update_sdate', prm.new_date)
},
endDateChange(prm) {
this.$store.commit('io_left_patient_list/update_edate', prm.new_date)
}
}
}
</script>

View File

@@ -0,0 +1,296 @@
<template>
<v-layout class="fill-height" column>
<v-card class="grow">
<v-subheader style="min-height:81px">
<v-layout row wrap>
<v-flex xs6>
<h3 class="title">DAFTAR ORDER BY TEST <br><strong class="red--text caption">[ {{ px_name }} ]</strong></h3>
</v-flex>
<v-flex xs4>
<v-select
:items="instruments"
label="Pilih Instrument"
solo
hide-details
clearable
item-value="T_InstrumentID"
item-text="T_InstrumentName"
@change="update_instrument_id"
:value="instrument_id"
></v-select>
<!-- <v-spacer></v-spacer> -->
</v-flex>
<v-flex xs2>
<v-btn color="primary" block dark @click="send_orders" class="ml-2 mt-0 mb-0 fill-height">Kirim ({{send_count}})</v-btn>
</v-flex>
</v-layout>
</v-subheader>
<v-data-table
:headers="headers" :items="patients"
:loading="isLoading"
hide-actions class="xelevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2 green--text" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
{{ props.item.order_number }}
</td>
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
{{ props.item.patient_name }}
<h5 class="caption">{{ props.item.test_name }}</h5>
</td>
<td class="text-xs-left pl-2 pr-2 pt-1 pb-1" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
<v-select
:items="props.item.instrument"
label=""
solo
@change="update_instrument_item(props.index, $event)"
:value="props.item.instrument_id"
item-value="T_InstrumentID"
item-text="T_InstrumentName"
hide-details
clearable
></v-select>
</td>
<td class="text-xs-center pa-2" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
<v-checkbox :value="props.item.send" true-value="Y" false-value="N"
@change="update_send_item(props.index, $event)"
:disabled="props.item.send_disabled"
class="mt-1 ml-2"
hide-details></v-checkbox>
</td>
</template>
</v-data-table>
<v-pagination
v-model="curr_patient_page"
:length="total_patient_page"
:total-visible="5"
@input="change_page"
></v-pagination>
</v-card>
<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-layout>
</template>
<style scoped>
/* .searchbox .v-input.v-text-field .v-input__slot{
min-height:60px;
} */
/* .searchbox .v-btn {
min-height:60px;
} */
table.v-table thead tr {
height: 40px;
}
</style>
<script>
module.exports = {
data() {
return {
save_text: 'Data berhasil terkirim',
query: "",
items: [],
headers: [
{
text: "NOMOR LAB",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
value: "mr",
width: "40%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "INSTRUMENT",
align: "left",
sortable: false,
value: "mr",
width: "30%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "KIRIM",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
}
],
isLoading: false
};
},
methods : {
oneMoment : function(d) {
return window.oneMoment(d)
},
select (item) {
},
is_selected (item) {
return ''
},
change_page(x) {
this.curr_patient_page = x
this.$store.dispatch('io_right_patient_list/search')
},
update_send_item(idx, val) {
if (val == null) val = "N"
let x = this.$store.state.io_right_patient_list.patients
x[idx].send = val
let total = this.$store.state.io_right_patient_list.total_patient
let total_page = this.$store.state.io_right_patient_list.total_patient_page
this.$store.commit('io_right_patient_list/update_patients',
{records:x, total:total, total_page:total_page})
},
update_instrument_item(idx, val) {
if (!val) val = 0
let x = this.$store.state.io_right_patient_list.patients
x[idx].instrument_id = val
if (val != 0) {
x[idx].send_disabled = false
x[idx].send = "Y"
}
else {
x[idx].send_disabled = true
x[idx].send = "N"
}
let total = this.$store.state.io_right_patient_list.total_patient
let total_page = this.$store.state.io_right_patient_list.total_patient_page
this.$store.commit('io_right_patient_list/update_patients',
{records:x, total:total, total_page:total_page})
},
send_orders () {
this.$store.dispatch('io_right_patient_list/send_orders')
},
update_instrument_id(e) {
this.instrument_id = e
let p = this.patients
for (let i in p) {
if (!p[i].persistent) {
if (e) {
p[i].instrument_id = e
p[i].send = "Y"
p[i].send_disabled = false
} else {
p[i].instrument_id = null
p[i].send = "N"
p[i].send_disabled = true
}
}
}
this.$store.commit('io_right_patient_list/update_patients',
{records:p,
total:this.$store.state.io_right_patient_list.total_patient_page,
total_page:this.$store.state.io_right_patient_list.total_patient_page})
}
},
computed : {
patients () {
return this.$store.state.io_right_patient_list.patients
},
total_patient () {
return this.$store.state.io_right_patient_list.total_patient
},
total_patient_page () {
return this.$store.state.io_right_patient_list.total_patient_page
},
curr_patient_page : {
get () { return this.$store.state.io_right_patient_list.curr_patient_page },
set (v) { this.$store.commit('io_right_patient_list/update_curr_patient_page', v) }
},
px_name() {
return this.$store.state.io_left_px_list.selected_px_names.join(', ')
},
send_count() {
let x = this.$store.state.io_right_patient_list.patients
let y = 0
for (let i in x)
if (x[i].send == "Y")
y = y + 1
return y
},
snackbar : {
get () { return this.$store.state.io_right_patient_list.snackbar },
set (v) { this.$store.commit('io_right_patient_list/update_snackbar', v) }
},
instruments () {
if (this.patients[0])
return this.patients[0].instrument
return []
},
instrument_id : {
get () { return this.$store.state.io_right_patient_list.instrument_id },
set (v) { this.$store.commit('io_right_patient_list/update_instrument_id', v) }
}
},
mounted () {
}
}
</script>

View File

@@ -0,0 +1,175 @@
<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 pa-2 green--text" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
<v-checkbox
:value="selected_px_ids.indexOf(props.item.t_testid) > -1 ? true : false"
:true-value="true" :false-value="false" hide-details></v-checkbox>
</td>
<td class="text-xs-left pa-2 green--text" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
{{ props.item.t_testcode }}
</td>
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
{{ props.item.t_testname }}
</td>
</template>
</v-data-table>
<v-pagination
v-model="curr_px_page"
:length="total_px_page"
:total-visible="5"
@input="change_page"
></v-pagination>
</v-card>
</v-layout>
</template>
<style scoped>
.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;
}
</style>
<script>
module.exports = {
data() {
return {
query: "",
items: [],
headers: [
{
text: "~",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "KODE",
align: "left",
sortable: false,
value: "mr",
width: "30%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
value: "mr",
width: "60%",
class: "pa-2 blue lighten-3 white--text"
}
],
isLoading: false
};
},
methods : {
oneMoment : function(d) {
return window.oneMoment(d)
},
select (item) {
let n = this.selected_px_ids.indexOf(item.t_testid)
let m = this.selected_px_names
if (n < 0) {
this.selected_px_ids.push(item.t_testid)
for (let i in this.pxs)
if (item.t_testid == this.pxs[i].t_testid)
m.push(this.pxs[i].t_testname)
}
else {
this.selected_px_ids.splice(n, 1)
m.splice(n, 1)
}
this.selected_px_names = m
this.$store.commit('io_left_px_list/update_selected_px', item)
this.$store.commit('io_left_px_list/update_id', item.t_testid)
this.$store.dispatch('io_right_patient_list/search')
},
is_selected (item) {
// let x = this.$store.state.io_left_px_list.selected_px
let x = this.selected_px_ids.indexOf(item.t_testid)
if (x < 0)
return ''
// if (x.t_testid == item.t_testid)
return 'green lighten-4'
return ''
},
change_page(x) {
this.curr_px_page = x
this.$store.dispatch('io_left_px_list/search')
}
},
computed : {
pxs () {
return this.$store.state.io_left_px_list.pxs
},
total_px () {
return this.$store.state.io_left_px_list.total_px
},
total_px_page () {
return this.$store.state.io_left_px_list.total_px_page
},
curr_px_page : {
get () { return this.$store.state.io_left_px_list.curr_px_page },
set (v) { this.$store.commit('io_left_px_list/update_curr_px_page', v) }
},
selected_px_ids : {
get () { return this.$store.state.io_left_px_list.selected_px_ids },
set (v) { this.$store.commit('io_left_px_list/update_selected_px_ids', v) }
},
selected_px_names : {
get () { return this.$store.state.io_left_px_list.selected_px_names },
set (v) { this.$store.commit('io_left_px_list/update_selected_px_names', v) }
}
},
mounted () {
let d = new Date().toISOString().substr(0, 10)
this.$store.commit('io_left_px_list/update_sdate', d)
this.$store.commit('io_left_px_list/update_edate', d)
this.$store.dispatch('io_left_px_list/search')
}
}
</script>

View File

@@ -0,0 +1,77 @@
<template>
<v-card class="mb-1 pa-1">
<v-layout row>
<v-flex xs12>
<v-layout>
<one-date-picker
label="Start Date"
:date="null"
@change="startDateChange"
:data="null"
:max_date="null"
class="mr-4"
hint="DD-MM-YYYY"
></one-date-picker>
<v-layout>
<one-date-picker
label="End Date"
:date="null"
@change="endDateChange"
:data="null"
:max_date="null"
class="mr-4"
hint="DD-MM-YYYY"
></one-date-picker>
<v-text-field class="flex xs8 ma-1"
label=""
placeholder="Nama"
single-line
solo
hide-details
v-model="search"
></v-text-field>
<v-btn class="flex xs6 ma-1" color="success" @click="searchs" >
Search
</v-btn>
</v-layout>
</v-flex>
</v-layout>
</v-card>
</template>
<style scoped>
button {
height: 48px;
}
</style>
<script>
module.exports = {
components : {
'one-date-picker' : httpVueLoader('../oneDatePicker2.vue')
},
computed : {
search : {
get () { return '' },
set (v) { this.$store.commit('io_left_px_list/update_search', v) }
}
},
methods : {
searchs() {
this.$store.dispatch('io_left_px_list/search')
},
startDateChange(prm) {
this.$store.commit('io_left_px_list/update_sdate', prm.new_date)
},
endDateChange(prm) {
this.$store.commit('io_left_px_list/update_edate', prm.new_date)
}
}
}
</script>

View File

@@ -0,0 +1,236 @@
<template>
<v-layout class="fill-height" column>
<v-card class="grow">
<v-subheader style="min-height:81px">
<h3 class="title">DAFTAR ORDER / PASIEN BY WORKLIST <strong class="red--text">[ {{ worklist_name }} ]</strong></h3>
<v-spacer></v-spacer>
<v-btn color="primary" dark @click="send_orders">Kirim ke Instrument ({{send_count}})</v-btn>
</v-subheader>
<v-data-table
:headers="headers" :items="patients"
:loading="isLoading"
hide-actions class="xelevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2 green--text" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
{{ props.item.order_number }}
</td>
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
{{ props.item.patient_name }}
<h5 class="caption grey--text">{{ props.item.t_testnames }}</h5>
</td>
<td class="text-xs-left pl-2 pr-2 pt-1 pb-1" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
<v-select
:items="props.item.instrument"
label=""
solo
@change="update_instrument_item(props.index, $event)"
:value="props.item.instrument_id"
item-value="T_InstrumentID"
item-text="T_InstrumentName"
hide-details
clearable
></v-select>
</td>
<td class="text-xs-center pa-2" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
<v-checkbox :value="props.item.send" true-value="Y" false-value="N"
@change="update_send_item(props.index, $event)"
:disabled="props.item.send_disabled"
class=" ml-2"></v-checkbox>
</td>
</template>
</v-data-table>
<v-pagination
v-model="curr_patient_page"
:length="total_patient_page"
:total-visible="5"
@input="change_page"
></v-pagination>
</v-card>
<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-layout>
</template>
<style scoped>
/* .searchbox .v-input.v-text-field .v-input__slot{
min-height:60px;
} */
/* .searchbox .v-btn {
min-height:60px;
} */
table.v-table thead tr {
height: 40px;
}
</style>
<script>
module.exports = {
data() {
return {
save_text: 'Data berhasil terkirim',
query: "",
items: [],
headers: [
{
text: "NOMOR LAB",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
value: "mr",
width: "40%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "INSTRUMENT",
align: "left",
sortable: false,
value: "mr",
width: "30%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "KIRIM",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
}
],
isLoading: false
};
},
methods : {
oneMoment : function(d) {
return window.oneMoment(d)
},
select (item) {
},
is_selected (item) {
return ''
},
change_page(x) {
this.curr_patient_page = x
this.$store.dispatch('io_right_worklist_patient_list/search')
},
update_send_item(idx, val) {
if (val == null) val = "N"
let x = this.$store.state.io_right_worklist_patient_list.patients
x[idx].send = val
let total = this.$store.state.io_right_worklist_patient_list.total_patient
let total_page = this.$store.state.io_right_worklist_patient_list.total_patient_page
this.$store.commit('io_right_worklist_patient_list/update_patients',
{records:x, total:total, total_page:total_page})
},
update_instrument_item(idx, val) {
if (!val) val = 0
let x = this.$store.state.io_right_worklist_patient_list.patients
x[idx].instrument_id = val
if (val != 0) {
x[idx].send_disabled = false
x[idx].send = "Y"
}
else {
x[idx].send_disabled = true
x[idx].send = "N"
}
let total = this.$store.state.io_right_worklist_patient_list.total_patient
let total_page = this.$store.state.io_right_worklist_patient_list.total_patient_page
this.$store.commit('io_right_worklist_patient_list/update_patients',
{records:x, total:total, total_page:total_page})
},
send_orders () {
this.$store.dispatch('io_right_worklist_patient_list/send_orders')
}
},
computed : {
patients () {
return this.$store.state.io_right_worklist_patient_list.patients
},
total_patient () {
return this.$store.state.io_right_worklist_patient_list.total_patient
},
total_patient_page () {
return this.$store.state.io_right_worklist_patient_list.total_patient_page
},
curr_patient_page : {
get () { return this.$store.state.io_right_worklist_patient_list.curr_patient_page },
set (v) { this.$store.commit('io_right_worklist_patient_list/update_curr_patient_page', v) }
},
worklist_name() {
return this.$store.state.io_left_worklist_list.selected_worklist.t_worklistname
},
send_count() {
let x = this.$store.state.io_right_worklist_patient_list.patients
let y = 0
for (let i in x)
if (x[i].send == "Y")
y = y + 1
return y
},
snackbar : {
get () { return this.$store.state.io_right_worklist_patient_list.snackbar },
set (v) { this.$store.commit('io_right_worklist_patient_list/update_snackbar', v) }
}
},
mounted () {
}
}
</script>

View File

@@ -0,0 +1,77 @@
<template>
<v-card class="mb-1 pa-1">
<v-layout row>
<v-flex xs12>
<v-layout>
<one-date-picker
label="Start Date"
:date="null"
@change="startDateChange"
:data="null"
:max_date="null"
class="mr-4"
hint="DD-MM-YYYY"
></one-date-picker>
<v-layout>
<one-date-picker
label="End Date"
:date="null"
@change="endDateChange"
:data="null"
:max_date="null"
class="mr-4"
hint="DD-MM-YYYY"
></one-date-picker>
<v-text-field class="flex xs8 ma-1"
label=""
placeholder="Nama"
single-line
solo
hide-details
v-model="search"
></v-text-field>
<v-btn class="flex xs6 ma-1" color="success" @click="searchs" >
Search
</v-btn>
</v-layout>
</v-flex>
</v-layout>
</v-card>
</template>
<style scoped>
button {
height: 48px;
}
</style>
<script>
module.exports = {
components : {
'one-date-picker' : httpVueLoader('../oneDatePicker2.vue')
},
computed : {
search : {
get () { return '' },
set (v) { this.$store.commit('io_left_worklist_list/update_search', v) }
}
},
methods : {
searchs() {
this.$store.dispatch('io_left_worklist_list/search')
},
startDateChange(prm) {
this.$store.commit('io_left_worklist_list/update_sdate', prm.new_date)
},
endDateChange(prm) {
this.$store.commit('io_left_worklist_list/update_edate', prm.new_date)
}
}
}
</script>

View File

@@ -0,0 +1,124 @@
<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:0worklist solid #c8c8c8;" />
<v-data-table
:headers="headers" :items="worklists"
:loading="isLoading"
hide-actions class="xelevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2 green--text" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
{{ props.item.t_worklistname }}
</td>
</template>
</v-data-table>
<v-pagination
v-model="curr_worklist_page"
:length="total_worklist_page"
:total-visible="5"
@input="change_page"
></v-pagination>
</v-card>
</v-layout>
</template>
<style scoped>
.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;
}
</style>
<script>
module.exports = {
data() {
return {
query: "",
items: [],
headers: [
{
text: "NAMA WORKLIST",
align: "left",
sortable: false,
value: "mr",
width: "100%",
class: "pa-2 blue lighten-3 white--text"
}
],
isLoading: false
};
},
methods : {
oneMoment : function(d) {
return window.oneMoment(d)
},
select (item) {
this.$store.commit('io_left_worklist_list/update_selected_worklist', item)
this.$store.commit('io_left_worklist_list/update_id', item.t_worklistid)
this.$store.dispatch('io_right_worklist_patient_list/search')
},
is_selected (item) {
let x = this.$store.state.io_left_worklist_list.selected_worklist
if (!x)
return ''
if (x.t_worklistid == item.t_worklistid)
return 'green lighten-4'
return ''
},
change_page(x) {
this.curr_worklist_page = x
this.$store.dispatch('io_left_worklist_list/search')
}
},
computed : {
worklists () {
return this.$store.state.io_left_worklist_list.worklists
},
total_worklist () {
return this.$store.state.io_left_worklist_list.total_worklist
},
total_worklist_page () {
return this.$store.state.io_left_worklist_list.total_worklist_page
},
curr_worklist_page : {
get () { return this.$store.state.io_left_worklist_list.curr_worklist_page },
set (v) { this.$store.commit('io_left_worklist_list/update_curr_worklist_page', v) }
}
},
mounted () {
let d = new Date().toISOString().substr(0, 10)
this.$store.commit('io_left_worklist_list/update_sdate', d)
this.$store.commit('io_left_worklist_list/update_edate', d)
this.$store.dispatch('io_left_worklist_list/search')
}
}
</script>

View File

@@ -0,0 +1,78 @@
<template>
<v-menu
v-model="menu2"
:close-on-content-click="false"
:nudge-right="40"
lazy
transition="scale-transition"
offset-y
full-width
max-width="290px"
min-width="290px"
>
<v-text-field
slot="activator"
v-model="computedDateFormatted"
:label=init_label
:hint="init_hint"
persistent-hint
readonly
browser-autocomplete="off"
></v-text-field>
<v-date-picker v-model="init_date" no-title @input="menu2 = false" :max="init_max_date"></v-date-picker>
</v-menu>
</template>
<script>
module.exports = {
props : ['label', 'date', 'data', 'max_date', 'hint'],
data () {
return {
init_date: this.date && this.date != "0000-00-00" ? this.date : new Date().toISOString().substr(0, 10),
init_max_date: this.max_date ? this.max_date : '2999-09-09',
init_hint: this.hint ? this.hint : 'MM-DD-YYYY format',
dateFormatted: this.formatDate(new Date().toISOString().substr(0, 10)),
menu1: false,
menu2: false,
init_label: this.label ? this.label : 'Date',
init_data: this.data ? this.data : ''
}
},
computed: {
computedDateFormatted () {
return this.formatDate(this.init_date)
}
},
watch: {
init_date (n, o) {
this.dateFormatted = this.formatDate(this.init_date)
this.$emit('change', {"old_date":o, "new_date":n, "data":this.init_data});
}
},
methods: {
formatDate (date) {
if (!date) { return null }
const [year, month, day] = date.split('-')
return `${day}-${month}-${year}`
},
parseDate (date) {
if (!date) return null
const [month, day, year] = date.split('/')
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
},
emitChange (n, o) {
console.log("old:"+o)
console.log("new:"+n)
}
}
}
</script>

View File

@@ -0,0 +1,65 @@
<template>
<v-layout>
<v-flex xs12 text-xs-center mb-2>
<v-card color="blue lighten-4">
<v-card-text class="pb-0 pt-1">
<v-btn
v-for="tab in tabs"
:color="tab.code == active ? 'white' : 'grey lighten-5'"
class="white--text ma-0 tab-btn"
:class="[tab.code == active ? 'active' : '']"
@click="changeTab(tab.code)"
flat
:key="tab.code"
:data="tab"
>
<v-icon left dark>{{ tab.icon }}</v-icon>
<h6 class="title">{{ tab.label }}</h6>
</v-btn>
</v-card-text>
</v-card>
</v-flex>
</v-layout>
</template>
<style scoped>
.active {
border-bottom: solid 3px #ffeb3b!important;
}
.tab-btn {
min-width: 400px;
}
</style>
<script>
module.exports = {
data () {
return {
}
},
methods : {
changeTab (x) {
// this.active = x;
this.$store.commit('change_tab', x);
}
},
computed : {
tabs : {
get () {
return this.$store.state.tabs
},
set (v) {
return
}
},
active () {
return this.$store.state.tab_active
}
}
}
</script>

View File

@@ -0,0 +1,117 @@
<template>
<v-card class="mb-1 pa-1">
<v-layout row>
<v-flex xs4>
<v-layout>
<one-date-picker
label="Start Date"
:date="null"
@change="startDateChange"
:data="null"
:max_date="null"
class="mr-4"
></one-date-picker>
<v-layout>
<one-date-picker
label="End Date"
:date="null"
@change="startDateChange"
:data="null"
:max_date="null"
class="mr-4"
></one-date-picker>
<v-text-field class="flex xs8 ma-1"
label=""
placeholder="Nama"
single-line
solo
hide-details
v-model="search"
></v-text-field>
<v-btn class="flex xs6 ma-1" color="success" @click="searchs" >
Search
</v-btn>
</v-layout>
</v-flex>
<v-flex xs2>
<v-layout>
</v-layout>
</v-flex>
<v-flex xs3 class="text-xs-right">
<v-btn
color="blue-grey"
class="white--text ma-1"
@click="histories"
>
Histori
</v-btn>
<v-btn
color="blue"
class="white--text ma-1"
@click="save_result"
>
Simpan
<v-icon right dark>save_alt</v-icon>
</v-btn>
</v-flex>
</v-layout>
</v-card>
</template>
<style scoped>
button {
height: 48px;
}
</style>
<script>
module.exports = {
components : {
'one-date-picker' : httpVueLoader('./oneDatePicker2.vue')
},
computed : {
nolab : {
get () { return this.$store.state.re_patient.nolab },
set (v) { this.$store.commit('re_patient/update_nolab', v) }
},
search : {
get () { return '' },
set (v) { this.$store.commit('re_patient/update_search', v) }
},
selected_group : {
get () { return this.$store.state.re_px.selected_group },
set (v) { this.$store.commit('re_px/update_selected_group', v) }
}
},
methods : {
searchs() {
this.$store.dispatch('re_patient/search')
},
save_result() {
this.$store.dispatch('re_px/save')
},
histories() {
this.$store.commit('re_history/update_dialog_history', true)
},
startDateChange(prm) {
// this.$store.commit('worklist_patient/update_sdate', prm.new_date)
},
}
}
</script>

View File

@@ -0,0 +1,129 @@
<!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>
<one-process-instrument-order-tab></one-process-instrument-order-tab>
</v-flex>
<v-flex>
</v-flex>
<v-flex>
<v-layout v-show="tab_active == '01'">
<v-flex xs4 pr-1>
<one-process-io-bypx-search-box></one-process-io-bypx-search-box>
<one-process-io-bypx-px-list></one-process-io-bypx-px-list>
</v-flex>
<v-flex xs8 pl-1>
<one-process-io-bypx-patient-list></one-process-io-bypx-patient-list>
</v-flex>
</v-layout>
<v-layout v-show="tab_active == '02'">
<v-flex xs4 pr-1>
<one-process-io-byorder-search-box></one-process-io-byorder-search-box>
<one-process-io-byorder-patient-list></one-process-io-byorder-patient-list>
</v-flex>
<v-flex xs8 pl-1>
<one-process-io-byorder-px-list></one-process-io-byorder-px-list>
</v-flex>
</v-layout>
<v-layout v-if="tab_active == '03'">
<v-flex xs4 pr-1>
<one-process-io-byworklist-search-box></one-process-io-byworklist-search-box>
<one-process-io-byworklist-worklist-list></one-process-io-byworklist-worklist-list>
</v-flex>
<v-flex xs8 pl-1>
<one-process-io-byworklist-patient-list></one-process-io-byworklist-patient-list>
</v-flex>
</v-layout>
<v-flex>
</v-layout>
</v-container>
</v-content>
<one-footer> </one-footer>
</v-app>
</div>
<!-- Vendor -->
<script src="../../../libs/vendor/axios.min.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>
<!-- App Script -->
<?php
$ts = "?ts=" . Date("ymdhis");
?>
<script type="module">
import { store } from './store.js<?php echo $ts ?>';
//for testing
window.store = store;
new Vue({
store,
el: '#app',
components: {
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
'one-process-instrument-order-tab': httpVueLoader('./components/oneProcessInstrumentOrderTab.vue'),
'one-process-io-bypx-search-box' : httpVueLoader('./components/by-px/oneProcessInstrumentOrderSearchBox.vue'),
'one-process-io-bypx-px-list' : httpVueLoader('./components/by-px/oneProcessInstrumentOrderPxList.vue'),
'one-process-io-byorder-search-box' : httpVueLoader('./components/by-order/oneProcessInstrumentOrderSearchBox.vue'),
'one-process-io-byorder-patient-list' : httpVueLoader('./components/by-order/oneProcessInstrumentOrderPatientList.vue'),
'one-process-io-bypx-patient-list' : httpVueLoader('./components/by-px/oneProcessInstrumentOrderPatientList.vue'),
'one-process-io-byorder-px-list' : httpVueLoader('./components/by-order/oneProcessInstrumentOrderPxList.vue'),
'one-process-io-byworklist-search-box' : httpVueLoader('./components/by-worklist/oneProcessInstrumentOrderSearchBox.vue'),
'one-process-io-byworklist-worklist-list' : httpVueLoader('./components/by-worklist/oneProcessInstrumentOrderWorklistList.vue'),
'one-process-io-byworklist-patient-list' : httpVueLoader('./components/by-worklist/oneProcessInstrumentOrderPatientList.vue')
},
computed : {
tab_active () {
return this.$store.state.tab_active
}
},
mounted () {
// store.dispatch('receive_patient/search')
}
})
</script>
<style>
[v-cloak] {
display: none
}
</style>
</body>
</html>

View File

@@ -0,0 +1,94 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/io_left.js"
window.api = api
export default {
namespaced: true,
state: {
order_id:0,
search: '',
sdate: null,
edate: null,
search_status:0,
search_error_message:'',
search_dialog_is_active: false,
patients: [],
total_patient: 0,
total_patient_page: 0,
curr_patient_page: 1,
selected_patient: { }
},
mutations: {
update_search_dialog_is_active(state,status) {
state.search_dialog_is_active = status
},
update_search_error_message(state,status) {
state.search_error_message = status
},
update_search(state,val) {
state.search = val
},
update_sdate(state, val) {
state.sdate = val
},
update_edate(state, val) {
state.edate = val
},
update_search_status(state,status) {
state.search_status = status
},
update_patients(state, data) {
state.patients= data.records
state.total_patient = data.total
state.total_patient_page = data.total_page
},
update_curr_patient_page(state, data) {
state.curr_patient_page = data
},
update_selected_patient(state, val) {
state.selected_patient = val
},
update_id(state, id) {
state.order_id = id
}
},
actions: {
async search(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.search_patient(context.state.sdate, context.state.edate, context.state.search, context.state.curr_patient_page)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
let data = {
records : resp.data.records,
total: resp.data.total,
total_page: resp.data.total_page
}
context.commit("update_patients", data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,105 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/io_left.js"
window.api = api
export default {
namespaced: true,
state: {
px_id:0,
search: '',
sdate: null,
edate: null,
search_status:0,
search_error_message:'',
search_dialog_is_active: false,
pxs: [],
total_px: 0,
total_px_page: 0,
curr_px_page: 1,
selected_px: { },
selected_px_ids: [],
selected_px_names: []
},
mutations: {
update_search_dialog_is_active(state,status) {
state.search_dialog_is_active = status
},
update_search_error_message(state,status) {
state.search_error_message = status
},
update_search(state,val) {
state.search = val
},
update_sdate(state, val) {
state.sdate = val
},
update_edate(state, val) {
state.edate = val
},
update_search_status(state,status) {
state.search_status = status
},
update_pxs(state, data) {
state.pxs= data.records
state.total_px = data.total
state.total_px_page = data.total_page
},
update_curr_px_page(state, data) {
state.curr_px_page = data
},
update_selected_px(state, val) {
state.selected_px = val
},
update_id(state, id) {
state.px_id = id
},
update_selected_px_ids(state, ids) {
state.selected_px_ids = ids
},
update_selected_px_names(state, names) {
state.selected_px_names = names
}
},
actions: {
async search(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.search_px(context.state.sdate, context.state.edate, context.state.search, context.state.curr_px_page)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
let data = {
records : resp.data.records,
total: resp.data.total,
total_page: resp.data.total_page
}
context.commit("update_pxs", data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,94 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/io_left.js"
window.api = api
export default {
namespaced: true,
state: {
worklist_id:0,
search: '',
sdate: null,
edate: null,
search_status:0,
search_error_message:'',
search_dialog_is_active: false,
worklists: [],
total_worklist: 0,
total_worklist_page: 0,
curr_worklist_page: 1,
selected_worklist: { }
},
mutations: {
update_search_dialog_is_active(state,status) {
state.search_dialog_is_active = status
},
update_search_error_message(state,status) {
state.search_error_message = status
},
update_search(state,val) {
state.search = val
},
update_sdate(state, val) {
state.sdate = val
},
update_edate(state, val) {
state.edate = val
},
update_search_status(state,status) {
state.search_status = status
},
update_worklists(state, data) {
state.worklists= data.records
state.total_worklist = data.total
state.total_worklist_page = data.total_page
},
update_curr_worklist_page(state, data) {
state.curr_worklist_page = data
},
update_selected_worklist(state, val) {
state.selected_worklist = val
},
update_id(state, id) {
state.worklist_id = id
}
},
actions: {
async search(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.search_worklist(context.state.search, context.state.curr_worklist_page)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
let data = {
records : resp.data.records,
total: resp.data.total,
total_page: resp.data.total_page
}
context.commit("update_worklists", data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,161 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/io_right.js"
window.api = api
export default {
namespaced: true,
state: {
order_id:0,
instrument_id:0,
search: '',
sdate: null,
edate: null,
search_status:0,
search_error_message:'',
search_dialog_is_active: false,
patients: [],
total_patient: 0,
total_patient_page: 0,
curr_patient_page: 1,
selected_patient: { },
snackbar: false
},
mutations: {
update_search_dialog_is_active(state,status) {
state.search_dialog_is_active = status
},
update_search_error_message(state,status) {
state.search_error_message = status
},
update_search(state,val) {
state.search = val
},
update_sdate(state, val) {
state.sdate = val
},
update_edate(state, val) {
state.edate = val
},
update_search_status(state,status) {
state.search_status = status
},
update_patients(state, data) {
state.patients= data.records
state.total_patient = data.total
state.total_patient_page = data.total_page
},
update_curr_patient_page(state, data) {
state.curr_patient_page = data
},
update_selected_patient(state, val) {
state.selected_patient = val
},
update_id(state, id) {
state.order_id = id
},
update_snackbar(state, v) {
state.snackbar = v
},
update_instrument_id(state, id) {
state.instrument_id = id
}
},
actions: {
async search(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.search_patient(context.rootState.io_left_px_list.sdate,
context.rootState.io_left_px_list.edate,
JSON.stringify(context.rootState.io_left_px_list.selected_px_ids),
context.state.curr_patient_page)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
for (let i in resp.data.records) {
resp.data.records[i].send = "N"
resp.data.records[i].send_disabled = resp.data.records[i].instrument_id == 0 ? true : false
resp.data.records[i].persistent = resp.data.records[i].instrument_id == 0 ? false : true
}
let data = {
records : resp.data.records,
total: resp.data.total,
total_page: resp.data.total_page
}
context.commit("update_patients", data)
context.commit("update_instrument_id", 0)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
},
async send_orders(context) {
context.commit("update_search_status", 1)
try {
let data = []
let pts = context.state.patients
for (let i in pts) {
if (pts[i].instrument_id != 0 && pts[i].send == "Y") {
for(let j in pts[i].detail_id)
data.push({instrument_id:pts[i].instrument_id, detail_id:pts[i].detail_id[j]})
}
}
if (data.length < 1) {
alert('Tidak ada data yang dipilih !')
return
}
let resp= await api.send_orders(one_token(), JSON.stringify(data))
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
for (let i in resp.data.records)
resp.data.records[i].send = "N"
// let data = {
// records : resp.data.records,
// total: resp.data.total,
// total_page: resp.data.total_page
// }
// context.commit("update_patients", data)
context.dispatch('search')
context.commit('update_snackbar', true)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,148 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/io_right.js"
window.api = api
export default {
namespaced: true,
state: {
order_id:0,
search: '',
sdate: null,
edate: null,
search_status:0,
search_error_message:'',
search_dialog_is_active: false,
patients: [],
total_patient: 0,
total_patient_page: 0,
curr_patient_page: 1,
selected_patient: { },
snackbar: false
},
mutations: {
update_search_dialog_is_active(state,status) {
state.search_dialog_is_active = status
},
update_search_error_message(state,status) {
state.search_error_message = status
},
update_search(state,val) {
state.search = val
},
update_sdate(state, val) {
state.sdate = val
},
update_edate(state, val) {
state.edate = val
},
update_search_status(state,status) {
state.search_status = status
},
update_patients(state, data) {
state.patients= data.records
state.total_patient = data.total
state.total_patient_page = data.total_page
},
update_curr_patient_page(state, data) {
state.curr_patient_page = data
},
update_selected_patient(state, val) {
state.selected_patient = val
},
update_id(state, id) {
state.order_id = id
},
update_snackbar(state, v) {
state.snackbar = v
}
},
actions: {
async search(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.search_patient(context.rootState.io_left_px_list.sdate, context.rootState.io_left_px_list.edate, context.rootState.io_left_px_list.px_id, context.state.curr_patient_page)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
for (let i in resp.data.records) {
resp.data.records[i].send = "N"
resp.data.records[i].send_disabled = resp.data.records[i].instrument_id == 0 ? true : false
}
let data = {
records : resp.data.records,
total: resp.data.total,
total_page: resp.data.total_page
}
context.commit("update_patients", data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
},
async send_orders(context) {
context.commit("update_search_status", 1)
try {
let data = []
let pts = context.state.patients
for (let i in pts) {
if (pts[i].instrument_id != 0 && pts[i].send == "Y")
data.push({instrument_id:pts[i].instrument_id, detail_id:pts[i].detail_id})
}
if (data.length < 1) {
alert('Tidak ada data yang dipilih !')
return
}
let resp= await api.send_orders(one_token(), JSON.stringify(data))
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
for (let i in resp.data.records)
resp.data.records[i].send = "N"
// let data = {
// records : resp.data.records,
// total: resp.data.total,
// total_page: resp.data.total_page
// }
// context.commit("update_patients", data)
context.dispatch('search')
context.commit('update_snackbar', true)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,148 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/io_right.js"
window.api = api
export default {
namespaced: true,
state: {
order_id:0,
search: '',
sdate: null,
edate: null,
search_status:0,
search_error_message:'',
search_dialog_is_active: false,
pxs: [],
total_px: 0,
total_px_page: 0,
curr_px_page: 1,
selected_px: { },
snackbar: false
},
mutations: {
update_search_dialog_is_active(state,status) {
state.search_dialog_is_active = status
},
update_search_error_message(state,status) {
state.search_error_message = status
},
update_search(state,val) {
state.search = val
},
update_sdate(state, val) {
state.sdate = val
},
update_edate(state, val) {
state.edate = val
},
update_search_status(state,status) {
state.search_status = status
},
update_pxs(state, data) {
state.pxs= data.records
state.total_px = data.total
state.total_px_page = data.total_page
},
update_curr_px_page(state, data) {
state.curr_px_page = data
},
update_selected_px(state, val) {
state.selected_px = val
},
update_id(state, id) {
state.order_id = id
},
update_snackbar(state, v) {
state.snackbar = v
}
},
actions: {
async search(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.search_px(context.rootState.io_left_patient_list.order_id, context.state.curr_px_page)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
for (let i in resp.data.records) {
resp.data.records[i].send = "N"
resp.data.records[i].send_disabled = resp.data.records[i].instrument_id == 0 ? true : false
}
let data = {
records : resp.data.records,
total: resp.data.total,
total_page: resp.data.total_page
}
context.commit("update_pxs", data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
},
async send_orders(context) {
context.commit("update_search_status", 1)
try {
let data = []
let pts = context.state.pxs
for (let i in pts) {
if (pts[i].instrument_id != 0 && pts[i].send == "Y")
data.push({instrument_id:pts[i].instrument_id, detail_id:pts[i].detail_id})
}
if (data.length < 1) {
alert('Tidak ada data yang dipilih !')
return
}
let resp= await api.send_orders(one_token(), JSON.stringify(data))
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
for (let i in resp.data.records)
resp.data.records[i].send = "N"
// let data = {
// records : resp.data.records,
// total: resp.data.total,
// total_page: resp.data.total_page
// }
// context.commit("update_pxs", data)
context.dispatch('search')
context.commit('update_snackbar', true)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,148 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/io_right.js"
window.api = api
export default {
namespaced: true,
state: {
order_id:0,
search: '',
sdate: null,
edate: null,
search_status:0,
search_error_message:'',
search_dialog_is_active: false,
patients: [],
total_patient: 0,
total_patient_page: 0,
curr_patient_page: 1,
selected_patient: { },
snackbar: false
},
mutations: {
update_search_dialog_is_active(state,status) {
state.search_dialog_is_active = status
},
update_search_error_message(state,status) {
state.search_error_message = status
},
update_search(state,val) {
state.search = val
},
update_sdate(state, val) {
state.sdate = val
},
update_edate(state, val) {
state.edate = val
},
update_search_status(state,status) {
state.search_status = status
},
update_patients(state, data) {
state.patients= data.records
state.total_patient = data.total
state.total_patient_page = data.total_page
},
update_curr_patient_page(state, data) {
state.curr_patient_page = data
},
update_selected_patient(state, val) {
state.selected_patient = val
},
update_id(state, id) {
state.order_id = id
},
update_snackbar(state, v) {
state.snackbar = v
}
},
actions: {
async search(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.search_worklist_patient(context.rootState.io_left_worklist_list.sdate, context.rootState.io_left_worklist_list.edate, context.rootState.io_left_worklist_list.worklist_id, context.state.curr_patient_page)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
for (let i in resp.data.records) {
resp.data.records[i].send = "N"
resp.data.records[i].send_disabled = resp.data.records[i].instrument_id == 0 ? true : false
}
let data = {
records : resp.data.records,
total: resp.data.total,
total_page: resp.data.total_page
}
context.commit("update_patients", data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
},
async send_orders(context) {
context.commit("update_search_status", 1)
try {
let data = []
let pts = context.state.patients
for (let i in pts) {
if (pts[i].instrument_id != 0 && pts[i].send == "Y")
data.push({instrument_id:pts[i].instrument_id, detail_id:pts[i].detail_id})
}
if (data.length < 1) {
alert('Tidak ada data yang dipilih !')
return
}
let resp= await api.send_orders(one_token(), JSON.stringify(data))
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
for (let i in resp.data.records)
resp.data.records[i].send = "N"
// let data = {
// records : resp.data.records,
// total: resp.data.total,
// total_page: resp.data.total_page
// }
// context.commit("update_patients", data)
context.dispatch('search')
context.commit('update_snackbar', true)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,43 @@
// State
// data ...
// Mutations
//
//
// Actions
// import io_patient from "./modules/io_patient.js";
// import re_px from "./modules/re_px.js";
import io_left_patient_list from "./modules/io_left_patient_list.js";
import io_left_px_list from "./modules/io_left_px_list.js";
import io_left_worklist_list from "./modules/io_left_worklist_list.js";
import io_right_patient_list from "./modules/io_right_patient_list.js";
import io_right_px_list from "./modules/io_right_px_list.js";
import io_right_worklist_patient_list from "./modules/io_right_worklist_patient_list.js";
import system from "../../../apps/modules/system/system.js";
export const store = new Vuex.Store({
state : {
tab_active : '01',
tabs : [
{"label":"BY TEST", "icon":"opacity", "code":"01"},
{"label":"BY ORDER", "icon":"verified_user", "code":"02"}
]
},
mutations : {
change_tab(state, tab) {
state.tab_active = tab;
}
},
modules : {
// re_patient: re_patient,
// re_px: re_px,
io_left_patient_list: io_left_patient_list,
io_left_px_list: io_left_px_list,
io_left_worklist_list: io_left_worklist_list,
io_right_patient_list: io_right_patient_list,
io_right_px_list: io_right_px_list,
io_right_worklist_patient_list: io_right_worklist_patient_list,
system: system
}
});