patch from Joe Holzer to show encounter dates
[openemr.git] / sql / database.sql
blobf4162d5794923f68fe238432436869be1e6a4075
1 -- 
2 -- Database: `openemr`
3 -- 
5 -- --------------------------------------------------------
7 -- 
8 -- Table structure for table `addresses`
9 -- 
11 DROP TABLE IF EXISTS `addresses`;
12 CREATE TABLE `addresses` (
13   `id` int(11) NOT NULL default '0',
14   `line1` varchar(255) default NULL,
15   `line2` varchar(255) default NULL,
16   `city` varchar(255) default NULL,
17   `state` varchar(35) default NULL,
18   `zip` varchar(10) default NULL,
19   `plus_four` varchar(4) default NULL,
20   `country` varchar(255) default NULL,
21   `foreign_id` int(11) default NULL,
22   PRIMARY KEY  (`id`),
23   KEY `foreign_id` (`foreign_id`)
24 ) ENGINE=MyISAM;
26 -- --------------------------------------------------------
28 -- 
29 -- Table structure for table `array`
30 -- 
32 DROP TABLE IF EXISTS `array`;
33 CREATE TABLE `array` (
34   `array_key` varchar(255) default NULL,
35   `array_value` longtext
36 ) ENGINE=MyISAM;
38 -- --------------------------------------------------------
40 -- 
41 -- Table structure for table `batchcom`
42 -- 
44 DROP TABLE IF EXISTS `batchcom`;
45 CREATE TABLE `batchcom` (
46   `id` bigint(20) NOT NULL auto_increment,
47   `patient_id` int(11) NOT NULL default '0',
48   `sent_by` bigint(20) NOT NULL default '0',
49   `msg_type` varchar(60) default NULL,
50   `msg_subject` varchar(255) default NULL,
51   `msg_text` mediumtext,
52   `msg_date_sent` datetime NOT NULL default '0000-00-00 00:00:00',
53   PRIMARY KEY  (`id`)
54 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
56 -- --------------------------------------------------------
58 -- 
59 -- Table structure for table `billing`
60 -- 
62 DROP TABLE IF EXISTS `billing`;
63 CREATE TABLE `billing` (
64   `id` int(11) NOT NULL auto_increment,
65   `date` datetime default NULL,
66   `code_type` varchar(7) default NULL,
67   `code` varchar(9) default NULL,
68   `pid` int(11) default NULL,
69   `provider_id` int(11) default NULL,
70   `user` int(11) default NULL,
71   `groupname` varchar(255) default NULL,
72   `authorized` tinyint(1) default NULL,
73   `encounter` int(11) default NULL,
74   `code_text` longtext,
75   `billed` tinyint(1) default NULL,
76   `activity` tinyint(1) default NULL,
77   `payer_id` int(11) default NULL,
78   `bill_process` tinyint(2) NOT NULL default '0',
79   `bill_date` datetime default NULL,
80   `process_date` datetime default NULL,
81   `process_file` varchar(255) default NULL,
82   `modifier` varchar(5) default NULL,
83   `units` tinyint(3) default NULL,
84   `fee` decimal(12,2) default NULL,
85   `justify` varchar(255) default NULL,
86   `target` varchar(30) default NULL,
87   `x12_partner_id` int(11) default NULL,
88   `ndc_info` varchar(255) default NULL,
89   PRIMARY KEY  (`id`),
90   KEY `pid` (`pid`)
91 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
93 -- --------------------------------------------------------
95 -- 
96 -- Table structure for table `categories`
97 -- 
99 DROP TABLE IF EXISTS `categories`;
100 CREATE TABLE `categories` (
101   `id` int(11) NOT NULL default '0',
102   `name` varchar(255) default NULL,
103   `value` varchar(255) default NULL,
104   `parent` int(11) NOT NULL default '0',
105   `lft` int(11) NOT NULL default '0',
106   `rght` int(11) NOT NULL default '0',
107   PRIMARY KEY  (`id`),
108   KEY `parent` (`parent`),
109   KEY `lft` (`lft`,`rght`)
110 ) ENGINE=MyISAM;
112 -- 
113 -- Dumping data for table `categories`
114 -- 
116 INSERT INTO `categories` VALUES (1, 'Categories', '', 0, 0, 9);
117 INSERT INTO `categories` VALUES (2, 'Lab Report', '', 1, 1, 2);
118 INSERT INTO `categories` VALUES (3, 'Medical Record', '', 1, 3, 4);
119 INSERT INTO `categories` VALUES (4, 'Patient Information', '', 1, 5, 8);
120 INSERT INTO `categories` VALUES (5, 'Patient ID card', '', 4, 6, 7);
122 -- --------------------------------------------------------
124 -- 
125 -- Table structure for table `categories_seq`
126 -- 
128 DROP TABLE IF EXISTS `categories_seq`;
129 CREATE TABLE `categories_seq` (
130   `id` int(11) NOT NULL default '0',
131   PRIMARY KEY  (`id`)
132 ) ENGINE=MyISAM;
134 -- 
135 -- Dumping data for table `categories_seq`
136 -- 
138 INSERT INTO `categories_seq` VALUES (5);
140 -- --------------------------------------------------------
142 -- 
143 -- Table structure for table `categories_to_documents`
144 -- 
146 DROP TABLE IF EXISTS `categories_to_documents`;
147 CREATE TABLE `categories_to_documents` (
148   `category_id` int(11) NOT NULL default '0',
149   `document_id` int(11) NOT NULL default '0',
150   PRIMARY KEY  (`category_id`,`document_id`)
151 ) ENGINE=MyISAM;
153 -- --------------------------------------------------------
155 -- 
156 -- Table structure for table `claims`
157 -- 
159 DROP TABLE IF EXISTS `claims`;
160 CREATE TABLE `claims` (
161   `patient_id` int(11) NOT NULL,
162   `encounter_id` int(11) NOT NULL,
163   `version` int(10) unsigned NOT NULL auto_increment,
164   `payer_id` int(11) NOT NULL default '0',
165   `status` tinyint(2) NOT NULL default '0',
166   `payer_type` tinyint(4) NOT NULL default '0',
167   `bill_process` tinyint(2) NOT NULL default '0',
168   `bill_time` datetime default NULL,
169   `process_time` datetime default NULL,
170   `process_file` varchar(255) default NULL,
171   `target` varchar(30) default NULL,
172   `x12_partner_id` int(11) NOT NULL default '0',
173   PRIMARY KEY  (`patient_id`,`encounter_id`,`version`)
174 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
176 -- --------------------------------------------------------
178 -- 
179 -- Table structure for table `codes`
180 -- 
182 DROP TABLE IF EXISTS `codes`;
183 CREATE TABLE `codes` (
184   `id` int(11) NOT NULL auto_increment,
185   `code_text` varchar(255) NOT NULL default '',
186   `code_text_short` varchar(24) NOT NULL default '',
187   `code` varchar(10) NOT NULL default '',
188   `code_type` tinyint(2) default NULL,
189   `modifier` varchar(5) NOT NULL default '',
190   `units` tinyint(3) default NULL,
191   `fee` decimal(12,2) default NULL,
192   `superbill` varchar(31) NOT NULL default '',
193   `related_code` varchar(255) NOT NULL default '',
194   `taxrates` varchar(255) NOT NULL default '',
195   `cyp_factor` float NOT NULL DEFAULT 0 COMMENT 'quantity representing a years supply',
196   PRIMARY KEY  (`id`),
197   KEY `code` (`code`)
198 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
200 -- --------------------------------------------------------
202 -- 
203 -- Table structure for table `config`
204 -- 
206 DROP TABLE IF EXISTS `config`;
207 CREATE TABLE `config` (
208   `id` int(11) NOT NULL default '0',
209   `name` varchar(255) default NULL,
210   `value` varchar(255) default NULL,
211   `parent` int(11) NOT NULL default '0',
212   `lft` int(11) NOT NULL default '0',
213   `rght` int(11) NOT NULL default '0',
214   PRIMARY KEY  (`id`),
215   KEY `parent` (`parent`),
216   KEY `lft` (`lft`,`rght`)
217 ) ENGINE=MyISAM;
219 -- --------------------------------------------------------
221 -- 
222 -- Table structure for table `config_seq`
223 -- 
225 DROP TABLE IF EXISTS `config_seq`;
226 CREATE TABLE `config_seq` (
227   `id` int(11) NOT NULL default '0',
228   PRIMARY KEY  (`id`)
229 ) ENGINE=MyISAM;
231 -- 
232 -- Dumping data for table `config_seq`
233 -- 
235 INSERT INTO `config_seq` VALUES (0);
237 -- --------------------------------------------------------
239 -- 
240 -- Table structure for table `documents`
241 -- 
243 DROP TABLE IF EXISTS `documents`;
244 CREATE TABLE `documents` (
245   `id` int(11) NOT NULL default '0',
246   `type` enum('file_url','blob','web_url') default NULL,
247   `size` int(11) default NULL,
248   `date` datetime default NULL,
249   `url` varchar(255) default NULL,
250   `mimetype` varchar(255) default NULL,
251   `pages` int(11) default NULL,
252   `owner` int(11) default NULL,
253   `revision` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
254   `foreign_id` int(11) default NULL,
255   `docdate` date default NULL,
256   `list_id` bigint(20) NOT NULL default '0',
257   PRIMARY KEY  (`id`),
258   KEY `revision` (`revision`),
259   KEY `foreign_id` (`foreign_id`),
260   KEY `owner` (`owner`)
261 ) ENGINE=MyISAM;
263 -- --------------------------------------------------------
265 -- 
266 -- Table structure for table `drug_inventory`
267 -- 
269 DROP TABLE IF EXISTS `drug_inventory`;
270 CREATE TABLE `drug_inventory` (
271   `inventory_id` int(11) NOT NULL auto_increment,
272   `drug_id` int(11) NOT NULL,
273   `lot_number` varchar(20) default NULL,
274   `expiration` date default NULL,
275   `manufacturer` varchar(255) default NULL,
276   `on_hand` int(11) NOT NULL default '0',
277   `last_notify` date NOT NULL default '0000-00-00',
278   `destroy_date` date default NULL,
279   `destroy_method` varchar(255) default NULL,
280   `destroy_witness` varchar(255) default NULL,
281   `destroy_notes` varchar(255) default NULL,
282   PRIMARY KEY  (`inventory_id`)
283 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
285 -- --------------------------------------------------------
287 -- 
288 -- Table structure for table `drug_sales`
289 -- 
291 DROP TABLE IF EXISTS `drug_sales`;
292 CREATE TABLE `drug_sales` (
293   `sale_id` int(11) NOT NULL auto_increment,
294   `drug_id` int(11) NOT NULL,
295   `inventory_id` int(11) NOT NULL,
296   `prescription_id` int(11) NOT NULL default '0',
297   `pid` int(11) NOT NULL default '0',
298   `encounter` int(11) NOT NULL default '0',
299   `user` varchar(255) default NULL,
300   `sale_date` date NOT NULL,
301   `quantity` int(11) NOT NULL default '0',
302   `fee` decimal(12,2) NOT NULL default '0.00',
303   `billed` tinyint(1) NOT NULL default '0' COMMENT 'indicates if the sale is posted to accounting',
304   PRIMARY KEY  (`sale_id`)
305 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
307 -- --------------------------------------------------------
309 -- 
310 -- Table structure for table `drug_templates`
311 -- 
313 DROP TABLE IF EXISTS `drug_templates`;
314 CREATE TABLE `drug_templates` (
315   `drug_id` int(11) NOT NULL,
316   `selector` varchar(255) NOT NULL default '',
317   `dosage` varchar(10) default NULL,
318   `period` int(11) NOT NULL default '0',
319   `quantity` int(11) NOT NULL default '0',
320   `refills` int(11) NOT NULL default '0',
321   `taxrates` varchar(255) default NULL,
322   PRIMARY KEY  (`drug_id`,`selector`)
323 ) ENGINE=MyISAM;
325 -- --------------------------------------------------------
327 -- 
328 -- Table structure for table `drugs`
329 -- 
331 DROP TABLE IF EXISTS `drugs`;
332 CREATE TABLE `drugs` (
333   `drug_id` int(11) NOT NULL auto_increment,
334   `name` varchar(255) NOT NULL DEFAULT '',
335   `ndc_number` varchar(20) NOT NULL DEFAULT '',
336   `on_order` int(11) NOT NULL default '0',
337   `reorder_point` int(11) NOT NULL default '0',
338   `last_notify` date NOT NULL default '0000-00-00',
339   `reactions` text,
340   `form` int(3) NOT NULL default '0',
341   `size` float unsigned NOT NULL default '0',
342   `unit` int(11) NOT NULL default '0',
343   `route` int(11) NOT NULL default '0',
344   `substitute` int(11) NOT NULL default '0',
345   `related_code` varchar(255) NOT NULL DEFAULT '' COMMENT 'may reference a related codes.code',
346   `cyp_factor` float NOT NULL DEFAULT 0 COMMENT 'quantity representing a years supply',
347   PRIMARY KEY  (`drug_id`)
348 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
350 -- --------------------------------------------------------
352 -- 
353 -- Table structure for table `employer_data`
354 -- 
356 DROP TABLE IF EXISTS `employer_data`;
357 CREATE TABLE `employer_data` (
358   `id` bigint(20) NOT NULL auto_increment,
359   `name` varchar(255) default NULL,
360   `street` varchar(255) default NULL,
361   `postal_code` varchar(255) default NULL,
362   `city` varchar(255) default NULL,
363   `state` varchar(255) default NULL,
364   `country` varchar(255) default NULL,
365   `date` datetime default NULL,
366   `pid` bigint(20) NOT NULL default '0',
367   PRIMARY KEY  (`id`),
368   KEY `pid` (`pid`)
369 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
371 -- --------------------------------------------------------
373 -- 
374 -- Table structure for table `facility`
375 -- 
377 DROP TABLE IF EXISTS `facility`;
378 CREATE TABLE `facility` (
379   `id` int(11) NOT NULL auto_increment,
380   `name` varchar(255) default NULL,
381   `phone` varchar(30) default NULL,
382   `fax` varchar(30) default NULL,
383   `street` varchar(255) default NULL,
384   `city` varchar(255) default NULL,
385   `state` varchar(50) default NULL,
386   `postal_code` varchar(11) default NULL,
387   `country_code` varchar(10) default NULL,
388   `federal_ein` varchar(15) default NULL,
389   `service_location` tinyint(1) NOT NULL default '1',
390   `billing_location` tinyint(1) NOT NULL default '0',
391   `accepts_assignment` tinyint(1) NOT NULL default '0',
392   `pos_code` tinyint(4) default NULL,
393   `x12_sender_id` varchar(25) default NULL,
394   `attn` varchar(65) default NULL,
395   `domain_identifier` varchar(60) default NULL,
396   `facility_npi` varchar(15) default NULL,
397   PRIMARY KEY  (`id`)
398 ) ENGINE=MyISAM AUTO_INCREMENT=4 ;
400 -- 
401 -- Dumping data for table `facility`
402 -- 
404 INSERT INTO `facility` VALUES (3, 'Your Clinic Name Here', '000-000-0000', '000-000-0000', '', '', '', '', '', '', 1, 0, 0, NULL, '', '', '', '');
406 -- --------------------------------------------------------
408 -- 
409 -- Table structure for table `fee_sheet_options`
410 -- 
412 DROP TABLE IF EXISTS `fee_sheet_options`;
413 CREATE TABLE `fee_sheet_options` (
414   `fs_category` varchar(63) default NULL,
415   `fs_option` varchar(63) default NULL,
416   `fs_codes` varchar(255) default NULL
417 ) ENGINE=MyISAM;
419 -- 
420 -- Dumping data for table `fee_sheet_options`
421 -- 
423 INSERT INTO `fee_sheet_options` VALUES ('1New Patient', '1Brief', 'CPT4|99201|');
424 INSERT INTO `fee_sheet_options` VALUES ('1New Patient', '2Limited', 'CPT4|99202|');
425 INSERT INTO `fee_sheet_options` VALUES ('1New Patient', '3Detailed', 'CPT4|99203|');
426 INSERT INTO `fee_sheet_options` VALUES ('1New Patient', '4Extended', 'CPT4|99204|');
427 INSERT INTO `fee_sheet_options` VALUES ('1New Patient', '5Comprehensive', 'CPT4|99205|');
428 INSERT INTO `fee_sheet_options` VALUES ('2Established Patient', '1Brief', 'CPT4|99211|');
429 INSERT INTO `fee_sheet_options` VALUES ('2Established Patient', '2Limited', 'CPT4|99212|');
430 INSERT INTO `fee_sheet_options` VALUES ('2Established Patient', '3Detailed', 'CPT4|99213|');
431 INSERT INTO `fee_sheet_options` VALUES ('2Established Patient', '4Extended', 'CPT4|99214|');
432 INSERT INTO `fee_sheet_options` VALUES ('2Established Patient', '5Comprehensive', 'CPT4|99215|');
434 -- --------------------------------------------------------
436 -- 
437 -- Table structure for table `form_dictation`
438 -- 
440 DROP TABLE IF EXISTS `form_dictation`;
441 CREATE TABLE `form_dictation` (
442   `id` bigint(20) NOT NULL auto_increment,
443   `date` datetime default NULL,
444   `pid` bigint(20) default NULL,
445   `user` varchar(255) default NULL,
446   `groupname` varchar(255) default NULL,
447   `authorized` tinyint(4) default NULL,
448   `activity` tinyint(4) default NULL,
449   `dictation` longtext,
450   `additional_notes` longtext,
451   PRIMARY KEY  (`id`)
452 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
454 -- --------------------------------------------------------
456 -- 
457 -- Table structure for table `form_encounter`
458 -- 
460 DROP TABLE IF EXISTS `form_encounter`;
461 CREATE TABLE `form_encounter` (
462   `id` bigint(20) NOT NULL auto_increment,
463   `date` datetime default NULL,
464   `reason` longtext,
465   `facility` longtext,
466   `facility_id` int(11) NOT NULL default '0',
467   `pid` bigint(20) default NULL,
468   `encounter` bigint(20) default NULL,
469   `onset_date` datetime default NULL,
470   `sensitivity` varchar(30) default NULL,
471   `billing_note` text,
472   `pc_catid` int(11) NOT NULL default '5' COMMENT 'event category from openemr_postcalendar_categories',
473   `last_level_billed` int  NOT NULL DEFAULT 0 COMMENT '0=none, 1=ins1, 2=ins2, etc',
474   `last_level_closed` int  NOT NULL DEFAULT 0 COMMENT '0=none, 1=ins1, 2=ins2, etc',
475   `last_stmt_date`    date DEFAULT NULL,
476   `stmt_count`        int  NOT NULL DEFAULT 0,
477   PRIMARY KEY  (`id`),
478   KEY `pid` (`pid`)
479 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
481 -- --------------------------------------------------------
483 -- 
484 -- Table structure for table `form_misc_billing_options`
485 -- 
487 DROP TABLE IF EXISTS `form_misc_billing_options`;
488 CREATE TABLE `form_misc_billing_options` (
489   `id` bigint(20) NOT NULL auto_increment,
490   `date` datetime default NULL,
491   `pid` bigint(20) default NULL,
492   `user` varchar(255) default NULL,
493   `groupname` varchar(255) default NULL,
494   `authorized` tinyint(4) default NULL,
495   `activity` tinyint(4) default NULL,
496   `employment_related` tinyint(1) default NULL,
497   `auto_accident` tinyint(1) default NULL,
498   `accident_state` varchar(2) default NULL,
499   `other_accident` tinyint(1) default NULL,
500   `outside_lab` tinyint(1) default NULL,
501   `lab_amount` decimal(5,2) default NULL,
502   `is_unable_to_work` tinyint(1) default NULL,
503   `off_work_from` date default NULL,
504   `off_work_to` date default NULL,
505   `is_hospitalized` tinyint(1) default NULL,
506   `hospitalization_date_from` date default NULL,
507   `hospitalization_date_to` date default NULL,
508   `medicaid_resubmission_code` varchar(10) default NULL,
509   `medicaid_original_reference` varchar(15) default NULL,
510   `prior_auth_number` varchar(20) default NULL,
511   `comments` varchar(255) default NULL,
512   `replacement_claim` tinyint(1) default 0,
513   PRIMARY KEY  (`id`)
514 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
516 -- --------------------------------------------------------
518 -- 
519 -- Table structure for table `form_reviewofs`
520 -- 
522 DROP TABLE IF EXISTS `form_reviewofs`;
523 CREATE TABLE `form_reviewofs` (
524   `id` bigint(20) NOT NULL auto_increment,
525   `date` datetime default NULL,
526   `pid` bigint(20) default NULL,
527   `user` varchar(255) default NULL,
528   `groupname` varchar(255) default NULL,
529   `authorized` tinyint(4) default NULL,
530   `activity` tinyint(4) default NULL,
531   `fever` varchar(255) default NULL,
532   `chills` varchar(255) default NULL,
533   `night_sweats` varchar(255) default NULL,
534   `weight_loss` varchar(255) default NULL,
535   `poor_appetite` varchar(255) default NULL,
536   `insomnia` varchar(255) default NULL,
537   `fatigued` varchar(255) default NULL,
538   `depressed` varchar(255) default NULL,
539   `hyperactive` varchar(255) default NULL,
540   `exposure_to_foreign_countries` varchar(255) default NULL,
541   `cataracts` varchar(255) default NULL,
542   `cataract_surgery` varchar(255) default NULL,
543   `glaucoma` varchar(255) default NULL,
544   `double_vision` varchar(255) default NULL,
545   `blurred_vision` varchar(255) default NULL,
546   `poor_hearing` varchar(255) default NULL,
547   `headaches` varchar(255) default NULL,
548   `ringing_in_ears` varchar(255) default NULL,
549   `bloody_nose` varchar(255) default NULL,
550   `sinusitis` varchar(255) default NULL,
551   `sinus_surgery` varchar(255) default NULL,
552   `dry_mouth` varchar(255) default NULL,
553   `strep_throat` varchar(255) default NULL,
554   `tonsillectomy` varchar(255) default NULL,
555   `swollen_lymph_nodes` varchar(255) default NULL,
556   `throat_cancer` varchar(255) default NULL,
557   `throat_cancer_surgery` varchar(255) default NULL,
558   `heart_attack` varchar(255) default NULL,
559   `irregular_heart_beat` varchar(255) default NULL,
560   `chest_pains` varchar(255) default NULL,
561   `shortness_of_breath` varchar(255) default NULL,
562   `high_blood_pressure` varchar(255) default NULL,
563   `heart_failure` varchar(255) default NULL,
564   `poor_circulation` varchar(255) default NULL,
565   `vascular_surgery` varchar(255) default NULL,
566   `cardiac_catheterization` varchar(255) default NULL,
567   `coronary_artery_bypass` varchar(255) default NULL,
568   `heart_transplant` varchar(255) default NULL,
569   `stress_test` varchar(255) default NULL,
570   `emphysema` varchar(255) default NULL,
571   `chronic_bronchitis` varchar(255) default NULL,
572   `interstitial_lung_disease` varchar(255) default NULL,
573   `shortness_of_breath_2` varchar(255) default NULL,
574   `lung_cancer` varchar(255) default NULL,
575   `lung_cancer_surgery` varchar(255) default NULL,
576   `pheumothorax` varchar(255) default NULL,
577   `stomach_pains` varchar(255) default NULL,
578   `peptic_ulcer_disease` varchar(255) default NULL,
579   `gastritis` varchar(255) default NULL,
580   `endoscopy` varchar(255) default NULL,
581   `polyps` varchar(255) default NULL,
582   `colonoscopy` varchar(255) default NULL,
583   `colon_cancer` varchar(255) default NULL,
584   `colon_cancer_surgery` varchar(255) default NULL,
585   `ulcerative_colitis` varchar(255) default NULL,
586   `crohns_disease` varchar(255) default NULL,
587   `appendectomy` varchar(255) default NULL,
588   `divirticulitis` varchar(255) default NULL,
589   `divirticulitis_surgery` varchar(255) default NULL,
590   `gall_stones` varchar(255) default NULL,
591   `cholecystectomy` varchar(255) default NULL,
592   `hepatitis` varchar(255) default NULL,
593   `cirrhosis_of_the_liver` varchar(255) default NULL,
594   `splenectomy` varchar(255) default NULL,
595   `kidney_failure` varchar(255) default NULL,
596   `kidney_stones` varchar(255) default NULL,
597   `kidney_cancer` varchar(255) default NULL,
598   `kidney_infections` varchar(255) default NULL,
599   `bladder_infections` varchar(255) default NULL,
600   `bladder_cancer` varchar(255) default NULL,
601   `prostate_problems` varchar(255) default NULL,
602   `prostate_cancer` varchar(255) default NULL,
603   `kidney_transplant` varchar(255) default NULL,
604   `sexually_transmitted_disease` varchar(255) default NULL,
605   `burning_with_urination` varchar(255) default NULL,
606   `discharge_from_urethra` varchar(255) default NULL,
607   `rashes` varchar(255) default NULL,
608   `infections` varchar(255) default NULL,
609   `ulcerations` varchar(255) default NULL,
610   `pemphigus` varchar(255) default NULL,
611   `herpes` varchar(255) default NULL,
612   `osetoarthritis` varchar(255) default NULL,
613   `rheumotoid_arthritis` varchar(255) default NULL,
614   `lupus` varchar(255) default NULL,
615   `ankylosing_sondlilitis` varchar(255) default NULL,
616   `swollen_joints` varchar(255) default NULL,
617   `stiff_joints` varchar(255) default NULL,
618   `broken_bones` varchar(255) default NULL,
619   `neck_problems` varchar(255) default NULL,
620   `back_problems` varchar(255) default NULL,
621   `back_surgery` varchar(255) default NULL,
622   `scoliosis` varchar(255) default NULL,
623   `herniated_disc` varchar(255) default NULL,
624   `shoulder_problems` varchar(255) default NULL,
625   `elbow_problems` varchar(255) default NULL,
626   `wrist_problems` varchar(255) default NULL,
627   `hand_problems` varchar(255) default NULL,
628   `hip_problems` varchar(255) default NULL,
629   `knee_problems` varchar(255) default NULL,
630   `ankle_problems` varchar(255) default NULL,
631   `foot_problems` varchar(255) default NULL,
632   `insulin_dependent_diabetes` varchar(255) default NULL,
633   `noninsulin_dependent_diabetes` varchar(255) default NULL,
634   `hypothyroidism` varchar(255) default NULL,
635   `hyperthyroidism` varchar(255) default NULL,
636   `cushing_syndrom` varchar(255) default NULL,
637   `addison_syndrom` varchar(255) default NULL,
638   `additional_notes` longtext,
639   PRIMARY KEY  (`id`)
640 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
642 -- --------------------------------------------------------
644 -- 
645 -- Table structure for table `form_ros`
646 -- 
648 DROP TABLE IF EXISTS `form_ros`;
649 CREATE TABLE `form_ros` (
650   `id` int(11) NOT NULL auto_increment,
651   `pid` int(11) NOT NULL,
652   `activity` int(11) NOT NULL default '1',
653   `date` datetime default NULL,
654   `weight_change` varchar(3) default NULL,
655   `weakness` varchar(3) default NULL,
656   `fatigue` varchar(3) default NULL,
657   `anorexia` varchar(3) default NULL,
658   `fever` varchar(3) default NULL,
659   `chills` varchar(3) default NULL,
660   `night_sweats` varchar(3) default NULL,
661   `insomnia` varchar(3) default NULL,
662   `irritability` varchar(3) default NULL,
663   `heat_or_cold` varchar(3) default NULL,
664   `intolerance` varchar(3) default NULL,
665   `change_in_vision` varchar(3) default NULL,
666   `glaucoma_history` varchar(3) default NULL,
667   `eye_pain` varchar(3) default NULL,
668   `irritation` varchar(3) default NULL,
669   `redness` varchar(3) default NULL,
670   `excessive_tearing` varchar(3) default NULL,
671   `double_vision` varchar(3) default NULL,
672   `blind_spots` varchar(3) default NULL,
673   `photophobia` varchar(3) default NULL,
674   `hearing_loss` varchar(3) default NULL,
675   `discharge` varchar(3) default NULL,
676   `pain` varchar(3) default NULL,
677   `vertigo` varchar(3) default NULL,
678   `tinnitus` varchar(3) default NULL,
679   `frequent_colds` varchar(3) default NULL,
680   `sore_throat` varchar(3) default NULL,
681   `sinus_problems` varchar(3) default NULL,
682   `post_nasal_drip` varchar(3) default NULL,
683   `nosebleed` varchar(3) default NULL,
684   `snoring` varchar(3) default NULL,
685   `apnea` varchar(3) default NULL,
686   `breast_mass` varchar(3) default NULL,
687   `breast_discharge` varchar(3) default NULL,
688   `biopsy` varchar(3) default NULL,
689   `abnormal_mammogram` varchar(3) default NULL,
690   `cough` varchar(3) default NULL,
691   `sputum` varchar(3) default NULL,
692   `shortness_of_breath` varchar(3) default NULL,
693   `wheezing` varchar(3) default NULL,
694   `hemoptsyis` varchar(3) default NULL,
695   `asthma` varchar(3) default NULL,
696   `copd` varchar(3) default NULL,
697   `chest_pain` varchar(3) default NULL,
698   `palpitation` varchar(3) default NULL,
699   `syncope` varchar(3) default NULL,
700   `pnd` varchar(3) default NULL,
701   `doe` varchar(3) default NULL,
702   `orthopnea` varchar(3) default NULL,
703   `peripheal` varchar(3) default NULL,
704   `edema` varchar(3) default NULL,
705   `legpain_cramping` varchar(3) default NULL,
706   `history_murmur` varchar(3) default NULL,
707   `arrythmia` varchar(3) default NULL,
708   `heart_problem` varchar(3) default NULL,
709   `dysphagia` varchar(3) default NULL,
710   `heartburn` varchar(3) default NULL,
711   `bloating` varchar(3) default NULL,
712   `belching` varchar(3) default NULL,
713   `flatulence` varchar(3) default NULL,
714   `nausea` varchar(3) default NULL,
715   `vomiting` varchar(3) default NULL,
716   `hematemesis` varchar(3) default NULL,
717   `gastro_pain` varchar(3) default NULL,
718   `food_intolerance` varchar(3) default NULL,
719   `hepatitis` varchar(3) default NULL,
720   `jaundice` varchar(3) default NULL,
721   `hematochezia` varchar(3) default NULL,
722   `changed_bowel` varchar(3) default NULL,
723   `diarrhea` varchar(3) default NULL,
724   `constipation` varchar(3) default NULL,
725   `polyuria` varchar(3) default NULL,
726   `polydypsia` varchar(3) default NULL,
727   `dysuria` varchar(3) default NULL,
728   `hematuria` varchar(3) default NULL,
729   `frequency` varchar(3) default NULL,
730   `urgency` varchar(3) default NULL,
731   `incontinence` varchar(3) default NULL,
732   `renal_stones` varchar(3) default NULL,
733   `utis` varchar(3) default NULL,
734   `hesitancy` varchar(3) default NULL,
735   `dribbling` varchar(3) default NULL,
736   `stream` varchar(3) default NULL,
737   `nocturia` varchar(3) default NULL,
738   `erections` varchar(3) default NULL,
739   `ejaculations` varchar(3) default NULL,
740   `g` varchar(3) default NULL,
741   `p` varchar(3) default NULL,
742   `ap` varchar(3) default NULL,
743   `lc` varchar(3) default NULL,
744   `mearche` varchar(3) default NULL,
745   `menopause` varchar(3) default NULL,
746   `lmp` varchar(3) default NULL,
747   `f_frequency` varchar(3) default NULL,
748   `f_flow` varchar(3) default NULL,
749   `f_symptoms` varchar(3) default NULL,
750   `abnormal_hair_growth` varchar(3) default NULL,
751   `f_hirsutism` varchar(3) default NULL,
752   `joint_pain` varchar(3) default NULL,
753   `swelling` varchar(3) default NULL,
754   `m_redness` varchar(3) default NULL,
755   `m_warm` varchar(3) default NULL,
756   `m_stiffness` varchar(3) default NULL,
757   `muscle` varchar(3) default NULL,
758   `m_aches` varchar(3) default NULL,
759   `fms` varchar(3) default NULL,
760   `arthritis` varchar(3) default NULL,
761   `loc` varchar(3) default NULL,
762   `seizures` varchar(3) default NULL,
763   `stroke` varchar(3) default NULL,
764   `tia` varchar(3) default NULL,
765   `n_numbness` varchar(3) default NULL,
766   `n_weakness` varchar(3) default NULL,
767   `paralysis` varchar(3) default NULL,
768   `intellectual_decline` varchar(3) default NULL,
769   `memory_problems` varchar(3) default NULL,
770   `dementia` varchar(3) default NULL,
771   `n_headache` varchar(3) default NULL,
772   `s_cancer` varchar(3) default NULL,
773   `psoriasis` varchar(3) default NULL,
774   `s_acne` varchar(3) default NULL,
775   `s_other` varchar(3) default NULL,
776   `s_disease` varchar(3) default NULL,
777   `p_diagnosis` varchar(3) default NULL,
778   `p_medication` varchar(3) default NULL,
779   `depression` varchar(3) default NULL,
780   `anxiety` varchar(3) default NULL,
781   `social_difficulties` varchar(3) default NULL,
782   `thyroid_problems` varchar(3) default NULL,
783   `diabetes` varchar(3) default NULL,
784   `abnormal_blood` varchar(3) default NULL,
785   `anemia` varchar(3) default NULL,
786   `fh_blood_problems` varchar(3) default NULL,
787   `bleeding_problems` varchar(3) default NULL,
788   `allergies` varchar(3) default NULL,
789   `frequent_illness` varchar(3) default NULL,
790   `hiv` varchar(3) default NULL,
791   `hai_status` varchar(3) default NULL,
792   PRIMARY KEY  (`id`)
793 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
795 -- --------------------------------------------------------
797 -- 
798 -- Table structure for table `form_soap`
799 -- 
801 DROP TABLE IF EXISTS `form_soap`;
802 CREATE TABLE `form_soap` (
803   `id` bigint(20) NOT NULL auto_increment,
804   `date` datetime default NULL,
805   `pid` bigint(20) default '0',
806   `user` varchar(255) default NULL,
807   `groupname` varchar(255) default NULL,
808   `authorized` tinyint(4) default '0',
809   `activity` tinyint(4) default '0',
810   `subjective` text,
811   `objective` text,
812   `assessment` text,
813   `plan` text,
814   PRIMARY KEY  (`id`)
815 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
817 -- --------------------------------------------------------
819 -- 
820 -- Table structure for table `form_vitals`
821 -- 
823 DROP TABLE IF EXISTS `form_vitals`;
824 CREATE TABLE `form_vitals` (
825   `id` bigint(20) NOT NULL auto_increment,
826   `date` datetime default NULL,
827   `pid` bigint(20) default '0',
828   `user` varchar(255) default NULL,
829   `groupname` varchar(255) default NULL,
830   `authorized` tinyint(4) default '0',
831   `activity` tinyint(4) default '0',
832   `bps` varchar(40) default NULL,
833   `bpd` varchar(40) default NULL,
834   `weight` float(5,2) default '0.00',
835   `height` float(5,2) default '0.00',
836   `temperature` float(5,2) default '0.00',
837   `temp_method` varchar(255) default NULL,
838   `pulse` float(5,2) default '0.00',
839   `respiration` float(5,2) default '0.00',
840   `note` varchar(255) default NULL,
841   `BMI` float(4,1) default '0.0',
842   `BMI_status` varchar(255) default NULL,
843   `waist_circ` float(5,2) default '0.00',
844   `head_circ` float(4,2) default '0.00',
845   `oxygen_saturation` float(5,2) default '0.00',
846   PRIMARY KEY  (`id`)
847 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
849 -- --------------------------------------------------------
851 -- 
852 -- Table structure for table `forms`
853 -- 
855 DROP TABLE IF EXISTS `forms`;
856 CREATE TABLE `forms` (
857   `id` bigint(20) NOT NULL auto_increment,
858   `date` datetime default NULL,
859   `encounter` bigint(20) default NULL,
860   `form_name` longtext,
861   `form_id` bigint(20) default NULL,
862   `pid` bigint(20) default NULL,
863   `user` varchar(255) default NULL,
864   `groupname` varchar(255) default NULL,
865   `authorized` tinyint(4) default NULL,
866   `deleted` tinyint(4) DEFAULT '0' NOT NULL COMMENT 'flag indicates form has been deleted',
867   `formdir` longtext,
868   PRIMARY KEY  (`id`)
869 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
871 -- --------------------------------------------------------
873 -- 
874 -- Table structure for table `geo_country_reference`
875 -- 
877 DROP TABLE IF EXISTS `geo_country_reference`;
878 CREATE TABLE `geo_country_reference` (
879   `countries_id` int(5) NOT NULL auto_increment,
880   `countries_name` varchar(64) default NULL,
881   `countries_iso_code_2` char(2) NOT NULL default '',
882   `countries_iso_code_3` char(3) NOT NULL default '',
883   PRIMARY KEY  (`countries_id`),
884   KEY `IDX_COUNTRIES_NAME` (`countries_name`)
885 ) ENGINE=MyISAM AUTO_INCREMENT=240 ;
887 -- 
888 -- Dumping data for table `geo_country_reference`
889 -- 
891 INSERT INTO `geo_country_reference` VALUES (1, 'Afghanistan', 'AF', 'AFG');
892 INSERT INTO `geo_country_reference` VALUES (2, 'Albania', 'AL', 'ALB');
893 INSERT INTO `geo_country_reference` VALUES (3, 'Algeria', 'DZ', 'DZA');
894 INSERT INTO `geo_country_reference` VALUES (4, 'American Samoa', 'AS', 'ASM');
895 INSERT INTO `geo_country_reference` VALUES (5, 'Andorra', 'AD', 'AND');
896 INSERT INTO `geo_country_reference` VALUES (6, 'Angola', 'AO', 'AGO');
897 INSERT INTO `geo_country_reference` VALUES (7, 'Anguilla', 'AI', 'AIA');
898 INSERT INTO `geo_country_reference` VALUES (8, 'Antarctica', 'AQ', 'ATA');
899 INSERT INTO `geo_country_reference` VALUES (9, 'Antigua and Barbuda', 'AG', 'ATG');
900 INSERT INTO `geo_country_reference` VALUES (10, 'Argentina', 'AR', 'ARG');
901 INSERT INTO `geo_country_reference` VALUES (11, 'Armenia', 'AM', 'ARM');
902 INSERT INTO `geo_country_reference` VALUES (12, 'Aruba', 'AW', 'ABW');
903 INSERT INTO `geo_country_reference` VALUES (13, 'Australia', 'AU', 'AUS');
904 INSERT INTO `geo_country_reference` VALUES (14, 'Austria', 'AT', 'AUT');
905 INSERT INTO `geo_country_reference` VALUES (15, 'Azerbaijan', 'AZ', 'AZE');
906 INSERT INTO `geo_country_reference` VALUES (16, 'Bahamas', 'BS', 'BHS');
907 INSERT INTO `geo_country_reference` VALUES (17, 'Bahrain', 'BH', 'BHR');
908 INSERT INTO `geo_country_reference` VALUES (18, 'Bangladesh', 'BD', 'BGD');
909 INSERT INTO `geo_country_reference` VALUES (19, 'Barbados', 'BB', 'BRB');
910 INSERT INTO `geo_country_reference` VALUES (20, 'Belarus', 'BY', 'BLR');
911 INSERT INTO `geo_country_reference` VALUES (21, 'Belgium', 'BE', 'BEL');
912 INSERT INTO `geo_country_reference` VALUES (22, 'Belize', 'BZ', 'BLZ');
913 INSERT INTO `geo_country_reference` VALUES (23, 'Benin', 'BJ', 'BEN');
914 INSERT INTO `geo_country_reference` VALUES (24, 'Bermuda', 'BM', 'BMU');
915 INSERT INTO `geo_country_reference` VALUES (25, 'Bhutan', 'BT', 'BTN');
916 INSERT INTO `geo_country_reference` VALUES (26, 'Bolivia', 'BO', 'BOL');
917 INSERT INTO `geo_country_reference` VALUES (27, 'Bosnia and Herzegowina', 'BA', 'BIH');
918 INSERT INTO `geo_country_reference` VALUES (28, 'Botswana', 'BW', 'BWA');
919 INSERT INTO `geo_country_reference` VALUES (29, 'Bouvet Island', 'BV', 'BVT');
920 INSERT INTO `geo_country_reference` VALUES (30, 'Brazil', 'BR', 'BRA');
921 INSERT INTO `geo_country_reference` VALUES (31, 'British Indian Ocean Territory', 'IO', 'IOT');
922 INSERT INTO `geo_country_reference` VALUES (32, 'Brunei Darussalam', 'BN', 'BRN');
923 INSERT INTO `geo_country_reference` VALUES (33, 'Bulgaria', 'BG', 'BGR');
924 INSERT INTO `geo_country_reference` VALUES (34, 'Burkina Faso', 'BF', 'BFA');
925 INSERT INTO `geo_country_reference` VALUES (35, 'Burundi', 'BI', 'BDI');
926 INSERT INTO `geo_country_reference` VALUES (36, 'Cambodia', 'KH', 'KHM');
927 INSERT INTO `geo_country_reference` VALUES (37, 'Cameroon', 'CM', 'CMR');
928 INSERT INTO `geo_country_reference` VALUES (38, 'Canada', 'CA', 'CAN');
929 INSERT INTO `geo_country_reference` VALUES (39, 'Cape Verde', 'CV', 'CPV');
930 INSERT INTO `geo_country_reference` VALUES (40, 'Cayman Islands', 'KY', 'CYM');
931 INSERT INTO `geo_country_reference` VALUES (41, 'Central African Republic', 'CF', 'CAF');
932 INSERT INTO `geo_country_reference` VALUES (42, 'Chad', 'TD', 'TCD');
933 INSERT INTO `geo_country_reference` VALUES (43, 'Chile', 'CL', 'CHL');
934 INSERT INTO `geo_country_reference` VALUES (44, 'China', 'CN', 'CHN');
935 INSERT INTO `geo_country_reference` VALUES (45, 'Christmas Island', 'CX', 'CXR');
936 INSERT INTO `geo_country_reference` VALUES (46, 'Cocos (Keeling) Islands', 'CC', 'CCK');
937 INSERT INTO `geo_country_reference` VALUES (47, 'Colombia', 'CO', 'COL');
938 INSERT INTO `geo_country_reference` VALUES (48, 'Comoros', 'KM', 'COM');
939 INSERT INTO `geo_country_reference` VALUES (49, 'Congo', 'CG', 'COG');
940 INSERT INTO `geo_country_reference` VALUES (50, 'Cook Islands', 'CK', 'COK');
941 INSERT INTO `geo_country_reference` VALUES (51, 'Costa Rica', 'CR', 'CRI');
942 INSERT INTO `geo_country_reference` VALUES (52, 'Cote D Ivoire', 'CI', 'CIV');
943 INSERT INTO `geo_country_reference` VALUES (53, 'Croatia', 'HR', 'HRV');
944 INSERT INTO `geo_country_reference` VALUES (54, 'Cuba', 'CU', 'CUB');
945 INSERT INTO `geo_country_reference` VALUES (55, 'Cyprus', 'CY', 'CYP');
946 INSERT INTO `geo_country_reference` VALUES (56, 'Czech Republic', 'CZ', 'CZE');
947 INSERT INTO `geo_country_reference` VALUES (57, 'Denmark', 'DK', 'DNK');
948 INSERT INTO `geo_country_reference` VALUES (58, 'Djibouti', 'DJ', 'DJI');
949 INSERT INTO `geo_country_reference` VALUES (59, 'Dominica', 'DM', 'DMA');
950 INSERT INTO `geo_country_reference` VALUES (60, 'Dominican Republic', 'DO', 'DOM');
951 INSERT INTO `geo_country_reference` VALUES (61, 'East Timor', 'TP', 'TMP');
952 INSERT INTO `geo_country_reference` VALUES (62, 'Ecuador', 'EC', 'ECU');
953 INSERT INTO `geo_country_reference` VALUES (63, 'Egypt', 'EG', 'EGY');
954 INSERT INTO `geo_country_reference` VALUES (64, 'El Salvador', 'SV', 'SLV');
955 INSERT INTO `geo_country_reference` VALUES (65, 'Equatorial Guinea', 'GQ', 'GNQ');
956 INSERT INTO `geo_country_reference` VALUES (66, 'Eritrea', 'ER', 'ERI');
957 INSERT INTO `geo_country_reference` VALUES (67, 'Estonia', 'EE', 'EST');
958 INSERT INTO `geo_country_reference` VALUES (68, 'Ethiopia', 'ET', 'ETH');
959 INSERT INTO `geo_country_reference` VALUES (69, 'Falkland Islands (Malvinas)', 'FK', 'FLK');
960 INSERT INTO `geo_country_reference` VALUES (70, 'Faroe Islands', 'FO', 'FRO');
961 INSERT INTO `geo_country_reference` VALUES (71, 'Fiji', 'FJ', 'FJI');
962 INSERT INTO `geo_country_reference` VALUES (72, 'Finland', 'FI', 'FIN');
963 INSERT INTO `geo_country_reference` VALUES (73, 'France', 'FR', 'FRA');
964 INSERT INTO `geo_country_reference` VALUES (74, 'France, MEtropolitan', 'FX', 'FXX');
965 INSERT INTO `geo_country_reference` VALUES (75, 'French Guiana', 'GF', 'GUF');
966 INSERT INTO `geo_country_reference` VALUES (76, 'French Polynesia', 'PF', 'PYF');
967 INSERT INTO `geo_country_reference` VALUES (77, 'French Southern Territories', 'TF', 'ATF');
968 INSERT INTO `geo_country_reference` VALUES (78, 'Gabon', 'GA', 'GAB');
969 INSERT INTO `geo_country_reference` VALUES (79, 'Gambia', 'GM', 'GMB');
970 INSERT INTO `geo_country_reference` VALUES (80, 'Georgia', 'GE', 'GEO');
971 INSERT INTO `geo_country_reference` VALUES (81, 'Germany', 'DE', 'DEU');
972 INSERT INTO `geo_country_reference` VALUES (82, 'Ghana', 'GH', 'GHA');
973 INSERT INTO `geo_country_reference` VALUES (83, 'Gibraltar', 'GI', 'GIB');
974 INSERT INTO `geo_country_reference` VALUES (84, 'Greece', 'GR', 'GRC');
975 INSERT INTO `geo_country_reference` VALUES (85, 'Greenland', 'GL', 'GRL');
976 INSERT INTO `geo_country_reference` VALUES (86, 'Grenada', 'GD', 'GRD');
977 INSERT INTO `geo_country_reference` VALUES (87, 'Guadeloupe', 'GP', 'GLP');
978 INSERT INTO `geo_country_reference` VALUES (88, 'Guam', 'GU', 'GUM');
979 INSERT INTO `geo_country_reference` VALUES (89, 'Guatemala', 'GT', 'GTM');
980 INSERT INTO `geo_country_reference` VALUES (90, 'Guinea', 'GN', 'GIN');
981 INSERT INTO `geo_country_reference` VALUES (91, 'Guinea-bissau', 'GW', 'GNB');
982 INSERT INTO `geo_country_reference` VALUES (92, 'Guyana', 'GY', 'GUY');
983 INSERT INTO `geo_country_reference` VALUES (93, 'Haiti', 'HT', 'HTI');
984 INSERT INTO `geo_country_reference` VALUES (94, 'Heard and Mc Donald Islands', 'HM', 'HMD');
985 INSERT INTO `geo_country_reference` VALUES (95, 'Honduras', 'HN', 'HND');
986 INSERT INTO `geo_country_reference` VALUES (96, 'Hong Kong', 'HK', 'HKG');
987 INSERT INTO `geo_country_reference` VALUES (97, 'Hungary', 'HU', 'HUN');
988 INSERT INTO `geo_country_reference` VALUES (98, 'Iceland', 'IS', 'ISL');
989 INSERT INTO `geo_country_reference` VALUES (99, 'India', 'IN', 'IND');
990 INSERT INTO `geo_country_reference` VALUES (100, 'Indonesia', 'ID', 'IDN');
991 INSERT INTO `geo_country_reference` VALUES (101, 'Iran (Islamic Republic of)', 'IR', 'IRN');
992 INSERT INTO `geo_country_reference` VALUES (102, 'Iraq', 'IQ', 'IRQ');
993 INSERT INTO `geo_country_reference` VALUES (103, 'Ireland', 'IE', 'IRL');
994 INSERT INTO `geo_country_reference` VALUES (104, 'Israel', 'IL', 'ISR');
995 INSERT INTO `geo_country_reference` VALUES (105, 'Italy', 'IT', 'ITA');
996 INSERT INTO `geo_country_reference` VALUES (106, 'Jamaica', 'JM', 'JAM');
997 INSERT INTO `geo_country_reference` VALUES (107, 'Japan', 'JP', 'JPN');
998 INSERT INTO `geo_country_reference` VALUES (108, 'Jordan', 'JO', 'JOR');
999 INSERT INTO `geo_country_reference` VALUES (109, 'Kazakhstan', 'KZ', 'KAZ');
1000 INSERT INTO `geo_country_reference` VALUES (110, 'Kenya', 'KE', 'KEN');
1001 INSERT INTO `geo_country_reference` VALUES (111, 'Kiribati', 'KI', 'KIR');
1002 INSERT INTO `geo_country_reference` VALUES (112, 'Korea, Democratic Peoples Republic of', 'KP', 'PRK');
1003 INSERT INTO `geo_country_reference` VALUES (113, 'Korea, Republic of', 'KR', 'KOR');
1004 INSERT INTO `geo_country_reference` VALUES (114, 'Kuwait', 'KW', 'KWT');
1005 INSERT INTO `geo_country_reference` VALUES (115, 'Kyrgyzstan', 'KG', 'KGZ');
1006 INSERT INTO `geo_country_reference` VALUES (116, 'Lao Peoples Democratic Republic', 'LA', 'LAO');
1007 INSERT INTO `geo_country_reference` VALUES (117, 'Latvia', 'LV', 'LVA');
1008 INSERT INTO `geo_country_reference` VALUES (118, 'Lebanon', 'LB', 'LBN');
1009 INSERT INTO `geo_country_reference` VALUES (119, 'Lesotho', 'LS', 'LSO');
1010 INSERT INTO `geo_country_reference` VALUES (120, 'Liberia', 'LR', 'LBR');
1011 INSERT INTO `geo_country_reference` VALUES (121, 'Libyan Arab Jamahiriya', 'LY', 'LBY');
1012 INSERT INTO `geo_country_reference` VALUES (122, 'Liechtenstein', 'LI', 'LIE');
1013 INSERT INTO `geo_country_reference` VALUES (123, 'Lithuania', 'LT', 'LTU');
1014 INSERT INTO `geo_country_reference` VALUES (124, 'Luxembourg', 'LU', 'LUX');
1015 INSERT INTO `geo_country_reference` VALUES (125, 'Macau', 'MO', 'MAC');
1016 INSERT INTO `geo_country_reference` VALUES (126, 'Macedonia, The Former Yugoslav Republic of', 'MK', 'MKD');
1017 INSERT INTO `geo_country_reference` VALUES (127, 'Madagascar', 'MG', 'MDG');
1018 INSERT INTO `geo_country_reference` VALUES (128, 'Malawi', 'MW', 'MWI');
1019 INSERT INTO `geo_country_reference` VALUES (129, 'Malaysia', 'MY', 'MYS');
1020 INSERT INTO `geo_country_reference` VALUES (130, 'Maldives', 'MV', 'MDV');
1021 INSERT INTO `geo_country_reference` VALUES (131, 'Mali', 'ML', 'MLI');
1022 INSERT INTO `geo_country_reference` VALUES (132, 'Malta', 'MT', 'MLT');
1023 INSERT INTO `geo_country_reference` VALUES (133, 'Marshall Islands', 'MH', 'MHL');
1024 INSERT INTO `geo_country_reference` VALUES (134, 'Martinique', 'MQ', 'MTQ');
1025 INSERT INTO `geo_country_reference` VALUES (135, 'Mauritania', 'MR', 'MRT');
1026 INSERT INTO `geo_country_reference` VALUES (136, 'Mauritius', 'MU', 'MUS');
1027 INSERT INTO `geo_country_reference` VALUES (137, 'Mayotte', 'YT', 'MYT');
1028 INSERT INTO `geo_country_reference` VALUES (138, 'Mexico', 'MX', 'MEX');
1029 INSERT INTO `geo_country_reference` VALUES (139, 'Micronesia, Federated States of', 'FM', 'FSM');
1030 INSERT INTO `geo_country_reference` VALUES (140, 'Moldova, Republic of', 'MD', 'MDA');
1031 INSERT INTO `geo_country_reference` VALUES (141, 'Monaco', 'MC', 'MCO');
1032 INSERT INTO `geo_country_reference` VALUES (142, 'Mongolia', 'MN', 'MNG');
1033 INSERT INTO `geo_country_reference` VALUES (143, 'Montserrat', 'MS', 'MSR');
1034 INSERT INTO `geo_country_reference` VALUES (144, 'Morocco', 'MA', 'MAR');
1035 INSERT INTO `geo_country_reference` VALUES (145, 'Mozambique', 'MZ', 'MOZ');
1036 INSERT INTO `geo_country_reference` VALUES (146, 'Myanmar', 'MM', 'MMR');
1037 INSERT INTO `geo_country_reference` VALUES (147, 'Namibia', 'NA', 'NAM');
1038 INSERT INTO `geo_country_reference` VALUES (148, 'Nauru', 'NR', 'NRU');
1039 INSERT INTO `geo_country_reference` VALUES (149, 'Nepal', 'NP', 'NPL');
1040 INSERT INTO `geo_country_reference` VALUES (150, 'Netherlands', 'NL', 'NLD');
1041 INSERT INTO `geo_country_reference` VALUES (151, 'Netherlands Antilles', 'AN', 'ANT');
1042 INSERT INTO `geo_country_reference` VALUES (152, 'New Caledonia', 'NC', 'NCL');
1043 INSERT INTO `geo_country_reference` VALUES (153, 'New Zealand', 'NZ', 'NZL');
1044 INSERT INTO `geo_country_reference` VALUES (154, 'Nicaragua', 'NI', 'NIC');
1045 INSERT INTO `geo_country_reference` VALUES (155, 'Niger', 'NE', 'NER');
1046 INSERT INTO `geo_country_reference` VALUES (156, 'Nigeria', 'NG', 'NGA');
1047 INSERT INTO `geo_country_reference` VALUES (157, 'Niue', 'NU', 'NIU');
1048 INSERT INTO `geo_country_reference` VALUES (158, 'Norfolk Island', 'NF', 'NFK');
1049 INSERT INTO `geo_country_reference` VALUES (159, 'Northern Mariana Islands', 'MP', 'MNP');
1050 INSERT INTO `geo_country_reference` VALUES (160, 'Norway', 'NO', 'NOR');
1051 INSERT INTO `geo_country_reference` VALUES (161, 'Oman', 'OM', 'OMN');
1052 INSERT INTO `geo_country_reference` VALUES (162, 'Pakistan', 'PK', 'PAK');
1053 INSERT INTO `geo_country_reference` VALUES (163, 'Palau', 'PW', 'PLW');
1054 INSERT INTO `geo_country_reference` VALUES (164, 'Panama', 'PA', 'PAN');
1055 INSERT INTO `geo_country_reference` VALUES (165, 'Papua New Guinea', 'PG', 'PNG');
1056 INSERT INTO `geo_country_reference` VALUES (166, 'Paraguay', 'PY', 'PRY');
1057 INSERT INTO `geo_country_reference` VALUES (167, 'Peru', 'PE', 'PER');
1058 INSERT INTO `geo_country_reference` VALUES (168, 'Philippines', 'PH', 'PHL');
1059 INSERT INTO `geo_country_reference` VALUES (169, 'Pitcairn', 'PN', 'PCN');
1060 INSERT INTO `geo_country_reference` VALUES (170, 'Poland', 'PL', 'POL');
1061 INSERT INTO `geo_country_reference` VALUES (171, 'Portugal', 'PT', 'PRT');
1062 INSERT INTO `geo_country_reference` VALUES (172, 'Puerto Rico', 'PR', 'PRI');
1063 INSERT INTO `geo_country_reference` VALUES (173, 'Qatar', 'QA', 'QAT');
1064 INSERT INTO `geo_country_reference` VALUES (174, 'Reunion', 'RE', 'REU');
1065 INSERT INTO `geo_country_reference` VALUES (175, 'Romania', 'RO', 'ROM');
1066 INSERT INTO `geo_country_reference` VALUES (176, 'Russian Federation', 'RU', 'RUS');
1067 INSERT INTO `geo_country_reference` VALUES (177, 'Rwanda', 'RW', 'RWA');
1068 INSERT INTO `geo_country_reference` VALUES (178, 'Saint Kitts and Nevis', 'KN', 'KNA');
1069 INSERT INTO `geo_country_reference` VALUES (179, 'Saint Lucia', 'LC', 'LCA');
1070 INSERT INTO `geo_country_reference` VALUES (180, 'Saint Vincent and the Grenadines', 'VC', 'VCT');
1071 INSERT INTO `geo_country_reference` VALUES (181, 'Samoa', 'WS', 'WSM');
1072 INSERT INTO `geo_country_reference` VALUES (182, 'San Marino', 'SM', 'SMR');
1073 INSERT INTO `geo_country_reference` VALUES (183, 'Sao Tome and Principe', 'ST', 'STP');
1074 INSERT INTO `geo_country_reference` VALUES (184, 'Saudi Arabia', 'SA', 'SAU');
1075 INSERT INTO `geo_country_reference` VALUES (185, 'Senegal', 'SN', 'SEN');
1076 INSERT INTO `geo_country_reference` VALUES (186, 'Seychelles', 'SC', 'SYC');
1077 INSERT INTO `geo_country_reference` VALUES (187, 'Sierra Leone', 'SL', 'SLE');
1078 INSERT INTO `geo_country_reference` VALUES (188, 'Singapore', 'SG', 'SGP');
1079 INSERT INTO `geo_country_reference` VALUES (189, 'Slovakia (Slovak Republic)', 'SK', 'SVK');
1080 INSERT INTO `geo_country_reference` VALUES (190, 'Slovenia', 'SI', 'SVN');
1081 INSERT INTO `geo_country_reference` VALUES (191, 'Solomon Islands', 'SB', 'SLB');
1082 INSERT INTO `geo_country_reference` VALUES (192, 'Somalia', 'SO', 'SOM');
1083 INSERT INTO `geo_country_reference` VALUES (193, 'south Africa', 'ZA', 'ZAF');
1084 INSERT INTO `geo_country_reference` VALUES (194, 'South Georgia and the South Sandwich Islands', 'GS', 'SGS');
1085 INSERT INTO `geo_country_reference` VALUES (195, 'Spain', 'ES', 'ESP');
1086 INSERT INTO `geo_country_reference` VALUES (196, 'Sri Lanka', 'LK', 'LKA');
1087 INSERT INTO `geo_country_reference` VALUES (197, 'St. Helena', 'SH', 'SHN');
1088 INSERT INTO `geo_country_reference` VALUES (198, 'St. Pierre and Miquelon', 'PM', 'SPM');
1089 INSERT INTO `geo_country_reference` VALUES (199, 'Sudan', 'SD', 'SDN');
1090 INSERT INTO `geo_country_reference` VALUES (200, 'Suriname', 'SR', 'SUR');
1091 INSERT INTO `geo_country_reference` VALUES (201, 'Svalbard and Jan Mayen Islands', 'SJ', 'SJM');
1092 INSERT INTO `geo_country_reference` VALUES (202, 'Swaziland', 'SZ', 'SWZ');
1093 INSERT INTO `geo_country_reference` VALUES (203, 'Sweden', 'SE', 'SWE');
1094 INSERT INTO `geo_country_reference` VALUES (204, 'Switzerland', 'CH', 'CHE');
1095 INSERT INTO `geo_country_reference` VALUES (205, 'Syrian Arab Republic', 'SY', 'SYR');
1096 INSERT INTO `geo_country_reference` VALUES (206, 'Taiwan, Province of China', 'TW', 'TWN');
1097 INSERT INTO `geo_country_reference` VALUES (207, 'Tajikistan', 'TJ', 'TJK');
1098 INSERT INTO `geo_country_reference` VALUES (208, 'Tanzania, United Republic of', 'TZ', 'TZA');
1099 INSERT INTO `geo_country_reference` VALUES (209, 'Thailand', 'TH', 'THA');
1100 INSERT INTO `geo_country_reference` VALUES (210, 'Togo', 'TG', 'TGO');
1101 INSERT INTO `geo_country_reference` VALUES (211, 'Tokelau', 'TK', 'TKL');
1102 INSERT INTO `geo_country_reference` VALUES (212, 'Tonga', 'TO', 'TON');
1103 INSERT INTO `geo_country_reference` VALUES (213, 'Trinidad and Tobago', 'TT', 'TTO');
1104 INSERT INTO `geo_country_reference` VALUES (214, 'Tunisia', 'TN', 'TUN');
1105 INSERT INTO `geo_country_reference` VALUES (215, 'Turkey', 'TR', 'TUR');
1106 INSERT INTO `geo_country_reference` VALUES (216, 'Turkmenistan', 'TM', 'TKM');
1107 INSERT INTO `geo_country_reference` VALUES (217, 'Turks and Caicos Islands', 'TC', 'TCA');
1108 INSERT INTO `geo_country_reference` VALUES (218, 'Tuvalu', 'TV', 'TUV');
1109 INSERT INTO `geo_country_reference` VALUES (219, 'Uganda', 'UG', 'UGA');
1110 INSERT INTO `geo_country_reference` VALUES (220, 'Ukraine', 'UA', 'UKR');
1111 INSERT INTO `geo_country_reference` VALUES (221, 'United Arab Emirates', 'AE', 'ARE');
1112 INSERT INTO `geo_country_reference` VALUES (222, 'United Kingdom', 'GB', 'GBR');
1113 INSERT INTO `geo_country_reference` VALUES (223, 'United States', 'US', 'USA');
1114 INSERT INTO `geo_country_reference` VALUES (224, 'United States Minor Outlying Islands', 'UM', 'UMI');
1115 INSERT INTO `geo_country_reference` VALUES (225, 'Uruguay', 'UY', 'URY');
1116 INSERT INTO `geo_country_reference` VALUES (226, 'Uzbekistan', 'UZ', 'UZB');
1117 INSERT INTO `geo_country_reference` VALUES (227, 'Vanuatu', 'VU', 'VUT');
1118 INSERT INTO `geo_country_reference` VALUES (228, 'Vatican City State (Holy See)', 'VA', 'VAT');
1119 INSERT INTO `geo_country_reference` VALUES (229, 'Venezuela', 'VE', 'VEN');
1120 INSERT INTO `geo_country_reference` VALUES (230, 'Viet Nam', 'VN', 'VNM');
1121 INSERT INTO `geo_country_reference` VALUES (231, 'Virgin Islands (British)', 'VG', 'VGB');
1122 INSERT INTO `geo_country_reference` VALUES (232, 'Virgin Islands (U.S.)', 'VI', 'VIR');
1123 INSERT INTO `geo_country_reference` VALUES (233, 'Wallis and Futuna Islands', 'WF', 'WLF');
1124 INSERT INTO `geo_country_reference` VALUES (234, 'Western Sahara', 'EH', 'ESH');
1125 INSERT INTO `geo_country_reference` VALUES (235, 'Yemen', 'YE', 'YEM');
1126 INSERT INTO `geo_country_reference` VALUES (236, 'Yugoslavia', 'YU', 'YUG');
1127 INSERT INTO `geo_country_reference` VALUES (237, 'Zaire', 'ZR', 'ZAR');
1128 INSERT INTO `geo_country_reference` VALUES (238, 'Zambia', 'ZM', 'ZMB');
1129 INSERT INTO `geo_country_reference` VALUES (239, 'Zimbabwe', 'ZW', 'ZWE');
1131 -- --------------------------------------------------------
1133 -- 
1134 -- Table structure for table `geo_zone_reference`
1135 -- 
1137 DROP TABLE IF EXISTS `geo_zone_reference`;
1138 CREATE TABLE `geo_zone_reference` (
1139   `zone_id` int(5) NOT NULL auto_increment,
1140   `zone_country_id` int(5) NOT NULL default '0',
1141   `zone_code` varchar(5) default NULL,
1142   `zone_name` varchar(32) default NULL,
1143   PRIMARY KEY  (`zone_id`)
1144 ) ENGINE=MyISAM AUTO_INCREMENT=83 ;
1146 -- 
1147 -- Dumping data for table `geo_zone_reference`
1148 -- 
1150 INSERT INTO `geo_zone_reference` VALUES (1, 223, 'AL', 'Alabama');
1151 INSERT INTO `geo_zone_reference` VALUES (2, 223, 'AK', 'Alaska');
1152 INSERT INTO `geo_zone_reference` VALUES (3, 223, 'AS', 'American Samoa');
1153 INSERT INTO `geo_zone_reference` VALUES (4, 223, 'AZ', 'Arizona');
1154 INSERT INTO `geo_zone_reference` VALUES (5, 223, 'AR', 'Arkansas');
1155 INSERT INTO `geo_zone_reference` VALUES (6, 223, 'AF', 'Armed Forces Africa');
1156 INSERT INTO `geo_zone_reference` VALUES (7, 223, 'AA', 'Armed Forces Americas');
1157 INSERT INTO `geo_zone_reference` VALUES (8, 223, 'AC', 'Armed Forces Canada');
1158 INSERT INTO `geo_zone_reference` VALUES (9, 223, 'AE', 'Armed Forces Europe');
1159 INSERT INTO `geo_zone_reference` VALUES (10, 223, 'AM', 'Armed Forces Middle East');
1160 INSERT INTO `geo_zone_reference` VALUES (11, 223, 'AP', 'Armed Forces Pacific');
1161 INSERT INTO `geo_zone_reference` VALUES (12, 223, 'CA', 'California');
1162 INSERT INTO `geo_zone_reference` VALUES (13, 223, 'CO', 'Colorado');
1163 INSERT INTO `geo_zone_reference` VALUES (14, 223, 'CT', 'Connecticut');
1164 INSERT INTO `geo_zone_reference` VALUES (15, 223, 'DE', 'Delaware');
1165 INSERT INTO `geo_zone_reference` VALUES (16, 223, 'DC', 'District of Columbia');
1166 INSERT INTO `geo_zone_reference` VALUES (17, 223, 'FM', 'Federated States Of Micronesia');
1167 INSERT INTO `geo_zone_reference` VALUES (18, 223, 'FL', 'Florida');
1168 INSERT INTO `geo_zone_reference` VALUES (19, 223, 'GA', 'Georgia');
1169 INSERT INTO `geo_zone_reference` VALUES (20, 223, 'GU', 'Guam');
1170 INSERT INTO `geo_zone_reference` VALUES (21, 223, 'HI', 'Hawaii');
1171 INSERT INTO `geo_zone_reference` VALUES (22, 223, 'ID', 'Idaho');
1172 INSERT INTO `geo_zone_reference` VALUES (23, 223, 'IL', 'Illinois');
1173 INSERT INTO `geo_zone_reference` VALUES (24, 223, 'IN', 'Indiana');
1174 INSERT INTO `geo_zone_reference` VALUES (25, 223, 'IA', 'Iowa');
1175 INSERT INTO `geo_zone_reference` VALUES (26, 223, 'KS', 'Kansas');
1176 INSERT INTO `geo_zone_reference` VALUES (27, 223, 'KY', 'Kentucky');
1177 INSERT INTO `geo_zone_reference` VALUES (28, 223, 'LA', 'Louisiana');
1178 INSERT INTO `geo_zone_reference` VALUES (29, 223, 'ME', 'Maine');
1179 INSERT INTO `geo_zone_reference` VALUES (30, 223, 'MH', 'Marshall Islands');
1180 INSERT INTO `geo_zone_reference` VALUES (31, 223, 'MD', 'Maryland');
1181 INSERT INTO `geo_zone_reference` VALUES (32, 223, 'MA', 'Massachusetts');
1182 INSERT INTO `geo_zone_reference` VALUES (33, 223, 'MI', 'Michigan');
1183 INSERT INTO `geo_zone_reference` VALUES (34, 223, 'MN', 'Minnesota');
1184 INSERT INTO `geo_zone_reference` VALUES (35, 223, 'MS', 'Mississippi');
1185 INSERT INTO `geo_zone_reference` VALUES (36, 223, 'MO', 'Missouri');
1186 INSERT INTO `geo_zone_reference` VALUES (37, 223, 'MT', 'Montana');
1187 INSERT INTO `geo_zone_reference` VALUES (38, 223, 'NE', 'Nebraska');
1188 INSERT INTO `geo_zone_reference` VALUES (39, 223, 'NV', 'Nevada');
1189 INSERT INTO `geo_zone_reference` VALUES (40, 223, 'NH', 'New Hampshire');
1190 INSERT INTO `geo_zone_reference` VALUES (41, 223, 'NJ', 'New Jersey');
1191 INSERT INTO `geo_zone_reference` VALUES (42, 223, 'NM', 'New Mexico');
1192 INSERT INTO `geo_zone_reference` VALUES (43, 223, 'NY', 'New York');
1193 INSERT INTO `geo_zone_reference` VALUES (44, 223, 'NC', 'North Carolina');
1194 INSERT INTO `geo_zone_reference` VALUES (45, 223, 'ND', 'North Dakota');
1195 INSERT INTO `geo_zone_reference` VALUES (46, 223, 'MP', 'Northern Mariana Islands');
1196 INSERT INTO `geo_zone_reference` VALUES (47, 223, 'OH', 'Ohio');
1197 INSERT INTO `geo_zone_reference` VALUES (48, 223, 'OK', 'Oklahoma');
1198 INSERT INTO `geo_zone_reference` VALUES (49, 223, 'OR', 'Oregon');
1199 INSERT INTO `geo_zone_reference` VALUES (50, 223, 'PW', 'Palau');
1200 INSERT INTO `geo_zone_reference` VALUES (51, 223, 'PA', 'Pennsylvania');
1201 INSERT INTO `geo_zone_reference` VALUES (52, 223, 'PR', 'Puerto Rico');
1202 INSERT INTO `geo_zone_reference` VALUES (53, 223, 'RI', 'Rhode Island');
1203 INSERT INTO `geo_zone_reference` VALUES (54, 223, 'SC', 'South Carolina');
1204 INSERT INTO `geo_zone_reference` VALUES (55, 223, 'SD', 'South Dakota');
1205 INSERT INTO `geo_zone_reference` VALUES (56, 223, 'TN', 'Tenessee');
1206 INSERT INTO `geo_zone_reference` VALUES (57, 223, 'TX', 'Texas');
1207 INSERT INTO `geo_zone_reference` VALUES (58, 223, 'UT', 'Utah');
1208 INSERT INTO `geo_zone_reference` VALUES (59, 223, 'VT', 'Vermont');
1209 INSERT INTO `geo_zone_reference` VALUES (60, 223, 'VI', 'Virgin Islands');
1210 INSERT INTO `geo_zone_reference` VALUES (61, 223, 'VA', 'Virginia');
1211 INSERT INTO `geo_zone_reference` VALUES (62, 223, 'WA', 'Washington');
1212 INSERT INTO `geo_zone_reference` VALUES (63, 223, 'WV', 'West Virginia');
1213 INSERT INTO `geo_zone_reference` VALUES (64, 223, 'WI', 'Wisconsin');
1214 INSERT INTO `geo_zone_reference` VALUES (65, 223, 'WY', 'Wyoming');
1215 INSERT INTO `geo_zone_reference` VALUES (66, 38, 'AB', 'Alberta');
1216 INSERT INTO `geo_zone_reference` VALUES (67, 38, 'BC', 'British Columbia');
1217 INSERT INTO `geo_zone_reference` VALUES (68, 38, 'MB', 'Manitoba');
1218 INSERT INTO `geo_zone_reference` VALUES (69, 38, 'NF', 'Newfoundland');
1219 INSERT INTO `geo_zone_reference` VALUES (70, 38, 'NB', 'New Brunswick');
1220 INSERT INTO `geo_zone_reference` VALUES (71, 38, 'NS', 'Nova Scotia');
1221 INSERT INTO `geo_zone_reference` VALUES (72, 38, 'NT', 'Northwest Territories');
1222 INSERT INTO `geo_zone_reference` VALUES (73, 38, 'NU', 'Nunavut');
1223 INSERT INTO `geo_zone_reference` VALUES (74, 38, 'ON', 'Ontario');
1224 INSERT INTO `geo_zone_reference` VALUES (75, 38, 'PE', 'Prince Edward Island');
1225 INSERT INTO `geo_zone_reference` VALUES (76, 38, 'QC', 'Quebec');
1226 INSERT INTO `geo_zone_reference` VALUES (77, 38, 'SK', 'Saskatchewan');
1227 INSERT INTO `geo_zone_reference` VALUES (78, 38, 'YT', 'Yukon Territory');
1228 INSERT INTO `geo_zone_reference` VALUES (79, 61, 'QLD', 'Queensland');
1229 INSERT INTO `geo_zone_reference` VALUES (80, 61, 'SA', 'South Australia');
1230 INSERT INTO `geo_zone_reference` VALUES (81, 61, 'ACT', 'Australian Capital Territory');
1231 INSERT INTO `geo_zone_reference` VALUES (82, 61, 'VIC', 'Victoria');
1233 -- --------------------------------------------------------
1235 -- 
1236 -- Table structure for table `groups`
1237 -- 
1239 DROP TABLE IF EXISTS `groups`;
1240 CREATE TABLE `groups` (
1241   `id` bigint(20) NOT NULL auto_increment,
1242   `name` longtext,
1243   `user` longtext,
1244   PRIMARY KEY  (`id`)
1245 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1247 -- --------------------------------------------------------
1249 -- 
1250 -- Table structure for table `history_data`
1251 -- 
1253 DROP TABLE IF EXISTS `history_data`;
1254 CREATE TABLE `history_data` (
1255   `id` bigint(20) NOT NULL auto_increment,
1256   `coffee` longtext,
1257   `tobacco` longtext,
1258   `alcohol` longtext,
1259   `sleep_patterns` longtext,
1260   `exercise_patterns` longtext,
1261   `seatbelt_use` longtext,
1262   `counseling` longtext,
1263   `hazardous_activities` longtext,
1264   `last_breast_exam` varchar(255) default NULL,
1265   `last_mammogram` varchar(255) default NULL,
1266   `last_gynocological_exam` varchar(255) default NULL,
1267   `last_rectal_exam` varchar(255) default NULL,
1268   `last_prostate_exam` varchar(255) default NULL,
1269   `last_physical_exam` varchar(255) default NULL,
1270   `last_sigmoidoscopy_colonoscopy` varchar(255) default NULL,
1271   `last_ecg` varchar(255) default NULL,
1272   `last_cardiac_echo` varchar(255) default NULL,
1273   `last_retinal` varchar(255) default NULL,
1274   `last_fluvax` varchar(255) default NULL,
1275   `last_pneuvax` varchar(255) default NULL,
1276   `last_ldl` varchar(255) default NULL,
1277   `last_hemoglobin` varchar(255) default NULL,
1278   `last_psa` varchar(255) default NULL,
1279   `last_exam_results` varchar(255) default NULL,
1280   `history_mother` longtext,
1281   `history_father` longtext,
1282   `history_siblings` longtext,
1283   `history_offspring` longtext,
1284   `history_spouse` longtext,
1285   `relatives_cancer` longtext,
1286   `relatives_tuberculosis` longtext,
1287   `relatives_diabetes` longtext,
1288   `relatives_high_blood_pressure` longtext,
1289   `relatives_heart_problems` longtext,
1290   `relatives_stroke` longtext,
1291   `relatives_epilepsy` longtext,
1292   `relatives_mental_illness` longtext,
1293   `relatives_suicide` longtext,
1294   `cataract_surgery` datetime default NULL,
1295   `tonsillectomy` datetime default NULL,
1296   `cholecystestomy` datetime default NULL,
1297   `heart_surgery` datetime default NULL,
1298   `hysterectomy` datetime default NULL,
1299   `hernia_repair` datetime default NULL,
1300   `hip_replacement` datetime default NULL,
1301   `knee_replacement` datetime default NULL,
1302   `appendectomy` datetime default NULL,
1303   `date` datetime default NULL,
1304   `pid` bigint(20) NOT NULL default '0',
1305   `name_1` varchar(255) default NULL,
1306   `value_1` varchar(255) default NULL,
1307   `name_2` varchar(255) default NULL,
1308   `value_2` varchar(255) default NULL,
1309   `additional_history` text,
1310   `exams`      text         NOT NULL DEFAULT '',
1311   `usertext11` varchar(255) NOT NULL DEFAULT '',
1312   `usertext12` varchar(255) NOT NULL DEFAULT '',
1313   `usertext13` varchar(255) NOT NULL DEFAULT '',
1314   `usertext14` varchar(255) NOT NULL DEFAULT '',
1315   `usertext15` varchar(255) NOT NULL DEFAULT '',
1316   `usertext16` varchar(255) NOT NULL DEFAULT '',
1317   `usertext17` varchar(255) NOT NULL DEFAULT '',
1318   `usertext18` varchar(255) NOT NULL DEFAULT '',
1319   `usertext19` varchar(255) NOT NULL DEFAULT '',
1320   `usertext20` varchar(255) NOT NULL DEFAULT '',
1321   `usertext21` varchar(255) NOT NULL DEFAULT '',
1322   `usertext22` varchar(255) NOT NULL DEFAULT '',
1323   `usertext23` varchar(255) NOT NULL DEFAULT '',
1324   `usertext24` varchar(255) NOT NULL DEFAULT '',
1325   `usertext25` varchar(255) NOT NULL DEFAULT '',
1326   `usertext26` varchar(255) NOT NULL DEFAULT '',
1327   `usertext27` varchar(255) NOT NULL DEFAULT '',
1328   `usertext28` varchar(255) NOT NULL DEFAULT '',
1329   `usertext29` varchar(255) NOT NULL DEFAULT '',
1330   `usertext30` varchar(255) NOT NULL DEFAULT '',
1331   `userdate11` date DEFAULT NULL,
1332   `userdate12` date DEFAULT NULL,
1333   `userdate13` date DEFAULT NULL,
1334   `userdate14` date DEFAULT NULL,
1335   `userdate15` date DEFAULT NULL,
1336   `userarea11` text NOT NULL DEFAULT '',
1337   `userarea12` text NOT NULL DEFAULT '',
1338   PRIMARY KEY  (`id`),
1339   KEY `pid` (`pid`)
1340 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1342 -- --------------------------------------------------------
1344 -- 
1345 -- Table structure for table `immunization`
1346 -- 
1348 DROP TABLE IF EXISTS `immunization`;
1349 CREATE TABLE `immunization` (
1350   `id` int(11) NOT NULL auto_increment,
1351   `name` varchar(255) default NULL,
1352   PRIMARY KEY  (`id`),
1353   KEY `immunization_name` (`name`)
1354 ) ENGINE=MyISAM AUTO_INCREMENT=36 ;
1356 -- 
1357 -- Dumping data for table `immunization`
1358 -- 
1360 INSERT INTO `immunization` VALUES (1, 'DTaP 1');
1361 INSERT INTO `immunization` VALUES (2, 'DTaP 2');
1362 INSERT INTO `immunization` VALUES (3, 'DTaP 3');
1363 INSERT INTO `immunization` VALUES (4, 'DTaP 4');
1364 INSERT INTO `immunization` VALUES (5, 'DTaP 5');
1365 INSERT INTO `immunization` VALUES (6, 'DT 1');
1366 INSERT INTO `immunization` VALUES (7, 'DT 2');
1367 INSERT INTO `immunization` VALUES (8, 'DT 3');
1368 INSERT INTO `immunization` VALUES (9, 'DT 4');
1369 INSERT INTO `immunization` VALUES (10, 'DT 5');
1370 INSERT INTO `immunization` VALUES (11, 'IPV 1');
1371 INSERT INTO `immunization` VALUES (12, 'IPV 2');
1372 INSERT INTO `immunization` VALUES (13, 'IPV 3');
1373 INSERT INTO `immunization` VALUES (14, 'IPV 4');
1374 INSERT INTO `immunization` VALUES (15, 'Hib 1');
1375 INSERT INTO `immunization` VALUES (16, 'Hib 2');
1376 INSERT INTO `immunization` VALUES (17, 'Hib 3');
1377 INSERT INTO `immunization` VALUES (18, 'Hib 4');
1378 INSERT INTO `immunization` VALUES (19, 'Pneumococcal Conjugate 1');
1379 INSERT INTO `immunization` VALUES (20, 'Pneumococcal Conjugate 2');
1380 INSERT INTO `immunization` VALUES (21, 'Pneumococcal Conjugate 3');
1381 INSERT INTO `immunization` VALUES (22, 'Pneumococcal Conjugate 4');
1382 INSERT INTO `immunization` VALUES (23, 'MMR 1');
1383 INSERT INTO `immunization` VALUES (24, 'MMR 2');
1384 INSERT INTO `immunization` VALUES (25, 'Varicella 1');
1385 INSERT INTO `immunization` VALUES (26, 'Varicella 2');
1386 INSERT INTO `immunization` VALUES (27, 'Hepatitis B 1');
1387 INSERT INTO `immunization` VALUES (28, 'Hepatitis B 2');
1388 INSERT INTO `immunization` VALUES (29, 'Hepatitis B 3');
1389 INSERT INTO `immunization` VALUES (30, 'Influenza 1');
1390 INSERT INTO `immunization` VALUES (31, 'Influenza 2');
1391 INSERT INTO `immunization` VALUES (32, 'Td');
1392 INSERT INTO `immunization` VALUES (33, 'Hepatitis A 1');
1393 INSERT INTO `immunization` VALUES (34, 'Hepatitis A 2');
1394 INSERT INTO `immunization` VALUES (35, 'Other');
1396 -- --------------------------------------------------------
1398 -- 
1399 -- Table structure for table `immunizations`
1400 -- 
1402 DROP TABLE IF EXISTS `immunizations`;
1403 CREATE TABLE `immunizations` (
1404   `id` bigint(20) NOT NULL auto_increment,
1405   `patient_id` int(11) default NULL,
1406   `administered_date` date default NULL,
1407   `immunization_id` int(11) default NULL,
1408   `manufacturer` varchar(100) default NULL,
1409   `lot_number` varchar(50) default NULL,
1410   `administered_by_id` bigint(20) default NULL,
1411   `administered_by` VARCHAR( 255 ) default NULL COMMENT 'Alternative to administered_by_id',
1412   `education_date` date default NULL,
1413   `vis_date` date default NULL COMMENT 'Date of VIS Statement', 
1414   `note` text,
1415   `create_date` datetime default NULL,
1416   `update_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
1417   `created_by` bigint(20) default NULL,
1418   `updated_by` bigint(20) default NULL,
1419   PRIMARY KEY  (`id`)
1420 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1422 -- --------------------------------------------------------
1424 -- 
1425 -- Table structure for table `insurance_companies`
1426 -- 
1428 DROP TABLE IF EXISTS `insurance_companies`;
1429 CREATE TABLE `insurance_companies` (
1430   `id` int(11) NOT NULL default '0',
1431   `name` varchar(255) default NULL,
1432   `attn` varchar(255) default NULL,
1433   `cms_id` varchar(15) default NULL,
1434   `freeb_type` tinyint(2) default NULL,
1435   `x12_receiver_id` varchar(25) default NULL,
1436   `x12_default_partner_id` int(11) default NULL,
1437   PRIMARY KEY  (`id`)
1438 ) ENGINE=MyISAM;
1440 -- --------------------------------------------------------
1442 -- 
1443 -- Table structure for table `insurance_data`
1444 -- 
1446 DROP TABLE IF EXISTS `insurance_data`;
1447 CREATE TABLE `insurance_data` (
1448   `id` bigint(20) NOT NULL auto_increment,
1449   `type` enum('primary','secondary','tertiary') default NULL,
1450   `provider` varchar(255) default NULL,
1451   `plan_name` varchar(255) default NULL,
1452   `policy_number` varchar(255) default NULL,
1453   `group_number` varchar(255) default NULL,
1454   `subscriber_lname` varchar(255) default NULL,
1455   `subscriber_mname` varchar(255) default NULL,
1456   `subscriber_fname` varchar(255) default NULL,
1457   `subscriber_relationship` varchar(255) default NULL,
1458   `subscriber_ss` varchar(255) default NULL,
1459   `subscriber_DOB` date default NULL,
1460   `subscriber_street` varchar(255) default NULL,
1461   `subscriber_postal_code` varchar(255) default NULL,
1462   `subscriber_city` varchar(255) default NULL,
1463   `subscriber_state` varchar(255) default NULL,
1464   `subscriber_country` varchar(255) default NULL,
1465   `subscriber_phone` varchar(255) default NULL,
1466   `subscriber_employer` varchar(255) default NULL,
1467   `subscriber_employer_street` varchar(255) default NULL,
1468   `subscriber_employer_postal_code` varchar(255) default NULL,
1469   `subscriber_employer_state` varchar(255) default NULL,
1470   `subscriber_employer_country` varchar(255) default NULL,
1471   `subscriber_employer_city` varchar(255) default NULL,
1472   `copay` varchar(255) default NULL,
1473   `date` date NOT NULL default '0000-00-00',
1474   `pid` bigint(20) NOT NULL default '0',
1475   `subscriber_sex` varchar(25) default NULL,
1476   `accept_assignment` varchar(5) NOT NULL DEFAULT 'TRUE',
1477   PRIMARY KEY  (`id`),
1478   UNIQUE KEY `pid_type_date` (`pid`,`type`,`date`)
1479 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1481 -- --------------------------------------------------------
1483 -- 
1484 -- Table structure for table `insurance_numbers`
1485 -- 
1487 DROP TABLE IF EXISTS `insurance_numbers`;
1488 CREATE TABLE `insurance_numbers` (
1489   `id` int(11) NOT NULL default '0',
1490   `provider_id` int(11) NOT NULL default '0',
1491   `insurance_company_id` int(11) default NULL,
1492   `provider_number` varchar(20) default NULL,
1493   `rendering_provider_number` varchar(20) default NULL,
1494   `group_number` varchar(20) default NULL,
1495   `provider_number_type` varchar(4) default NULL,
1496   `rendering_provider_number_type` varchar(4) default NULL,
1497   PRIMARY KEY  (`id`)
1498 ) ENGINE=MyISAM;
1500 -- --------------------------------------------------------
1502 -- 
1503 -- Table structure for table `integration_mapping`
1504 -- 
1506 DROP TABLE IF EXISTS `integration_mapping`;
1507 CREATE TABLE `integration_mapping` (
1508   `id` int(11) NOT NULL default '0',
1509   `foreign_id` int(11) NOT NULL default '0',
1510   `foreign_table` varchar(125) default NULL,
1511   `local_id` int(11) NOT NULL default '0',
1512   `local_table` varchar(125) default NULL,
1513   PRIMARY KEY  (`id`),
1514   UNIQUE KEY `foreign_id` (`foreign_id`,`foreign_table`,`local_id`,`local_table`)
1515 ) ENGINE=MyISAM;
1517 -- --------------------------------------------------------
1519 -- 
1520 -- Table structure for table `issue_encounter`
1521 -- 
1523 DROP TABLE IF EXISTS `issue_encounter`;
1524 CREATE TABLE `issue_encounter` (
1525   `pid` int(11) NOT NULL,
1526   `list_id` int(11) NOT NULL,
1527   `encounter` int(11) NOT NULL,
1528   `resolved` tinyint(1) NOT NULL,
1529   PRIMARY KEY  (`pid`,`list_id`,`encounter`)
1530 ) ENGINE=MyISAM;
1532 -- --------------------------------------------------------
1534 -- 
1535 -- Table structure for table `lang_constants`
1536 -- 
1538 DROP TABLE IF EXISTS `lang_constants`;
1539 CREATE TABLE `lang_constants` (
1540   `cons_id` int(11) NOT NULL auto_increment,
1541   `constant_name` varchar(255) default NULL,
1542   UNIQUE KEY `cons_id` (`cons_id`),
1543   KEY `cons_name` (`constant_name`)
1544 ) ENGINE=MyISAM ;
1546 -- 
1547 -- Table structure for table `lang_definitions`
1548 -- 
1550 DROP TABLE IF EXISTS `lang_definitions`;
1551 CREATE TABLE `lang_definitions` (
1552   `def_id` int(11) NOT NULL auto_increment,
1553   `cons_id` int(11) NOT NULL default '0',
1554   `lang_id` int(11) NOT NULL default '0',
1555   `definition` mediumtext,
1556   UNIQUE KEY `def_id` (`def_id`),
1557   KEY `definition` (`definition`(100))
1558 ) ENGINE=MyISAM ;
1560 -- 
1561 -- Table structure for table `lang_languages`
1562 -- 
1564 DROP TABLE IF EXISTS `lang_languages`;
1565 CREATE TABLE `lang_languages` (
1566   `lang_id` int(11) NOT NULL auto_increment,
1567   `lang_code` char(2) NOT NULL default '',
1568   `lang_description` varchar(100) default NULL,
1569   UNIQUE KEY `lang_id` (`lang_id`)
1570 ) ENGINE=MyISAM AUTO_INCREMENT=7 ;
1572 -- 
1573 -- Dumping data for table `lang_languages`
1574 -- 
1576 INSERT INTO `lang_languages` VALUES (1, 'en', 'English');
1577 INSERT INTO `lang_languages` VALUES (2, 'se', 'Swedish');
1578 INSERT INTO `lang_languages` VALUES (3, 'es', 'Spanish');
1579 INSERT INTO `lang_languages` VALUES (4, 'de', 'German');
1580 INSERT INTO `lang_languages` VALUES (5, 'du', 'Dutch');
1581 INSERT INTO `lang_languages` VALUES (6, 'he', 'Hebrew');
1583 -- --------------------------------------------------------
1585 -- 
1586 -- Table structure for table `layout_options`
1587 -- 
1589 DROP TABLE IF EXISTS `layout_options`;
1590 CREATE TABLE `layout_options` (
1591   `form_id` varchar(31) NOT NULL default '',
1592   `field_id` varchar(31) NOT NULL default '',
1593   `group_name` varchar(31) NOT NULL default '',
1594   `title` varchar(63) NOT NULL default '',
1595   `seq` int(11) NOT NULL default '0',
1596   `data_type` tinyint(3) NOT NULL default '0',
1597   `uor` tinyint(1) NOT NULL default '1',
1598   `fld_length` int(11) NOT NULL default '15',
1599   `max_length` int(11) NOT NULL default '0',
1600   `list_id` varchar(31) NOT NULL default '',
1601   `titlecols` tinyint(3) NOT NULL default '1',
1602   `datacols` tinyint(3) NOT NULL default '1',
1603   `default_value` varchar(255) NOT NULL default '',
1604   `edit_options` varchar(36) NOT NULL default '',
1605   `description` varchar(255) NOT NULL default '',
1606   PRIMARY KEY  (`form_id`,`field_id`,`seq`)
1607 ) ENGINE=MyISAM;
1609 -- 
1610 -- Dumping data for table `layout_options`
1611 -- 
1613 INSERT INTO `layout_options` VALUES ('DEM', 'title', '1Who', 'Name', 1, 1, 1, 0, 0, 'titles', 1, 1, '', '', 'Title');
1614 INSERT INTO `layout_options` VALUES ('DEM', 'fname', '1Who', '', 2, 2, 2, 10, 63, '', 0, 0, '', 'C', 'First Name');
1615 INSERT INTO `layout_options` VALUES ('DEM', 'mname', '1Who', '', 3, 2, 1, 2, 63, '', 0, 0, '', 'C', 'Middle Name');
1616 INSERT INTO `layout_options` VALUES ('DEM', 'lname', '1Who', '', 4, 2, 2, 10, 63, '', 0, 0, '', 'C', 'Last Name');
1617 INSERT INTO `layout_options` VALUES ('DEM', 'pubpid', '1Who', 'External ID', 5, 2, 1, 10, 15, '', 1, 1, '', '', 'External identifier');
1618 INSERT INTO `layout_options` VALUES ('DEM', 'DOB', '1Who', 'DOB', 6, 4, 2, 10, 10, '', 1, 1, '', 'D', 'Date of Birth');
1619 INSERT INTO `layout_options` VALUES ('DEM', 'sex', '1Who', 'Sex', 7, 1, 2, 0, 0, 'sex', 1, 1, '', '', 'Sex');
1620 INSERT INTO `layout_options` VALUES ('DEM', 'ss', '1Who', 'S.S.', 8, 2, 1, 11, 11, '', 1, 1, '', '', 'Social Security Number');
1621 INSERT INTO `layout_options` VALUES ('DEM', 'drivers_license', '1Who', 'License/ID', 9, 2, 1, 15, 63, '', 1, 1, '', '', 'Drivers License or State ID');
1622 INSERT INTO `layout_options` VALUES ('DEM', 'status', '1Who', 'Marital Status', 10, 1, 1, 0, 0, 'marital', 1, 3, '', '', 'Marital Status');
1623 INSERT INTO `layout_options` VALUES ('DEM', 'genericname1', '1Who', 'User Defined', 11, 2, 1, 15, 63, '', 1, 3, '', '', 'User Defined Field');
1624 INSERT INTO `layout_options` VALUES ('DEM', 'genericval1', '1Who', '', 12, 2, 1, 15, 63, '', 0, 0, '', '', 'User Defined Field');
1625 INSERT INTO `layout_options` VALUES ('DEM', 'genericname2', '1Who', '', 13, 2, 1, 15, 63, '', 0, 0, '', '', 'User Defined Field');
1626 INSERT INTO `layout_options` VALUES ('DEM', 'genericval2', '1Who', '', 14, 2, 1, 15, 63, '', 0, 0, '', '', 'User Defined Field');
1627 INSERT INTO `layout_options` VALUES ('DEM', 'squad', '1Who', 'Squad', 15, 13, 0, 0, 0, '', 1, 3, '', '', 'Squad Membership');
1628 INSERT INTO `layout_options` VALUES ('DEM', 'pricelevel', '1Who', 'Price Level', 16, 1, 0, 0, 0, 'pricelevel', 1, 1, '', '', 'Discount Level');
1629 INSERT INTO `layout_options` VALUES ('DEM', 'street', '2Contact', 'Address', 1, 2, 1, 25, 63, '', 1, 1, '', 'C', 'Street and Number');
1630 INSERT INTO `layout_options` VALUES ('DEM', 'city', '2Contact', 'City', 2, 2, 1, 15, 63, '', 1, 1, '', 'C', 'City Name');
1631 INSERT INTO `layout_options` VALUES ('DEM', 'state', '2Contact', 'State', 3, 26, 1, 0, 0, 'state', 1, 1, '', '', 'State/Locality');
1632 INSERT INTO `layout_options` VALUES ('DEM', 'postal_code', '2Contact', 'Postal Code', 4, 2, 1, 6, 63, '', 1, 1, '', '', 'Postal Code');
1633 INSERT INTO `layout_options` VALUES ('DEM', 'country_code', '2Contact', 'Country', 5, 26, 1, 0, 0, 'country', 1, 1, '', '', 'Country');
1634 INSERT INTO `layout_options` VALUES ('DEM', 'contact_relationship', '2Contact', 'Emergency Contact', 6, 2, 1, 10, 63, '', 1, 1, '', 'C', 'Emergency Contact Person');
1635 INSERT INTO `layout_options` VALUES ('DEM', 'phone_contact', '2Contact', 'Emergency Phone', 7, 2, 1, 20, 63, '', 1, 1, '', 'P', 'Emergency Contact Phone Number');
1636 INSERT INTO `layout_options` VALUES ('DEM', 'phone_home', '2Contact', 'Home Phone', 8, 2, 1, 20, 63, '', 1, 1, '', 'P', 'Home Phone Number');
1637 INSERT INTO `layout_options` VALUES ('DEM', 'phone_biz', '2Contact', 'Work Phone', 9, 2, 1, 20, 63, '', 1, 1, '', 'P', 'Work Phone Number');
1638 INSERT INTO `layout_options` VALUES ('DEM', 'phone_cell', '2Contact', 'Mobile Phone', 10, 2, 1, 20, 63, '', 1, 1, '', 'P', 'Cell Phone Number');
1639 INSERT INTO `layout_options` VALUES ('DEM', 'email', '2Contact', 'Contact Email', 11, 2, 1, 30, 95, '', 1, 1, '', '', 'Contact Email Address');
1640 INSERT INTO `layout_options` VALUES ('DEM', 'providerID', '3Choices', 'Provider', 1, 11, 1, 0, 0, '', 1, 3, '', '', 'Referring Provider');
1641 INSERT INTO `layout_options` VALUES ('DEM', 'pharmacy_id', '3Choices', 'Pharmacy', 2, 12, 1, 0, 0, '', 1, 3, '', '', 'Preferred Pharmacy');
1642 INSERT INTO `layout_options` VALUES ('DEM', 'hipaa_notice', '3Choices', 'HIPAA Notice Received', 3, 1, 1, 0, 0, 'yesno', 1, 1, '', '', 'Did you receive a copy of the HIPAA Notice?');
1643 INSERT INTO `layout_options` VALUES ('DEM', 'hipaa_voice', '3Choices', 'Allow Voice Message', 4, 1, 1, 0, 0, 'yesno', 1, 1, '', '', 'Allow telephone messages?');
1644 INSERT INTO `layout_options` VALUES ('DEM', 'hipaa_mail', '3Choices', 'Allow Mail Message', 5, 1, 1, 0, 0, 'yesno', 1, 1, '', '', 'Allow email messages?');
1645 INSERT INTO `layout_options` VALUES ('DEM', 'hipaa_message', '3Choices', 'Leave Message With', 6, 2, 1, 20, 63, '', 1, 1, '', '', 'With whom may we leave a message?');
1646 INSERT INTO `layout_options` VALUES ('DEM', 'occupation', '4Employer', 'Occupation', 1, 2, 1, 20, 63, '', 1, 1, '', 'C', 'Occupation');
1647 INSERT INTO `layout_options` VALUES ('DEM', 'em_name', '4Employer', 'Employer Name', 2, 2, 1, 20, 63, '', 1, 1, '', 'C', 'Employer Name');
1648 INSERT INTO `layout_options` VALUES ('DEM', 'em_street', '4Employer', 'Employer Address', 3, 2, 1, 25, 63, '', 1, 1, '', 'C', 'Street and Number');
1649 INSERT INTO `layout_options` VALUES ('DEM', 'em_city', '4Employer', 'City', 4, 2, 1, 15, 63, '', 1, 1, '', 'C', 'City Name');
1650 INSERT INTO `layout_options` VALUES ('DEM', 'em_state', '4Employer', 'State', 5, 2, 1, 15, 63, '', 1, 1, '', 'C', 'State/Locality');
1651 INSERT INTO `layout_options` VALUES ('DEM', 'em_postal_code', '4Employer', 'Postal Code', 6, 2, 1, 6, 63, '', 1, 1, '', '', 'Postal Code');
1652 INSERT INTO `layout_options` VALUES ('DEM', 'em_country', '4Employer', 'Country', 7, 2, 1, 10, 63, '', 1, 1, '', 'C', 'Country');
1653 INSERT INTO `layout_options` VALUES ('DEM', 'language', '5Stats', 'Language', 1, 26, 1, 0, 0, 'language', 1, 1, '', '', 'Preferred Language');
1654 INSERT INTO `layout_options` VALUES ('DEM', 'ethnoracial', '5Stats', 'Race/Ethnicity', 2, 26, 1, 0, 0, 'ethrace', 1, 1, '', '', 'Ethnicity or Race');
1655 INSERT INTO `layout_options` VALUES ('DEM', 'financial_review', '5Stats', 'Financial Review Date', 3, 2, 1, 10, 10, '', 1, 1, '', 'D', 'Financial Review Date');
1656 INSERT INTO `layout_options` VALUES ('DEM', 'family_size', '5Stats', 'Family Size', 4, 2, 1, 20, 63, '', 1, 1, '', '', 'Family Size');
1657 INSERT INTO `layout_options` VALUES ('DEM', 'monthly_income', '5Stats', 'Monthly Income', 5, 2, 1, 20, 63, '', 1, 1, '', '', 'Monthly Income');
1658 INSERT INTO `layout_options` VALUES ('DEM', 'homeless', '5Stats', 'Homeless, etc.', 6, 2, 1, 20, 63, '', 1, 1, '', '', 'Homeless or similar?');
1659 INSERT INTO `layout_options` VALUES ('DEM', 'interpretter', '5Stats', 'Interpreter', 7, 2, 1, 20, 63, '', 1, 1, '', '', 'Interpreter needed?');
1660 INSERT INTO `layout_options` VALUES ('DEM', 'migrantseasonal', '5Stats', 'Migrant/Seasonal', 8, 2, 1, 20, 63, '', 1, 1, '', '', 'Migrant or seasonal worker?');
1661 INSERT INTO `layout_options` VALUES ('DEM', 'contrastart', '5Stats', 'Contraceptives Start',9,4,0,10,10,'',1,1,'','','Date contraceptive services initially provided');
1662 INSERT INTO `layout_options` VALUES ('DEM', 'usertext1', '6Misc', 'User Defined Text 1', 1, 2, 0, 10, 63, '', 1, 1, '', '', 'User Defined');
1663 INSERT INTO `layout_options` VALUES ('DEM', 'usertext2', '6Misc', 'User Defined Text 2', 2, 2, 0, 10, 63, '', 1, 1, '', '', 'User Defined');
1664 INSERT INTO `layout_options` VALUES ('DEM', 'usertext3', '6Misc', 'User Defined Text 3', 3,2,0,10,63,'',1,1,'','','User Defined');
1665 INSERT INTO `layout_options` VALUES ('DEM', 'usertext4', '6Misc', 'User Defined Text 4', 4,2,0,10,63,'',1,1,'','','User Defined');
1666 INSERT INTO `layout_options` VALUES ('DEM', 'usertext5', '6Misc', 'User Defined Text 5', 5,2,0,10,63,'',1,1,'','','User Defined');
1667 INSERT INTO `layout_options` VALUES ('DEM', 'usertext6', '6Misc', 'User Defined Text 6', 6,2,0,10,63,'',1,1,'','','User Defined');
1668 INSERT INTO `layout_options` VALUES ('DEM', 'usertext7', '6Misc', 'User Defined Text 7', 7,2,0,10,63,'',1,1,'','','User Defined');
1669 INSERT INTO `layout_options` VALUES ('DEM', 'usertext8', '6Misc', 'User Defined Text 8', 8,2,0,10,63,'',1,1,'','','User Defined');
1670 INSERT INTO `layout_options` VALUES ('DEM', 'userlist1', '6Misc', 'User Defined List 1', 9, 1, 0, 0, 0, 'userlist1', 1, 1, '', '', 'User Defined');
1671 INSERT INTO `layout_options` VALUES ('DEM', 'userlist2', '6Misc', 'User Defined List 2',10, 1, 0, 0, 0, 'userlist2', 1, 1, '', '', 'User Defined');
1672 INSERT INTO `layout_options` VALUES ('DEM', 'userlist3', '6Misc', 'User Defined List 3',11, 1, 0, 0, 0, 'userlist3', 1, 1, '', '' , 'User Defined');
1673 INSERT INTO `layout_options` VALUES ('DEM', 'userlist4', '6Misc', 'User Defined List 4',12, 1, 0, 0, 0, 'userlist4', 1, 1, '', '' , 'User Defined');
1674 INSERT INTO `layout_options` VALUES ('DEM', 'userlist5', '6Misc', 'User Defined List 5',13, 1, 0, 0, 0, 'userlist5', 1, 1, '', '' , 'User Defined');
1675 INSERT INTO `layout_options` VALUES ('DEM', 'userlist6', '6Misc', 'User Defined List 6',14, 1, 0, 0, 0, 'userlist6', 1, 1, '', '' , 'User Defined');
1676 INSERT INTO `layout_options` VALUES ('DEM', 'userlist7', '6Misc', 'User Defined List 7',15, 1, 0, 0, 0, 'userlist7', 1, 1, '', '' , 'User Defined');
1677 INSERT INTO `layout_options` VALUES ('DEM', 'regdate'  , '6Misc', 'Registration Date'  ,16, 4, 0,10,10, ''         , 1, 1, '', 'D', 'Start Date at This Clinic');
1678 INSERT INTO `layout_options` VALUES ('DEM', 'hipaa_allowsms'  , '3Choices', 'Allow SMS'  , 5, 1, 1, 0, 0, 'yesno', 1, 1, '', '', 'Allow SMS (text messages)?');
1679 INSERT INTO `layout_options` VALUES ('DEM', 'hipaa_allowemail', '3Choices', 'Allow Email', 5, 1, 1, 0, 0, 'yesno', 1, 1, '', '', 'Allow Email?');
1681 INSERT INTO layout_options VALUES ('REF','refer_date'      ,'1Referral','Referral Date'                  , 1, 4,2, 0,  0,''         ,1,1,'C','D','Date of referral');
1682 INSERT INTO layout_options VALUES ('REF','refer_from'      ,'1Referral','Refer By'                       , 2,10,2, 0,  0,''         ,1,1,'' ,'' ,'Referral By');
1683 INSERT INTO layout_options VALUES ('REF','refer_to'        ,'1Referral','Refer To'                       , 3,14,2, 0,  0,''         ,1,1,'' ,'' ,'Referral To');
1684 INSERT INTO layout_options VALUES ('REF','body'            ,'1Referral','Reason'                         , 4, 3,2,30,  3,''         ,1,1,'' ,'' ,'Reason for referral');
1685 INSERT INTO layout_options VALUES ('REF','refer_external'  ,'1Referral','External Referral'              , 5, 1,1, 0,  0,'boolean'  ,1,1,'' ,'' ,'External referral?');
1686 INSERT INTO layout_options VALUES ('REF','refer_diag'      ,'1Referral','Referrer Diagnosis'             , 6, 2,1,30,255,''         ,1,1,'' ,'X','Referrer diagnosis');
1687 INSERT INTO layout_options VALUES ('REF','refer_risk_level','1Referral','Risk Level'                     , 7, 1,1, 0,  0,'risklevel',1,1,'' ,'' ,'Level of urgency');
1688 INSERT INTO layout_options VALUES ('REF','refer_vitals'    ,'1Referral','Include Vitals'                 , 8, 1,1, 0,  0,'boolean'  ,1,1,'' ,'' ,'Include vitals data?');
1689 INSERT INTO layout_options VALUES ('REF','refer_related_code','1Referral','Requested Service'            , 9,15,1,30,255,''         ,1,1,'' ,'' ,'Billing Code for Requested Service');
1690 INSERT INTO layout_options VALUES ('REF','reply_date'      ,'2Counter-Referral','Reply Date'             ,10, 4,1, 0,  0,''         ,1,1,'' ,'D','Date of reply');
1691 INSERT INTO layout_options VALUES ('REF','reply_from'      ,'2Counter-Referral','Reply From'             ,11, 2,1,30,255,''         ,1,1,'' ,'' ,'Who replied?');
1692 INSERT INTO layout_options VALUES ('REF','reply_init_diag' ,'2Counter-Referral','Presumed Diagnosis'     ,12, 2,1,30,255,''         ,1,1,'' ,'' ,'Presumed diagnosis by specialist');
1693 INSERT INTO layout_options VALUES ('REF','reply_final_diag','2Counter-Referral','Final Diagnosis'        ,13, 2,1,30,255,''         ,1,1,'' ,'' ,'Final diagnosis by specialist');
1694 INSERT INTO layout_options VALUES ('REF','reply_documents' ,'2Counter-Referral','Documents'              ,14, 2,1,30,255,''         ,1,1,'' ,'' ,'Where may related scanned or paper documents be found?');
1695 INSERT INTO layout_options VALUES ('REF','reply_findings'  ,'2Counter-Referral','Findings'               ,15, 3,1,30,  3,''         ,1,1,'' ,'' ,'Findings by specialist');
1696 INSERT INTO layout_options VALUES ('REF','reply_services'  ,'2Counter-Referral','Services Provided'      ,16, 3,1,30,  3,''         ,1,1,'' ,'' ,'Service provided by specialist');
1697 INSERT INTO layout_options VALUES ('REF','reply_recommend' ,'2Counter-Referral','Recommendations'        ,17, 3,1,30,  3,''         ,1,1,'' ,'' ,'Recommendations by specialist');
1698 INSERT INTO layout_options VALUES ('REF','reply_rx_refer'  ,'2Counter-Referral','Prescriptions/Referrals',18, 3,1,30,  3,''         ,1,1,'' ,'' ,'Prescriptions and/or referrals by specialist');
1700 INSERT INTO layout_options VALUES ('HIS','usertext11','1General','Risk Factors',1,21,1,0,0,'riskfactors',1,1,'','' ,'Risk Factors');
1701 INSERT INTO layout_options VALUES ('HIS','exams'     ,'1General','Exams/Tests' ,2,23,1,0,0,'exams'      ,1,1,'','' ,'Exam and test results');
1702 INSERT INTO layout_options VALUES ('HIS','history_father'   ,'2Family History','Father'   ,1, 2,1,20,255,'',1,1,'','' ,'');
1703 INSERT INTO layout_options VALUES ('HIS','history_mother'   ,'2Family History','Mother'   ,2, 2,1,20,255,'',1,1,'','' ,'');
1704 INSERT INTO layout_options VALUES ('HIS','history_siblings' ,'2Family History','Siblings' ,3, 2,1,20,255,'',1,1,'','' ,'');
1705 INSERT INTO layout_options VALUES ('HIS','history_spouse'   ,'2Family History','Spouse'   ,4, 2,1,20,255,'',1,1,'','' ,'');
1706 INSERT INTO layout_options VALUES ('HIS','history_offspring','2Family History','Offspring',5, 2,1,20,255,'',1,3,'','' ,'');
1707 INSERT INTO layout_options VALUES ('HIS','relatives_cancer'             ,'3Relatives','Cancer'             ,1, 2,1,20,255,'',1,1,'','' ,'');
1708 INSERT INTO layout_options VALUES ('HIS','relatives_tuberculosis'       ,'3Relatives','Tuberculosis'       ,2, 2,1,20,255,'',1,1,'','' ,'');
1709 INSERT INTO layout_options VALUES ('HIS','relatives_diabetes'           ,'3Relatives','Diabetes'           ,3, 2,1,20,255,'',1,1,'','' ,'');
1710 INSERT INTO layout_options VALUES ('HIS','relatives_high_blood_pressure','3Relatives','High Blood Pressure',4, 2,1,20,255,'',1,1,'','' ,'');
1711 INSERT INTO layout_options VALUES ('HIS','relatives_heart_problems'     ,'3Relatives','Heart Problems'     ,5, 2,1,20,255,'',1,1,'','' ,'');
1712 INSERT INTO layout_options VALUES ('HIS','relatives_stroke'             ,'3Relatives','Stroke'             ,6, 2,1,20,255,'',1,1,'','' ,'');
1713 INSERT INTO layout_options VALUES ('HIS','relatives_epilepsy'           ,'3Relatives','Epilepsy'           ,7, 2,1,20,255,'',1,1,'','' ,'');
1714 INSERT INTO layout_options VALUES ('HIS','relatives_mental_illness'     ,'3Relatives','Mental Illness'     ,8, 2,1,20,255,'',1,1,'','' ,'');
1715 INSERT INTO layout_options VALUES ('HIS','relatives_suicide'            ,'3Relatives','Suicide'            ,9, 2,1,20,255,'',1,3,'','' ,'');
1716 INSERT INTO layout_options VALUES ('HIS','coffee'              ,'4Lifestyle','Coffee'              ,1, 2,1,20,255,'',1,1,'','' ,'Caffeine consumption');
1717 INSERT INTO layout_options VALUES ('HIS','tobacco'             ,'4Lifestyle','Tobacco'             ,2, 2,1,20,255,'',1,1,'','' ,'Tobacco use');
1718 INSERT INTO layout_options VALUES ('HIS','alcohol'             ,'4Lifestyle','Alcohol'             ,3, 2,1,20,255,'',1,1,'','' ,'Alcohol consumption');
1719 INSERT INTO layout_options VALUES ('HIS','sleep_patterns'      ,'4Lifestyle','Sleep Patterns'      ,4, 2,1,20,255,'',1,1,'','' ,'Sleep patterns');
1720 INSERT INTO layout_options VALUES ('HIS','exercise_patterns'   ,'4Lifestyle','Exercise Patterns'   ,5, 2,1,20,255,'',1,1,'','' ,'Exercise patterns');
1721 INSERT INTO layout_options VALUES ('HIS','seatbelt_use'        ,'4Lifestyle','Seatbelt Use'        ,6, 2,1,20,255,'',1,1,'','' ,'Seatbelt use');
1722 INSERT INTO layout_options VALUES ('HIS','counseling'          ,'4Lifestyle','Counseling'          ,7, 2,1,20,255,'',1,1,'','' ,'Counseling activities');
1723 INSERT INTO layout_options VALUES ('HIS','hazardous_activities','4Lifestyle','Hazardous Activities',8, 2,1,20,255,'',1,1,'','' ,'Hazardous activities');
1724 INSERT INTO layout_options VALUES ('HIS','name_1'            ,'5Other','Name/Value'        ,1, 2,1,10,255,'',1,1,'','' ,'Name 1' );
1725 INSERT INTO layout_options VALUES ('HIS','value_1'           ,'5Other',''                  ,2, 2,1,10,255,'',0,0,'','' ,'Value 1');
1726 INSERT INTO layout_options VALUES ('HIS','name_2'            ,'5Other','Name/Value'        ,3, 2,1,10,255,'',1,1,'','' ,'Name 2' );
1727 INSERT INTO layout_options VALUES ('HIS','value_2'           ,'5Other',''                  ,4, 2,1,10,255,'',0,0,'','' ,'Value 2');
1728 INSERT INTO layout_options VALUES ('HIS','additional_history','5Other','Additional History',5, 3,1,30,  3,'',1,3,'' ,'' ,'Additional history notes');
1729 INSERT INTO layout_options VALUES ('HIS','userarea11'        ,'5Other','User Defined Area 11',6,3,0,30,3,'',1,3,'','','User Defined');
1730 INSERT INTO layout_options VALUES ('HIS','userarea12'        ,'5Other','User Defined Area 12',7,3,0,30,3,'',1,3,'','','User Defined');
1732 -- --------------------------------------------------------
1734 -- 
1735 -- Table structure for table `list_options`
1736 -- 
1738 DROP TABLE IF EXISTS `list_options`;
1739 CREATE TABLE `list_options` (
1740   `list_id` varchar(31) NOT NULL default '',
1741   `option_id` varchar(31) NOT NULL default '',
1742   `title` varchar(255) NOT NULL default '',
1743   `seq` int(11) NOT NULL default '0',
1744   `is_default` tinyint(1) NOT NULL default '0',
1745   `option_value` float NOT NULL default '0',
1746   PRIMARY KEY  (`list_id`,`option_id`)
1747 ) ENGINE=MyISAM;
1749 -- 
1750 -- Dumping data for table `list_options`
1751 -- 
1753 INSERT INTO `list_options` VALUES ('yesno', 'NO', 'NO', 1, 0, 0);
1754 INSERT INTO `list_options` VALUES ('yesno', 'YES', 'YES', 2, 0, 0);
1755 INSERT INTO `list_options` VALUES ('titles', 'Mr.', 'Mr.', 1, 0, 0);
1756 INSERT INTO `list_options` VALUES ('titles', 'Mrs.', 'Mrs.', 2, 0, 0);
1757 INSERT INTO `list_options` VALUES ('titles', 'Ms.', 'Ms.', 3, 0, 0);
1758 INSERT INTO `list_options` VALUES ('titles', 'Dr.', 'Dr.', 4, 0, 0);
1759 INSERT INTO `list_options` VALUES ('sex', 'Female', 'Female', 1, 0, 0);
1760 INSERT INTO `list_options` VALUES ('sex', 'Male', 'Male', 2, 0, 0);
1761 INSERT INTO `list_options` VALUES ('marital', 'married', 'Married', 1, 0, 0);
1762 INSERT INTO `list_options` VALUES ('marital', 'single', 'Single', 2, 0, 0);
1763 INSERT INTO `list_options` VALUES ('marital', 'divorced', 'Divorced', 3, 0, 0);
1764 INSERT INTO `list_options` VALUES ('marital', 'widowed', 'Widowed', 4, 0, 0);
1765 INSERT INTO `list_options` VALUES ('marital', 'separated', 'Separated', 5, 0, 0);
1766 INSERT INTO `list_options` VALUES ('marital', 'domestic partner', 'Domestic Partner', 6, 0, 0);
1767 INSERT INTO `list_options` VALUES ('language', 'English', 'English', 1, 0, 0);
1768 INSERT INTO `list_options` VALUES ('language', 'Spanish', 'Spanish', 2, 0, 0);
1769 INSERT INTO `list_options` VALUES ('ethrace', 'Caucasian', 'Caucasian', 1, 0, 0);
1770 INSERT INTO `list_options` VALUES ('ethrace', 'Asian', 'Asian', 2, 0, 0);
1771 INSERT INTO `list_options` VALUES ('ethrace', 'Black', 'Black', 3, 0, 0);
1772 INSERT INTO `list_options` VALUES ('ethrace', 'Hispanic', 'Hispanic', 4, 0, 0);
1773 INSERT INTO `list_options` VALUES ('userlist1', 'sample', 'Sample', 1, 0, 0);
1774 INSERT INTO `list_options` VALUES ('userlist2', 'sample', 'Sample', 1, 0, 0);
1775 INSERT INTO `list_options` VALUES ('userlist3','sample','Sample',1,0,0);
1776 INSERT INTO `list_options` VALUES ('userlist4','sample','Sample',1,0,0);
1777 INSERT INTO `list_options` VALUES ('userlist5','sample','Sample',1,0,0);
1778 INSERT INTO `list_options` VALUES ('userlist6','sample','Sample',1,0,0);
1779 INSERT INTO `list_options` VALUES ('userlist7','sample','Sample',1,0,0);
1780 INSERT INTO `list_options` VALUES ('pricelevel', 'standard', 'Standard', 1, 1, 0);
1781 INSERT INTO `list_options` VALUES ('risklevel', 'low', 'Low', 1, 0, 0);
1782 INSERT INTO `list_options` VALUES ('risklevel', 'medium', 'Medium', 2, 1, 0);
1783 INSERT INTO `list_options` VALUES ('risklevel', 'high', 'High', 3, 0, 0);
1784 INSERT INTO `list_options` VALUES ('boolean', '0', 'No', 1, 0, 0);
1785 INSERT INTO `list_options` VALUES ('boolean', '1', 'Yes', 2, 0, 0);
1786 INSERT INTO `list_options` VALUES ('country', 'USA', 'USA', 1, 0, 0);
1787 INSERT INTO `list_options` VALUES ('state','CA','California',1,0,0);
1788 INSERT INTO list_options VALUES ('refsource','Patient'      ,'Patient'      , 1,0,0);
1789 INSERT INTO list_options VALUES ('refsource','Employee'     ,'Employee'     , 2,0,0);
1790 INSERT INTO list_options VALUES ('refsource','Walk-In'      ,'Walk-In'      , 3,0,0);
1791 INSERT INTO list_options VALUES ('refsource','Newspaper'    ,'Newspaper'    , 4,0,0);
1792 INSERT INTO list_options VALUES ('refsource','Radio'        ,'Radio'        , 5,0,0);
1793 INSERT INTO list_options VALUES ('refsource','T.V.'         ,'T.V.'         , 6,0,0);
1794 INSERT INTO list_options VALUES ('refsource','Direct Mail'  ,'Direct Mail'  , 7,0,0);
1795 INSERT INTO list_options VALUES ('refsource','Coupon'       ,'Coupon'       , 8,0,0);
1796 INSERT INTO list_options VALUES ('refsource','Referral Card','Referral Card', 9,0,0);
1797 INSERT INTO list_options VALUES ('refsource','Other'        ,'Other'        ,10,0,0);
1798 INSERT INTO list_options VALUES ('riskfactors','vv' ,'Varicose Veins'                      , 1,0,0);
1799 INSERT INTO list_options VALUES ('riskfactors','ht' ,'Hypertension'                        , 2,0,0);
1800 INSERT INTO list_options VALUES ('riskfactors','db' ,'Diabetes'                            , 3,0,0);
1801 INSERT INTO list_options VALUES ('riskfactors','sc' ,'Sickle Cell'                         , 4,0,0);
1802 INSERT INTO list_options VALUES ('riskfactors','fib','Fibroids'                            , 5,0,0);
1803 INSERT INTO list_options VALUES ('riskfactors','pid','PID (Pelvic Inflammatory Disease)'   , 6,0,0);
1804 INSERT INTO list_options VALUES ('riskfactors','mig','Severe Migraine'                     , 7,0,0);
1805 INSERT INTO list_options VALUES ('riskfactors','hd' ,'Heart Disease'                       , 8,0,0);
1806 INSERT INTO list_options VALUES ('riskfactors','str','Thrombosis/Stroke'                   , 9,0,0);
1807 INSERT INTO list_options VALUES ('riskfactors','hep','Hepatitis'                           ,10,0,0);
1808 INSERT INTO list_options VALUES ('riskfactors','gb' ,'Gall Bladder Condition'              ,11,0,0);
1809 INSERT INTO list_options VALUES ('riskfactors','br' ,'Breast Disease'                      ,12,0,0);
1810 INSERT INTO list_options VALUES ('riskfactors','dpr','Depression'                          ,13,0,0);
1811 INSERT INTO list_options VALUES ('riskfactors','all','Allergies'                           ,14,0,0);
1812 INSERT INTO list_options VALUES ('riskfactors','inf','Infertility'                         ,15,0,0);
1813 INSERT INTO list_options VALUES ('riskfactors','ast','Asthma'                              ,16,0,0);
1814 INSERT INTO list_options VALUES ('riskfactors','ep' ,'Epilepsy'                            ,17,0,0);
1815 INSERT INTO list_options VALUES ('riskfactors','cl' ,'Contact Lenses'                      ,18,0,0);
1816 INSERT INTO list_options VALUES ('riskfactors','coc','Contraceptive Complication (specify)',19,0,0);
1817 INSERT INTO list_options VALUES ('riskfactors','oth','Other (specify)'                     ,20,0,0);
1818 INSERT INTO list_options VALUES ('exams' ,'brs','Breast Exam'          , 1,0,0);
1819 INSERT INTO list_options VALUES ('exams' ,'cec','Cardiac Echo'         , 2,0,0);
1820 INSERT INTO list_options VALUES ('exams' ,'ecg','ECG'                  , 3,0,0);
1821 INSERT INTO list_options VALUES ('exams' ,'gyn','Gynecological Exam'   , 4,0,0);
1822 INSERT INTO list_options VALUES ('exams' ,'mam','Mammogram'            , 5,0,0);
1823 INSERT INTO list_options VALUES ('exams' ,'phy','Physical Exam'        , 6,0,0);
1824 INSERT INTO list_options VALUES ('exams' ,'pro','Prostate Exam'        , 7,0,0);
1825 INSERT INTO list_options VALUES ('exams' ,'rec','Rectal Exam'          , 8,0,0);
1826 INSERT INTO list_options VALUES ('exams' ,'sic','Sigmoid/Colonoscopy'  , 9,0,0);
1827 INSERT INTO list_options VALUES ('exams' ,'ret','Retinal Exam'         ,10,0,0);
1828 INSERT INTO list_options VALUES ('exams' ,'flu','Flu Vaccination'      ,11,0,0);
1829 INSERT INTO list_options VALUES ('exams' ,'pne','Pneumonia Vaccination',12,0,0);
1830 INSERT INTO list_options VALUES ('exams' ,'ldl','LDL'                  ,13,0,0);
1831 INSERT INTO list_options VALUES ('exams' ,'hem','Hemoglobin'           ,14,0,0);
1832 INSERT INTO list_options VALUES ('exams' ,'psa','PSA'                  ,15,0,0);
1833 INSERT INTO list_options VALUES ('drug_form','1','suspension' ,1,0,0);
1834 INSERT INTO list_options VALUES ('drug_form','2','tablet'     ,2,0,0);
1835 INSERT INTO list_options VALUES ('drug_form','3','capsule'    ,3,0,0);
1836 INSERT INTO list_options VALUES ('drug_form','4','solution'   ,4,0,0);
1837 INSERT INTO list_options VALUES ('drug_form','5','tsp'        ,5,0,0);
1838 INSERT INTO list_options VALUES ('drug_form','6','ml'         ,6,0,0);
1839 INSERT INTO list_options VALUES ('drug_form','7','units'      ,7,0,0);
1840 INSERT INTO list_options VALUES ('drug_form','8','inhalations',8,0,0);
1841 INSERT INTO list_options VALUES ('drug_form','9','gtts(drops)',9,0,0);
1842 INSERT INTO list_options VALUES ('drug_units','1','mg'    ,1,0,0);
1843 INSERT INTO list_options VALUES ('drug_units','2','mg/1cc',2,0,0);
1844 INSERT INTO list_options VALUES ('drug_units','3','mg/2cc',3,0,0);
1845 INSERT INTO list_options VALUES ('drug_units','4','mg/3cc',4,0,0);
1846 INSERT INTO list_options VALUES ('drug_units','5','mg/4cc',5,0,0);
1847 INSERT INTO list_options VALUES ('drug_units','6','mg/5cc',6,0,0);
1848 INSERT INTO list_options VALUES ('drug_units','7','grams' ,7,0,0);
1849 INSERT INTO list_options VALUES ('drug_units','8','mcg'   ,8,0,0);
1850 INSERT INTO list_options VALUES ('drug_route', '1','Per Oris'         , 1,0,0);
1851 INSERT INTO list_options VALUES ('drug_route', '2','Per Rectum'       , 2,0,0);
1852 INSERT INTO list_options VALUES ('drug_route', '3','To Skin'          , 3,0,0);
1853 INSERT INTO list_options VALUES ('drug_route', '4','To Affected Area' , 4,0,0);
1854 INSERT INTO list_options VALUES ('drug_route', '5','Sublingual'       , 5,0,0);
1855 INSERT INTO list_options VALUES ('drug_route',' 6','OS'               , 6,0,0);
1856 INSERT INTO list_options VALUES ('drug_route', '7','OD'               , 7,0,0);
1857 INSERT INTO list_options VALUES ('drug_route', '8','OU'               , 8,0,0);
1858 INSERT INTO list_options VALUES ('drug_route', '9','SQ'               , 9,0,0);
1859 INSERT INTO list_options VALUES ('drug_route','10','IM'               ,10,0,0);
1860 INSERT INTO list_options VALUES ('drug_route','11','IV'               ,11,0,0);
1861 INSERT INTO list_options VALUES ('drug_route','12','Per Nostril'      ,12,0,0);
1862 INSERT INTO list_options VALUES ('drug_interval','1','b.i.d.',1,0,0);
1863 INSERT INTO list_options VALUES ('drug_interval','2','t.i.d.',2,0,0);
1864 INSERT INTO list_options VALUES ('drug_interval','3','q.i.d.',3,0,0);
1865 INSERT INTO list_options VALUES ('drug_interval','4','q.3h'  ,4,0,0);
1866 INSERT INTO list_options VALUES ('drug_interval','5','q.4h'  ,5,0,0);
1867 INSERT INTO list_options VALUES ('drug_interval','6','q.5h'  ,6,0,0);
1868 INSERT INTO list_options VALUES ('drug_interval','7','q.6h'  ,7,0,0);
1869 INSERT INTO list_options VALUES ('drug_interval','8','q.8h'  ,8,0,0);
1870 INSERT INTO list_options VALUES ('drug_interval','9','q.d.'  ,9,0,0);
1871 INSERT INTO list_options VALUES ('chartloc','fileroom','File Room'              ,1,0,0);
1872 INSERT INTO list_options VALUES ('lists' ,'boolean'      ,'Boolean'            , 1,0,0);
1873 INSERT INTO list_options VALUES ('lists' ,'chartloc'     ,'Chart Storage Locations',1,0,0);
1874 INSERT INTO list_options VALUES ('lists' ,'country'      ,'Country'            , 2,0,0);
1875 INSERT INTO list_options VALUES ('lists' ,'drug_form'    ,'Drug Forms'         , 3,0,0);
1876 INSERT INTO list_options VALUES ('lists' ,'drug_units'   ,'Drug Units'         , 4,0,0);
1877 INSERT INTO list_options VALUES ('lists' ,'drug_route'   ,'Drug Routes'        , 5,0,0);
1878 INSERT INTO list_options VALUES ('lists' ,'drug_interval','Drug Intervals'     , 6,0,0);
1879 INSERT INTO list_options VALUES ('lists' ,'exams'        ,'Exams/Tests'        , 7,0,0);
1880 INSERT INTO list_options VALUES ('lists' ,'feesheet'     ,'Fee Sheet'          , 8,0,0);
1881 INSERT INTO list_options VALUES ('lists' ,'language'     ,'Language'           , 9,0,0);
1882 INSERT INTO list_options VALUES ('lists' ,'marital'      ,'Marital Status'     ,10,0,0);
1883 INSERT INTO list_options VALUES ('lists' ,'pricelevel'   ,'Price Level'        ,11,0,0);
1884 INSERT INTO list_options VALUES ('lists' ,'ethrace'      ,'Race/Ethnicity'     ,12,0,0);
1885 INSERT INTO list_options VALUES ('lists' ,'refsource'    ,'Referral Source'    ,13,0,0);
1886 INSERT INTO list_options VALUES ('lists' ,'riskfactors'  ,'Risk Factors'       ,14,0,0);
1887 INSERT INTO list_options VALUES ('lists' ,'risklevel'    ,'Risk Level'         ,15,0,0);
1888 INSERT INTO list_options VALUES ('lists' ,'superbill'    ,'Service Category'   ,16,0,0);
1889 INSERT INTO list_options VALUES ('lists' ,'sex'          ,'Sex'                ,17,0,0);
1890 INSERT INTO list_options VALUES ('lists' ,'state'        ,'State'              ,18,0,0);
1891 INSERT INTO list_options VALUES ('lists' ,'taxrate'      ,'Tax Rate'           ,19,0,0);
1892 INSERT INTO list_options VALUES ('lists' ,'titles'       ,'Titles'             ,20,0,0);
1893 INSERT INTO list_options VALUES ('lists' ,'yesno'        ,'Yes/No'             ,21,0,0);
1894 INSERT INTO list_options VALUES ('lists' ,'userlist1'    ,'User Defined List 1',22,0,0);
1895 INSERT INTO list_options VALUES ('lists' ,'userlist2'    ,'User Defined List 2',23,0,0);
1896 INSERT INTO list_options VALUES ('lists' ,'userlist3'    ,'User Defined List 3',24,0,0);
1897 INSERT INTO list_options VALUES ('lists' ,'userlist4'    ,'User Defined List 4',25,0,0);
1898 INSERT INTO list_options VALUES ('lists' ,'userlist5'    ,'User Defined List 5',26,0,0);
1899 INSERT INTO list_options VALUES ('lists' ,'userlist6'    ,'User Defined List 6',27,0,0);
1900 INSERT INTO list_options VALUES ('lists' ,'userlist7'    ,'User Defined List 7',28,0,0);
1902 INSERT INTO list_options VALUES ('lists'    ,'adjreason'      ,'Adjustment Reasons',1,0,0);
1903 INSERT INTO list_options VALUES ('adjreason','Adm adjust'     ,'Adm adjust'     , 5,0,0);
1904 INSERT INTO list_options VALUES ('adjreason','After hrs calls','After hrs calls',10,0,0);
1905 INSERT INTO list_options VALUES ('adjreason','Bad check'      ,'Bad check'      ,15,0,0);
1906 INSERT INTO list_options VALUES ('adjreason','Bad debt'       ,'Bad debt'       ,20,0,0);
1907 INSERT INTO list_options VALUES ('adjreason','Coll w/o'       ,'Coll w/o'       ,25,0,0);
1908 INSERT INTO list_options VALUES ('adjreason','Discount'       ,'Discount'       ,30,0,0);
1909 INSERT INTO list_options VALUES ('adjreason','Hardship w/o'   ,'Hardship w/o'   ,35,0,0);
1910 INSERT INTO list_options VALUES ('adjreason','Ins adjust'     ,'Ins adjust'     ,40,0,0);
1911 INSERT INTO list_options VALUES ('adjreason','Ins bundling'   ,'Ins bundling'   ,45,0,0);
1912 INSERT INTO list_options VALUES ('adjreason','Ins overpaid'   ,'Ins overpaid'   ,50,0,0);
1913 INSERT INTO list_options VALUES ('adjreason','Ins refund'     ,'Ins refund'     ,55,0,0);
1914 INSERT INTO list_options VALUES ('adjreason','Pt overpaid'    ,'Pt overpaid'    ,60,0,0);
1915 INSERT INTO list_options VALUES ('adjreason','Pt refund'      ,'Pt refund'      ,65,0,0);
1916 INSERT INTO list_options VALUES ('adjreason','Pt released'    ,'Pt released'    ,70,0,0);
1917 INSERT INTO list_options VALUES ('adjreason','Sm debt w/o'    ,'Sm debt w/o'    ,75,0,0);
1918 INSERT INTO list_options VALUES ('adjreason','To copay'       ,'To copay'       ,80,0,0);
1919 INSERT INTO list_options VALUES ('adjreason','To ded\'ble'    ,'To ded\'ble'    ,85,0,0);
1920 INSERT INTO list_options VALUES ('adjreason','Untimely filing','Untimely filing',90,0,0);
1922 -- --------------------------------------------------------
1924 -- 
1925 -- Table structure for table `lists`
1926 -- 
1928 DROP TABLE IF EXISTS `lists`;
1929 CREATE TABLE `lists` (
1930   `id` bigint(20) NOT NULL auto_increment,
1931   `date` datetime default NULL,
1932   `type` varchar(255) default NULL,
1933   `title` varchar(255) default NULL,
1934   `begdate` date default NULL,
1935   `enddate` date default NULL,
1936   `returndate` date default NULL,
1937   `occurrence` int(11) default '0',
1938   `classification` int(11) default '0',
1939   `referredby` varchar(255) default NULL,
1940   `extrainfo` varchar(255) default NULL,
1941   `diagnosis` varchar(255) default NULL,
1942   `activity` tinyint(4) default NULL,
1943   `comments` longtext,
1944   `pid` bigint(20) default NULL,
1945   `user` varchar(255) default NULL,
1946   `groupname` varchar(255) default NULL,
1947   `outcome` int(11) NOT NULL default '0',
1948   `destination` varchar(255) default NULL,
1949   PRIMARY KEY  (`id`)
1950 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1952 -- --------------------------------------------------------
1954 -- 
1955 -- Table structure for table `log`
1956 -- 
1958 DROP TABLE IF EXISTS `log`;
1959 CREATE TABLE `log` (
1960   `id` bigint(20) NOT NULL auto_increment,
1961   `date` datetime default NULL,
1962   `event` varchar(255) default NULL,
1963   `user` varchar(255) default NULL,
1964   `groupname` varchar(255) default NULL,
1965   `comments` longtext,
1966   `user_notes` longtext,
1967   PRIMARY KEY  (`id`)
1968 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1970 -- --------------------------------------------------------
1972 -- 
1973 -- Table structure for table `notes`
1974 -- 
1976 DROP TABLE IF EXISTS `notes`;
1977 CREATE TABLE `notes` (
1978   `id` int(11) NOT NULL default '0',
1979   `foreign_id` int(11) NOT NULL default '0',
1980   `note` varchar(255) default NULL,
1981   `owner` int(11) default NULL,
1982   `date` datetime default NULL,
1983   `revision` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
1984   PRIMARY KEY  (`id`),
1985   KEY `foreign_id` (`owner`),
1986   KEY `foreign_id_2` (`foreign_id`),
1987   KEY `date` (`date`)
1988 ) ENGINE=MyISAM;
1990 -- --------------------------------------------------------
1992 -- 
1993 -- Table structure for table `onotes`
1994 -- 
1996 DROP TABLE IF EXISTS `onotes`;
1997 CREATE TABLE `onotes` (
1998   `id` bigint(20) NOT NULL auto_increment,
1999   `date` datetime default NULL,
2000   `body` longtext,
2001   `user` varchar(255) default NULL,
2002   `groupname` varchar(255) default NULL,
2003   `activity` tinyint(4) default NULL,
2004   PRIMARY KEY  (`id`)
2005 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2007 -- --------------------------------------------------------
2009 -- 
2010 -- Table structure for table `openemr_module_vars`
2011 -- 
2013 DROP TABLE IF EXISTS `openemr_module_vars`;
2014 CREATE TABLE `openemr_module_vars` (
2015   `pn_id` int(11) unsigned NOT NULL auto_increment,
2016   `pn_modname` varchar(64) default NULL,
2017   `pn_name` varchar(64) default NULL,
2018   `pn_value` longtext,
2019   PRIMARY KEY  (`pn_id`),
2020   KEY `pn_modname` (`pn_modname`),
2021   KEY `pn_name` (`pn_name`)
2022 ) ENGINE=MyISAM AUTO_INCREMENT=235 ;
2024 -- 
2025 -- Dumping data for table `openemr_module_vars`
2026 -- 
2028 INSERT INTO `openemr_module_vars` VALUES (234, 'PostCalendar', 'pcNotifyEmail', '');
2029 INSERT INTO `openemr_module_vars` VALUES (233, 'PostCalendar', 'pcNotifyAdmin', '0');
2030 INSERT INTO `openemr_module_vars` VALUES (232, 'PostCalendar', 'pcCacheLifetime', '3600');
2031 INSERT INTO `openemr_module_vars` VALUES (231, 'PostCalendar', 'pcUseCache', '0');
2032 INSERT INTO `openemr_module_vars` VALUES (230, 'PostCalendar', 'pcDefaultView', 'day');
2033 INSERT INTO `openemr_module_vars` VALUES (229, 'PostCalendar', 'pcTimeIncrement', '5');
2034 INSERT INTO `openemr_module_vars` VALUES (228, 'PostCalendar', 'pcAllowUserCalendar', '1');
2035 INSERT INTO `openemr_module_vars` VALUES (227, 'PostCalendar', 'pcAllowSiteWide', '1');
2036 INSERT INTO `openemr_module_vars` VALUES (226, 'PostCalendar', 'pcTemplate', 'default');
2037 INSERT INTO `openemr_module_vars` VALUES (225, 'PostCalendar', 'pcEventDateFormat', '%Y-%m-%d');
2038 INSERT INTO `openemr_module_vars` VALUES (224, 'PostCalendar', 'pcDisplayTopics', '0');
2039 INSERT INTO `openemr_module_vars` VALUES (223, 'PostCalendar', 'pcListHowManyEvents', '15');
2040 INSERT INTO `openemr_module_vars` VALUES (222, 'PostCalendar', 'pcAllowDirectSubmit', '1');
2041 INSERT INTO `openemr_module_vars` VALUES (221, 'PostCalendar', 'pcUsePopups', '0');
2042 INSERT INTO `openemr_module_vars` VALUES (220, 'PostCalendar', 'pcDayHighlightColor', '#EEEEEE');
2043 INSERT INTO `openemr_module_vars` VALUES (219, 'PostCalendar', 'pcFirstDayOfWeek', '1');
2044 INSERT INTO `openemr_module_vars` VALUES (218, 'PostCalendar', 'pcUseInternationalDates', '0');
2045 INSERT INTO `openemr_module_vars` VALUES (217, 'PostCalendar', 'pcEventsOpenInNewWindow', '0');
2046 INSERT INTO `openemr_module_vars` VALUES (216, 'PostCalendar', 'pcTime24Hours', '0');
2048 -- --------------------------------------------------------
2050 -- 
2051 -- Table structure for table `openemr_modules`
2052 -- 
2054 DROP TABLE IF EXISTS `openemr_modules`;
2055 CREATE TABLE `openemr_modules` (
2056   `pn_id` int(11) unsigned NOT NULL auto_increment,
2057   `pn_name` varchar(64) default NULL,
2058   `pn_type` int(6) NOT NULL default '0',
2059   `pn_displayname` varchar(64) default NULL,
2060   `pn_description` varchar(255) default NULL,
2061   `pn_regid` int(11) unsigned NOT NULL default '0',
2062   `pn_directory` varchar(64) default NULL,
2063   `pn_version` varchar(10) default NULL,
2064   `pn_admin_capable` tinyint(1) NOT NULL default '0',
2065   `pn_user_capable` tinyint(1) NOT NULL default '0',
2066   `pn_state` tinyint(1) NOT NULL default '0',
2067   PRIMARY KEY  (`pn_id`)
2068 ) ENGINE=MyISAM AUTO_INCREMENT=47 ;
2070 -- 
2071 -- Dumping data for table `openemr_modules`
2072 -- 
2074 INSERT INTO `openemr_modules` VALUES (46, 'PostCalendar', 2, 'PostCalendar', 'PostNuke Calendar Module', 0, 'PostCalendar', '4.0.0', 1, 1, 3);
2076 -- --------------------------------------------------------
2078 -- 
2079 -- Table structure for table `openemr_postcalendar_categories`
2080 -- 
2082 DROP TABLE IF EXISTS `openemr_postcalendar_categories`;
2083 CREATE TABLE `openemr_postcalendar_categories` (
2084   `pc_catid` int(11) unsigned NOT NULL auto_increment,
2085   `pc_catname` varchar(100) default NULL,
2086   `pc_catcolor` varchar(50) default NULL,
2087   `pc_catdesc` text,
2088   `pc_recurrtype` int(1) NOT NULL default '0',
2089   `pc_enddate` date default NULL,
2090   `pc_recurrspec` text,
2091   `pc_recurrfreq` int(3) NOT NULL default '0',
2092   `pc_duration` bigint(20) NOT NULL default '0',
2093   `pc_end_date_flag` tinyint(1) NOT NULL default '0',
2094   `pc_end_date_type` int(2) default NULL,
2095   `pc_end_date_freq` int(11) NOT NULL default '0',
2096   `pc_end_all_day` tinyint(1) NOT NULL default '0',
2097   `pc_dailylimit` int(2) NOT NULL default '0',
2098   PRIMARY KEY  (`pc_catid`),
2099   KEY `basic_cat` (`pc_catname`,`pc_catcolor`)
2100 ) ENGINE=MyISAM AUTO_INCREMENT=11 ;
2102 -- 
2103 -- Dumping data for table `openemr_postcalendar_categories`
2104 -- 
2106 INSERT INTO `openemr_postcalendar_categories` VALUES (5, 'Office Visit', '#FFFFCC', 'Normal Office Visit', 0, NULL, 'a:5:{s:17:"event_repeat_freq";s:1:"0";s:22:"event_repeat_freq_type";s:1:"0";s:19:"event_repeat_on_num";s:1:"1";s:19:"event_repeat_on_day";s:1:"0";s:20:"event_repeat_on_freq";s:1:"0";}', 0, 900, 0, 0, 0, 0, 0);
2107 INSERT INTO `openemr_postcalendar_categories` VALUES (4, 'Vacation', '#EFEFEF', 'Reserved for use to define Scheduled Vacation Time', 0, NULL, 'a:5:{s:17:"event_repeat_freq";s:1:"0";s:22:"event_repeat_freq_type";s:1:"0";s:19:"event_repeat_on_num";s:1:"1";s:19:"event_repeat_on_day";s:1:"0";s:20:"event_repeat_on_freq";s:1:"0";}', 0, 0, 0, 0, 0, 1, 0);
2108 INSERT INTO `openemr_postcalendar_categories` VALUES (1, 'No Show', '#DDDDDD', 'Reserved to define when an event did not occur as specified.', 0, NULL, 'a:5:{s:17:"event_repeat_freq";s:1:"0";s:22:"event_repeat_freq_type";s:1:"0";s:19:"event_repeat_on_num";s:1:"1";s:19:"event_repeat_on_day";s:1:"0";s:20:"event_repeat_on_freq";s:1:"0";}', 0, 0, 0, 0, 0, 0, 0);
2109 INSERT INTO `openemr_postcalendar_categories` VALUES (2, 'In Office', '#99CCFF', 'Reserved todefine when a provider may haveavailable appointments after.', 1, NULL, 'a:5:{s:17:"event_repeat_freq";s:1:"1";s:22:"event_repeat_freq_type";s:1:"4";s:19:"event_repeat_on_num";s:1:"1";s:19:"event_repeat_on_day";s:1:"0";s:20:"event_repeat_on_freq";s:1:"0";}', 0, 0, 1, 3, 2, 0, 0);
2110 INSERT INTO `openemr_postcalendar_categories` VALUES (3, 'Out Of Office', '#99FFFF', 'Reserved to define when a provider may not have available appointments after.', 1, NULL, 'a:5:{s:17:"event_repeat_freq";s:1:"1";s:22:"event_repeat_freq_type";s:1:"4";s:19:"event_repeat_on_num";s:1:"1";s:19:"event_repeat_on_day";s:1:"0";s:20:"event_repeat_on_freq";s:1:"0";}', 0, 0, 1, 3, 2, 0, 0);
2111 INSERT INTO `openemr_postcalendar_categories` VALUES (8, 'Lunch', '#FFFF33', 'Lunch', 1, NULL, 'a:5:{s:17:"event_repeat_freq";s:1:"1";s:22:"event_repeat_freq_type";s:1:"4";s:19:"event_repeat_on_num";s:1:"1";s:19:"event_repeat_on_day";s:1:"0";s:20:"event_repeat_on_freq";s:1:"0";}', 0, 3600, 0, 3, 2, 0, 0);
2112 INSERT INTO `openemr_postcalendar_categories` VALUES (9, 'Established Patient', '#CCFF33', '', 0, NULL, 'a:5:{s:17:"event_repeat_freq";s:1:"0";s:22:"event_repeat_freq_type";s:1:"0";s:19:"event_repeat_on_num";s:1:"1";s:19:"event_repeat_on_day";s:1:"0";s:20:"event_repeat_on_freq";s:1:"0";}', 0, 900, 0, 0, 0, 0, 0);
2113 INSERT INTO `openemr_postcalendar_categories` VALUES (10,'New Patient', '#CCFFFF', '', 0, NULL, 'a:5:{s:17:"event_repeat_freq";s:1:"0";s:22:"event_repeat_freq_type";s:1:"0";s:19:"event_repeat_on_num";s:1:"1";s:19:"event_repeat_on_day";s:1:"0";s:20:"event_repeat_on_freq";s:1:"0";}', 0, 1800, 0, 0, 0, 0, 0);
2114 INSERT INTO `openemr_postcalendar_categories` VALUES (11,'Reserved','#FF7777','Reserved',1,NULL,'a:5:{s:17:\"event_repeat_freq\";s:1:\"1\";s:22:\"event_repeat_freq_type\";s:1:\"4\";s:19:\"event_repeat_on_num\";s:1:\"1\";s:19:\"event_repeat_on_day\";s:1:\"0\";s:20:\"event_repeat_on_freq\";s:1:\"0\";}',0,900,0,3,2,0,0);
2116 -- --------------------------------------------------------
2118 -- 
2119 -- Table structure for table `openemr_postcalendar_events`
2120 -- 
2122 DROP TABLE IF EXISTS `openemr_postcalendar_events`;
2123 CREATE TABLE `openemr_postcalendar_events` (
2124   `pc_eid` int(11) unsigned NOT NULL auto_increment,
2125   `pc_catid` int(11) NOT NULL default '0',
2126   `pc_multiple` int(10) unsigned NOT NULL,
2127   `pc_aid` varchar(30) default NULL,
2128   `pc_pid` varchar(11) default NULL,
2129   `pc_title` varchar(150) default NULL,
2130   `pc_time` datetime default NULL,
2131   `pc_hometext` text,
2132   `pc_comments` int(11) default '0',
2133   `pc_counter` mediumint(8) unsigned default '0',
2134   `pc_topic` int(3) NOT NULL default '1',
2135   `pc_informant` varchar(20) default NULL,
2136   `pc_eventDate` date NOT NULL default '0000-00-00',
2137   `pc_endDate` date NOT NULL default '0000-00-00',
2138   `pc_duration` bigint(20) NOT NULL default '0',
2139   `pc_recurrtype` int(1) NOT NULL default '0',
2140   `pc_recurrspec` text,
2141   `pc_recurrfreq` int(3) NOT NULL default '0',
2142   `pc_startTime` time default NULL,
2143   `pc_endTime` time default NULL,
2144   `pc_alldayevent` int(1) NOT NULL default '0',
2145   `pc_location` text,
2146   `pc_conttel` varchar(50) default NULL,
2147   `pc_contname` varchar(50) default NULL,
2148   `pc_contemail` varchar(255) default NULL,
2149   `pc_website` varchar(255) default NULL,
2150   `pc_fee` varchar(50) default NULL,
2151   `pc_eventstatus` int(11) NOT NULL default '0',
2152   `pc_sharing` int(11) NOT NULL default '0',
2153   `pc_language` varchar(30) default NULL,
2154   `pc_apptstatus` char(1) NOT NULL default '-',
2155   `pc_prefcatid` int(11) NOT NULL default '0',
2156   `pc_facility` smallint(6) NOT NULL default '0' COMMENT 'facility id for this event',
2157   `pc_sendalertsms` VARCHAR(3) NOT NULL DEFAULT 'NO',
2158   `pc_sendalertemail` VARCHAR( 3 ) NOT NULL DEFAULT 'NO',
2159   PRIMARY KEY  (`pc_eid`),
2160   KEY `basic_event` (`pc_catid`,`pc_aid`,`pc_eventDate`,`pc_endDate`,`pc_eventstatus`,`pc_sharing`,`pc_topic`)
2161 ) ENGINE=MyISAM AUTO_INCREMENT=7 ;
2163 -- 
2164 -- Dumping data for table `openemr_postcalendar_events`
2165 -- 
2167 INSERT INTO `openemr_postcalendar_events` VALUES (3, 2, 0, '1', '', 'In Office', '2005-03-03 12:22:31', ':text:', 0, 0, 0, '1', '2005-03-03', '2007-03-03', 0, 1, 'a:5:{s:17:"event_repeat_freq";s:1:"1";s:22:"event_repeat_freq_type";s:1:"4";s:19:"event_repeat_on_num";s:1:"1";s:19:"event_repeat_on_day";s:1:"0";s:20:"event_repeat_on_freq";s:1:"0";}', 0, '09:00:00', '09:00:00', 0, 'a:6:{s:14:"event_location";N;s:13:"event_street1";N;s:13:"event_street2";N;s:10:"event_city";N;s:11:"event_state";N;s:12:"event_postal";N;}', '', '', '', '', '', 1, 1, '', '-', 0, 0, 'NO', 'NO');
2168 INSERT INTO `openemr_postcalendar_events` VALUES (5, 3, 0, '1', '', 'Out Of Office', '2005-03-03 12:22:52', ':text:', 0, 0, 0, '1', '2005-03-03', '2007-03-03', 0, 1, 'a:5:{s:17:"event_repeat_freq";s:1:"1";s:22:"event_repeat_freq_type";s:1:"4";s:19:"event_repeat_on_num";s:1:"1";s:19:"event_repeat_on_day";s:1:"0";s:20:"event_repeat_on_freq";s:1:"0";}', 0, '17:00:00', '17:00:00', 0, 'a:6:{s:14:"event_location";N;s:13:"event_street1";N;s:13:"event_street2";N;s:10:"event_city";N;s:11:"event_state";N;s:12:"event_postal";N;}', '', '', '', '', '', 1, 1, '', '-', 0, 0, 'NO', 'NO');
2169 INSERT INTO `openemr_postcalendar_events` VALUES (6, 8, 0, '1', '', 'Lunch', '2005-03-03 12:23:31', ':text:', 0, 0, 0, '1', '2005-03-03', '2007-03-03', 3600, 1, 'a:5:{s:17:"event_repeat_freq";s:1:"1";s:22:"event_repeat_freq_type";s:1:"4";s:19:"event_repeat_on_num";s:1:"1";s:19:"event_repeat_on_day";s:1:"0";s:20:"event_repeat_on_freq";s:1:"0";}', 0, '12:00:00', '13:00:00', 0, 'a:6:{s:14:"event_location";N;s:13:"event_street1";N;s:13:"event_street2";N;s:10:"event_city";N;s:11:"event_state";N;s:12:"event_postal";N;}', '', '', '', '', '', 1, 1, '', '-', 0, 0, 'NO', 'NO');
2171 -- --------------------------------------------------------
2173 -- 
2174 -- Table structure for table `openemr_postcalendar_limits`
2175 -- 
2177 DROP TABLE IF EXISTS `openemr_postcalendar_limits`;
2178 CREATE TABLE `openemr_postcalendar_limits` (
2179   `pc_limitid` int(11) NOT NULL auto_increment,
2180   `pc_catid` int(11) NOT NULL default '0',
2181   `pc_starttime` time NOT NULL default '00:00:00',
2182   `pc_endtime` time NOT NULL default '00:00:00',
2183   `pc_limit` int(11) NOT NULL default '1',
2184   PRIMARY KEY  (`pc_limitid`)
2185 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2187 -- --------------------------------------------------------
2189 -- 
2190 -- Table structure for table `openemr_postcalendar_topics`
2191 -- 
2193 DROP TABLE IF EXISTS `openemr_postcalendar_topics`;
2194 CREATE TABLE `openemr_postcalendar_topics` (
2195   `pc_catid` int(11) unsigned NOT NULL auto_increment,
2196   `pc_catname` varchar(100) default NULL,
2197   `pc_catcolor` varchar(50) default NULL,
2198   `pc_catdesc` text,
2199   PRIMARY KEY  (`pc_catid`),
2200   KEY `basic_cat` (`pc_catname`,`pc_catcolor`)
2201 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2203 -- --------------------------------------------------------
2205 -- 
2206 -- Table structure for table `openemr_session_info`
2207 -- 
2209 DROP TABLE IF EXISTS `openemr_session_info`;
2210 CREATE TABLE `openemr_session_info` (
2211   `pn_sessid` varchar(32) NOT NULL default '',
2212   `pn_ipaddr` varchar(20) default NULL,
2213   `pn_firstused` int(11) NOT NULL default '0',
2214   `pn_lastused` int(11) NOT NULL default '0',
2215   `pn_uid` int(11) NOT NULL default '0',
2216   `pn_vars` blob,
2217   PRIMARY KEY  (`pn_sessid`)
2218 ) ENGINE=MyISAM;
2220 -- 
2221 -- Dumping data for table `openemr_session_info`
2222 -- 
2224 INSERT INTO `openemr_session_info` VALUES ('978d31441dccd350d406bfab98978f20', '127.0.0.1', 1109233952, 1109234177, 0, NULL);
2226 -- --------------------------------------------------------
2228 -- 
2229 -- Table structure for table `patient_data`
2230 -- 
2232 DROP TABLE IF EXISTS `patient_data`;
2233 CREATE TABLE `patient_data` (
2234   `id` bigint(20) NOT NULL auto_increment,
2235   `title` varchar(255) NOT NULL default '',
2236   `language` varchar(255) NOT NULL default '',
2237   `financial` varchar(255) NOT NULL default '',
2238   `fname` varchar(255) NOT NULL default '',
2239   `lname` varchar(255) NOT NULL default '',
2240   `mname` varchar(255) NOT NULL default '',
2241   `DOB` date default NULL,
2242   `street` varchar(255) NOT NULL default '',
2243   `postal_code` varchar(255) NOT NULL default '',
2244   `city` varchar(255) NOT NULL default '',
2245   `state` varchar(255) NOT NULL default '',
2246   `country_code` varchar(255) NOT NULL default '',
2247   `drivers_license` varchar(255) NOT NULL default '',
2248   `ss` varchar(255) NOT NULL default '',
2249   `occupation` longtext,
2250   `phone_home` varchar(255) NOT NULL default '',
2251   `phone_biz` varchar(255) NOT NULL default '',
2252   `phone_contact` varchar(255) NOT NULL default '',
2253   `phone_cell` varchar(255) NOT NULL default '',
2254   `pharmacy_id` int(11) NOT NULL default '0',
2255   `status` varchar(255) NOT NULL default '',
2256   `contact_relationship` varchar(255) NOT NULL default '',
2257   `date` datetime default NULL,
2258   `sex` varchar(255) NOT NULL default '',
2259   `referrer` varchar(255) NOT NULL default '',
2260   `referrerID` varchar(255) NOT NULL default '',
2261   `providerID` int(11) default NULL,
2262   `email` varchar(255) NOT NULL default '',
2263   `ethnoracial` varchar(255) NOT NULL default '',
2264   `interpretter` varchar(255) NOT NULL default '',
2265   `migrantseasonal` varchar(255) NOT NULL default '',
2266   `family_size` varchar(255) NOT NULL default '',
2267   `monthly_income` varchar(255) NOT NULL default '',
2268   `homeless` varchar(255) NOT NULL default '',
2269   `financial_review` datetime default NULL,
2270   `pubpid` varchar(255) NOT NULL default '',
2271   `pid` bigint(20) NOT NULL default '0',
2272   `genericname1` varchar(255) NOT NULL default '',
2273   `genericval1` varchar(255) NOT NULL default '',
2274   `genericname2` varchar(255) NOT NULL default '',
2275   `genericval2` varchar(255) NOT NULL default '',
2276   `hipaa_mail` varchar(3) NOT NULL default '',
2277   `hipaa_voice` varchar(3) NOT NULL default '',
2278   `hipaa_notice` varchar(3) NOT NULL default '',
2279   `hipaa_message` varchar(20) NOT NULL default '',
2280   `hipaa_allowsms` VARCHAR( 3 ) NOT NULL DEFAULT 'NO',
2281   `hipaa_allowemail` VARCHAR( 3 ) NOT NULL DEFAULT 'NO',
2282   `squad` varchar(32) NOT NULL default '',
2283   `fitness` int(11) NOT NULL default '0',
2284   `referral_source` varchar(30) NOT NULL default '',
2285   `usertext1` varchar(255) NOT NULL DEFAULT '',
2286   `usertext2` varchar(255) NOT NULL DEFAULT '',
2287   `usertext3` varchar(255) NOT NULL DEFAULT '',
2288   `usertext4` varchar(255) NOT NULL DEFAULT '',
2289   `usertext5` varchar(255) NOT NULL DEFAULT '',
2290   `usertext6` varchar(255) NOT NULL DEFAULT '',
2291   `usertext7` varchar(255) NOT NULL DEFAULT '',
2292   `usertext8` varchar(255) NOT NULL DEFAULT '',
2293   `userlist1` varchar(255) NOT NULL DEFAULT '',
2294   `userlist2` varchar(255) NOT NULL DEFAULT '',
2295   `userlist3` varchar(255) NOT NULL DEFAULT '',
2296   `userlist4` varchar(255) NOT NULL DEFAULT '',
2297   `userlist5` varchar(255) NOT NULL DEFAULT '',
2298   `userlist6` varchar(255) NOT NULL DEFAULT '',
2299   `userlist7` varchar(255) NOT NULL DEFAULT '',
2300   `pricelevel` varchar(255) NOT NULL default 'standard',
2301   `regdate`     date DEFAULT NULL COMMENT 'Registration Date',
2302   `contrastart` date DEFAULT NULL COMMENT 'Date contraceptives initially used',
2303   UNIQUE KEY `pid` (`pid`),
2304   KEY `id` (`id`)
2305 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2307 -- --------------------------------------------------------
2309 -- 
2310 -- Table structure for table `payments`
2311 -- 
2313 DROP TABLE IF EXISTS `payments`;
2314 CREATE TABLE `payments` (
2315   `id` bigint(20) NOT NULL auto_increment,
2316   `pid` bigint(20) NOT NULL default '0',
2317   `dtime` datetime NOT NULL,
2318   `encounter` bigint(20) NOT NULL default '0',
2319   `user` varchar(255) default NULL,
2320   `method` varchar(255) default NULL,
2321   `source` varchar(255) default NULL,
2322   `amount1` decimal(12,2) NOT NULL default '0.00',
2323   `amount2` decimal(12,2) NOT NULL default '0.00',
2324   `posted1` decimal(12,2) NOT NULL default '0.00',
2325   `posted2` decimal(12,2) NOT NULL default '0.00',
2326   PRIMARY KEY  (`id`),
2327   KEY `pid` (`pid`)
2328 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2330 -- --------------------------------------------------------
2332 -- 
2333 -- Table structure for table `pharmacies`
2334 -- 
2336 DROP TABLE IF EXISTS `pharmacies`;
2337 CREATE TABLE `pharmacies` (
2338   `id` int(11) NOT NULL default '0',
2339   `name` varchar(255) default NULL,
2340   `transmit_method` int(11) NOT NULL default '1',
2341   `email` varchar(255) default NULL,
2342   PRIMARY KEY  (`id`)
2343 ) ENGINE=MyISAM;
2345 -- --------------------------------------------------------
2347 -- 
2348 -- Table structure for table `phone_numbers`
2349 -- 
2351 DROP TABLE IF EXISTS `phone_numbers`;
2352 CREATE TABLE `phone_numbers` (
2353   `id` int(11) NOT NULL default '0',
2354   `country_code` varchar(5) default NULL,
2355   `area_code` char(3) default NULL,
2356   `prefix` char(3) default NULL,
2357   `number` varchar(4) default NULL,
2358   `type` int(11) default NULL,
2359   `foreign_id` int(11) default NULL,
2360   PRIMARY KEY  (`id`),
2361   KEY `foreign_id` (`foreign_id`)
2362 ) ENGINE=MyISAM;
2364 -- --------------------------------------------------------
2366 -- 
2367 -- Table structure for table `pma_bookmark`
2368 -- 
2370 DROP TABLE IF EXISTS `pma_bookmark`;
2371 CREATE TABLE `pma_bookmark` (
2372   `id` int(11) NOT NULL auto_increment,
2373   `dbase` varchar(255) default NULL,
2374   `user` varchar(255) default NULL,
2375   `label` varchar(255) default NULL,
2376   `query` text,
2377   PRIMARY KEY  (`id`)
2378 ) ENGINE=MyISAM COMMENT='Bookmarks' AUTO_INCREMENT=10 ;
2380 -- 
2381 -- Dumping data for table `pma_bookmark`
2382 -- 
2384 INSERT INTO `pma_bookmark` VALUES (2, 'openemr', 'openemr', 'Aggregate Race Statistics', 'SELECT ethnoracial as "Race/Ethnicity", count(*) as Count FROM  `patient_data` WHERE 1 group by ethnoracial');
2385 INSERT INTO `pma_bookmark` VALUES (9, 'openemr', 'openemr', 'Search by Code', 'SELECT  b.code, concat(pd.fname," ", pd.lname) as "Patient Name", concat(u.fname," ", u.lname) as "Provider Name", en.reason as "Encounter Desc.", en.date\r\nFROM billing as b\r\nLEFT JOIN users AS u ON b.user = u.id\r\nLEFT JOIN patient_data as pd on b.pid = pd.pid\r\nLEFT JOIN form_encounter as en on b.encounter = en.encounter and b.pid = en.pid\r\nWHERE 1 /* and b.code like ''%[VARIABLE]%'' */ ORDER BY b.code');
2386 INSERT INTO `pma_bookmark` VALUES (8, 'openemr', 'openemr', 'Count No Shows By Provider since Interval ago', 'SELECT concat( u.fname,  " ", u.lname )  AS  "Provider Name", u.id AS  "Provider ID", count(  DISTINCT ev.pc_eid )  AS  "Number of No Shows"/* , concat(DATE_FORMAT(NOW(),''%Y-%m-%d''), '' and '',DATE_FORMAT(DATE_ADD(now(), INTERVAL [VARIABLE]),''%Y-%m-%d'') ) as "Between Dates" */ FROM  `openemr_postcalendar_events`  AS ev LEFT  JOIN users AS u ON ev.pc_aid = u.id WHERE ev.pc_catid =1/* and ( ev.pc_eventDate >= DATE_SUB(now(), INTERVAL [VARIABLE]) )  */\r\nGROUP  BY u.id;');
2387 INSERT INTO `pma_bookmark` VALUES (6, 'openemr', 'openemr', 'Appointments By Race/Ethnicity from today plus interval', 'SELECT  count(pd.ethnoracial) as "Number of Appointments", pd.ethnoracial AS  "Race/Ethnicity" /* , concat(DATE_FORMAT(NOW(),''%Y-%m-%d''), '' and '',DATE_FORMAT(DATE_ADD(now(), INTERVAL [VARIABLE]),''%Y-%m-%d'') ) as "Between Dates" */ FROM openemr_postcalendar_events AS ev LEFT  JOIN   `patient_data`  AS pd ON  pd.pid = ev.pc_pid where ev.pc_eventstatus=1 and ev.pc_catid = 5 and ev.pc_eventDate >= now()  /* and ( ev.pc_eventDate <= DATE_ADD(now(), INTERVAL [VARIABLE]) )  */ group by pd.ethnoracial');
2389 -- --------------------------------------------------------
2391 -- 
2392 -- Table structure for table `pma_column_info`
2393 -- 
2395 DROP TABLE IF EXISTS `pma_column_info`;
2396 CREATE TABLE `pma_column_info` (
2397   `id` int(5) unsigned NOT NULL auto_increment,
2398   `db_name` varchar(64) default NULL,
2399   `table_name` varchar(64) default NULL,
2400   `column_name` varchar(64) default NULL,
2401   `comment` varchar(255) default NULL,
2402   `mimetype` varchar(255) default NULL,
2403   `transformation` varchar(255) default NULL,
2404   `transformation_options` varchar(255) default NULL,
2405   PRIMARY KEY  (`id`),
2406   UNIQUE KEY `db_name` (`db_name`,`table_name`,`column_name`)
2407 ) ENGINE=MyISAM COMMENT='Column Information for phpMyAdmin' AUTO_INCREMENT=1 ;
2409 -- --------------------------------------------------------
2411 -- 
2412 -- Table structure for table `pma_history`
2413 -- 
2415 DROP TABLE IF EXISTS `pma_history`;
2416 CREATE TABLE `pma_history` (
2417   `id` bigint(20) unsigned NOT NULL auto_increment,
2418   `username` varchar(64) default NULL,
2419   `db` varchar(64) default NULL,
2420   `table` varchar(64) default NULL,
2421   `timevalue` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
2422   `sqlquery` text,
2423   PRIMARY KEY  (`id`),
2424   KEY `username` (`username`,`db`,`table`,`timevalue`)
2425 ) ENGINE=MyISAM COMMENT='SQL history' AUTO_INCREMENT=1 ;
2427 -- --------------------------------------------------------
2429 -- 
2430 -- Table structure for table `pma_pdf_pages`
2431 -- 
2433 DROP TABLE IF EXISTS `pma_pdf_pages`;
2434 CREATE TABLE `pma_pdf_pages` (
2435   `db_name` varchar(64) default NULL,
2436   `page_nr` int(10) unsigned NOT NULL auto_increment,
2437   `page_descr` varchar(50) default NULL,
2438   PRIMARY KEY  (`page_nr`),
2439   KEY `db_name` (`db_name`)
2440 ) ENGINE=MyISAM COMMENT='PDF Relationpages for PMA' AUTO_INCREMENT=1 ;
2442 -- --------------------------------------------------------
2444 -- 
2445 -- Table structure for table `pma_relation`
2446 -- 
2448 DROP TABLE IF EXISTS `pma_relation`;
2449 CREATE TABLE `pma_relation` (
2450   `master_db` varchar(64) NOT NULL default '',
2451   `master_table` varchar(64) NOT NULL default '',
2452   `master_field` varchar(64) NOT NULL default '',
2453   `foreign_db` varchar(64) default NULL,
2454   `foreign_table` varchar(64) default NULL,
2455   `foreign_field` varchar(64) default NULL,
2456   PRIMARY KEY  (`master_db`,`master_table`,`master_field`),
2457   KEY `foreign_field` (`foreign_db`,`foreign_table`)
2458 ) ENGINE=MyISAM COMMENT='Relation table';
2460 -- --------------------------------------------------------
2462 -- 
2463 -- Table structure for table `pma_table_coords`
2464 -- 
2466 DROP TABLE IF EXISTS `pma_table_coords`;
2467 CREATE TABLE `pma_table_coords` (
2468   `db_name` varchar(64) NOT NULL default '',
2469   `table_name` varchar(64) NOT NULL default '',
2470   `pdf_page_number` int(11) NOT NULL default '0',
2471   `x` float unsigned NOT NULL default '0',
2472   `y` float unsigned NOT NULL default '0',
2473   PRIMARY KEY  (`db_name`,`table_name`,`pdf_page_number`)
2474 ) ENGINE=MyISAM COMMENT='Table coordinates for phpMyAdmin PDF output';
2476 -- --------------------------------------------------------
2478 -- 
2479 -- Table structure for table `pma_table_info`
2480 -- 
2482 DROP TABLE IF EXISTS `pma_table_info`;
2483 CREATE TABLE `pma_table_info` (
2484   `db_name` varchar(64) NOT NULL default '',
2485   `table_name` varchar(64) NOT NULL default '',
2486   `display_field` varchar(64) default NULL,
2487   PRIMARY KEY  (`db_name`,`table_name`)
2488 ) ENGINE=MyISAM COMMENT='Table information for phpMyAdmin';
2490 -- --------------------------------------------------------
2492 -- 
2493 -- Table structure for table `pnotes`
2494 -- 
2496 DROP TABLE IF EXISTS `pnotes`;
2497 CREATE TABLE `pnotes` (
2498   `id` bigint(20) NOT NULL auto_increment,
2499   `date` datetime default NULL,
2500   `body` longtext,
2501   `pid` bigint(20) default NULL,
2502   `user` varchar(255) default NULL,
2503   `groupname` varchar(255) default NULL,
2504   `activity` tinyint(4) default NULL,
2505   `authorized` tinyint(4) default NULL,
2506   `title` varchar(255) default NULL,
2507   `assigned_to` varchar(255) default NULL,
2508   `deleted` tinyint(4) default 0 COMMENT 'flag indicates note is deleted',
2509   PRIMARY KEY  (`id`)
2510 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2512 -- --------------------------------------------------------
2514 -- 
2515 -- Table structure for table `prescriptions`
2516 -- 
2518 DROP TABLE IF EXISTS `prescriptions`;
2519 CREATE TABLE `prescriptions` (
2520   `id` int(11) NOT NULL auto_increment,
2521   `patient_id` int(11) default NULL,
2522   `filled_by_id` int(11) default NULL,
2523   `pharmacy_id` int(11) default NULL,
2524   `date_added` date default NULL,
2525   `date_modified` date default NULL,
2526   `provider_id` int(11) default NULL,
2527   `start_date` date default NULL,
2528   `drug` varchar(150) default NULL,
2529   `drug_id` int(11) NOT NULL default '0',
2530   `form` int(3) default NULL,
2531   `dosage` varchar(100) default NULL,
2532   `quantity` varchar(31) default NULL,
2533   `size` float unsigned default NULL,
2534   `unit` int(11) default NULL,
2535   `route` int(11) default NULL,
2536   `interval` int(11) default NULL,
2537   `substitute` int(11) default NULL,
2538   `refills` int(11) default NULL,
2539   `per_refill` int(11) default NULL,
2540   `filled_date` date default NULL,
2541   `medication` int(11) default NULL,
2542   `note` text,
2543   `active` int(11) NOT NULL default '1',
2544   PRIMARY KEY  (`id`)
2545 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2547 -- --------------------------------------------------------
2549 -- 
2550 -- Table structure for table `prices`
2551 -- 
2553 DROP TABLE IF EXISTS `prices`;
2554 CREATE TABLE `prices` (
2555   `pr_id` varchar(11) NOT NULL default '',
2556   `pr_selector` varchar(15) NOT NULL default '',
2557   `pr_level` varchar(31) NOT NULL default '',
2558   `pr_price` decimal(12,2) NOT NULL default '0.00' COMMENT 'price in local currency',
2559   PRIMARY KEY  (`pr_id`,`pr_selector`,`pr_level`)
2560 ) ENGINE=MyISAM;
2562 -- --------------------------------------------------------
2564 -- 
2565 -- Table structure for table `registry`
2566 -- 
2568 DROP TABLE IF EXISTS `registry`;
2569 CREATE TABLE `registry` (
2570   `name` varchar(255) default NULL,
2571   `state` tinyint(4) default NULL,
2572   `directory` varchar(255) default NULL,
2573   `id` bigint(20) NOT NULL auto_increment,
2574   `sql_run` tinyint(4) default NULL,
2575   `unpackaged` tinyint(4) default NULL,
2576   `date` datetime default NULL,
2577   `priority` int(11) default '0',
2578   `category` varchar(255) default NULL,
2579   `nickname` varchar(255) default NULL,
2580   PRIMARY KEY  (`id`)
2581 ) ENGINE=MyISAM AUTO_INCREMENT=16 ;
2583 -- 
2584 -- Dumping data for table `registry`
2585 -- 
2587 INSERT INTO `registry` VALUES ('New Encounter Form', 1, 'newpatient', 1, 1, 1, '2003-09-14 15:16:45', 0, 'category', '');
2588 INSERT INTO `registry` VALUES ('Review of Systems Checks', 1, 'reviewofs', 9, 1, 1, '2003-09-14 15:16:45', 0, 'category', '');
2589 INSERT INTO `registry` VALUES ('Speech Dictation', 1, 'dictation', 10, 1, 1, '2003-09-14 15:16:45', 0, 'category', '');
2590 INSERT INTO `registry` VALUES ('SOAP', 1, 'soap', 11, 1, 1, '2005-03-03 00:16:35', 0, 'category', '');
2591 INSERT INTO `registry` VALUES ('Vitals', 1, 'vitals', 12, 1, 1, '2005-03-03 00:16:34', 0, 'category', '');
2592 INSERT INTO `registry` VALUES ('Review Of Systems', 1, 'ros', 13, 1, 1, '2005-03-03 00:16:30', 0, 'category', '');
2593 INSERT INTO `registry` VALUES ('Fee Sheet', 1, 'fee_sheet', 14, 1, 1, '2007-07-28 00:00:00', 0, 'category', '');
2594 INSERT INTO `registry` VALUES ('Misc Billing Options HCFA', 1, 'misc_billing_options', 15, 1, 1, '2007-07-28 00:00:00', 0, 'category', '');
2596 -- --------------------------------------------------------
2598 -- 
2599 -- Table structure for table `sequences`
2600 -- 
2602 DROP TABLE IF EXISTS `sequences`;
2603 CREATE TABLE `sequences` (
2604   `id` int(11) unsigned NOT NULL default '0'
2605 ) ENGINE=MyISAM;
2607 -- 
2608 -- Dumping data for table `sequences`
2609 -- 
2611 INSERT INTO `sequences` VALUES (1);
2613 -- --------------------------------------------------------
2615 -- 
2616 -- Table structure for table `transactions`
2617 -- 
2619 DROP TABLE IF EXISTS `transactions`;
2620 CREATE TABLE `transactions` (
2621   `id`                      bigint(20)   NOT NULL auto_increment,
2622   `date`                    datetime     default NULL,
2623   `title`                   varchar(255) NOT NULL DEFAULT '',
2624   `body`                    longtext     NOT NULL DEFAULT '',
2625   `pid`                     bigint(20)   default NULL,
2626   `user`                    varchar(255) NOT NULL DEFAULT '',
2627   `groupname`               varchar(255) NOT NULL DEFAULT '',
2628   `authorized`              tinyint(4)   default NULL,
2629   `refer_date`              date         DEFAULT NULL,
2630   `refer_from`              int(11)      NOT NULL DEFAULT 0,
2631   `refer_to`                int(11)      NOT NULL DEFAULT 0,
2632   `refer_diag`              varchar(255) NOT NULL DEFAULT '',
2633   `refer_risk_level`        varchar(255) NOT NULL DEFAULT '',
2634   `refer_vitals`            tinyint(1)   NOT NULL DEFAULT 0,
2635   `refer_external`          tinyint(1)   NOT NULL DEFAULT 0,
2636   `refer_related_code`      varchar(255) NOT NULL DEFAULT '',
2637   `reply_date`              date         DEFAULT NULL,
2638   `reply_from`              varchar(255) NOT NULL DEFAULT '',
2639   `reply_init_diag`         varchar(255) NOT NULL DEFAULT '',
2640   `reply_final_diag`        varchar(255) NOT NULL DEFAULT '',
2641   `reply_documents`         varchar(255) NOT NULL DEFAULT '',
2642   `reply_findings`          text         NOT NULL DEFAULT '',
2643   `reply_services`          text         NOT NULL DEFAULT '',
2644   `reply_recommend`         text         NOT NULL DEFAULT '',
2645   `reply_rx_refer`          text         NOT NULL DEFAULT '',
2646   PRIMARY KEY  (`id`)
2647 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2649 -- --------------------------------------------------------
2651 -- 
2652 -- Table structure for table `users`
2653 -- 
2655 DROP TABLE IF EXISTS `users`;
2656 CREATE TABLE `users` (
2657   `id` bigint(20) NOT NULL auto_increment,
2658   `username` varchar(255) default NULL,
2659   `password` longtext,
2660   `authorized` tinyint(4) default NULL,
2661   `info` longtext,
2662   `source` tinyint(4) default NULL,
2663   `fname` varchar(255) default NULL,
2664   `mname` varchar(255) default NULL,
2665   `lname` varchar(255) default NULL,
2666   `federaltaxid` varchar(255) default NULL,
2667   `federaldrugid` varchar(255) default NULL,
2668   `upin` varchar(255) default NULL,
2669   `facility` varchar(255) default NULL,
2670   `facility_id` int(11) NOT NULL default '0',
2671   `see_auth` int(11) NOT NULL default '1',
2672   `active` tinyint(1) NOT NULL default '1',
2673   `npi` varchar(15) default NULL,
2674   `title` varchar(30) default NULL,
2675   `specialty` varchar(255) default NULL,
2676   `billname` varchar(255) default NULL,
2677   `email` varchar(255) default NULL,
2678   `url` varchar(255) default NULL,
2679   `assistant` varchar(255) default NULL,
2680   `organization` varchar(255) default NULL,
2681   `valedictory` varchar(255) default NULL,
2682   `street` varchar(60) default NULL,
2683   `streetb` varchar(60) default NULL,
2684   `city` varchar(30) default NULL,
2685   `state` varchar(30) default NULL,
2686   `zip` varchar(20) default NULL,
2687   `street2` varchar(60) default NULL,
2688   `streetb2` varchar(60) default NULL,
2689   `city2` varchar(30) default NULL,
2690   `state2` varchar(30) default NULL,
2691   `zip2` varchar(20) default NULL,
2692   `phone` varchar(30) default NULL,
2693   `fax` varchar(30) default NULL,
2694   `phonew1` varchar(30) default NULL,
2695   `phonew2` varchar(30) default NULL,
2696   `phonecell` varchar(30) default NULL,
2697   `notes` text,
2698   `cal_ui` tinyint(4) NOT NULL default '1',
2699   `taxonomy` varchar(30) NOT NULL DEFAULT '207Q00000X',
2700   PRIMARY KEY  (`id`)
2701 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2703 -- --------------------------------------------------------
2705 -- 
2706 -- Table structure for table `x12_partners`
2707 -- 
2709 DROP TABLE IF EXISTS `x12_partners`;
2710 CREATE TABLE `x12_partners` (
2711   `id` int(11) NOT NULL default '0',
2712   `name` varchar(255) default NULL,
2713   `id_number` varchar(255) default NULL,
2714   `x12_sender_id` varchar(255) default NULL,
2715   `x12_receiver_id` varchar(255) default NULL,
2716   `x12_version` varchar(255) default NULL,
2717   `processing_format` enum('standard','medi-cal','cms','proxymed') default NULL,
2718   PRIMARY KEY  (`id`)
2719 ) ENGINE=MyISAM;
2721 ------------------------------------------------------------------------------------- 
2722 -- Table structure for table `automatic_notification`
2723 -- 
2725 DROP TABLE IF EXISTS `automatic_notification`;
2726 CREATE TABLE `automatic_notification` (
2727   `notification_id` int(5) NOT NULL auto_increment,
2728   `sms_gateway_type` varchar(255) NOT NULL,
2729   `next_app_date` date NOT NULL,
2730   `next_app_time` varchar(10) NOT NULL,
2731   `provider_name` varchar(100) NOT NULL,
2732   `message` text NOT NULL,
2733   `email_sender` varchar(100) NOT NULL,
2734   `email_subject` varchar(100) NOT NULL,
2735   `type` enum('SMS','Email') NOT NULL default 'SMS',
2736   `notification_sent_date` datetime NOT NULL,
2737   PRIMARY KEY  (`notification_id`)
2738 ) ENGINE=InnoDB AUTO_INCREMENT=3 ;
2740 -- 
2741 -- Dumping data for table `automatic_notification`
2742 -- 
2744 INSERT INTO `automatic_notification` (`notification_id`, `sms_gateway_type`, `next_app_date`, `next_app_time`, `provider_name`, `message`, `email_sender`, `email_subject`, `type`, `notification_sent_date`) VALUES (1, 'CLICKATELL', '0000-00-00', ':', 'EMR GROUP 1 .. SMS', 'Welcome to EMR GROUP 1.. SMS', '', '', 'SMS', '0000-00-00 00:00:00'),
2745 (2, '', '2007-10-02', '05:50', 'EMR GROUP', 'Welcome to EMR GROUP . Email', 'EMR Group', 'Welcome to EMR GROUP', 'Email', '2007-09-30 00:00:00');
2747 -- --------------------------------------------------------
2749 -- 
2750 -- Table structure for table `notification_log`
2751 -- 
2753 DROP TABLE IF EXISTS `notification_log`;
2754 CREATE TABLE `notification_log` (
2755   `iLogId` int(11) NOT NULL auto_increment,
2756   `pid` int(7) NOT NULL,
2757   `pc_eid` int(11) unsigned NULL,
2758   `sms_gateway_type` varchar(50) NOT NULL,
2759   `smsgateway_info` varchar(255) NOT NULL,
2760   `message` text NOT NULL,
2761   `email_sender` varchar(255) NOT NULL,
2762   `email_subject` varchar(255) NOT NULL,
2763   `type` enum('SMS','Email') NOT NULL,
2764   `patient_info` text NOT NULL,
2765   `pc_eventDate` date NOT NULL,
2766   `pc_endDate` date NOT NULL,
2767   `pc_startTime` time NOT NULL,
2768   `pc_endTime` time NOT NULL,
2769   `dSentDateTime` datetime NOT NULL,
2770   PRIMARY KEY  (`iLogId`)
2771 ) ENGINE=InnoDB AUTO_INCREMENT=5 ;
2773 -- --------------------------------------------------------
2775 -- 
2776 -- Table structure for table `notification_settings`
2777 -- 
2779 DROP TABLE IF EXISTS `notification_settings`;
2780 CREATE TABLE `notification_settings` (
2781   `SettingsId` int(3) NOT NULL auto_increment,
2782   `Send_SMS_Before_Hours` int(3) NOT NULL,
2783   `Send_Email_Before_Hours` int(3) NOT NULL,
2784   `SMS_gateway_username` varchar(100) NOT NULL,
2785   `SMS_gateway_password` varchar(100) NOT NULL,
2786   `SMS_gateway_apikey` varchar(100) NOT NULL,
2787   `type` varchar(50) NOT NULL,
2788   PRIMARY KEY  (`SettingsId`)
2789 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
2791 -- 
2792 -- Dumping data for table `notification_settings`
2793 -- 
2795 INSERT INTO `notification_settings` (`SettingsId`, `Send_SMS_Before_Hours`, `Send_Email_Before_Hours`, `SMS_gateway_username`, `SMS_gateway_password`, `SMS_gateway_apikey`, `type`) VALUES (1, 150, 150, 'sms username', 'sms password', 'sms api key', 'SMS/Email Settings');
2797 -- -------------------------------------------------------------------
2799 CREATE TABLE chart_tracker (
2800   ct_pid            int(11)       NOT NULL,
2801   ct_when           datetime      NOT NULL,
2802   ct_userid         bigint(20)    NOT NULL DEFAULT 0,
2803   ct_location       varchar(31)   NOT NULL DEFAULT '',
2804   PRIMARY KEY (ct_pid, ct_when)
2805 ) ENGINE=MyISAM;
2807 CREATE TABLE ar_session (
2808   session_id     int unsigned  NOT NULL AUTO_INCREMENT,
2809   payer_id       int(11)       NOT NULL            COMMENT '0=pt else references insurance_companies.id',
2810   user_id        int(11)       NOT NULL            COMMENT 'references users.id for session owner',
2811   closed         tinyint(1)    NOT NULL DEFAULT 0  COMMENT '0=no, 1=yes',
2812   reference      varchar(255)  NOT NULL DEFAULT '' COMMENT 'check or EOB number',
2813   check_date     date          DEFAULT NULL,
2814   deposit_date   date          DEFAULT NULL,
2815   pay_total      decimal(12,2) NOT NULL DEFAULT 0,
2816   PRIMARY KEY (session_id),
2817   KEY user_closed (user_id, closed),
2818   KEY deposit_date (deposit_date)
2819 ) ENGINE=MyISAM;
2821 CREATE TABLE ar_activity (
2822   pid            int(11)       NOT NULL,
2823   encounter      int(11)       NOT NULL,
2824   sequence_no    int unsigned  NOT NULL AUTO_INCREMENT,
2825   code           varchar(9)    NOT NULL            COMMENT 'empty means claim level',
2826   modifier       varchar(5)    NOT NULL DEFAULT '',
2827   payer_type     int           NOT NULL            COMMENT '0=pt, 1=ins1, 2=ins2, etc',
2828   post_time      datetime      NOT NULL,
2829   post_user      int(11)       NOT NULL            COMMENT 'references users.id',
2830   session_id     int unsigned  NOT NULL            COMMENT 'references ar_session.session_id',
2831   memo           varchar(255)  NOT NULL DEFAULT '' COMMENT 'adjustment reasons go here',
2832   pay_amount     decimal(12,2) NOT NULL DEFAULT 0  COMMENT 'either pay or adj will always be 0',
2833   adj_amount     decimal(12,2) NOT NULL DEFAULT 0,
2834   PRIMARY KEY (pid, encounter, sequence_no),
2835   KEY session_id (session_id)
2836 ) ENGINE=MyISAM;