feat: add new encounter entry form and handler with VClaim SEP and member validation.
This commit is contained in:
@@ -61,6 +61,8 @@ const [sepNumber, sepNumberAttrs] = defineField('sepNumber')
|
||||
const [patientName, patientNameAttrs] = defineField('patientName')
|
||||
const [nationalIdentity, nationalIdentityAttrs] = defineField('nationalIdentity')
|
||||
const [medicalRecordNumber, medicalRecordNumberAttrs] = defineField('medicalRecordNumber')
|
||||
const [sepFile, sepFileAttrs] = defineField('sepFile')
|
||||
const [sippFile, sippFileAttrs] = defineField('sippFile')
|
||||
const patientId = ref('')
|
||||
const sepReference = ref('')
|
||||
const sepControlDate = ref('')
|
||||
@@ -548,6 +550,8 @@ defineExpose({
|
||||
placeholder=""
|
||||
:accept="['pdf', 'jpg', 'png']"
|
||||
:max-size-mb="1"
|
||||
v-model="sepFile"
|
||||
v-bind="sepFileAttrs"
|
||||
/>
|
||||
<span class="mt-1 text-sm text-gray-500">
|
||||
{{ noteFile }}
|
||||
@@ -561,6 +565,8 @@ defineExpose({
|
||||
placeholder=""
|
||||
:accept="['pdf', 'jpg', 'png']"
|
||||
:max-size-mb="1"
|
||||
v-model="sippFile"
|
||||
v-bind="sippFileAttrs"
|
||||
/>
|
||||
<span class="mt-1 text-sm text-gray-500">
|
||||
{{ noteFile }}
|
||||
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
} from '~/services/encounter.service'
|
||||
import { getList as getMemberList } from '~/services/vclaim-member.service'
|
||||
import { getList as getSepList } from '~/services/vclaim-sep.service'
|
||||
import { uploadAttachment } from '~/services/supporting-document.service'
|
||||
|
||||
// Handlers
|
||||
import {
|
||||
@@ -64,6 +65,8 @@ export function useEncounterEntry(props: {
|
||||
const isCheckingSep = ref(false)
|
||||
const sepNumber = ref('')
|
||||
const vclaimReference = ref<any>(null)
|
||||
const sepFile = ref<File | null>(null)
|
||||
const sippFile = ref<File | null>(null)
|
||||
|
||||
const isEditMode = computed(() => props.id > 0)
|
||||
|
||||
@@ -577,6 +580,17 @@ export function useEncounterEntry(props: {
|
||||
console.log('📤 [SAVE] API Response:', { success: result.success, message: result.body?.message })
|
||||
|
||||
if (result.success) {
|
||||
// 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({
|
||||
title: 'Berhasil',
|
||||
description: isEditMode.value ? 'Kunjungan berhasil diperbarui' : 'Kunjungan berhasil dibuat',
|
||||
@@ -611,6 +625,8 @@ export function useEncounterEntry(props: {
|
||||
paymentsList,
|
||||
sepsList,
|
||||
sepNumber,
|
||||
sepFile,
|
||||
sippFile,
|
||||
participantGroupsList,
|
||||
specialistsTree,
|
||||
doctorsList,
|
||||
|
||||
@@ -344,6 +344,8 @@ export const uploadCode: Record<string, string> = {
|
||||
kk: 'person-family-card',
|
||||
paspor: 'person-passport',
|
||||
'mcu-report': 'mcu-item-result',
|
||||
'vclaim-sep': 'vclaim-sep',
|
||||
'vclaim-sipp': 'vclaim-sipp',
|
||||
} as const
|
||||
|
||||
export type UploadCodeKey = keyof typeof uploadCode
|
||||
|
||||
Reference in New Issue
Block a user