fe-prescription-56: wip
This commit is contained in:
@@ -15,5 +15,24 @@ defineProps<{
|
|||||||
:func-parsed="funcParsed"
|
:func-parsed="funcParsed"
|
||||||
:func-html="funcHtml"
|
:func-html="funcHtml"
|
||||||
:func-component="funcComponent"
|
:func-component="funcComponent"
|
||||||
|
class="border mb-4 2xl:mb-5"
|
||||||
/>
|
/>
|
||||||
|
<div class="flex">
|
||||||
|
<div class="me-auto">
|
||||||
|
<Button class="me-2">
|
||||||
|
<Icon name="i-lucide-plus" class="align-middle" />
|
||||||
|
Tambah Racikan
|
||||||
|
</Button>
|
||||||
|
<Button>
|
||||||
|
<Icon name="i-lucide-plus" class="align-middle" />
|
||||||
|
Tambah Non-Racikan
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Button variant="secondary">
|
||||||
|
<Icon name="i-lucide-x" class="align-middle" />
|
||||||
|
Batal
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
|
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
|
||||||
|
import type { Prescription } from '~/models/prescription'
|
||||||
|
|
||||||
|
import * as DE from '~/components/pub/my-ui/doc-entry';
|
||||||
|
import PrescriptionItemList from '~/components/app/prescription-item/list-entry.vue';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
data: any[]
|
data: Prescription[]
|
||||||
isLoading: boolean
|
isLoading: boolean
|
||||||
paginationMeta?: PaginationMeta
|
paginationMeta?: PaginationMeta
|
||||||
}
|
}
|
||||||
@@ -14,52 +18,52 @@ defineProps<Props>()
|
|||||||
<div v-if="isLoading" class="p-10 text-center">
|
<div v-if="isLoading" class="p-10 text-center">
|
||||||
Memuat data..
|
Memuat data..
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="data.length == 0" class="p-10 text-center">
|
<div v-else-if="data && data.length == 0" class="p-10 text-center">
|
||||||
<div class="mb-4 xl:mb-5">Belum Ada Data</div>
|
<div class="mb-4 xl:mb-5">Belum Ada Data</div>
|
||||||
<div>
|
<!-- <div>
|
||||||
<Button>
|
<Button>
|
||||||
<Icon name="i-lucide-plus" class="me-2 align-middle" />
|
<Icon name="i-lucide-plus" class="me-2 align-middle" />
|
||||||
Tambah Order
|
Tambah Order
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="md:grid md:grid-cols-2 font-semibold">
|
<div v-else v-for="(item, idx) in data">
|
||||||
<div>
|
<Separator class="my-5" />
|
||||||
<PubCustomUiDocEntryBlock mode="preview">
|
<div class="md:grid md:grid-cols-2 font-semibold">
|
||||||
<PubCustomUiDocEntryCell>
|
<div>
|
||||||
<PubCustomUiDocEntryLabel>Order #1</PubCustomUiDocEntryLabel>
|
<DE.Block mode="preview">
|
||||||
<PubCustomUiDocEntryColon />
|
<DE.Cell>
|
||||||
<PubCustomUiDocEntryField>
|
<DE.Label>Order #{{ data.length - idx }}</DE.Label>
|
||||||
2025-01-01
|
<DE.Field>
|
||||||
</PubCustomUiDocEntryField>
|
2025-01-01
|
||||||
</PubCustomUiDocEntryCell>
|
</DE.Field>
|
||||||
<PubCustomUiDocEntryCell>
|
</DE.Cell>
|
||||||
<PubCustomUiDocEntryLabel>Status</PubCustomUiDocEntryLabel>
|
<DE.Cell>
|
||||||
<PubCustomUiDocEntryColon />
|
<DE.Label>Status</DE.Label>
|
||||||
<PubCustomUiDocEntryField>
|
<DE.Field>
|
||||||
Status
|
{{ item.status_code }}
|
||||||
</PubCustomUiDocEntryField>
|
</DE.Field>
|
||||||
</PubCustomUiDocEntryCell>
|
</DE.Cell>
|
||||||
</PubCustomUiDocEntryBlock>
|
</DE.Block>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<PubCustomUiDocEntryBlock mode="preview">
|
<DE.Block mode="preview">
|
||||||
<PubCustomUiDocEntryCell>
|
<DE.Cell>
|
||||||
<PubCustomUiDocEntryLabel>DPJP</PubCustomUiDocEntryLabel>
|
<DE.Label>DPJP</DE.Label>
|
||||||
<PubCustomUiDocEntryColon />
|
<DE.Field>
|
||||||
<PubCustomUiDocEntryField>
|
{{ item.doctor.employee.person.name }}
|
||||||
Nama Dokter
|
</DE.Field>
|
||||||
</PubCustomUiDocEntryField>
|
</DE.Cell>
|
||||||
</PubCustomUiDocEntryCell>
|
<DE.Cell>
|
||||||
<PubCustomUiDocEntryCell>
|
<DE.Label>PPDS</DE.Label>
|
||||||
<PubCustomUiDocEntryLabel>PPDS</PubCustomUiDocEntryLabel>
|
<DE.Field>
|
||||||
<PubCustomUiDocEntryColon />
|
{{ item.specialistIntern?.person.name }}
|
||||||
<PubCustomUiDocEntryField>
|
</DE.Field>
|
||||||
Nama PPDS
|
</DE.Cell>
|
||||||
</PubCustomUiDocEntryField>
|
</DE.Block>
|
||||||
</PubCustomUiDocEntryCell>
|
</div>
|
||||||
</PubCustomUiDocEntryBlock>
|
|
||||||
</div>
|
</div>
|
||||||
|
<PrescriptionItemList :data="item.items || []" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import type { TabItem } from '~/components/pub/my-ui/comp-tab/type'
|
|||||||
|
|
||||||
import Status from '~/components/app/encounter/status.vue'
|
import Status from '~/components/app/encounter/status.vue'
|
||||||
import AssesmentFunctionList from './assesment-function/list.vue'
|
import AssesmentFunctionList from './assesment-function/list.vue'
|
||||||
|
import PrescriptionList from '~/components/content/prescription/list.vue'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@@ -43,7 +44,7 @@ const tabs: TabItem[] = [
|
|||||||
{ value: 'education-assessment', label: 'Asesmen Kebutuhan Edukasi' },
|
{ value: 'education-assessment', label: 'Asesmen Kebutuhan Edukasi' },
|
||||||
{ value: 'consent', label: 'General Consent' },
|
{ value: 'consent', label: 'General Consent' },
|
||||||
{ value: 'patient-note', label: 'CPRJ' },
|
{ value: 'patient-note', label: 'CPRJ' },
|
||||||
{ value: 'prescription', label: 'Order Obat' },
|
{ value: 'prescription', label: 'Order Obat', component: PrescriptionList },
|
||||||
{ value: 'device', label: 'Order Alkes' },
|
{ value: 'device', label: 'Order Alkes' },
|
||||||
{ value: 'mcu-radiology', label: 'Order Radiologi' },
|
{ value: 'mcu-radiology', label: 'Order Radiologi' },
|
||||||
{ value: 'mcu-lab-pc', label: 'Order Lab PK' },
|
{ value: 'mcu-lab-pc', label: 'Order Lab PK' },
|
||||||
|
|||||||
@@ -1,15 +1,46 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// Components
|
||||||
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
||||||
import type { DataTableLoader } from '~/components/pub/my-ui/data-table/type'
|
|
||||||
import type { HeaderPrep, RefSearchNav } from '~/components/pub/my-ui/data/types'
|
|
||||||
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
||||||
import ListEntry from '~/components/app/prescription/list-entry.vue'
|
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
|
||||||
import PrescriptionItemListEntry from '~/components/app/prescription-item/list-entry.vue'
|
import List from '~/components/app/prescription/list-entry.vue'
|
||||||
|
|
||||||
import { getList } from '~/services/prescription.service'
|
// Helpers
|
||||||
import { usePaginatedList } from '~/composables/usePaginatedList'
|
import { usePaginatedList } from '~/composables/usePaginatedList'
|
||||||
|
import { toast } from '~/components/pub/ui/toast'
|
||||||
|
|
||||||
import MixEntry from '~/components/app/prescription-item/mix-entry.vue'
|
// Types
|
||||||
|
import { ActionEvents, type HeaderPrep } from '~/components/pub/my-ui/data/types'
|
||||||
|
import { PrescriptionSchema, type PrescriptionFormData } from '~/schemas/prescription.schema'
|
||||||
|
import type { Unit } from '~/models/unit'
|
||||||
|
|
||||||
|
// Handlers
|
||||||
|
import {
|
||||||
|
recId,
|
||||||
|
recAction,
|
||||||
|
recItem,
|
||||||
|
isReadonly,
|
||||||
|
isProcessing,
|
||||||
|
isFormEntryDialogOpen,
|
||||||
|
isRecordConfirmationOpen,
|
||||||
|
handleActionSave,
|
||||||
|
handleActionEdit,
|
||||||
|
handleActionRemove,
|
||||||
|
handleCancelForm,
|
||||||
|
} from '~/handlers/prescription.handler'
|
||||||
|
|
||||||
|
// Services
|
||||||
|
import { getList, getDetail } from '~/services/prescription.service'
|
||||||
|
// import { getList as getUnitList } from '~/services/unit.service' // previously uses getList
|
||||||
|
// import { getValueLabelList } from '~/services/unit.service'
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
|
let units = ref<{ value: string; label: string }[]>([])
|
||||||
|
const title = ref('')
|
||||||
|
|
||||||
|
const plainEid = route.params.id
|
||||||
|
const encounter_id = (plainEid && typeof plainEid == 'string') ? parseInt(plainEid) : 0
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data,
|
data,
|
||||||
@@ -18,38 +49,42 @@ const {
|
|||||||
searchInput,
|
searchInput,
|
||||||
handlePageChange,
|
handlePageChange,
|
||||||
handleSearch,
|
handleSearch,
|
||||||
fetchData: getMedicineList,
|
fetchData: getMyList,
|
||||||
} = usePaginatedList({
|
} = usePaginatedList({
|
||||||
fetchFn: async ({ page, search }) => {
|
fetchFn: async ({ page, search }) => {
|
||||||
const result = await getList({ search, page })
|
const result = await getList({
|
||||||
|
search,
|
||||||
|
page,
|
||||||
|
'encounter-id': encounter_id
|
||||||
|
})
|
||||||
return { success: result.success || false, body: result.body || {} }
|
return { success: result.success || false, body: result.body || {} }
|
||||||
},
|
},
|
||||||
entityName: 'medicine',
|
entityName: 'prescription'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const refSearchNav: RefSearchNav = {
|
|
||||||
onClick: () => {
|
|
||||||
// open filter modal
|
|
||||||
},
|
|
||||||
onInput: (_val: string) => {
|
|
||||||
// filter patient list
|
|
||||||
},
|
|
||||||
onClear: () => {
|
|
||||||
// clear url param
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
const recId = ref<number>(0)
|
|
||||||
const recAction = ref<string>('')
|
|
||||||
const recItem = ref<any>(null)
|
|
||||||
|
|
||||||
const headerPrep: HeaderPrep = {
|
const headerPrep: HeaderPrep = {
|
||||||
title: 'Resep Obat',
|
title: 'Order Obat',
|
||||||
icon: 'i-lucide-panel-bottom',
|
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: {
|
addNav: {
|
||||||
label: 'Tambah',
|
label: 'Tambah',
|
||||||
onClick: () => navigateTo('/tools-equipment-src/equipment/add'),
|
icon: 'i-lucide-plus',
|
||||||
|
onClick: () => {
|
||||||
|
recItem.value = null
|
||||||
|
recId.value = 0
|
||||||
|
isFormEntryDialogOpen.value = true
|
||||||
|
isReadonly.value = false
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,45 +93,104 @@ provide('rec_action', recAction)
|
|||||||
provide('rec_item', recItem)
|
provide('rec_item', recItem)
|
||||||
provide('table_data_loader', isLoading)
|
provide('table_data_loader', isLoading)
|
||||||
|
|
||||||
let loading = ref(false);
|
const getMyDetail = async (id: number | string) => {
|
||||||
let itemEntryDialogShown = ref(false);
|
const result = await getDetail(id)
|
||||||
let itemMixEntryDialogShown = ref(false);
|
if (result.success) {
|
||||||
let title = '';
|
const currentValue = result.body?.data || {}
|
||||||
|
recItem.value = currentValue
|
||||||
|
isFormEntryDialogOpen.value = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
// const getUnits = async () => {
|
||||||
getMaterialList()
|
// const result = await getUnitList()
|
||||||
|
// if (result.success) {
|
||||||
|
// const currentMedicineGroups = result.body?.data || []
|
||||||
|
// units.value = currentMedicineGroups.map((item: Unit) => ({
|
||||||
|
// value: item.code,
|
||||||
|
// label: item.name,
|
||||||
|
// }))
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Watch for row actions when recId or recAction changes
|
||||||
|
watch([recId, recAction], () => {
|
||||||
|
switch (recAction.value) {
|
||||||
|
case ActionEvents.showDetail:
|
||||||
|
getMyDetail(recId.value)
|
||||||
|
title.value = 'Detail Konsultasi'
|
||||||
|
isReadonly.value = true
|
||||||
|
break
|
||||||
|
case ActionEvents.showEdit:
|
||||||
|
getMyDetail(recId.value)
|
||||||
|
title.value = 'Edit Konsultasi'
|
||||||
|
isReadonly.value = false
|
||||||
|
break
|
||||||
|
case ActionEvents.showConfirmDelete:
|
||||||
|
isRecordConfirmationOpen.value = true
|
||||||
|
break
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
async function getMaterialList() {
|
watch([isFormEntryDialogOpen], () => {
|
||||||
isLoading.dataListLoading = true
|
if (isFormEntryDialogOpen.value) {
|
||||||
|
isFormEntryDialogOpen.value = false;
|
||||||
// const resp = await xfetch('/api/v1/material')
|
handleActionSave({
|
||||||
// if (resp.success) {
|
encounter_id,
|
||||||
// data.value = (resp.body as Record<string, any>).data
|
}, getMyList, () =>{}, toast)
|
||||||
// }
|
}
|
||||||
|
})
|
||||||
isLoading.dataListLoading = false
|
|
||||||
}
|
|
||||||
|
|
||||||
function addMedicine() {
|
|
||||||
itemEntryDialogShown.value = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function addMedicineMix() {
|
|
||||||
itemMixEntryDialogShown.value = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
// await getMyList()
|
||||||
|
// units.value = await getValueLabelList()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Header :prep="{ ...headerPrep }" :ref-search-nav="refSearchNav" />
|
<Header
|
||||||
<ListEntry v-if="!isLoading.dataListLoading" :data="[]" :isLoading="isLoading.isTableLoading" :paginatin="{}" />
|
v-model="searchInput"
|
||||||
|
:prep="headerPrep"
|
||||||
|
:ref-search-nav="headerPrep.refSearchNav"
|
||||||
|
@search="handleSearch"
|
||||||
|
class="mb-4 xl:mb-5"
|
||||||
|
/>
|
||||||
|
<List :data="data" :pagination-meta="paginationMeta" :is-loading="isLoading.isTableLoading" @page-change="handlePageChange" />
|
||||||
|
|
||||||
<Dialog v-model:open="itemEntryDialogShown" :title="!!recItem ? title : 'Tambah Obat'" size="lg" prevent-outside>
|
<!-- <Dialog v-model:open="isFormEntryDialogOpen" :title="!!recItem ? title : 'Tambah Divisi'" size="xl" prevent-outside>
|
||||||
</Dialog>
|
<Entry
|
||||||
|
:schema="PrescriptionSchema"
|
||||||
<Dialog v-model:open="itemMixEntryDialogShown" :title="!!recItem ? title : 'Tambah Obat'" size="lg" prevent-outside>
|
:values="recItem"
|
||||||
<MixEntry />
|
:units="units"
|
||||||
</Dialog>
|
:is-loading="isProcessing"
|
||||||
|
:is-readonly="isReadonly"
|
||||||
|
@submit="
|
||||||
|
(values: PrescriptionFormData | Record<string, any>, resetForm: () => void) => {
|
||||||
|
if (recId > 0) {
|
||||||
|
handleActionEdit(recId, values, getMyList, resetForm, toast)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
handleActionSave(values, getMyList, resetForm, toast)
|
||||||
|
}
|
||||||
|
"
|
||||||
|
@cancel="handleCancelForm"
|
||||||
|
/>
|
||||||
|
</Dialog> -->
|
||||||
|
|
||||||
|
<!-- Record Confirmation Modal -->
|
||||||
|
<RecordConfirmation
|
||||||
|
v-model:open="isRecordConfirmationOpen"
|
||||||
|
action="delete"
|
||||||
|
:record="recItem"
|
||||||
|
@confirm="() => handleActionRemove(recId, getMyList, toast)"
|
||||||
|
@cancel=""
|
||||||
|
>
|
||||||
|
<template #default="{ record }">
|
||||||
|
<div class="text-sm">
|
||||||
|
<p><strong>ID:</strong> {{ record?.id }}</p>
|
||||||
|
<p v-if="record?.name"><strong>Nama:</strong> {{ record.name }}</p>
|
||||||
|
<p v-if="record?.code"><strong>Kode:</strong> {{ record.code }}</p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</RecordConfirmation>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ const props = defineProps<{
|
|||||||
funcComponent?: RecStrFuncComponent
|
funcComponent?: RecStrFuncComponent
|
||||||
selectMode?: 'single' | 'multiple'
|
selectMode?: 'single' | 'multiple'
|
||||||
modelValue?: any[] | any
|
modelValue?: any[] | any
|
||||||
|
class?: string
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
@@ -61,7 +62,7 @@ function handleActionCellClick(event: Event, _cellRef: string) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Table>
|
<Table :class="class">
|
||||||
<TableHeader class="bg-gray-50 dark:bg-gray-800">
|
<TableHeader class="bg-gray-50 dark:bg-gray-800">
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead
|
<TableHead
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ function btnClick() {
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="prep.addNav" class="flex items-center ms-2">
|
<div v-if="prep.addNav" class="flex items-center ms-2">
|
||||||
<Button class="rounded-md border border-gray-300 text-white" @click="btnClick">
|
<Button class="rounded-md border border-gray-300 text-white" @click="btnClick">
|
||||||
<Icon name="i-lucide-plus" class="mr-2 h-4 w-4 align-middle" />
|
<Icon name="i-lucide-plus" class="align-middle" />
|
||||||
{{ prep.addNav.label }}
|
{{ prep.addNav.label }}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -54,6 +54,10 @@ export function usePaginatedList<T = any>(options: UsePaginatedListOptions<T>) {
|
|||||||
initialValue: defaultQuery,
|
initialValue: defaultQuery,
|
||||||
removeFalsyValues: true,
|
removeFalsyValues: true,
|
||||||
})
|
})
|
||||||
|
console.log("SAPI PERAH");
|
||||||
|
console.log(options);
|
||||||
|
console.log(defaultQuery);
|
||||||
|
console.log(queryParams);
|
||||||
|
|
||||||
const params = computed(() => {
|
const params = computed(() => {
|
||||||
const result = querySchema.safeParse(queryParams)
|
const result = querySchema.safeParse(queryParams)
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { createCrudHandler, genCrudHandler } from '~/handlers/_handler'
|
||||||
|
import { create, update, remove } from '~/services/prescription.service'
|
||||||
|
|
||||||
|
export const {
|
||||||
|
recId,
|
||||||
|
recAction,
|
||||||
|
recItem,
|
||||||
|
isReadonly,
|
||||||
|
isProcessing,
|
||||||
|
isFormEntryDialogOpen,
|
||||||
|
isRecordConfirmationOpen,
|
||||||
|
onResetState,
|
||||||
|
handleActionSave,
|
||||||
|
handleActionEdit,
|
||||||
|
handleActionRemove,
|
||||||
|
handleCancelForm,
|
||||||
|
} = genCrudHandler({ create, update, remove})
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
export interface ItemMeta {
|
export interface ItemMeta {
|
||||||
id: number
|
id: number
|
||||||
createdAt: string | null
|
createdAt: string | null
|
||||||
deletedAt: string | null
|
|
||||||
updatedAt: string | null
|
updatedAt: string | null
|
||||||
|
deletedAt?: string | null
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pagination meta model for API responses
|
// Pagination meta model for API responses
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
export interface Device {
|
import type { ItemMeta } from "./_model"
|
||||||
|
|
||||||
|
export interface Device extends ItemMeta {
|
||||||
code: string
|
code: string
|
||||||
name: string
|
name: string
|
||||||
uom_code: string
|
uom_code: string
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import type { ItemMeta } from "./_model"
|
||||||
|
|
||||||
|
export interface DivisionPosition extends ItemMeta {
|
||||||
|
code: string
|
||||||
|
name: string
|
||||||
|
division_id: number
|
||||||
|
}
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
export interface Division {
|
import type { ItemMeta } from "./_model"
|
||||||
id?: number
|
|
||||||
|
export interface Division extends ItemMeta {
|
||||||
code: string
|
code: string
|
||||||
name: string
|
name: string
|
||||||
parent_id?: number | null
|
parent_id?: number | null
|
||||||
childrens?: Division[] | null
|
childrens?: Division[] | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DivisionPosition {
|
export interface DivisionPosition extends ItemMeta {
|
||||||
code: string
|
code: string
|
||||||
name: string
|
name: string
|
||||||
division_id: number
|
division_id: number
|
||||||
|
|||||||
+16
-16
@@ -1,18 +1,17 @@
|
|||||||
export interface Doctor {
|
import type { ItemMeta } from "./_model"
|
||||||
id: number
|
import { genEmployee, type Employee } from "./employee"
|
||||||
createdAt: string
|
|
||||||
updatedAt: string
|
export interface Doctor extends ItemMeta {
|
||||||
name: string
|
employee_id: number
|
||||||
frontTitle?: string
|
employee: Employee
|
||||||
endTitle?: string
|
|
||||||
specialist_code?: string
|
|
||||||
sip_no: string
|
|
||||||
ihs_number: string
|
ihs_number: string
|
||||||
identity_number: string
|
sip_number: string
|
||||||
phone?: string
|
unit_id?: number
|
||||||
bpjs_code?: string
|
specialist_id?: number
|
||||||
status_code?: number
|
subspecialist_id?: number
|
||||||
|
bpjs_code: string
|
||||||
}
|
}
|
||||||
|
|
||||||
// use one dto for both create and update
|
// use one dto for both create and update
|
||||||
export interface CreateDto {
|
export interface CreateDto {
|
||||||
name?: string
|
name?: string
|
||||||
@@ -53,9 +52,10 @@ export function genDoctor(): Doctor {
|
|||||||
id: 0,
|
id: 0,
|
||||||
createdAt: '',
|
createdAt: '',
|
||||||
updatedAt: '',
|
updatedAt: '',
|
||||||
name: '',
|
employee_id: 0,
|
||||||
|
employee: genEmployee(),
|
||||||
ihs_number: '',
|
ihs_number: '',
|
||||||
identity_number: '',
|
sip_number: '',
|
||||||
sip_no: '',
|
bpjs_code: '',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
|
import { type Person, genPerson } from "./person"
|
||||||
|
|
||||||
export interface Employee {
|
export interface Employee {
|
||||||
name: string
|
|
||||||
number: string
|
|
||||||
status_code: string
|
|
||||||
user_id: number
|
user_id: number
|
||||||
person_id: number
|
person_id: number
|
||||||
|
person: Person
|
||||||
position_code: string
|
position_code: string
|
||||||
division_code: string
|
division_code: string
|
||||||
|
number: string
|
||||||
|
status_code: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CreateDto extends Employee {}
|
export interface CreateDto extends Employee {}
|
||||||
@@ -26,12 +28,12 @@ export interface GetListDto extends Employee {
|
|||||||
|
|
||||||
export function genEmployee(): Employee {
|
export function genEmployee(): Employee {
|
||||||
return {
|
return {
|
||||||
name: '',
|
|
||||||
number: '',
|
|
||||||
status_code: '',
|
|
||||||
user_id: 0,
|
user_id: 0,
|
||||||
person_id: 0,
|
person_id: 0,
|
||||||
|
person: genPerson(),
|
||||||
position_code: '',
|
position_code: '',
|
||||||
division_code: '',
|
division_code: '',
|
||||||
|
number: '',
|
||||||
|
status_code: '',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
import { type Doctor, genDoctor } from "./doctor"
|
||||||
|
|
||||||
|
export interface Encounter {
|
||||||
|
id: number
|
||||||
|
patient_id: number
|
||||||
|
registeredAt: string
|
||||||
|
class_code: string
|
||||||
|
unit_id: number
|
||||||
|
specialist_id?: number
|
||||||
|
subspecialist_id?: number
|
||||||
|
visitdate: string
|
||||||
|
appointment_doctor_id: number
|
||||||
|
appointment_doctor: Doctor
|
||||||
|
responsible_doctor_id?: number
|
||||||
|
responsible_doctor?: Doctor
|
||||||
|
refSource_name?: string
|
||||||
|
appointment_id?: number
|
||||||
|
earlyEducation?: string
|
||||||
|
medicalDischargeEducation: string
|
||||||
|
admDischargeEducation?: string
|
||||||
|
dischargeMethod_code?: string
|
||||||
|
discharge_reason?: string
|
||||||
|
status_code: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export function genEncounter(): Encounter {
|
||||||
|
return {
|
||||||
|
id: 0,
|
||||||
|
patient_id: 0,
|
||||||
|
registeredAt: '',
|
||||||
|
class_code: '',
|
||||||
|
unit_id: 0,
|
||||||
|
visitdate: '',
|
||||||
|
appointment_doctor_id: 0,
|
||||||
|
appointment_doctor: genDoctor(),
|
||||||
|
medicalDischargeEducation: '',
|
||||||
|
status_code: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import type { ItemMeta } from '~/models/_model'
|
||||||
|
|
||||||
|
export interface Person extends ItemMeta {
|
||||||
|
id: number
|
||||||
|
name: string
|
||||||
|
alias?: string
|
||||||
|
frontTitle?: string
|
||||||
|
endTitle?: string
|
||||||
|
birthDate?: Date | string
|
||||||
|
birthRegency_code?: string
|
||||||
|
gender_code?: string
|
||||||
|
residentIdentityNumber?: string
|
||||||
|
passportNumber?: string
|
||||||
|
drivingLicenseNumber?: string
|
||||||
|
religion_code?: string
|
||||||
|
education_code?: string
|
||||||
|
occupation_code?: string
|
||||||
|
occupation_name?: string
|
||||||
|
ethnic_code?: string
|
||||||
|
language_code?: string
|
||||||
|
residentIdentityFileUrl?: string
|
||||||
|
passportFileUrl?: string
|
||||||
|
drivingLicenseFileUrl?: string
|
||||||
|
familyIdentityFileUrl?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export function genPerson(): Person {
|
||||||
|
return {
|
||||||
|
id: 0,
|
||||||
|
createdAt: '',
|
||||||
|
updatedAt: '',
|
||||||
|
name: '',
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { genMedicine, type Medicine } from "./medicine";
|
import { genMedicine, type Medicine } from "./medicine";
|
||||||
import { genMedicinemix, type Medicinemix } from "./medicinemix";
|
import { genMedicinemix, type Medicinemix } from "./medicinemix";
|
||||||
|
|
||||||
interface PrescriptionItem {
|
export interface PrescriptionItem {
|
||||||
id: number;
|
id: number;
|
||||||
prescription_id: number;
|
prescription_id: number;
|
||||||
isMix: boolean;
|
isMix: boolean;
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
import { type Encounter, genEncounter } from "./encounter";
|
||||||
|
import { type Doctor, genDoctor } from "./doctor";
|
||||||
|
import { type PrescriptionItem } from "./prescription-item";
|
||||||
|
import type { SpecialistIntern } from "./specialist-intern";
|
||||||
|
|
||||||
|
export interface Prescription {
|
||||||
|
id: number
|
||||||
|
encounter_id: number
|
||||||
|
encounter: Encounter
|
||||||
|
doctor_id: number
|
||||||
|
doctor: Doctor
|
||||||
|
specialistIntern_id?: number
|
||||||
|
specialistIntern?: SpecialistIntern
|
||||||
|
issuedAt: string
|
||||||
|
status_code: string
|
||||||
|
items: PrescriptionItem[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateDto {
|
||||||
|
encounter_id: number
|
||||||
|
doctor_id: number
|
||||||
|
issuedAt: string
|
||||||
|
status_code: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GetListDto {
|
||||||
|
encounter_id: number
|
||||||
|
doctor_id: number
|
||||||
|
issuedAt: string
|
||||||
|
status_code: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GetDetailDto {
|
||||||
|
id?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateDto extends CreateDto {
|
||||||
|
id?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DeleteDto {
|
||||||
|
id?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export function genPresciption(): Prescription {
|
||||||
|
return {
|
||||||
|
id: 0,
|
||||||
|
encounter_id: 0,
|
||||||
|
encounter: genEncounter(),
|
||||||
|
doctor_id: 0,
|
||||||
|
doctor: genDoctor(),
|
||||||
|
issuedAt: '',
|
||||||
|
status_code: '',
|
||||||
|
items: [],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import type { ItemMeta } from "./_model";
|
||||||
|
import { type Person, genPerson } from "./person";
|
||||||
|
import { type Specialist, genSpecialist } from "./specialist";
|
||||||
|
import { type Subspecialist, genSubspecialist } from "./subspecialist";
|
||||||
|
|
||||||
|
export interface SpecialistIntern extends ItemMeta {
|
||||||
|
person_id: number
|
||||||
|
person: Person
|
||||||
|
specialist_id: number
|
||||||
|
specialist: Specialist
|
||||||
|
subspecialist_id: number
|
||||||
|
subspecialist: Subspecialist
|
||||||
|
user_id: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export function genSpecialistIntern(): SpecialistIntern {
|
||||||
|
return {
|
||||||
|
id: 0,
|
||||||
|
createdAt: '',
|
||||||
|
updatedAt: '',
|
||||||
|
person_id: 0,
|
||||||
|
person: genPerson(),
|
||||||
|
specialist_id: 0,
|
||||||
|
specialist: genSpecialist(),
|
||||||
|
subspecialist_id: 0,
|
||||||
|
subspecialist: genSubspecialist(),
|
||||||
|
user_id: 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,18 @@
|
|||||||
export interface Specialist {
|
import type { ItemMeta } from "./_model"
|
||||||
id?: number
|
|
||||||
|
export interface Specialist extends ItemMeta {
|
||||||
code: string
|
code: string
|
||||||
name: string
|
name: string
|
||||||
unit_id: number | string
|
unit_id: number | string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function genSpecialist(): Specialist {
|
||||||
|
return {
|
||||||
|
id: 0,
|
||||||
|
createdAt: '',
|
||||||
|
updatedAt: '',
|
||||||
|
code: '',
|
||||||
|
name: '',
|
||||||
|
unit_id: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,18 @@
|
|||||||
export interface Subspecialist {
|
import type { ItemMeta } from "./_model"
|
||||||
id?: number
|
|
||||||
|
export interface Subspecialist extends ItemMeta {
|
||||||
code: string
|
code: string
|
||||||
name: string
|
name: string
|
||||||
specialist_id: number | string
|
specialist_id: number | string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function genSubspecialist(): Subspecialist {
|
||||||
|
return {
|
||||||
|
id: 0,
|
||||||
|
createdAt: '',
|
||||||
|
updatedAt: '',
|
||||||
|
code: '',
|
||||||
|
name: '',
|
||||||
|
specialist_id: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import { z } from 'zod'
|
||||||
|
import type { PrescriptionItem } from '~/models/prescription-item'
|
||||||
|
|
||||||
|
const PrescriptionItemSchema = z.object({
|
||||||
|
})
|
||||||
|
|
||||||
|
type PrescriptionItemFormData = z.infer<typeof PrescriptionItemSchema> & PrescriptionItem
|
||||||
|
|
||||||
|
export { PrescriptionItemSchema }
|
||||||
|
export type { PrescriptionItemFormData }
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { z } from 'zod'
|
||||||
|
import type { Prescription } from '~/models/prescription'
|
||||||
|
|
||||||
|
const PrescriptionSchema = z.object({
|
||||||
|
'encounter-id': z.number().nullable().optional(),
|
||||||
|
})
|
||||||
|
|
||||||
|
type PrescriptionFormData = z.infer<typeof PrescriptionSchema> & Prescription
|
||||||
|
|
||||||
|
export { PrescriptionSchema }
|
||||||
|
export type { PrescriptionFormData }
|
||||||
Reference in New Issue
Block a user