fix: adjust payload sep
This commit is contained in:
No files matched your search
@@ -55,6 +55,7 @@ import {
|
|||||||
getPatientByIdentifierSearch,
|
getPatientByIdentifierSearch,
|
||||||
} from '~/handlers/patient.handler'
|
} from '~/handlers/patient.handler'
|
||||||
|
|
||||||
|
const userStore = useUserStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const openPatient = ref(false)
|
const openPatient = ref(false)
|
||||||
const openLetter = ref(false)
|
const openLetter = ref(false)
|
||||||
@@ -290,8 +291,13 @@ function mapLetterDataToForm(formValues: any): any {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// response.rujukan.provPerujuk.kode → fromClinic (rujukan.ppkRujukan)
|
// response.rujukan.provPerujuk.kode → fromClinic (rujukan.ppkRujukan)
|
||||||
if (info.ppkRujukan) {
|
if (info.destination) {
|
||||||
mappedValues.referralTo = info.ppkRujukan
|
mappedValues.referralTo = info.destination
|
||||||
|
}
|
||||||
|
|
||||||
|
// response.rujukan.poliRujukan.kode → polyCode
|
||||||
|
if (info.poly) {
|
||||||
|
mappedValues.polyCode = info.poly
|
||||||
}
|
}
|
||||||
|
|
||||||
// response.asalFaskes → asalRujukan (1 = Faskes 1, 2 = Faskes RS)
|
// response.asalFaskes → asalRujukan (1 = Faskes 1, 2 = Faskes RS)
|
||||||
@@ -387,7 +393,7 @@ async function handleEvent(menu: string, value: any) {
|
|||||||
})
|
})
|
||||||
if (resultControl && resultControl.success && resultControl.body) {
|
if (resultControl && resultControl.success && resultControl.body) {
|
||||||
const resultData = resultControl.body?.response?.list || []
|
const resultData = resultControl.body?.response?.list || []
|
||||||
const resultUnique = [...new Map(resultData.map((item: any) => [item.kode, item])).values()]
|
const resultUnique = [...new Map(resultData.map((item: any) => [item.kodeDokter, item])).values()]
|
||||||
const controlLetters = resultUnique.map((item: any) => ({
|
const controlLetters = resultUnique.map((item: any) => ({
|
||||||
value: item.kodeDokter ? String(item.kodeDokter) : '',
|
value: item.kodeDokter ? String(item.kodeDokter) : '',
|
||||||
label: `${item.kodeDokter} - ${item.namaDokter} - ${item.jadwalPraktek} (${item.kapasitas})`,
|
label: `${item.kodeDokter} - ${item.namaDokter} - ${item.jadwalPraktek} (${item.kapasitas})`,
|
||||||
@@ -477,6 +483,8 @@ async function handleEvent(menu: string, value: any) {
|
|||||||
mappedValues.clinicExcecutive = 'no'
|
mappedValues.clinicExcecutive = 'no'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mappedValues.userName = userStore.user?.user_name || ''
|
||||||
|
|
||||||
createSep(makeSepData(mappedValues))
|
createSep(makeSepData(mappedValues))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const body = res?.body
|
const body = res?.body
|
||||||
|
|||||||
@@ -185,6 +185,7 @@ async function handleRemove() {
|
|||||||
console.log('Data dihapus:', sepData)
|
console.log('Data dihapus:', sepData)
|
||||||
const result = await removeSepData(makeSepDataForRemove({ ...sepData.value, userName: userStore.user?.user_name }))
|
const result = await removeSepData(makeSepDataForRemove({ ...sepData.value, userName: userStore.user?.user_name }))
|
||||||
if (result && result.success && result.body) {
|
if (result && result.success && result.body) {
|
||||||
|
await getSepList()
|
||||||
toast({ title: 'Berhasil', description: 'Data berhasil dihapus', variant: 'default' })
|
toast({ title: 'Berhasil', description: 'Data berhasil dihapus', variant: 'default' })
|
||||||
} else {
|
} else {
|
||||||
toast({ title: 'Gagal', description: 'Gagal menghapus data', variant: 'destructive' })
|
toast({ title: 'Gagal', description: 'Gagal menghapus data', variant: 'destructive' })
|
||||||
@@ -301,7 +302,7 @@ provide('table_data_loader', isLoading)
|
|||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<DialogDescription class="text-gray-700">Apakah anda yakin ingin menghapus SEP dengan data:</DialogDescription>
|
<DialogDescription class="text-gray-700">Apakah anda yakin ingin menghapus SEP dengan data:</DialogDescription>
|
||||||
<div class="mt-4 space-y-2 text-sm">
|
<div class="mt-4 space-y-2 text-sm">
|
||||||
<p><strong>>No. SEP:</strong> {{ sepData.sepNumber }}</p>
|
<p><strong>No. SEP:</strong> {{ sepData.sepNumber }}</p>
|
||||||
<p><strong>No. Kartu BPJS:</strong> {{ sepData.cardNumber }}</p>
|
<p><strong>No. Kartu BPJS:</strong> {{ sepData.cardNumber }}</p>
|
||||||
<p><strong>Nama Pasien:</strong> {{ sepData.patientName }}</p>
|
<p><strong>Nama Pasien:</strong> {{ sepData.patientName }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ import type { IntegrationBpjsFormData } from '~/schemas/integration-bpjs.schema'
|
|||||||
const path = '/api/vclaim-swagger/sep'
|
const path = '/api/vclaim-swagger/sep'
|
||||||
const name = 'sep'
|
const name = 'sep'
|
||||||
|
|
||||||
|
// TODO: temporary destinationClinic
|
||||||
|
const destinationClinic = '1323R001'
|
||||||
|
|
||||||
export function create(data: any) {
|
export function create(data: any) {
|
||||||
return base.create(path, data, name)
|
return base.create(path, data, name)
|
||||||
}
|
}
|
||||||
@@ -20,6 +23,10 @@ export function getList(params: any = null) {
|
|||||||
return base.getList(url, params, name)
|
return base.getList(url, params, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getDetail(id: number | string) {
|
||||||
|
return base.getDetail(path, id, name)
|
||||||
|
}
|
||||||
|
|
||||||
export function remove(payload: any) {
|
export function remove(payload: any) {
|
||||||
const url = `${path}`
|
const url = `${path}`
|
||||||
return base.removeCustom(url, payload, name)
|
return base.removeCustom(url, payload, name)
|
||||||
@@ -27,6 +34,8 @@ export function remove(payload: any) {
|
|||||||
|
|
||||||
export function makeSepData(
|
export function makeSepData(
|
||||||
data: IntegrationBpjsFormData & {
|
data: IntegrationBpjsFormData & {
|
||||||
|
userName: string
|
||||||
|
polyCode?: string
|
||||||
referralFrom?: string
|
referralFrom?: string
|
||||||
referralTo?: string
|
referralTo?: string
|
||||||
referralLetterDate?: string
|
referralLetterDate?: string
|
||||||
@@ -36,13 +45,13 @@ export function makeSepData(
|
|||||||
const content = {
|
const content = {
|
||||||
noKartu: data.cardNumber || '',
|
noKartu: data.cardNumber || '',
|
||||||
tglSep: data.sepDate,
|
tglSep: data.sepDate,
|
||||||
ppkPelayanan: data.fromClinic || '',
|
ppkPelayanan: destinationClinic || data.fromClinic || '',
|
||||||
jnsPelayanan: data.serviceType ? String(data.serviceType) : '2',
|
jnsPelayanan: data.serviceType ? String(data.serviceType) : '2',
|
||||||
noMR: data.medicalRecordNumber || '',
|
noMR: data.medicalRecordNumber || '',
|
||||||
catatan: data.note || '',
|
catatan: data.note || '',
|
||||||
diagAwal: data.initialDiagnosis || '',
|
diagAwal: data.initialDiagnosis || '',
|
||||||
poli: {
|
poli: {
|
||||||
tujuan: data.destinationClinic || '',
|
tujuan: data.polyCode || '',
|
||||||
eksekutif: data.clinicExcecutive === 'yes' ? '1' : '0',
|
eksekutif: data.clinicExcecutive === 'yes' ? '1' : '0',
|
||||||
},
|
},
|
||||||
cob: {
|
cob: {
|
||||||
@@ -51,7 +60,7 @@ export function makeSepData(
|
|||||||
katarak: {
|
katarak: {
|
||||||
katarak: data.cataract === 'yes' ? '1' : '0',
|
katarak: data.cataract === 'yes' ? '1' : '0',
|
||||||
},
|
},
|
||||||
tujuanKunj: data.purposeOfVisit || '',
|
tujuanKunj: data.purposeOfVisit || '0',
|
||||||
flagProcedure: data.procedureType || '',
|
flagProcedure: data.procedureType || '',
|
||||||
kdPenunjang: data.supportCode || '',
|
kdPenunjang: data.supportCode || '',
|
||||||
assesmentPel: data.serviceAssessment || '',
|
assesmentPel: data.serviceAssessment || '',
|
||||||
@@ -75,7 +84,7 @@ export function makeSepData(
|
|||||||
},
|
},
|
||||||
dpjpLayan: data.attendingDoctor || '',
|
dpjpLayan: data.attendingDoctor || '',
|
||||||
noTelp: data.phoneNumber || '',
|
noTelp: data.phoneNumber || '',
|
||||||
user: data.patientName || '',
|
user: data.userName || '',
|
||||||
jaminan: {
|
jaminan: {
|
||||||
lakaLantas: data.trafficAccident || '0',
|
lakaLantas: data.trafficAccident || '0',
|
||||||
noLP: data.lpNumber || '',
|
noLP: data.lpNumber || '',
|
||||||
|
|||||||
Reference in New Issue
Block a user