Files
web-antrean/stores/clinicStore.js
T

383 lines
9.4 KiB
JavaScript

// stores/clinicStore.js
import { defineStore } from 'pinia';
import { ref, computed } from 'vue';
export const useClinicStore = defineStore('clinic', () => {
// Data clinics dari Anjungan.vue
const clinics = ref([
{
id: 1,
kode: "AN",
name: "ANAK",
subtitle: "",
icon: "mdi-baby-face",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Sarah Putri, Sp.A", "dr. Andi Wijaya, Sp.A"],
shifts: [
{ name: "Shift 1", quota: 15 },
{ name: "Shift 2", quota: 20 }
]
},
{
id: 2,
kode: "AS",
name: "ANESTESI",
subtitle: "",
icon: "mdi-face-mask",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Ahmad Fauzi, Sp.An"],
shifts: [
{ name: "Shift 1", quota: 0 },
{ name: "Shift 2", quota: 12 }
]
},
{
id: 3,
kode: "BD",
name: "BEDAH",
subtitle: "",
icon: "mdi-medical-bag",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Budi Santoso, Sp.B", "dr. Eko Prasetyo, Sp.B", "dr. Dian Permata, Sp.B"],
shifts: [
{ name: "Shift 1", quota: 8 },
{ name: "Shift 2", quota: 10 }
]
},
{
id: 4,
kode: "GR",
name: "GERIATRI",
subtitle: "",
icon: "mdi-human-cane",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Siti Aminah, Sp.PD-KGer"],
shifts: [
{ name: "Shift 1", quota: 10 },
{ name: "Shift 2", quota: 8 }
]
},
{
id: 5,
kode: "GI",
name: "GIGI DAN MULUT",
subtitle: "",
icon: "mdi-tooth",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["drg. Rina Wati, Sp.KG", "drg. Made Surya, Sp.KG"],
shifts: [
{ name: "Shift 1", quota: 18 },
{ name: "Shift 2", quota: 15 }
]
},
{
id: 6,
kode: "GZ",
name: "GIZI",
subtitle: "",
icon: "mdi-food-apple",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Lisa Andriani, Sp.GK"],
shifts: [
{ name: "Shift 1", quota: 12 },
{ name: "Shift 2", quota: 10 }
]
},
{
id: 7,
kode: "HO",
name: "HEMATO ONKOLOGI MEDIS",
subtitle: "",
icon: "mdi-water",
shift: "TUTUP",
schedule: "",
available: false,
doctors: [],
shifts: []
},
{
id: 8,
kode: "IP",
name: "IPD (PENYAKIT DALAM)",
subtitle: "",
icon: "mdi-hospital",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Hendra Wijaya, Sp.PD", "dr. Agus Salim, Sp.PD", "dr. Retno Wulan, Sp.PD", "dr. Bambang Susilo, Sp.PD"],
shifts: [
{ name: "Shift 1", quota: 25 },
{ name: "Shift 2", quota: 20 }
]
},
{
id: 9,
kode: "JT",
name: "JANTUNG (CARDIOLOGI)",
subtitle: "",
icon: "mdi-heart-pulse",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Rudi Hartono, Sp.JP", "dr. Sinta Dewi, Sp.JP"],
shifts: [
{ name: "Shift 1", quota: 14 },
{ name: "Shift 2", quota: 12 }
]
},
{
id: 10,
kode: "JW",
name: "JIWA",
subtitle: "",
icon: "mdi-head-dots-horizontal",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Maya Kusuma, Sp.KJ"],
shifts: [
{ name: "Shift 1", quota: 10 },
{ name: "Shift 2", quota: 8 }
]
},
{
id: 11,
kode: "OB",
name: "KANDUNGAN",
subtitle: "",
icon: "mdi-human-pregnant",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Dewi Lestari, Sp.OG", "dr. Putri Andini, Sp.OG", "dr. Nova Riani, Sp.OG"],
shifts: [
{ name: "Shift 1", quota: 16 },
{ name: "Shift 2", quota: 14 }
]
},
{
id: 12,
kode: "KH", // kode fiktif untuk KEMOTERAPI (belum ada di master klinik)
name: "KEMOTERAPI",
subtitle: "",
icon: "mdi-virus",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Andi Pratama, Sp.PD-KHOM"],
shifts: [
{ name: "Shift 1", quota: 8 },
{ name: "Shift 2", quota: 6 }
]
},
{
id: 13,
kode: "KN", // kode fiktif untuk KOMPLEMENTER (NYERI)
name: "KOMPLEMENTER (NYERI)",
subtitle: "",
icon: "mdi-medical-bag",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Ratna Sari, Sp.KFR"],
shifts: [
{ name: "Shift 1", quota: 10 },
{ name: "Shift 2", quota: 8 }
]
},
{
id: 14,
kode: "KK",
name: "KULIT KELAMIN",
subtitle: "",
icon: "mdi-human-male-female",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Tika Anggraini, Sp.KK", "dr. Fajar Ramadhan, Sp.KK"],
shifts: [
{ name: "Shift 1", quota: 12 },
{ name: "Shift 2", quota: 10 }
]
},
{
id: 15,
kode: "MT",
name: "MATA",
subtitle: "",
icon: "mdi-eye",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Yudi Prasetyo, Sp.M", "dr. Linda Kartika, Sp.M"],
shifts: [
{ name: "Shift 1", quota: 15 },
{ name: "Shift 2", quota: 12 }
]
},
{
id: 16,
kode: "MC", // kode fiktif untuk MCU
name: "MCU",
subtitle: "",
icon: "mdi-clipboard-check",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Fitri Handayani, Sp.OK"],
shifts: [
{ name: "Shift 1", quota: 20 },
{ name: "Shift 2", quota: 15 }
]
},
{
id: 17,
kode: "ON", // kode fiktif untuk ONKOLOGI
name: "ONKOLOGI",
subtitle: "",
icon: "mdi-virus",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Dimas Prakoso, Sp.Onk-Rad"],
shifts: [
{ name: "Shift 1", quota: 10 },
{ name: "Shift 2", quota: 8 }
]
},
{
id: 18,
kode: "PR",
name: "PARU",
subtitle: "",
icon: "mdi-lungs",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Nina Marlina, Sp.P", "dr. Arief Budiman, Sp.P"],
shifts: [
{ name: "Shift 1", quota: 14 },
{ name: "Shift 2", quota: 12 }
]
},
{
id: 19,
kode: "TD", // mengikuti kode pelayanan TD di loket
name: "R. TINDAKAN (EMG, ECG, DLL)",
subtitle: "",
icon: "mdi-waveform",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Fajar Nugroho, Sp.S"],
shifts: [
{ name: "Shift 1", quota: 12 },
{ name: "Shift 2", quota: 10 }
]
},
{
id: 20,
kode: "RT",
name: "RADIOTERAPI",
subtitle: "",
icon: "mdi-radioactive",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Wulan Safitri, Sp.Rad"],
shifts: [
{ name: "Shift 1", quota: 8 },
{ name: "Shift 2", quota: 6 }
]
},
{
id: 21,
kode: "RM",
name: "REHAB MEDIK",
subtitle: "",
icon: "mdi-human-cane",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Gita Permata, Sp.KFR", "dr. Rian Saputra, Sp.KFR"],
shifts: [
{ name: "Shift 1", quota: 16 },
{ name: "Shift 2", quota: 14 }
]
},
{
id: 22,
kode: "SR",
name: "SARAF (NEUROLOGI)",
subtitle: "",
icon: "mdi-head-cog",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: false,
doctors: [],
shifts: []
},
{
id: 23,
kode: "TH", // kode fiktif untuk THT
name: "THT",
subtitle: "",
icon: "mdi-ear-hearing",
shift: "SHIFT 1",
schedule: "Mulai Pukul 07:00",
available: true,
doctors: ["dr. Reza Maulana, Sp.THT-KL"],
shifts: [
{ name: "Shift 1", quota: 12 },
{ name: "Shift 2", quota: 10 }
]
},
]);
// Get all clinics
const getAllClinics = computed(() => clinics.value);
// Get clinic by name (untuk mapping dengan kode klinik)
const getClinicByName = (name) => {
return clinics.value.find(c => c.name === name);
};
// Get clinic by kode (lebih stabil untuk integrasi dengan master klinik & anjungan)
const getClinicByKode = (kode) => {
return clinics.value.find(c => c.kode === kode);
};
// Get clinics list untuk dropdown (format: { name, kode })
// Sekarang langsung pakai kode dari clinic, tidak bergantung ke nama di masterStore
const getClinicsForDropdown = () => {
return clinics.value.map(clinic => ({
name: clinic.name,
kode: clinic.kode,
icon: clinic.icon,
available: clinic.available,
id: clinic.id
}));
};
return {
clinics,
getAllClinics,
getClinicByName,
getClinicByKode,
getClinicsForDropdown,
};
});