Merge pull request #200 from dikstub-rssa/feat/encounter-adjustment-163
Feat: Encounter Adjustment
This commit is contained in:
No files matched your search
@@ -13,32 +13,39 @@ const activeServicePosition = inject<Ref<string>>('activeServicePosition')! // p
|
|||||||
|
|
||||||
const activeKey = ref<string | null>(null)
|
const activeKey = ref<string | null>(null)
|
||||||
const linkItemsFiltered = ref<LinkItem[]>([])
|
const linkItemsFiltered = ref<LinkItem[]>([])
|
||||||
|
|
||||||
const baseLinkItems: LinkItem[] = [
|
const baseLinkItems: LinkItem[] = [
|
||||||
{
|
{
|
||||||
label: 'Detail',
|
label: 'Detail',
|
||||||
value: 'detail',
|
value: 'detail',
|
||||||
|
groups: ['medical', 'registration'],
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
proceedItem(ActionEvents.showDetail)
|
proceedItem(ActionEvents.showDetail)
|
||||||
},
|
},
|
||||||
icon: 'i-lucide-eye',
|
icon: 'i-lucide-eye',
|
||||||
},
|
},
|
||||||
]
|
{
|
||||||
|
label: 'Edit',
|
||||||
const medicalLinkItems: LinkItem[] = [
|
value: 'edit',
|
||||||
|
groups: ['registration'],
|
||||||
|
onClick: () => {
|
||||||
|
proceedItem(ActionEvents.showEdit)
|
||||||
|
},
|
||||||
|
icon: 'i-lucide-pencil',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Process',
|
label: 'Process',
|
||||||
value: 'process',
|
value: 'process',
|
||||||
|
groups: ['medical'],
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
proceedItem(ActionEvents.showProcess)
|
proceedItem(ActionEvents.showProcess)
|
||||||
},
|
},
|
||||||
icon: 'i-lucide-shuffle',
|
icon: 'i-lucide-shuffle',
|
||||||
},
|
},
|
||||||
]
|
|
||||||
|
|
||||||
const regLinkItems: LinkItem[] = [
|
|
||||||
{
|
{
|
||||||
label: 'Print',
|
label: 'Print',
|
||||||
value: 'print',
|
value: 'print',
|
||||||
|
groups: ['registration'],
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
proceedItem(ActionEvents.showPrint)
|
proceedItem(ActionEvents.showPrint)
|
||||||
},
|
},
|
||||||
@@ -47,6 +54,7 @@ const regLinkItems: LinkItem[] = [
|
|||||||
{
|
{
|
||||||
label: 'Batalkan',
|
label: 'Batalkan',
|
||||||
value: 'cancel',
|
value: 'cancel',
|
||||||
|
groups: ['registration'],
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
proceedItem(ActionEvents.showCancel)
|
proceedItem(ActionEvents.showCancel)
|
||||||
},
|
},
|
||||||
@@ -55,6 +63,7 @@ const regLinkItems: LinkItem[] = [
|
|||||||
{
|
{
|
||||||
label: 'Hapus',
|
label: 'Hapus',
|
||||||
value: 'remove',
|
value: 'remove',
|
||||||
|
groups: ['registration'],
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
proceedItem(ActionEvents.showConfirmDelete)
|
proceedItem(ActionEvents.showConfirmDelete)
|
||||||
},
|
},
|
||||||
@@ -62,7 +71,7 @@ const regLinkItems: LinkItem[] = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const voidLinkItems: LinkItem[] = [
|
const noneLinkItems: LinkItem[] = [
|
||||||
{
|
{
|
||||||
label: 'Nothing',
|
label: 'Nothing',
|
||||||
value: 'nothing',
|
value: 'nothing',
|
||||||
@@ -72,12 +81,6 @@ const voidLinkItems: LinkItem[] = [
|
|||||||
|
|
||||||
linkItemsFiltered.value = [...baseLinkItems]
|
linkItemsFiltered.value = [...baseLinkItems]
|
||||||
|
|
||||||
getLinks()
|
|
||||||
|
|
||||||
watch(activeServicePosition, () => {
|
|
||||||
getLinks()
|
|
||||||
})
|
|
||||||
|
|
||||||
function proceedItem(action: string) {
|
function proceedItem(action: string) {
|
||||||
recId.value = props.rec.id || 0
|
recId.value = props.rec.id || 0
|
||||||
recItem.value = props.rec
|
recItem.value = props.rec
|
||||||
@@ -87,18 +90,24 @@ function proceedItem(action: string) {
|
|||||||
function getLinks() {
|
function getLinks() {
|
||||||
switch (activeServicePosition.value) {
|
switch (activeServicePosition.value) {
|
||||||
case 'medical':
|
case 'medical':
|
||||||
linkItemsFiltered.value = [...baseLinkItems, ...medicalLinkItems]
|
linkItemsFiltered.value = baseLinkItems.filter((item) => item.groups?.includes('medical'))
|
||||||
break
|
break
|
||||||
case 'registration':
|
case 'registration':
|
||||||
linkItemsFiltered.value = [...baseLinkItems, ...regLinkItems]
|
linkItemsFiltered.value = baseLinkItems.filter((item) => item.groups?.includes('registration'))
|
||||||
case 'unit|resp':
|
|
||||||
linkItemsFiltered.value = [...baseLinkItems]
|
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
linkItemsFiltered.value = voidLinkItems
|
linkItemsFiltered.value = noneLinkItems
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(activeServicePosition, () => {
|
||||||
|
getLinks()
|
||||||
|
})
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getLinks()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -26,19 +26,21 @@ import { genEncounter, type Encounter } from '~/models/encounter'
|
|||||||
|
|
||||||
// Props
|
// Props
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
mode?: string
|
||||||
isLoading?: boolean
|
isLoading?: boolean
|
||||||
isReadonly?: boolean
|
isReadonly?: boolean
|
||||||
isSepValid?: boolean
|
isSepValid?: boolean
|
||||||
|
isMemberValid?: boolean
|
||||||
isCheckingSep?: boolean
|
isCheckingSep?: boolean
|
||||||
doctorItems?: CB.Item[]
|
doctorItems?: CB.Item[]
|
||||||
selectedDoctor: Doctor
|
selectedDoctor: Doctor
|
||||||
// subSpecialist?: any[]
|
// subSpecialist?: any[]
|
||||||
// specialists?: TreeItem[]
|
// specialists?: TreeItem[]
|
||||||
// paymentMethods: PaymentMethodCode[]
|
payments?: any[]
|
||||||
participantGroups?: any[]
|
participantGroups?: any[]
|
||||||
seps: any[]
|
seps: any[]
|
||||||
patient?: PatientEntity | null | undefined
|
patient?: PatientEntity | null | undefined
|
||||||
// objects?: any
|
objects?: any
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
// Model
|
// Model
|
||||||
@@ -73,17 +75,37 @@ const [sepNumber, sepNumberAttrs] = defineField('sepNumber')
|
|||||||
const [patientName, patientNameAttrs] = defineField('patientName')
|
const [patientName, patientNameAttrs] = defineField('patientName')
|
||||||
const [nationalIdentity, nationalIdentityAttrs] = defineField('nationalIdentity')
|
const [nationalIdentity, nationalIdentityAttrs] = defineField('nationalIdentity')
|
||||||
const [medicalRecordNumber, medicalRecordNumberAttrs] = defineField('medicalRecordNumber')
|
const [medicalRecordNumber, medicalRecordNumberAttrs] = defineField('medicalRecordNumber')
|
||||||
|
const [sepFile, sepFileAttrs] = defineField('sepFile')
|
||||||
|
const [sippFile, sippFileAttrs] = defineField('sippFile')
|
||||||
const patientId = ref('')
|
const patientId = ref('')
|
||||||
|
const sepReference = ref('')
|
||||||
|
const sepControlDate = ref('')
|
||||||
|
const sepTrafficStatus = ref('')
|
||||||
|
const diagnosis = ref('')
|
||||||
|
const noteReference = ref('Hanya diperlukan jika pembayaran jenis JKN')
|
||||||
|
const noteFile = ref('Gunakan file [.pdf, .jpg, .png] dengan ukuran maksimal 1MB')
|
||||||
|
|
||||||
const isLoading = props.isLoading !== undefined ? props.isLoading : false
|
const isLoading = props.isLoading !== undefined ? props.isLoading : false
|
||||||
const isReadonly = props.isReadonly !== undefined ? props.isReadonly : false
|
const isReadonly = props.isReadonly !== undefined ? props.isReadonly : false
|
||||||
|
const mode = props.mode !== undefined ? props.mode : 'add'
|
||||||
// SEP validation state from props
|
// SEP validation state from props
|
||||||
const isSepValid = computed(() => props.isSepValid || false)
|
const isSepValid = computed(() => props.isSepValid || false)
|
||||||
const isCheckingSep = computed(() => props.isCheckingSep || false)
|
const isCheckingSep = computed(() => props.isCheckingSep || false)
|
||||||
|
const isInsurancePayment = computed(() => ['insurance', 'jkn'].includes(paymentMethodCode.value))
|
||||||
|
const isDateLoading = ref(false)
|
||||||
|
const debouncedSepNumber = refDebounced(sepNumber, 500)
|
||||||
|
const debouncedCardNumber = refDebounced(cardNumber, 500)
|
||||||
|
const unitFullName = ref('') // Unit, specialist, subspecialist
|
||||||
|
|
||||||
|
if (mode === 'add') {
|
||||||
|
// Set default sepDate to current date in YYYY-MM-DD format
|
||||||
|
const today = new Date()
|
||||||
|
const year = today.getFullYear()
|
||||||
|
const month = String(today.getMonth() + 1).padStart(2, '0')
|
||||||
|
const day = String(today.getDate()).padStart(2, '0')
|
||||||
|
registerDate.value = `${year}-${month}-${day}`
|
||||||
|
}
|
||||||
|
|
||||||
// Unit, specialist, subspecialist
|
|
||||||
const unitFullName = ref('')
|
|
||||||
watch(() => props.selectedDoctor, (doctor) => {
|
watch(() => props.selectedDoctor, (doctor) => {
|
||||||
unitFullName.value = doctor.subspecialist?.name ??
|
unitFullName.value = doctor.subspecialist?.name ??
|
||||||
doctor.specialist?.name ??
|
doctor.specialist?.name ??
|
||||||
@@ -94,65 +116,31 @@ watch(() => props.selectedDoctor, (doctor) => {
|
|||||||
model.value!.subspecialist_code = doctor.subspecialist_code || ''
|
model.value!.subspecialist_code = doctor.subspecialist_code || ''
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
// const doctorOpts = computed(() => {
|
|
||||||
// const defaultOption = [{ label: 'Pilih', value: '' }]
|
|
||||||
// const doctors = props.doctors || []
|
|
||||||
// return [...defaultOption, ...doctors]
|
|
||||||
// })
|
|
||||||
// watch(doctorCode, (newValue) => {
|
|
||||||
// // doctor.value = props.doctors?.find(doc => doc.code === newValue)
|
|
||||||
// unitFullName.value = doctor.value?.subspecialist?.name ??
|
|
||||||
// doctor.value?.specialist?.name ??
|
|
||||||
// doctor.value?.unit?.name ??
|
|
||||||
// 'tidak diketahui'
|
|
||||||
// model.value!.responsible_doctor_code = doctor.value?.code
|
|
||||||
// // const unitName = selectedDoctor?.specialist?.name || ''
|
|
||||||
// // emit('event', 'unit-changed', unitName)
|
|
||||||
// })
|
|
||||||
|
|
||||||
const isJKNPayment = computed(() => paymentMethodCode.value === 'jkn')
|
|
||||||
|
|
||||||
// async function onFetchChildren(parentId: string): Promise<void> {
|
|
||||||
// console.log('onFetchChildren', parentId)
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Watch specialist/subspecialist selection to fetch doctors
|
|
||||||
// watch(subSpecialistCode, async (newValue) => {
|
|
||||||
// if (newValue) {
|
|
||||||
// console.log('SubSpecialist changed:', newValue)
|
|
||||||
// // Reset doctor selection
|
|
||||||
// doctorCode.value = ''
|
|
||||||
// // Emit fetch event to parent
|
|
||||||
// emit('fetch', { subSpecialistCode: newValue })
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
|
|
||||||
// Debounced SEP number watcher: emit change only after user stops typing
|
|
||||||
const debouncedSepNumber = refDebounced(sepNumber, 500)
|
|
||||||
watch(debouncedSepNumber, (newValue) => {
|
|
||||||
emit('event', 'sep-number-changed', newValue)
|
|
||||||
})
|
|
||||||
|
|
||||||
// Sync props to form fields
|
// Sync props to form fields
|
||||||
// watch(
|
watch(
|
||||||
// () => props.objects,
|
() => props.objects,
|
||||||
// (objects) => {
|
(objects) => {
|
||||||
// if (objects && Object.keys(objects).length > 0) {
|
if (objects && Object.keys(objects).length > 0) {
|
||||||
// patientName.value = objects?.patientName || ''
|
patientName.value = objects?.patientName || ''
|
||||||
// nationalIdentity.value = objects?.nationalIdentity || ''
|
nationalIdentity.value = objects?.nationalIdentity || ''
|
||||||
// medicalRecordNumber.value = objects?.medicalRecordNumber || ''
|
medicalRecordNumber.value = objects?.medicalRecordNumber || ''
|
||||||
// doctorCode.value = objects?.doctorCode || ''
|
doctorCode.value = objects?.doctorCode || ''
|
||||||
// subSpecialistCode.value = objects?.subSpecialistCode || ''
|
// subSpecialistCode.value = objects?.subSpecialistCode || ''
|
||||||
// registerDate.value = objects?.registerDate || ''
|
paymentMethodCode.value = objects?.paymentMethodCode || ''
|
||||||
// paymentMethodCode.value = objects?.paymentMethodCode || ''
|
patientCategory.value = objects?.patientCategory || ''
|
||||||
// patientCategory.value = objects?.patientCategory || ''
|
cardNumber.value = objects?.cardNumber || ''
|
||||||
// cardNumber.value = objects?.cardNumber || ''
|
sepType.value = objects?.sepType || ''
|
||||||
// sepType.value = objects?.sepType || ''
|
sepNumber.value = objects?.sepNumber || ''
|
||||||
// sepNumber.value = objects?.sepNumber || ''
|
isDateLoading.value = true
|
||||||
// }
|
setTimeout(() => {
|
||||||
// },
|
registerDate.value = objects?.registerDate || ''
|
||||||
// { deep: true, immediate: true },
|
isDateLoading.value = false
|
||||||
// )
|
}, 100)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ deep: true, immediate: true },
|
||||||
|
)
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.patient,
|
() => props.patient,
|
||||||
@@ -167,6 +155,28 @@ watch(
|
|||||||
{ deep: true, immediate: true },
|
{ deep: true, immediate: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.isSepValid,
|
||||||
|
(value) => {
|
||||||
|
if (!value) return
|
||||||
|
const objects = props.objects
|
||||||
|
if (objects && Object.keys(objects).length > 0) {
|
||||||
|
sepReference.value = objects?.sepReference || ''
|
||||||
|
sepControlDate.value = objects?.sepControlDate || ''
|
||||||
|
sepTrafficStatus.value = objects?.sepTrafficStatus || ''
|
||||||
|
diagnosis.value = objects?.diagnosis || ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
watch(debouncedSepNumber, (newValue) => {
|
||||||
|
emit('event', 'sep-number-changed', newValue)
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(debouncedCardNumber, (newValue) => {
|
||||||
|
emit('event', 'member-changed', newValue)
|
||||||
|
})
|
||||||
|
|
||||||
function onAddSep() {
|
function onAddSep() {
|
||||||
const formValues = {
|
const formValues = {
|
||||||
patientId: patientId.value || '',
|
patientId: patientId.value || '',
|
||||||
@@ -180,6 +190,10 @@ function onAddSep() {
|
|||||||
emit('event', 'add-sep', formValues)
|
emit('event', 'add-sep', formValues)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onSearchSep() {
|
||||||
|
emit('event', 'search-sep', { cardNumber: cardNumber.value })
|
||||||
|
}
|
||||||
|
|
||||||
// Submit handler
|
// Submit handler
|
||||||
const onSubmit = handleSubmit((values) => {
|
const onSubmit = handleSubmit((values) => {
|
||||||
console.log('✅ Validated form values:', JSON.stringify(values, null, 2))
|
console.log('✅ Validated form values:', JSON.stringify(values, null, 2))
|
||||||
@@ -190,23 +204,11 @@ const onSubmit = handleSubmit((values) => {
|
|||||||
const formRef = ref<HTMLFormElement | null>(null)
|
const formRef = ref<HTMLFormElement | null>(null)
|
||||||
|
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
console.log('🔵 submitForm called, formRef:', formRef.value)
|
|
||||||
console.log('🔵 Form values:', {
|
|
||||||
doctorCode: doctorCode.value,
|
|
||||||
// subSpecialistCode: subSpecialistCode.value,
|
|
||||||
registerDate: registerDate.value,
|
|
||||||
paymentMethodCode: paymentMethodCode.value,
|
|
||||||
})
|
|
||||||
console.log('🔵 Form errors:', errors.value)
|
|
||||||
console.log('🔵 Form meta:', meta.value)
|
|
||||||
|
|
||||||
// Trigger form submit using native form submit
|
// Trigger form submit using native form submit
|
||||||
// This will trigger validation and onSubmit handler
|
// This will trigger validation and onSubmit handler
|
||||||
if (formRef.value) {
|
if (formRef.value) {
|
||||||
console.log('🔵 Calling formRef.value.requestSubmit()')
|
|
||||||
formRef.value.requestSubmit()
|
formRef.value.requestSubmit()
|
||||||
} else {
|
} else {
|
||||||
console.warn('⚠️ formRef.value is null, cannot submit form')
|
|
||||||
// Fallback: directly call onSubmit handler
|
// Fallback: directly call onSubmit handler
|
||||||
// Create a mock event object
|
// Create a mock event object
|
||||||
const mockEvent = {
|
const mockEvent = {
|
||||||
@@ -215,7 +217,6 @@ function submitForm() {
|
|||||||
} as SubmitEvent
|
} as SubmitEvent
|
||||||
|
|
||||||
// Call onSubmit directly
|
// Call onSubmit directly
|
||||||
console.log('🔵 Calling onSubmit with mock event')
|
|
||||||
onSubmit(mockEvent)
|
onSubmit(mockEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -345,14 +346,23 @@ defineExpose({
|
|||||||
<span class="text-red-500">*</span>
|
<span class="text-red-500">*</span>
|
||||||
</DE.Label>
|
</DE.Label>
|
||||||
<DE.Field :errMessage="errors.unit_code">
|
<DE.Field :errMessage="errors.unit_code">
|
||||||
<Input :value="unitFullName"/>
|
<Input :value="unitFullName" :disabled="true"/>
|
||||||
<!-- <TreeSelect
|
</DE.Field>
|
||||||
id="subSpecialistCode"
|
</DE.Cell>
|
||||||
v-model="subSpecialistCode"
|
|
||||||
v-bind="subSpecialistCodeAttrs"
|
<DE.Cell>
|
||||||
:data="specialists || []"
|
<DE.Label height="compact">
|
||||||
:on-fetch-children="onFetchChildren"
|
Tanggal Daftar
|
||||||
/> -->
|
<span class="text-red-500">*</span>
|
||||||
|
</DE.Label>
|
||||||
|
<DE.Field :errMessage="errors.registerDate">
|
||||||
|
<DatepickerSingle
|
||||||
|
v-if="!isDateLoading"
|
||||||
|
id="registerDate"
|
||||||
|
v-model="registerDate"
|
||||||
|
v-bind="registerDateAttrs"
|
||||||
|
placeholder="Pilih tanggal"
|
||||||
|
/>
|
||||||
</DE.Field>
|
</DE.Field>
|
||||||
</DE.Cell>
|
</DE.Cell>
|
||||||
</DE.Block>
|
</DE.Block>
|
||||||
@@ -363,21 +373,6 @@ defineExpose({
|
|||||||
:colCount="3"
|
:colCount="3"
|
||||||
:cellFlex="false"
|
:cellFlex="false"
|
||||||
>
|
>
|
||||||
<DE.Cell>
|
|
||||||
<DE.Label height="compact">
|
|
||||||
Tanggal Daftar
|
|
||||||
<span class="text-red-500">*</span>
|
|
||||||
</DE.Label>
|
|
||||||
<DE.Field :errMessage="errors.registerDate">
|
|
||||||
<DatepickerSingle
|
|
||||||
id="registerDate"
|
|
||||||
v-model="registerDate"
|
|
||||||
v-bind="registerDateAttrs"
|
|
||||||
placeholder="Pilih tanggal"
|
|
||||||
/>
|
|
||||||
</DE.Field>
|
|
||||||
</DE.Cell>
|
|
||||||
|
|
||||||
<DE.Cell>
|
<DE.Cell>
|
||||||
<DE.Label height="compact">
|
<DE.Label height="compact">
|
||||||
Jenis Pembayaran
|
Jenis Pembayaran
|
||||||
@@ -397,7 +392,7 @@ defineExpose({
|
|||||||
</DE.Block>
|
</DE.Block>
|
||||||
|
|
||||||
<!-- BPJS Fields (conditional) -->
|
<!-- BPJS Fields (conditional) -->
|
||||||
<template v-if="isJKNPayment">
|
<template v-if="isInsurancePayment">
|
||||||
<DE.Block
|
<DE.Block
|
||||||
labelSize="thin"
|
labelSize="thin"
|
||||||
class="!pt-0"
|
class="!pt-0"
|
||||||
@@ -419,6 +414,9 @@ defineExpose({
|
|||||||
placeholder="Pilih Kelompok Peserta"
|
placeholder="Pilih Kelompok Peserta"
|
||||||
/>
|
/>
|
||||||
</DE.Field>
|
</DE.Field>
|
||||||
|
<span class="text-sm text-gray-500">
|
||||||
|
{{ noteReference }}
|
||||||
|
</span>
|
||||||
</DE.Cell>
|
</DE.Cell>
|
||||||
|
|
||||||
<DE.Cell>
|
<DE.Cell>
|
||||||
@@ -435,6 +433,26 @@ defineExpose({
|
|||||||
placeholder="Masukkan nomor kartu BPJS"
|
placeholder="Masukkan nomor kartu BPJS"
|
||||||
/>
|
/>
|
||||||
</DE.Field>
|
</DE.Field>
|
||||||
|
<div
|
||||||
|
v-if="isMemberValid"
|
||||||
|
class="mt-1 flex items-center gap-2"
|
||||||
|
>
|
||||||
|
<Icon
|
||||||
|
name="i-lucide-badge-check"
|
||||||
|
class="h-4 w-4 bg-green-500 text-white"
|
||||||
|
/>
|
||||||
|
<span class="text-sm text-green-500">Aktif</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="!isMemberValid"
|
||||||
|
class="mt-1 flex items-center gap-2"
|
||||||
|
>
|
||||||
|
<Icon
|
||||||
|
name="i-lucide-x"
|
||||||
|
class="h-4 w-4 bg-red-500 text-white"
|
||||||
|
/>
|
||||||
|
<span class="text-sm text-red-500">Tidak aktif</span>
|
||||||
|
</div>
|
||||||
</DE.Cell>
|
</DE.Cell>
|
||||||
|
|
||||||
<DE.Cell>
|
<DE.Cell>
|
||||||
@@ -474,7 +492,7 @@ defineExpose({
|
|||||||
v-bind="sepNumberAttrs"
|
v-bind="sepNumberAttrs"
|
||||||
placeholder="Tambah SEP terlebih dahulu"
|
placeholder="Tambah SEP terlebih dahulu"
|
||||||
class="flex-1"
|
class="flex-1"
|
||||||
:disabled="isLoading || isReadonly"
|
:disabled="isLoading || isReadonly || isSepValid"
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
v-if="!isSepValid"
|
v-if="!isSepValid"
|
||||||
@@ -490,44 +508,152 @@ defineExpose({
|
|||||||
name="i-lucide-loader-2"
|
name="i-lucide-loader-2"
|
||||||
class="h-4 w-4 animate-spin"
|
class="h-4 w-4 animate-spin"
|
||||||
/>
|
/>
|
||||||
<Icon
|
<Icon
|
||||||
v-else
|
v-else
|
||||||
name="i-lucide-plus"
|
name="i-lucide-plus"
|
||||||
class="h-4 w-4"
|
class="h-4 w-4"
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
v-else
|
v-if="isMemberValid"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
type="button"
|
type="button"
|
||||||
class="bg-green-500 text-white hover:bg-green-600"
|
class="bg-primary"
|
||||||
size="sm"
|
size="sm"
|
||||||
disabled
|
@click="onSearchSep"
|
||||||
>
|
>
|
||||||
<Icon
|
<Icon
|
||||||
name="i-lucide-check"
|
name="i-lucide-search"
|
||||||
class="h-4 w-4"
|
class="h-4 w-4"
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</DE.Field>
|
</DE.Field>
|
||||||
|
<div
|
||||||
|
v-if="isSepValid"
|
||||||
|
class="mt-1 flex items-center gap-2"
|
||||||
|
>
|
||||||
|
<Icon
|
||||||
|
name="i-lucide-badge-check"
|
||||||
|
class="h-4 w-4 bg-green-500 text-white"
|
||||||
|
/>
|
||||||
|
<span class="text-sm text-green-500">Aktif</span>
|
||||||
|
</div>
|
||||||
|
<span class="text-sm text-gray-500">
|
||||||
|
{{ noteReference }}
|
||||||
|
</span>
|
||||||
</DE.Cell>
|
</DE.Cell>
|
||||||
|
|
||||||
<FileUpload
|
<DE.Cell>
|
||||||
field-name="sepFile"
|
<FileUpload
|
||||||
label="Dokumen SEP"
|
field-name="sepFile"
|
||||||
placeholder="Unggah dokumen SEP"
|
label="Dokumen SEP"
|
||||||
:accept="['pdf', 'jpg', 'png']"
|
placeholder="Pilih file"
|
||||||
:max-size-mb="1"
|
:accept="['pdf', 'jpg', 'png']"
|
||||||
/>
|
:max-size-mb="1"
|
||||||
|
v-model="sepFile"
|
||||||
|
v-bind="sepFileAttrs"
|
||||||
|
@file-selected="(file: any) => { console.log(file) }"
|
||||||
|
/>
|
||||||
|
<span class="mt-1 text-sm text-gray-500">
|
||||||
|
{{ noteFile }}
|
||||||
|
</span>
|
||||||
|
</DE.Cell>
|
||||||
|
|
||||||
<FileUpload
|
<DE.Cell>
|
||||||
field-name="sippFile"
|
<FileUpload
|
||||||
label="Dokumen SIPP"
|
field-name="sippFile"
|
||||||
placeholder="Unggah dokumen SIPP"
|
label="Dokumen SIPP"
|
||||||
:accept="['pdf', 'jpg', 'png']"
|
placeholder="Pilih file"
|
||||||
:max-size-mb="1"
|
:accept="['pdf', 'jpg', 'png']"
|
||||||
/>
|
:max-size-mb="1"
|
||||||
|
v-model="sippFile"
|
||||||
|
v-bind="sippFileAttrs"
|
||||||
|
@file-selected="(file: any) => { console.log(file) }"
|
||||||
|
/>
|
||||||
|
<span class="mt-1 text-sm text-gray-500">
|
||||||
|
{{ noteFile }}
|
||||||
|
</span>
|
||||||
|
</DE.Cell>
|
||||||
|
</DE.Block>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-if="isSepValid">
|
||||||
|
<hr />
|
||||||
|
<!-- Data SEP -->
|
||||||
|
<h3 class="text-lg font-semibold">Data SEP</h3>
|
||||||
|
|
||||||
|
<DE.Block
|
||||||
|
labelSize="thin"
|
||||||
|
class="!pt-0"
|
||||||
|
:colCount="3"
|
||||||
|
:cellFlex="false"
|
||||||
|
>
|
||||||
|
<DE.Cell>
|
||||||
|
<Label height="compact">Dengan Rujukan / Surat Kontrol</Label>
|
||||||
|
<Field>
|
||||||
|
<Input
|
||||||
|
id="sepReference"
|
||||||
|
v-model="sepReference"
|
||||||
|
:disabled="true"
|
||||||
|
/>
|
||||||
|
</Field>
|
||||||
|
</DE.Cell>
|
||||||
|
|
||||||
|
<DE.Cell>
|
||||||
|
<Label height="compact">No. Rujukan / Surat Kontrol</Label>
|
||||||
|
<DE.Field>
|
||||||
|
<Input
|
||||||
|
id="sepReference"
|
||||||
|
v-model="sepNumber"
|
||||||
|
:disabled="true"
|
||||||
|
/>
|
||||||
|
</DE.Field>
|
||||||
|
</DE.Cell>
|
||||||
|
|
||||||
|
<DE.Cell>
|
||||||
|
<Label height="compact">
|
||||||
|
Tanggal Rujukan / Surat Kontrol
|
||||||
|
<span class="ml-1 text-red-500">*</span>
|
||||||
|
</Label>
|
||||||
|
<DE.Field>
|
||||||
|
<DatepickerSingle
|
||||||
|
id="sepControlDate"
|
||||||
|
v-model="sepControlDate"
|
||||||
|
:disabled="true"
|
||||||
|
placeholder="Pilih tanggal sep"
|
||||||
|
/>
|
||||||
|
</DE.Field>
|
||||||
|
</DE.Cell>
|
||||||
|
</DE.Block>
|
||||||
|
|
||||||
|
<DE.Block
|
||||||
|
labelSize="thin"
|
||||||
|
class="!pt-0"
|
||||||
|
:colCount="3"
|
||||||
|
:cellFlex="false"
|
||||||
|
>
|
||||||
|
<DE.Cell :col-span="2">
|
||||||
|
<Label height="compact">Diagnosis</Label>
|
||||||
|
<Field>
|
||||||
|
<Input
|
||||||
|
id="diagnosis"
|
||||||
|
v-model="diagnosis"
|
||||||
|
:disabled="true"
|
||||||
|
/>
|
||||||
|
</Field>
|
||||||
|
</DE.Cell>
|
||||||
|
|
||||||
|
<DE.Cell>
|
||||||
|
<Label height="compact">Status Kecelakaan</Label>
|
||||||
|
<DE.Field>
|
||||||
|
<Input
|
||||||
|
id="sepTrafficStatus"
|
||||||
|
v-model="sepTrafficStatus"
|
||||||
|
:disabled="true"
|
||||||
|
/>
|
||||||
|
</DE.Field>
|
||||||
|
</DE.Cell>
|
||||||
</DE.Block>
|
</DE.Block>
|
||||||
</template>
|
</template>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { cn } from '~/lib/utils'
|
|||||||
import type { RefExportNav, RefSearchNav } from '~/components/pub/my-ui/data/types'
|
import type { RefExportNav, RefSearchNav } from '~/components/pub/my-ui/data/types'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
activePositon?: string
|
||||||
refSearchNav?: RefSearchNav
|
refSearchNav?: RefSearchNav
|
||||||
enableExport?: boolean
|
enableExport?: boolean
|
||||||
refExportNav?: RefExportNav
|
refExportNav?: RefExportNav
|
||||||
@@ -30,6 +31,8 @@ const props = defineProps<{
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
const searchQuery = ref('')
|
const searchQuery = ref('')
|
||||||
|
const isRoleRegistration = props.activePositon === 'registration'
|
||||||
|
const isRoleMedical = props.activePositon === 'medical'
|
||||||
const dateRange = ref<{ from: Date | null; to: Date | null }>({
|
const dateRange = ref<{ from: Date | null; to: Date | null }>({
|
||||||
from: new Date(),
|
from: new Date(),
|
||||||
to: new Date(),
|
to: new Date(),
|
||||||
@@ -70,7 +73,7 @@ const value = ref({
|
|||||||
<PopoverTrigger as-child>
|
<PopoverTrigger as-child>
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
:class="cn('w-[200px] justify-start text-left font-normal', !value && 'text-muted-foreground')"
|
:class="cn('min-w-[240px] max-w-[320px] justify-start text-left font-normal', !value && 'text-muted-foreground')"
|
||||||
>
|
>
|
||||||
<CalendarIcon class="mr-2 h-4 w-4" />
|
<CalendarIcon class="mr-2 h-4 w-4" />
|
||||||
<template v-if="value.start">
|
<template v-if="value.start">
|
||||||
@@ -101,7 +104,7 @@ const value = ref({
|
|||||||
Filter
|
Filter
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<DropdownMenu v-show="props.enableExport">
|
<DropdownMenu v-show="props.enableExport && (isRoleRegistration || isRoleMedical)">
|
||||||
<DropdownMenuTrigger as-child>
|
<DropdownMenuTrigger as-child>
|
||||||
<Button variant="outline" class="ml-auto border-orange-500 text-orange-600 hover:bg-orange-50">
|
<Button variant="outline" class="ml-auto border-orange-500 text-orange-600 hover:bg-orange-50">
|
||||||
<Icon name="i-lucide-download" class="h-4 w-4" />
|
<Icon name="i-lucide-download" class="h-4 w-4" />
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import { inject, type Ref } from 'vue'
|
||||||
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
|
// Components
|
||||||
|
import { Button } from '~/components/pub/ui/button'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
rec: { sepNumber: string; }
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
|
const record = props.rec || {}
|
||||||
|
const recSepId = inject('rec_sep_id') as Ref<string>
|
||||||
|
|
||||||
|
function handleSelection() {
|
||||||
|
recSepId.value = record.sepNumber || ''
|
||||||
|
const pathUrl = `/integration/bpjs-vclaim/sep/${record.sepNumber || ''}/link?source-path=${route.path}`
|
||||||
|
router.push(pathUrl)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
type="button"
|
||||||
|
class="h-[40px] rounded-md border-orange-400 text-orange-400 hover:bg-green-50"
|
||||||
|
@click="handleSelection"
|
||||||
|
>
|
||||||
|
Detail SEP
|
||||||
|
</Button>
|
||||||
|
</template>
|
||||||
@@ -24,11 +24,11 @@ import { useForm } from 'vee-validate'
|
|||||||
import { refDebounced } from '@vueuse/core'
|
import { refDebounced } from '@vueuse/core'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
mode?: string
|
||||||
isLoading?: boolean
|
isLoading?: boolean
|
||||||
isReadonly?: boolean
|
isReadonly?: boolean
|
||||||
isService?: boolean
|
isService?: boolean
|
||||||
isShowPatient?: boolean;
|
isShowPatient?: boolean
|
||||||
mode?: string
|
|
||||||
doctors: any[]
|
doctors: any[]
|
||||||
diagnoses: any[]
|
diagnoses: any[]
|
||||||
facilitiesFrom: any[]
|
facilitiesFrom: any[]
|
||||||
@@ -102,14 +102,17 @@ const titleLetterNumber = computed(() => (admissionType.value === '3' ? 'Surat K
|
|||||||
const titleLetterDate = computed(() =>
|
const titleLetterDate = computed(() =>
|
||||||
admissionType.value === '3' ? 'Tanggal Surat Kontrol' : 'Tanggal Surat Rujukan',
|
admissionType.value === '3' ? 'Tanggal Surat Kontrol' : 'Tanggal Surat Rujukan',
|
||||||
)
|
)
|
||||||
|
const mode = props.mode !== undefined ? props.mode : 'add'
|
||||||
|
const attendingDoctorName = ref('')
|
||||||
|
const diagnosisName = ref('')
|
||||||
const isAccidentally = computed(() => accident.value === '1' || accident.value === '2')
|
const isAccidentally = computed(() => accident.value === '1' || accident.value === '2')
|
||||||
const isProvinceSelected = computed(() => accidentProvince.value !== '')
|
const isProvinceSelected = computed(() => accidentProvince.value !== '')
|
||||||
const isCitySelected = computed(() => accidentCity.value !== '')
|
const isCitySelected = computed(() => accidentCity.value !== '')
|
||||||
const mode = props.mode !== undefined ? props.mode : 'add'
|
|
||||||
const isLoading = props.isLoading !== undefined ? props.isLoading : false
|
const isLoading = props.isLoading !== undefined ? props.isLoading : false
|
||||||
const isReadonly = props.isReadonly !== undefined ? props.isReadonly : false
|
const isReadonly = props.isReadonly !== undefined ? props.isReadonly : false
|
||||||
const isService = ref(props.isService || false)
|
const isService = ref(props.isService || false)
|
||||||
const isShowPatient = ref(props.isShowPatient || false)
|
const isShowPatient = ref(props.isShowPatient || false)
|
||||||
|
const isShowSpecialist = ref(false)
|
||||||
const isDateReload = ref(false)
|
const isDateReload = ref(false)
|
||||||
|
|
||||||
// Debounced search for bpjsNumber and nationalId
|
// Debounced search for bpjsNumber and nationalId
|
||||||
@@ -129,32 +132,139 @@ async function onFetchChildren(parentId: string): Promise<void> {
|
|||||||
console.log('onFetchChildren', parentId)
|
console.log('onFetchChildren', parentId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onBack = () => {
|
||||||
|
emit('event', 'back')
|
||||||
|
}
|
||||||
|
|
||||||
|
const onSaveNumber = () => {
|
||||||
|
emit('event', 'save-sep-number', { sepNumber: props?.objects?.sepNumber || '' })
|
||||||
|
}
|
||||||
|
|
||||||
// Submit handler
|
// Submit handler
|
||||||
const onSubmit = handleSubmit((values) => {
|
const onSubmit = handleSubmit((values) => {
|
||||||
console.log('✅ Validated form values:', JSON.stringify(values, null, 2))
|
console.log('✅ Validated form values:', JSON.stringify(values, null, 2))
|
||||||
emit('event', 'save-sep', values)
|
emit('event', 'save-sep', values)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const onInitialized = (objects: any) => {
|
||||||
|
sepDate.value = objects?.registerDate || new Date().toISOString().substring(0, 10)
|
||||||
|
cardNumber.value = objects?.cardNumber || '-'
|
||||||
|
nationalId.value = objects?.nationalIdentity || '-'
|
||||||
|
medicalRecordNumber.value = objects?.medicalRecordNumber || '-'
|
||||||
|
patientName.value = objects?.patientName || '-'
|
||||||
|
phoneNumber.value = objects?.phoneNumber || '-'
|
||||||
|
if (objects?.sepType === 'internal') {
|
||||||
|
admissionType.value = '4'
|
||||||
|
}
|
||||||
|
if (objects?.sepType === 'external') {
|
||||||
|
admissionType.value = '1'
|
||||||
|
}
|
||||||
|
if (objects?.diagnosisName) {
|
||||||
|
diagnosisName.value = objects?.diagnosisName
|
||||||
|
}
|
||||||
|
// Patient data
|
||||||
|
if (objects?.serviceType) {
|
||||||
|
serviceType.value = objects?.serviceType
|
||||||
|
}
|
||||||
|
if (objects?.fromClinic) {
|
||||||
|
fromClinic.value = objects?.fromClinic
|
||||||
|
}
|
||||||
|
if (objects?.destinationClinic) {
|
||||||
|
destinationClinic.value = objects?.destinationClinic
|
||||||
|
}
|
||||||
|
// Doctor & Support data
|
||||||
|
if (objects?.attendingDoctor) {
|
||||||
|
attendingDoctor.value = objects?.attendingDoctor
|
||||||
|
}
|
||||||
|
if (objects?.attendingDoctorName) {
|
||||||
|
attendingDoctorName.value = objects?.attendingDoctorName
|
||||||
|
}
|
||||||
|
if (objects?.cob) {
|
||||||
|
cob.value = objects?.cob
|
||||||
|
}
|
||||||
|
if (objects?.cataract) {
|
||||||
|
cataract.value = objects?.cataract
|
||||||
|
}
|
||||||
|
if (objects?.clinicExcecutive) {
|
||||||
|
clinicExcecutive.value = objects?.clinicExcecutive
|
||||||
|
}
|
||||||
|
if (objects?.procedureType) {
|
||||||
|
procedureType.value = objects?.procedureType
|
||||||
|
}
|
||||||
|
if (objects?.supportCode) {
|
||||||
|
supportCode.value = objects?.supportCode
|
||||||
|
}
|
||||||
|
// Class & Payment data
|
||||||
|
if (objects?.classLevel) {
|
||||||
|
classLevel.value = objects?.classLevel
|
||||||
|
}
|
||||||
|
if (objects?.classLevelUpgrade) {
|
||||||
|
classLevelUpgrade.value = objects?.classLevelUpgrade
|
||||||
|
}
|
||||||
|
if (objects?.classPaySource) {
|
||||||
|
classPaySource.value = objects?.classPaySource
|
||||||
|
}
|
||||||
|
if (objects?.responsiblePerson) {
|
||||||
|
responsiblePerson.value = objects?.responsiblePerson
|
||||||
|
}
|
||||||
|
// Accident data
|
||||||
|
if (objects?.trafficAccident) {
|
||||||
|
accident.value = objects?.trafficAccident
|
||||||
|
}
|
||||||
|
if (objects?.lpNumber) {
|
||||||
|
lpNumber.value = objects?.lpNumber
|
||||||
|
}
|
||||||
|
if (objects?.accidentDate) {
|
||||||
|
accidentDate.value = objects?.accidentDate
|
||||||
|
}
|
||||||
|
if (objects?.accidentNote) {
|
||||||
|
accidentNote.value = objects?.accidentNote
|
||||||
|
}
|
||||||
|
if (objects?.accidentProvince) {
|
||||||
|
accidentProvince.value = objects?.accidentProvince
|
||||||
|
}
|
||||||
|
if (objects?.accidentCity) {
|
||||||
|
accidentCity.value = objects?.accidentCity
|
||||||
|
}
|
||||||
|
if (objects?.accidentDistrict) {
|
||||||
|
accidentDistrict.value = objects?.accidentDistrict
|
||||||
|
}
|
||||||
|
if (objects?.suplesi) {
|
||||||
|
suplesi.value = objects?.suplesi
|
||||||
|
}
|
||||||
|
if (objects?.suplesiNumber) {
|
||||||
|
suplesiNumber.value = objects?.suplesiNumber
|
||||||
|
}
|
||||||
|
// Visit purpose & Assessment
|
||||||
|
if (objects?.purposeOfVisit) {
|
||||||
|
purposeOfVisit.value = objects?.purposeOfVisit
|
||||||
|
}
|
||||||
|
if (objects?.serviceAssessment) {
|
||||||
|
serviceAssessment.value = objects?.serviceAssessment
|
||||||
|
}
|
||||||
|
// Note & Specialist
|
||||||
|
if (objects?.note) {
|
||||||
|
note.value = objects?.note
|
||||||
|
}
|
||||||
|
if (objects?.subSpecialistId) {
|
||||||
|
subSpecialistId.value = objects?.subSpecialistId
|
||||||
|
}
|
||||||
|
// Referral letter
|
||||||
|
if (objects?.referralLetterNumber) {
|
||||||
|
referralLetterNumber.value = objects?.referralLetterNumber
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
watch(props, (value) => {
|
watch(props, (value) => {
|
||||||
const objects = value.objects || ({} as any)
|
const objects = value.objects || ({} as any)
|
||||||
if (Object.keys(objects).length > 0) {
|
if (Object.keys(objects).length > 0) {
|
||||||
sepDate.value = objects?.registerDate || new Date().toISOString().substring(0, 10)
|
onInitialized(objects)
|
||||||
cardNumber.value = objects?.cardNumber || '-'
|
|
||||||
nationalId.value = objects?.nationalIdentity || '-'
|
|
||||||
medicalRecordNumber.value = objects?.medicalRecordNumber || '-'
|
|
||||||
patientName.value = objects?.patientName || '-'
|
|
||||||
phoneNumber.value = objects?.phoneNumber || '-'
|
|
||||||
if (objects?.sepType === 'internal') {
|
|
||||||
admissionType.value = '4'
|
|
||||||
}
|
|
||||||
if (objects?.sepType === 'external') {
|
|
||||||
admissionType.value = '1'
|
|
||||||
}
|
|
||||||
if (objects?.diagnoseLabel) {
|
|
||||||
initialDiagnosis.value = objects?.diagnoseLabel
|
|
||||||
}
|
|
||||||
isDateReload.value = true
|
isDateReload.value = true
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
if (objects?.sepDate) {
|
||||||
|
sepDate.value = objects?.sepDate
|
||||||
|
referralLetterDate.value = objects?.sepDate
|
||||||
|
}
|
||||||
if (objects?.letterDate) {
|
if (objects?.letterDate) {
|
||||||
referralLetterDate.value = objects?.letterDate
|
referralLetterDate.value = objects?.letterDate
|
||||||
}
|
}
|
||||||
@@ -206,10 +316,11 @@ onMounted(() => {
|
|||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.sepDate">
|
<Field :errMessage="errors.sepDate">
|
||||||
<DatepickerSingle
|
<DatepickerSingle
|
||||||
|
v-if="!isDateReload"
|
||||||
id="sepDate"
|
id="sepDate"
|
||||||
v-model="sepDate"
|
v-model="sepDate"
|
||||||
v-bind="sepDateAttrs"
|
v-bind="sepDateAttrs"
|
||||||
:disabled="true"
|
:disabled="isLoading || isReadonly"
|
||||||
placeholder="Pilih tanggal sep"
|
placeholder="Pilih tanggal sep"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
@@ -284,7 +395,7 @@ onMounted(() => {
|
|||||||
id="cardNumber"
|
id="cardNumber"
|
||||||
v-model="cardNumber"
|
v-model="cardNumber"
|
||||||
v-bind="cardNumberAttrs"
|
v-bind="cardNumberAttrs"
|
||||||
:disabled="false"
|
:disabled="isLoading || isReadonly"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
</Cell>
|
</Cell>
|
||||||
@@ -299,7 +410,7 @@ onMounted(() => {
|
|||||||
id="nationalId"
|
id="nationalId"
|
||||||
v-model="nationalId"
|
v-model="nationalId"
|
||||||
v-bind="nationalIdAttrs"
|
v-bind="nationalIdAttrs"
|
||||||
:disabled="false"
|
:disabled="isLoading || isReadonly"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
</Cell>
|
</Cell>
|
||||||
@@ -378,6 +489,7 @@ onMounted(() => {
|
|||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
|
v-if="!isReadonly"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
type="button"
|
type="button"
|
||||||
class="h-[40px] rounded-md border-orange-400 text-orange-400 hover:bg-green-50"
|
class="h-[40px] rounded-md border-orange-400 text-orange-400 hover:bg-green-50"
|
||||||
@@ -406,7 +518,7 @@ onMounted(() => {
|
|||||||
id="referralLetterDate"
|
id="referralLetterDate"
|
||||||
v-model="referralLetterDate"
|
v-model="referralLetterDate"
|
||||||
v-bind="referralLetterDateAttrs"
|
v-bind="referralLetterDateAttrs"
|
||||||
:disabled="true"
|
:disabled="isLoading || isReadonly"
|
||||||
placeholder="Pilih tanggal surat"
|
placeholder="Pilih tanggal surat"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
@@ -417,11 +529,12 @@ onMounted(() => {
|
|||||||
Klinik Eksekutif
|
Klinik Eksekutif
|
||||||
<span class="text-red-500">*</span>
|
<span class="text-red-500">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.cob">
|
<Field :errMessage="errors.clinicExcecutive">
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
v-model="clinicExcecutive"
|
v-model="clinicExcecutive"
|
||||||
v-bind="clinicExcecutiveAttrs"
|
v-bind="clinicExcecutiveAttrs"
|
||||||
class="flex items-center gap-2"
|
class="flex items-center gap-2"
|
||||||
|
:disabled="isLoading || isReadonly"
|
||||||
>
|
>
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<RadioGroupItem
|
<RadioGroupItem
|
||||||
@@ -481,7 +594,7 @@ onMounted(() => {
|
|||||||
</Field>
|
</Field>
|
||||||
</Cell>
|
</Cell>
|
||||||
|
|
||||||
<Cell>
|
<Cell v-if="!isReadonly && isShowSpecialist">
|
||||||
<Label height="compact">
|
<Label height="compact">
|
||||||
Spesialis / Subspesialis
|
Spesialis / Subspesialis
|
||||||
<span class="text-red-500">*</span>
|
<span class="text-red-500">*</span>
|
||||||
@@ -504,6 +617,7 @@ onMounted(() => {
|
|||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.attendingDoctor">
|
<Field :errMessage="errors.attendingDoctor">
|
||||||
<Combobox
|
<Combobox
|
||||||
|
v-if="!isReadonly"
|
||||||
id="attendingDoctor"
|
id="attendingDoctor"
|
||||||
v-model="attendingDoctor"
|
v-model="attendingDoctor"
|
||||||
v-bind="attendingDoctorAttrs"
|
v-bind="attendingDoctorAttrs"
|
||||||
@@ -514,6 +628,12 @@ onMounted(() => {
|
|||||||
empty-message="Item tidak ditemukan"
|
empty-message="Item tidak ditemukan"
|
||||||
@update:searchText="emit('fetch', { menu: 'doctor', value: $event })"
|
@update:searchText="emit('fetch', { menu: 'doctor', value: $event })"
|
||||||
/>
|
/>
|
||||||
|
<Input
|
||||||
|
v-else
|
||||||
|
v-model="attendingDoctorName"
|
||||||
|
v-bind="attendingDoctorAttrs"
|
||||||
|
:disabled="isLoading || isReadonly"
|
||||||
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
</Cell>
|
</Cell>
|
||||||
|
|
||||||
@@ -524,6 +644,7 @@ onMounted(() => {
|
|||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.initialDiagnosis">
|
<Field :errMessage="errors.initialDiagnosis">
|
||||||
<Combobox
|
<Combobox
|
||||||
|
v-if="!isReadonly"
|
||||||
id="initialDiagnosis"
|
id="initialDiagnosis"
|
||||||
v-model="initialDiagnosis"
|
v-model="initialDiagnosis"
|
||||||
v-bind="initialDiagnosisAttrs"
|
v-bind="initialDiagnosisAttrs"
|
||||||
@@ -534,6 +655,12 @@ onMounted(() => {
|
|||||||
empty-message="Item tidak ditemukan"
|
empty-message="Item tidak ditemukan"
|
||||||
@update:searchText="emit('fetch', { menu: 'diagnosis', value: $event })"
|
@update:searchText="emit('fetch', { menu: 'diagnosis', value: $event })"
|
||||||
/>
|
/>
|
||||||
|
<Input
|
||||||
|
v-else
|
||||||
|
v-model="diagnosisName"
|
||||||
|
v-bind="initialDiagnosisAttrs"
|
||||||
|
:disabled="isLoading || isReadonly"
|
||||||
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
</Cell>
|
</Cell>
|
||||||
</Block>
|
</Block>
|
||||||
@@ -658,6 +785,7 @@ onMounted(() => {
|
|||||||
v-model="cob"
|
v-model="cob"
|
||||||
v-bind="cobAttrs"
|
v-bind="cobAttrs"
|
||||||
class="flex items-center gap-2"
|
class="flex items-center gap-2"
|
||||||
|
:disabled="isLoading || isReadonly"
|
||||||
>
|
>
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<RadioGroupItem
|
<RadioGroupItem
|
||||||
@@ -668,7 +796,7 @@ onMounted(() => {
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<RadioGroupItem
|
<RadioGroupItem
|
||||||
value="Tidak"
|
value="no"
|
||||||
id="cob-no"
|
id="cob-no"
|
||||||
/>
|
/>
|
||||||
<Label for="cob-no">Tidak</Label>
|
<Label for="cob-no">Tidak</Label>
|
||||||
@@ -687,6 +815,7 @@ onMounted(() => {
|
|||||||
v-model="cataract"
|
v-model="cataract"
|
||||||
v-bind="cataractAttrs"
|
v-bind="cataractAttrs"
|
||||||
class="flex items-center gap-2"
|
class="flex items-center gap-2"
|
||||||
|
:disabled="isLoading || isReadonly"
|
||||||
>
|
>
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<RadioGroupItem
|
<RadioGroupItem
|
||||||
@@ -756,7 +885,7 @@ onMounted(() => {
|
|||||||
id="accidentDate"
|
id="accidentDate"
|
||||||
v-model="accidentDate"
|
v-model="accidentDate"
|
||||||
v-bind="accidentDateAttrs"
|
v-bind="accidentDateAttrs"
|
||||||
:disabled="true"
|
:disabled="isLoading || isReadonly"
|
||||||
placeholder="Pilih tanggal kejadian"
|
placeholder="Pilih tanggal kejadian"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
@@ -966,6 +1095,7 @@ onMounted(() => {
|
|||||||
<!-- Actions -->
|
<!-- Actions -->
|
||||||
<div class="mt-6 flex justify-end gap-2">
|
<div class="mt-6 flex justify-end gap-2">
|
||||||
<Button
|
<Button
|
||||||
|
v-if="props.mode === 'detail'"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
type="button"
|
type="button"
|
||||||
class="h-[40px] min-w-[120px] text-orange-400 hover:bg-green-50"
|
class="h-[40px] min-w-[120px] text-orange-400 hover:bg-green-50"
|
||||||
@@ -978,6 +1108,7 @@ onMounted(() => {
|
|||||||
Riwayat SEP
|
Riwayat SEP
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
v-if="props.mode === 'detail'"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
type="button"
|
type="button"
|
||||||
class="h-[40px] min-w-[120px] rounded-md border-orange-400 text-orange-400 hover:bg-green-50 hover:text-orange-400"
|
class="h-[40px] min-w-[120px] rounded-md border-orange-400 text-orange-400 hover:bg-green-50 hover:text-orange-400"
|
||||||
@@ -989,6 +1120,7 @@ onMounted(() => {
|
|||||||
Preview
|
Preview
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
v-if="props.mode === 'add'"
|
||||||
type="button"
|
type="button"
|
||||||
class="h-[40px] min-w-[120px] text-white"
|
class="h-[40px] min-w-[120px] text-white"
|
||||||
:disabled="isLoading"
|
:disabled="isLoading"
|
||||||
@@ -1000,6 +1132,32 @@ onMounted(() => {
|
|||||||
/>
|
/>
|
||||||
Simpan
|
Simpan
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
v-if="props.mode === 'detail'"
|
||||||
|
type="button"
|
||||||
|
class="h-[40px] min-w-[120px] text-white"
|
||||||
|
:disabled="isLoading"
|
||||||
|
@click="onBack"
|
||||||
|
>
|
||||||
|
<Icon
|
||||||
|
name="i-lucide-chevron-left"
|
||||||
|
class="h-5 w-5"
|
||||||
|
/>
|
||||||
|
Kembali
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
v-if="props.mode === 'link'"
|
||||||
|
type="button"
|
||||||
|
class="h-[40px] min-w-[120px] text-white"
|
||||||
|
:disabled="isLoading"
|
||||||
|
@click="onSaveNumber"
|
||||||
|
>
|
||||||
|
<Icon
|
||||||
|
name="i-lucide-save"
|
||||||
|
class="h-5 w-5"
|
||||||
|
/>
|
||||||
|
Terapkan
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,21 +9,25 @@ export interface SepHistoryData {
|
|||||||
careClass: string
|
careClass: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ActionHistory = defineAsyncComponent(() => import('~/components/app/sep/action-history.vue'))
|
||||||
|
|
||||||
|
const keysDefault = ['sepNumber', 'sepDate', 'referralNumber', 'diagnosis', 'serviceType', 'careClass']
|
||||||
|
const colsDefault = [{ width: 100 }, { width: 100 }, { width: 100 }, { width: 100 }, { width: 100 }, { width: 100 }]
|
||||||
|
const headersDefault = [
|
||||||
|
{ label: 'NO. SEP' },
|
||||||
|
{ label: 'TGL. SEP' },
|
||||||
|
{ label: 'NO. RUJUKAN' },
|
||||||
|
{ label: 'DIAGNOSIS AWAL' },
|
||||||
|
{ label: 'JENIS PELAYANAN' },
|
||||||
|
{ label: 'KELAS RAWAT' },
|
||||||
|
]
|
||||||
|
|
||||||
export const config: Config = {
|
export const config: Config = {
|
||||||
cols: [{ width: 100 }, { width: 100 }, { width: 100 }, { width: 100 }, { width: 100 }, { width: 100 }],
|
cols: [...colsDefault],
|
||||||
|
|
||||||
headers: [
|
headers: [[...headersDefault]],
|
||||||
[
|
|
||||||
{ label: 'NO. SEP' },
|
|
||||||
{ label: 'TGL. SEP' },
|
|
||||||
{ label: 'NO. RUJUKAN' },
|
|
||||||
{ label: 'DIAGNOSIS AWAL' },
|
|
||||||
{ label: 'JENIS PELAYANAN' },
|
|
||||||
{ label: 'KELAS RAWAT' },
|
|
||||||
],
|
|
||||||
],
|
|
||||||
|
|
||||||
keys: ['sepNumber', 'sepDate', 'referralNumber', 'diagnosis', 'serviceType', 'careClass'],
|
keys: [...keysDefault],
|
||||||
|
|
||||||
delKeyNames: [{ key: 'code', label: 'Kode' }],
|
delKeyNames: [{ key: 'code', label: 'Kode' }],
|
||||||
|
|
||||||
@@ -33,3 +37,27 @@ export const config: Config = {
|
|||||||
|
|
||||||
htmls: {},
|
htmls: {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const configDetail: Config = {
|
||||||
|
cols: [...colsDefault, { width: 50 }],
|
||||||
|
|
||||||
|
headers: [[...headersDefault, { label: 'AKSI' }]],
|
||||||
|
|
||||||
|
keys: [...keysDefault, 'action'],
|
||||||
|
|
||||||
|
delKeyNames: [{ key: 'code', label: 'Kode' }],
|
||||||
|
|
||||||
|
parses: {},
|
||||||
|
|
||||||
|
components: {
|
||||||
|
action(rec, idx) {
|
||||||
|
return {
|
||||||
|
idx,
|
||||||
|
rec: { ...(rec as object) },
|
||||||
|
component: ActionHistory,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
htmls: {},
|
||||||
|
}
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
import type { Config } from '~/components/pub/my-ui/data-table'
|
import type { Config } from '~/components/pub/my-ui/data-table'
|
||||||
import { defineAsyncComponent } from 'vue'
|
import { defineAsyncComponent } from 'vue'
|
||||||
|
|
||||||
type SepDto = any
|
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dd.vue'))
|
||||||
|
|
||||||
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
|
|
||||||
|
|
||||||
export const config: Config = {
|
export const config: Config = {
|
||||||
cols: [
|
cols: [
|
||||||
|
|||||||
@@ -7,9 +7,10 @@ import type { SepHistoryData } from './list-cfg.history'
|
|||||||
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
|
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
|
||||||
|
|
||||||
// Configs
|
// Configs
|
||||||
import { config } from './list-cfg.history'
|
import { config, configDetail } from './list-cfg.history'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
isAction?: boolean
|
||||||
data: SepHistoryData[]
|
data: SepHistoryData[]
|
||||||
paginationMeta?: PaginationMeta
|
paginationMeta?: PaginationMeta
|
||||||
}>()
|
}>()
|
||||||
@@ -25,7 +26,7 @@ function handlePageChange(page: number) {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<PubMyUiDataTable
|
<PubMyUiDataTable
|
||||||
v-bind="config"
|
v-bind="isAction ? configDetail : config"
|
||||||
:rows="props.data"
|
:rows="props.data"
|
||||||
/>
|
/>
|
||||||
<PaginationView
|
<PaginationView
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import type { PaginationMeta } from '~/components/pub/my-ui/pagination/paginatio
|
|||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
open: boolean
|
open: boolean
|
||||||
|
isAction?: boolean
|
||||||
histories: Array<SepHistoryData>
|
histories: Array<SepHistoryData>
|
||||||
paginationMeta?: PaginationMeta
|
paginationMeta?: PaginationMeta
|
||||||
}>()
|
}>()
|
||||||
@@ -37,7 +38,7 @@ const emit = defineEmits<{
|
|||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
|
|
||||||
<div class="overflow-x-auto rounded-lg border">
|
<div class="overflow-x-auto rounded-lg border">
|
||||||
<ListHistory :data="histories" :pagination-meta="paginationMeta" />
|
<ListHistory :data="histories" :is-action="props.isAction || false" :pagination-meta="paginationMeta" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<DialogFooter></DialogFooter>
|
<DialogFooter></DialogFooter>
|
||||||
|
|||||||
@@ -3,14 +3,14 @@
|
|||||||
import { Button } from '~/components/pub/ui/button'
|
import { Button } from '~/components/pub/ui/button'
|
||||||
import AppEncounterEntryForm from '~/components/app/encounter/entry-form.vue'
|
import AppEncounterEntryForm from '~/components/app/encounter/entry-form.vue'
|
||||||
import AppViewPatient from '~/components/app/patient/view-patient.vue'
|
import AppViewPatient from '~/components/app/patient/view-patient.vue'
|
||||||
|
import AppViewHistory from '~/components/app/sep/view-history.vue'
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
import { refDebounced } from '@vueuse/core'
|
import { refDebounced } from '@vueuse/core'
|
||||||
|
|
||||||
// Handlers
|
// Handlers
|
||||||
import { getDetail as getDoctorDetail } from '~/services/doctor.service'
|
|
||||||
import { useEncounterEntry } from '~/handlers/encounter-entry.handler'
|
import { useEncounterEntry } from '~/handlers/encounter-entry.handler'
|
||||||
import { genDoctor, type Doctor } from '~/models/doctor'
|
import { useIntegrationSepEntry } from '~/handlers/integration-sep-entry.handler'
|
||||||
|
|
||||||
// Props
|
// Props
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -34,54 +34,33 @@ const {
|
|||||||
isLoadingDetail,
|
isLoadingDetail,
|
||||||
formObjects,
|
formObjects,
|
||||||
openPatient,
|
openPatient,
|
||||||
|
isMemberValid,
|
||||||
isSepValid,
|
isSepValid,
|
||||||
isCheckingSep,
|
isCheckingSep,
|
||||||
isSaveDisabled,
|
isSaveDisabled,
|
||||||
isSaving,
|
|
||||||
isLoading,
|
isLoading,
|
||||||
patients,
|
patients,
|
||||||
|
selectedDoctor,
|
||||||
selectedPatient,
|
selectedPatient,
|
||||||
selectedPatientObject,
|
selectedPatientObject,
|
||||||
paginationMeta,
|
paginationMeta,
|
||||||
toNavigateSep,
|
toNavigateSep,
|
||||||
getListPath,
|
getListPath,
|
||||||
handleInit,
|
handleInit,
|
||||||
loadEncounterDetail,
|
getFetchEncounterDetail,
|
||||||
handleSaveEncounter,
|
handleSaveEncounter,
|
||||||
getPatientsList,
|
getPatientsList,
|
||||||
getPatientCurrent,
|
getPatientCurrent,
|
||||||
getPatientByIdentifierSearch,
|
getPatientByIdentifierSearch,
|
||||||
getIsSubspecialist,
|
// getIsSubspecialist,
|
||||||
|
getDoctorInfo,
|
||||||
|
getValidateMember,
|
||||||
getValidateSepNumber,
|
getValidateSepNumber,
|
||||||
handleFetchDoctors,
|
handleFetchDoctors,
|
||||||
} = useEncounterEntry(props)
|
} = useEncounterEntry(props)
|
||||||
|
const { recSepId, openHistory, histories, getMonitoringHistoryMappers } = useIntegrationSepEntry()
|
||||||
|
|
||||||
const debouncedSepNumber = refDebounced(sepNumber, 500)
|
const debouncedSepNumber = refDebounced(sepNumber, 500)
|
||||||
const selectedDoctor = ref<Doctor>(genDoctor())
|
|
||||||
|
|
||||||
provide('rec_select_id', recSelectId)
|
|
||||||
provide('table_data_loader', isLoading)
|
|
||||||
|
|
||||||
watch(debouncedSepNumber, async (newValue) => {
|
|
||||||
await getValidateSepNumber(newValue)
|
|
||||||
})
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => formObjects.value?.paymentType,
|
|
||||||
(newValue) => {
|
|
||||||
isSepValid.value = false
|
|
||||||
if (newValue !== 'jkn') {
|
|
||||||
sepNumber.value = ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
await handleInit()
|
|
||||||
if (props.id > 0) {
|
|
||||||
await loadEncounterDetail()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
///// Functions
|
///// Functions
|
||||||
function handleSavePatient() {
|
function handleSavePatient() {
|
||||||
@@ -116,12 +95,28 @@ async function handleEvent(menu: string, value?: any) {
|
|||||||
}
|
}
|
||||||
toNavigateSep({
|
toNavigateSep({
|
||||||
isService: 'false',
|
isService: 'false',
|
||||||
|
encounterId: props.id || null,
|
||||||
sourcePath: route.path,
|
sourcePath: route.path,
|
||||||
resource: `${props.classCode}-${props.subClassCode}`,
|
resource: `${props.classCode}-${props.subClassCode}`,
|
||||||
...value,
|
...value,
|
||||||
})
|
})
|
||||||
} else if (menu === 'sep-number-changed') {
|
} else if (menu === 'sep-number-changed') {
|
||||||
await getValidateSepNumber(String(value || ''))
|
const sepNumberText = String(value || '').trim()
|
||||||
|
if (sepNumberText.length > 5) {
|
||||||
|
await getValidateSepNumber(sepNumberText)
|
||||||
|
}
|
||||||
|
} else if (menu === 'member-changed') {
|
||||||
|
const memberText = String(value || '').trim()
|
||||||
|
if (memberText.length > 5) {
|
||||||
|
await getValidateMember(memberText)
|
||||||
|
}
|
||||||
|
} else if (menu === 'search-sep') {
|
||||||
|
const memberText = String(value?.cardNumber || '').trim()
|
||||||
|
if (memberText.length < 5) return
|
||||||
|
getMonitoringHistoryMappers(memberText).then(() => {
|
||||||
|
openHistory.value = true
|
||||||
|
})
|
||||||
|
return
|
||||||
} else if (menu === 'save') {
|
} else if (menu === 'save') {
|
||||||
await handleSaveEncounter(value)
|
await handleSaveEncounter(value)
|
||||||
} else if (menu === 'cancel') {
|
} else if (menu === 'cancel') {
|
||||||
@@ -129,13 +124,39 @@ async function handleEvent(menu: string, value?: any) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getDoctorInfo(value: string) {
|
provide('rec_select_id', recSelectId)
|
||||||
const resp = await getDoctorDetail(value, { includes: 'unit,specialist,subspecialist'})
|
provide('rec_sep_id', recSepId)
|
||||||
if (resp.success) {
|
provide('table_data_loader', isLoading)
|
||||||
selectedDoctor.value = resp.body.data
|
|
||||||
// console.log(selectedDoctor.value)
|
watch(debouncedSepNumber, async (newValue) => {
|
||||||
|
await getValidateSepNumber(newValue)
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => formObjects.value?.paymentType,
|
||||||
|
(newValue) => {
|
||||||
|
isSepValid.value = false
|
||||||
|
if (newValue !== 'jkn') {
|
||||||
|
sepNumber.value = ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.id,
|
||||||
|
async (newId) => {
|
||||||
|
if (props.formType === 'edit' && newId > 0) {
|
||||||
|
await getFetchEncounterDetail()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await handleInit()
|
||||||
|
if (props.formType === 'edit' && props.id > 0) {
|
||||||
|
await getFetchEncounterDetail()
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -144,13 +165,15 @@ async function getDoctorInfo(value: string) {
|
|||||||
name="i-lucide-user"
|
name="i-lucide-user"
|
||||||
class="me-2"
|
class="me-2"
|
||||||
/>
|
/>
|
||||||
<span class="font-semibold">{{ props.formType }}</span>
|
<span class="font-semibold">{{ props.formType === 'add' ? 'Tambah' : 'Ubah' }}</span>
|
||||||
Kunjungan
|
Kunjungan
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<AppEncounterEntryForm
|
<AppEncounterEntryForm
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
|
:mode="props.formType"
|
||||||
:is-loading="isLoadingDetail"
|
:is-loading="isLoadingDetail"
|
||||||
|
:is-member-valid="isMemberValid"
|
||||||
:is-sep-valid="isSepValid"
|
:is-sep-valid="isSepValid"
|
||||||
:is-checking-sep="isCheckingSep"
|
:is-checking-sep="isCheckingSep"
|
||||||
:payments="paymentsList"
|
:payments="paymentsList"
|
||||||
@@ -165,7 +188,6 @@ async function getDoctorInfo(value: string) {
|
|||||||
@event="handleEvent"
|
@event="handleEvent"
|
||||||
@fetch="handleFetch"
|
@fetch="handleFetch"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<AppViewPatient
|
<AppViewPatient
|
||||||
v-model:open="openPatient"
|
v-model:open="openPatient"
|
||||||
v-model:selected="selectedPatient"
|
v-model:selected="selectedPatient"
|
||||||
@@ -184,7 +206,11 @@ async function getDoctorInfo(value: string) {
|
|||||||
"
|
"
|
||||||
@save="handleSavePatient"
|
@save="handleSavePatient"
|
||||||
/>
|
/>
|
||||||
|
<AppViewHistory
|
||||||
|
v-model:open="openHistory"
|
||||||
|
:is-action="true"
|
||||||
|
:histories="histories"
|
||||||
|
/>
|
||||||
<!-- Footer Actions -->
|
<!-- Footer Actions -->
|
||||||
<div class="mt-6 flex justify-end gap-2 border-t border-t-slate-300 pt-4">
|
<div class="mt-6 flex justify-end gap-2 border-t border-t-slate-300 pt-4">
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -34,8 +34,13 @@ const props = defineProps<{
|
|||||||
const { setOpen } = useSidebar()
|
const { setOpen } = useSidebar()
|
||||||
setOpen(true)
|
setOpen(true)
|
||||||
|
|
||||||
|
// Role reactivities
|
||||||
|
const { getActiveRole } = useUserStore()
|
||||||
|
|
||||||
// Main data
|
// Main data
|
||||||
const data = ref([])
|
const data = ref([])
|
||||||
|
const dataFiltered = ref([])
|
||||||
|
const activeServicePosition = ref(getServicePosition(getActiveRole()))
|
||||||
const isLoading = reactive<DataTableLoader>({
|
const isLoading = reactive<DataTableLoader>({
|
||||||
summary: false,
|
summary: false,
|
||||||
isTableLoading: false,
|
isTableLoading: false,
|
||||||
@@ -87,29 +92,25 @@ const filter = ref<{
|
|||||||
schema: {},
|
schema: {},
|
||||||
})
|
})
|
||||||
|
|
||||||
// Role reactivities
|
|
||||||
const { getActiveRole } = useUserStore()
|
|
||||||
const activeServicePosition = ref(getServicePosition(getActiveRole()))
|
|
||||||
provide('activeServicePosition', activeServicePosition)
|
|
||||||
watch(getActiveRole, (role? : string) => {
|
|
||||||
activeServicePosition.value = getServicePosition(role)
|
|
||||||
})
|
|
||||||
|
|
||||||
// Recrod reactivities
|
// Recrod reactivities
|
||||||
|
provide('activeServicePosition', activeServicePosition)
|
||||||
provide('rec_id', recId)
|
provide('rec_id', recId)
|
||||||
provide('rec_action', recAction)
|
provide('rec_action', recAction)
|
||||||
provide('rec_item', recItem)
|
provide('rec_item', recItem)
|
||||||
provide('table_data_loader', isLoading)
|
provide('table_data_loader', isLoading)
|
||||||
|
|
||||||
|
watch(getActiveRole, (role? : string) => {
|
||||||
|
activeServicePosition.value = getServicePosition(role)
|
||||||
|
})
|
||||||
|
|
||||||
watch(() => recAction.value, () => {
|
watch(() => recAction.value, () => {
|
||||||
const basePath = `/${props.classCode}/encounter`
|
const basePath = `/${props.classCode}/encounter`
|
||||||
// console.log(`${basePath}/${recId.value}`, recAction.value)
|
|
||||||
// return
|
|
||||||
if (recAction.value === ActionEvents.showConfirmDelete) {
|
if (recAction.value === ActionEvents.showConfirmDelete) {
|
||||||
isRecordConfirmationOpen.value = true
|
isRecordConfirmationOpen.value = true
|
||||||
} else if (recAction.value === ActionEvents.showCancel) {
|
} else if (recAction.value === ActionEvents.showCancel) {
|
||||||
isRecordCancelOpen.value = true
|
isRecordCancelOpen.value = true
|
||||||
} else if (recAction.value === ActionEvents.showDetail) {
|
} else if (recAction.value === ActionEvents.showDetail) {
|
||||||
navigateTo(`${basePath}/${recId.value}`)
|
navigateTo(`${basePath}/${recId.value}/detail`)
|
||||||
} else if (recAction.value === ActionEvents.showEdit) {
|
} else if (recAction.value === ActionEvents.showEdit) {
|
||||||
navigateTo(`${basePath}/${recId.value}/edit`)
|
navigateTo(`${basePath}/${recId.value}/edit`)
|
||||||
} else if (recAction.value === ActionEvents.showProcess) {
|
} else if (recAction.value === ActionEvents.showProcess) {
|
||||||
@@ -138,6 +139,7 @@ async function getPatientList() {
|
|||||||
const result = await getEncounterList(params)
|
const result = await getEncounterList(params)
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
data.value = result.body?.data || []
|
data.value = result.body?.data || []
|
||||||
|
dataFiltered.value = [...data.value]
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching encounter list:', error)
|
console.error('Error fetching encounter list:', error)
|
||||||
@@ -240,6 +242,7 @@ function handleRemoveConfirmation() {
|
|||||||
<template>
|
<template>
|
||||||
<CH.ContentHeader v-bind="hreaderPrep">
|
<CH.ContentHeader v-bind="hreaderPrep">
|
||||||
<FilterNav
|
<FilterNav
|
||||||
|
:active-positon="activeServicePosition"
|
||||||
@onFilterClick="() => isFilterFormDialogOpen = true"
|
@onFilterClick="() => isFilterFormDialogOpen = true"
|
||||||
@onExportPdf="() => {}"
|
@onExportPdf="() => {}"
|
||||||
@onExportExcel="() => {}"
|
@onExportExcel="() => {}"
|
||||||
@@ -261,6 +264,7 @@ function handleRemoveConfirmation() {
|
|||||||
|
|
||||||
<!-- Batal -->
|
<!-- Batal -->
|
||||||
<RecordConfirmation
|
<RecordConfirmation
|
||||||
|
v-if="canDelete"
|
||||||
v-model:open="isRecordCancelOpen"
|
v-model:open="isRecordCancelOpen"
|
||||||
custom-title="Batalkan Kunjungan"
|
custom-title="Batalkan Kunjungan"
|
||||||
custom-message="Apakah anda yakin ingin membatalkan kunjungan pasien berikut?"
|
custom-message="Apakah anda yakin ingin membatalkan kunjungan pasien berikut?"
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import AppViewHistory from '~/components/app/sep/view-history.vue'
|
|||||||
import AppViewLetter from '~/components/app/sep/view-letter.vue'
|
import AppViewLetter from '~/components/app/sep/view-letter.vue'
|
||||||
|
|
||||||
// Handler
|
// Handler
|
||||||
import useIntegrationSepEntry from '~/handlers/integration-sep-entry.handler'
|
import { useIntegrationSepEntry } from '~/handlers/integration-sep-entry.handler'
|
||||||
|
import { useIntegrationSepDetail } from '~/handlers/integration-sep-detail.handler'
|
||||||
|
|
||||||
const {
|
const {
|
||||||
histories,
|
histories,
|
||||||
@@ -55,8 +56,18 @@ const {
|
|||||||
handleInit,
|
handleInit,
|
||||||
} = useIntegrationSepEntry()
|
} = useIntegrationSepEntry()
|
||||||
|
|
||||||
|
const { valueObjects, getSepDetail } = useIntegrationSepDetail()
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
mode: 'add' | 'edit' | 'detail' | 'link'
|
||||||
|
}>()
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await handleInit()
|
await handleInit()
|
||||||
|
if (['detail', 'link'].includes(props.mode)) {
|
||||||
|
await getSepDetail()
|
||||||
|
selectedObjects.value = { ...selectedObjects.value, ...valueObjects.value }
|
||||||
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -66,12 +77,13 @@ onMounted(async () => {
|
|||||||
name="i-lucide-panel-bottom"
|
name="i-lucide-panel-bottom"
|
||||||
class="me-2"
|
class="me-2"
|
||||||
/>
|
/>
|
||||||
<span class="font-semibold">Tambah</span>
|
<span class="font-semibold">{{ ['detail', 'link'].includes(props.mode) ? 'Detail' : 'Tambah' }} SEP</span>
|
||||||
SEP
|
|
||||||
</div>
|
</div>
|
||||||
<AppSepEntryForm
|
<AppSepEntryForm
|
||||||
|
:mode="props.mode"
|
||||||
:is-save-loading="isSaveLoading"
|
:is-save-loading="isSaveLoading"
|
||||||
:is-service="isServiceHidden"
|
:is-service="isServiceHidden"
|
||||||
|
:is-readonly="['detail', 'link'].includes(props.mode)"
|
||||||
:doctors="doctors"
|
:doctors="doctors"
|
||||||
:diagnoses="diagnoses"
|
:diagnoses="diagnoses"
|
||||||
:facilities-from="facilitiesFrom"
|
:facilities-from="facilitiesFrom"
|
||||||
|
|||||||
@@ -13,8 +13,11 @@ import RangeCalendar from '~/components/pub/ui/range-calendar/RangeCalendar.vue'
|
|||||||
// Icons
|
// Icons
|
||||||
import { X, Check } from 'lucide-vue-next'
|
import { X, Check } from 'lucide-vue-next'
|
||||||
|
|
||||||
// Libraries
|
// Handlers
|
||||||
import useIntegrationSepList from '~/handlers/integration-sep-list.handler'
|
import { useIntegrationSepList } from '~/handlers/integration-sep-list.handler'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { refDebounced } from '@vueuse/core'
|
||||||
|
|
||||||
// use handler to provide state and functions
|
// use handler to provide state and functions
|
||||||
const {
|
const {
|
||||||
@@ -42,26 +45,42 @@ const {
|
|||||||
handleRemove,
|
handleRemove,
|
||||||
} = useIntegrationSepList()
|
} = useIntegrationSepList()
|
||||||
|
|
||||||
|
const dataFiltered = ref<any>([])
|
||||||
|
const debouncedSearch = refDebounced(search, 500)
|
||||||
|
|
||||||
// expose provides so component can also use provide/inject if needed
|
// expose provides so component can also use provide/inject if needed
|
||||||
provide('rec_id', recId)
|
provide('rec_id', recId)
|
||||||
provide('rec_action', recAction)
|
provide('rec_action', recAction)
|
||||||
provide('rec_item', recItem)
|
provide('rec_item', recItem)
|
||||||
provide('table_data_loader', isLoading)
|
provide('table_data_loader', isLoading)
|
||||||
|
|
||||||
watch(
|
watch([recId, recAction], () => {
|
||||||
[recId, recAction],
|
if (recAction.value === 'showConfirmDel') {
|
||||||
() => {
|
open.value = true
|
||||||
if (recAction.value === 'showConfirmDel') {
|
}
|
||||||
open.value = true
|
if (recAction.value === 'showDetail') {
|
||||||
}
|
navigateTo(`/integration/bpjs-vclaim/sep/${recItem.value?.letterNumber}/detail`)
|
||||||
},
|
}
|
||||||
)
|
})
|
||||||
|
|
||||||
|
watch(debouncedSearch, (newValue) => {
|
||||||
|
if (newValue && newValue !== '-' && newValue.length >= 3) {
|
||||||
|
dataFiltered.value = data.value.filter(
|
||||||
|
(item: any) =>
|
||||||
|
item.patientName.toLowerCase().includes(newValue.toLowerCase()) ||
|
||||||
|
item.letterNumber.toLowerCase().includes(newValue.toLowerCase()) ||
|
||||||
|
item.cardNumber.toLowerCase().includes(newValue.toLowerCase()),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => dateSelection.value,
|
() => dateSelection.value,
|
||||||
(val) => {
|
async (val) => {
|
||||||
if (!val) return
|
if (!val) return
|
||||||
setDateRange()
|
setDateRange()
|
||||||
|
await getSepList()
|
||||||
|
dataFiltered.value = [...data.value]
|
||||||
},
|
},
|
||||||
{ deep: true },
|
{ deep: true },
|
||||||
)
|
)
|
||||||
@@ -73,9 +92,10 @@ watch(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
setServiceTypes()
|
setServiceTypes()
|
||||||
getSepList()
|
await getSepList()
|
||||||
|
dataFiltered.value = [...data.value]
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -85,20 +105,35 @@ onMounted(() => {
|
|||||||
<!-- Filter Bar -->
|
<!-- Filter Bar -->
|
||||||
<div class="my-2 flex flex-wrap items-center gap-2">
|
<div class="my-2 flex flex-wrap items-center gap-2">
|
||||||
<!-- Search -->
|
<!-- Search -->
|
||||||
<Input v-model="search" placeholder="Cari No. SEP / No. Kartu BPJS..." class="w-72" />
|
<Input
|
||||||
|
v-model="search"
|
||||||
|
placeholder="Cari No. SEP / No. Kartu BPJS..."
|
||||||
|
class="w-72"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- Filter -->
|
<!-- Filter -->
|
||||||
<div class="w-72">
|
<div class="w-72">
|
||||||
<Select id="serviceType" icon-name="i-lucide-chevron-down" v-model="serviceType" :items="serviceTypesList"
|
<Select
|
||||||
placeholder="Pilih Pelayanan" />
|
id="serviceType"
|
||||||
|
icon-name="i-lucide-chevron-down"
|
||||||
|
v-model="serviceType"
|
||||||
|
:items="serviceTypesList"
|
||||||
|
placeholder="Pilih Pelayanan"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Date Range -->
|
<!-- Date Range -->
|
||||||
<Popover>
|
<Popover>
|
||||||
<PopoverTrigger as-child>
|
<PopoverTrigger as-child>
|
||||||
<Button variant="outline" class="h-[40px] w-72 border-gray-400 bg-white text-right font-normal">
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
class="h-[40px] w-72 border-gray-400 bg-white text-right font-normal"
|
||||||
|
>
|
||||||
{{ dateRange }}
|
{{ dateRange }}
|
||||||
<Icon name="i-lucide-calendar" class="h-5 w-5" />
|
<Icon
|
||||||
|
name="i-lucide-calendar"
|
||||||
|
class="h-5 w-5"
|
||||||
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
<PopoverContent class="p-2">
|
<PopoverContent class="p-2">
|
||||||
@@ -109,9 +144,14 @@ onMounted(() => {
|
|||||||
<!-- Export -->
|
<!-- Export -->
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
<DropdownMenuTrigger as-child>
|
<DropdownMenuTrigger as-child>
|
||||||
<Button variant="outline"
|
<Button
|
||||||
class="ml-auto h-[40px] w-[120px] rounded-md border-green-600 text-green-600 hover:bg-green-50">
|
variant="outline"
|
||||||
<Icon name="i-lucide-download" class="h-5 w-5" />
|
class="ml-auto h-[40px] w-[120px] rounded-md border-green-600 text-green-600 hover:bg-green-50"
|
||||||
|
>
|
||||||
|
<Icon
|
||||||
|
name="i-lucide-download"
|
||||||
|
class="h-5 w-5"
|
||||||
|
/>
|
||||||
Ekspor
|
Ekspor
|
||||||
</Button>
|
</Button>
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
@@ -123,13 +163,20 @@ onMounted(() => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<AppSepList v-if="!isLoading.dataListLoading" :data="data" @update:modelValue="handleRowSelected" />
|
<AppSepList
|
||||||
|
v-if="!isLoading.dataListLoading"
|
||||||
|
:data="dataFiltered"
|
||||||
|
@update:modelValue="handleRowSelected"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Pagination -->
|
<!-- Pagination -->
|
||||||
<template v-if="paginationMeta">
|
<template v-if="paginationMeta">
|
||||||
<div v-if="paginationMeta.totalPage > 1">
|
<div v-if="paginationMeta.totalPage > 1">
|
||||||
<PubMyUiPagination :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
<PubMyUiPagination
|
||||||
|
:pagination-meta="paginationMeta"
|
||||||
|
@page-change="handlePageChange"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -142,20 +189,39 @@ onMounted(() => {
|
|||||||
</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>
|
||||||
<p><strong>No. Kartu BPJS:</strong> {{ sepData.cardNumber }}</p>
|
<strong>No. SEP:</strong>
|
||||||
<p><strong>Nama Pasien:</strong> {{ sepData.patientName }}</p>
|
{{ sepData.sepNumber }}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<strong>No. Kartu BPJS:</strong>
|
||||||
|
{{ sepData.cardNumber }}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<strong>Nama Pasien:</strong>
|
||||||
|
{{ sepData.patientName }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<DialogFooter class="mt-6 flex justify-end gap-3">
|
<DialogFooter class="mt-6 flex justify-end gap-3">
|
||||||
<Button variant="outline" class="border-green-600 text-green-600 hover:bg-green-50" @click="() => {
|
<Button
|
||||||
recId = 0
|
variant="outline"
|
||||||
recAction = ''
|
class="border-green-600 text-green-600 hover:bg-green-50"
|
||||||
open = false
|
@click="
|
||||||
}">
|
() => {
|
||||||
|
recId = 0
|
||||||
|
recAction = ''
|
||||||
|
open = false
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
<X class="mr-1 h-4 w-4" />
|
<X class="mr-1 h-4 w-4" />
|
||||||
Tidak
|
Tidak
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="destructive" class="bg-red-600 hover:bg-red-700" @click="handleRemove">
|
<Button
|
||||||
|
variant="destructive"
|
||||||
|
class="bg-red-600 hover:bg-red-700"
|
||||||
|
@click="handleRemove"
|
||||||
|
>
|
||||||
<Check class="mr-1 h-4 w-4" />
|
<Check class="mr-1 h-4 w-4" />
|
||||||
Ya
|
Ya
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ export interface LinkItem {
|
|||||||
icon?: string
|
icon?: string
|
||||||
href?: string // to cover the needs of stating full external origins full url
|
href?: string // to cover the needs of stating full external origins full url
|
||||||
action?: string // for local paths
|
action?: string // for local paths
|
||||||
|
groups?: string[]
|
||||||
onClick?: (event: Event) => void
|
onClick?: (event: Event) => void
|
||||||
headerStatus?: boolean
|
headerStatus?: boolean
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { cn } from '~/lib/utils'
|
|||||||
|
|
||||||
import * as DE from '~/components/pub/my-ui/doc-entry'
|
import * as DE from '~/components/pub/my-ui/doc-entry'
|
||||||
|
|
||||||
const props = defineProps<{
|
interface Props {
|
||||||
fieldName: string
|
fieldName: string
|
||||||
label?: string
|
label?: string
|
||||||
placeholder?: string
|
placeholder?: string
|
||||||
@@ -21,6 +21,19 @@ const props = defineProps<{
|
|||||||
isRequired?: boolean
|
isRequired?: boolean
|
||||||
isDisabled?: boolean
|
isDisabled?: boolean
|
||||||
icons?: string
|
icons?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
label: '',
|
||||||
|
placeholder: 'Choose file...',
|
||||||
|
maxSizeMb: 1,
|
||||||
|
isDisabled: false,
|
||||||
|
isRequired: false,
|
||||||
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'update:modelValue', value: File | null): void
|
||||||
|
(e: 'fileSelected', file: File | null): void
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const hintMsg = computed(() => {
|
const hintMsg = computed(() => {
|
||||||
@@ -35,7 +48,26 @@ async function onFileChange(event: Event, handleChange: (value: any) => void) {
|
|||||||
const target = event.target as HTMLInputElement
|
const target = event.target as HTMLInputElement
|
||||||
const file = target.files?.[0]
|
const file = target.files?.[0]
|
||||||
|
|
||||||
|
if (!file) {
|
||||||
|
handleChange(null)
|
||||||
|
emit('update:modelValue', null)
|
||||||
|
emit('fileSelected', null)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate file size
|
||||||
|
const maxSizeBytes = props.maxSizeMb * 1024 * 1024
|
||||||
|
if (file.size > maxSizeBytes) {
|
||||||
|
console.warn(`File size exceeds ${props.maxSizeMb}MB limit`)
|
||||||
|
handleChange(null)
|
||||||
|
emit('update:modelValue', null)
|
||||||
|
emit('fileSelected', null)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
handleChange(file)
|
handleChange(file)
|
||||||
|
emit('update:modelValue', file)
|
||||||
|
emit('fileSelected', file)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -62,7 +94,7 @@ async function onFileChange(event: Event, handleChange: (value: any) => void) {
|
|||||||
@change="onFileChange($event, handleChange)"
|
@change="onFileChange($event, handleChange)"
|
||||||
type="file"
|
type="file"
|
||||||
:disabled="isDisabled"
|
:disabled="isDisabled"
|
||||||
v-bind="{ onBlur: componentField.onBlur }"
|
v-bind="{ onBlur: componentField.onBlur }"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
:class="cn('focus:border-primary focus:ring-2 focus:ring-primary focus:ring-offset-0')"
|
:class="cn('focus:border-primary focus:ring-2 focus:ring-primary focus:ring-offset-0')"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { toast } from '~/components/pub/ui/toast'
|
|||||||
import type { TreeItem } from '~/components/pub/my-ui/select-tree/type'
|
import type { TreeItem } from '~/components/pub/my-ui/select-tree/type'
|
||||||
import type { DataTableLoader } from '~/components/pub/my-ui/data-table/type'
|
import type { DataTableLoader } from '~/components/pub/my-ui/data-table/type'
|
||||||
import { paymentTypes, sepRefTypeCodes, participantGroups } from '~/lib/constants.vclaim'
|
import { paymentTypes, sepRefTypeCodes, participantGroups } from '~/lib/constants.vclaim'
|
||||||
|
import { genDoctor, type Doctor } from '~/models/doctor'
|
||||||
|
|
||||||
// Stores
|
// Stores
|
||||||
import { useUserStore } from '~/stores/user'
|
import { useUserStore } from '~/stores/user'
|
||||||
@@ -17,13 +18,15 @@ import {
|
|||||||
getList as getSpecialistList,
|
getList as getSpecialistList,
|
||||||
getValueTreeItems as getSpecialistTreeItems,
|
getValueTreeItems as getSpecialistTreeItems,
|
||||||
} from '~/services/specialist.service'
|
} from '~/services/specialist.service'
|
||||||
import { getValueLabelList as getDoctorValueLabelList } from '~/services/doctor.service'
|
import { getDetail as getDoctorDetail, getValueLabelList as getDoctorValueLabelList } from '~/services/doctor.service'
|
||||||
import {
|
import {
|
||||||
create as createEncounter,
|
create as createEncounter,
|
||||||
getDetail as getEncounterDetail,
|
getDetail as getEncounterDetail,
|
||||||
update as updateEncounter,
|
update as updateEncounter,
|
||||||
} from '~/services/encounter.service'
|
} from '~/services/encounter.service'
|
||||||
|
import { getList as getMemberList } from '~/services/vclaim-member.service'
|
||||||
import { getList as getSepList } from '~/services/vclaim-sep.service'
|
import { getList as getSepList } from '~/services/vclaim-sep.service'
|
||||||
|
import { uploadAttachment } from '~/services/supporting-document.service'
|
||||||
|
|
||||||
// Handlers
|
// Handlers
|
||||||
import {
|
import {
|
||||||
@@ -59,12 +62,14 @@ export function useEncounterEntry(props: {
|
|||||||
const encounterData = ref<any>(null)
|
const encounterData = ref<any>(null)
|
||||||
const formObjects = ref<any>({})
|
const formObjects = ref<any>({})
|
||||||
const isSepValid = ref(false)
|
const isSepValid = ref(false)
|
||||||
|
const isMemberValid = ref(false)
|
||||||
const isCheckingSep = ref(false)
|
const isCheckingSep = ref(false)
|
||||||
const sepNumber = ref('')
|
const sepNumber = ref('')
|
||||||
const vclaimReference = ref<any>(null)
|
const vclaimReference = ref<any>(null)
|
||||||
|
const sepFile = ref<File | null>(null)
|
||||||
|
const sippFile = ref<File | null>(null)
|
||||||
|
const selectedDoctor = ref<Doctor>(genDoctor())
|
||||||
const isEditMode = computed(() => props.id > 0)
|
const isEditMode = computed(() => props.id > 0)
|
||||||
|
|
||||||
const isSaveDisabled = computed(() => {
|
const isSaveDisabled = computed(() => {
|
||||||
return !selectedPatient.value || !selectedPatientObject.value || isSaving.value || isLoadingDetail.value
|
return !selectedPatient.value || !selectedPatientObject.value || isSaving.value || isLoadingDetail.value
|
||||||
})
|
})
|
||||||
@@ -73,15 +78,12 @@ export function useEncounterEntry(props: {
|
|||||||
if (props.classCode === 'ambulatory') {
|
if (props.classCode === 'ambulatory') {
|
||||||
return '/ambulatory/encounter'
|
return '/ambulatory/encounter'
|
||||||
}
|
}
|
||||||
// if (props.classCode === 'ambulatory' && props.subClassCode === 'reg') {
|
if (props.classCode === 'emergency') {
|
||||||
// return '/outpatient/encounter'
|
return '/emergency/encounter'
|
||||||
// }
|
}
|
||||||
// if (props.classCode === 'emergency') {
|
if (props.classCode === 'inpatient') {
|
||||||
// return '/emergency/encounter'
|
return '/inpatient/encounter'
|
||||||
// }
|
}
|
||||||
// if (props.classCode === 'inpatient') {
|
|
||||||
// return '/inpatient/encounter'
|
|
||||||
// }
|
|
||||||
return '/encounter'
|
return '/encounter'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,6 +203,34 @@ export function useEncounterEntry(props: {
|
|||||||
return { specialist_id: null, subspecialist_id: null }
|
return { specialist_id: null, subspecialist_id: null }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function getDoctorInfo(value: string) {
|
||||||
|
const resp = await getDoctorDetail(value, { includes: 'unit,specialist,subspecialist' })
|
||||||
|
if (resp.success) {
|
||||||
|
selectedDoctor.value = resp.body.data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getValidateMember(member: string) {
|
||||||
|
if (isCheckingSep.value) return
|
||||||
|
isMemberValid.value = false
|
||||||
|
try {
|
||||||
|
const result = await getMemberList({
|
||||||
|
mode: 'by-card',
|
||||||
|
number: member,
|
||||||
|
date: new Date().toISOString().split('T')[0],
|
||||||
|
})
|
||||||
|
if (result.success && result.body?.response !== null) {
|
||||||
|
const response = result.body?.response || {}
|
||||||
|
if (Object.keys(response).length > 0) {
|
||||||
|
formObjects.value.nationalIdentity = response.peserta?.nik || ''
|
||||||
|
}
|
||||||
|
isMemberValid.value = result.body?.metaData?.code === '200'
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error checking member:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function getValidateSepNumber(sepNumberValue: string) {
|
async function getValidateSepNumber(sepNumberValue: string) {
|
||||||
vclaimReference.value = null
|
vclaimReference.value = null
|
||||||
if (!sepNumberValue || sepNumberValue.trim() === '') {
|
if (!sepNumberValue || sepNumberValue.trim() === '') {
|
||||||
@@ -220,19 +250,25 @@ export function useEncounterEntry(props: {
|
|||||||
formObjects.value.medicalRecordNumber = response.peserta?.noMr || '-'
|
formObjects.value.medicalRecordNumber = response.peserta?.noMr || '-'
|
||||||
formObjects.value.cardNumber = response.peserta?.noKartu || '-'
|
formObjects.value.cardNumber = response.peserta?.noKartu || '-'
|
||||||
formObjects.value.registerDate = response.tglSep || null
|
formObjects.value.registerDate = response.tglSep || null
|
||||||
|
formObjects.value.sepReference = response.noSep || '-'
|
||||||
|
formObjects.value.sepControlDate = response.tglSep || null
|
||||||
|
formObjects.value.sepTrafficStatus = response.nmstatusKecelakaan || '-'
|
||||||
|
formObjects.value.diagnosis = response.diagnosa || '-'
|
||||||
vclaimReference.value = {
|
vclaimReference.value = {
|
||||||
noSep: response.noSep || sepNumberValue.trim(),
|
noSep: response.noSep || sepNumberValue.trim(),
|
||||||
tglRujukan: response.tglSep ? new Date(response.tglSep).toISOString() : null,
|
tglRujukan: response.tglSep ? new Date(response.tglSep).toISOString() : null,
|
||||||
ppkDirujuk: response.noRujukan || 'rssa',
|
ppkDirujuk: response.noRujukan || 'rssa',
|
||||||
jnsPelayanan: response.jnsPelayanan === 'Rawat Jalan' ? '2' : response.jnsPelayanan === 'Rawat Inap' ? '1' : null,
|
jnsPelayanan:
|
||||||
|
response.jnsPelayanan === 'Rawat Jalan' ? '2' : response.jnsPelayanan === 'Rawat Inap' ? '1' : null,
|
||||||
catatan: response.catatan || '',
|
catatan: response.catatan || '',
|
||||||
diagRujukan: response.diagnosa || '',
|
diagRujukan: response.diagnosa || '',
|
||||||
tipeRujukan: response.tujuanKunj?.kode ?? '0',
|
tipeRujukan: response.tujuanKunj?.kode ?? '0',
|
||||||
poliRujukan: response.poli || '',
|
poliRujukan: response.poli || '',
|
||||||
user: '',
|
user: userStore.user?.user_name || '',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
isSepValid.value = result.body?.metaData?.code === '200'
|
isSepValid.value = result.body?.metaData?.code === '200'
|
||||||
|
isMemberValid.value = isSepValid.value
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error checking SEP:', error)
|
console.error('Error checking SEP:', error)
|
||||||
@@ -305,7 +341,7 @@ export function useEncounterEntry(props: {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadEncounterDetail() {
|
async function getFetchEncounterDetail() {
|
||||||
if (!isEditMode.value || props.id <= 0) {
|
if (!isEditMode.value || props.id <= 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -313,22 +349,23 @@ export function useEncounterEntry(props: {
|
|||||||
try {
|
try {
|
||||||
isLoadingDetail.value = true
|
isLoadingDetail.value = true
|
||||||
const result = await getEncounterDetail(props.id, {
|
const result = await getEncounterDetail(props.id, {
|
||||||
includes: 'patient,patient-person,specialist,subspecialist',
|
includes: 'patient,patient-person,specialist,subspecialist,Appointment_Doctor,EncounterDocuments',
|
||||||
})
|
})
|
||||||
|
|
||||||
if (result.success && result.body?.data) {
|
if (result.success && result.body?.data) {
|
||||||
encounterData.value = result.body.data
|
encounterData.value = result.body.data
|
||||||
await mapEncounterToForm(encounterData.value)
|
await mapEncounterToForm(encounterData.value)
|
||||||
isLoadingDetail.value = false
|
isLoadingDetail.value = false
|
||||||
} else {
|
} else {
|
||||||
|
const errorMsg = result.body?.message || 'Gagal memuat data kunjungan'
|
||||||
toast({
|
toast({
|
||||||
title: 'Gagal',
|
title: 'Gagal',
|
||||||
description: 'Gagal memuat data kunjungan',
|
description: errorMsg,
|
||||||
variant: 'destructive',
|
variant: 'destructive',
|
||||||
})
|
})
|
||||||
await navigateTo(getListPath())
|
await navigateTo(getListPath())
|
||||||
}
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error('Error loading encounter detail:', error)
|
|
||||||
toast({
|
toast({
|
||||||
title: 'Gagal',
|
title: 'Gagal',
|
||||||
description: error?.message || 'Gagal memuat data kunjungan',
|
description: error?.message || 'Gagal memuat data kunjungan',
|
||||||
@@ -362,9 +399,10 @@ export function useEncounterEntry(props: {
|
|||||||
formData.medicalRecordNumber = selectedPatientObject.value.number || ''
|
formData.medicalRecordNumber = selectedPatientObject.value.number || ''
|
||||||
}
|
}
|
||||||
|
|
||||||
const doctorId = encounter.appointment_doctor_id || encounter.responsible_doctor_id
|
const doctorCode = encounter.appointment_doctor_code || encounter.responsible_doctor_code
|
||||||
if (doctorId) {
|
if (doctorCode) {
|
||||||
formData.doctorId = String(doctorId)
|
formData.doctorCode = String(doctorCode)
|
||||||
|
await getDoctorInfo(doctorCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (encounter.subspecialist_id) {
|
if (encounter.subspecialist_id) {
|
||||||
@@ -390,12 +428,14 @@ export function useEncounterEntry(props: {
|
|||||||
if (encounter.registeredAt) {
|
if (encounter.registeredAt) {
|
||||||
const date = new Date(encounter.registeredAt)
|
const date = new Date(encounter.registeredAt)
|
||||||
formData.registerDate = date.toISOString().split('T')[0]
|
formData.registerDate = date.toISOString().split('T')[0]
|
||||||
} else if (encounter.visitDate) {
|
}
|
||||||
|
if (encounter.visitDate) {
|
||||||
const date = new Date(encounter.visitDate)
|
const date = new Date(encounter.visitDate)
|
||||||
formData.registerDate = date.toISOString().split('T')[0]
|
formData.registerDate = date.toISOString().split('T')[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (encounter.paymentMethod_code) {
|
if (encounter.paymentMethod_code) {
|
||||||
|
formData.paymentMethodCode = encounter.paymentMethod_code
|
||||||
if (encounter.paymentMethod_code === 'insurance') {
|
if (encounter.paymentMethod_code === 'insurance') {
|
||||||
formData.paymentType = 'jkn'
|
formData.paymentType = 'jkn'
|
||||||
} else {
|
} else {
|
||||||
@@ -412,7 +452,15 @@ export function useEncounterEntry(props: {
|
|||||||
|
|
||||||
formData.cardNumber = encounter.member_number || ''
|
formData.cardNumber = encounter.member_number || ''
|
||||||
formData.sepNumber = encounter.ref_number || ''
|
formData.sepNumber = encounter.ref_number || ''
|
||||||
formObjects.value = formData
|
formData.sepType = encounter.sep_type || ''
|
||||||
|
formData.patientCategory = encounter.participant_group_code || ''
|
||||||
|
|
||||||
|
// Map BPJS reference data if available
|
||||||
|
if (encounter.vclaimReference) {
|
||||||
|
formData.sepReference = encounter.vclaimReference?.noSep || ''
|
||||||
|
} else if (encounter.ref_number) {
|
||||||
|
formData.sepReference = encounter.ref_number
|
||||||
|
}
|
||||||
|
|
||||||
if (formData.sepNumber) {
|
if (formData.sepNumber) {
|
||||||
sepNumber.value = formData.sepNumber
|
sepNumber.value = formData.sepNumber
|
||||||
@@ -420,6 +468,8 @@ export function useEncounterEntry(props: {
|
|||||||
if (formData.subSpecialistId) {
|
if (formData.subSpecialistId) {
|
||||||
await handleFetchDoctors(formData.subSpecialistId)
|
await handleFetchDoctors(formData.subSpecialistId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
formObjects.value = { ...formData }
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleSaveEncounter(formValues: any) {
|
async function handleSaveEncounter(formValues: any) {
|
||||||
@@ -434,7 +484,7 @@ export function useEncounterEntry(props: {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
isSaving.value = true
|
isSaving.value = true
|
||||||
|
const isAdmin = false
|
||||||
const employeeId = userStore.user?.employee_id || userStore.user?.employee?.id || 0
|
const employeeId = userStore.user?.employee_id || userStore.user?.employee?.id || 0
|
||||||
|
|
||||||
const formatDate = (dateString: string): string => {
|
const formatDate = (dateString: string): string => {
|
||||||
@@ -499,19 +549,17 @@ export function useEncounterEntry(props: {
|
|||||||
if (paymentMethodCode === 'insurance') {
|
if (paymentMethodCode === 'insurance') {
|
||||||
payload.insuranceCompany_id = formValues.insuranceCompany_id ?? null
|
payload.insuranceCompany_id = formValues.insuranceCompany_id ?? null
|
||||||
if (memberNumber) payload.member_number = memberNumber
|
if (memberNumber) payload.member_number = memberNumber
|
||||||
if (refNumber) payload.ref_number = refNumber
|
// if (refNumber) payload.ref_number = refNumber
|
||||||
if (formValues.refTypeCode) payload.refTypeCode = formValues.refTypeCode
|
if (formValues.refTypeCode) payload.refTypeCode = formValues.refTypeCode
|
||||||
if (formValues.vclaimReference) payload.vclaimReference = formValues.vclaimReference
|
if (formValues.vclaimReference) payload.vclaimReference = formValues.vclaimReference
|
||||||
} else {
|
} else {
|
||||||
if (paymentMethodCode === 'membership' && memberNumber) {
|
if (paymentMethodCode === 'membership' && memberNumber) {
|
||||||
payload.member_number = memberNumber
|
payload.member_number = memberNumber
|
||||||
}
|
}
|
||||||
if (refNumber) {
|
// if (refNumber) payload.ref_number = refNumber
|
||||||
payload.ref_number = refNumber
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.classCode === 'ambulatory') {
|
if (isAdmin && props.classCode === 'ambulatory') {
|
||||||
payload.visitMode_code = 'adm'
|
payload.visitMode_code = 'adm'
|
||||||
payload.allocatedVisitCount = 0
|
payload.allocatedVisitCount = 0
|
||||||
}
|
}
|
||||||
@@ -520,19 +568,35 @@ export function useEncounterEntry(props: {
|
|||||||
if (isEditMode.value) {
|
if (isEditMode.value) {
|
||||||
result = await updateEncounter(props.id, payload)
|
result = await updateEncounter(props.id, payload)
|
||||||
} else {
|
} else {
|
||||||
|
console.log('💾 [ADD MODE] Sending POST request:', { payload })
|
||||||
result = await createEncounter(payload)
|
result = await createEncounter(payload)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
|
console.log(result)
|
||||||
|
console.log(sepFile.value)
|
||||||
|
console.log(sippFile.value)
|
||||||
|
// const encounterId = isEditMode.value ? props.id : result.body?.data?.id
|
||||||
|
if (patientId) {
|
||||||
|
if (sepFile.value) {
|
||||||
|
await uploadAttachment(sepFile.value, patientId, 'vclaim-sep')
|
||||||
|
}
|
||||||
|
if (sippFile.value) {
|
||||||
|
await uploadAttachment(sippFile.value, patientId, 'vclaim-sipp')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: 'Berhasil',
|
title: 'Berhasil',
|
||||||
description: isEditMode.value ? 'Kunjungan berhasil diperbarui' : 'Kunjungan berhasil dibuat',
|
description: isEditMode.value ? 'Kunjungan berhasil diperbarui' : 'Kunjungan berhasil dibuat',
|
||||||
variant: 'default',
|
variant: 'default',
|
||||||
})
|
})
|
||||||
|
console.log('✅ [SAVE] Success - Redirecting to list page')
|
||||||
await navigateTo(getListPath())
|
await navigateTo(getListPath())
|
||||||
} else {
|
} else {
|
||||||
const errorMessage =
|
const errorMessage =
|
||||||
result.body?.message || (isEditMode.value ? 'Gagal memperbarui kunjungan' : 'Gagal membuat kunjungan')
|
result.body?.message || (isEditMode.value ? 'Gagal memperbarui kunjungan' : 'Gagal membuat kunjungan')
|
||||||
|
console.error('❌ [SAVE] Failed:', errorMessage)
|
||||||
toast({
|
toast({
|
||||||
title: 'Gagal',
|
title: 'Gagal',
|
||||||
description: errorMessage,
|
description: errorMessage,
|
||||||
@@ -540,7 +604,7 @@ export function useEncounterEntry(props: {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error('Error saving encounter:', error)
|
console.error('❌ [SAVE] Error saving encounter:', error)
|
||||||
toast({
|
toast({
|
||||||
title: 'Gagal',
|
title: 'Gagal',
|
||||||
description: error?.message || (isEditMode.value ? 'Gagal memperbarui kunjungan' : 'Gagal membuat kunjungan'),
|
description: error?.message || (isEditMode.value ? 'Gagal memperbarui kunjungan' : 'Gagal membuat kunjungan'),
|
||||||
@@ -556,6 +620,8 @@ export function useEncounterEntry(props: {
|
|||||||
paymentsList,
|
paymentsList,
|
||||||
sepsList,
|
sepsList,
|
||||||
sepNumber,
|
sepNumber,
|
||||||
|
sepFile,
|
||||||
|
sippFile,
|
||||||
participantGroupsList,
|
participantGroupsList,
|
||||||
specialistsTree,
|
specialistsTree,
|
||||||
doctorsList,
|
doctorsList,
|
||||||
@@ -565,15 +631,17 @@ export function useEncounterEntry(props: {
|
|||||||
encounterData,
|
encounterData,
|
||||||
formObjects,
|
formObjects,
|
||||||
openPatient,
|
openPatient,
|
||||||
|
isMemberValid,
|
||||||
isSepValid,
|
isSepValid,
|
||||||
isCheckingSep,
|
isCheckingSep,
|
||||||
isEditMode,
|
isEditMode,
|
||||||
isSaveDisabled,
|
isSaveDisabled,
|
||||||
isLoading,
|
isLoading,
|
||||||
|
selectedDoctor,
|
||||||
selectedPatient,
|
selectedPatient,
|
||||||
selectedPatientObject,
|
selectedPatientObject,
|
||||||
paginationMeta,
|
paginationMeta,
|
||||||
loadEncounterDetail,
|
getFetchEncounterDetail,
|
||||||
mapEncounterToForm,
|
mapEncounterToForm,
|
||||||
toKebabCase,
|
toKebabCase,
|
||||||
toNavigateSep,
|
toNavigateSep,
|
||||||
@@ -585,6 +653,8 @@ export function useEncounterEntry(props: {
|
|||||||
getPatientsList,
|
getPatientsList,
|
||||||
getPatientCurrent,
|
getPatientCurrent,
|
||||||
getPatientByIdentifierSearch,
|
getPatientByIdentifierSearch,
|
||||||
|
getDoctorInfo,
|
||||||
|
getValidateMember,
|
||||||
getValidateSepNumber,
|
getValidateSepNumber,
|
||||||
handleFetchSpecialists,
|
handleFetchSpecialists,
|
||||||
handleFetchDoctors,
|
handleFetchDoctors,
|
||||||
|
|||||||
@@ -0,0 +1,127 @@
|
|||||||
|
import { ref, computed } from 'vue'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
|
import { toast } from '~/components/pub/ui/toast'
|
||||||
|
import { getList as getSepList } from '~/services/vclaim-sep.service'
|
||||||
|
import { getList as getMemberList } from '~/services/vclaim-member.service'
|
||||||
|
|
||||||
|
export function useIntegrationSepDetail() {
|
||||||
|
const route = useRoute()
|
||||||
|
const isLoading = ref(false)
|
||||||
|
const sepData = ref<any>(null)
|
||||||
|
const valueObjects = ref<any>({})
|
||||||
|
|
||||||
|
const noSep = computed(() => {
|
||||||
|
return typeof route.params.id === 'string' ? route.params.id : ''
|
||||||
|
})
|
||||||
|
|
||||||
|
async function getSepDetail() {
|
||||||
|
if (!noSep.value) {
|
||||||
|
toast({
|
||||||
|
title: 'Gagal',
|
||||||
|
description: 'No SEP tidak ditemukan di URL',
|
||||||
|
variant: 'destructive',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
isLoading.value = true
|
||||||
|
const result = await getSepList({ number: noSep.value })
|
||||||
|
|
||||||
|
if (result.success && result.body?.response) {
|
||||||
|
const response = result.body.response
|
||||||
|
sepData.value = response
|
||||||
|
valueObjects.value = {
|
||||||
|
sepNumber: response.noSep || noSep.value,
|
||||||
|
eSep: response.eSEP === 'True' ? 'yes' : 'no',
|
||||||
|
serviceType:
|
||||||
|
response.jnsPelayanan === 'Rawat Jalan' ? '2' : response.jnsPelayanan === 'Rawat Inap' ? '1' : null,
|
||||||
|
sepDate: response.tglSep ? new Date(response.tglSep).toISOString().split('T')[0] : '',
|
||||||
|
cardNumber: response.peserta?.noKartu || '-',
|
||||||
|
patientName: response.peserta?.nama || '-',
|
||||||
|
phoneNumber: response.peserta?.noTelp || '-',
|
||||||
|
medicalRecordNumber: response.peserta?.noMr || '-',
|
||||||
|
memberInsurance: response.peserta?.asuransi || '-',
|
||||||
|
memberClass: response.peserta?.hakKelas || '-',
|
||||||
|
memberGender: response.peserta?.kelamin || '-',
|
||||||
|
memberBirthDate: response.peserta?.tglLahir || '-',
|
||||||
|
memberType: response.peserta?.jnsPeserta || '-',
|
||||||
|
referralLetterNumber: response.noRujukan || '-',
|
||||||
|
diagnosisName: response.diagnosa || '-',
|
||||||
|
attendingDoctor: response.dpjp?.kdDPJP || '-',
|
||||||
|
attendingDoctorName: response.dpjp?.nmDPJP || '-',
|
||||||
|
polyName: response.poli || '-',
|
||||||
|
cob: response.cob === '1' ? 'yes' : 'no',
|
||||||
|
cataract: response.katarak === '1' ? 'yes' : 'no',
|
||||||
|
clinicExcecutive: response.poliEksekutif === '1' ? 'yes' : 'no',
|
||||||
|
procedureType: response.flagProcedure?.kode || '-',
|
||||||
|
procedureTypeName: response.flagProcedure?.nama || '-',
|
||||||
|
supportCode: response.kdPenunjang?.kode || '-',
|
||||||
|
supportCodeName: response.kdPenunjang?.nama || '-',
|
||||||
|
note: response.catatan || response.informasi || '-',
|
||||||
|
classLevel: response.kelasRawat || '-',
|
||||||
|
classLevelUpgrade: response.klsRawat?.klsRawatNaik || '-',
|
||||||
|
classPaySource: response.klsRawat?.pembiayaan || '-',
|
||||||
|
responsiblePerson: response.klsRawat?.penanggungJawab || response.penjamin || '-',
|
||||||
|
purposeOfVisit: response.tujuanKunj?.kode || '-',
|
||||||
|
purposeOfVisitName: response.tujuanKunj?.nama || '-',
|
||||||
|
serviceAssessment: response.assestmenPel?.kode || '-',
|
||||||
|
serviceAssessmentName: response.assestmenPel?.nama || '-',
|
||||||
|
trafficAccident: response.kdStatusKecelakaan || '',
|
||||||
|
trafficAccidentName: response.nmstatusKecelakaan || '',
|
||||||
|
lpNumber: response.kontrol?.noSurat || '-',
|
||||||
|
accidentDate: response.lokasiKejadian?.tglKejadian || '-',
|
||||||
|
accidentNote: response.lokasiKejadian?.ketKejadian || '-',
|
||||||
|
accidentProvince: response.lokasiKejadian?.kdProp || '-',
|
||||||
|
accidentCity: response.lokasiKejadian?.kdKab || '-',
|
||||||
|
accidentDistrict: response.lokasiKejadian?.kdKec || '-',
|
||||||
|
accidentLocation: response.lokasiKejadian?.lokasi || '-',
|
||||||
|
suplesi: response.jnsPelayanan === 'Rawat Jalan' ? 'yes' : 'no',
|
||||||
|
suplesiNumber: response.jnsPelayanan === 'Rawat Jalan' ? response.noRujukan || '-' : '-',
|
||||||
|
controlLetterNumber: response.kontrol?.noSurat || '-',
|
||||||
|
controlLetterDoctor: response.kontrol?.kdDokter || '-',
|
||||||
|
controlLetterDoctorName: response.kontrol?.nmDokter || '-',
|
||||||
|
}
|
||||||
|
if (valueObjects.value?.cardNumber !== '-') {
|
||||||
|
const resultMember = await getMemberList({
|
||||||
|
mode: 'by-card',
|
||||||
|
number: valueObjects.value.cardNumber,
|
||||||
|
date: new Date().toISOString().substring(0, 10),
|
||||||
|
})
|
||||||
|
if (resultMember && resultMember.success && resultMember.body) {
|
||||||
|
const memberRaws = resultMember.body?.response || null
|
||||||
|
valueObjects.value['nationalIdentity'] = memberRaws?.peserta?.nik || ''
|
||||||
|
valueObjects.value['phoneNumber'] = memberRaws?.peserta?.mr?.noTelepon || ''
|
||||||
|
valueObjects.value['classLevel'] = memberRaws?.peserta?.hakKelas?.kode || ''
|
||||||
|
valueObjects.value['status'] = memberRaws?.statusPeserta?.kode || ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
toast({
|
||||||
|
title: 'Gagal',
|
||||||
|
description: 'Data SEP tidak ditemukan',
|
||||||
|
variant: 'destructive',
|
||||||
|
})
|
||||||
|
await navigateTo('/integration/bpjs-vclaim/sep')
|
||||||
|
}
|
||||||
|
} catch (error: any) {
|
||||||
|
console.error('Error loading SEP detail:', error)
|
||||||
|
toast({
|
||||||
|
title: 'Gagal',
|
||||||
|
description: error?.message || 'Gagal memuat data SEP',
|
||||||
|
variant: 'destructive',
|
||||||
|
})
|
||||||
|
await navigateTo('/integration/bpjs-vclaim/sep')
|
||||||
|
} finally {
|
||||||
|
isLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
isLoading,
|
||||||
|
noSep,
|
||||||
|
sepData,
|
||||||
|
valueObjects,
|
||||||
|
getSepDetail,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -54,6 +54,7 @@ export function useIntegrationSepEntry() {
|
|||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
|
const recSepId = ref<number | null>(null)
|
||||||
const openPatient = ref(false)
|
const openPatient = ref(false)
|
||||||
const openLetter = ref(false)
|
const openLetter = ref(false)
|
||||||
const openHistory = ref(false)
|
const openHistory = ref(false)
|
||||||
@@ -87,6 +88,7 @@ export function useIntegrationSepEntry() {
|
|||||||
const specialistsTree = ref<TreeItem[]>([])
|
const specialistsTree = ref<TreeItem[]>([])
|
||||||
const resourceType = ref('')
|
const resourceType = ref('')
|
||||||
const resourcePath = ref('')
|
const resourcePath = ref('')
|
||||||
|
const encounterId = ref<number | string | null>(null)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map letter data to form fields for save-sep
|
* Map letter data to form fields for save-sep
|
||||||
@@ -176,17 +178,17 @@ export function useIntegrationSepEntry() {
|
|||||||
return mappedValues
|
return mappedValues
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getMonitoringHistoryMappers() {
|
async function getMonitoringHistoryMappers(number: string | null = null) {
|
||||||
histories.value = []
|
histories.value = []
|
||||||
const dateFirst = new Date()
|
const dateFirst = new Date()
|
||||||
const dateLast = new Date()
|
const dateLast = new Date()
|
||||||
dateLast.setMonth(dateFirst.getMonth() - 3)
|
dateLast.setMonth(dateFirst.getMonth() - 2) // max 90 days
|
||||||
const cardNumber =
|
const cardNumber =
|
||||||
selectedPatientObject.value?.person?.residentIdentityNumber || selectedPatientObject.value?.number || ''
|
selectedPatientObject.value?.person?.residentIdentityNumber || selectedPatientObject.value?.number || number || ''
|
||||||
const result = await getMonitoringHistoryList({
|
const result = await getMonitoringHistoryList({
|
||||||
cardNumber: cardNumber,
|
cardNumber: cardNumber,
|
||||||
startDate: dateFirst.toISOString().substring(0, 10),
|
startDate: dateLast.toISOString().substring(0, 10),
|
||||||
endDate: dateLast.toISOString().substring(0, 10),
|
endDate: dateFirst.toISOString().substring(0, 10),
|
||||||
})
|
})
|
||||||
if (result && result.success && result.body) {
|
if (result && result.success && result.body) {
|
||||||
const historiesRaw = result.body?.response?.histori || []
|
const historiesRaw = result.body?.response?.histori || []
|
||||||
@@ -441,6 +443,10 @@ export function useIntegrationSepEntry() {
|
|||||||
if (menu === 'back') {
|
if (menu === 'back') {
|
||||||
navigateTo('/integration/bpjs-vclaim/sep')
|
navigateTo('/integration/bpjs-vclaim/sep')
|
||||||
}
|
}
|
||||||
|
if (menu === 'save-sep-number') {
|
||||||
|
const sourcePath = route.query['source-path'] || ('' as any)
|
||||||
|
navigateTo({ path: sourcePath, query: { 'sep-number': value.sepNumber || '' } })
|
||||||
|
}
|
||||||
if (menu === 'save-sep') {
|
if (menu === 'save-sep') {
|
||||||
isSaveLoading.value = true
|
isSaveLoading.value = true
|
||||||
|
|
||||||
@@ -481,22 +487,33 @@ export function useIntegrationSepEntry() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mappedValues.userName = userStore.user?.user_name || ''
|
mappedValues.userName = userStore.user?.user_name || ''
|
||||||
|
const payload = { ...makeSepData(mappedValues), encounterId: encounterId.value || null }
|
||||||
|
|
||||||
createSep(makeSepData(mappedValues))
|
createSep(payload)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const body = res?.body
|
const success = res?.success
|
||||||
const code = body?.metaData?.code
|
if (success) {
|
||||||
const message = body?.metaData?.message
|
const body = res?.body
|
||||||
if (code && code !== '200') {
|
const code = body?.metaData?.code
|
||||||
toast({ title: 'Gagal', description: message || 'Gagal membuat SEP', variant: 'destructive' })
|
const message = body?.metaData?.message
|
||||||
|
if (code && code !== '200') {
|
||||||
|
toast({ title: 'Gagal', description: message || 'Gagal membuat SEP', variant: 'destructive' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
toast({ title: 'Berhasil', description: 'SEP berhasil dibuat', variant: 'default' })
|
||||||
|
if (!!resourcePath.value) {
|
||||||
|
navigateTo({ path: resourcePath.value, query: { 'sep-number': body?.response?.sep?.noSep || '-' } })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
navigateTo('/integration/bpjs-vclaim/sep')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
toast({ title: 'Berhasil', description: 'SEP berhasil dibuat', variant: 'default' })
|
const error = res?.error
|
||||||
if (!!resourcePath.value) {
|
if (error) {
|
||||||
navigateTo({ path: resourcePath.value, query: { 'sep-number': body?.response?.sep?.noSep || '-' } })
|
const errorMessage = error?.message ? `${error?.message}` : 'Sep gagal dibuat'
|
||||||
|
toast({ title: 'Gagal', description: errorMessage, variant: 'destructive' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
navigateTo('/integration/bpjs-vclaim/sep')
|
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error('Failed to save SEP:', err)
|
console.error('Failed to save SEP:', err)
|
||||||
@@ -609,6 +626,7 @@ export function useIntegrationSepEntry() {
|
|||||||
const queries = route.query as any
|
const queries = route.query as any
|
||||||
isServiceHidden.value = queries['is-service'] === 'true'
|
isServiceHidden.value = queries['is-service'] === 'true'
|
||||||
selectedObjects.value = {}
|
selectedObjects.value = {}
|
||||||
|
if (queries['encounter-id']) encounterId.value = queries['encounter-id']
|
||||||
if (queries['resource']) resourceType.value = queries['resource']
|
if (queries['resource']) resourceType.value = queries['resource']
|
||||||
if (queries['source-path']) resourcePath.value = queries['source-path']
|
if (queries['source-path']) resourcePath.value = queries['source-path']
|
||||||
if (queries['doctor-code']) selectedObjects.value['doctorCode'] = queries['doctor-code']
|
if (queries['doctor-code']) selectedObjects.value['doctorCode'] = queries['doctor-code']
|
||||||
@@ -624,18 +642,18 @@ export function useIntegrationSepEntry() {
|
|||||||
await getPatientInternalMappers(queries['patient-id'])
|
await getPatientInternalMappers(queries['patient-id'])
|
||||||
}
|
}
|
||||||
if (queries['card-number']) {
|
if (queries['card-number']) {
|
||||||
const resultMember = await getMemberList({
|
await getMemberList({
|
||||||
mode: 'by-card',
|
mode: 'by-card',
|
||||||
number: queries['card-number'],
|
number: queries['card-number'],
|
||||||
date: new Date().toISOString().substring(0, 10),
|
date: new Date().toISOString().substring(0, 10),
|
||||||
})
|
})
|
||||||
console.log(resultMember)
|
|
||||||
}
|
}
|
||||||
delete selectedObjects.value['is-service']
|
delete selectedObjects.value['is-service']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
recSepId,
|
||||||
openPatient,
|
openPatient,
|
||||||
openLetter,
|
openLetter,
|
||||||
openHistory,
|
openHistory,
|
||||||
@@ -669,6 +687,7 @@ export function useIntegrationSepEntry() {
|
|||||||
specialistsTree,
|
specialistsTree,
|
||||||
resourceType,
|
resourceType,
|
||||||
resourcePath,
|
resourcePath,
|
||||||
|
encounterId,
|
||||||
patients,
|
patients,
|
||||||
selectedPatient,
|
selectedPatient,
|
||||||
paginationMeta,
|
paginationMeta,
|
||||||
@@ -687,5 +706,3 @@ export function useIntegrationSepEntry() {
|
|||||||
handleInit,
|
handleInit,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default useIntegrationSepEntry
|
|
||||||
@@ -14,7 +14,7 @@ import { getFormatDateId } from '~/lib/date'
|
|||||||
import { downloadCsv, downloadXls } from '~/lib/download'
|
import { downloadCsv, downloadXls } from '~/lib/download'
|
||||||
import { serviceTypes } from '~/lib/constants.vclaim'
|
import { serviceTypes } from '~/lib/constants.vclaim'
|
||||||
import { getList as geMonitoringVisitList } from '~/services/vclaim-monitoring-visit.service'
|
import { getList as geMonitoringVisitList } from '~/services/vclaim-monitoring-visit.service'
|
||||||
import { remove as removeSepData, makeSepDataForRemove } from '~/services/vclaim-sep.service'
|
import { remove as removeSepData, removeOld as removeSepDataOld, makeSepDataForRemove } from '~/services/vclaim-sep.service'
|
||||||
|
|
||||||
const headerKeys = [
|
const headerKeys = [
|
||||||
'letterDate',
|
'letterDate',
|
||||||
@@ -224,10 +224,11 @@ export function useIntegrationSepList() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleRemove = async () => {
|
const handleRemove = async () => {
|
||||||
|
const isNew = true;
|
||||||
try {
|
try {
|
||||||
const result = await removeSepData(
|
const result = !isNew ? await removeSepDataOld(
|
||||||
makeSepDataForRemove({ ...sepData.value, userName: userStore.user?.user_name }),
|
makeSepDataForRemove({ ...sepData.value, userName: userStore.user?.user_name }),
|
||||||
)
|
) : await removeSepData(sepData.value.sepNumber || '')
|
||||||
const backendMessage = result?.body?.message || result?.message || null
|
const backendMessage = result?.body?.message || result?.message || null
|
||||||
const backendStatus = result?.body?.status || result?.status || null
|
const backendStatus = result?.body?.status || result?.status || null
|
||||||
|
|
||||||
@@ -280,5 +281,3 @@ export function useIntegrationSepList() {
|
|||||||
handleRemove,
|
handleRemove,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default useIntegrationSepList
|
|
||||||
@@ -344,6 +344,8 @@ export const uploadCode: Record<string, string> = {
|
|||||||
kk: 'person-family-card',
|
kk: 'person-family-card',
|
||||||
paspor: 'person-passport',
|
paspor: 'person-passport',
|
||||||
'mcu-report': 'mcu-item-result',
|
'mcu-report': 'mcu-item-result',
|
||||||
|
'vclaim-sep': 'vclaim-sep',
|
||||||
|
'vclaim-sipp': 'vclaim-sipp',
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export type UploadCodeKey = keyof typeof uploadCode
|
export type UploadCodeKey = keyof typeof uploadCode
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
import type { Permission } from '~/models/role'
|
||||||
|
|
||||||
|
export function usePageChecker() {
|
||||||
|
const route = useRoute()
|
||||||
|
const { checkRole, hasCreateAccess, hasReadAccess, hasUpdateAccess, hasDeleteAccess } = useRBAC()
|
||||||
|
|
||||||
|
function getRouteTitle() {
|
||||||
|
return route.meta.title as string
|
||||||
|
}
|
||||||
|
|
||||||
|
function getParamsId() {
|
||||||
|
const id = route.params.id
|
||||||
|
return typeof id === 'string' ? parseInt(id) : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function getPageAccess(
|
||||||
|
roleAccess: Record<string, Permission[]>,
|
||||||
|
type: 'create' | 'read' | 'update' | 'delete',
|
||||||
|
) {
|
||||||
|
// Check if user has access to this page, need to use try - catch for proper handling
|
||||||
|
const hasAccess = checkRole(roleAccess)
|
||||||
|
if (!hasAccess) {
|
||||||
|
navigateTo('/403')
|
||||||
|
}
|
||||||
|
|
||||||
|
// Define permission-based computed properties
|
||||||
|
const canCreate = hasCreateAccess(roleAccess)
|
||||||
|
const canRead = hasReadAccess(roleAccess)
|
||||||
|
const canUpdate = hasUpdateAccess(roleAccess)
|
||||||
|
const canDelete = hasDeleteAccess(roleAccess)
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case 'create':
|
||||||
|
return canCreate
|
||||||
|
case 'read':
|
||||||
|
return canRead
|
||||||
|
case 'update':
|
||||||
|
return canUpdate
|
||||||
|
case 'delete':
|
||||||
|
return canDelete
|
||||||
|
default:
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
checkRole,
|
||||||
|
hasCreateAccess,
|
||||||
|
hasReadAccess,
|
||||||
|
hasUpdateAccess,
|
||||||
|
hasDeleteAccess,
|
||||||
|
getRouteTitle,
|
||||||
|
getParamsId,
|
||||||
|
getPageAccess
|
||||||
|
}
|
||||||
|
}
|
||||||
+16
-17
@@ -1,9 +1,19 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// Types & Consts
|
||||||
import type { Permission } from '~/models/role'
|
import type { Permission } from '~/models/role'
|
||||||
import { permissions } from '~/const/page-permission/ambulatory'
|
import { permissions } from '~/const/page-permission/ambulatory'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { usePageChecker } from "~/lib/page-checker"
|
||||||
|
|
||||||
|
// Pubs
|
||||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
|
|
||||||
|
// Apps
|
||||||
import Content from '~/components/content/encounter/detail.vue'
|
import Content from '~/components/content/encounter/detail.vue'
|
||||||
|
|
||||||
|
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: ['rbac'],
|
middleware: ['rbac'],
|
||||||
roles: ['emp|doc', 'emp|nur', 'emp|reg', 'emp|pha', 'emp|pay', 'emp|mng'],
|
roles: ['emp|doc', 'emp|nur', 'emp|reg', 'emp|pha', 'emp|pay', 'emp|mng'],
|
||||||
@@ -11,28 +21,17 @@ definePageMeta({
|
|||||||
contentFrame: 'cf-full-width',
|
contentFrame: 'cf-full-width',
|
||||||
})
|
})
|
||||||
|
|
||||||
// Preps role checking
|
|
||||||
const roleAccess: Record<string, Permission[]> = permissions['/outpatient/encounter'] || {}
|
|
||||||
const { checkRole, hasReadAccess } = useRBAC()
|
|
||||||
|
|
||||||
// Check if user has access to this page
|
|
||||||
const hasAccess = checkRole(roleAccess)
|
|
||||||
if (!hasAccess) {
|
|
||||||
navigateTo('/403')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define permission-based computed properties
|
|
||||||
const canRead = hasReadAccess(roleAccess)
|
|
||||||
|
|
||||||
// Page needs
|
|
||||||
const route = useRoute()
|
|
||||||
useHead({
|
useHead({
|
||||||
title: () => `${route.meta.title}`,
|
title: () => `${getRouteTitle()}`,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Preps role checking
|
||||||
|
const roleAccess: Record<string, Permission[]> = permissions['/ambulatory/encounter/[id]'] || {}
|
||||||
|
const hasAccess = getPageAccess(roleAccess, 'read')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="canRead">
|
<div v-if="hasAccess">
|
||||||
<Content />
|
<Content />
|
||||||
</div>
|
</div>
|
||||||
<Error v-else :status-code="403" />
|
<Error v-else :status-code="403" />
|
||||||
@@ -1,15 +1,19 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// Pubs
|
// Types & Consts
|
||||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
|
||||||
|
|
||||||
// Models & Consts
|
|
||||||
import type { Permission } from '~/models/role'
|
import type { Permission } from '~/models/role'
|
||||||
import { permissions } from '~/const/page-permission/ambulatory'
|
import { permissions } from '~/const/page-permission/ambulatory'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { usePageChecker } from "~/lib/page-checker"
|
||||||
|
|
||||||
|
// Pubs
|
||||||
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
|
|
||||||
// Apps
|
// Apps
|
||||||
import Content from '~/components/content/encounter/entry.vue'
|
import Content from '~/components/content/encounter/entry.vue'
|
||||||
|
|
||||||
// Page meta
|
const { getParamsId, getRouteTitle, getPageAccess } = usePageChecker()
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: ['rbac'],
|
middleware: ['rbac'],
|
||||||
roles: ['emp|reg'],
|
roles: ['emp|reg'],
|
||||||
@@ -17,42 +21,25 @@ definePageMeta({
|
|||||||
contentFrame: 'cf-full-width',
|
contentFrame: 'cf-full-width',
|
||||||
})
|
})
|
||||||
|
|
||||||
const route = useRoute()
|
|
||||||
useHead({
|
useHead({
|
||||||
title: () => `${route.meta.title}`, // backtick to avoid the ts-plugin(2322) warning
|
title: () => `${getRouteTitle()}`,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Preps role checking
|
// Preps role checking
|
||||||
const roleAccess: Record<string, Permission[]> = permissions['/ambulatory/encounter/[id]/edit'] || {}
|
const roleAccess: Record<string, Permission[]> = permissions['/ambulatory/encounter/[id]/edit'] || {}
|
||||||
const { checkRole, hasUpdateAccess } = useRBAC()
|
const hasAccess = getPageAccess(roleAccess, 'update')
|
||||||
|
const encounterId = getParamsId()
|
||||||
// Check if user has access to this page, need to use try - catch for proper handling
|
|
||||||
const hasAccess = checkRole(roleAccess)
|
|
||||||
if (!hasAccess) {
|
|
||||||
navigateTo('/403')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define permission-based computed properties
|
|
||||||
const canUpdate = hasUpdateAccess(roleAccess)
|
|
||||||
|
|
||||||
// Get encounter ID from route params
|
|
||||||
const encounter_id = computed(() => {
|
|
||||||
const id = route.params.id
|
|
||||||
return typeof id === 'string' ? parseInt(id) : 0
|
|
||||||
})
|
|
||||||
|
|
||||||
// User info
|
|
||||||
const { user } = useUserStore()
|
const { user } = useUserStore()
|
||||||
const subClassCode = user.unit_code == 'rehab' ? 'rehab' : 'reg'
|
const subClassCode = user.unit_code == 'rehab' ? 'rehab' : 'reg'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="canUpdate">
|
<div v-if="hasAccess">
|
||||||
<Content
|
<Content
|
||||||
:id="encounter_id"
|
:id="encounterId"
|
||||||
class-code="ambulatory"
|
class-code="ambulatory"
|
||||||
:sub-class-code="subClassCode"
|
:sub-class-code="subClassCode"
|
||||||
form-type="Edit"
|
form-type="edit"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Error
|
<Error
|
||||||
@@ -60,4 +47,3 @@ const subClassCode = user.unit_code == 'rehab' ? 'rehab' : 'reg'
|
|||||||
:status-code="403"
|
:status-code="403"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
// Pubs
|
|
||||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
|
||||||
|
|
||||||
// Models & Consts
|
|
||||||
import type { Permission } from '~/models/role'
|
|
||||||
import { permissions } from '~/const/page-permission/ambulatory'
|
|
||||||
import { medicalRoles } from '~/const/common/role'
|
|
||||||
|
|
||||||
// Page meta
|
|
||||||
definePageMeta({
|
|
||||||
middleware: ['rbac'],
|
|
||||||
roles: medicalRoles,
|
|
||||||
title: 'Detail Kunjungan',
|
|
||||||
contentFrame: 'cf-container-md',
|
|
||||||
})
|
|
||||||
|
|
||||||
// Define common things
|
|
||||||
const route = useRoute()
|
|
||||||
|
|
||||||
// Prep role checking
|
|
||||||
const roleAccess: Record<string, Permission[]> = permissions['/ambulatory/encounter/[id]'] || {}
|
|
||||||
const { checkRole, hasReadAccess } = useRBAC()
|
|
||||||
|
|
||||||
// Check if user has access to this page
|
|
||||||
const hasAccess = checkRole(roleAccess)
|
|
||||||
if (!hasAccess) {
|
|
||||||
navigateTo('/403')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define permission-based computed properties
|
|
||||||
const canRead = hasReadAccess(roleAccess)
|
|
||||||
|
|
||||||
// Page needs
|
|
||||||
useHead({
|
|
||||||
title: () => route.meta.title as string,
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<div v-if="canRead">
|
|
||||||
<ContentOutpatientEncounterDetail :patient-id="Number(route.params.id)" />
|
|
||||||
</div>
|
|
||||||
<Error v-else :status-code="403" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
@@ -1,45 +1,43 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// Types & Consts
|
||||||
|
import type { Permission } from '~/models/role'
|
||||||
|
import { permissions } from '~/const/page-permission/ambulatory'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { usePageChecker } from '~/lib/page-checker'
|
||||||
|
|
||||||
// Pubs
|
// Pubs
|
||||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
|
|
||||||
// AppS
|
// Apps
|
||||||
import type { Permission } from '~/models/role'
|
|
||||||
import { permissions } from '~/const/page-permission/ambulatory'
|
|
||||||
import Content from '~/components/content/encounter/process.vue'
|
import Content from '~/components/content/encounter/process.vue'
|
||||||
|
|
||||||
|
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: ['rbac'],
|
middleware: ['rbac'],
|
||||||
roles: ['emp|doc', 'emp|nur', 'emp|miw', 'emp|nut', 'emp|lab', 'emp|pha', 'emp|thr'],
|
roles: ['emp|doc', 'emp|nur', 'emp|miw', 'emp|nut', 'emp|lab', 'emp|pha', 'emp|thr'],
|
||||||
title: 'Proses Kunjungan',
|
title: 'Proses Kunjungan',
|
||||||
contentFrame: 'cf-full-width',
|
contentFrame: 'cf-full-width',
|
||||||
contentPadding: 'p-0',
|
contentPadding: 'p-0',
|
||||||
contentUseCard: false
|
contentUseCard: false,
|
||||||
|
})
|
||||||
|
|
||||||
|
useHead({
|
||||||
|
title: () => `${getRouteTitle()}`,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Preps role checking
|
// Preps role checking
|
||||||
const roleAccess: Record<string, Permission[]> = permissions['/ambulatory/encounter/[id]/process'] || {}
|
const roleAccess: Record<string, Permission[]> = permissions['/ambulatory/encounter/[id]/process'] || {}
|
||||||
const { checkRole, hasReadAccess } = useRBAC()
|
const hasAccess = getPageAccess(roleAccess, 'read')
|
||||||
|
|
||||||
// Check if user has access to this page
|
|
||||||
const hasAccess = checkRole(roleAccess)
|
|
||||||
if (!hasAccess) {
|
|
||||||
navigateTo('/403')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define permission-based computed properties
|
|
||||||
const canRead = hasReadAccess(roleAccess)
|
|
||||||
|
|
||||||
// Page needs
|
|
||||||
const route = useRoute()
|
|
||||||
useHead({
|
|
||||||
title: () => `${route.meta.title}`,
|
|
||||||
})
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="canRead">
|
<div v-if="hasAccess">
|
||||||
<Content class-code="ambulatory" />
|
<Content class-code="ambulatory" />
|
||||||
</div>
|
</div>
|
||||||
<Error v-else :status-code="403" />
|
<Error
|
||||||
|
v-else
|
||||||
|
:status-code="403"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
@@ -1,10 +1,19 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// Types & Consts
|
||||||
import type { Permission } from '~/models/role'
|
import type { Permission } from '~/models/role'
|
||||||
import { permissions } from '~/const/page-permission/ambulatory'
|
import { permissions } from '~/const/page-permission/ambulatory'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { usePageChecker } from "~/lib/page-checker"
|
||||||
|
|
||||||
|
// Pubs
|
||||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
|
|
||||||
|
// Apps
|
||||||
import Content from '~/components/content/encounter/entry.vue'
|
import Content from '~/components/content/encounter/entry.vue'
|
||||||
|
|
||||||
|
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: ['rbac'],
|
middleware: ['rbac'],
|
||||||
roles: ['emp|reg'],
|
roles: ['emp|reg'],
|
||||||
@@ -12,36 +21,22 @@ definePageMeta({
|
|||||||
contentFrame: 'cf-full-width',
|
contentFrame: 'cf-full-width',
|
||||||
})
|
})
|
||||||
|
|
||||||
// Preps role checking
|
|
||||||
const roleAccess: Record<string, Permission[]> = permissions['/ambulatory/encounter/add'] || {}
|
|
||||||
const { checkRole, hasReadAccess, hasCreateAccess } = useRBAC()
|
|
||||||
|
|
||||||
// Check if user has access to this page
|
|
||||||
const hasAccess = checkRole(roleAccess)
|
|
||||||
if (!hasAccess) {
|
|
||||||
navigateTo('/403')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define permission-based computed properties
|
|
||||||
const canRead = hasReadAccess(roleAccess)
|
|
||||||
|
|
||||||
// Page needs
|
|
||||||
const route = useRoute()
|
|
||||||
useHead({
|
useHead({
|
||||||
title: () => route.meta.title as string,
|
title: () => `${getRouteTitle()}`,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Define permission-based computed properties
|
// Preps role checking
|
||||||
const canCreate = hasCreateAccess(roleAccess)
|
const roleAccess: Record<string, Permission[]> = permissions['/ambulatory/encounter/add'] || {}
|
||||||
|
const hasAccess = getPageAccess(roleAccess, 'create')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="canCreate">
|
<div v-if="hasAccess">
|
||||||
<Content
|
<Content
|
||||||
:id="0"
|
:id="0"
|
||||||
class-code="ambulatory"
|
class-code="ambulatory"
|
||||||
sub-class-code="reg"
|
sub-class-code="reg"
|
||||||
form-type="Tambah"
|
form-type="add"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Error
|
<Error
|
||||||
|
|||||||
@@ -1,41 +1,39 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// Pubs
|
// Types & Consts
|
||||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
|
||||||
|
|
||||||
// Models & Consts
|
|
||||||
import type { Permission } from '~/models/role'
|
import type { Permission } from '~/models/role'
|
||||||
import { permissions } from '~/const/page-permission/ambulatory'
|
import { permissions } from '~/const/page-permission/ambulatory'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { usePageChecker } from "~/lib/page-checker"
|
||||||
|
|
||||||
|
// Pubs
|
||||||
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
|
|
||||||
// Apps
|
// Apps
|
||||||
import Content from '~/components/content/encounter/list.vue'
|
import Content from '~/components/content/encounter/list.vue'
|
||||||
|
|
||||||
|
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||||
|
|
||||||
// Page meta
|
// Page meta
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
// middleware: ['rbac'],
|
middleware: ['rbac'],
|
||||||
// roles: ['emp|reg', 'emp|nur', 'emp|doc', 'emp|miw', 'emp|thr', 'emp|nut', 'emp|pha', 'emp|lab'],
|
roles: ['emp|reg', 'emp|nur', 'emp|doc', 'emp|miw', 'emp|thr', 'emp|nut', 'emp|pha', 'emp|lab'],
|
||||||
title: 'Daftar Kunjungan',
|
title: 'Daftar Kunjungan',
|
||||||
contentFrame: 'cf-full-width',
|
contentFrame: 'cf-full-width',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
useHead({
|
||||||
|
title: () => `${getRouteTitle()}`,
|
||||||
|
})
|
||||||
|
|
||||||
// Define common things
|
// Define common things
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
// Preps role checking
|
// Preps role checking
|
||||||
const roleAccess: Record<string, Permission[]> = permissions[route.path] || {}
|
const roleAccess: Record<string, Permission[]> = permissions[route.path] || {}
|
||||||
const { checkRole, hasCreateAccess, hasReadAccess } = useRBAC()
|
const hasAccess = getPageAccess(roleAccess, 'read')
|
||||||
|
const canCreate = getPageAccess(roleAccess, 'create')
|
||||||
// Check if user has access to this page
|
const canRemove = getPageAccess(roleAccess, 'delete')
|
||||||
const hasAccess = checkRole(roleAccess)
|
|
||||||
const canRead = hasReadAccess(roleAccess)
|
|
||||||
if (!hasAccess || !canRead) {
|
|
||||||
navigateTo('/403')
|
|
||||||
}
|
|
||||||
const canCreate = hasCreateAccess(roleAccess)
|
|
||||||
|
|
||||||
// Page needs
|
|
||||||
useHead({
|
|
||||||
title: () => route.meta.title as string,
|
|
||||||
})
|
|
||||||
|
|
||||||
// User info
|
// User info
|
||||||
const { user } = useUserStore()
|
const { user } = useUserStore()
|
||||||
@@ -44,11 +42,12 @@ const subClassCode = user.unit_code == 'rehab' ? 'rehab' : 'reg'
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div v-if="canRead">
|
<div v-if="hasAccess">
|
||||||
<Content
|
<Content
|
||||||
class-code="ambulatory"
|
class-code="ambulatory"
|
||||||
:sub-class-code="subClassCode"
|
:sub-class-code="subClassCode"
|
||||||
:can-create="canCreate"
|
:can-create="canCreate"
|
||||||
|
:can-delete="canRemove"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Error
|
<Error
|
||||||
|
|||||||
@@ -1,9 +1,19 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// Types & Consts
|
||||||
import type { Permission } from '~/models/role'
|
import type { Permission } from '~/models/role'
|
||||||
import { permissions } from '~/const/page-permission/emergency'
|
import { permissions } from '~/const/page-permission/emergency'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { usePageChecker } from "~/lib/page-checker"
|
||||||
|
|
||||||
|
// Pubs
|
||||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
|
|
||||||
|
// Apps
|
||||||
import Content from '~/components/content/encounter/detail.vue'
|
import Content from '~/components/content/encounter/detail.vue'
|
||||||
|
|
||||||
|
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: ['rbac'],
|
middleware: ['rbac'],
|
||||||
roles: ['emp|doc', 'emp|nur', 'emp|reg', 'emp|pha', 'emp|pay', 'emp|mng'],
|
roles: ['emp|doc', 'emp|nur', 'emp|reg', 'emp|pha', 'emp|pay', 'emp|mng'],
|
||||||
@@ -11,28 +21,17 @@ definePageMeta({
|
|||||||
contentFrame: 'cf-full-width',
|
contentFrame: 'cf-full-width',
|
||||||
})
|
})
|
||||||
|
|
||||||
// Preps role checking
|
|
||||||
const roleAccess: Record<string, Permission[]> = permissions['/emergency/encounter'] || {}
|
|
||||||
const { checkRole, hasReadAccess } = useRBAC()
|
|
||||||
|
|
||||||
// Check if user has access to this page
|
|
||||||
const hasAccess = checkRole(roleAccess)
|
|
||||||
if (!hasAccess) {
|
|
||||||
navigateTo('/403')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define permission-based computed properties
|
|
||||||
const canRead = hasReadAccess(roleAccess)
|
|
||||||
|
|
||||||
// Page needs
|
|
||||||
const route = useRoute()
|
|
||||||
useHead({
|
useHead({
|
||||||
title: () => `${route.meta.title}`,
|
title: () => `${getRouteTitle()}`,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Preps role checking
|
||||||
|
const roleAccess: Record<string, Permission[]> = permissions['/emergency/encounter/[id]'] || {}
|
||||||
|
const hasAccess = getPageAccess(roleAccess, 'read')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="canRead">
|
<div v-if="hasAccess">
|
||||||
<Content />
|
<Content />
|
||||||
</div>
|
</div>
|
||||||
<Error v-else :status-code="403" />
|
<Error v-else :status-code="403" />
|
||||||
|
|||||||
@@ -1,51 +1,43 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PagePermission } from '~/models/role'
|
// Types & Consts
|
||||||
|
import type { Permission } from '~/models/role'
|
||||||
|
import { permissions } from '~/const/page-permission/emergency'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { usePageChecker } from "~/lib/page-checker"
|
||||||
|
|
||||||
|
// Pubs
|
||||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
|
|
||||||
|
// Apps
|
||||||
|
import Content from '~/components/content/encounter/entry.vue'
|
||||||
|
|
||||||
|
const { getParamsId, getRouteTitle, getPageAccess } = usePageChecker()
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: ['rbac'],
|
middleware: ['rbac'],
|
||||||
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
roles: ['emp|reg'],
|
||||||
title: 'Edit Kunjungan',
|
title: 'Edit Kunjungan',
|
||||||
contentFrame: 'cf-full-width',
|
contentFrame: 'cf-full-width',
|
||||||
})
|
})
|
||||||
|
|
||||||
const route = useRoute()
|
|
||||||
|
|
||||||
useHead({
|
useHead({
|
||||||
title: () => `${route.meta.title}`, // backtick to avoid the ts-plugin(2322) warning
|
title: () => `${getRouteTitle()}`,
|
||||||
})
|
})
|
||||||
|
|
||||||
const roleAccess: PagePermission = PAGE_PERMISSIONS['/emergency/encounter']
|
// Preps role checking
|
||||||
|
const roleAccess: Record<string, Permission[]> = permissions['/emergency/encounter/[id]/edit'] || {}
|
||||||
const { checkRole, hasUpdateAccess } = useRBAC()
|
const hasAccess = getPageAccess(roleAccess, 'update')
|
||||||
|
const encounterId = getParamsId()
|
||||||
// Check if user has access to this page
|
|
||||||
const hasAccess = checkRole(roleAccess)
|
|
||||||
if (!hasAccess) {
|
|
||||||
throw createError({
|
|
||||||
statusCode: 403,
|
|
||||||
statusMessage: 'Access denied',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define permission-based computed properties
|
|
||||||
const canUpdate = hasUpdateAccess(roleAccess)
|
|
||||||
|
|
||||||
// Get encounter ID from route params
|
|
||||||
const encounterId = computed(() => {
|
|
||||||
const id = route.params.id
|
|
||||||
return typeof id === 'string' ? parseInt(id) : 0
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="canUpdate">
|
<div v-if="hasAccess">
|
||||||
<ContentEncounterEntry
|
<Content
|
||||||
:id="encounterId"
|
:id="encounterId"
|
||||||
class-code="emergency"
|
class-code="emergency"
|
||||||
sub-class-code="emg"
|
sub-class-code="emg"
|
||||||
form-type="Edit"
|
form-type="edit"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Error
|
<Error
|
||||||
@@ -53,4 +45,3 @@ const encounterId = computed(() => {
|
|||||||
:status-code="403"
|
:status-code="403"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -1,39 +1,43 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// Types & Consts
|
||||||
import type { Permission } from '~/models/role'
|
import type { Permission } from '~/models/role'
|
||||||
import { permissions } from '~/const/page-permission/emergency'
|
import { permissions } from '~/const/page-permission/emergency'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { usePageChecker } from '~/lib/page-checker'
|
||||||
|
|
||||||
|
// Pubs
|
||||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
|
|
||||||
|
// Apps
|
||||||
import Content from '~/components/content/encounter/process.vue'
|
import Content from '~/components/content/encounter/process.vue'
|
||||||
|
|
||||||
|
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: ['rbac'],
|
middleware: ['rbac'],
|
||||||
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
roles: ['emp|doc', 'emp|nur', 'emp|miw', 'emp|nut', 'emp|lab', 'emp|pha', 'emp|thr'],
|
||||||
title: 'Kunjungan',
|
title: 'Proses Kunjungan',
|
||||||
contentFrame: 'cf-full-width',
|
contentFrame: 'cf-full-width',
|
||||||
|
contentPadding: 'p-0',
|
||||||
|
contentUseCard: false,
|
||||||
|
})
|
||||||
|
|
||||||
|
useHead({
|
||||||
|
title: () => `${getRouteTitle()}`,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Preps role checking
|
// Preps role checking
|
||||||
const roleAccess: Record<string, Permission[]> = permissions['/emergency/encounter'] || {}
|
const roleAccess: Record<string, Permission[]> = permissions['/emergency/encounter/[id]/process'] || {}
|
||||||
const { checkRole, hasReadAccess } = useRBAC()
|
const hasAccess = getPageAccess(roleAccess, 'read')
|
||||||
|
|
||||||
// Check if user has access to this page
|
|
||||||
const hasAccess = checkRole(roleAccess)
|
|
||||||
if (!hasAccess) {
|
|
||||||
navigateTo('/403')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define permission-based computed properties
|
|
||||||
const canRead = hasReadAccess(roleAccess)
|
|
||||||
|
|
||||||
// Page needs
|
|
||||||
const route = useRoute()
|
|
||||||
useHead({
|
|
||||||
title: () => `${route.meta.title}`,
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="canRead">
|
<div v-if="hasAccess">
|
||||||
<Content class-code="emergency" sub-class-code="emg" />
|
<Content class-code="emergency" />
|
||||||
</div>
|
</div>
|
||||||
<Error v-else :status-code="403" />
|
<Error
|
||||||
|
v-else
|
||||||
|
:status-code="403"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
@@ -1,10 +1,19 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// Types & Consts
|
||||||
import type { Permission } from '~/models/role'
|
import type { Permission } from '~/models/role'
|
||||||
import { permissions } from '~/const/page-permission/ambulatory'
|
import { permissions } from '~/const/page-permission/emergency'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { usePageChecker } from "~/lib/page-checker"
|
||||||
|
|
||||||
|
// Pubs
|
||||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
|
|
||||||
|
// Apps
|
||||||
import Content from '~/components/content/encounter/entry.vue'
|
import Content from '~/components/content/encounter/entry.vue'
|
||||||
|
|
||||||
|
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: ['rbac'],
|
middleware: ['rbac'],
|
||||||
roles: ['emp|reg'],
|
roles: ['emp|reg'],
|
||||||
@@ -12,36 +21,22 @@ definePageMeta({
|
|||||||
contentFrame: 'cf-full-width',
|
contentFrame: 'cf-full-width',
|
||||||
})
|
})
|
||||||
|
|
||||||
// Preps role checking
|
|
||||||
const roleAccess: Record<string, Permission[]> = permissions['/outpatient/encounter'] || {}
|
|
||||||
const { checkRole, hasReadAccess, hasCreateAccess } = useRBAC()
|
|
||||||
|
|
||||||
// Check if user has access to this page
|
|
||||||
const hasAccess = checkRole(roleAccess)
|
|
||||||
if (!hasAccess) {
|
|
||||||
navigateTo('/403')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define permission-based computed properties
|
|
||||||
const canRead = hasReadAccess(roleAccess)
|
|
||||||
|
|
||||||
// Page needs
|
|
||||||
const route = useRoute()
|
|
||||||
useHead({
|
useHead({
|
||||||
title: () => route.meta.title as string,
|
title: () => `${getRouteTitle()}`,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Define permission-based computed properties
|
// Preps role checking
|
||||||
const canCreate = hasCreateAccess(roleAccess)
|
const roleAccess: Record<string, Permission[]> = permissions['/emergency/encounter/add'] || {}
|
||||||
|
const hasAccess = getPageAccess(roleAccess, 'create')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="canCreate">
|
<div v-if="hasAccess">
|
||||||
<Content
|
<Content
|
||||||
:id="0"
|
:id="0"
|
||||||
class-code="emergency"
|
class-code="emergency"
|
||||||
sub-class-code="reg"
|
sub-class-code="emg"
|
||||||
form-type="Tambah"
|
form-type="add"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Error
|
<Error
|
||||||
|
|||||||
@@ -1,10 +1,20 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// Types & Consts
|
||||||
import type { Permission } from '~/models/role'
|
import type { Permission } from '~/models/role'
|
||||||
import { permissions } from '~/const/page-permission/emergency'
|
import { permissions } from '~/const/page-permission/emergency'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { usePageChecker } from "~/lib/page-checker"
|
||||||
|
|
||||||
|
// Pubs
|
||||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
|
|
||||||
|
// Apps
|
||||||
import Content from '~/components/content/encounter/list.vue'
|
import Content from '~/components/content/encounter/list.vue'
|
||||||
|
|
||||||
|
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||||
|
|
||||||
|
// Page meta
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: ['rbac'],
|
middleware: ['rbac'],
|
||||||
roles: ['emp|reg', 'emp|nur', 'emp|doc', 'emp|miw', 'emp|thr', 'emp|nut', 'emp|pha', 'emp|lab'],
|
roles: ['emp|reg', 'emp|nur', 'emp|doc', 'emp|miw', 'emp|thr', 'emp|nut', 'emp|pha', 'emp|lab'],
|
||||||
@@ -12,36 +22,28 @@ definePageMeta({
|
|||||||
contentFrame: 'cf-full-width',
|
contentFrame: 'cf-full-width',
|
||||||
})
|
})
|
||||||
|
|
||||||
// Preps role checking
|
|
||||||
const route = useRoute()
|
|
||||||
const roleAccess: Record<string, Permission[]> = permissions[route.path] || {}
|
|
||||||
const { checkRole, hasReadAccess } = useRBAC()
|
|
||||||
|
|
||||||
// Check if user has access to this page
|
|
||||||
const hasAccess = checkRole(roleAccess)
|
|
||||||
if (!hasAccess) {
|
|
||||||
navigateTo('/403')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define permission-based computed properties
|
|
||||||
const canRead = hasReadAccess(roleAccess)
|
|
||||||
|
|
||||||
// Page needs
|
|
||||||
useHead({
|
useHead({
|
||||||
title: () => route.meta.title as string,
|
title: () => `${getRouteTitle()}`,
|
||||||
})
|
})
|
||||||
|
|
||||||
const { user } = useUserStore()
|
// Define common things
|
||||||
const subClassCode = user.unit_code == 'rehab' ? 'rehab' : 'reg'
|
const route = useRoute()
|
||||||
|
|
||||||
|
// Preps role checking
|
||||||
|
const roleAccess: Record<string, Permission[]> = permissions[route.path] || {}
|
||||||
|
const hasAccess = getPageAccess(roleAccess, 'read')
|
||||||
|
const canCreate = getPageAccess(roleAccess, 'create')
|
||||||
|
const canRemove = getPageAccess(roleAccess, 'delete')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div v-if="canRead">
|
<div v-if="hasAccess">
|
||||||
<Content
|
<Content
|
||||||
class-code="emergency"
|
class-code="emergency"
|
||||||
:sub-class-code="subClassCode"
|
sub-class-code="emg"
|
||||||
type="encounter"
|
:can-create="canCreate"
|
||||||
|
:can-delete="canRemove"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Error
|
<Error
|
||||||
|
|||||||
@@ -1,9 +1,19 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// Types & Consts
|
||||||
import type { Permission } from '~/models/role'
|
import type { Permission } from '~/models/role'
|
||||||
import { permissions } from '~/const/page-permission/inpatient'
|
import { permissions } from '~/const/page-permission/inpatient'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { usePageChecker } from "~/lib/page-checker"
|
||||||
|
|
||||||
|
// Pubs
|
||||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
|
|
||||||
|
// Apps
|
||||||
import Content from '~/components/content/encounter/detail.vue'
|
import Content from '~/components/content/encounter/detail.vue'
|
||||||
|
|
||||||
|
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: ['rbac'],
|
middleware: ['rbac'],
|
||||||
roles: ['emp|doc', 'emp|nur', 'emp|reg', 'emp|pha', 'emp|pay', 'emp|mng'],
|
roles: ['emp|doc', 'emp|nur', 'emp|reg', 'emp|pha', 'emp|pay', 'emp|mng'],
|
||||||
@@ -11,28 +21,17 @@ definePageMeta({
|
|||||||
contentFrame: 'cf-full-width',
|
contentFrame: 'cf-full-width',
|
||||||
})
|
})
|
||||||
|
|
||||||
// Preps role checking
|
|
||||||
const roleAccess: Record<string, Permission[]> = permissions['/inpatient/encounter'] || {}
|
|
||||||
const { checkRole, hasReadAccess } = useRBAC()
|
|
||||||
|
|
||||||
// Check if user has access to this page
|
|
||||||
const hasAccess = checkRole(roleAccess)
|
|
||||||
if (!hasAccess) {
|
|
||||||
navigateTo('/403')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define permission-based computed properties
|
|
||||||
const canRead = hasReadAccess(roleAccess)
|
|
||||||
|
|
||||||
// Page needs
|
|
||||||
const route = useRoute()
|
|
||||||
useHead({
|
useHead({
|
||||||
title: () => `${route.meta.title}`,
|
title: () => `${getRouteTitle()}`,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Preps role checking
|
||||||
|
const roleAccess: Record<string, Permission[]> = permissions['/inpatient/encounter/[id]'] || {}
|
||||||
|
const hasAccess = getPageAccess(roleAccess, 'read')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="canRead">
|
<div v-if="hasAccess">
|
||||||
<Content />
|
<Content />
|
||||||
</div>
|
</div>
|
||||||
<Error v-else :status-code="403" />
|
<Error v-else :status-code="403" />
|
||||||
|
|||||||
@@ -1,51 +1,43 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PagePermission } from '~/models/role'
|
// Types & Consts
|
||||||
|
import type { Permission } from '~/models/role'
|
||||||
|
import { permissions } from '~/const/page-permission/inpatient'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { usePageChecker } from "~/lib/page-checker"
|
||||||
|
|
||||||
|
// Pubs
|
||||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
|
|
||||||
|
// Apps
|
||||||
|
import Content from '~/components/content/encounter/entry.vue'
|
||||||
|
|
||||||
|
const { getParamsId, getRouteTitle, getPageAccess } = usePageChecker()
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: ['rbac'],
|
middleware: ['rbac'],
|
||||||
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
roles: ['emp|reg'],
|
||||||
title: 'Edit Kunjungan',
|
title: 'Edit Kunjungan',
|
||||||
contentFrame: 'cf-full-width',
|
contentFrame: 'cf-full-width',
|
||||||
})
|
})
|
||||||
|
|
||||||
const route = useRoute()
|
|
||||||
|
|
||||||
useHead({
|
useHead({
|
||||||
title: () => `${route.meta.title}`, // backtick to avoid the ts-plugin(2322) warning
|
title: () => `${getRouteTitle()}`,
|
||||||
})
|
})
|
||||||
|
|
||||||
const roleAccess: PagePermission = PAGE_PERMISSIONS['/inpatient/encounter']
|
// Preps role checking
|
||||||
|
const roleAccess: Record<string, Permission[]> = permissions['/inpatient/encounter/[id]/edit'] || {}
|
||||||
const { checkRole, hasUpdateAccess } = useRBAC()
|
const hasAccess = getPageAccess(roleAccess, 'update')
|
||||||
|
const encounterId = getParamsId()
|
||||||
// Check if user has access to this page
|
|
||||||
const hasAccess = checkRole(roleAccess)
|
|
||||||
if (!hasAccess) {
|
|
||||||
throw createError({
|
|
||||||
statusCode: 403,
|
|
||||||
statusMessage: 'Access denied',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define permission-based computed properties
|
|
||||||
const canUpdate = hasUpdateAccess(roleAccess)
|
|
||||||
|
|
||||||
// Get encounter ID from route params
|
|
||||||
const encounterId = computed(() => {
|
|
||||||
const id = route.params.id
|
|
||||||
return typeof id === 'string' ? parseInt(id) : 0
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="canUpdate">
|
<div v-if="hasAccess">
|
||||||
<ContentEncounterEntry
|
<Content
|
||||||
:id="encounterId"
|
:id="encounterId"
|
||||||
class-code="inpatient"
|
class-code="inpatient"
|
||||||
sub-class-code="icu"
|
sub-class-code="vk"
|
||||||
form-type="Edit"
|
form-type="edit"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Error
|
<Error
|
||||||
@@ -53,4 +45,3 @@ const encounterId = computed(() => {
|
|||||||
:status-code="403"
|
:status-code="403"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -1,39 +1,43 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// Types & Consts
|
||||||
import type { Permission } from '~/models/role'
|
import type { Permission } from '~/models/role'
|
||||||
import { permissions } from '~/const/page-permission/inpatient'
|
import { permissions } from '~/const/page-permission/inpatient'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { usePageChecker } from '~/lib/page-checker'
|
||||||
|
|
||||||
|
// Pubs
|
||||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
|
|
||||||
|
// Apps
|
||||||
import Content from '~/components/content/encounter/process.vue'
|
import Content from '~/components/content/encounter/process.vue'
|
||||||
|
|
||||||
|
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: ['rbac'],
|
middleware: ['rbac'],
|
||||||
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
roles: ['emp|doc', 'emp|nur', 'emp|miw', 'emp|nut', 'emp|lab', 'emp|pha', 'emp|thr'],
|
||||||
title: 'Kunjungan',
|
title: 'Proses Kunjungan',
|
||||||
contentFrame: 'cf-full-width',
|
contentFrame: 'cf-full-width',
|
||||||
|
contentPadding: 'p-0',
|
||||||
|
contentUseCard: false,
|
||||||
|
})
|
||||||
|
|
||||||
|
useHead({
|
||||||
|
title: () => `${getRouteTitle()}`,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Preps role checking
|
// Preps role checking
|
||||||
const roleAccess: Record<string, Permission[]> = permissions['/inpatient/encounter'] || {}
|
const roleAccess: Record<string, Permission[]> = permissions['/inpatient/encounter/[id]/process'] || {}
|
||||||
const { checkRole, hasReadAccess } = useRBAC()
|
const hasAccess = getPageAccess(roleAccess, 'read')
|
||||||
|
|
||||||
// Check if user has access to this page
|
|
||||||
const hasAccess = checkRole(roleAccess)
|
|
||||||
if (!hasAccess) {
|
|
||||||
navigateTo('/403')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define permission-based computed properties
|
|
||||||
const canRead = hasReadAccess(roleAccess)
|
|
||||||
|
|
||||||
// Page needs
|
|
||||||
const route = useRoute()
|
|
||||||
useHead({
|
|
||||||
title: () => `${route.meta.title}`,
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="canRead">
|
<div v-if="hasAccess">
|
||||||
<Content class-code="inpatient" sub-class-code="vk" />
|
<Content class-code="inpatient" />
|
||||||
</div>
|
</div>
|
||||||
<Error v-else :status-code="403" />
|
<Error
|
||||||
|
v-else
|
||||||
|
:status-code="403"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
@@ -1,10 +1,19 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// Types & Consts
|
||||||
import type { Permission } from '~/models/role'
|
import type { Permission } from '~/models/role'
|
||||||
import { permissions } from '~/const/page-permission/ambulatory'
|
import { permissions } from '~/const/page-permission/inpatient'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { usePageChecker } from "~/lib/page-checker"
|
||||||
|
|
||||||
|
// Pubs
|
||||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
|
|
||||||
|
// Apps
|
||||||
import Content from '~/components/content/encounter/entry.vue'
|
import Content from '~/components/content/encounter/entry.vue'
|
||||||
|
|
||||||
|
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: ['rbac'],
|
middleware: ['rbac'],
|
||||||
roles: ['emp|reg'],
|
roles: ['emp|reg'],
|
||||||
@@ -12,36 +21,22 @@ definePageMeta({
|
|||||||
contentFrame: 'cf-full-width',
|
contentFrame: 'cf-full-width',
|
||||||
})
|
})
|
||||||
|
|
||||||
// Preps role checking
|
|
||||||
const roleAccess: Record<string, Permission[]> = permissions['/outpatient/encounter'] || {}
|
|
||||||
const { checkRole, hasReadAccess, hasCreateAccess } = useRBAC()
|
|
||||||
|
|
||||||
// Check if user has access to this page
|
|
||||||
const hasAccess = checkRole(roleAccess)
|
|
||||||
if (!hasAccess) {
|
|
||||||
navigateTo('/403')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define permission-based computed properties
|
|
||||||
const canRead = hasReadAccess(roleAccess)
|
|
||||||
|
|
||||||
// Page needs
|
|
||||||
const route = useRoute()
|
|
||||||
useHead({
|
useHead({
|
||||||
title: () => route.meta.title as string,
|
title: () => `${getRouteTitle()}`,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Define permission-based computed properties
|
// Preps role checking
|
||||||
const canCreate = hasCreateAccess(roleAccess)
|
const roleAccess: Record<string, Permission[]> = permissions['/inpatient/encounter/add'] || {}
|
||||||
|
const hasAccess = getPageAccess(roleAccess, 'create')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="canCreate">
|
<div v-if="hasAccess">
|
||||||
<Content
|
<Content
|
||||||
:id="0"
|
:id="0"
|
||||||
class-code="ambulatory"
|
class-code="inpatient"
|
||||||
sub-class-code="reg"
|
sub-class-code="vk"
|
||||||
form-type="Tambah"
|
form-type="add"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Error
|
<Error
|
||||||
|
|||||||
@@ -1,10 +1,20 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// Types & Consts
|
||||||
import type { Permission } from '~/models/role'
|
import type { Permission } from '~/models/role'
|
||||||
import { permissions } from '~/const/page-permission/inpatient'
|
import { permissions } from '~/const/page-permission/inpatient'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { usePageChecker } from "~/lib/page-checker"
|
||||||
|
|
||||||
|
// Pubs
|
||||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
|
|
||||||
|
// Apps
|
||||||
import Content from '~/components/content/encounter/list.vue'
|
import Content from '~/components/content/encounter/list.vue'
|
||||||
|
|
||||||
|
const { getRouteTitle, getPageAccess } = usePageChecker()
|
||||||
|
|
||||||
|
// Page meta
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: ['rbac'],
|
middleware: ['rbac'],
|
||||||
roles: ['emp|reg', 'emp|nur', 'emp|doc', 'emp|miw', 'emp|thr', 'emp|nut', 'emp|pha', 'emp|lab'],
|
roles: ['emp|reg', 'emp|nur', 'emp|doc', 'emp|miw', 'emp|thr', 'emp|nut', 'emp|pha', 'emp|lab'],
|
||||||
@@ -12,37 +22,28 @@ definePageMeta({
|
|||||||
contentFrame: 'cf-full-width',
|
contentFrame: 'cf-full-width',
|
||||||
})
|
})
|
||||||
|
|
||||||
// Preps role checking
|
|
||||||
const roleAccess: Record<string, Permission[]> = permissions['/inpatient/encounter'] || {}
|
|
||||||
const { checkRole, hasReadAccess } = useRBAC()
|
|
||||||
|
|
||||||
// Check if user has access to this page
|
|
||||||
const hasAccess = checkRole(roleAccess)
|
|
||||||
if (!hasAccess) {
|
|
||||||
navigateTo('/403')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define permission-based computed properties
|
|
||||||
const canRead = hasReadAccess(roleAccess)
|
|
||||||
|
|
||||||
// Page needs
|
|
||||||
const route = useRoute()
|
|
||||||
useHead({
|
useHead({
|
||||||
title: () => route.meta.title as string,
|
title: () => `${getRouteTitle()}`,
|
||||||
})
|
})
|
||||||
|
|
||||||
const { user } = useUserStore()
|
// Define common things
|
||||||
const subClassCode = user.unit_code == 'rehab' ? 'rehab' : 'reg'
|
const route = useRoute()
|
||||||
|
|
||||||
|
// Preps role checking
|
||||||
|
const roleAccess: Record<string, Permission[]> = permissions[route.path] || {}
|
||||||
|
const hasAccess = getPageAccess(roleAccess, 'read')
|
||||||
|
const canCreate = getPageAccess(roleAccess, 'create')
|
||||||
|
const canRemove = getPageAccess(roleAccess, 'delete')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div v-if="canRead">
|
<div v-if="hasAccess">
|
||||||
<Content
|
<Content
|
||||||
class-code="inpatient"
|
class-code="inpatient"
|
||||||
:sub-class-code="subClassCode"
|
sub-class-code="vk"
|
||||||
type="encounter"
|
:can-create="canCreate"
|
||||||
|
:can-delete="canRemove"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Error
|
<Error
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
|
import Content from '~/components/content/sep/entry.vue'
|
||||||
|
|
||||||
|
definePageMeta({
|
||||||
|
middleware: [],
|
||||||
|
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
||||||
|
title: 'Detail SEP',
|
||||||
|
contentFrame: 'cf-full-width',
|
||||||
|
})
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
|
useHead({
|
||||||
|
title: () => route.meta.title as string,
|
||||||
|
})
|
||||||
|
|
||||||
|
const canCreate = true
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div v-if="canCreate">
|
||||||
|
<Content mode="detail" />
|
||||||
|
</div>
|
||||||
|
<Error v-else :status-code="403" />
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
|
import Content from '~/components/content/sep/entry.vue'
|
||||||
|
|
||||||
|
definePageMeta({
|
||||||
|
middleware: [],
|
||||||
|
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
||||||
|
title: 'Detail SEP',
|
||||||
|
contentFrame: 'cf-full-width',
|
||||||
|
})
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
|
useHead({
|
||||||
|
title: () => route.meta.title as string,
|
||||||
|
})
|
||||||
|
|
||||||
|
const canCreate = true
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div v-if="canCreate">
|
||||||
|
<Content mode="link" />
|
||||||
|
</div>
|
||||||
|
<Error v-else :status-code="403" />
|
||||||
|
</template>
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PagePermission } from '~/models/role'
|
|
||||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
|
import Content from '~/components/content/sep/entry.vue'
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: [],
|
middleware: [],
|
||||||
@@ -16,26 +15,12 @@ useHead({
|
|||||||
title: () => route.meta.title as string,
|
title: () => route.meta.title as string,
|
||||||
})
|
})
|
||||||
|
|
||||||
const roleAccess: PagePermission = PAGE_PERMISSIONS['/doctor']
|
const canCreate = true
|
||||||
|
|
||||||
const { checkRole, hasCreateAccess } = useRBAC()
|
|
||||||
|
|
||||||
// Check if user has access to this page
|
|
||||||
const hasAccess = checkRole(roleAccess)
|
|
||||||
// if (!hasAccess) {
|
|
||||||
// throw createError({
|
|
||||||
// statusCode: 403,
|
|
||||||
// statusMessage: 'Access denied',
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Define permission-based computed properties
|
|
||||||
const canCreate = true // hasCreateAccess(roleAccess)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="canCreate">
|
<div v-if="canCreate">
|
||||||
<ContentSepEntry />
|
<Content mode="add" />
|
||||||
</div>
|
</div>
|
||||||
<Error v-else :status-code="403" />
|
<Error v-else :status-code="403" />
|
||||||
</template>
|
</template>
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PagePermission } from '~/models/role'
|
|
||||||
import Error from '~/components/pub/my-ui/error/error.vue'
|
import Error from '~/components/pub/my-ui/error/error.vue'
|
||||||
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
|
import Content from '~/components/content/sep/list.vue'
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: ['rbac'],
|
middleware: ['rbac'],
|
||||||
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
||||||
title: 'Daftar User',
|
title: 'Daftar SEP',
|
||||||
contentFrame: 'cf-full-width',
|
contentFrame: 'cf-full-width',
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -16,24 +15,13 @@ useHead({
|
|||||||
title: () => route.meta.title as string,
|
title: () => route.meta.title as string,
|
||||||
})
|
})
|
||||||
|
|
||||||
const roleAccess: PagePermission = PAGE_PERMISSIONS['/doctor']
|
const canRead = true
|
||||||
|
|
||||||
const { checkRole, hasReadAccess } = useRBAC()
|
|
||||||
|
|
||||||
// Check if user has access to this page
|
|
||||||
const hasAccess = checkRole(roleAccess)
|
|
||||||
// if (!hasAccess) {
|
|
||||||
// navigateTo('/403')
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Define permission-based computed properties
|
|
||||||
const canRead = true // hasReadAccess(roleAccess)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div v-if="canRead">
|
<div v-if="canRead">
|
||||||
<ContentSepList />
|
<Content />
|
||||||
</div>
|
</div>
|
||||||
<Error v-else :status-code="403" />
|
<Error v-else :status-code="403" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -53,8 +53,7 @@ const IntegrationEncounterSchema = z
|
|||||||
.min(1, ERROR_MESSAGES.required.sepType)
|
.min(1, ERROR_MESSAGES.required.sepType)
|
||||||
.optional(),
|
.optional(),
|
||||||
sepNumber: z
|
sepNumber: z
|
||||||
.string()
|
.string({ required_error: ERROR_MESSAGES.required.sepNumber })
|
||||||
.min(1, ERROR_MESSAGES.required.sepNumber)
|
|
||||||
.optional(),
|
.optional(),
|
||||||
|
|
||||||
// File uploads
|
// File uploads
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ export async function create(path: string, data: any, name: string = 'item') {
|
|||||||
const resp = await xfetch(path, 'POST', data)
|
const resp = await xfetch(path, 'POST', data)
|
||||||
const result: any = {}
|
const result: any = {}
|
||||||
result.success = resp.success
|
result.success = resp.success
|
||||||
|
if (resp.status_code !== 200) {
|
||||||
|
result.error = { ...resp.error }
|
||||||
|
}
|
||||||
result.body = (resp.body as Record<string, any>) || {}
|
result.body = (resp.body as Record<string, any>) || {}
|
||||||
return result
|
return result
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -29,6 +32,9 @@ export async function getList(path: string, params: any = null, name: string = '
|
|||||||
const resp = await xfetch(url, 'GET')
|
const resp = await xfetch(url, 'GET')
|
||||||
const result: any = {}
|
const result: any = {}
|
||||||
result.success = resp.success
|
result.success = resp.success
|
||||||
|
if (resp.status_code !== 200) {
|
||||||
|
result.error = { ...resp.error }
|
||||||
|
}
|
||||||
result.body = (resp.body as Record<string, any>) || {}
|
result.body = (resp.body as Record<string, any>) || {}
|
||||||
return result
|
return result
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -53,6 +59,9 @@ export async function getDetail(path: string, id: number | string, name: string
|
|||||||
const resp = await xfetch(`${path}/${id}${paramStr}`, 'GET')
|
const resp = await xfetch(`${path}/${id}${paramStr}`, 'GET')
|
||||||
const result: any = {}
|
const result: any = {}
|
||||||
result.success = resp.success
|
result.success = resp.success
|
||||||
|
if (resp.status_code !== 200) {
|
||||||
|
result.error = { ...resp.error }
|
||||||
|
}
|
||||||
result.body = (resp.body as Record<string, any>) || {}
|
result.body = (resp.body as Record<string, any>) || {}
|
||||||
return result
|
return result
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -66,6 +75,9 @@ export async function update(path: string, id: number | string, data: any, name:
|
|||||||
const resp = await xfetch(`${path}/${id}`, 'PATCH', data)
|
const resp = await xfetch(`${path}/${id}`, 'PATCH', data)
|
||||||
const result: any = {}
|
const result: any = {}
|
||||||
result.success = resp.success
|
result.success = resp.success
|
||||||
|
if (resp.status_code !== 200) {
|
||||||
|
result.error = { ...resp.error }
|
||||||
|
}
|
||||||
result.body = (resp.body as Record<string, any>) || {}
|
result.body = (resp.body as Record<string, any>) || {}
|
||||||
return result
|
return result
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -79,6 +91,9 @@ export async function updateCustom(path: string, data: any, name: string = 'item
|
|||||||
const resp = await xfetch(`${path}`, 'PATCH', data)
|
const resp = await xfetch(`${path}`, 'PATCH', data)
|
||||||
const result: any = {}
|
const result: any = {}
|
||||||
result.success = resp.success
|
result.success = resp.success
|
||||||
|
if (resp.status_code !== 200) {
|
||||||
|
result.error = { ...resp.error }
|
||||||
|
}
|
||||||
result.body = (resp.body as Record<string, any>) || {}
|
result.body = (resp.body as Record<string, any>) || {}
|
||||||
return result
|
return result
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -92,6 +107,9 @@ export async function remove(path: string, id: number | string, name: string = '
|
|||||||
const resp = await xfetch(`${path}/${id}`, 'DELETE')
|
const resp = await xfetch(`${path}/${id}`, 'DELETE')
|
||||||
const result: any = {}
|
const result: any = {}
|
||||||
result.success = resp.success
|
result.success = resp.success
|
||||||
|
if (resp.status_code !== 200) {
|
||||||
|
result.error = { ...resp.error }
|
||||||
|
}
|
||||||
result.body = (resp.body as Record<string, any>) || {}
|
result.body = (resp.body as Record<string, any>) || {}
|
||||||
return result
|
return result
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -105,6 +123,9 @@ export async function removeCustom(path: string, data: any, name: string = 'item
|
|||||||
const resp = await xfetch(`${path}`, 'DELETE', data)
|
const resp = await xfetch(`${path}`, 'DELETE', data)
|
||||||
const result: any = {}
|
const result: any = {}
|
||||||
result.success = resp.success
|
result.success = resp.success
|
||||||
|
if (resp.status_code !== 200) {
|
||||||
|
result.error = { ...resp.error }
|
||||||
|
}
|
||||||
result.body = (resp.body as Record<string, any>) || {}
|
result.body = (resp.body as Record<string, any>) || {}
|
||||||
return result
|
return result
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
// Base
|
// Base
|
||||||
import * as base from './_crud-base'
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
const path = '/api/vclaim-swagger/RencanaKontrol'
|
const path = '/api/v1/control-plan'
|
||||||
const name = 'rencana-kontrol'
|
const pathOld = '/api/v1/rencana-kontrol'
|
||||||
|
const name = 'control-plan' // 'rencana-kontrol'
|
||||||
|
|
||||||
export function getList(params: any = null) {
|
export function getListOld(params: any = null) {
|
||||||
let url = path
|
let url = pathOld
|
||||||
if (params?.letterNumber && params.mode === 'by-control') {
|
if (params?.letterNumber && params.mode === 'by-control') {
|
||||||
url += `/noSuratKontrol/${params.letterNumber}`
|
url += `/noSuratKontrol/${params.letterNumber}`
|
||||||
}
|
}
|
||||||
@@ -26,4 +27,19 @@ export function getList(params: any = null) {
|
|||||||
delete params.mode
|
delete params.mode
|
||||||
}
|
}
|
||||||
return base.getList(url, params, name)
|
return base.getList(url, params, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getList(params: any = null) {
|
||||||
|
let url = path
|
||||||
|
if (params?.controlDate && params.mode === 'by-schedule') {
|
||||||
|
url += `/${params.controlType}/${params.polyCode}/${params.controlDate}`
|
||||||
|
delete params.controlType
|
||||||
|
delete params.controlDate
|
||||||
|
delete params.polyCode
|
||||||
|
}
|
||||||
|
if (params) {
|
||||||
|
delete params.letterNumber
|
||||||
|
delete params.mode
|
||||||
|
}
|
||||||
|
return base.getList(url, params, name)
|
||||||
|
}
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
// Base
|
// Base
|
||||||
import * as base from './_crud-base'
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
const path = '/api/vclaim/v1/reference/diagnose-prb'
|
const path = '/api/v1/reference/diagnose-prb'
|
||||||
const name = 'diagnose-referral'
|
const name = 'diagnose-referral'
|
||||||
|
|
||||||
export function getList(params: any = null) {
|
export function getList(params: any = null) {
|
||||||
return base.getList(path, params, name)
|
const url = path
|
||||||
|
return base.getList(url, params, name)
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// Base
|
// Base
|
||||||
import * as base from './_crud-base'
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
const path = '/api/vclaim/v1/reference/diagnose'
|
const path = '/api/v1/reference/diagnose'
|
||||||
const name = 'diagnose'
|
const name = 'diagnose'
|
||||||
|
|
||||||
export function getList(params: any = null) {
|
export function getList(params: any = null) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Base
|
// Base
|
||||||
import * as base from './_crud-base'
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
const path = '/api/vclaim/v1/reference/responsible-doctor'
|
const path = '/api/v1/reference/responsible-doctor'
|
||||||
const name = 'responsible-doctor'
|
const name = 'responsible-doctor'
|
||||||
|
|
||||||
export function getList(params: any = null) {
|
export function getList(params: any = null) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Base
|
// Base
|
||||||
import * as base from './_crud-base'
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
const path = '/api/vclaim/v1/reference/healthcare'
|
const path = '/api/v1/reference/healthcare'
|
||||||
const name = 'healthcare'
|
const name = 'healthcare'
|
||||||
|
|
||||||
export function getList(params: any = null) {
|
export function getList(params: any = null) {
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
// Base
|
// Base
|
||||||
import * as base from './_crud-base'
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
const path = '/api/vclaim/v1/reference/medicine'
|
const path = '/api/v1/reference/medicine'
|
||||||
const name = 'medicine'
|
const name = 'medicine'
|
||||||
|
|
||||||
export function getList(params: any = null) {
|
export function getList(params: any = null) {
|
||||||
return base.getList(path, params, name)
|
const url = path
|
||||||
|
return base.getList(url, params, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
|
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Base
|
// Base
|
||||||
import * as base from './_crud-base'
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
const path = '/api/vclaim/v1/member'
|
const path = '/api/v1/member'
|
||||||
const name = 'member'
|
const name = 'member'
|
||||||
|
|
||||||
export function getList(params: any = null) {
|
export function getList(params: any = null) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Base
|
// Base
|
||||||
import * as base from './_crud-base'
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
const path = '/api/vclaim/v1/monitoring/hist'
|
const path = '/api/v1/monitoring/hist'
|
||||||
const name = 'monitoring-history'
|
const name = 'monitoring-history'
|
||||||
|
|
||||||
export function getList(params: any = null) {
|
export function getList(params: any = null) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Base
|
// Base
|
||||||
import * as base from './_crud-base'
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
const path = '/api/vclaim/v1/monitoring/visit'
|
const path = '/api/v1/monitoring/visit'
|
||||||
const name = 'monitoring-visit'
|
const name = 'monitoring-visit'
|
||||||
|
|
||||||
export async function getList(params: any = null) {
|
export async function getList(params: any = null) {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// Base
|
// Base
|
||||||
import * as base from './_crud-base'
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
const path = '/api/vclaim-swagger/Rujukan/RS'
|
const path = '/api/v1/referral'
|
||||||
const name = 'rujukan-rumah-sakit'
|
const name = 'reference-hospital-letter' // 'rujukan-rumah-sakit'
|
||||||
|
|
||||||
export function getList(params: any = null) {
|
export function getList(params: any = null) {
|
||||||
let url = path
|
let url = path
|
||||||
@@ -13,4 +13,4 @@ export function getList(params: any = null) {
|
|||||||
delete params.letterNumber
|
delete params.letterNumber
|
||||||
}
|
}
|
||||||
return base.getList(url, params, name)
|
return base.getList(url, params, name)
|
||||||
}
|
}
|
||||||
@@ -13,4 +13,4 @@ export function getList(params: any = null) {
|
|||||||
delete params.letterNumber
|
delete params.letterNumber
|
||||||
}
|
}
|
||||||
return base.getList(url, params, name)
|
return base.getList(url, params, name)
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// Base
|
// Base
|
||||||
import * as base from './_crud-base'
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
const path = '/api/vclaim/v1/reference/regency'
|
const path = '/api/v1/reference/regency'
|
||||||
const name = 'cities'
|
const name = 'cities'
|
||||||
|
|
||||||
export function getList(params: any = null) {
|
export function getList(params: any = null) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Base
|
// Base
|
||||||
import * as base from './_crud-base'
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
const path = '/api/vclaim/v1/reference/district'
|
const path = '/api/v1/reference/district'
|
||||||
const name = 'districts'
|
const name = 'districts'
|
||||||
|
|
||||||
export function getList(params: any = null) {
|
export function getList(params: any = null) {
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
// Base
|
// Base
|
||||||
import * as base from './_crud-base'
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
const path = '/api/vclaim/v1/reference/province'
|
const path = '/api/v1/reference/province'
|
||||||
const name = 'provinces'
|
const name = 'provinces'
|
||||||
|
|
||||||
export function getList(params: any = null) {
|
export function getList(params: any = null) {
|
||||||
return base.getList(path, params, name)
|
const url = path
|
||||||
|
return base.getList(url, params, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
|
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
|
||||||
|
|||||||
@@ -4,18 +4,32 @@ import * as base from './_crud-base'
|
|||||||
// Types
|
// Types
|
||||||
import type { IntegrationBpjsFormData } from '~/schemas/integration-bpjs.schema'
|
import type { IntegrationBpjsFormData } from '~/schemas/integration-bpjs.schema'
|
||||||
|
|
||||||
const path = '/api/vclaim-swagger/sep'
|
const path = '/api/v1/vclaim-sep'
|
||||||
|
const pathOld = '/api/vclaim-swagger/sep'
|
||||||
const name = 'sep'
|
const name = 'sep'
|
||||||
|
|
||||||
// TODO: temporary destinationClinic
|
// TODO: temporary destinationClinic
|
||||||
const destinationClinic = '1323R001'
|
const destinationClinic = '1323R001'
|
||||||
|
|
||||||
export function create(data: any) {
|
export function create(data: any) {
|
||||||
return base.create(path, data, name)
|
const isNew = true
|
||||||
|
let url = !isNew ? pathOld : path
|
||||||
|
let payload: any = data
|
||||||
|
if (isNew && data?.encounterId) {
|
||||||
|
payload = {
|
||||||
|
encounter_id: Number(data.encounterId) || 0,
|
||||||
|
requestPayload: data?.request ? JSON.stringify({ request: data.request }) : null,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
url = pathOld
|
||||||
|
delete payload.encounterId
|
||||||
|
}
|
||||||
|
return base.create(url, payload, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getList(params: any = null) {
|
export function getList(params: any = null) {
|
||||||
let url = path
|
const isNew = true
|
||||||
|
let url = !isNew ? pathOld : path
|
||||||
if (params?.number) {
|
if (params?.number) {
|
||||||
url += `/${params.number}`
|
url += `/${params.number}`
|
||||||
delete params.number
|
delete params.number
|
||||||
@@ -24,12 +38,18 @@ export function getList(params: any = null) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getDetail(id: number | string) {
|
export function getDetail(id: number | string) {
|
||||||
return base.getDetail(path, id, name)
|
const isNew = true
|
||||||
|
const url = !isNew ? pathOld : path
|
||||||
|
return base.getDetail(url, id, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function remove(payload: any) {
|
export function remove(id: string) {
|
||||||
const url = `${path}`
|
const url = `${path}/${id}`
|
||||||
return base.removeCustom(url, payload, name)
|
return base.removeCustom(url, {}, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function removeOld(payload: any) {
|
||||||
|
return base.removeCustom(pathOld, payload, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function makeSepData(
|
export function makeSepData(
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Base
|
// Base
|
||||||
import * as base from './_crud-base'
|
import * as base from './_crud-base'
|
||||||
|
|
||||||
const path = '/api/vclaim/v1/reference/unit'
|
const path = '/api/v1/reference/unit'
|
||||||
const name = 'unit'
|
const name = 'unit'
|
||||||
|
|
||||||
export function getList(params: any = null) {
|
export function getList(params: any = null) {
|
||||||
|
|||||||
@@ -5,11 +5,9 @@ export default defineNuxtConfig({
|
|||||||
devtools: { enabled: true },
|
devtools: { enabled: true },
|
||||||
runtimeConfig: {
|
runtimeConfig: {
|
||||||
API_ORIGIN: process.env.NUXT_API_ORIGIN || 'http://localhost:3000',
|
API_ORIGIN: process.env.NUXT_API_ORIGIN || 'http://localhost:3000',
|
||||||
VCLAIM: process.env.NUXT_API_VCLAIM || 'http://localhost:3000',
|
|
||||||
VCLAIM_SWAGGER: process.env.NUXT_API_VCLAIM_SWAGGER || 'http://localhost:3000',
|
VCLAIM_SWAGGER: process.env.NUXT_API_VCLAIM_SWAGGER || 'http://localhost:3000',
|
||||||
public: {
|
public: {
|
||||||
API_ORIGIN: process.env.NUXT_API_ORIGIN || 'http://localhost:3000',
|
API_ORIGIN: process.env.NUXT_API_ORIGIN || 'http://localhost:3000',
|
||||||
VCLAIM: process.env.NUXT_API_VCLAIM || 'http://localhost:3000',
|
|
||||||
VCLAIM_SWAGGER: process.env.NUXT_API_VCLAIM_SWAGGER || 'http://localhost:3000',
|
VCLAIM_SWAGGER: process.env.NUXT_API_VCLAIM_SWAGGER || 'http://localhost:3000',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,15 +7,11 @@ export default defineEventHandler(async (event) => {
|
|||||||
const config = useRuntimeConfig()
|
const config = useRuntimeConfig()
|
||||||
|
|
||||||
const apiOrigin = config.public.API_ORIGIN
|
const apiOrigin = config.public.API_ORIGIN
|
||||||
const apiVclaim = config.public.VCLAIM
|
|
||||||
const apiVclaimSwagger = config.public.VCLAIM_SWAGGER
|
const apiVclaimSwagger = config.public.VCLAIM_SWAGGER
|
||||||
const pathname = url.pathname.replace(/^\/api/, '')
|
const pathname = url.pathname.replace(/^\/api/, '')
|
||||||
const isVclaim = pathname.includes('/vclaim')
|
const isVclaim = pathname.includes('/vclaim') && !pathname.includes('/vclaim-sep')
|
||||||
|
|
||||||
let targetUrl = apiOrigin + pathname + (url.search || '')
|
let targetUrl = apiOrigin + pathname + (url.search || '')
|
||||||
if (pathname.includes('/vclaim')) {
|
|
||||||
targetUrl = apiVclaim + pathname.replace('/vclaim', '') + (url.search || '')
|
|
||||||
}
|
|
||||||
if (pathname.includes('/vclaim-swagger')) {
|
if (pathname.includes('/vclaim-swagger')) {
|
||||||
targetUrl = apiVclaimSwagger + pathname.replace('/vclaim-swagger', '') + (url.search || '')
|
targetUrl = apiVclaimSwagger + pathname.replace('/vclaim-swagger', '') + (url.search || '')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user