--
-- Host: localhost    Database: smrphvco_medication
-- ------------------------------------------------------


--
-- Table structure for table `device`
--

CREATE TABLE `device` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `gcm` varchar(255) NOT NULL,
  `patient_id` varchar(50) NOT NULL,
  `os` varchar(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=72 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `device`
--

INSERT INTO `device` VALUES (71,'1de4fe99-58d8-4bed-bc56-7ea571b47475','ola2','web'),(70,'null','quang','web'),(69,'null','banksy','web'),(43,'9ff9b66f-26bb-4aa5-ada4-7e54f08351ae','123','ios'),(44,'a5c4fb77-9619-4373-8170-c8fe449edef1','123','ios'),(45,'APA91bEE7VHlh6eDjj_pq0Rmf5cgzyjfYNY2oespAxMQVc44hwBYb5ctM9IHJBAGSS0aHFttyxcupAXjkPy1RC0mEL1R3I_ZGtYvRHritbvdCWugfCGXVpY','ianama','android'),(68,'1de4fe99-58d8-4bed-bc56-7ea571b47475','quang','web'),(47,'9ff9b66f-26bb-4aa5-ada4-7e54f08351ae','123','ios'),(48,'a5c4fb77-9619-4373-8170-c8fe449edef1','Welby','ios'),(67,'467b621c-4ae7-43d2-b8c8-546de7242d46','newbd','web'),(51,'cfe7e025-a848-460e-be04-f6f106a34666','Welby','ios'),(52,'9ff9b66f-26bb-4aa5-ada4-7e54f08351ae','123','ios'),(65,'1de4fe99-58d8-4bed-bc56-7ea571b47475','ola','web'),(54,'9ff9b66f-26bb-4aa5-ada4-7e54f08351ae','D3','ios'),(64,'534f8f6a-0062-4756-8eac-1814089ff93f','banksy','web'),(63,'534f8f6a-0062-4756-8eac-1814089ff93f','quang','web'),(61,'534f8f6a-0062-4756-8eac-1814089ff93f','ola1','web'),(58,'cfe7e025-a848-460e-be04-f6f106a34666','ola1','ios'),(62,'1de4fe99-58d8-4bed-bc56-7ea571b47475','banksy','web');

--
-- Table structure for table `drnodes`
--

CREATE TABLE `drnodes` (
  `doctor_id` varchar(25) NOT NULL,
  `name` varchar(50) NOT NULL,
  `address` varchar(255) NOT NULL,
  `phone` varchar(20) NOT NULL,
  `node_mac` varchar(50) NOT NULL,
  PRIMARY KEY (`doctor_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `drnodes`
--

INSERT INTO `drnodes` VALUES ('quang','Quang Hoang','No 1/55 Hanoi City','8498909582','AC:86:74:47:57:A8'),('banksy','David','Block 4/34 Washington DC','1257684768','AC:86:74:4B:2E:A8');

--
-- Table structure for table `mapping`
--

CREATE TABLE `mapping` (
  `patient_id` varchar(50) NOT NULL,
  `patient_name` varchar(100) NOT NULL,
  `record_id` varchar(50) NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`patient_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `mapping`
--

INSERT INTO `mapping` VALUES ('123','ONE TESTPATIENT','TESON000','2016-04-03 21:41:11'),('687640218','ANTHONY TESTAVERDE','TESAN000','2016-04-04 02:45:24'),('new123','CHRISTOPHER ','COLCH001','2016-04-12 02:14:43');

--
-- Table structure for table `medlist`
--

CREATE TABLE `medlist` (
  `patient_id` varchar(50) NOT NULL,
  `med_id` int(11) NOT NULL AUTO_INCREMENT,
  `med_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `dosage` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `time_per_day` int(3) NOT NULL,
  `active_ind` tinyint(1) NOT NULL,
  `num_dosages` int(4) NOT NULL,
  `num_refills` int(4) NOT NULL,
  `end_date` datetime NOT NULL,
  `date` datetime NOT NULL,
  `creator` varchar(50) NOT NULL,
  `updater` varchar(50) NOT NULL,
  `update_action` varchar(20) NOT NULL,
  `update_time` datetime NOT NULL,
  PRIMARY KEY (`patient_id`,`med_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `medlist`
--

INSERT INTO `medlist` VALUES ('123',1,'TEST MED 1 Capsule','',1,1,3,0,'2016-04-06 21:41:11','2016-04-03 21:41:11','123','123','CREATED','2016-04-03 21:41:11'),('123',2,'Test2','300mg',4,1,100,3,'2016-04-28 22:03:56','2016-04-03 22:03:56','123','123','CREATED','2016-04-03 22:03:56'),('687640218',1,'HAPPY PILL Capsule','',1,1,3,0,'2016-04-07 02:45:24','2016-04-04 02:45:24','687640218','687640218','CREATED','2016-04-04 02:45:24'),('123',3,'Heroin','1000',5,0,2,30,'2016-04-05 18:49:32','2016-04-05 18:49:32','Welby','Welby','CHANGED','2016-04-05 18:49:43'),('123',4,'Heroin','1000',5,1,2,30,'2016-04-05 18:49:43','2016-04-05 18:49:43','Welby','Welby','CREATED','2016-04-05 18:49:43'),('123',5,'TEST1','100mg',5,1,30,3,'2016-04-18 01:55:09','2016-04-12 01:55:09','123','123','CREATED','2016-04-12 01:55:09'),('new123',1,'COREG Capsule 20 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',2,'ENALAPRIL MALEATE Tablet 20 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',3,'HYDROCHLOROTHIAZIDE Tablet 12.5 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',4,'FUROSEMIDE Tablet 20 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',5,'AZELASTINE HCL Drops 0.05 %','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',6,'CHOLESTYRAMINE SCOOP 4 GM','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',7,'ZOLOFT Tablet 25 MG/ML','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',8,'HUMULIN R 10 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',9,'SERTRALINE HCL 50 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',10,'CHOLESTERINE','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',11,'ASPIRIN Tablet 81 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',12,'AZELASTINE HCL Drops 0.05 %','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',13,'METOPROLOL ER Tablet 50 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',14,'HYDROCHLOROTHIAZIDE Tablet 20 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',15,'AMIODARONE Capsule 200 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',16,'HUMULIN R 10 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',17,'AMIODARONE HCL Capsule 200 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',18,'AMIODARONE HCL Capsule 200 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',19,'AMIODARONE HCL Capsule 200 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',20,'AMIODARONE HCL Capsule 200 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',21,'HUMULIN R','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',22,'COREG CR Capsule ER 24HR 80 MG','',1,1,2,0,'2016-04-14 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',23,'AMIODARONE HCL Tablet 200 MG','',1,1,2,0,'2016-04-14 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',24,'LOVAZA Capsule 1 GM','',1,1,2,0,'2016-04-14 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',25,'COREG CR Capsule ER 24HR 80 MG','',1,1,12,0,'2016-04-24 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',26,'AMIODARONE HCL Tablet 200 MG','',1,1,2,0,'2016-04-14 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',27,'LOVAZA Capsule 1 GM','',1,1,2,0,'2016-04-14 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',28,'AMIODARONE HCL Tablet 200 MG','',1,1,2,0,'2016-04-14 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',29,'COREG CR Capsule ER 24HR 80 MG','',1,1,4,0,'2016-04-16 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',30,'LANTUS FOR OPTICLIK Injection 30 UNIT/ML','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',31,'LISINOPRIL Tablet 20 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',32,'CLARITIN-D 12 HOUR Tablet 10 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',33,'ZOLOFT Tablet 150 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',34,'ASPIRIN Tablet 81 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',35,'FUROSEMIDE Tablet 20 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',36,'CHOLESTERINE Powder','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',37,'EYEDROPS OTC Solution','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',38,'HUMALOG Solution 100 UNIT/ML','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',39,'OMEGA 3 Caps DR 340 MG','',1,1,1,0,'2016-04-13 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',40,'AMIODARONE HCL Tablet 200 MG','',1,1,2,0,'2016-04-14 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',41,'COREG CR Capsule ER 24HR 80 MG','',1,1,2,0,'2016-04-14 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('new123',42,'AMIODARONE HCL Tablet 200 MG','',1,1,2,0,'2016-04-14 02:14:43','2016-04-12 02:14:43','new123','new123','CREATED','2016-04-12 02:14:43'),('ianama',1,'viagra','50mg',2,1,2,0,'2016-04-21 16:03:53','2016-04-20 16:03:53','ianama','ianama','CREATED','2016-04-20 16:03:53'),('ianama',2,'viagra','50mg',2,1,2,0,'2016-04-21 16:03:56','2016-04-20 16:03:56','ianama','ianama','CREATED','2016-04-20 16:03:56'),('ianama',3,'viagra','50mg',2,1,2,0,'2016-04-21 16:03:57','2016-04-20 16:03:57','ianama','ianama','CREATED','2016-04-20 16:03:57'),('ianama',4,'viagra','50mg',2,1,2,0,'2016-04-21 16:03:58','2016-04-20 16:03:58','ianama','ianama','CREATED','2016-04-20 16:03:58'),('ianama',5,'viagra','50mg',2,1,2,1,'2016-04-21 16:04:04','2016-04-20 16:04:04','ianama','ianama','CREATED','2016-04-20 16:04:04'),('ianama',6,'viagra','50mg',2,1,2,1,'2016-04-21 16:04:09','2016-04-20 16:04:09','ianama','ianama','CREATED','2016-04-20 16:04:09'),('ianama',7,'viagra','50mg',2,1,2,1,'2016-04-21 16:04:10','2016-04-20 16:04:10','ianama','ianama','CREATED','2016-04-20 16:04:10'),('ianama',8,'viagra','50mg',2,1,2,1,'2016-04-21 16:04:14','2016-04-20 16:04:14','ianama','ianama','CREATED','2016-04-20 16:04:14'),('ianama',9,'viagra','50mg',2,1,2,1,'2016-04-21 16:04:23','2016-04-20 16:04:23','ianama','ianama','CREATED','2016-04-20 16:04:23'),('ianama',10,'viagra','50mg',2,1,2,1,'2016-04-21 16:04:24','2016-04-20 16:04:24','ianama','ianama','CREATED','2016-04-20 16:04:24'),('ianama',11,'viagra','50mg',2,1,2,1,'2016-04-21 16:04:25','2016-04-20 16:04:25','ianama','ianama','CREATED','2016-04-20 16:04:25'),('ianama',12,'viagra','50mg',2,1,2,1,'2016-04-21 16:04:26','2016-04-20 16:04:26','ianama','ianama','CREATED','2016-04-20 16:04:26'),('ianama',13,'viagra','50mg',2,1,2,1,'2016-04-21 16:04:29','2016-04-20 16:04:29','ianama','ianama','CREATED','2016-04-20 16:04:29'),('ianama',14,'viagra','50mg',2,1,2,1,'2016-04-21 16:04:52','2016-04-20 16:04:52','ianama','ianama','CREATED','2016-04-20 16:04:52'),('ianama',15,'viagra','50mg',2,1,2,1,'2016-04-21 16:04:53','2016-04-20 16:04:53','ianama','ianama','CREATED','2016-04-20 16:04:53'),('ianama',16,'viagra','50mg',2,1,2,1,'2016-04-21 16:04:54','2016-04-20 16:04:54','ianama','ianama','CREATED','2016-04-20 16:04:54'),('ola1',1,'Med1','10mg',3,0,2,3,'2016-05-07 03:21:27','2016-05-06 03:21:27','banksy','ola1','CHANGED','2016-05-11 15:44:46'),('ola1',2,'Med','10mg',3,1,2,3,'2016-05-11 15:44:46','2016-05-11 15:44:46','ola1','ola1','CREATED','2016-05-11 15:44:46'),('ola',1,'Dotamin','10mg',3,0,2,2,'2016-05-26 14:58:11','2016-05-25 14:58:11','ola','ola','CHANGED','2016-05-31 02:41:18'),('ola2',1,'Aspirin','100mg',2,1,2,1,'2016-05-30 04:48:42','2016-05-29 04:48:42','ola2','ola2','CREATED','2016-05-29 04:48:42'),('ola2',2,'Berberin','4mg',1,1,3,4,'2016-06-01 04:48:52','2016-05-29 04:48:52','ola2','ola2','CREATED','2016-05-29 04:48:52'),('ola',2,'Vitamin D','10mg',3,1,2,2,'2016-05-31 02:41:18','2016-05-31 02:41:18','ola','ola','CREATED','2016-05-31 02:41:18');

--
-- Table structure for table `patientauth`
--

CREATE TABLE `patientauth` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `patient_id` varchar(50) NOT NULL,
  `doctor_id` varchar(50) NOT NULL,
  `permission` varchar(50) NOT NULL,
  `date` datetime NOT NULL,
  `expired` datetime NOT NULL,
  `status` varchar(15) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=32 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `patientauth`
--

INSERT INTO `patientauth` VALUES (24,'ola','banksy','READ','2016-05-31 02:47:17','2026-05-28 20:49:03','RELEASED'),(25,'ola','banksy','READ','2016-05-31 03:22:19','2016-05-31 03:22:19','DENIED'),(26,'newbd','quang','READ','2016-05-31 03:42:42','2016-05-31 03:42:42','REQUEST'),(23,'ola','banksy','READ','2016-05-31 02:46:58','2016-05-31 02:46:58','DENIED'),(22,'ola','banksy','READ','2016-05-31 02:46:41','2016-05-31 02:46:41','DENIED'),(27,'newbd','quang','READ','2016-05-31 03:45:23','2016-05-31 03:45:23','REQUEST'),(28,'newbd','quang','READ','2016-05-31 03:45:39','2016-05-31 03:45:39','REQUEST'),(29,'newbd','quang','READ','2016-05-31 03:46:11','2016-05-31 03:46:11','REQUEST'),(30,'newbd','quang','READ','2016-05-31 03:47:16','2016-05-31 03:47:16','REQUEST'),(31,'newbd','quang','READ','2016-05-31 04:26:22','2016-05-31 04:26:22','REQUEST');

--
-- Table structure for table `registration`
--

CREATE TABLE `registration` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `macaddress` varchar(17) NOT NULL,
  `phone` varchar(12) NOT NULL,
  `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `nod_mac` varchar(18) NOT NULL,
  `patient_id` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `registration`
--

INSERT INTO `registration` VALUES (1,'70ECE4630039','9176265710','2016-05-19 03:13:54','AC:86:74:47:57:A8',NULL),(2,'70ECE4630039','9176265710','2016-05-19 03:25:03','AC:86:74:47:57:A8',NULL),(3,'0022FB61B500','8494808048','2016-05-19 09:15:13','AC:86:74:4B:2E:A8',NULL),(4,'70ECE4630039','9176265710','2016-05-19 14:19:13','AC:86:74:47:57:A8',NULL),(5,'70ECE4630039','9176265710','2016-05-31 03:32:12','AC:86:74:47:57:A8',NULL),(6,'1CABA76768D9','9176265710','2016-05-31 13:59:39','AC:86:74:47:57:A8',NULL),(7,'58B03574CAE0','9176265710','2016-06-08 13:19:58','AC:86:74:47:57:A8',NULL);


