feat: add new encounter entry form and handler with VClaim SEP and member validation.

This commit is contained in:
riefive
2025-12-02 12:50:14 +07:00
parent 4df67ed979
commit a058fd6659
3 changed files with 24 additions and 0 deletions

No files matched your search

+16
View File
@@ -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,