Merge branch 'dev' into feat/micro-lab-order-50

This commit is contained in:
Andrian Roshandy
2025-12-03 10:16:45 +07:00
152 changed files with 9865 additions and 374 deletions
+1 -1
View File
@@ -111,4 +111,4 @@ export async function removeCustom(path: string, data: any, name: string = 'item
console.error(`Error deleting ${name}:`, error)
throw new Error(`Failed to delete ${name}`)
}
}
}
+3 -3
View File
@@ -13,8 +13,8 @@ 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 getDetail(id: number | string, params?: any) {
return base.getDetail(path, id, name, params)
}
export function update(id: number | string, data: any) {
@@ -32,7 +32,7 @@ export async function getValueLabelList(params: any = null, useCodeAsValue = fal
const resultData = result.body?.data || []
data = resultData.map((item: Doctor) => ({
value: useCodeAsValue ? item.code
: item.id ? Number(item.id)
: item.id ? Number(item.id)
: item.id,
label: item.employee?.person?.name || '',
}))
+27
View File
@@ -0,0 +1,27 @@
// Base
import * as base from './_crud-base'
// Constants
const path = '/api/v1/kfr'
const name = 'kfr'
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, params?: any) {
return base.getDetail(path, id, name, params)
}
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)
}
+28
View File
@@ -0,0 +1,28 @@
// Base
import * as base from './_crud-base'
// Constants
import { encounterClassCodes } from '~/lib/constants'
const path = '/api/v1/surgery-report'
const name = 'surgery-report'
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, params?: any) {
return base.getDetail(path, id, name, params)
}
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)
}
+27
View File
@@ -0,0 +1,27 @@
// Base
import * as base from './_crud-base'
// Constants
const path = '/api/v1/therapy-protocol'
const name = 'therapy-protocol'
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, params?: any) {
return base.getDetail(path, id, name, params)
}
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)
}
+4 -7
View File
@@ -27,17 +27,14 @@ export function remove(id: number | string) {
return base.remove(path, id, name)
}
export async function getValueLabelList(params: any = null, useCodeAsValue = false): 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 }[] = []
const result = await getList(params)
if (result.success) {
const resultData = result.body?.data || []
data = resultData.map((item: Unit) => ({
value: useCodeAsValue ? item.code
: item.id ? Number(item.id)
: item.code,
label: item.name,
}))
data = !useId ?
resultData.map((item: Unit) => ({ value: item.code, label: item.name })) :
resultData.map((item: Unit) => ({ value: item.id, label: item.name }))
}
return data
}