feat: implement queue display and management system for loket and clinic modules voice over
This commit is contained in:
No files matched your search
@@ -531,6 +531,11 @@ export const useQueueStore = defineStore('queue', () => {
|
||||
*/
|
||||
const syncApiPatientStatus = (patient, newStatus) => {
|
||||
if (!patient) return;
|
||||
|
||||
// Bersihkan LocalStorage fallback jika status sudah bukan pending/terlambat
|
||||
if (newStatus !== 'pending' && newStatus !== 'terlambat' && patient.barcode) {
|
||||
localStorage.removeItem(`patient-status-${patient.barcode}`);
|
||||
}
|
||||
|
||||
// Allow syncing if strictly 'api' OR if we can find a matching ID in the API store
|
||||
// This handles cases where we have an 'onsite' patient locally that corresponds to an API patient
|
||||
@@ -2224,6 +2229,10 @@ const fetchPatientsForLoket = async (loketId, force = false) => {
|
||||
allPatients.value[patientIndex] = updatedPatient;
|
||||
// Set currentProcessingPatient with isolated key
|
||||
currentProcessingPatient.value[storageKey] = updatedPatient;
|
||||
|
||||
if (shouldUpdateStatus) {
|
||||
syncApiPatientStatus(updatedPatient, "di-loket");
|
||||
}
|
||||
|
||||
// POST to external API when patient is being processed (sedang diproses)
|
||||
try {
|
||||
@@ -2261,6 +2270,7 @@ const fetchPatientsForLoket = async (loketId, force = false) => {
|
||||
};
|
||||
allPatients.value[patientIndex] = updatedPatient;
|
||||
currentProcessingPatient.value[storageKey] = updatedPatient;
|
||||
syncApiPatientStatus(updatedPatient, "di-loket");
|
||||
} else {
|
||||
currentProcessingPatient.value[storageKey] = patient;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user