feat: add new encounter entry form and handler with VClaim SEP and member validation.
This commit is contained in:
No files matched your search
@@ -61,6 +61,8 @@ 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 sepReference = ref('')
|
||||||
const sepControlDate = ref('')
|
const sepControlDate = ref('')
|
||||||
@@ -548,6 +550,8 @@ defineExpose({
|
|||||||
placeholder=""
|
placeholder=""
|
||||||
:accept="['pdf', 'jpg', 'png']"
|
:accept="['pdf', 'jpg', 'png']"
|
||||||
:max-size-mb="1"
|
:max-size-mb="1"
|
||||||
|
v-model="sepFile"
|
||||||
|
v-bind="sepFileAttrs"
|
||||||
/>
|
/>
|
||||||
<span class="mt-1 text-sm text-gray-500">
|
<span class="mt-1 text-sm text-gray-500">
|
||||||
{{ noteFile }}
|
{{ noteFile }}
|
||||||
@@ -561,6 +565,8 @@ defineExpose({
|
|||||||
placeholder=""
|
placeholder=""
|
||||||
:accept="['pdf', 'jpg', 'png']"
|
:accept="['pdf', 'jpg', 'png']"
|
||||||
:max-size-mb="1"
|
:max-size-mb="1"
|
||||||
|
v-model="sippFile"
|
||||||
|
v-bind="sippFileAttrs"
|
||||||
/>
|
/>
|
||||||
<span class="mt-1 text-sm text-gray-500">
|
<span class="mt-1 text-sm text-gray-500">
|
||||||
{{ noteFile }}
|
{{ noteFile }}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import {
|
|||||||
} from '~/services/encounter.service'
|
} from '~/services/encounter.service'
|
||||||
import { getList as getMemberList } from '~/services/vclaim-member.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 {
|
||||||
@@ -64,6 +65,8 @@ export function useEncounterEntry(props: {
|
|||||||
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 isEditMode = computed(() => props.id > 0)
|
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 })
|
console.log('📤 [SAVE] API Response:', { success: result.success, message: result.body?.message })
|
||||||
|
|
||||||
if (result.success) {
|
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({
|
toast({
|
||||||
title: 'Berhasil',
|
title: 'Berhasil',
|
||||||
description: isEditMode.value ? 'Kunjungan berhasil diperbarui' : 'Kunjungan berhasil dibuat',
|
description: isEditMode.value ? 'Kunjungan berhasil diperbarui' : 'Kunjungan berhasil dibuat',
|
||||||
@@ -611,6 +625,8 @@ export function useEncounterEntry(props: {
|
|||||||
paymentsList,
|
paymentsList,
|
||||||
sepsList,
|
sepsList,
|
||||||
sepNumber,
|
sepNumber,
|
||||||
|
sepFile,
|
||||||
|
sippFile,
|
||||||
participantGroupsList,
|
participantGroupsList,
|
||||||
specialistsTree,
|
specialistsTree,
|
||||||
doctorsList,
|
doctorsList,
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user