text: -- phpMyAdmin SQL Dump
  -- version 5.0.1
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: Jul 25, 2020 at 04:11 AM
  -- Server version: 10.4.11-MariaDB
  -- PHP Version: 7.4.3
  
  SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  SET AUTOCOMMIT = 0;
  START TRANSACTION;
  SET time_zone = "+00:00";
  
  
  /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  /*!40101 SET NAMES utf8mb4 */;
  
  --
  -- Database: `rekam_medis`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `dokter`
  --
  
  CREATE TABLE `dokter` (
    `id_dokter` varchar(50) NOT NULL,
    `nama_dokter` varchar(255) NOT NULL,
    `spesialis` varchar(50) NOT NULL,
    `alamat` text NOT NULL,
    `no_telp` varchar(15) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `dokter`
  --
  
  INSERT INTO `dokter` (`id_dokter`, `nama_dokter`, `spesialis`, `alamat`, `no_telp`) VALUES
  ('D01', 'Mustajab', 'saraf', 'cakke', '05451');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `obat`
  --
  
  CREATE TABLE `obat` (
    `id_obat` varchar(50) NOT NULL,
    `nama_obat` varchar(255) NOT NULL,
    `keterangan_obat` text NOT NULL,
    `harga_obat` decimal(20,2) NOT NULL,
    `stok_obat` int(11) NOT NULL,
    `tanggal_expired` date NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `obat`
  --
  
  INSERT INTO `obat` (`id_obat`, `nama_obat`, `keterangan_obat`, `harga_obat`, `stok_obat`, `tanggal_expired`) VALUES
  ('O-01', 'Parasetamol', 'Meredahkan Demam', '12000.00', 25, '2021-04-02'),
  ('O-02', 'Ponstan', 'Pereda Nyeri pada Gusi ', '35000.00', 30, '2021-10-16');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `pasien`
  --
  
  CREATE TABLE `pasien` (
    `id_pasien` varchar(50) NOT NULL,
    `nomor_identitas` varchar(50) NOT NULL,
    `nama_pasien` varchar(255) NOT NULL,
    `jenis_kelamin` enum('L','P') NOT NULL,
    `alamat` text NOT NULL,
    `no_telp` varchar(15) NOT NULL,
    `nomor_rm` varchar(225) NOT NULL,
    `tempat_lahir` varchar(225) NOT NULL,
    `tanggal_lahir` date NOT NULL,
    `usia` int(11) NOT NULL,
    `agama` varchar(255) NOT NULL,
    `pekerjaan` varchar(225) NOT NULL,
    `status` varchar(225) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `pasien`
  --
  
  INSERT INTO `pasien` (`id_pasien`, `nomor_identitas`, `nama_pasien`, `jenis_kelamin`, `alamat`, `no_telp`, `nomor_rm`, `tempat_lahir`, `tanggal_lahir`, `usia`, `agama`, `pekerjaan`, `status`) VALUES
  ('Pasien2020-07001', '7316040911980001', 'Mustajab', 'L', 'Jl. Ir. H Djuanda, Cakke no.83', '081291551486', 'RM20-07001', 'Sudu', '1998-11-09', 21, 'Islam', 'Mahasiswa', 'Belum Menikah');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `pemeriksaan`
  --
  
  CREATE TABLE `pemeriksaan` (
    `id_pemeriksaan` varchar(225) NOT NULL,
    `id_pasien` varchar(225) NOT NULL,
    `id_dokter` varchar(225) NOT NULL,
    `id_poli` varchar(225) NOT NULL,
    `tanggal_pemeriksaan` date NOT NULL,
    `anamnesis` text NOT NULL,
    `pemeriksaan_fisik` text NOT NULL,
    `hasil_penunjang` text NOT NULL,
    `diagnosis` text NOT NULL,
    `tindakan` text NOT NULL,
    `saran` text NOT NULL,
    `tensi_darah` text NOT NULL,
    `resep` text NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `pemeriksaan`
  --
  
  INSERT INTO `pemeriksaan` (`id_pemeriksaan`, `id_pasien`, `id_dokter`, `id_poli`, `tanggal_pemeriksaan`, `anamnesis`, `pemeriksaan_fisik`, `hasil_penunjang`, `diagnosis`, `tindakan`, `saran`, `tensi_darah`, `resep`) VALUES
  ('P001', 'Pasien2020-07001', 'D01', 'PK01', '2020-07-25', 'asdasd', 'asdasd', 'asdas', 'dsadasd', 'asdasd', 'sadasd', 'asdasd', 'sadas');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `poli`
  --
  
  CREATE TABLE `poli` (
    `id_poli` varchar(50) NOT NULL,
    `nama_poli` varchar(255) NOT NULL,
    `gedung` varchar(50) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `poli`
  --
  
  INSERT INTO `poli` (`id_poli`, `nama_poli`, `gedung`) VALUES
  ('PK01', 'Saraf', 'A');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `user`
  --
  
  CREATE TABLE `user` (
    `id_user` varchar(50) NOT NULL,
    `nama_user` varchar(255) NOT NULL,
    `username` varchar(255) NOT NULL,
    `password` varchar(255) NOT NULL,
    `level` int(11) NOT NULL,
    `nip` varchar(25) NOT NULL,
    `jenis_kelamin` int(11) NOT NULL,
    `alamat` varchar(255) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `user`
  --
  
  INSERT INTO `user` (`id_user`, `nama_user`, `username`, `password`, `level`, `nip`, `jenis_kelamin`, `alamat`) VALUES
  ('U20-01001', 'admin', 'Admin', '$2y$10$K0q7KqUODeemefDnQaiXl.r6cD0YkCS1RlyZ74Dt2q28diDTGnYgy', 0, '16455211547522', 1, 'Anggeraja');
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `dokter`
  --
  ALTER TABLE `dokter`
    ADD PRIMARY KEY (`id_dokter`);
  
  --
  -- Indexes for table `obat`
  --
  ALTER TABLE `obat`
    ADD PRIMARY KEY (`id_obat`);
  
  --
  -- Indexes for table `pasien`
  --
  ALTER TABLE `pasien`
    ADD PRIMARY KEY (`id_pasien`);
  
  --
  -- Indexes for table `pemeriksaan`
  --
  ALTER TABLE `pemeriksaan`
    ADD KEY `id_pasien` (`id_pasien`),
    ADD KEY `id_dokter` (`id_dokter`),
    ADD KEY `id_poli` (`id_poli`);
  
  --
  -- Indexes for table `poli`
  --
  ALTER TABLE `poli`
    ADD PRIMARY KEY (`id_poli`);
  
  --
  -- Indexes for table `user`
  --
  ALTER TABLE `user`
    ADD PRIMARY KEY (`id_user`);
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `pemeriksaan`
  --
  ALTER TABLE `pemeriksaan`
    ADD CONSTRAINT `pemeriksaan_ibfk_2` FOREIGN KEY (`id_pasien`) REFERENCES `pasien` (`id_pasien`) ON DELETE CASCADE,
    ADD CONSTRAINT `pemeriksaan_ibfk_3` FOREIGN KEY (`id_dokter`) REFERENCES `dokter` (`id_dokter`) ON DELETE CASCADE,
    ADD CONSTRAINT `pemeriksaan_ibfk_4` FOREIGN KEY (`id_poli`) REFERENCES `poli` (`id_poli`) ON DELETE CASCADE;
  COMMIT;
  
  /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  