Add: No toast notification system or success feedback + No corrections/supersession UI

This commit is contained in:
voltsrage
2026-06-27 16:36:35 +08:00
parent efd3974d1f
commit 2d36d1a5dd
15 changed files with 598 additions and 29 deletions
+24 -1
View File
@@ -9,6 +9,7 @@ import type {
DraftObservation,
BatchListResponse,
FieldCheck,
PatientDigitizationHistoryResponse,
} from '../types'
export const useBatchStore = defineStore('batches', () => {
@@ -68,13 +69,15 @@ export const useBatchStore = defineStore('batches', () => {
file: File,
batchType: string,
track: string,
patientId?: string
patientId?: string,
supersedesBatchId?: string,
): Promise<BatchDetailResponse | null> {
loading.value = true
error.value = null
try {
const fields: Record<string, string> = { batchType, track }
if (patientId) fields.patientId = patientId
if (supersedesBatchId) fields.supersedesBatchId = supersedesBatchId
const response = await uploadFile<BatchDetailResponse>(
'digitization-batches',
@@ -194,6 +197,25 @@ async function assignBatch(batchId: string, entryClerkUserId: string): Promise<v
return { data: response.data ?? undefined }
}
async function getPatientHistory(patientId: string): Promise<PatientDigitizationHistoryResponse | null> {
loading.value = true
error.value = null
try {
const response = await get<PatientDigitizationHistoryResponse>(
`patients/${patientId}/digitization-history`,
)
if (response.success && response.data) {
return response.data
}
return null
} catch (e: unknown) {
error.value = e instanceof Error ? e.message : 'Failed to load patient history'
return null
} finally {
loading.value = false
}
}
return {
batches,
currentBatch,
@@ -216,5 +238,6 @@ async function assignBatch(batchId: string, entryClerkUserId: string): Promise<v
verifyBatch,
rejectBatch,
approveBatch,
getPatientHistory,
}
})