-
Notifications
You must be signed in to change notification settings - Fork 0
/
medica_client_structure.sql
181 lines (149 loc) · 5.12 KB
/
medica_client_structure.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
/*
SQLyog Community v13.1.6 (64 bit)
MySQL - 8.0.21 : Database - medica_client
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE = ''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS = @@UNIQUE_CHECKS, UNIQUE_CHECKS = 0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS = @@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS = 0 */;
/*!40101 SET @OLD_SQL_MODE = @@SQL_MODE, SQL_MODE = 'NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES = @@SQL_NOTES, SQL_NOTES = 0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS */`medica_client` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `medica_client`;
/*Table structure for table `appointments` */
DROP TABLE IF EXISTS `appointments`;
CREATE TABLE `appointments`
(
`id` int NOT NULL AUTO_INCREMENT,
`PatientId` int NOT NULL,
`doctorId` int NOT NULL,
`type` varchar(30) NOT NULL DEFAULT 'sick',
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 5
DEFAULT CHARSET = latin1;
/*Table structure for table `conditions` */
DROP TABLE IF EXISTS `conditions`;
CREATE TABLE `conditions`
(
`id` int NOT NULL AUTO_INCREMENT,
`patientemail` text,
`conditionName` text NOT NULL,
`recommendation` text,
`date` date DEFAULT NULL,
`category` text NOT NULL,
`description` text NOT NULL,
`doctorMail` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 4
DEFAULT CHARSET = latin1;
/*Table structure for table `hospital` */
DROP TABLE IF EXISTS `hospital`;
CREATE TABLE `hospital`
(
`id` int NOT NULL AUTO_INCREMENT,
`name` text NOT NULL,
`location` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARSET = latin1;
/*Table structure for table `labtests` */
DROP TABLE IF EXISTS `labtests`;
CREATE TABLE `labtests`
(
`id` int NOT NULL AUTO_INCREMENT,
`tests` text,
`technician` text,
`patientname` text,
`doctorname` text,
`results` text,
`status` varchar(30) NOT NULL DEFAULT 'PENDING',
`imageResult` blob,
`done` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 11
DEFAULT CHARSET = latin1;
/*Table structure for table `patients` */
DROP TABLE IF EXISTS `patients`;
CREATE TABLE `patients`
(
`id` int NOT NULL AUTO_INCREMENT,
`name` text NOT NULL,
`email` text NOT NULL,
`phonenumber` text NOT NULL,
`birthdate` date NOT NULL,
`identifier` text,
`sex` text NOT NULL,
`branch` text NOT NULL,
`dateregistered` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `identifier number` (`identifier`(11))
) ENGINE = InnoDB
AUTO_INCREMENT = 6
DEFAULT CHARSET = latin1;
/*Table structure for table `prescriptions` */
DROP TABLE IF EXISTS `prescriptions`;
CREATE TABLE `prescriptions`
(
`id` int NOT NULL AUTO_INCREMENT,
`patientemail` text,
`dateprescribed` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`diagnosis` text,
`prescription` text,
`recommendation` text,
`doctor` text,
`tests` text,
`ratings` int DEFAULT NULL,
`completed` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 10
DEFAULT CHARSET = latin1;
/*Table structure for table `push` */
DROP TABLE IF EXISTS `push`;
CREATE TABLE `push`
(
`id` int NOT NULL AUTO_INCREMENT,
`time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;
/*Table structure for table `specialdisease` */
DROP TABLE IF EXISTS `specialdisease`;
CREATE TABLE `specialdisease`
(
`id` int NOT NULL AUTO_INCREMENT,
`type` text NOT NULL,
`prescription` text NOT NULL,
`recommendation` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARSET = latin1;
/*Table structure for table `users` */
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users`
(
`id` int NOT NULL AUTO_INCREMENT,
`name` text NOT NULL,
`email` text NOT NULL,
`password` text NOT NULL,
`hospital` text NOT NULL,
`status` text NOT NULL,
`userclearancelevel` text NOT NULL,
`certification` longblob,
`identification` text,
`description` text NOT NULL,
`numberoofappointments` int NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 13
DEFAULT CHARSET = latin1;
/*!40101 SET SQL_MODE = @OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS = @OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS = @OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES = @OLD_SQL_NOTES */;