feat/micro-lab-order-50: added antibiotic

This commit is contained in:
Andrian Roshandy
2025-12-01 01:50:39 +07:00
parent 95e27a8b6f
commit 1ee0f39e7d
13 changed files with 242 additions and 1 deletions
@@ -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>
+24
View File
@@ -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,
})
+24
View File
@@ -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,
})
+24
View File
@@ -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,
})
+16
View File
@@ -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: ''
}
}
+14
View File
@@ -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: '',
}
}
+16
View File
@@ -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: ''
}
}
+4 -1
View File
@@ -1,4 +1,5 @@
import { type Base, genBase } from "./_base"
import type { AntibioticInUse } from "./antibiotic-in-use"
import { type Doctor, genDoctor } from "./doctor"
import type { McuOrderItem } from "./mcu-order-item"
@@ -13,6 +14,7 @@ export interface McuOrder extends Base {
temperature?: number
mcuUrgencyLevel_code?: string
items: McuOrderItem[]
antibioticInUseItems: AntibioticInUse[]
}
export function genMcuOrder(): McuOrder {
@@ -23,7 +25,8 @@ export function genMcuOrder(): McuOrder {
doctor: genDoctor(),
specimenPickTime: '',
examinationDate: '',
items: []
items: [],
antibioticInUseItems: [],
}
}
+25
View File
@@ -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)
}
+25
View File
@@ -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)
}
+25
View File
@@ -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)
}