Facebook
From okello, 3 Weeks ago, written in SQL.
Embed
Download Paste or View Raw
Hits: 144
  1. -- phpMyAdmin SQL Dump
  2. -- version 5.2.1
  3. -- https://www.phpmyadmin.net/
  4. --
  5. -- Host: 127.0.0.1:3306
  6. -- Generation Time: Apr 11, 2024 at 02:50 AM
  7. -- Server version: 8.2.0
  8. -- PHP Version: 8.1.26
  9.  
  10. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  11. START TRANSACTION;
  12. SET time_zone = "+00:00";
  13.  
  14.  
  15. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  16. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  17. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  18. /*!40101 SET NAMES utf8mb4 */;
  19.  
  20. --
  21. -- Database: `hospital_care`
  22. --
  23.  
  24. -- --------------------------------------------------------
  25.  
  26. --
  27. -- Table structure for table `appointment`
  28. --
  29.  
  30. DROP TABLE IF EXISTS `appointment`;
  31. CREATE TABLE IF NOT EXISTS `appointment` (
  32.                                              `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  33.                                              `created_at` TIMESTAMP NULL DEFAULT NULL,
  34.                                              `updated_at` TIMESTAMP NULL DEFAULT NULL,
  35.                                              `appointment_reason` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  36.     `patient_id` BIGINT UNSIGNED NOT NULL,
  37.     `status` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  38.     `appointmentdate` datetime DEFAULT NULL,
  39.     `location` VARCHAR(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  40.     PRIMARY KEY (`id`),
  41.     KEY `appointment_patient_id_foreign` (`patient_id`)
  42.     );
  43.  
  44. --
  45. -- Dumping data for table `appointment`
  46. --
  47.  
  48. INSERT INTO `appointment` (`id`, `created_at`, `updated_at`, `appointment_reason`, `patient_id`, `status`, `appointmentdate`, `location`) VALUES
  49.                                                                                                                                               (2, '2024-04-01 22:57:03', '2024-04-01 22:57:03', 'nurse_visit', 1, 'Scheduled', '2024-04-09 01:23:33', 'nairobi'),
  50.                                                                                                                                               (3, '2024-04-01 23:00:44', '2024-04-01 23:00:44', 'nurse_visit', 1, 'Scheduled', '2024-04-23 12:23:52', 'mombasa'),
  51.                                                                                                                                               (4, '2024-04-01 23:02:17', '2024-04-01 23:02:17', 'labtest', 3, 'Scheduled', '2024-04-22 11:00:03', 'nairobi'),
  52.                                                                                                                                               (5, '2024-04-01 23:13:11', '2024-04-01 23:13:11', 'labtest', 1, 'Scheduled', '2024-04-28 14:24:30', 'mombasa'),
  53.                                                                                                                                               (6, '2024-04-01 23:13:17', '2024-04-01 23:13:17', 'nurse_visit', 5, 'Scheduled', '2024-04-22 11:24:26', 'nairobi'),
  54.                                                                                                                                               (7, '2024-04-01 23:13:23', '2024-04-01 23:13:23', 'labtest', 4, 'Scheduled', '2024-05-22 01:27:49', 'kisumu'),
  55.                                                                                                                                               (8, '2024-04-01 23:13:27', '2024-04-01 23:13:27', 'labtest', 3, 'Scheduled', '2024-04-29 11:24:21', 'mombasa'),
  56.                                                                                                                                               (9, '2024-04-01 23:13:33', '2024-04-01 23:13:33', 'nurse_visit', 4, 'Scheduled', '2024-05-29 01:24:45', 'nairobi'),
  57.                                                                                                                                               (10, '2024-04-01 23:13:37', '2024-04-01 23:13:37', 'nurse_visit', 1, 'Scheduled', '2024-04-19 09:24:16', 'nairobi'),
  58.                                                                                                                                               (11, '2024-04-01 23:13:41', '2024-04-01 23:13:41', 'labtest', 1, 'Scheduled', '2024-05-29 10:24:45', 'kisumu'),
  59.                                                                                                                                               (12, '2024-04-01 23:13:49', '2024-04-01 23:13:49', 'labtest', 1, 'Scheduled', '2024-05-29 10:24:45', 'eldoret'),
  60.                                                                                                                                               (13, '2024-04-08 21:31:42', '2024-04-08 21:31:42', 'labtest', 1, 'Scheduled', '2024-05-15 12:26:55', 'kisumu'),
  61.                                                                                                                                               (14, '2024-04-08 21:59:27', '2024-04-08 21:59:27', 'labtest', 7, 'Scheduled', '2024-04-17 15:59:00', 'mombasa'),
  62.                                                                                                                                               (15, '2024-04-08 22:00:30', '2024-04-08 22:00:30', 'labtest', 7, 'Scheduled', '2024-04-17 15:59:00', 'mombasa'),
  63.                                                                                                                                               (16, '2024-04-08 22:05:58', '2024-04-08 22:05:58', 'nurse_visit', 7, 'Scheduled', '2024-04-30 17:09:00', 'mombasa'),
  64.                                                                                                                                               (17, '2024-04-08 22:07:32', '2024-04-08 22:07:32', 'nurse_visit', 7, 'Scheduled', '2024-04-21 16:10:00', 'nairobi');
  65.  
  66. -- --------------------------------------------------------
  67.  
  68. --
  69. -- Table structure for table `available`
  70. --
  71.  
  72. DROP TABLE IF EXISTS `available`;
  73. CREATE TABLE IF NOT EXISTS `available` (
  74.                                            `status_id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  75.                                            `status_name` tinyint(1) NOT NULL,
  76.     PRIMARY KEY (`status_id`),
  77.     UNIQUE KEY `status_id` (`status_id`),
  78.     UNIQUE KEY `status_name` (`status_name`)
  79.     );
  80.  
  81. --
  82. -- Dumping data for table `available`
  83. --
  84.  
  85. INSERT INTO `available` (`status_id`, `status_name`) VALUES
  86.                                                          (1, 1),
  87.                                                          (2, 0);
  88.  
  89. -- --------------------------------------------------------
  90.  
  91. --
  92. -- Table structure for table `caregiver`
  93. --
  94.  
  95. DROP TABLE IF EXISTS `caregiver`;
  96. CREATE TABLE IF NOT EXISTS `caregiver` (
  97.                                            `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  98.                                            `name` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  99.     `email` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  100.     `password` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  101.     `location` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  102.     `phone` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  103.     `created_at` TIMESTAMP NULL DEFAULT NULL,
  104.     `updated_at` TIMESTAMP NULL DEFAULT NULL,
  105.     PRIMARY KEY (`id`),
  106.     UNIQUE KEY `caregiver_email_unique` (`email`),
  107.     UNIQUE KEY `caregiver_phone_unique` (`phone`)
  108.     );
  109.  
  110. --
  111. -- Dumping data for table `caregiver`
  112. --
  113.  
  114. INSERT INTO `caregiver` (`id`, `name`, `email`, `password`, `location`, `phone`, `created_at`, `updated_at`) VALUES
  115.                                                                                                                  (1, 'John Doe', '[email protected]', 'b489ef012183881a15535c64f6b0646a', 'Nairobi', '+254700000001', '2024-03-31 07:28:32', '2024-03-31 07:28:32'),
  116.                                                                                                                  (2, 'Jane Smith', '[email protected]', 'b489ef012183881a15535c64f6b0646a', 'Nakuru', '+254700000002', '2024-03-31 07:28:32', '2024-03-31 07:28:32'),
  117.                                                                                                                  (3, 'Emily Johnson', '[email protected]', 'b489ef012183881a15535c64f6b0646a', 'Mombasa', '+254700000003', '2024-03-31 07:28:32', '2024-03-31 07:28:32'),
  118.                                                                                                                  (4, 'Michael Brown', '[email protected]', 'b489ef012183881a15535c64f6b0646a', 'Kisumu', '+254700000004', '2024-03-31 07:28:32', '2024-03-31 07:28:32'),
  119.                                                                                                                  (5, 'Jessica Davis', '[email protected]', 'b489ef012183881a15535c64f6b0646a', 'Nairobi', '+254700000005', '2024-03-31 07:28:32', '2024-03-31 07:28:32');
  120.  
  121. -- --------------------------------------------------------
  122.  
  123. --
  124. -- Table structure for table `healthcare_facility`
  125. --
  126.  
  127. DROP TABLE IF EXISTS `healthcare_facility`;
  128. CREATE TABLE IF NOT EXISTS `healthcare_facility` (
  129.                                                      `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  130.                                                      `facilty_name` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  131.     `facility_location` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  132.     `phone` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  133.     `email` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  134.     `password` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  135.     `facility_id` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  136.     `created_at` TIMESTAMP NULL DEFAULT NULL,
  137.     `updated_at` TIMESTAMP NULL DEFAULT NULL,
  138.     PRIMARY KEY (`id`)
  139.     );
  140.  
  141. --
  142. -- Dumping data for table `healthcare_facility`
  143. --
  144.  
  145. INSERT INTO `healthcare_facility` (`id`, `facilty_name`, `facility_location`, `phone`, `email`, `password`, `facility_id`, `created_at`, `updated_at`) VALUES
  146.                                                                                                                                                            (1, 'Nairobi Health Clinic', 'Nairobi', '+254700100200', '[email protected]', 'b489ef012183881a15535c64f6b0646a', '101', '2024-03-31 10:32:37', '2024-03-31 10:32:37'),
  147.                                                                                                                                                            (2, 'Nakuru Medical Center', 'Nakuru', '+254700300400', '[email protected]', 'b489ef012183881a15535c64f6b0646a', '102', '2024-03-31 10:32:37', '2024-03-31 10:32:37'),
  148.                                                                                                                                                            (3, 'Mombasa Healthcare', 'Mombasa', '+254700500600', '[email protected]', 'b489ef012183881a15535c64f6b0646a', '103', '2024-03-31 10:32:37', '2024-03-31 10:32:37'),
  149.                                                                                                                                                            (4, 'Kisumu Doctors Plaza', 'Kisumu', '+254700700800', '[email protected]', 'b489ef012183881a15535c64f6b0646a', '104', '2024-03-31 10:32:37', '2024-03-31 10:32:37'),
  150.                                                                                                                                                            (5, 'Coast Provincial Hospital', 'Mombasa', '+254700900000', '[email protected]', 'b489ef012183881a15535c64f6b0646a', '105', '2024-03-31 10:32:37', '2024-03-31 10:32:37'),
  151.                                                                                                                                                            (6, 'Niaje mzee', 'mombasa', '254719343421', '[email protected]', 'b489ef012183881a15535c64f6b0646a', '106', NULL, NULL),
  152.                                                                                                                                                            (7, 'Nairobi National Hopsital', 'nairobi', '2547001231231', '[email protected]', 'b489ef012183881a15535c64f6b0646a', NULL, NULL, NULL);
  153.  
  154. -- --------------------------------------------------------
  155.  
  156. --
  157. -- Table structure for table `nurse`
  158. --
  159.  
  160. DROP TABLE IF EXISTS `nurse`;
  161. CREATE TABLE IF NOT EXISTS `nurse` (
  162.                                        `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  163.                                        `name` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  164.     `email` VARCHAR(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  165.     `password` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  166.     `location` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  167.     `phone` VARCHAR(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  168.     `km_num` VARCHAR(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  169.     `available_status` tinyint(1) NOT NULL DEFAULT '1',
  170.     `created_at` TIMESTAMP NULL DEFAULT NULL,
  171.     `updated_at` TIMESTAMP NULL DEFAULT NULL,
  172.     PRIMARY KEY (`id`),
  173.     UNIQUE KEY `nurse_email_unique` (`email`),
  174.     UNIQUE KEY `nurse_phone_unique` (`phone`)
  175.     );
  176.  
  177. --
  178. -- Dumping data for table `nurse`
  179. --
  180.  
  181. INSERT INTO `nurse` (`id`, `name`, `email`, `password`, `location`, `phone`, `km_num`, `available_status`, `created_at`, `updated_at`) VALUES
  182.                                                                                                                                            (1, 'William Onyango', '[email protected]', 'b489ef012183881a15535c64f6b0646a', 'Nairobi', '254700000001', 'KM001', 0, '2024-03-31 10:34:40', '2024-03-31 10:34:40'),
  183.                                                                                                                                            (2, 'Bill Njau', '[email protected]', 'b489ef012183881a15535c64f6b0646a', 'Nakuru', '254700000002', 'KM002', 0, '2024-03-31 10:34:40', '2024-03-31 10:34:40'),
  184.                                                                                                                                            (3, 'Shem Kigaai', '[email protected]', 'b489ef012183881a15535c64f6b0646a', 'Mombasa', '254700000003', 'KM003', 1, '2024-03-31 10:34:40', '2024-03-31 10:34:40'),
  185.                                                                                                                                            (4, 'Ugunja John', '[email protected]', 'b489ef012183881a15535c64f6b0646a', 'Kisumu', '254700000004', 'KM004', 0, '2024-03-31 10:34:40', '2024-03-31 10:34:40'),
  186.                                                                                                                                            (5, 'Yoana Msee', '[email protected]', 'b489ef012183881a15535c64f6b0646a', 'Nairobi', '254700000005', 'KM005', 0, '2024-03-31 10:34:40', '2024-03-31 10:34:40'),
  187.                                                                                                                                            (6, 'Jane Mwangi', '[email protected]', 'b489ef012183881a15535c64f6b0646a', 'Nairobi', '254719343423', 'KM006', 1, NULL, NULL),
  188.                                                                                                                                            (7, 'Joan Wambui', '[email protected]', 'eb9fe5104a53b3cb2d18be5399633ea9', 'nairobi', '254719343422', NULL, 1, NULL, NULL);
  189.  
  190. -- --------------------------------------------------------
  191.  
  192. --
  193. -- Table structure for table `patient`
  194. --
  195.  
  196. DROP TABLE IF EXISTS `patient`;
  197. CREATE TABLE IF NOT EXISTS `patient` (
  198.                                          `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  199.                                          `name` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  200.     `email` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  201.     `password` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  202.     `location` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  203.     `phone` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  204.     `caregiver_id` BIGINT UNSIGNED DEFAULT NULL,
  205.     `created_at` TIMESTAMP NULL DEFAULT NULL,
  206.     `updated_at` TIMESTAMP NULL DEFAULT NULL,
  207.     PRIMARY KEY (`id`),
  208.     UNIQUE KEY `patient_email_unique` (`email`),
  209.     UNIQUE KEY `patient_phone_unique` (`phone`),
  210.     KEY `patient_caregiver_id_foreign` (`caregiver_id`)
  211.     );
  212.  
  213. --
  214. -- Dumping data for table `patient`
  215. --
  216.  
  217. INSERT INTO `patient` (`id`, `name`, `email`, `password`, `location`, `phone`, `caregiver_id`, `created_at`, `updated_at`) VALUES
  218.                                                                                                                                (1, 'Eve', '[email protected]', 'b489ef012183881a15535c64f6b0646a', 'Nairobi', '+254700000001', 1, '2024-03-30 16:15:42', '2024-03-30 16:15:42'),
  219.                                                                                                                                (2, 'Alice', '[email protected]', 'b489ef012183881a15535c64f6b0646a', 'Nakuru', '+254700000002', 2, '2024-03-30 16:15:42', '2024-03-30 16:15:42'),
  220.                                                                                                                                (3, 'Bob', '[email protected]', 'b489ef012183881a15535c64f6b0646a', 'Mombasa', '+254700000003', 3, '2024-03-30 16:15:42', '2024-03-30 16:15:42'),
  221.                                                                                                                                (4, 'Charlie', '[email protected]', 'b489ef012183881a15535c64f6b0646a', 'Kisumu', '+254700000004', 2, '2024-03-30 16:15:42', '2024-03-30 16:15:42'),
  222.                                                                                                                                (5, 'David', '[email protected]', 'b489ef012183881a15535c64f6b0646a', 'Nairobi', '+254700000005', 3, '2024-03-30 16:15:42', '2024-03-30 16:15:42'),
  223.                                                                                                                                (6, 'David', '[email protected]', 'b489ef012183881a15535c64f6b0646a', 'Nairobi', '+254700040005', 4, '2024-03-30 16:15:42', '2024-03-30 16:15:42'),
  224.                                                                                                                                (7, 'Jamila Ngaira', '[email protected]', 'b489ef012183881a15535c64f6b0646a', 'mombasa', '254719343421', 1, NULL, NULL),
  225.                                                                                                                                (9, 'John Niaje', '[email protected]', '765d292bfc3ef785594b6167fe9811b1', 'mombasa', '254719343425', 5, NULL, NULL);
  226.  
  227. -- --------------------------------------------------------
  228.  
  229. --
  230. -- Table structure for table `patient_lab_results`
  231. --
  232.  
  233. DROP TABLE IF EXISTS `patient_lab_results`;
  234. CREATE TABLE IF NOT EXISTS `patient_lab_results` (
  235.                                                      `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  236.                                                      `lab_test_type` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  237.     `lab_result` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  238.     `healthcare_facility_id` BIGINT UNSIGNED NOT NULL,
  239.     `patient_id` BIGINT UNSIGNED NOT NULL,
  240.     `created_at` TIMESTAMP NULL DEFAULT NULL,
  241.     `updated_at` TIMESTAMP NULL DEFAULT NULL,
  242.     PRIMARY KEY (`id`),
  243.     KEY `patient_lab_results_healthcare_facility_id_foreign` (`healthcare_facility_id`),
  244.     KEY `patient_lab_results_patient_id_foreign` (`patient_id`)
  245.     );
  246.  
  247. --
  248. -- Dumping data for table `patient_lab_results`
  249. --
  250.  
  251. INSERT INTO `patient_lab_results` (`id`, `lab_test_type`, `lab_result`, `healthcare_facility_id`, `patient_id`, `created_at`, `updated_at`) VALUES
  252.                                                                                                                                                 (6, 'Blood Test', 'Normal', 1, 1, '2024-04-10 05:00:00', '2024-04-10 05:00:00'),
  253.                                                                                                                                                 (7, 'Blood Test', 'High Cholesterol', 2, 3, '2024-04-10 06:15:00', '2024-04-10 06:15:00'),
  254.                                                                                                                                                 (8, 'Urine Test', 'Normal', 1, 3, '2024-04-10 07:30:00', '2024-04-10 07:30:00'),
  255.                                                                                                                                                 (9, 'MRI Scan', 'No abnormalities found', 3, 4, '2024-04-10 08:45:00', '2024-04-10 08:45:00'),
  256.                                                                                                                                                 (10, 'X-ray', 'Fractured bone detected', 2, 5, '2024-04-10 10:00:00', '2024-04-10 10:00:00'),
  257.                                                                                                                                                 (11, 'Blood Pressure', '120/80', 1, 1, '2024-04-11 05:00:00', '2024-04-11 05:00:00'),
  258.                                                                                                                                                 (12, 'Blood Glucose', '100', 2, 2, '2024-04-11 06:00:00', '2024-04-11 06:00:00'),
  259.                                                                                                                                                 (13, 'Cholesterol', '180', 3, 3, '2024-04-11 07:00:00', '2024-04-11 07:00:00'),
  260.                                                                                                                                                 (14, 'Blood Pressure', '130/85', 1, 4, '2024-04-11 08:00:00', '2024-04-11 08:00:00'),
  261.                                                                                                                                                 (15, 'Blood Glucose', '120', 2, 5, '2024-04-11 09:00:00', '2024-04-11 09:00:00'),
  262.                                                                                                                                                 (16, 'Cholesterol', '200', 3, 6, '2024-04-11 10:00:00', '2024-04-11 10:00:00'),
  263.                                                                                                                                                 (17, 'Blood Pressure', '140/90', 1, 7, '2024-04-11 11:00:00', '2024-04-11 11:00:00'),
  264.                                                                                                                                                 (18, 'Blood Pressure', '120/80', 1, 1, '2024-04-11 05:00:00', '2024-04-11 05:00:00'),
  265.                                                                                                                                                 (19, 'Blood Glucose', '100', 2, 2, '2024-04-11 06:00:00', '2024-04-11 06:00:00'),
  266.                                                                                                                                                 (20, 'Cholesterol', '180', 3, 3, '2024-04-11 07:00:00', '2024-04-11 07:00:00'),
  267.                                                                                                                                                 (21, 'Blood Pressure', '130/85', 1, 4, '2024-04-11 08:00:00', '2024-04-11 08:00:00'),
  268.                                                                                                                                                 (22, 'Blood Glucose', '120', 2, 5, '2024-04-11 09:00:00', '2024-04-11 09:00:00'),
  269.                                                                                                                                                 (23, 'Cholesterol', '200', 3, 6, '2024-04-11 10:00:00', '2024-04-11 10:00:00'),
  270.                                                                                                                                                 (24, 'Blood Pressure', '140/90', 1, 7, '2024-04-11 11:00:00', '2024-04-11 11:00:00'),
  271.                                                                                                                                                 (25, 'Blood Glucose', '110', 2, 1, '2024-04-11 12:00:00', '2024-04-11 12:00:00'),
  272.                                                                                                                                                 (26, 'Cholesterol', '190', 3, 2, '2024-04-11 13:00:00', '2024-04-11 13:00:00'),
  273.                                                                                                                                                 (27, 'Blood Pressure', '125/82', 1, 3, '2024-04-11 14:00:00', '2024-04-11 14:00:00'),
  274.                                                                                                                                                 (28, 'Blood Glucose', '115', 2, 4, '2024-04-11 15:00:00', '2024-04-11 15:00:00'),
  275.                                                                                                                                                 (29, 'Cholesterol', '210', 3, 5, '2024-04-11 16:00:00', '2024-04-11 16:00:00'),
  276.                                                                                                                                                 (30, 'Blood Pressure', '135/88', 1, 6, '2024-04-11 17:00:00', '2024-04-11 17:00:00'),
  277.                                                                                                                                                 (31, 'Blood Glucose', '105', 2, 7, '2024-04-11 18:00:00', '2024-04-11 18:00:00');
  278.  
  279. -- --------------------------------------------------------
  280.  
  281. --
  282. -- Table structure for table `patient_visit_details`
  283. --
  284.  
  285. DROP TABLE IF EXISTS `patient_visit_details`;
  286. CREATE TABLE IF NOT EXISTS `patient_visit_details` (
  287.                                                        `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  288.                                                        `visit_reason` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  289.                                                        `patient_id` BIGINT UNSIGNED NOT NULL,
  290.                                                        `appointment_id` BIGINT UNSIGNED NOT NULL,
  291.                                                        `nurse_id` BIGINT UNSIGNED NOT NULL,
  292.                                                        `created_at` TIMESTAMP NULL DEFAULT NULL,
  293.                                                        `updated_at` TIMESTAMP NULL DEFAULT NULL,
  294.                                                        PRIMARY KEY (`id`),
  295.     KEY `patient_visit_details_patient_id_foreign` (`patient_id`),
  296.     KEY `patient_visit_details_appointment_id_foreign` (`appointment_id`),
  297.     KEY `patient_visit_details_nurse_id_foreign` (`nurse_id`)
  298.     );
  299.  
  300. --
  301. -- Constraints for dumped tables
  302. --
  303.  
  304. --
  305. -- Constraints for table `appointment`
  306. --
  307. ALTER TABLE `appointment`
  308.     ADD CONSTRAINT `appointment_patient_id_foreign` FOREIGN KEY (`patient_id`) REFERENCES `patient` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  309.  
  310. --
  311. -- Constraints for table `patient`
  312. --
  313. ALTER TABLE `patient`
  314.     ADD CONSTRAINT `patient_caregiver_id_foreign` FOREIGN KEY (`caregiver_id`) REFERENCES `caregiver` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  315.  
  316. --
  317. -- Constraints for table `patient_lab_results`
  318. --
  319. ALTER TABLE `patient_lab_results`
  320.     ADD CONSTRAINT `patient_lab_results_healthcare_facility_id_foreign` FOREIGN KEY (`healthcare_facility_id`) REFERENCES `healthcare_facility` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  321.   ADD CONSTRAINT `patient_lab_results_patient_id_foreign` FOREIGN KEY (`patient_id`) REFERENCES `patient` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  322.  
  323. --
  324. -- Constraints for table `patient_visit_details`
  325. --
  326. ALTER TABLE `patient_visit_details`
  327.     ADD CONSTRAINT `patient_visit_details_appointment_id_foreign` FOREIGN KEY (`appointment_id`) REFERENCES `appointment` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  328.   ADD CONSTRAINT `patient_visit_details_nurse_id_foreign` FOREIGN KEY (`nurse_id`) REFERENCES `nurse` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  329.   ADD CONSTRAINT `patient_visit_details_patient_id_foreign` FOREIGN KEY (`patient_id`) REFERENCES `patient` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  330. COMMIT;
  331.  
  332. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  333. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  334. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  335.