-- https://www.phpmyadmin.net/
--

START TRANSACTION;



-- --------------------------------------------------------

--
-- Table structure for table `jadwal_dokter`
--

CREATE TABLE `jadwal_dokter` (
  `kd_jadwal` int(10) UNSIGNED NOT NULL,
  `id_dokter` int(10) UNSIGNED NOT NULL,
  `jadwal_hari` varchar(225) NOT NULL,
  `jadwal_jam` varchar(225) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `jadwal_dokter`
--

INSERT INTO `jadwal_dokter` (`kd_jadwal`, `id_dokter`, `jadwal_hari`, `jadwal_jam`) VALUES
(6, 3, 'Senin', '10.00 - 15.00'),
(13, 14, 'Kamis', '10.00-18.00'),
(108, 3, 'Senin', '10.00-18.00'),
(109, 3, 'Rabu', '10.00 - 18.00'),
(110, 14, 'Senin', '12.00 - 17.00'),
(111, 3, 'Jumat', '12.00 - 17.00');

-- --------------------------------------------------------

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `version` varchar(255) NOT NULL,
  `class` varchar(255) NOT NULL,
  `group` varchar(255) NOT NULL,
  `namespace` varchar(255) NOT NULL,
  `time` int(11) NOT NULL,
  `batch` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `version`, `class`, `group`, `namespace`, `time`, `batch`) VALUES
(1, '2022-11-26-054030', 'App\\Database\\Migrations\\Admin', 'default', 'App', 1669441929, 1),
(2, '2022-11-28-064220', 'App\\Database\\Migrations\\RekamMedis', 'default', 'App', 1669622846, 2),
(3, '2022-11-28-075952', 'App\\Database\\Migrations\\RekamMedis', 'default', 'App', 1669622867, 3),
(4, '2022-12-01-081322', 'App\\Database\\Migrations\\Dokter', 'default', 'App', 1669882532, 4),
(5, '2022-12-01-162321', 'App\\Database\\Migrations\\RekamMedis', 'default', 'App', 1669912752, 5),
(6, '2022-12-03-071206', 'App\\Database\\Migrations\\Admin', 'default', 'App', 1670051610, 6),
(8, '2022-12-03-165815', 'App\\Database\\Migrations\\JadwalDokter', 'default', 'App', 1670087121, 7),
(9, '2022-12-05-111403', 'App\\Database\\Migrations\\UserAkun', 'default', 'App', 1670239035, 8),
(10, '2022-12-06-035927', 'App\\Database\\Migrations\\ResepObat', 'default', 'App', 1670367203, 9),
(11, '2022-12-07-003901', 'App\\Database\\Migrations\\StokObat', 'default', 'App', 1670373694, 10),
(12, '2022-12-07-004206', 'App\\Database\\Migrations\\ObatMasuk', 'default', 'App', 1670374097, 11),
(13, '2022-12-07-004842', 'App\\Database\\Migrations\\ObatKeluar', 'default', 'App', 1670374201, 12),
(14, '2022-12-07-005112', 'App\\Database\\Migrations\\Reservasi', 'default', 'App', 1670374747, 13);

-- --------------------------------------------------------

--
-- Table structure for table `obat_keluar`
--

