Squashed commit of the following:
commit82e33c6dbfMerge:f96cbdbeba740aAuthor: Munawwirul Jamal <[email protected]> Date: Thu Dec 4 13:21:37 2025 +0700 Merge pull request #209 from dikstub-rssa/feat/move-kai-ui-to-sidebar-195 Feat/move kai UI to sidebar 195 commitf96cbdb173Merge:5de005762556a5Author: Munawwirul Jamal <[email protected]> Date: Thu Dec 4 12:07:25 2025 +0700 Merge pull request #210 from dikstub-rssa/feat/procedure-room-order Feat/procedure room order commit62556a5c7dMerge:93a294d5de0057Author: Munawwirul Jamal <[email protected]> Date: Thu Dec 4 12:07:18 2025 +0700 Merge branch 'dev' into feat/procedure-room-order commit5de0057278Merge:71ca7f9782034cAuthor: Andsky <[email protected]> Date: Thu Dec 4 11:56:31 2025 +0700 Merge pull request #211 from dikstub-rssa/feat/micro-lab-order-50 Feat/micro lab order 50 commit93a294d8d0Merge:6c2636726365bbAuthor: Andrian Roshandy <[email protected]> Date: Thu Dec 4 11:18:49 2025 +0700 Merge branch 'dev' into feat/procedure-room-order commit26365bbd2eMerge:b6b56d1e7cab6cAuthor: Andrian Roshandy <[email protected]> Date: Thu Dec 4 11:18:33 2025 +0700 Merge branch 'dev' of github.com:dikstub-rssa/simrs-fe into dev commit6c26367c1dAuthor: Andrian Roshandy <[email protected]> Date: Thu Dec 4 10:51:40 2025 +0700 feat/procedure-room-order: added item commita0dfd214e5Author: Andrian Roshandy <[email protected]> Date: Thu Dec 4 10:25:50 2025 +0700 feat/procedure-room-order: finishing commitacb573e279Author: Andrian Roshandy <[email protected]> Date: Thu Dec 4 10:25:35 2025 +0700 feat/procedure-room-order: adjust procedure-room-order commit9adb77d10bAuthor: Andrian Roshandy <[email protected]> Date: Thu Dec 4 10:24:52 2025 +0700 feat/procedure-room-order: adjust material-package commit52454a019eMerge:0a0fb73b6b56d1Author: Andrian Roshandy <[email protected]> Date: Thu Dec 4 10:23:14 2025 +0700 Merge branch 'dev' into feat/procedure-room-order commitb6b56d186dAuthor: Munawwirul Jamal <[email protected]> Date: Thu Dec 4 10:17:16 2025 +0700 dev: hotfix, cleaning some pubs commit0a0fb73483Author: Munawwirul Jamal <[email protected]> Date: Wed Dec 3 14:33:13 2025 +0700 feat/procedure-room-order: flow for procedure room commit7b4b4eecf9Merge:9f72e1db172125Author: Andrian Roshandy <[email protected]> Date: Wed Dec 3 10:18:15 2025 +0700 Merge branch 'feat/mcu-order' into feat/procedure-room-order commit782034c2b1Merge:bae0a22b80ee5aAuthor: Andrian Roshandy <[email protected]> Date: Wed Dec 3 10:16:45 2025 +0700 Merge branch 'dev' into feat/micro-lab-order-50 commit9f72e1df47Merge:fa0ae98b80ee5aAuthor: Andrian Roshandy <[email protected]> Date: Wed Dec 3 10:02:57 2025 +0700 Merge branch 'dev' into feat/procedure-room-order commitfa0ae9866eAuthor: Andrian Roshandy <[email protected]> Date: Wed Dec 3 09:44:33 2025 +0700 feat/procedure-room-order: wip #3 commitce93f996d9Author: Andrian Roshandy <[email protected]> Date: Wed Dec 3 09:43:36 2025 +0700 feat/procedure-room-order: wip #2 + procedure-room commit4444e87cb3Author: Andrian Roshandy <[email protected]> Date: Wed Dec 3 09:42:31 2025 +0700 feat/procedure-room-order: wip #1 + material-package + material-package-item commitb172125d99Merge:b2d3c149b7a719Author: Andrian Roshandy <[email protected]> Date: Mon Dec 1 20:41:58 2025 +0700 Merge branch 'feat/page-cleaning' into feat/mcu-order commitbae0a222b8Author: Andrian Roshandy <[email protected]> Date: Mon Dec 1 01:51:04 2025 +0700 feat/micro-lab-order-50: adjust for antibiotic commit1ee0f39e7dAuthor: Andrian Roshandy <[email protected]> Date: Mon Dec 1 01:50:39 2025 +0700 feat/micro-lab-order-50: added antibiotic commit95e27a8b6fAuthor: Andrian Roshandy <[email protected]> Date: Sun Nov 30 13:00:04 2025 +0700 feat/micro-lab-order-50: wip commita002ef6c6eMerge:fb2f01bb2d3c14Author: Andrian Roshandy <[email protected]> Date: Sun Nov 30 12:50:31 2025 +0700 Merge branch 'feat/mcu-order' into feat/micro-lab-order-50 commitb2d3c14ddcAuthor: Andrian Roshandy <[email protected]> Date: Sun Nov 30 12:48:11 2025 +0700 feat/mcu-order: adjustment commitfb2f01bd36Merge:9a481fe5c92f8bAuthor: Andrian Roshandy <[email protected]> Date: Sun Nov 30 12:43:11 2025 +0700 Merge branch 'feat/mcu-order' into feat/micro-lab-order-50 commit5c92f8b946Author: Andrian Roshandy <[email protected]> Date: Sun Nov 30 12:30:19 2025 +0700 feat/mcu-order: added the components commit9a481fec14Merge:425123978fc289Author: Andrian Roshandy <[email protected]> Date: Fri Nov 28 21:18:10 2025 +0700 Merge branch 'dev' into feat/micro-lab-order-50 commit4251239f7cAuthor: Andrian Roshandy <[email protected]> Date: Fri Nov 28 21:17:18 2025 +0700 feat/micro-lab-order-50: wip commitcf5789549eAuthor: Munawwirul Jamal <[email protected]> Date: Sun Nov 23 15:56:31 2025 +0700 feat/mcu: improved wip commita40eac35f8Merge:3211972baf6ab1Author: Andrian Roshandy <[email protected]> Date: Wed Nov 19 22:23:18 2025 +0700 Merge branch 'dev' into feat/radiology-order-54 commit3211972a84Merge:e3fc1e4ccabe01Author: Andrian Roshandy <[email protected]> Date: Sat Nov 15 20:15:07 2025 +0700 Merge branch 'dev' into feat/radiology-order-54 commite3fc1e4ab9Author: Andrian Roshandy <[email protected]> Date: Sat Nov 15 20:14:38 2025 +0700 feat/radiology-order-54: adjust wip
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
import type { Config, RecComponent } from '~/components/pub/my-ui/data-table'
|
||||||
|
import { defineAsyncComponent } from 'vue'
|
||||||
|
|
||||||
|
type SmallDetailDto = any
|
||||||
|
|
||||||
|
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
|
||||||
|
|
||||||
|
export const config: Config = {
|
||||||
|
cols: [{}, {}],
|
||||||
|
|
||||||
|
headers: [[{ label: 'Kode' }, { label: 'Nama' }]],
|
||||||
|
|
||||||
|
keys: ['code', 'name'],
|
||||||
|
|
||||||
|
delKeyNames: [
|
||||||
|
{ key: 'code', label: 'Kode' },
|
||||||
|
{ key: 'name', label: 'Nama' },
|
||||||
|
],
|
||||||
|
|
||||||
|
parses: {
|
||||||
|
},
|
||||||
|
|
||||||
|
components: {
|
||||||
|
},
|
||||||
|
|
||||||
|
htmls: {
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
// Pub components
|
||||||
|
import DataTable from '~/components/pub/my-ui/data-table/data-table.vue'
|
||||||
|
|
||||||
|
// Configs
|
||||||
|
import { config } from './list.cfg'
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
data: any[]
|
||||||
|
}>()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="space-y-4">
|
||||||
|
<DataTable v-bind="config" :rows="data" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import type { Config } from '~/components/pub/my-ui/data-table'
|
||||||
|
|
||||||
|
type SmallDetailDto = any
|
||||||
|
|
||||||
|
export const config: Config = {
|
||||||
|
cols: [ { width: 150 }, {}, { width: 150 }],
|
||||||
|
|
||||||
|
headers: [
|
||||||
|
[
|
||||||
|
{ label: 'No' },
|
||||||
|
{ label: 'Name' },
|
||||||
|
{ label: 'Jumlah' },
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
keys: ['number', 'material.name', 'count'],
|
||||||
|
|
||||||
|
parses: {
|
||||||
|
number: (rec: unknown): unknown => {
|
||||||
|
return (rec as SmallDetailDto).medicineGroup?.name || '-'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
//
|
||||||
|
import DataTable from '~/components/pub/my-ui/data-table/data-table.vue'
|
||||||
|
|
||||||
|
// Configs
|
||||||
|
import { config } from './quick-list.cfg'
|
||||||
|
import type { MaterialPackageItem } from '~/models/material-package-item';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
data: MaterialPackageItem[]
|
||||||
|
}
|
||||||
|
|
||||||
|
defineProps<Props>()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="mb-4">
|
||||||
|
<div class="font-semibold text-sm 2xl:text-base mb-2">
|
||||||
|
Daftar Item BMHP
|
||||||
|
</div>
|
||||||
|
<DataTable v-bind="config" :rows="data" class="border"/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
//
|
||||||
|
import * as CB from '~/components/pub/my-ui/combobox'
|
||||||
|
import type { MaterialPackage } from '~/models/material-package';
|
||||||
|
|
||||||
|
//
|
||||||
|
const props =defineProps<{
|
||||||
|
data: MaterialPackage[]
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const model = defineModel()
|
||||||
|
|
||||||
|
const items = computed(() => {
|
||||||
|
return props.data.map((item) => {
|
||||||
|
return {
|
||||||
|
label: item.name,
|
||||||
|
value: item.code,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="mb-4 2xl:mb-5">
|
||||||
|
<div class="font-semibold text-sm 2xl:text-base mb-2">
|
||||||
|
Paket BMHP
|
||||||
|
</div>
|
||||||
|
<div class="max-w-[600px]">
|
||||||
|
<CB.Combobox :items="items" v-model="model" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -1,18 +1,20 @@
|
|||||||
import type { Config } from '~/components/pub/my-ui/data-table'
|
import type { Config } from '~/components/pub/my-ui/data-table'
|
||||||
import { defineAsyncComponent } from 'vue'
|
import { defineAsyncComponent } from 'vue'
|
||||||
|
import type { McuOrderItem } from '~/models/mcu-order-item'
|
||||||
|
|
||||||
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
|
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
|
||||||
|
// const input = defineAsyncComponent(() => import('~/components/pub/my-ui/data/editable-div.vue'))
|
||||||
const input = defineAsyncComponent(() => import('~/components/pub/ui/input/Input.vue'))
|
const input = defineAsyncComponent(() => import('~/components/pub/ui/input/Input.vue'))
|
||||||
|
|
||||||
export const config: Config = {
|
export const config: Config = {
|
||||||
cols: [{}, {}, { classVal: '!p-0.5' }, { width: 50 }],
|
cols: [{}, {}, { classVal: '!p-0.5' }],
|
||||||
|
|
||||||
headers: [
|
headers: [
|
||||||
[
|
[
|
||||||
{ label: 'Nama' },
|
{ label: 'Nama' },
|
||||||
{ label: 'Jenis' },
|
{ label: 'Jenis' },
|
||||||
{ label: 'Catatan' },
|
{ label: 'Catatan', classVal: '!w-[40%]' },
|
||||||
{ label: '' },
|
// { label: '' },
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
@@ -27,16 +29,17 @@ export const config: Config = {
|
|||||||
return {
|
return {
|
||||||
idx,
|
idx,
|
||||||
rec: rec as object,
|
rec: rec as object,
|
||||||
|
props: { data: (rec as McuOrderItem).note },
|
||||||
component: input,
|
component: input,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
action(rec, idx) {
|
// action(rec, idx) {
|
||||||
return {
|
// return {
|
||||||
idx,
|
// idx,
|
||||||
rec: rec as object,
|
// rec: rec as object,
|
||||||
component: action,
|
// component: action,
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
},
|
},
|
||||||
|
|
||||||
htmls: {},
|
htmls: {},
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import DataTable from '~/components/pub/my-ui/data-table/data-table.vue'
|
||||||
|
|
||||||
import { config } from './list-entry.cfg'
|
import { config } from './list-entry.cfg'
|
||||||
import type { McuOrderItem } from '~/models/mcu-order-item';
|
import type { McuOrderItem } from '~/models/mcu-order-item';
|
||||||
|
|
||||||
@@ -13,7 +15,7 @@ const emit = defineEmits<{
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<PubMyUiDataTable class="border mb-3 2xl:mb-4"
|
<DataTable class="border mb-3 2xl:mb-4"
|
||||||
v-bind="config"
|
v-bind="config"
|
||||||
:rows="data"
|
:rows="data"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
import type { Config } from '~/components/pub/my-ui/data-table'
|
import type { Config } from '~/components/pub/my-ui/data-table'
|
||||||
|
|
||||||
export const config: Config = {
|
export const config: Config = {
|
||||||
cols: [{}, {}],
|
cols: [{}, { width: 150 }, {}],
|
||||||
|
|
||||||
headers: [
|
headers: [
|
||||||
[
|
[
|
||||||
{ label: 'Nama' },
|
{ label: 'Nama' },
|
||||||
{ label: 'Jenis' },
|
{ label: 'Jadwal Pemeriksaan' },
|
||||||
|
{ label: 'Status' },
|
||||||
|
{ label: 'Catatan' },
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
keys: ['mcuSrc.name', 'mcuSrcCategory.name'],
|
keys: ['mcuSrc.name', 'examinationDate', 'status_code', 'note'],
|
||||||
|
|
||||||
delKeyNames: [
|
delKeyNames: [
|
||||||
{ key: 'mcuSrc.name', label: 'Nama' },
|
{ key: 'mcuSrc.name', label: 'Nama' },
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type { McuOrder } from '~/models/mcu-order';
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
recItem: McuOrder
|
||||||
|
}>()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="flex mb-2">
|
||||||
|
<div class="w-20">Tanggal</div>
|
||||||
|
<div class="w-4">:</div>
|
||||||
|
<div class="">{{ recItem.createdAt?.substring(0, 10) }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex">
|
||||||
|
<div class="w-20">DPJP</div>
|
||||||
|
<div class="w-4">:</div>
|
||||||
|
<div class="">{{ recItem.doctor?.employee?.person?.name }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -10,7 +10,7 @@ const props = defineProps<{
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="text-sm 2xl:text-base font-semibold mb-3">
|
<div class="text-sm 2xl:text-base font-semibold mb-3">
|
||||||
Order {{ data?.createdAt?.substring(0, 10) }} - {{ data.status_code }}
|
Order {{ data?.createdAt?.substring(0, 10) }} - {{ data?.status_code }}
|
||||||
</div>
|
</div>
|
||||||
<div class="max-w-[1000px]">
|
<div class="max-w-[1000px]">
|
||||||
<DE.Block mode="preview" :col-count=5 class="!mb-3">
|
<DE.Block mode="preview" :col-count=5 class="!mb-3">
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ function navClick(type: 'cancel' | 'edit' | 'submit', data: McuOrder): void {
|
|||||||
<div class="mb-4 xl:mb-5">Belum Ada Data</div>
|
<div class="mb-4 xl:mb-5">Belum Ada Data</div>
|
||||||
</div>
|
</div>
|
||||||
<template v-for="item, idx in data">
|
<template v-for="item, idx in data">
|
||||||
<div :class="'text-sm 2xl:text-base font-semibold ' + (item.status_code == 'new' ? 'mb-2' : 'mb-2')">
|
<div :class="'text-sm 2xl:text-base font-semibold ' + (item.status_code == 'new' ? 'mb-0' : 'mb-2')">
|
||||||
Order #{{ data.length - idx }} - {{ item.createdAt?.substring(0, 10) }} - {{ item.status_code }}
|
Order #{{ data.length - idx }} - {{ item.createdAt?.substring(0, 10) }} - {{ item.status_code }}
|
||||||
</div>
|
</div>
|
||||||
<DE.Block mode="preview" :col-count=7 class="!mb-3">
|
<DE.Block mode="preview" :col-count=7 class="!mb-3">
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import * as DE from '~/components/pub/my-ui/doc-entry';
|
||||||
|
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
|
||||||
|
import Nav from '~/components/pub/my-ui/nav-footer/ca-ed-su.vue'
|
||||||
|
|
||||||
|
import type { McuOrder } from '~/models/mcu-order';
|
||||||
|
import AntibioticInUseList from '~/components/app/antibiotic-in-use/list.vue';
|
||||||
|
import McuOrderItems from '~/components/app/mcu-order-item/list.vue';
|
||||||
|
import type { AntibioticInUse } from '~/models/antibiotic-in-use';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
data: McuOrder[]
|
||||||
|
antibioticInUses: AntibioticInUse[]
|
||||||
|
paginationMeta: PaginationMeta
|
||||||
|
}
|
||||||
|
const props = defineProps<Props>()
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
cancel: [data: any]
|
||||||
|
edit: [data: any],
|
||||||
|
submit: [data: any]
|
||||||
|
}>()
|
||||||
|
|
||||||
|
function navClick(type: 'cancel' | 'edit' | 'submit', data: McuOrder): void {
|
||||||
|
if (type === 'cancel') {
|
||||||
|
emit('cancel', data)
|
||||||
|
} else if (type === 'edit') {
|
||||||
|
emit('edit', data)
|
||||||
|
} else if (type === 'submit') {
|
||||||
|
emit('submit', data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div v-if="data.length == 0" class="p-10 text-center">
|
||||||
|
<div class="mb-4 xl:mb-5">Belum Ada Data</div>
|
||||||
|
</div>
|
||||||
|
<template v-for="item, idx in data">
|
||||||
|
<div :class="'text-sm 2xl:text-base font-semibold ' + (item.status_code == 'new' ? 'mb-0' : 'mb-2')">
|
||||||
|
Order #{{ data.length - idx }} - {{ item.createdAt?.substring(0, 10) }} - {{ item.status_code }}
|
||||||
|
</div>
|
||||||
|
<DE.Block mode="preview" :col-count=7 class="!mb-3">
|
||||||
|
<DE.Cell :col-span="3">
|
||||||
|
<DE.Label :class="'font-semibold ' + (item.status_code == 'new' ? 'pt-2' : '')">DPJP</DE.Label>
|
||||||
|
<DE.Field :class="item.status_code == 'new' ? 'pt-2' : ''">
|
||||||
|
{{ item.doctor?.employee?.person?.name || '........' }}
|
||||||
|
</DE.Field>
|
||||||
|
</DE.Cell>
|
||||||
|
<DE.Cell :col-span="3">
|
||||||
|
<DE.Label :class="'font-semibold ' + (item.status_code == 'new' ? 'pt-2' : '')">PPDS</DE.Label>
|
||||||
|
<DE.Field :class="item.status_code == 'new' ? 'pt-2' : ''">
|
||||||
|
...........
|
||||||
|
</DE.Field>
|
||||||
|
</DE.Cell>
|
||||||
|
<div class="flex justify-end" >
|
||||||
|
<Nav
|
||||||
|
v-if="item.status_code == 'new'"
|
||||||
|
:small-mode="true"
|
||||||
|
:default-class="'flex gap-1'"
|
||||||
|
@click="(type) => { navClick(type, item) }"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</DE.Block>
|
||||||
|
<AntibioticInUseList v-if="item.antibioticInUseItems?.length > 0" :data="[]" class="!mb-5" />
|
||||||
|
<McuOrderItems :data="item.items || []" @click="console.log('click')" class="!mb-5" />
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
@@ -37,7 +37,7 @@ function pick(item: McuSrc) {
|
|||||||
<div class="grid lg:grid-cols-4 2xl:grid-cols-5 gap-2 [&_button]:w-full">
|
<div class="grid lg:grid-cols-4 2xl:grid-cols-5 gap-2 [&_button]:w-full">
|
||||||
<div v-for="item, idx in dataSource" :key="idx" class="flex gap-2">
|
<div v-for="item, idx in dataSource" :key="idx" class="flex gap-2">
|
||||||
<Button
|
<Button
|
||||||
:variant="data.some(e => e.mcuSrc_id === item.id) ? 'default' : 'outline'"
|
:variant="data.some(e => e.mcuSrc_code === item.code) ? 'default' : 'outline'"
|
||||||
type="button"
|
type="button"
|
||||||
@click="pick(item)"
|
@click="pick(item)"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import type { Config } from '~/components/pub/my-ui/data-table'
|
||||||
|
import { defineAsyncComponent } from 'vue'
|
||||||
|
|
||||||
|
export const config: Config = {
|
||||||
|
cols: [{}, {}, { classVal: '!p-0.5' }],
|
||||||
|
|
||||||
|
headers: [
|
||||||
|
[
|
||||||
|
{ label: 'Kode' },
|
||||||
|
{ label: 'Nama' },
|
||||||
|
{ label: 'Catatan' },
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
keys: ['procedureRoom.code', 'procedureRoom.infra.name', 'note'],
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import DataTable from '~/components/pub/my-ui/data-table/data-table.vue'
|
||||||
|
|
||||||
|
import { config } from './list-detail.cfg'
|
||||||
|
import type { ProcedureRoomOrderItem } from '~/models/procedure-room-order-item';
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
data: ProcedureRoomOrderItem[]
|
||||||
|
}>()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="mb-4 2xl:mb-5">
|
||||||
|
<div class="font-semibold text-sm 2xl:text-base mb-2">
|
||||||
|
Daftar Order Ruang
|
||||||
|
</div>
|
||||||
|
<DataTable class="border mb-3 2xl:mb-4"
|
||||||
|
v-bind="config"
|
||||||
|
:rows="data"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import type { Config } from '~/components/pub/my-ui/data-table'
|
||||||
|
import { defineAsyncComponent } from 'vue'
|
||||||
|
|
||||||
|
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
|
||||||
|
const input = defineAsyncComponent(() => import('~/components/pub/ui/input/Input.vue'))
|
||||||
|
|
||||||
|
export const config: Config = {
|
||||||
|
cols: [{}, {}, { classVal: '!p-0.5' }, { width: 50 }],
|
||||||
|
|
||||||
|
headers: [
|
||||||
|
[
|
||||||
|
{ label: 'Kode' },
|
||||||
|
{ label: 'Nama' },
|
||||||
|
{ label: 'Catatan' },
|
||||||
|
{ label: '' },
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
keys: ['procedureRoom.code', 'procedureRoom.infra.name', 'note'],
|
||||||
|
|
||||||
|
delKeyNames: [
|
||||||
|
{ key: 'mcuSrc.name', label: 'Nama' },
|
||||||
|
],
|
||||||
|
|
||||||
|
components: {
|
||||||
|
note(rec, idx) {
|
||||||
|
return {
|
||||||
|
idx,
|
||||||
|
rec: rec as object,
|
||||||
|
component: input,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
action(rec, idx) {
|
||||||
|
return {
|
||||||
|
idx,
|
||||||
|
rec: rec as object,
|
||||||
|
component: action,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
htmls: {},
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import DataTable from '~/components/pub/my-ui/data-table/data-table.vue'
|
||||||
|
|
||||||
|
import { config } from './list-entry.cfg'
|
||||||
|
import type { ProcedureRoomOrderItem } from '~/models/procedure-room-order-item';
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
data: ProcedureRoomOrderItem[]
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
requestItem: []
|
||||||
|
}>()
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="mb-4 2xl:mb-5">
|
||||||
|
<div class="font-semibold text-sm 2xl:text-base mb-2">
|
||||||
|
Daftar Order Ruang
|
||||||
|
</div>
|
||||||
|
<DataTable class="border mb-3 2xl:mb-4"
|
||||||
|
v-bind="config"
|
||||||
|
:rows="data"
|
||||||
|
/>
|
||||||
|
<div class="-mx-1 [&_button]:mx-1">
|
||||||
|
<Button @click="emit('requestItem')">
|
||||||
|
<Icon name="i-lucide-plus" />
|
||||||
|
Pilih Item
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import * as DE from '~/components/pub/my-ui/doc-entry'
|
||||||
|
import type { ProcedureRoom } from '~/models/procedure-room';
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
data: ProcedureRoom
|
||||||
|
}>()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="mb-4 2xl:mb-5">
|
||||||
|
<div class="font-semibold text-sm 2xl:text-base mb-2">
|
||||||
|
Detail Order
|
||||||
|
</div>
|
||||||
|
<DE.Block :col-count="2" mode="preview">
|
||||||
|
<DE.Cell>
|
||||||
|
<DE.Label>No. Order</DE.Label>
|
||||||
|
<DE.Colon />
|
||||||
|
<DE.Field>ORT-{{ data.id }}</DE.Field>
|
||||||
|
</DE.Cell>
|
||||||
|
<DE.Cell>
|
||||||
|
<DE.Label>Tgl. Order</DE.Label>
|
||||||
|
<DE.Colon />
|
||||||
|
<DE.Field>{{ data.createdAt?.substring(0, 10) }}</DE.Field>
|
||||||
|
</DE.Cell>
|
||||||
|
</DE.Block>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
import type { Config, RecComponent } from '~/components/pub/my-ui/data-table'
|
||||||
|
import { defineAsyncComponent } from 'vue'
|
||||||
|
import type { ProcedureRoomOrder } from '~/models/procedure-room-order'
|
||||||
|
|
||||||
|
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dsd.vue'))
|
||||||
|
|
||||||
|
export const config: Config = {
|
||||||
|
cols: [{}, {}, {}, {}, {}, { width: 50 }],
|
||||||
|
|
||||||
|
headers: [[
|
||||||
|
{ label: 'Tgl. Order' },
|
||||||
|
{ label: 'No. Order' },
|
||||||
|
{ label: 'Ruangan' },
|
||||||
|
{ label: 'Status' },
|
||||||
|
{ label: 'Resume' },
|
||||||
|
{ label: '' },
|
||||||
|
]],
|
||||||
|
|
||||||
|
keys: ['date', 'number', 'room', 'status_code', 'resume', 'action'],
|
||||||
|
|
||||||
|
delKeyNames: [
|
||||||
|
{ key: 'createdAt', label: 'Tgl. Order' },
|
||||||
|
{ key: 'id', label: 'No. Order' },
|
||||||
|
],
|
||||||
|
|
||||||
|
parses: {
|
||||||
|
date: (rec: any) => {
|
||||||
|
const recX = rec as ProcedureRoomOrder
|
||||||
|
return recX.createdAt ? recX.createdAt.substring(0, 10) : ''
|
||||||
|
|
||||||
|
},
|
||||||
|
number: (rec: any) => {
|
||||||
|
const recX = rec as ProcedureRoomOrder
|
||||||
|
return `ORT-${recX.id}`
|
||||||
|
},
|
||||||
|
room: (rec: any) => {
|
||||||
|
const recX = rec as ProcedureRoomOrder
|
||||||
|
let result = ''
|
||||||
|
if (recX.items && recX.items.length > 0) {
|
||||||
|
recX.items.forEach((item, idx) => {
|
||||||
|
result += item.infra?.name ? `<div>${item.infra.name}</div>` : ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// recX.ite
|
||||||
|
return ''
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
components: {
|
||||||
|
action(rec, idx) {
|
||||||
|
const res: RecComponent = {
|
||||||
|
idx,
|
||||||
|
rec: rec as object,
|
||||||
|
component: action,
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
htmls: {},
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
// Components
|
||||||
|
import DataTable from '~/components/pub/my-ui/data-table/data-table.vue'
|
||||||
|
import PaginationView from '~/components/pub/my-ui/pagination/pagination-view.vue'
|
||||||
|
|
||||||
|
// Types
|
||||||
|
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
|
||||||
|
|
||||||
|
// Configs
|
||||||
|
import { config } from './list.cfg'
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
data: any[]
|
||||||
|
paginationMeta: PaginationMeta
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
pageChange: [page: number]
|
||||||
|
}>()
|
||||||
|
|
||||||
|
function handlePageChange(page: number) {
|
||||||
|
emit('pageChange', page)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<DataTable
|
||||||
|
v-bind="config"
|
||||||
|
:rows="data"
|
||||||
|
:skeleton-size="paginationMeta?.pageSize"
|
||||||
|
class="mb-4 border"
|
||||||
|
/>
|
||||||
|
<PaginationView :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type { ProcedureRoom } from '~/models/procedure-room';
|
||||||
|
import type { ProcedureRoomOrderItem } from '~/models/procedure-room-order-item';
|
||||||
|
|
||||||
|
const dataModel = defineModel({ type: Array as PropType<ProcedureRoomOrderItem[]>, required: true })
|
||||||
|
defineProps<{
|
||||||
|
data: ProcedureRoom[]
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
pick: [item: ProcedureRoom]
|
||||||
|
}>()
|
||||||
|
|
||||||
|
function pick(item: ProcedureRoom) {
|
||||||
|
emit('pick', item)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="mb-5">
|
||||||
|
<div class="font-semibold text-sm 2xl:text-base mb-2">
|
||||||
|
Daftar Pilihan Ruang Tindakan
|
||||||
|
</div>
|
||||||
|
<div class="grid grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 gap-2 2xl:gap-2">
|
||||||
|
<!-- <div v-for="item, idx in data" :key="idx" class="flex gap-2"> -->
|
||||||
|
<div v-if="data.length > 0" v-for="item, idx in data">
|
||||||
|
<Button
|
||||||
|
:variant="dataModel.some(e => e.procedureRoom.code === item.code) ? 'default' : 'outline'"
|
||||||
|
class="w-full"
|
||||||
|
type="button"
|
||||||
|
@click="pick(item)"
|
||||||
|
>
|
||||||
|
{{ item.infra?.name }}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<div v-else class="col-span-full text-center text-sm text-gray-500">
|
||||||
|
<div>Tidak ada data ruang tindakan.</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type { ProcedureRoom } from '~/models/procedure-room';
|
||||||
|
import type { ProcedureRoomOrderItem } from '~/models/procedure-room-order-item';
|
||||||
|
|
||||||
|
const dataModel = defineModel({ type: Array as PropType<ProcedureRoomOrderItem[]>, required: true })
|
||||||
|
defineProps<{
|
||||||
|
data: ProcedureRoom[]
|
||||||
|
pickMode: 'single' | 'multi'
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
pick: [item: ProcedureRoom]
|
||||||
|
}>()
|
||||||
|
|
||||||
|
function pick(item: ProcedureRoom) {
|
||||||
|
emit('pick', item)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="mb-5">
|
||||||
|
<div class="font-semibold text-sm 2xl:text-base mb-2">
|
||||||
|
Daftar Pilihan Ruang Tindakan
|
||||||
|
</div>
|
||||||
|
<div class="grid grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 gap-2 2xl:gap-2">
|
||||||
|
<!-- <div v-for="item, idx in data" :key="idx" class="flex gap-2"> -->
|
||||||
|
<div v-if="data.length > 0" v-for="item, idx in data">
|
||||||
|
<Button
|
||||||
|
:variant="dataModel.some(e => e.procedureRoom.code === item.code) ? 'default' : 'outline'"
|
||||||
|
class="w-full"
|
||||||
|
type="button"
|
||||||
|
@click="pick(item)"
|
||||||
|
>
|
||||||
|
{{ item.infra?.name }}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<div v-else class="col-span-full text-center text-sm text-gray-500">
|
||||||
|
<div>Tidak ada data ruang tindakan.</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type { ProcedureRoom } from '~/models/procedure-room';
|
||||||
|
import type { ProcedureRoomOrderItem } from '~/models/procedure-room-order-item';
|
||||||
|
|
||||||
|
const dataModel = defineModel({ type: Array as PropType<ProcedureRoomOrderItem[]>, required: true })
|
||||||
|
defineProps<{
|
||||||
|
data: ProcedureRoom[]
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
pick: [item: ProcedureRoom]
|
||||||
|
}>()
|
||||||
|
|
||||||
|
function pick(item: ProcedureRoom) {
|
||||||
|
emit('pick', item)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="mb-5">
|
||||||
|
<div class="font-semibold text-sm 2xl:text-base mb-2">
|
||||||
|
Daftar Pilihan Ruang Tindakan
|
||||||
|
</div>
|
||||||
|
<div class="grid grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 gap-2 2xl:gap-2">
|
||||||
|
<!-- <div v-for="item, idx in data" :key="idx" class="flex gap-2"> -->
|
||||||
|
<div v-if="data.length > 0" v-for="item, idx in data">
|
||||||
|
<Button
|
||||||
|
:variant="dataModel.some(e => e.procedureRoom.code === item.code) ? 'default' : 'outline'"
|
||||||
|
class="w-full"
|
||||||
|
type="button"
|
||||||
|
@click="pick(item)"
|
||||||
|
>
|
||||||
|
{{ item.infra?.name }}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<div v-else class="col-span-full text-center text-sm text-gray-500">
|
||||||
|
<div>Tidak ada data ruang tindakan.</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { procedureRoomTypeCodes } from '~/const/key-val/clinical'
|
||||||
|
|
||||||
|
const model = defineModel()
|
||||||
|
model.value = 'procedure'
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
pick: [type_code: string]
|
||||||
|
}>()
|
||||||
|
|
||||||
|
function pick(type_code: string) {
|
||||||
|
model.value = type_code
|
||||||
|
emit('pick', type_code)
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="mb-5">
|
||||||
|
<div class="font-semibold text-sm 2xl:text-base mb-2">
|
||||||
|
Jenis Ruang Tindakan
|
||||||
|
</div>
|
||||||
|
<div class="-mx-1 [&_button]:mx-1 ">
|
||||||
|
<Button v-for="item, key in procedureRoomTypeCodes" :variant="model === key ? 'default' : 'outline'" @click="pick(key)">
|
||||||
|
{{ item }}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -21,7 +21,7 @@ import {
|
|||||||
|
|
||||||
// Apps
|
// Apps
|
||||||
import { getList, getDetail } from '~/services/mcu-order.service'
|
import { getList, getDetail } from '~/services/mcu-order.service'
|
||||||
import List from '~/components/app/mcu-order/list.vue'
|
import List from '~/components/app/mcu-order/micro-list.vue'
|
||||||
import type { McuOrder } from '~/models/mcu-order'
|
import type { McuOrder } from '~/models/mcu-order'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
@@ -55,7 +55,7 @@ const {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const headerPrep: HeaderPrep = {
|
const headerPrep: HeaderPrep = {
|
||||||
title: 'Order Lab PK',
|
title: 'Order Lab Mikro',
|
||||||
icon: 'i-lucide-box',
|
icon: 'i-lucide-box',
|
||||||
refSearchNav: {
|
refSearchNav: {
|
||||||
placeholder: 'Cari (min. 3 karakter)...',
|
placeholder: 'Cari (min. 3 karakter)...',
|
||||||
|
|||||||
@@ -0,0 +1,154 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import Nav from '~/components/pub/my-ui/nav-footer/ba-de-su.vue'
|
||||||
|
import NavOk from '~/components/pub/my-ui/nav-footer/ok.vue'
|
||||||
|
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
||||||
|
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
||||||
|
|
||||||
|
import { useQueryCRUDMode } from '~/composables/useQueryCRUD'
|
||||||
|
import { type HeaderPrep } from '~/components/pub/my-ui/data/types'
|
||||||
|
|
||||||
|
// mcu src category
|
||||||
|
import ScrCategorySwitcher from '~/components/app/mcu-src-category/switcher.vue'
|
||||||
|
import { getList as getMcuCategoryList } from '~/services/mcu-src-category.service'
|
||||||
|
|
||||||
|
// mcu src
|
||||||
|
import { type McuSrc } from '~/models/mcu-src'
|
||||||
|
import { getList as getMcuSrcList } from '~/services/mcu-src.service'
|
||||||
|
import McuSrcPicker from '~/components/app/mcu-src/picker-accordion.vue'
|
||||||
|
|
||||||
|
// mcu order
|
||||||
|
import { getDetail } from '~/services/mcu-order.service'
|
||||||
|
import Detail from '~/components/app/mcu-order/detail.vue'
|
||||||
|
|
||||||
|
// mcu order item, manually not using composable
|
||||||
|
import {
|
||||||
|
getList as getMcuOrderItemList,
|
||||||
|
create as createMcuOrderItem,
|
||||||
|
remove as removeMcuOrderItem,
|
||||||
|
} from '~/services/mcu-order-item.service'
|
||||||
|
import { type McuOrderItem } from '~/models/mcu-order-item'
|
||||||
|
import ItemListEntry from '~/components/app/mcu-order-item/list-entry.vue'
|
||||||
|
|
||||||
|
// props
|
||||||
|
const props = defineProps<{
|
||||||
|
encounter_id: number
|
||||||
|
scopeCode: string
|
||||||
|
}>()
|
||||||
|
|
||||||
|
// declaration & flows
|
||||||
|
|
||||||
|
// MCU Order
|
||||||
|
const { backToList, crudQueryParams } = useQueryCRUD()
|
||||||
|
const id = crudQueryParams.value.recordId
|
||||||
|
const dataRes = await getDetail(
|
||||||
|
typeof id === 'string' ? parseInt(id) : 0,
|
||||||
|
{ includes: 'encounter,doctor,doctor-employee,doctor-employee-person' }
|
||||||
|
)
|
||||||
|
const data = dataRes.body?.data
|
||||||
|
|
||||||
|
// MCU items
|
||||||
|
const items = ref<McuOrderItem[]>([])
|
||||||
|
|
||||||
|
// MCU Categories
|
||||||
|
const mcuSrcCategoryRes = await getMcuCategoryList({ 'scope-code': props.scopeCode })
|
||||||
|
const mcuSrcCategories = mcuSrcCategoryRes.body?.data
|
||||||
|
const selectedMcuSrcCategory_code = ref('')
|
||||||
|
|
||||||
|
// MCU Sources
|
||||||
|
const mcuSrcs = ref<McuSrc[]>([])
|
||||||
|
|
||||||
|
// const {
|
||||||
|
// data: items,
|
||||||
|
// fetchData: getItems,
|
||||||
|
// } = usePaginatedList<McuOrderItem> ({
|
||||||
|
// fetchFn: async ({ page, search }) => {
|
||||||
|
// const result = await getMcuOrderItemList({ 'mcu-order-id': id, search, page })
|
||||||
|
// if (result.success) {
|
||||||
|
// items.value = result.body.data
|
||||||
|
// }
|
||||||
|
// return { success: result.success || false, body: result.body || {} }
|
||||||
|
// },
|
||||||
|
// entityName: 'mcu-order-item',
|
||||||
|
// })
|
||||||
|
|
||||||
|
const headerPrep: HeaderPrep = {
|
||||||
|
title: 'Detail dan List Item Order Radiologi ',
|
||||||
|
icon: 'i-lucide-box',
|
||||||
|
}
|
||||||
|
|
||||||
|
const pickerDialogOpen = ref(false)
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await getItems()
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(selectedMcuSrcCategory_code, async () => {
|
||||||
|
const res = await getMcuSrcList({ 'mcu-src-category-code': selectedMcuSrcCategory_code.value })
|
||||||
|
mcuSrcs.value = res.body?.data
|
||||||
|
})
|
||||||
|
|
||||||
|
function navClick(type: 'back' | 'delete' | 'draft' | 'submit') {
|
||||||
|
if (type === 'back') {
|
||||||
|
backToList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function requestItem() {
|
||||||
|
pickerDialogOpen.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
async function pickItem(item: McuSrc) {
|
||||||
|
const exItem = items.value.find(e => e.mcuSrc_code === item.code)
|
||||||
|
if (exItem) {
|
||||||
|
await removeMcuOrderItem(exItem.id)
|
||||||
|
await getItems()
|
||||||
|
} else {
|
||||||
|
const intId = parseInt(id?.toString() || '0')
|
||||||
|
await createMcuOrderItem({
|
||||||
|
mcuOrder_id: intId,
|
||||||
|
mcuSrc_code: item.code,
|
||||||
|
})
|
||||||
|
await getItems()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getItems() {
|
||||||
|
const itemsRes = await getMcuOrderItemList({ 'mcu-order-id': id, includes: 'mcuSrc,mcuSrc-mcuSrcCategory' })
|
||||||
|
if (itemsRes.success) {
|
||||||
|
items.value = itemsRes.body.data
|
||||||
|
} else {
|
||||||
|
items.value = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Header
|
||||||
|
:prep="headerPrep"
|
||||||
|
:ref-search-nav="headerPrep.refSearchNav"
|
||||||
|
class="mb-4 xl:mb-5"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Detail :data="data" />
|
||||||
|
|
||||||
|
<ItemListEntry
|
||||||
|
:data="items"
|
||||||
|
@requestItem="requestItem"/>
|
||||||
|
<Separator class="my-5" />
|
||||||
|
|
||||||
|
<div class="w-full flex justify-center">
|
||||||
|
<Nav @click="navClick" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Dialog
|
||||||
|
v-model:open="pickerDialogOpen"
|
||||||
|
title="Pilih Item"
|
||||||
|
size="2xl"
|
||||||
|
prevent-outside
|
||||||
|
>
|
||||||
|
<ScrCategorySwitcher :data="mcuSrcCategories" v-model="selectedMcuSrcCategory_code" />
|
||||||
|
<McuSrcPicker v-model="items" :data-source="mcuSrcs" @pick="pickItem" />
|
||||||
|
<Separator />
|
||||||
|
<NavOk @click="() => pickerDialogOpen = false" class="justify-center" />
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,198 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
||||||
|
|
||||||
|
import { usePaginatedList } from '~/composables/usePaginatedList'
|
||||||
|
import { toast } from '~/components/pub/ui/toast'
|
||||||
|
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
|
||||||
|
|
||||||
|
import { ActionEvents, type HeaderPrep } from '~/components/pub/my-ui/data/types'
|
||||||
|
|
||||||
|
// Handlers
|
||||||
|
import type { ToastFn } from '~/handlers/_handler'
|
||||||
|
|
||||||
|
// Apps
|
||||||
|
import {
|
||||||
|
recId,
|
||||||
|
recAction,
|
||||||
|
recItem,
|
||||||
|
isReadonly,
|
||||||
|
isFormEntryDialogOpen,
|
||||||
|
isRecordConfirmationOpen,
|
||||||
|
handleActionSave,
|
||||||
|
handleActionRemove,
|
||||||
|
} from '~/handlers/mcu-order.handler'
|
||||||
|
import { getList, getDetail, submit } from '~/services/mcu-order.service'
|
||||||
|
import type { McuOrder } from '~/models/mcu-order'
|
||||||
|
// import List from '~/components/app/mcu-order/micro-list.vue'
|
||||||
|
import ConfirmationInfo from '~/components/app/mcu-order/confirmation-info.vue'
|
||||||
|
|
||||||
|
// Props
|
||||||
|
const props = defineProps<{
|
||||||
|
scopeCode: string
|
||||||
|
}>()
|
||||||
|
|
||||||
|
// Common preparations
|
||||||
|
const route = useRoute()
|
||||||
|
const { crudQueryParams } = useQueryCRUD()
|
||||||
|
|
||||||
|
const title = ref('')
|
||||||
|
const plainEid = route.params.id
|
||||||
|
const encounter_id = (plainEid && typeof plainEid == 'string') ? parseInt(plainEid) : 0 // here the
|
||||||
|
const isSubmitConfirmationOpen = ref(false)
|
||||||
|
|
||||||
|
// Data
|
||||||
|
const {
|
||||||
|
data,
|
||||||
|
isLoading,
|
||||||
|
paginationMeta,
|
||||||
|
searchInput,
|
||||||
|
fetchData: getMyList,
|
||||||
|
} = usePaginatedList<McuOrder>({
|
||||||
|
fetchFn: async ({ page, search }) => {
|
||||||
|
const result = await getList({
|
||||||
|
search,
|
||||||
|
page,
|
||||||
|
'scope-code': props.scopeCode,
|
||||||
|
'encounter-id': encounter_id,
|
||||||
|
includes: 'doctor,doctor-employee,doctor-employee-person,items,items-mcuSrc',
|
||||||
|
})
|
||||||
|
return { success: result.success || false, body: result.body || {} }
|
||||||
|
},
|
||||||
|
entityName: 'mcu-order'
|
||||||
|
})
|
||||||
|
|
||||||
|
// Header
|
||||||
|
const headerPrep: HeaderPrep = {
|
||||||
|
title: 'Order Lab Mikro',
|
||||||
|
icon: 'i-lucide-box',
|
||||||
|
refSearchNav: {
|
||||||
|
placeholder: 'Cari (min. 3 karakter)...',
|
||||||
|
minLength: 3,
|
||||||
|
debounceMs: 500,
|
||||||
|
showValidationFeedback: true,
|
||||||
|
onInput: (value: string) => {
|
||||||
|
searchInput.value = value
|
||||||
|
},
|
||||||
|
onClick: () => {},
|
||||||
|
onClear: () => {},
|
||||||
|
},
|
||||||
|
addNav: {
|
||||||
|
label: 'Tambah',
|
||||||
|
icon: 'i-lucide-plus',
|
||||||
|
onClick: async () => {
|
||||||
|
const saveResp = await handleActionSave({ encounter_id, scope_code: props.scopeCode }, () => {}, () =>{}, toast)
|
||||||
|
if (saveResp.success) {
|
||||||
|
crudQueryParams.value = { mode: 'entry', recordId: saveResp.body?.data?.id.toString() }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// List component
|
||||||
|
let List: Component
|
||||||
|
if(props.scopeCode == 'radiology') {
|
||||||
|
List = defineAsyncComponent(() => import('~/components/content/encounter/status.vue'))
|
||||||
|
} else if(props.scopeCode == 'cp-lab') {
|
||||||
|
List = defineAsyncComponent(() => import('~/components/content/encounter/status.vue'))
|
||||||
|
} else if (props.scopeCode == 'micro-lab') {
|
||||||
|
List = defineAsyncComponent(() => import('~/components/app/mcu-order/micro-list.vue'))
|
||||||
|
} else {
|
||||||
|
List = defineAsyncComponent(() => import('~/components/content/encounter/status.vue'))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reactivities
|
||||||
|
provide('rec_id', recId)
|
||||||
|
provide('rec_action', recAction)
|
||||||
|
provide('rec_item', recItem)
|
||||||
|
provide('table_data_loader', isLoading)
|
||||||
|
|
||||||
|
watch([recId, recAction], () => {
|
||||||
|
switch (recAction.value) {
|
||||||
|
case ActionEvents.showDetail:
|
||||||
|
getMyDetail(recId.value)
|
||||||
|
title.value = 'Detail Order Lab PK'
|
||||||
|
isReadonly.value = true
|
||||||
|
break
|
||||||
|
case ActionEvents.showEdit:
|
||||||
|
getMyDetail(recId.value)
|
||||||
|
title.value = 'Edit Order Lab PK'
|
||||||
|
isReadonly.value = false
|
||||||
|
break
|
||||||
|
case ActionEvents.showConfirmDelete:
|
||||||
|
isRecordConfirmationOpen.value = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
///// Functions
|
||||||
|
async function getMyDetail (id: number | string) {
|
||||||
|
const result = await getDetail(id)
|
||||||
|
if (result.success) {
|
||||||
|
const currentValue = result.body?.data || {}
|
||||||
|
recItem.value = currentValue
|
||||||
|
isFormEntryDialogOpen.value = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function cancel(data: McuOrder) {
|
||||||
|
recId.value = data.id
|
||||||
|
recItem.value = data
|
||||||
|
isRecordConfirmationOpen.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
function edit(data: McuOrder) {
|
||||||
|
crudQueryParams.value = { mode: 'entry', recordId: data.id.toString() }
|
||||||
|
}
|
||||||
|
|
||||||
|
function confirmSubmit(data: McuOrder) {
|
||||||
|
recId.value = data.id
|
||||||
|
recItem.value = data
|
||||||
|
isSubmitConfirmationOpen.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleActionSubmit(id: number, refresh: () => void, toast: ToastFn) {
|
||||||
|
const result = await submit(id)
|
||||||
|
if (result.success) {
|
||||||
|
toast({ title: 'Berhasil', description: 'Resep telah di ajukan', variant: 'default' })
|
||||||
|
setTimeout(refresh, 300)
|
||||||
|
} else {
|
||||||
|
toast({ title: 'Gagal', description: 'Gagal menjalankan perintah', variant: 'destructive' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Header :prep="{ ...headerPrep }" />
|
||||||
|
|
||||||
|
<List
|
||||||
|
v-if="!isLoading.dataListLoading"
|
||||||
|
:data="data"
|
||||||
|
:pagination-meta="paginationMeta"
|
||||||
|
@cancel="cancel"
|
||||||
|
@edit="edit"
|
||||||
|
@submit="confirmSubmit"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<RecordConfirmation
|
||||||
|
v-model:open="isRecordConfirmationOpen"
|
||||||
|
action="delete"
|
||||||
|
:record="recItem"
|
||||||
|
@confirm="() => handleActionRemove(recId, getMyList, toast)"
|
||||||
|
@cancel=""
|
||||||
|
>
|
||||||
|
<ConfirmationInfo :rec-item="recItem" />
|
||||||
|
</RecordConfirmation>
|
||||||
|
|
||||||
|
<RecordConfirmation
|
||||||
|
v-model:open="isSubmitConfirmationOpen"
|
||||||
|
action="delete"
|
||||||
|
customTitle="Ajukan Resep"
|
||||||
|
customMessage="Proses akan mengajukan resep ini untuk diproses lebih lanjut. Lanjutkan?"
|
||||||
|
customConfirmText="Ajukan"
|
||||||
|
:record="recItem"
|
||||||
|
@confirm="() => handleActionSubmit(recId, getMyList, toast)"
|
||||||
|
@cancel=""
|
||||||
|
>
|
||||||
|
<ConfirmationInfo :rec-item="recItem" />
|
||||||
|
</RecordConfirmation>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
//
|
||||||
|
import List from './list.vue'
|
||||||
|
import Entry from './entry.vue'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
encounter_id: number
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const { mode } = useQueryCRUDMode()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<List v-if="mode === 'list'" :encounter_id="encounter_id" />
|
||||||
|
<Entry v-else :encounter_id="encounter_id" />
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import Entry from '~/components/content/mcu-order/entry.vue'
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
encounter_id: number
|
||||||
|
}>()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Entry :encounter_id="encounter_id" scope-code="micro-lab" />
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import List from '~/components/content/mcu-order/list.vue'
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<List scope-code="micro-lab" />
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
//
|
||||||
|
import List from './list.vue'
|
||||||
|
import Entry from './entry.vue'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
encounter_id: number
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const { mode } = useQueryCRUDMode()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<List v-if="mode === 'list'" :encounter_id="encounter_id" />
|
||||||
|
<Entry v-else :encounter_id="encounter_id" />
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
//
|
||||||
|
import * as CH from '~/components/pub/my-ui/content-header'
|
||||||
|
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
||||||
|
import NavEntry from '~/components/pub/my-ui/nav-footer/ba-de-dr-su.vue'
|
||||||
|
import NavDetail from '~/components/pub/my-ui/nav-footer/ba.vue'
|
||||||
|
import NavOk from '~/components/pub/my-ui/nav-footer/ok.vue'
|
||||||
|
|
||||||
|
// Procedure Room
|
||||||
|
import type { ProcedureRoom } from '~/models/procedure-room'
|
||||||
|
import { getList as getProcedureRoomList } from '~/services/procedure-room.service'
|
||||||
|
import PRSwitcher from '~/components/app/procedure-room/switcher.vue'
|
||||||
|
import PRMultiOptPicker from '~/components/app/procedure-room/multi-opt-picker.vue'
|
||||||
|
import PRPicker from '~/components/app/procedure-room/picker.vue'
|
||||||
|
|
||||||
|
// Material Package
|
||||||
|
import type { MaterialPackage } from '~/models/material-package'
|
||||||
|
import { getList as getMaterialPackageList } from '~/services/material-package.service'
|
||||||
|
|
||||||
|
// Material Package Item
|
||||||
|
import type { MaterialPackageItem } from '~/models/material-package-item'
|
||||||
|
import { getList as getmaterialPackageItems } from '~/services/material-package-item.service'
|
||||||
|
import MPSwitcher from '~/components/app/material-package/switcher.vue'
|
||||||
|
import MPIQuickList from '~/components/app/material-package-item/quick-list.vue'
|
||||||
|
|
||||||
|
// Main data
|
||||||
|
import { getDetail } from '~/services/procedure-room-order.service'
|
||||||
|
import Detail from '~/components/app/procedure-room-order/detail.vue'
|
||||||
|
|
||||||
|
// Items data
|
||||||
|
import type { ProcedureRoomOrderItem } from '~/models/procedure-room-order-item'
|
||||||
|
import {
|
||||||
|
getList as getOrderItemList,
|
||||||
|
create as createOrderItem,
|
||||||
|
remove as removeOrderItem,
|
||||||
|
} from '~/services/procedure-room-order-item.service'
|
||||||
|
import ItemListEntry from '~/components/app/procedure-room-order-item/list-entry.vue'
|
||||||
|
import ItemListDetail from '~/components/app/procedure-room-order-item/list-detail.vue'
|
||||||
|
|
||||||
|
// data
|
||||||
|
const { backToList, crudQueryParams } = useQueryCRUD()
|
||||||
|
const id = crudQueryParams.value.recordId
|
||||||
|
const dataRes = await getDetail(
|
||||||
|
typeof id === 'string' ? parseInt(id) : 0,
|
||||||
|
{ includes: 'encounter,doctor,doctor-employee,doctor-employee-person' }
|
||||||
|
)
|
||||||
|
const data = dataRes.body?.data
|
||||||
|
const items = ref<ProcedureRoomOrderItem[]>([])
|
||||||
|
|
||||||
|
// Header
|
||||||
|
const headerConfig: CH.Config = {
|
||||||
|
title: 'Order Ruang Tindakan',
|
||||||
|
icon: 'i-lucide-box',
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
const pickerDialogOpen = ref(false)
|
||||||
|
const procedureRooms = ref<ProcedureRoom[]>([])
|
||||||
|
const procedureRoomType = ref('procedure')
|
||||||
|
getProcedureRooms(procedureRoomType.value)
|
||||||
|
watch(procedureRoomType, async (newValue) => {
|
||||||
|
getProcedureRooms(newValue)
|
||||||
|
})
|
||||||
|
|
||||||
|
//
|
||||||
|
const materialPackages = ref<MaterialPackage[]>([])
|
||||||
|
const selectedMaterialPackage = ref('')
|
||||||
|
const res = await getMaterialPackageList()
|
||||||
|
if (res.success) {
|
||||||
|
materialPackages.value = res.body.data
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
const materialPackageItems = ref<MaterialPackageItem[]>([])
|
||||||
|
watch(selectedMaterialPackage, async (newValue) => {
|
||||||
|
const res = await getmaterialPackageItems({
|
||||||
|
'material-package-code': selectedMaterialPackage.value,
|
||||||
|
includes: 'material'
|
||||||
|
})
|
||||||
|
if (res.success) {
|
||||||
|
materialPackageItems.value = res.body.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// last flow
|
||||||
|
onMounted(async () => {
|
||||||
|
await getItems()
|
||||||
|
})
|
||||||
|
|
||||||
|
///// functions
|
||||||
|
async function getProcedureRooms(typeCode: string) {
|
||||||
|
const res = await getProcedureRoomList({ 'type-code': typeCode, includes: 'infra' })
|
||||||
|
if (res.success) {
|
||||||
|
procedureRooms.value = res.body.data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getItems() {
|
||||||
|
const res = await getOrderItemList({
|
||||||
|
'procedure-room-order-id': crudQueryParams.value.recordId,
|
||||||
|
includes: 'procedureRoom,procedureRoom-infra',
|
||||||
|
})
|
||||||
|
if (res.success) {
|
||||||
|
items.value = res.body.data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function pickItem(item: ProcedureRoom) {
|
||||||
|
const exItem = items.value.find(e => e.procedureRoom_code === item.code)
|
||||||
|
if (exItem) {
|
||||||
|
await removeOrderItem(exItem.id)
|
||||||
|
await getItems()
|
||||||
|
} else {
|
||||||
|
const intId = parseInt(id?.toString() || '0')
|
||||||
|
await createOrderItem({
|
||||||
|
procedureRoomOrder_id: intId,
|
||||||
|
procedureRoom_code: item.code,
|
||||||
|
})
|
||||||
|
await getItems()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function requestItem() {
|
||||||
|
pickerDialogOpen.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
function navClick(type: 'back' | 'delete' | 'draft' | 'submit') {
|
||||||
|
if (type === 'back') {
|
||||||
|
backToList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<CH.ContentHeader v-bind="headerConfig" />
|
||||||
|
|
||||||
|
<Separator class="mb-4" />
|
||||||
|
|
||||||
|
<Detail :data="data" />
|
||||||
|
|
||||||
|
<template v-if="data.status_code == 'new'">
|
||||||
|
<ItemListEntry :data="items" @requestItem="requestItem" />
|
||||||
|
<MPSwitcher :data="materialPackages" v-model="selectedMaterialPackage" />
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<ItemListDetail :data="items" @requestItem="requestItem" />
|
||||||
|
</template>
|
||||||
|
<MPIQuickList :data="materialPackageItems" />
|
||||||
|
|
||||||
|
<div class="w-full flex justify-center">
|
||||||
|
<NavEntry v-if="data.status_code == 'new'" @click="navClick" />
|
||||||
|
<NavDetail v-else @click="navClick" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Dialog
|
||||||
|
v-model:open="pickerDialogOpen"
|
||||||
|
title="Pilih Item"
|
||||||
|
size="2xl"
|
||||||
|
prevent-outside
|
||||||
|
>
|
||||||
|
<PRSwitcher v-model="procedureRoomType" />
|
||||||
|
<PRPicker
|
||||||
|
:data="procedureRooms"
|
||||||
|
:pick-mode="procedureRoomType == 'procedure' ? 'multi' : 'single'"
|
||||||
|
v-model="items"
|
||||||
|
@pick="pickItem"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Separator />
|
||||||
|
<NavOk @click="() => pickerDialogOpen = false" class="justify-center" />
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,191 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
// Composables
|
||||||
|
import { usePaginatedList } from '~/composables/usePaginatedList'
|
||||||
|
|
||||||
|
// Handlers
|
||||||
|
import type { ToastFn } from '~/handlers/_handler'
|
||||||
|
|
||||||
|
// Pubs component
|
||||||
|
import { toast } from '~/components/pub/ui/toast'
|
||||||
|
import { ActionEvents, type HeaderPrep } from '~/components/pub/my-ui/data/types'
|
||||||
|
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
||||||
|
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
|
||||||
|
|
||||||
|
// Order
|
||||||
|
import {
|
||||||
|
recId,
|
||||||
|
recAction,
|
||||||
|
recItem,
|
||||||
|
isRecordConfirmationOpen,
|
||||||
|
handleActionRemove,
|
||||||
|
} from '~/handlers/procedure-room-order.handler'
|
||||||
|
import { getList, create, submit } from '~/services/procedure-room-order.service'
|
||||||
|
import type { ProcedureRoomOrder } from '~/models/procedure-room-order'
|
||||||
|
import List from '~/components/app/procedure-room-order/list.vue'
|
||||||
|
|
||||||
|
// Common prep
|
||||||
|
const route = useRoute()
|
||||||
|
const { setQueryParams } = useQueryParam()
|
||||||
|
const { crudQueryParams } = useQueryCRUD()
|
||||||
|
|
||||||
|
const plainEid = route.params.id
|
||||||
|
const encounter_id = (plainEid && typeof plainEid == 'string') ? parseInt(plainEid) : 0
|
||||||
|
const isSubmitConfirmationOpen = ref(false)
|
||||||
|
|
||||||
|
// Main data
|
||||||
|
const {
|
||||||
|
data,
|
||||||
|
isLoading,
|
||||||
|
paginationMeta,
|
||||||
|
searchInput,
|
||||||
|
fetchData: getMyList,
|
||||||
|
} = usePaginatedList<ProcedureRoomOrder>({
|
||||||
|
fetchFn: async (params: any) => {
|
||||||
|
const result = await getList({
|
||||||
|
'encounter-id': encounter_id,
|
||||||
|
includes: 'items',
|
||||||
|
search: params.search,
|
||||||
|
page: params.page,
|
||||||
|
'page-number': params['page-number'] || 0,
|
||||||
|
'page-size': params['page-size'] || 10,
|
||||||
|
})
|
||||||
|
return { success: result.success || false, body: result.body || {} }
|
||||||
|
},
|
||||||
|
entityName: 'prescription'
|
||||||
|
})
|
||||||
|
|
||||||
|
// Header things
|
||||||
|
const headerPrep: HeaderPrep = {
|
||||||
|
title: 'Order Ruang Tindakan',
|
||||||
|
icon: 'i-lucide-box',
|
||||||
|
refSearchNav: {
|
||||||
|
placeholder: 'Cari (min. 3 karakter)...',
|
||||||
|
minLength: 3,
|
||||||
|
debounceMs: 500,
|
||||||
|
showValidationFeedback: true,
|
||||||
|
onInput: (value: string) => {
|
||||||
|
searchInput.value = value
|
||||||
|
},
|
||||||
|
onClick: () => {},
|
||||||
|
onClear: () => {},
|
||||||
|
},
|
||||||
|
addNav: {
|
||||||
|
label: 'Tambah',
|
||||||
|
icon: 'i-lucide-plus',
|
||||||
|
onClick: async () => {
|
||||||
|
recItem.value = null
|
||||||
|
recId.value = 0
|
||||||
|
const res = await create({ encounter_id })
|
||||||
|
if (res.success) {
|
||||||
|
crudQueryParams.value = { mode: 'entry', recordId: res.body?.data.id.toString() || '0' }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// list actions
|
||||||
|
const timestamp = ref<any>({})
|
||||||
|
provide('rec_id', recId)
|
||||||
|
provide('rec_action', recAction)
|
||||||
|
provide('rec_item', recItem)
|
||||||
|
provide('table_data_loader', isLoading)
|
||||||
|
provide('timestamp', timestamp)
|
||||||
|
watch(recAction, () => {
|
||||||
|
if (!recAction.value) {
|
||||||
|
return
|
||||||
|
} else if (recAction.value === ActionEvents.showDetail) {
|
||||||
|
crudQueryParams.value = { mode: 'entry', recordId: recId.value || '0' }
|
||||||
|
} else if (recAction.value === ActionEvents.showConfirmSubmit) {
|
||||||
|
isSubmitConfirmationOpen.value = true
|
||||||
|
} else if (recAction.value === ActionEvents.showConfirmDelete) {
|
||||||
|
isRecordConfirmationOpen.value = true
|
||||||
|
}
|
||||||
|
recAction.value = ''
|
||||||
|
})
|
||||||
|
|
||||||
|
///// functions
|
||||||
|
|
||||||
|
function confirmCancel(data: ProcedureRoomOrder) {
|
||||||
|
recId.value = data.id
|
||||||
|
recItem.value = data
|
||||||
|
isRecordConfirmationOpen.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
function goToEdit(data: ProcedureRoomOrder) {
|
||||||
|
setQueryParams({
|
||||||
|
'mode': 'entry',
|
||||||
|
'id': data.id.toString()
|
||||||
|
})
|
||||||
|
recItem.value = data
|
||||||
|
}
|
||||||
|
|
||||||
|
function confirmSubmit(data: ProcedureRoomOrder) {
|
||||||
|
recId.value = data.id
|
||||||
|
recItem.value = data
|
||||||
|
isSubmitConfirmationOpen.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleActionSubmit(id: number, refresh: () => void, toast: ToastFn) {
|
||||||
|
const result = await submit(id)
|
||||||
|
if (result.success) {
|
||||||
|
toast({ title: 'Berhasil', description: 'Resep telah di ajukan', variant: 'default' })
|
||||||
|
setTimeout(refresh, 300)
|
||||||
|
} else {
|
||||||
|
toast({ title: 'Gagal', description: 'Gagal menjalankan perintah', variant: 'destructive' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Header :prep="{ ...headerPrep }" />
|
||||||
|
|
||||||
|
<List
|
||||||
|
v-if="!isLoading.dataListLoading"
|
||||||
|
:data="data"
|
||||||
|
:pagination-meta="paginationMeta"
|
||||||
|
@cancel="confirmCancel"
|
||||||
|
@edit="goToEdit"
|
||||||
|
@submit="confirmSubmit"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<RecordConfirmation
|
||||||
|
v-model:open="isRecordConfirmationOpen"
|
||||||
|
action="delete"
|
||||||
|
:record="recItem"
|
||||||
|
@confirm="() => handleActionRemove(recId, getMyList, toast)"
|
||||||
|
@cancel=""
|
||||||
|
>
|
||||||
|
<div class="flex mb-2">
|
||||||
|
<div class="w-20">Tanggal</div>
|
||||||
|
<div class="w-4">:</div>
|
||||||
|
<div class="">{{ recItem.createdAt?.substring(0, 10) }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex">
|
||||||
|
<div class="w-20">DPJP</div>
|
||||||
|
<div class="w-4">:</div>
|
||||||
|
<div class="">{{ recItem.doctor?.employee?.person?.name }}</div>
|
||||||
|
</div>
|
||||||
|
</RecordConfirmation>
|
||||||
|
|
||||||
|
<RecordConfirmation
|
||||||
|
v-model:open="isSubmitConfirmationOpen"
|
||||||
|
action="delete"
|
||||||
|
customTitle="Ajukan Resep"
|
||||||
|
customMessage="Proses akan mengajukan resep ini untuk diproses lebih lanjut. Lanjutkan?"
|
||||||
|
customConfirmText="Ajukan"
|
||||||
|
:record="recItem"
|
||||||
|
@confirm="() => handleActionSubmit(recId, getMyList, toast)"
|
||||||
|
@cancel=""
|
||||||
|
>
|
||||||
|
<div class="flex mb-2">
|
||||||
|
<div class="w-20">Tanggal</div>
|
||||||
|
<div class="w-4">:</div>
|
||||||
|
<div class="">{{ recItem.createdAt.substring(0, 10) }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex">
|
||||||
|
<div class="w-20">DPJP</div>
|
||||||
|
<div class="w-4">:</div>
|
||||||
|
<div class="">{{ recItem.doctor?.employee?.person?.name }}</div>
|
||||||
|
</div>
|
||||||
|
</RecordConfirmation>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
//
|
||||||
|
import List from './list.vue'
|
||||||
|
import Entry from './entry.vue'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
encounter_id: number
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const { crudQueryParams } = useQueryCRUD()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<List v-if="crudQueryParams.mode === 'list'" :encounter_id="encounter_id" />
|
||||||
|
<Entry v-else :encounter_id="encounter_id" />
|
||||||
|
<div class="hidden">{{ crudQueryParams.mode }}</div>
|
||||||
|
</template>
|
||||||
@@ -13,7 +13,6 @@ import {
|
|||||||
recAction,
|
recAction,
|
||||||
recItem,
|
recItem,
|
||||||
isReadonly,
|
isReadonly,
|
||||||
isFormEntryDialogOpen,
|
|
||||||
isRecordConfirmationOpen,
|
isRecordConfirmationOpen,
|
||||||
handleActionSave,
|
handleActionSave,
|
||||||
handleActionRemove,
|
handleActionRemove,
|
||||||
@@ -28,6 +27,7 @@ const route = useRoute()
|
|||||||
const { setQueryParams } = useQueryParam()
|
const { setQueryParams } = useQueryParam()
|
||||||
|
|
||||||
const title = ref('')
|
const title = ref('')
|
||||||
|
const addTrigger = ref(false)
|
||||||
|
|
||||||
const plainEid = route.params.id
|
const plainEid = route.params.id
|
||||||
const encounter_id = (plainEid && typeof plainEid == 'string') ? parseInt(plainEid) : 0 // here the
|
const encounter_id = (plainEid && typeof plainEid == 'string') ? parseInt(plainEid) : 0 // here the
|
||||||
@@ -74,7 +74,7 @@ const headerPrep: HeaderPrep = {
|
|||||||
onClick: () => {
|
onClick: () => {
|
||||||
recItem.value = null
|
recItem.value = null
|
||||||
recId.value = 0
|
recId.value = 0
|
||||||
isFormEntryDialogOpen.value = true
|
addTrigger.value = true
|
||||||
isReadonly.value = false
|
isReadonly.value = false
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -90,7 +90,7 @@ const getMyDetail = async (id: number | string) => {
|
|||||||
if (result.success) {
|
if (result.success) {
|
||||||
const currentValue = result.body?.data || {}
|
const currentValue = result.body?.data || {}
|
||||||
recItem.value = currentValue
|
recItem.value = currentValue
|
||||||
isFormEntryDialogOpen.value = true
|
addTrigger.value = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,10 +113,10 @@ watch([recId, recAction], () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
watch([isFormEntryDialogOpen], async () => {
|
watch([addTrigger], async () => {
|
||||||
if (isFormEntryDialogOpen.value) {
|
if (addTrigger.value) {
|
||||||
isFormEntryDialogOpen.value = false;
|
addTrigger.value = false;
|
||||||
const saveResp = await handleActionSave({ encounter_id }, getMyList, () =>{}, toast)
|
const saveResp = await handleActionSave({ encounter_id, "scope_code": "rad" }, getMyList, () =>{}, toast)
|
||||||
if (saveResp.success) {
|
if (saveResp.success) {
|
||||||
setQueryParams({
|
setQueryParams({
|
||||||
'mode': 'entry',
|
'mode': 'entry',
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
const model = defineModel<string>()
|
||||||
|
const props = defineProps<{
|
||||||
|
class: string
|
||||||
|
defaultClass?: string
|
||||||
|
disabled?: boolean
|
||||||
|
width?: number
|
||||||
|
widthUnit?: string
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const InputComp = defineAsyncComponent(() => import('~/components/pub/ui/input/Input.vue'))
|
||||||
|
const activeState = ref(false)
|
||||||
|
|
||||||
|
let defaultClass = props.defaultClass ?? 'h-8 xl:h-9'
|
||||||
|
let widthStyle = '';
|
||||||
|
if(props.width) {
|
||||||
|
widthStyle = `width: ${props.width}${props.widthUnit ?? 'px'};`
|
||||||
|
} else {
|
||||||
|
widthStyle = `width: 100%;`
|
||||||
|
}
|
||||||
|
|
||||||
|
const recId = inject<Ref<number>>('rec_id')!
|
||||||
|
const recAction = inject<Ref<string>>('rec_action')!
|
||||||
|
const recItem = inject<Ref<any>>('rec_item')!
|
||||||
|
|
||||||
|
watch(activeState, () => {
|
||||||
|
nextTick(() => {
|
||||||
|
if (asyncInputRef.value && typeof asyncInputRef.value.focus === 'function') {
|
||||||
|
asyncInputRef.value.focus()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// document.getElementById('editable-div')?.scrollIntoView({ behavior: 'smooth' })
|
||||||
|
InputComp.value.focus()
|
||||||
|
// console.log(inputComp.__defaults)
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
v-if="!activeState || disabled" @click="() => activeState = true"
|
||||||
|
:class="`${defaultClass}`"
|
||||||
|
:style="widthStyle">
|
||||||
|
{{ model }}
|
||||||
|
</div>
|
||||||
|
<InputComp v-else
|
||||||
|
v-model="model"
|
||||||
|
:class="`${defaultClass}`"
|
||||||
|
:style="widthStyle"
|
||||||
|
@blur="() => activeState = false"
|
||||||
|
/>
|
||||||
|
<!-- {{ inputComp.value }} -->
|
||||||
|
<!-- <Input
|
||||||
|
v-else v-model="model" @blur="() => activeState = false"
|
||||||
|
:class="`${defaultClass}`"
|
||||||
|
:style="widthStyle"
|
||||||
|
autofocus
|
||||||
|
/> -->
|
||||||
|
</template>
|
||||||
@@ -7,7 +7,7 @@ const props = defineProps<{
|
|||||||
|
|
||||||
const defaultClass = props.defaultClass ?? 'm-2 flex gap-2 px-2'
|
const defaultClass = props.defaultClass ?? 'm-2 flex gap-2 px-2'
|
||||||
const additionalClass = props.class ?? ''
|
const additionalClass = props.class ?? ''
|
||||||
const btnClass = props.smallMode ? '[&_button]:w-7 [&_button]:h-7 [&_button]:2xl:w-8 [&_button]:2xl:h-9 [&_button]:!p-0' : ''
|
const btnClass = props.smallMode ? '[&_button]:w-7 [&_button]:h-7 [&_button]:2xl:w-8 [&_button]:2xl:h-8 [&_button]:!p-0' : ''
|
||||||
|
|
||||||
type ClickType = 'cancel' | 'edit' | 'submit'
|
type ClickType = 'cancel' | 'edit' | 'submit'
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,13 @@ export function useQueryCRUDMode(key: string = 'mode') {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const goToEntry = () => (mode.value = 'entry')
|
const goToEntry = (myRecord_id?: any) => {
|
||||||
|
mode.value = 'entry'
|
||||||
|
if(myRecord_id) {
|
||||||
|
myRecord_id.value = myRecord_id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const backToList = () => {
|
const backToList = () => {
|
||||||
router.push({
|
router.push({
|
||||||
path: route.path,
|
path: route.path,
|
||||||
@@ -78,7 +84,7 @@ export function useQueryCRUDMode(key: string = 'mode') {
|
|||||||
...route.query,
|
...route.query,
|
||||||
mode: 'list',
|
mode: 'list',
|
||||||
// HAPUS record-id
|
// HAPUS record-id
|
||||||
'record-id': undefined,
|
recordIdKey: undefined,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -106,3 +112,4 @@ export function useQueryCRUDRecordId(key: string = 'record-id') {
|
|||||||
|
|
||||||
return { recordId }
|
return { recordId }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export type MedObstacleCode = 'hearing' | 'sight' | 'physical' | 'emotional' | '
|
|||||||
export type LearnMethodCode = 'demo' | 'discuss-leaflet'
|
export type LearnMethodCode = 'demo' | 'discuss-leaflet'
|
||||||
export type LangClassCode = 'ind' | 'region' | 'foreign'
|
export type LangClassCode = 'ind' | 'region' | 'foreign'
|
||||||
export type TranslatorSrcCode = 'team' | 'family'
|
export type TranslatorSrcCode = 'team' | 'family'
|
||||||
|
export type ProcedureRoomTypeCode = 'procedure' | 'operation'
|
||||||
|
|
||||||
export const subjectCodes: Record<SubjectCode, string> = {
|
export const subjectCodes: Record<SubjectCode, string> = {
|
||||||
detail: 'Detail',
|
detail: 'Detail',
|
||||||
@@ -224,3 +225,8 @@ export const translatorSrcCodes: Record<TranslatorSrcCode, string> = {
|
|||||||
team: 'Tim Penerjemah',
|
team: 'Tim Penerjemah',
|
||||||
family: 'Keluarga',
|
family: 'Keluarga',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const procedureRoomTypeCodes: Record<ProcedureRoomTypeCode, string> = {
|
||||||
|
procedure: 'Ruang Tindakan',
|
||||||
|
operation: 'Ruang Operasi',
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
// Handlers
|
||||||
|
import { genCrudHandler } from '~/handlers/_handler'
|
||||||
|
|
||||||
|
// Services
|
||||||
|
import { create, update, remove } from '~/services/antibiotic-in-use'
|
||||||
|
|
||||||
|
export const {
|
||||||
|
recId,
|
||||||
|
recAction,
|
||||||
|
recItem,
|
||||||
|
isReadonly,
|
||||||
|
isProcessing,
|
||||||
|
isFormEntryDialogOpen,
|
||||||
|
isRecordConfirmationOpen,
|
||||||
|
onResetState,
|
||||||
|
handleActionSave,
|
||||||
|
handleActionEdit,
|
||||||
|
handleActionRemove,
|
||||||
|
handleCancelForm,
|
||||||
|
} = genCrudHandler({
|
||||||
|
create,
|
||||||
|
update,
|
||||||
|
remove,
|
||||||
|
})
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
// Handlers
|
||||||
|
import { genCrudHandler } from '~/handlers/_handler'
|
||||||
|
|
||||||
|
// Services
|
||||||
|
import { create, update, remove } from '~/services/antibiotic-src-category'
|
||||||
|
|
||||||
|
export const {
|
||||||
|
recId,
|
||||||
|
recAction,
|
||||||
|
recItem,
|
||||||
|
isReadonly,
|
||||||
|
isProcessing,
|
||||||
|
isFormEntryDialogOpen,
|
||||||
|
isRecordConfirmationOpen,
|
||||||
|
onResetState,
|
||||||
|
handleActionSave,
|
||||||
|
handleActionEdit,
|
||||||
|
handleActionRemove,
|
||||||
|
handleCancelForm,
|
||||||
|
} = genCrudHandler({
|
||||||
|
create,
|
||||||
|
update,
|
||||||
|
remove,
|
||||||
|
})
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
// Handlers
|
||||||
|
import { genCrudHandler } from '~/handlers/_handler'
|
||||||
|
|
||||||
|
// Services
|
||||||
|
import { create, update, remove } from '~/services/antibiotic-src'
|
||||||
|
|
||||||
|
export const {
|
||||||
|
recId,
|
||||||
|
recAction,
|
||||||
|
recItem,
|
||||||
|
isReadonly,
|
||||||
|
isProcessing,
|
||||||
|
isFormEntryDialogOpen,
|
||||||
|
isRecordConfirmationOpen,
|
||||||
|
onResetState,
|
||||||
|
handleActionSave,
|
||||||
|
handleActionEdit,
|
||||||
|
handleActionRemove,
|
||||||
|
handleCancelForm,
|
||||||
|
} = genCrudHandler({
|
||||||
|
create,
|
||||||
|
update,
|
||||||
|
remove,
|
||||||
|
})
|
||||||
@@ -40,6 +40,8 @@ const ChemoMedicineProtocolListAsync = defineAsyncComponent(
|
|||||||
const DeviceOrderAsync = defineAsyncComponent(() => import('~/components/content/device-order/main.vue'))
|
const DeviceOrderAsync = defineAsyncComponent(() => import('~/components/content/device-order/main.vue'))
|
||||||
const PrescriptionAsync = defineAsyncComponent(() => import('~/components/content/prescription/main.vue'))
|
const PrescriptionAsync = defineAsyncComponent(() => import('~/components/content/prescription/main.vue'))
|
||||||
const CpLabOrderAsync = defineAsyncComponent(() => import('~/components/content/cp-lab-order/main.vue'))
|
const CpLabOrderAsync = defineAsyncComponent(() => import('~/components/content/cp-lab-order/main.vue'))
|
||||||
|
const ProcedureRoomOrderAsync = defineAsyncComponent(() => import('~/components/content/procedure-room-order/main.vue'))
|
||||||
|
const MicroLabOrderAsync = defineAsyncComponent(() => import('~/components/content/micro-lab-order/main.vue'))
|
||||||
const CprjAsync = defineAsyncComponent(() => import('~/components/content/cprj/entry.vue'))
|
const CprjAsync = defineAsyncComponent(() => import('~/components/content/cprj/entry.vue'))
|
||||||
const RadiologyAsync = defineAsyncComponent(() => import('~/components/content/radiology-order/main.vue'))
|
const RadiologyAsync = defineAsyncComponent(() => import('~/components/content/radiology-order/main.vue'))
|
||||||
const ConsultationAsync = defineAsyncComponent(() => import('~/components/content/consultation/list.vue'))
|
const ConsultationAsync = defineAsyncComponent(() => import('~/components/content/consultation/list.vue'))
|
||||||
@@ -167,8 +169,8 @@ const defaultKeys: Record<string, any> = {
|
|||||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||||
unit: 'all',
|
unit: 'all',
|
||||||
},
|
},
|
||||||
actionRoomOrder: {
|
procedureRoomOrder: {
|
||||||
id: 'action-room-order',
|
id: 'procedure-room-order',
|
||||||
title: 'Order Ruang Tindakan',
|
title: 'Order Ruang Tindakan',
|
||||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||||
unit: 'all',
|
unit: 'all',
|
||||||
@@ -377,8 +379,7 @@ export function injectComponents(id: string | number, data: EncounterListData, m
|
|||||||
currentKeys.cpLabOrder['props'] = { encounter_id: id }
|
currentKeys.cpLabOrder['props'] = { encounter_id: id }
|
||||||
}
|
}
|
||||||
if (currentKeys?.microLabOrder) {
|
if (currentKeys?.microLabOrder) {
|
||||||
// TODO: add component for microLabOrder
|
currentKeys.microLabOrder['component'] = MicroLabOrderAsync
|
||||||
currentKeys.microLabOrder['component'] = null
|
|
||||||
currentKeys.microLabOrder['props'] = { encounter_id: id }
|
currentKeys.microLabOrder['props'] = { encounter_id: id }
|
||||||
}
|
}
|
||||||
if (currentKeys?.paLabOrder) {
|
if (currentKeys?.paLabOrder) {
|
||||||
@@ -386,10 +387,9 @@ export function injectComponents(id: string | number, data: EncounterListData, m
|
|||||||
currentKeys.paLabOrder['component'] = null
|
currentKeys.paLabOrder['component'] = null
|
||||||
currentKeys.paLabOrder['props'] = { encounter_id: id }
|
currentKeys.paLabOrder['props'] = { encounter_id: id }
|
||||||
}
|
}
|
||||||
if (currentKeys?.actionRoomOrder) {
|
if (currentKeys?.procedureRoomOrder) {
|
||||||
// TODO: add component for actionRoomOrder
|
currentKeys.procedureRoomOrder['component'] = ProcedureRoomOrderAsync
|
||||||
currentKeys.actionRoomOrder['component'] = null
|
currentKeys.procedureRoomOrder['props'] = { encounter_id: id }
|
||||||
currentKeys.actionRoomOrder['props'] = { encounter_id: id }
|
|
||||||
}
|
}
|
||||||
if (currentKeys?.mcuResult) {
|
if (currentKeys?.mcuResult) {
|
||||||
// TODO: add component for mcuResult
|
// TODO: add component for mcuResult
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { genCrudHandler } from '~/handlers/_handler'
|
||||||
|
import { create, update, remove } from '~/services/procedure-room-order.service'
|
||||||
|
|
||||||
|
export const {
|
||||||
|
recId,
|
||||||
|
recAction,
|
||||||
|
recItem,
|
||||||
|
isReadonly,
|
||||||
|
isProcessing,
|
||||||
|
isFormEntryDialogOpen,
|
||||||
|
isRecordConfirmationOpen,
|
||||||
|
onResetState,
|
||||||
|
handleActionSave,
|
||||||
|
handleActionEdit,
|
||||||
|
handleActionRemove,
|
||||||
|
handleCancelForm,
|
||||||
|
} = genCrudHandler({ create, update, remove})
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { genCrudHandler } from '~/handlers/_handler'
|
||||||
|
import { create, update, remove } from '~/services/procedure-room.service'
|
||||||
|
|
||||||
|
export const {
|
||||||
|
recId,
|
||||||
|
recAction,
|
||||||
|
recItem,
|
||||||
|
isReadonly,
|
||||||
|
isProcessing,
|
||||||
|
isFormEntryDialogOpen,
|
||||||
|
isRecordConfirmationOpen,
|
||||||
|
onResetState,
|
||||||
|
handleActionSave,
|
||||||
|
handleActionEdit,
|
||||||
|
handleActionRemove,
|
||||||
|
handleCancelForm,
|
||||||
|
} = genCrudHandler({ create, update, remove})
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { type Base, genBase } from "./_base"
|
||||||
|
import type { AntibioticSrc } from "./antibiotic-src"
|
||||||
|
|
||||||
|
export interface AntibioticInUse extends Base {
|
||||||
|
mcuOrder_id: number
|
||||||
|
antibioticSrc_code: string
|
||||||
|
antibioticSrc: AntibioticSrc
|
||||||
|
}
|
||||||
|
|
||||||
|
export function genDevice(): Pick<AntibioticInUse, 'mcuOrder_id' | 'antibioticSrc_code'> {
|
||||||
|
return {
|
||||||
|
...genBase(),
|
||||||
|
mcuOrder_id: 0,
|
||||||
|
antibioticSrc_code: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import { type Base, genBase } from "./_base"
|
||||||
|
|
||||||
|
export interface AntibioticSrcCategory extends Base {
|
||||||
|
code: string
|
||||||
|
name: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export function genDevice(): AntibioticSrcCategory {
|
||||||
|
return {
|
||||||
|
...genBase(),
|
||||||
|
code: '',
|
||||||
|
name: '',
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { type Base, genBase } from "./_base"
|
||||||
|
|
||||||
|
export interface AntibioticSrc extends Base {
|
||||||
|
code: string
|
||||||
|
name: string
|
||||||
|
antibioticSrcCategory_code: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export function genDevice(): AntibioticSrc {
|
||||||
|
return {
|
||||||
|
...genBase(),
|
||||||
|
code: '',
|
||||||
|
name: '',
|
||||||
|
antibioticSrcCategory_code: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
+20
-3
@@ -1,10 +1,27 @@
|
|||||||
export interface Infra {
|
import { type Base, genBase } from "./_base";
|
||||||
id?: number
|
import { genProcedureRoom, type ProcedureRoom } from "./procedure-room";
|
||||||
|
|
||||||
|
export interface Infra extends Base {
|
||||||
code: string
|
code: string
|
||||||
name: string
|
name: string
|
||||||
infraGroup_code: string
|
infraGroup_code: string
|
||||||
parent_id?: number | string | null
|
parent_id?: number | string | null
|
||||||
|
unit_id?: number | string | null
|
||||||
specialist_id?: number | string | null
|
specialist_id?: number | string | null
|
||||||
subspecialist_id?: number | string | null
|
subspecialist_id?: number | string | null
|
||||||
unit_id?: number | string | null
|
procedureRoom?: ProcedureRoom
|
||||||
|
}
|
||||||
|
|
||||||
|
export function genInfra(): Infra {
|
||||||
|
return {
|
||||||
|
...genBase(),
|
||||||
|
code: '',
|
||||||
|
name: '',
|
||||||
|
infraGroup_code: '',
|
||||||
|
parent_id: null,
|
||||||
|
unit_id: null,
|
||||||
|
specialist_id: null,
|
||||||
|
subspecialist_id: null,
|
||||||
|
procedureRoom: genProcedureRoom(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import { type Base, genBase } from "./_base"
|
||||||
|
|
||||||
|
export interface MaterialPackageItem extends Base {
|
||||||
|
materialPackage_code: string
|
||||||
|
material_code: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export function genMaterialPackage(): MaterialPackageItem {
|
||||||
|
return {
|
||||||
|
...genBase(),
|
||||||
|
materialPackage_code: '',
|
||||||
|
material_code: '',
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import { type Base, genBase } from "./_base"
|
||||||
|
|
||||||
|
export interface MaterialPackage extends Base {
|
||||||
|
code: string
|
||||||
|
name: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export function genMaterialPackage(): MaterialPackage {
|
||||||
|
return {
|
||||||
|
...genBase(),
|
||||||
|
code: '',
|
||||||
|
name: '',
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,16 +2,33 @@ import { type Base, genBase } from "./_base"
|
|||||||
|
|
||||||
export interface McuOrderItem extends Base {
|
export interface McuOrderItem extends Base {
|
||||||
mcuOrder_id: number
|
mcuOrder_id: number
|
||||||
mcuSrc_id: number
|
mcuSrc_code: string
|
||||||
|
note?: string
|
||||||
examinationDate?: string
|
examinationDate?: string
|
||||||
result?: string
|
result?: string
|
||||||
status_code?: string
|
status_code?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface CreateDto {
|
||||||
|
mcuOrder_id: number
|
||||||
|
mcuSrc_code: string
|
||||||
|
note?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ReadList {
|
||||||
|
'mcu-order-id'?: number
|
||||||
|
'mcu-src-code'?: string
|
||||||
|
includes?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateDto extends CreateDto {
|
||||||
|
id: number
|
||||||
|
}
|
||||||
|
|
||||||
export function genMcuOrderItem(): McuOrderItem {
|
export function genMcuOrderItem(): McuOrderItem {
|
||||||
return {
|
return {
|
||||||
...genBase(),
|
...genBase(),
|
||||||
mcuOrder_id: 0,
|
mcuOrder_id: 0,
|
||||||
mcuSrc_id: 0,
|
mcuSrc_code: '',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { type Base, genBase } from "./_base"
|
import { type Base, genBase } from "./_base"
|
||||||
|
|
||||||
export interface McuOrderSubItem extends Base {
|
export interface McuOrderSubItem extends Base {
|
||||||
mcuSubSrc_id: number
|
|
||||||
mcuOrderItem_id: number
|
mcuOrderItem_id: number
|
||||||
|
mcuSubSrc_code: string
|
||||||
result?: string
|
result?: string
|
||||||
status_code?: string
|
status_code?: string
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,7 @@ export interface McuOrderSubItem extends Base {
|
|||||||
export function genMcuOrderSubItem(): McuOrderSubItem {
|
export function genMcuOrderSubItem(): McuOrderSubItem {
|
||||||
return {
|
return {
|
||||||
...genBase(),
|
...genBase(),
|
||||||
mcuSubSrc_id: 0,
|
|
||||||
mcuOrderItem_id: 0,
|
mcuOrderItem_id: 0,
|
||||||
|
mcuSubSrc_code: '',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { type Base, genBase } from "./_base"
|
import { type Base, genBase } from "./_base"
|
||||||
|
import type { AntibioticInUse } from "./antibiotic-in-use"
|
||||||
import { type Doctor, genDoctor } from "./doctor"
|
import { type Doctor, genDoctor } from "./doctor"
|
||||||
import type { McuOrderItem } from "./mcu-order-item"
|
import type { McuOrderItem } from "./mcu-order-item"
|
||||||
|
|
||||||
@@ -13,6 +14,7 @@ export interface McuOrder extends Base {
|
|||||||
temperature?: number
|
temperature?: number
|
||||||
mcuUrgencyLevel_code?: string
|
mcuUrgencyLevel_code?: string
|
||||||
items: McuOrderItem[]
|
items: McuOrderItem[]
|
||||||
|
antibioticInUseItems: AntibioticInUse[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export function genMcuOrder(): McuOrder {
|
export function genMcuOrder(): McuOrder {
|
||||||
@@ -23,7 +25,8 @@ export function genMcuOrder(): McuOrder {
|
|||||||
doctor: genDoctor(),
|
doctor: genDoctor(),
|
||||||
specimenPickTime: '',
|
specimenPickTime: '',
|
||||||
examinationDate: '',
|
examinationDate: '',
|
||||||
items: []
|
items: [],
|
||||||
|
antibioticInUseItems: [],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import { type Base, genBase } from "./_base";
|
||||||
|
import { genMaterialPackage, type MaterialPackage } from "./material-package";
|
||||||
|
import { genProcedureRoom, type ProcedureRoom } from "./procedure-room";
|
||||||
|
|
||||||
|
export interface ProcedureRoomOrderItem extends Base {
|
||||||
|
procedureRoomOrder_id: number
|
||||||
|
procedureRoom_code: string
|
||||||
|
procedureRoom: ProcedureRoom
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateDto {
|
||||||
|
procedureRoomOrder_id: number
|
||||||
|
procedureRoom_code: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateDto extends CreateDto {
|
||||||
|
note?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export function genProcedureRoomOrderItem(): ProcedureRoomOrderItem {
|
||||||
|
return {
|
||||||
|
...genBase(),
|
||||||
|
procedureRoomOrder_id: 0,
|
||||||
|
procedureRoom_code: '',
|
||||||
|
procedureRoom: genProcedureRoom(),
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { type Base, genBase } from "./_base";
|
||||||
|
import { genMaterialPackage, type MaterialPackage } from "./material-package";
|
||||||
|
import { genProcedureRoom, type ProcedureRoom } from "./procedure-room";
|
||||||
|
|
||||||
|
export interface ProcedureRoomOrder extends Base {
|
||||||
|
encounter_id: number
|
||||||
|
materialPackage_code?: string
|
||||||
|
materialPackage: MaterialPackage
|
||||||
|
items?: ProcedureRoom[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateDto {
|
||||||
|
encounter_id: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export function genProcedureRoomOrder(): ProcedureRoomOrder {
|
||||||
|
return {
|
||||||
|
...genBase(),
|
||||||
|
encounter_id: 0,
|
||||||
|
materialPackage_code: '',
|
||||||
|
materialPackage: genMaterialPackage(),
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { type Base, genBase } from "./_base";
|
||||||
|
import type { Infra } from "./infra";
|
||||||
|
|
||||||
|
export interface ProcedureRoom extends Base {
|
||||||
|
code: string
|
||||||
|
infra_code: string
|
||||||
|
infra?: Infra
|
||||||
|
type_code: string
|
||||||
|
unit_code: string
|
||||||
|
specialist_code?: string | null
|
||||||
|
subspecialist_code?: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export function genProcedureRoom(): ProcedureRoom {
|
||||||
|
return {
|
||||||
|
...genBase(),
|
||||||
|
code: '',
|
||||||
|
infra_code: '',
|
||||||
|
type_code: '',
|
||||||
|
unit_code: '',
|
||||||
|
specialist_code: null,
|
||||||
|
subspecialist_code: null,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { z } from 'zod'
|
||||||
|
import type { MaterialPackageItem } from '~/models/material-package-item'
|
||||||
|
|
||||||
|
const MaterialSchema = z.object({
|
||||||
|
materialPackage_code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
|
||||||
|
material_code: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
|
||||||
|
})
|
||||||
|
|
||||||
|
type MaterialFormData = z.infer<typeof MaterialSchema> & Partial<MaterialPackageItem>
|
||||||
|
|
||||||
|
export { MaterialSchema }
|
||||||
|
export type { MaterialFormData }
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { z } from 'zod'
|
||||||
|
import type { MaterialPackage } from '~/models/material-package'
|
||||||
|
|
||||||
|
const MaterialSchema = z.object({
|
||||||
|
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
|
||||||
|
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
|
||||||
|
})
|
||||||
|
|
||||||
|
type MaterialFormData = z.infer<typeof MaterialSchema> & Partial<MaterialPackage>
|
||||||
|
|
||||||
|
export { MaterialSchema }
|
||||||
|
export type { MaterialFormData }
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// Base
|
||||||
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
|
const name = 'antibiotic-in-use'
|
||||||
|
const path = '/api/v1/' + name
|
||||||
|
|
||||||
|
export function create(data: any) {
|
||||||
|
return base.create(path, data, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getList(params: any = null) {
|
||||||
|
return base.getList(path, params, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDetail(id: number | string) {
|
||||||
|
return base.getDetail(path, id, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function update(id: number | string, data: any) {
|
||||||
|
return base.update(path, id, data, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function remove(id: number | string) {
|
||||||
|
return base.remove(path, id, name)
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// Base
|
||||||
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
|
const name = 'antibiotic-src-category'
|
||||||
|
const path = '/api/v1/' + name
|
||||||
|
|
||||||
|
export function create(data: any) {
|
||||||
|
return base.create(path, data, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getList(params: any = null) {
|
||||||
|
return base.getList(path, params, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDetail(id: number | string) {
|
||||||
|
return base.getDetail(path, id, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function update(id: number | string, data: any) {
|
||||||
|
return base.update(path, id, data, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function remove(id: number | string) {
|
||||||
|
return base.remove(path, id, name)
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// Base
|
||||||
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
|
const name = 'antibiotic-src'
|
||||||
|
const path = '/api/v1/' + name
|
||||||
|
|
||||||
|
export function create(data: any) {
|
||||||
|
return base.create(path, data, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getList(params: any = null) {
|
||||||
|
return base.getList(path, params, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDetail(id: number | string) {
|
||||||
|
return base.getDetail(path, id, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function update(id: number | string, data: any) {
|
||||||
|
return base.update(path, id, data, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function remove(id: number | string) {
|
||||||
|
return base.remove(path, id, name)
|
||||||
|
}
|
||||||
@@ -1,14 +1,11 @@
|
|||||||
|
|
||||||
// Base
|
|
||||||
import * as base from './_crud-base'
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
// Types
|
|
||||||
import type { Infra } from '~/models/infra'
|
import type { Infra } from '~/models/infra'
|
||||||
|
|
||||||
const path = '/api/v1/infra'
|
|
||||||
const name = 'infra'
|
const name = 'infra'
|
||||||
|
const path = `/api/v1/${name}`
|
||||||
|
|
||||||
export function create(data: any) {
|
export function create(data: Infra) {
|
||||||
return base.create(path, data, name)
|
return base.create(path, data, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,7 +17,7 @@ export function getDetail(id: number | string) {
|
|||||||
return base.getDetail(path, id, name)
|
return base.getDetail(path, id, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function update(id: number | string, data: any) {
|
export function update(id: number | string, data: Infra) {
|
||||||
return base.update(path, id, data, name)
|
return base.update(path, id, data, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,15 +25,26 @@ export function remove(id: number | string) {
|
|||||||
return base.remove(path, id, name)
|
return base.remove(path, id, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
|
export async function getValueLabelList(params: any = null, useId = false): Promise<{ value: string; label: string }[]> {
|
||||||
let data: { value: string; label: string }[] = []
|
let data: { value: string; label: string }[] = []
|
||||||
const result = await getList(params)
|
const result = await getList(params)
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
const resultData = result.body?.data || []
|
const resultData = result.body?.data || []
|
||||||
data = resultData.map((item: Infra) => ({
|
data = !useId ?
|
||||||
value: item.id ? Number(item.id) : item.code,
|
resultData.map((item: Infra) => ({ value: item.code, label: item.name })) :
|
||||||
label: item.name,
|
resultData.map((item: Infra) => ({ value: item.id, label: item.name }))
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// export async function getProcedureRoomValueLabelList(params: any = null, useId = false): Promise<{ value: string; label: string }[]> {
|
||||||
|
// let data: { value: string; label: string }[] = []
|
||||||
|
// const result = await getList({ 'infraGroup_code': 'procedure-room' ,...params})
|
||||||
|
// if (result.success) {
|
||||||
|
// const resultData = result.body?.data || []
|
||||||
|
// data = !useId ?
|
||||||
|
// resultData.map((item: Infra) => ({ value: item.code, label: item.name })) :
|
||||||
|
// resultData.map((item: Infra) => ({ value: item.id, label: item.name }))
|
||||||
|
// }
|
||||||
|
// return data
|
||||||
|
// }
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// Base
|
||||||
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
|
const name = 'material-package-item'
|
||||||
|
const path = `/api/v1/${name}`
|
||||||
|
|
||||||
|
export function create(data: any) {
|
||||||
|
return base.create(path, data, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getList(params: any = null) {
|
||||||
|
return base.getList(path, params, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDetail(id: number | string) {
|
||||||
|
return base.getDetail(path, id, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function update(id: number | string, data: any) {
|
||||||
|
return base.update(path, id, data, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function remove(id: number | string) {
|
||||||
|
return base.remove(path, id, name)
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
// Base
|
||||||
|
import type { MaterialPackage } from '~/models/material-package'
|
||||||
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
|
const name = 'material-package'
|
||||||
|
const path = `/api/v1/${name}`
|
||||||
|
|
||||||
|
export function create(data: any) {
|
||||||
|
return base.create(path, data, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getList(params: any = null) {
|
||||||
|
return base.getList(path, params, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDetail(id: number | string) {
|
||||||
|
return base.getDetail(path, id, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function update(id: number | string, data: any) {
|
||||||
|
return base.update(path, id, data, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function remove(id: number | string) {
|
||||||
|
return base.remove(path, id, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getValueLabelList(params: any = null, useId = false): Promise<{ value: string; label: string }[]> {
|
||||||
|
let data: { value: string; label: string }[] = []
|
||||||
|
const result = await getList(params)
|
||||||
|
if (result.success) {
|
||||||
|
const resultData = result.body?.data || []
|
||||||
|
data = !useId ?
|
||||||
|
resultData.map((item: MaterialPackage) => ({ value: item.code, label: item.name })) :
|
||||||
|
resultData.map((item: MaterialPackage) => ({ value: item.id, label: item.name }))
|
||||||
|
}
|
||||||
|
return data
|
||||||
|
}
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
import * as base from './_crud-base'
|
import * as base from './_crud-base'
|
||||||
|
import * as model from '~/models/mcu-order-item'
|
||||||
|
|
||||||
const path = '/api/v1/mcu-order-item'
|
const path = '/api/v1/mcu-order-item'
|
||||||
const name = 'mcu-order-item'
|
const name = 'mcu-order-item'
|
||||||
|
|
||||||
export function create(data: any) {
|
export function create(data: model.CreateDto) {
|
||||||
return base.create(path, data)
|
return base.create(path, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getList(params: any = null) {
|
export function getList(params: model.ReadList | null = null) {
|
||||||
return base.getList(path, params)
|
return base.getList(path, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,7 +16,7 @@ export function getDetail(id: number | string, params?: any) {
|
|||||||
return base.getDetail(path, id, name, params)
|
return base.getDetail(path, id, name, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function update(id: number | string, data: any) {
|
export function update(id: number | string, data: model.UpdateDto) {
|
||||||
return base.update(path, id, data)
|
return base.update(path, id, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,3 +22,16 @@ export function update(id: number | string, data: any) {
|
|||||||
export function remove(id: number | string) {
|
export function remove(id: number | string) {
|
||||||
return base.remove(path, id)
|
return base.remove(path, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function submit(id: number) {
|
||||||
|
try {
|
||||||
|
const resp = await xfetch(`${path}/${id}/submit`, 'PATCH')
|
||||||
|
const result: any = {}
|
||||||
|
result.success = resp.success
|
||||||
|
result.body = (resp.body as Record<string, any>) || {}
|
||||||
|
return result
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Error submitting ${name}:`, error)
|
||||||
|
throw new Error(`Failed to submit ${name}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
// Base
|
||||||
|
import type { CreateDto, UpdateDto } from '~/models/procedure-room-order-item'
|
||||||
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
|
const name = 'procedure-room-order-item'
|
||||||
|
const path = `/api/v1/${name}`
|
||||||
|
|
||||||
|
export function create(data: CreateDto) {
|
||||||
|
return base.create(path, data, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getList(params: any = null) {
|
||||||
|
return base.getList(path, params, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDetail(id: number | string) {
|
||||||
|
return base.getDetail(path, id, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function update(id: number | string, data: UpdateDto) {
|
||||||
|
return base.update(path, id, data, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function remove(id: number | string) {
|
||||||
|
return base.remove(path, id, name)
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
// Base
|
||||||
|
import type { ProcedureRoomOrder, CreateDto } from '~/models/procedure-room-order'
|
||||||
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
|
const name = 'procedure-room-order'
|
||||||
|
const path = `/api/v1/${name}`
|
||||||
|
|
||||||
|
export function create(data: CreateDto) {
|
||||||
|
return base.create(path, data, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getList(params: any = null) {
|
||||||
|
return base.getList(path, params, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDetail(id: number | string, params: any = null) {
|
||||||
|
return base.getDetail(path, id, name, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function update(id: number | string, data: ProcedureRoomOrder) {
|
||||||
|
return base.update(path, id, data, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function remove(id: number | string) {
|
||||||
|
return base.remove(path, id, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export async function submit(id: number) {
|
||||||
|
try {
|
||||||
|
const resp = await xfetch(`${path}/${id}/submit`, 'PATCH')
|
||||||
|
const result: any = {}
|
||||||
|
if (resp.success) {
|
||||||
|
result.success = resp.success
|
||||||
|
result.body = (resp.body as Record<string, any>) || {}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Error submitting ${name}:`, error)
|
||||||
|
throw new Error(`Failed to submit ${name}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
// Base
|
||||||
|
import type { ProcedureRoom } from '~/models/procedure-room'
|
||||||
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
|
const name = 'procedure-room'
|
||||||
|
const path = `/api/v1/${name}`
|
||||||
|
|
||||||
|
export function create(data: ProcedureRoom) {
|
||||||
|
return base.create(path, data, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getList(params: any = null) {
|
||||||
|
return base.getList(path, params, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDetail(id: number | string) {
|
||||||
|
return base.getDetail(path, id, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function update(id: number | string, data: ProcedureRoom) {
|
||||||
|
return base.update(path, id, data, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function remove(id: number | string) {
|
||||||
|
return base.remove(path, id, name)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user