feat(sep): implement diagnose on sep form

This commit is contained in:
riefive
2025-10-20 14:56:53 +07:00
parent 7650e1e0e0
commit 74aadc4f75
4 changed files with 65 additions and 28 deletions

No files matched your search

+20 -1
View File
@@ -5,5 +5,24 @@ const path = '/api/vclaim/diagnosa'
const name = 'diagnose'
export function getList(params: any = null) {
return base.getList(path, params, name)
let url = path
if (params && params?.diagnosa) {
url += `/${params.diagnosa}`
delete params.diagnosa
}
return base.getList(url, params, name)
}
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
let data: { value: string; label: string }[] = []
const result = await getList(params)
if (result.success) {
const resultData = result.body?.response?.diagnosa || []
const resultUnique = [...new Map(resultData.map((item: any) => [item.kode, item])).values()]
data = resultUnique.map((item: any) => ({
value: item.kode ? String(item.kode) : '',
label: item.nama,
}))
}
return data
}