CREATE TABLE `obat_keluar` (
  `kd_obat_keluar` int(10) UNSIGNED NOT NULL,
  `kd_obat` int(10) UNSIGNED NOT NULL,
  `tanggal_keluar` varchar(225) DEFAULT NULL,
  `jumlah_obat` int(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `obat_keluar`
--

INSERT INTO `obat_keluar` (`kd_obat_keluar`, `kd_obat`, `tanggal_keluar`, `jumlah_obat`) VALUES
(1, 2, '2022-12-13', 2),
(2, 1, '2022-12-23', 3),
(3, 1, '2022-12-17', 10),
(4, 1, '2022-12-17', 10),
(8, 6, '2022-12-23', 10),
(9, 2, '2023-01-23', 50);

-- --------------------------------------------------------

--
-- Table structure for table `obat_masuk`
--

CREATE TABLE `obat_masuk` (
  `kd_obat_masuk` int(10) UNSIGNED NOT NULL,
  `kd_obat` int(10) UNSIGNED NOT NULL,
  `tanggal_masuk` varchar(225) NOT NULL,
  `tanggal_kadarluarsa` varchar(225) NOT NULL,
  `jumlah_obat` int(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `obat_masuk`
--

INSERT INTO `obat_masuk` (`kd_obat_masuk`, `kd_obat`, `tanggal_masuk`, `tanggal_kadarluarsa`, `jumlah_obat`) VALUES
(1, 2, '2022-12-13', '2027-06-13', 10),
(4, 2, '2022-12-17', '2026-10-17', 30),
(6, 1, '2022-12-19', '2024-11-05', 30),
(9, 1, '2022-12-16', '2024-09-17', 30),
(10, 1, '2022-12-17', '2024-09-17', 10),
(11, 2, '2022-12-17', '2022-12-28', 10),
(15, 6, '2022-12-23', '2024-10-21', 10),
(16, 2, '2023-01-20', '2023-01-26', 100);

-- --------------------------------------------------------

--
-- Table structure for table `pasien`
--

CREATE TABLE `pasien` (
  `kd_pasien` int(10) UNSIGNED NOT NULL,
  `nama_pemilik` varchar(50) NOT NULL,
  `nama_hewan` varchar(50) NOT NULL,
  `jenis_hewan` varchar(50) NOT NULL,
  `jenis_kelamin` varchar(50) NOT NULL,
  `umur` varchar(10) NOT NULL,
  `alamat` varchar(225) NOT NULL,
  `no_telp` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `pasien`
--

INSERT INTO `pasien` (`kd_pasien`, `nama_pemilik`, `nama_hewan`, `jenis_hewan`, `jenis_kelamin`, `umur`, `alamat`, `no_telp`) VALUES
(62, 'Bu Sulistya', 'Yelly', 'Kucing Persian/Orange', 'Betina', '2 Tahun', 'Heliconia AG 00 no 79', 817432678),
(63, 'Bu Sulistya', 'Fully', 'Kucing Persian/Orange', 'Betina', '-', 'Heliconia AG 00 no 79', 817432678),
(64, 'Nn Adila ', 'Bunny', 'Kelinci Anggora Lokal / putih', '-', '-', 'Edelweis BB 10/03', 81290042838),
(65, 'Ny Lani', 'Marmut Putih', 'Marmut/ putih', 'Betina', '-', 'Hijau N05/50', 82125055897),
(66, 'Tn Ridwan', 'Otter Naga', 'Otter', 'Jantan', '4 Bulan', 'Jatimekar', 0),
(67, 'Ny Reni', 'Cimin', 'Hamster', '-', '2 Tahun', 'Bougenville Ai 35/12', 8568918822);

-- --------------------------------------------------------

--
-- Table structure for table `rekam_medis`
--

CREATE TABLE `rekam_medis` (
  `kd_rekam_medis` int(10) UNSIGNED NOT NULL,
  `kd_pasien` int(10) UNSIGNED NOT NULL,
  `id_dokter` int(10) UNSIGNED NOT NULL,
  `tanggal_periksa` varchar(25) NOT NULL,
  `anamnesa` varchar(225) NOT NULL,
  `diagnosa` varchar(225) NOT NULL,
  `terapi` varchar(225) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `rekam_medis`
--

INSERT INTO `rekam_medis` (`kd_rekam_medis`, `kd_pasien`, `id_dokter`, `tanggal_periksa`, `anamnesa`, `diagnosa`, `terapi`) VALUES
(55, 62, 13, '2021-09-08', 'BB :  2,4Kg T : 38\'C Ingus kental, makan minum oke', 'Flu', 'R/ Racikan obat flu (doxy) Steril'),
(56, 62, 13, '2021-10-06', 'BB : 2,65 Kg T : 37,7 Ingus bening', 'Flu', 'R/ Racikan Obat flu (doxy)'),
(57, 62, 13, '2021-11-01', 'BB :  2,5 Kg T : 38,1C Kucing bersin” lagi dan kadang beruntun, nyebarin ingus kemana”, ada jamur di perut bagian kiri', 'Flu + dermatofitosis', 'Nebu R/ Racikan flu (Cefadroxil) R/ Salep combiderm'),
(59, 62, 13, '2022-03-30', 'BB :  3,010 Kg T : 37,9C Semua bagus ', 'Sehat', 'Inj/ F4 + R'),
(60, 63, 13, '2021-07-28', 'BB : 2,5Kg T : 39C Keluhan : kucing tidak mau makan, ada radang di mulut, bersin” dan ingusan ijo, ada luka terbuka d punggung', 'Radang, flu, abses', 'R/ cefadroxil + racikan obat flu R/ methyl R/ levertran + enbatic R/ technode R/ Vitamin TF'),
(62, 63, 13, '2021-08-19', 'BB : 2,5Kg T : 39C Kucing masih gamau makan, ingusan ijo dan berdarah, radang masih ada dan sedikit', 'Chronic gingivitis Stomatitis Rhinitis', 'Inj/ Cefotaxime Inj/ Fluimucil Inj/ Vitamin Inj/ Hemostop Inj/ Ondan  Sangobion '),
(64, 63, 13, '2021-08-25', 'BB : 2,5Kg T : 39C Kucing sudah mau pulang tiba” ingusan ijo lagi, dan sedkit berdarah lagi', 'Rhinitis', 'R/ vitamin TF R/ cefadroxil + racikan obat flu + nexitra'),
(65, 64, 13, '2021-08-24', 'BB :  2,4Kg T : 39,4C Kelinci sering di depan rumah, matanya merah belekan, nafsu mkan minum bagus', 'konjungtivitis', 'R/ cendo genta'),
(66, 64, 13, '2022-07-11', 'BB : 3,4 Kg T : 39,7 Makan minum bagus, pup juga normal, ada kutu', 'Infestasi ektoparasit', 'R/ ivomec + dipen 0,1cc 60'),
(67, 64, 13, '2022-09-24', 'BB : 3,53 Kg T : 38,2 Makan minum banyak, kutu masih ada yg di bagian belakang', 'Infestasi ektoparasit', 'R/ revolution'),
(69, 65, 13, '2021-08-16', 'BB :  500g T : C Makan minum bagus habis dikasih minyak ikan nafsu makan jadi meningkat pupup bagus, masih suka ronto kadang”', 'Sehat ', 'Potong kuku Potong gigi'),
(70, 65, 13, '2021-10-29', 'BB : Makan minum normal, pup sempat lembek tp sudah mulai normal lg. gigi memanjang tp gigi bawah goyang.', '-', 'Potong kuku dan gigi. R/ Oral gel oxyfresh'),
(72, 65, 13, '2022-01-17', 'BB : Makan minum normal, pup sempat lembek tp sudah mulai normal lg. gigi memanjang tp gigi bawah goyang.', '-', 'Potong kuku dan gigi. R/ Oral gel oxyfresh'),
(74, 66, 13, '2022-10-16', 'BB : 1,6 Kg T : 40,3C Ngga mau makan dan lemes sejak 2 hari, pupup diare encer, hidung agak basah dikit. Berenang juga agak males2an.', 'Enteritis, Bisa krn giardia juga', 'R/ metro + Vit B12, curcuma R/ guanistrep'),
(76, 67, 13, '2022-10-12', 'BB : 62g T : C Tiba” lemes, dicek ada abses di kaki kanan bawah dan kaki kiri atas.', 'Luka abses ', 'Inj/ interflox');

-- --------------------------------------------------------

--
-- Table structure for table `resep_obat`
--

CREATE TABLE `resep_obat` (
  `kd_resep_obat` int(10) UNSIGNED NOT NULL,
  `kd_pasien` int(10) UNSIGNED NOT NULL,
  `id` int(10) UNSIGNED NOT NULL,
  `kd_rekam_medis` int(10) UNSIGNED NOT NULL,
  `keterangan` varchar(225) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `resep_obat`
--

INSERT INTO `resep_obat` (`kd_resep_obat`, `kd_pasien`, `id`, `kd_rekam_medis`, `keterangan`) VALUES
(16, 62, 10, 55, 'Racikan obat flu & melakukan steril'),
(17, 62, 10, 56, 'Racikan obat Flu'),
(18, 62, 10, 57, 'Raciksan Obat flu & Salep Combiderm'),
(19, 63, 10, 60, 'Racikan Obat Flu & Vitamin'),
(20, 63, 10, 62, 'Vitamin & Sangobion'),
(21, 64, 10, 65, 'Racikan cendo genta'),
(22, 64, 10, 66, 'racikan ivomec'),
(23, 65, 10, 69, 'Potong kuku Potong gigi'),
(24, 65, 10, 70, 'Potong kuku dan gigi. Dan Oral gel oxyfresh'),
(25, 67, 10, 76, 'Suntikan interflox'),
(26, 66, 10, 74, 'Vit B12, curcuma guanistrep');

-- --------------------------------------------------------

--
-- Table structure for table `reservasi`
--

CREATE TABLE `reservasi` (
  `kd_reservasi` int(10) UNSIGNED NOT NULL,
  `id_user` int(10) UNSIGNED NOT NULL,
  `id_dokter` int(10) UNSIGNED NOT NULL,
  `kd_jadwal` int(10) UNSIGNED NOT NULL,
  `nama` varchar(225) NOT NULL,
  `jam` varchar(225) NOT NULL,
  `keluhan` varchar(225) NOT NULL,
  `status` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `reservasi`
--

INSERT INTO `reservasi` (`kd_reservasi`, `id_user`, `id_dokter`, `kd_jadwal`, `nama`, `jam`, `keluhan`, `status`) VALUES
(1, 4, 3, 6, 'Test', '15.00', 'Flu', 'reject'),
(2, 4, 3, 6, 'Test', '', 'Flu', 'reject'),
(4, 2, 13, 13, 'Zhaliv Ibra Aqlan Pribadi', '10.00', 'Muntah', 'accept'),
(5, 2, 13, 13, 'Shafa Salsabila Pribadi', '12.00', 'Muntah', 'reject'),
(13, 2, 13, 13, 'Shafa Salsabila Pribadi', '10.00', 'Muntah', 'reject'),
(14, 6, 13, 13, 'Jane Doe', '10.00', 'Muntah', 'reject'),
(15, 2, 3, 6, 'Shafa Salsabila Pribadi', '10.00', 'Muntah', 'pending');

-- --------------------------------------------------------

--
-- Table structure for table `stok_obat`
--

CREATE TABLE `stok_obat` (
  `kd_obat` int(10) UNSIGNED NOT NULL,
  `jenis_obat` varchar(225) NOT NULL,
  `nama_obat` varchar(225) NOT NULL,
  `jumlah_obat` varchar(225) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `stok_obat`
--

INSERT INTO `stok_obat` (`kd_obat`, `jenis_obat`, `nama_obat`, `jumlah_obat`) VALUES
(1, 'Generik', 'Amoxilin', '69'),
(2, 'Antibiotik', 'Paracetamol', '108'),
(6, 'Antibiotik', 'Sangobion', '10'),
(7, 'Antibioyik', 'Paracetamol', '0');

--
-- Indexes for table `jadwal_dokter`
--
ALTER TABLE `jadwal_dokter`
  ADD PRIMARY KEY (`kd_jadwal`) USING BTREE,
  ADD KEY `jadwal_dokter_id_dokter_foreign` (`id_dokter`) USING BTREE;

--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`) USING BTREE;

--
-- Indexes for table `obat_keluar`
--
ALTER TABLE `obat_keluar`
  ADD PRIMARY KEY (`kd_obat_keluar`) USING BTREE,
  ADD KEY `obat_keluar_kd_obat_foreign` (`kd_obat`) USING BTREE;

--
-- Indexes for table `obat_masuk`
--
ALTER TABLE `obat_masuk`
  ADD PRIMARY KEY (`kd_obat_masuk`) USING BTREE,
  ADD KEY `obat_masuk_kd_obat_foreign` (`kd_obat`) USING BTREE;

--
-- Indexes for table `pasien`
--
ALTER TABLE `pasien`
  ADD PRIMARY KEY (`kd_pasien`) USING BTREE;

--
-- Indexes for table `rekam_medis`
--
ALTER TABLE `rekam_medis`
  ADD PRIMARY KEY (`kd_rekam_medis`) USING BTREE,
  ADD KEY `rekam_medis_id_dokter_foreign` (`id_dokter`) USING BTREE,
  ADD KEY `rekam_medis_kd_pasien_foreign` (`kd_pasien`) USING BTREE;

--
-- Indexes for table `resep_obat`
--
ALTER TABLE `resep_obat`
  ADD PRIMARY KEY (`kd_resep_obat`) USING BTREE,
  ADD KEY `resep_obat_kd_rekam_medis_foreign` (`kd_rekam_medis`) USING BTREE,
  ADD KEY `resep_obat_kd_pasien_foreign` (`kd_pasien`) USING BTREE,
  ADD KEY `resep_obat_id_foreign` (`id`) USING BTREE;

--
-- Indexes for table `reservasi`
--
ALTER TABLE `reservasi`
  ADD PRIMARY KEY (`kd_reservasi`) USING BTREE,
  ADD KEY `reservasi_id_user_foreign` (`id_user`) USING BTREE,
  ADD KEY `reservasi_id_dokter_foreign` (`id_dokter`) USING BTREE,
  ADD KEY `reservasi_kd_jadwal_foreign` (`kd_jadwal`) USING BTREE;

--
-- Indexes for table `stok_obat`
--
ALTER TABLE `stok_obat`
  ADD PRIMARY KEY (`kd_obat`) USING BTREE;

--
-- AUTO_INCREMENT for table `jadwal_dokter`
--
ALTER TABLE `jadwal_dokter`
  MODIFY `kd_jadwal` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=112;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `obat_keluar`
--
ALTER TABLE `obat_keluar`
  MODIFY `kd_obat_keluar` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `obat_masuk`
--
ALTER TABLE `obat_masuk`
  MODIFY `kd_obat_masuk` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT for table `pasien`
--
ALTER TABLE `pasien`
  MODIFY `kd_pasien` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=72;

--
-- AUTO_INCREMENT for table `rekam_medis`
--
ALTER TABLE `rekam_medis`
  MODIFY `kd_rekam_medis` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=93;

--
-- AUTO_INCREMENT for table `resep_obat`
--
ALTER TABLE `resep_obat`
  MODIFY `kd_resep_obat` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;

--
-- AUTO_INCREMENT for table `reservasi`
--
ALTER TABLE `reservasi`
  MODIFY `kd_reservasi` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT for table `stok_obat`
--
ALTER TABLE `stok_obat`
  MODIFY `kd_obat` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `jadwal_dokter`
--
ALTER TABLE `jadwal_dokter`
  ADD CONSTRAINT `jadwal_dokter_id_dokter_foreign` FOREIGN KEY (`id_dokter`) REFERENCES `dokter` (`id_dokter`);

--
-- Constraints for table `obat_keluar`
--
ALTER TABLE `obat_keluar`
  ADD CONSTRAINT `obat_keluar_kd_obat_foreign` FOREIGN KEY (`kd_obat`) REFERENCES `stok_obat` (`kd_obat`);

--
-- Constraints for table `obat_masuk`
--
ALTER TABLE `obat_masuk`
  ADD CONSTRAINT `obat_masuk_kd_obat_foreign` FOREIGN KEY (`kd_obat`) REFERENCES `stok_obat` (`kd_obat`);

--
-- Constraints for table `rekam_medis`
--
ALTER TABLE `rekam_medis`
  ADD CONSTRAINT `rekam_medis_id_dokter_foreign` FOREIGN KEY (`id_dokter`) REFERENCES `dokter` (`id_dokter`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `rekam_medis_kd_pasien_foreign` FOREIGN KEY (`kd_pasien`) REFERENCES `pasien` (`kd_pasien`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `resep_obat`
--
ALTER TABLE `resep_obat`
  ADD CONSTRAINT `resep_obat_id_foreign` FOREIGN KEY (`id`) REFERENCES `paramedis` (`id`),
  ADD CONSTRAINT `resep_obat_kd_pasien_foreign` FOREIGN KEY (`kd_pasien`) REFERENCES `pasien` (`kd_pasien`),
  ADD CONSTRAINT `resep_obat_kd_rekam_medis_foreign` FOREIGN KEY (`kd_rekam_medis`) REFERENCES `rekam_medis` (`kd_rekam_medis`);

--
-- Constraints for table `reservasi`
--
ALTER TABLE `reservasi`
  ADD CONSTRAINT `reservasi_id_dokter_foreign` FOREIGN KEY (`id_dokter`) REFERENCES `dokter` (`id_dokter`),
  ADD CONSTRAINT `reservasi_id_user_foreign` FOREIGN KEY (`id_user`) REFERENCES `user_akun` (`id_user`),
  ADD CONSTRAINT `reservasi_kd_jadwal_foreign` FOREIGN KEY (`kd_jadwal`) REFERENCES `jadwal_dokter` (`kd_jadwal`);
COMMIT;

