fix: change dpjp, unit and healthcare vclaim

This commit is contained in:
riefive
2025-10-27 13:48:19 +07:00
parent aa2a20a018
commit c8dde10506
4 changed files with 66 additions and 16 deletions
+15 -2
View File
@@ -1,10 +1,23 @@
// Base
import * as base from './_crud-base'
const path = '/api/vclaim/referensi/dokter-dpjp'
const name = 'doctor-dpjp'
const path = '/api/vclaim/v1/reference/responsible-doctor'
const name = 'responsible-doctor'
export function getList(params: any = null) {
let url = path
if (params?.serviceType) {
url += `/${params.serviceType}`
delete params.serviceType
}
if (params?.serviceDate) {
url += `/${params.serviceDate}`
delete params.serviceDate
}
if (params?.specialistCode) {
url += `/${params.specialistCode}`
delete params.specialistCode
}
return base.getList(path, params, name)
}
+10 -1
View File
@@ -5,7 +5,16 @@ const path = '/api/vclaim/v1/reference/healthcare'
const name = 'healthcare'
export function getList(params: any = null) {
return base.getList(path, params, name)
let url = path
if (params?.healthcare) {
url += `/${params.healthcare}`
delete params.healthcare
}
if (params?.healthcareType) {
url += `/${params.healthcareType}`
delete params.healthcareType
}
return base.getList(url, params, name)
}
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
+28
View File
@@ -0,0 +1,28 @@
// Base
import * as base from './_crud-base'
const path = '/api/vclaim/v1/reference/unit'
const name = 'unit'
export function getList(params: any = null) {
let url = path
if (params?.unitCode) {
url += `/${params.unitCode}`
delete params.unitCode
}
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?.faskes || []
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.kode} - ${item.nama}`,
}))
}
return data
}