diff --git a/app/components/app/medicine-group/entry-form.vue b/app/components/app/medicine-group/entry-form.vue new file mode 100644 index 00000000..e4f0b60a --- /dev/null +++ b/app/components/app/medicine-group/entry-form.vue @@ -0,0 +1,37 @@ + + + diff --git a/app/components/app/medicine-group/list-cfg.ts b/app/components/app/medicine-group/list-cfg.ts new file mode 100644 index 00000000..e2c72f9c --- /dev/null +++ b/app/components/app/medicine-group/list-cfg.ts @@ -0,0 +1,46 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/custom-ui/data/types' +import { defineAsyncComponent } from 'vue' + +const action = defineAsyncComponent(() => import('~/components/pub/custom-ui/data/dropdown-action-dud.vue')) + +const _doctorStatus = { + 0: 'Tidak Aktif', + 1: 'Aktif', +} + +export const cols: Col[] = [{}, {}, { width: 50 }] + +export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Aksi' }]] + +export const keys = ['code', 'name', 'action'] + +export const delKeyNames: KeyLabel[] = [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, +] + +export const funcParsed: RecStrFuncUnknown = {} + +export const funcComponent: RecStrFuncComponent = { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, +} + +export const funcHtml: RecStrFuncUnknown = { + patient_address(_rec) { + return '-' + }, +} diff --git a/app/components/app/medicine-group/list.vue b/app/components/app/medicine-group/list.vue new file mode 100644 index 00000000..5b8778d9 --- /dev/null +++ b/app/components/app/medicine-group/list.vue @@ -0,0 +1,19 @@ + + + diff --git a/app/components/app/medicine-group/picker.vue b/app/components/app/medicine-group/picker.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/medicine-group/search.vue b/app/components/app/medicine-group/search.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/medicine-group/status-badge.vue b/app/components/app/medicine-group/status-badge.vue new file mode 100644 index 00000000..32cdfbca --- /dev/null +++ b/app/components/app/medicine-group/status-badge.vue @@ -0,0 +1,29 @@ + + + diff --git a/app/components/app/medicine-method/entry-form.vue b/app/components/app/medicine-method/entry-form.vue new file mode 100644 index 00000000..e4f0b60a --- /dev/null +++ b/app/components/app/medicine-method/entry-form.vue @@ -0,0 +1,37 @@ + + + diff --git a/app/components/app/medicine-method/list-cfg.ts b/app/components/app/medicine-method/list-cfg.ts new file mode 100644 index 00000000..e2c72f9c --- /dev/null +++ b/app/components/app/medicine-method/list-cfg.ts @@ -0,0 +1,46 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/custom-ui/data/types' +import { defineAsyncComponent } from 'vue' + +const action = defineAsyncComponent(() => import('~/components/pub/custom-ui/data/dropdown-action-dud.vue')) + +const _doctorStatus = { + 0: 'Tidak Aktif', + 1: 'Aktif', +} + +export const cols: Col[] = [{}, {}, { width: 50 }] + +export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Aksi' }]] + +export const keys = ['code', 'name', 'action'] + +export const delKeyNames: KeyLabel[] = [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, +] + +export const funcParsed: RecStrFuncUnknown = {} + +export const funcComponent: RecStrFuncComponent = { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, +} + +export const funcHtml: RecStrFuncUnknown = { + patient_address(_rec) { + return '-' + }, +} diff --git a/app/components/app/medicine-method/list.vue b/app/components/app/medicine-method/list.vue new file mode 100644 index 00000000..5b8778d9 --- /dev/null +++ b/app/components/app/medicine-method/list.vue @@ -0,0 +1,19 @@ + + + diff --git a/app/components/app/medicine-method/picker.vue b/app/components/app/medicine-method/picker.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/medicine-method/search.vue b/app/components/app/medicine-method/search.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/medicine/entry-form.vue b/app/components/app/medicine/entry-form.vue new file mode 100644 index 00000000..5d3c495d --- /dev/null +++ b/app/components/app/medicine/entry-form.vue @@ -0,0 +1,80 @@ + + + diff --git a/app/components/app/medicine/list-cfg.ts b/app/components/app/medicine/list-cfg.ts new file mode 100644 index 00000000..e86a0646 --- /dev/null +++ b/app/components/app/medicine/list-cfg.ts @@ -0,0 +1,67 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/custom-ui/data/types' +import { defineAsyncComponent } from 'vue' + +type SmallDetailDto = any + +const action = defineAsyncComponent(() => import('~/components/pub/custom-ui/data/dropdown-action-dud.vue')) + +export const cols: Col[] = [{}, {}, {}, {}, {}, {}, { width: 50 }] + +export const header: Th[][] = [ + [ + { label: 'Kode' }, + { label: 'Name' }, + { label: 'Kategori' }, + { label: 'Golongan' }, + { label: 'Metode Pemberian' }, + { label: 'Bentuk' }, + { label: 'Stok' }, + { label: 'Aksi' }, + ], +] + +export const keys = ['code', 'name', 'category', 'group', 'method', 'unit', 'total', 'action'] + +export const delKeyNames: KeyLabel[] = [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, +] + +export const funcParsed: RecStrFuncUnknown = { + cateogry: (rec: unknown): unknown => { + return (rec as SmallDetailDto).medicineCategory?.name || '-' + }, + group: (rec: unknown): unknown => { + return (rec as SmallDetailDto).medicineGroup?.name || '-' + }, + method: (rec: unknown): unknown => { + return (rec as SmallDetailDto).medicineMethod?.name || '-' + }, + unit: (rec: unknown): unknown => { + return (rec as SmallDetailDto).medicineUnit?.name || '-' + }, +} + +export const funcComponent: RecStrFuncComponent = { + action: (rec: unknown, idx: number): RecComponent => { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, +} + +export const funcHtml: RecStrFuncUnknown = { + // (_rec) { + // return '-' + // }, +} diff --git a/app/components/app/medicine/list.vue b/app/components/app/medicine/list.vue new file mode 100644 index 00000000..5b8778d9 --- /dev/null +++ b/app/components/app/medicine/list.vue @@ -0,0 +1,19 @@ + + + diff --git a/app/components/app/medicine/picker.vue b/app/components/app/medicine/picker.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/medicine/search.vue b/app/components/app/medicine/search.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/medicine/status-badge.vue b/app/components/app/medicine/status-badge.vue new file mode 100644 index 00000000..32cdfbca --- /dev/null +++ b/app/components/app/medicine/status-badge.vue @@ -0,0 +1,29 @@ + + + diff --git a/app/components/flow/medicine-group/list.vue b/app/components/flow/medicine-group/list.vue new file mode 100644 index 00000000..9a5f567b --- /dev/null +++ b/app/components/flow/medicine-group/list.vue @@ -0,0 +1,71 @@ + + + diff --git a/app/components/flow/medicine-method/list.vue b/app/components/flow/medicine-method/list.vue new file mode 100644 index 00000000..43d7a03f --- /dev/null +++ b/app/components/flow/medicine-method/list.vue @@ -0,0 +1,74 @@ + + + diff --git a/app/components/flow/medicine/entry.vue b/app/components/flow/medicine/entry.vue new file mode 100644 index 00000000..3c3b4cfd --- /dev/null +++ b/app/components/flow/medicine/entry.vue @@ -0,0 +1,16 @@ + + + diff --git a/app/components/flow/medicine/list.vue b/app/components/flow/medicine/list.vue new file mode 100644 index 00000000..19497a7e --- /dev/null +++ b/app/components/flow/medicine/list.vue @@ -0,0 +1,63 @@ + + + diff --git a/app/components/pub/base/modal/modal.vue b/app/components/pub/base/modal/modal.vue new file mode 100644 index 00000000..147079e5 --- /dev/null +++ b/app/components/pub/base/modal/modal.vue @@ -0,0 +1,51 @@ + + + diff --git a/app/models/medicine-group.ts b/app/models/medicine-group.ts new file mode 100644 index 00000000..afaa06c6 --- /dev/null +++ b/app/models/medicine-group.ts @@ -0,0 +1,36 @@ +export interface MedicineGroup { + id: string + name: string + code: string +} + +export interface CreateDto { + name: string + code: string +} + +export interface GetListDto { + page: number + size: number + name?: string + code?: string +} + +export interface GetDetailDto { + id?: string +} + +export interface UpdateDto extends CreateDto { + id?: number +} + +export interface DeleteDto { + id?: string +} + +export function genMedicine(): CreateDto { + return { + name: 'name', + code: 'code', + } +} diff --git a/app/models/medicine-method.ts b/app/models/medicine-method.ts new file mode 100644 index 00000000..78e0a68b --- /dev/null +++ b/app/models/medicine-method.ts @@ -0,0 +1,36 @@ +export interface MedicineMethod { + id: string + name: string + code: string +} + +export interface CreateDto { + name: string + code: string +} + +export interface GetListDto { + page: number + size: number + name?: string + code?: string +} + +export interface GetDetailDto { + id?: string +} + +export interface UpdateDto extends CreateDto { + id?: number +} + +export interface DeleteDto { + id?: string +} + +export function genMedicine(): CreateDto { + return { + name: 'name', + code: 'code', + } +} diff --git a/app/models/medicine.ts b/app/models/medicine.ts new file mode 100644 index 00000000..382c76e2 --- /dev/null +++ b/app/models/medicine.ts @@ -0,0 +1,68 @@ +export interface Medicine { + id: string + name: string + code: string + medicineGroup_code: string + medicineMethod_code: string + uom_code: string + type: string + dose: string + infra_id: string + stock: string + status: string +} + +export interface CreateDto { + name: string + code: string + medicineGroup_code: string + medicineMethod_code: string + uom_code: string + type: string + dose: string + infra_id: string + stock: string + status: string +} + +export interface GetListDto { + page: number + size: number + name?: string + code?: string + medicineGroup_code?: string + medicineMethod_code?: string + uom_code?: string + type?: string + dose?: string + infra_id?: string + stock?: string + status?: string +} + +export interface GetDetailDto { + id?: string +} + +export interface UpdateDto extends CreateDto { + id?: number +} + +export interface DeleteDto { + id?: string +} + +export function genMedicine(): CreateDto { + return { + name: 'name', + code: 'code', + medicineGroup_code: 'medicineGroup_code', + medicineMethod_code: 'medicineMethod_code', + uom_code: 'uom_code', + type: 'type', + dose: 'dose', + infra_id: 'infra_id', + stock: 'stock', + status: 'status', + } +} diff --git a/app/pages/(features)/tools-equipment-src/medicine-method/index.vue b/app/pages/(features)/tools-equipment-src/medicine-method/index.vue new file mode 100644 index 00000000..1b080470 --- /dev/null +++ b/app/pages/(features)/tools-equipment-src/medicine-method/index.vue @@ -0,0 +1,40 @@ + + + diff --git a/app/pages/(features)/tools-equipment-src/medicine-type/index.vue b/app/pages/(features)/tools-equipment-src/medicine-type/index.vue new file mode 100644 index 00000000..cbeccd42 --- /dev/null +++ b/app/pages/(features)/tools-equipment-src/medicine-type/index.vue @@ -0,0 +1,40 @@ + + + diff --git a/app/pages/(features)/tools-equipment-src/medicine/[id]/edit.vue b/app/pages/(features)/tools-equipment-src/medicine/[id]/edit.vue new file mode 100644 index 00000000..9c1697fc --- /dev/null +++ b/app/pages/(features)/tools-equipment-src/medicine/[id]/edit.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/pages/(features)/tools-equipment-src/medicine/add.vue b/app/pages/(features)/tools-equipment-src/medicine/add.vue new file mode 100644 index 00000000..9c1697fc --- /dev/null +++ b/app/pages/(features)/tools-equipment-src/medicine/add.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/pages/(features)/tools-equipment-src/medicine/index.vue b/app/pages/(features)/tools-equipment-src/medicine/index.vue new file mode 100644 index 00000000..877b5c78 --- /dev/null +++ b/app/pages/(features)/tools-equipment-src/medicine/index.vue @@ -0,0 +1,40 @@ + + + diff --git a/app/pages/_dev/index.vue b/app/pages/_dev/index.vue index b1afab26..3f67f9f8 100644 --- a/app/pages/_dev/index.vue +++ b/app/pages/_dev/index.vue @@ -46,6 +46,11 @@ const navMenu = ref({ icon: 'i-lucide-user', component: defineAsyncComponent(() => import('~/pages/_dev/user/list.vue')), }, + { + title: 'Test Medicine List', + icon: 'i-lucide-user', + component: defineAsyncComponent(() => import('~/components/flow/medicine-method/list.vue')), + }, ], }) diff --git a/app/schemas/auth.schema.ts b/app/schemas/auth.schema.ts new file mode 100644 index 00000000..e69de29b diff --git a/app/services/auth.service.ts b/app/services/auth.service.ts new file mode 100644 index 00000000..e69de29b diff --git a/app/services/medicine-method.service.ts b/app/services/medicine-method.service.ts new file mode 100644 index 00000000..02327163 --- /dev/null +++ b/app/services/medicine-method.service.ts @@ -0,0 +1,9 @@ +import { xfetch } from '~/composables/useXfetch' + +export async function getMedicineMethods() { + const resp = await xfetch('/api/v1/medicine-method') + if (resp.success) { + return (resp.body as Record).data + } + throw new Error('Failed to fetch medicine methods') +}