update logika pemanggilan, sticky konten, tampilan card
This commit is contained in:
+38
-3
@@ -754,7 +754,8 @@ export const useQueueStore = defineStore('queue', () => {
|
||||
allPatients.value[patientIndex] = {
|
||||
...allPatients.value[patientIndex],
|
||||
status: "di-loket",
|
||||
processStage: "klinik"
|
||||
processStage: "klinik",
|
||||
calledByAdmin: false // Reset flag saat pindah stage
|
||||
};
|
||||
message = `Pasien ${patientCode} berhasil check in dan masuk ke Tabel Loket Klinik`;
|
||||
}
|
||||
@@ -784,7 +785,8 @@ export const useQueueStore = defineStore('queue', () => {
|
||||
case "terlambat":
|
||||
allPatients.value[patientIndex] = {
|
||||
...allPatients.value[patientIndex],
|
||||
status: "terlambat"
|
||||
status: "terlambat",
|
||||
calledByAdmin: false // Reset flag
|
||||
};
|
||||
if (currentProcessingPatient.value[adminType]?.no === patient.no) {
|
||||
currentProcessingPatient.value[adminType] = null;
|
||||
@@ -795,7 +797,8 @@ export const useQueueStore = defineStore('queue', () => {
|
||||
case "pending":
|
||||
allPatients.value[patientIndex] = {
|
||||
...allPatients.value[patientIndex],
|
||||
status: "pending"
|
||||
status: "pending",
|
||||
calledByAdmin: false // Reset flag
|
||||
};
|
||||
if (currentProcessingPatient.value[adminType]?.no === patient.no) {
|
||||
currentProcessingPatient.value[adminType] = null;
|
||||
@@ -891,6 +894,35 @@ export const useQueueStore = defineStore('queue', () => {
|
||||
};
|
||||
};
|
||||
|
||||
const callProcessingPatient = (adminType = 'loket') => {
|
||||
// Panggil pasien yang sedang diproses untuk ditampilkan di layar anjungan
|
||||
const processingPatient = currentProcessingPatient.value[adminType];
|
||||
|
||||
if (!processingPatient) {
|
||||
return { success: false, message: "Tidak ada pasien yang sedang diproses" };
|
||||
}
|
||||
|
||||
// Update flag calledByAdmin
|
||||
const patientIndex = allPatients.value.findIndex(p => p.no === processingPatient.no);
|
||||
if (patientIndex !== -1) {
|
||||
allPatients.value[patientIndex] = {
|
||||
...allPatients.value[patientIndex],
|
||||
calledByAdmin: true,
|
||||
lastCalledAt: new Date().toISOString()
|
||||
};
|
||||
|
||||
// Update currentProcessingPatient with the new data
|
||||
currentProcessingPatient.value[adminType] = allPatients.value[patientIndex];
|
||||
|
||||
return {
|
||||
success: true,
|
||||
message: `Memanggil pasien ${processingPatient.noAntrian.split(" |")[0]}`
|
||||
};
|
||||
}
|
||||
|
||||
return { success: false, message: "Gagal memanggil pasien" };
|
||||
};
|
||||
|
||||
const createAntreanKlinik = (klinik, patient = null, adminType = 'loket') => {
|
||||
const newNo = allPatients.value.length + 1;
|
||||
const timestamp = new Date();
|
||||
@@ -1016,6 +1048,7 @@ export const useQueueStore = defineStore('queue', () => {
|
||||
calledTindakan: false,
|
||||
lastCalledAt: null,
|
||||
lastCalledTipeLayanan: null,
|
||||
calledByAdmin: false, // Flag untuk tracking apakah sudah dipanggil oleh admin
|
||||
};
|
||||
|
||||
allPatients.value.push(newPatient);
|
||||
@@ -1535,6 +1568,7 @@ export const useQueueStore = defineStore('queue', () => {
|
||||
visitType: visitType,
|
||||
visitDate: visitDate || timestamp.toISOString().substring(0, 10),
|
||||
namaDokter: namaDokter || null, // Nama dokter hanya untuk pasien Eksekutif
|
||||
calledByAdmin: false, // Flag untuk tracking apakah sudah dipanggil oleh admin
|
||||
// Fast Track data
|
||||
penanggungJawab: (isFastTrack && fastTrackData) ? fastTrackData.penanggungJawab : null,
|
||||
alasanFastTrack: (isFastTrack && fastTrackData) ? fastTrackData.alasanFastTrack : null,
|
||||
@@ -1664,6 +1698,7 @@ export const useQueueStore = defineStore('queue', () => {
|
||||
callNext,
|
||||
callMultiplePatients,
|
||||
processPatient,
|
||||
callProcessingPatient,
|
||||
createAntreanKlinik,
|
||||
createAntreanPenunjang,
|
||||
createAntreanKlinikRuang,
|
||||
|
||||
Reference in New Issue
Block a user