diff --git a/app/components/content/sep/entry.vue b/app/components/content/sep/entry.vue
index e9e76981..a674f032 100644
--- a/app/components/content/sep/entry.vue
+++ b/app/components/content/sep/entry.vue
@@ -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
diff --git a/app/components/content/sep/list.vue b/app/components/content/sep/list.vue
index f122e27f..c4becc6b 100644
--- a/app/components/content/sep/list.vue
+++ b/app/components/content/sep/list.vue
@@ -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)
>No. SEP: {{ sepData.sepNumber }}
+No. SEP: {{ sepData.sepNumber }}
No. Kartu BPJS: {{ sepData.cardNumber }}
Nama Pasien: {{ sepData.patientName }}