fix: adjust payload sep

This commit is contained in:
riefive
2025-11-18 14:32:25 +07:00
parent a41df17d86
commit a6ff2499ee
3 changed files with 26 additions and 8 deletions
+13 -4
View File
@@ -7,6 +7,9 @@ import type { IntegrationBpjsFormData } from '~/schemas/integration-bpjs.schema'
const path = '/api/vclaim-swagger/sep'
const name = 'sep'
// TODO: temporary destinationClinic
const destinationClinic = '1323R001'
export function create(data: any) {
return base.create(path, data, name)
}
@@ -20,6 +23,10 @@ export function getList(params: any = null) {
return base.getList(url, params, name)
}
export function getDetail(id: number | string) {
return base.getDetail(path, id, name)
}
export function remove(payload: any) {
const url = `${path}`
return base.removeCustom(url, payload, name)
@@ -27,6 +34,8 @@ export function remove(payload: any) {
export function makeSepData(
data: IntegrationBpjsFormData & {
userName: string
polyCode?: string
referralFrom?: string
referralTo?: string
referralLetterDate?: string
@@ -36,13 +45,13 @@ export function makeSepData(
const content = {
noKartu: data.cardNumber || '',
tglSep: data.sepDate,
ppkPelayanan: data.fromClinic || '',
ppkPelayanan: destinationClinic || data.fromClinic || '',
jnsPelayanan: data.serviceType ? String(data.serviceType) : '2',
noMR: data.medicalRecordNumber || '',
catatan: data.note || '',
diagAwal: data.initialDiagnosis || '',
poli: {
tujuan: data.destinationClinic || '',
tujuan: data.polyCode || '',
eksekutif: data.clinicExcecutive === 'yes' ? '1' : '0',
},
cob: {
@@ -51,7 +60,7 @@ export function makeSepData(
katarak: {
katarak: data.cataract === 'yes' ? '1' : '0',
},
tujuanKunj: data.purposeOfVisit || '',
tujuanKunj: data.purposeOfVisit || '0',
flagProcedure: data.procedureType || '',
kdPenunjang: data.supportCode || '',
assesmentPel: data.serviceAssessment || '',
@@ -75,7 +84,7 @@ export function makeSepData(
},
dpjpLayan: data.attendingDoctor || '',
noTelp: data.phoneNumber || '',
user: data.patientName || '',
user: data.userName || '',
jaminan: {
lakaLantas: data.trafficAccident || '0',
noLP: data.lpNumber || '',