fix: adjust payload sep
This commit is contained in:
@@ -55,6 +55,7 @@ import {
|
||||
getPatientByIdentifierSearch,
|
||||
} from '~/handlers/patient.handler'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const route = useRoute()
|
||||
const openPatient = ref(false)
|
||||
const openLetter = ref(false)
|
||||
@@ -290,8 +291,13 @@ function mapLetterDataToForm(formValues: any): any {
|
||||
}
|
||||
|
||||
// response.rujukan.provPerujuk.kode → fromClinic (rujukan.ppkRujukan)
|
||||
if (info.ppkRujukan) {
|
||||
mappedValues.referralTo = info.ppkRujukan
|
||||
if (info.destination) {
|
||||
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)
|
||||
@@ -387,7 +393,7 @@ async function handleEvent(menu: string, value: any) {
|
||||
})
|
||||
if (resultControl && resultControl.success && resultControl.body) {
|
||||
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) => ({
|
||||
value: item.kodeDokter ? String(item.kodeDokter) : '',
|
||||
label: `${item.kodeDokter} - ${item.namaDokter} - ${item.jadwalPraktek} (${item.kapasitas})`,
|
||||
@@ -477,6 +483,8 @@ async function handleEvent(menu: string, value: any) {
|
||||
mappedValues.clinicExcecutive = 'no'
|
||||
}
|
||||
|
||||
mappedValues.userName = userStore.user?.user_name || ''
|
||||
|
||||
createSep(makeSepData(mappedValues))
|
||||
.then((res) => {
|
||||
const body = res?.body
|
||||
|
||||
@@ -185,6 +185,7 @@ async function handleRemove() {
|
||||
console.log('Data dihapus:', sepData)
|
||||
const result = await removeSepData(makeSepDataForRemove({ ...sepData.value, userName: userStore.user?.user_name }))
|
||||
if (result && result.success && result.body) {
|
||||
await getSepList()
|
||||
toast({ title: 'Berhasil', description: 'Data berhasil dihapus', variant: 'default' })
|
||||
} else {
|
||||
toast({ title: 'Gagal', description: 'Gagal menghapus data', variant: 'destructive' })
|
||||
@@ -301,7 +302,7 @@ provide('table_data_loader', isLoading)
|
||||
</DialogHeader>
|
||||
<DialogDescription class="text-gray-700">Apakah anda yakin ingin menghapus SEP dengan data:</DialogDescription>
|
||||
<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>Nama Pasien:</strong> {{ sepData.patientName }}</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user