Add New FMC code from Intesync
[openemr.git] / sql / database.sql
blobd8463d770f40b646423ddd908b946f9cb8753989
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, 17);
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);
121 INSERT INTO `categories` VALUES (6, 'Advance Directive', '', 1, 9, 16);
122 INSERT INTO `categories` VALUES (7, 'Do Not Resuscitate Order', '', 6, 10, 11);
123 INSERT INTO `categories` VALUES (8, 'Durable Power of Attorney', '', 6, 12, 13);
124 INSERT INTO `categories` VALUES (9, 'Living Will', '', 6, 14, 15);
126 -- --------------------------------------------------------
128 -- 
129 -- Table structure for table `categories_seq`
130 -- 
132 DROP TABLE IF EXISTS `categories_seq`;
133 CREATE TABLE `categories_seq` (
134   `id` int(11) NOT NULL default '0',
135   PRIMARY KEY  (`id`)
136 ) ENGINE=MyISAM;
138 -- 
139 -- Dumping data for table `categories_seq`
140 -- 
142 INSERT INTO `categories_seq` VALUES (9);
144 -- --------------------------------------------------------
146 -- 
147 -- Table structure for table `categories_to_documents`
148 -- 
150 DROP TABLE IF EXISTS `categories_to_documents`;
151 CREATE TABLE `categories_to_documents` (
152   `category_id` int(11) NOT NULL default '0',
153   `document_id` int(11) NOT NULL default '0',
154   PRIMARY KEY  (`category_id`,`document_id`)
155 ) ENGINE=MyISAM;
157 -- --------------------------------------------------------
159 -- 
160 -- Table structure for table `claims`
161 -- 
163 DROP TABLE IF EXISTS `claims`;
164 CREATE TABLE `claims` (
165   `patient_id` int(11) NOT NULL,
166   `encounter_id` int(11) NOT NULL,
167   `version` int(10) unsigned NOT NULL auto_increment,
168   `payer_id` int(11) NOT NULL default '0',
169   `status` tinyint(2) NOT NULL default '0',
170   `payer_type` tinyint(4) NOT NULL default '0',
171   `bill_process` tinyint(2) NOT NULL default '0',
172   `bill_time` datetime default NULL,
173   `process_time` datetime default NULL,
174   `process_file` varchar(255) default NULL,
175   `target` varchar(30) default NULL,
176   `x12_partner_id` int(11) NOT NULL default '0',
177   PRIMARY KEY  (`patient_id`,`encounter_id`,`version`)
178 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
180 -- --------------------------------------------------------
182 -- 
183 -- Table structure for table `codes`
184 -- 
186 DROP TABLE IF EXISTS `codes`;
187 CREATE TABLE `codes` (
188   `id` int(11) NOT NULL auto_increment,
189   `code_text` varchar(255) NOT NULL default '',
190   `code_text_short` varchar(24) NOT NULL default '',
191   `code` varchar(10) NOT NULL default '',
192   `code_type` tinyint(2) default NULL,
193   `modifier` varchar(5) NOT NULL default '',
194   `units` tinyint(3) default NULL,
195   `fee` decimal(12,2) default NULL,
196   `superbill` varchar(31) NOT NULL default '',
197   `related_code` varchar(255) NOT NULL default '',
198   `taxrates` varchar(255) NOT NULL default '',
199   `cyp_factor` float NOT NULL DEFAULT 0 COMMENT 'quantity representing a years supply',
200   `active` TINYINT(1) DEFAULT 1 COMMENT '0 = inactive, 1 = active',
201   `reportable` TINYINT(1) DEFAULT 0 COMMENT '0 = non-reportable, 1 = reportable',
202   PRIMARY KEY  (`id`),
203   KEY `code` (`code`)
204 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
205 -- --------------------------------------------------------
207 -- 
208 -- Table structure for table `syndromic_surveillance`
209 -- 
211 DROP TABLE IF EXISTS `syndromic_surveillance`;
212 CREATE TABLE `syndromic_surveillance` (
213   `id` bigint(20) NOT NULL auto_increment,
214   `lists_id` bigint(20) NOT NULL,
215   `submission_date` datetime NOT NULL,
216   `filename` varchar(255) NOT NULL default '',
217   PRIMARY KEY  (`id`),
218   KEY (`lists_id`)
219 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
221 -- --------------------------------------------------------
223 -- 
224 -- Table structure for table `config`
225 -- 
227 DROP TABLE IF EXISTS `config`;
228 CREATE TABLE `config` (
229   `id` int(11) NOT NULL default '0',
230   `name` varchar(255) default NULL,
231   `value` varchar(255) default NULL,
232   `parent` int(11) NOT NULL default '0',
233   `lft` int(11) NOT NULL default '0',
234   `rght` int(11) NOT NULL default '0',
235   PRIMARY KEY  (`id`),
236   KEY `parent` (`parent`),
237   KEY `lft` (`lft`,`rght`)
238 ) ENGINE=MyISAM;
240 -- --------------------------------------------------------
242 -- 
243 -- Table structure for table `config_seq`
244 -- 
246 DROP TABLE IF EXISTS `config_seq`;
247 CREATE TABLE `config_seq` (
248   `id` int(11) NOT NULL default '0',
249   PRIMARY KEY  (`id`)
250 ) ENGINE=MyISAM;
252 -- 
253 -- Dumping data for table `config_seq`
254 -- 
256 INSERT INTO `config_seq` VALUES (0);
258 -- --------------------------------------------------------
260 -- 
261 -- Table structure for table `documents`
262 -- 
264 DROP TABLE IF EXISTS `documents`;
265 CREATE TABLE `documents` (
266   `id` int(11) NOT NULL default '0',
267   `type` enum('file_url','blob','web_url') default NULL,
268   `size` int(11) default NULL,
269   `date` datetime default NULL,
270   `url` varchar(255) default NULL,
271   `mimetype` varchar(255) default NULL,
272   `pages` int(11) default NULL,
273   `owner` int(11) default NULL,
274   `revision` timestamp NOT NULL,
275   `foreign_id` int(11) default NULL,
276   `docdate` date default NULL,
277   `list_id` bigint(20) NOT NULL default '0',
278   PRIMARY KEY  (`id`),
279   KEY `revision` (`revision`),
280   KEY `foreign_id` (`foreign_id`),
281   KEY `owner` (`owner`)
282 ) ENGINE=MyISAM;
284 -- --------------------------------------------------------
286 -- 
287 -- Table structure for table `drug_inventory`
288 -- 
290 DROP TABLE IF EXISTS `drug_inventory`;
291 CREATE TABLE `drug_inventory` (
292   `inventory_id` int(11) NOT NULL auto_increment,
293   `drug_id` int(11) NOT NULL,
294   `lot_number` varchar(20) default NULL,
295   `expiration` date default NULL,
296   `manufacturer` varchar(255) default NULL,
297   `on_hand` int(11) NOT NULL default '0',
298   `warehouse_id` varchar(31) NOT NULL DEFAULT '',
299   `vendor_id` bigint(20) NOT NULL DEFAULT 0,
300   `last_notify` date NOT NULL default '0000-00-00',
301   `destroy_date` date default NULL,
302   `destroy_method` varchar(255) default NULL,
303   `destroy_witness` varchar(255) default NULL,
304   `destroy_notes` varchar(255) default NULL,
305   PRIMARY KEY  (`inventory_id`)
306 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
308 -- --------------------------------------------------------
310 -- 
311 -- Table structure for table `drug_sales`
312 -- 
314 DROP TABLE IF EXISTS `drug_sales`;
315 CREATE TABLE `drug_sales` (
316   `sale_id` int(11) NOT NULL auto_increment,
317   `drug_id` int(11) NOT NULL,
318   `inventory_id` int(11) NOT NULL,
319   `prescription_id` int(11) NOT NULL default '0',
320   `pid` int(11) NOT NULL default '0',
321   `encounter` int(11) NOT NULL default '0',
322   `user` varchar(255) default NULL,
323   `sale_date` date NOT NULL,
324   `quantity` int(11) NOT NULL default '0',
325   `fee` decimal(12,2) NOT NULL default '0.00',
326   `billed` tinyint(1) NOT NULL default '0' COMMENT 'indicates if the sale is posted to accounting',
327   `xfer_inventory_id` int(11) NOT NULL DEFAULT 0,
328   `notes` varchar(255) NOT NULL DEFAULT '',
329   PRIMARY KEY  (`sale_id`)
330 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
332 -- --------------------------------------------------------
334 -- 
335 -- Table structure for table `drug_templates`
336 -- 
338 DROP TABLE IF EXISTS `drug_templates`;
339 CREATE TABLE `drug_templates` (
340   `drug_id` int(11) NOT NULL,
341   `selector` varchar(255) NOT NULL default '',
342   `dosage` varchar(10) default NULL,
343   `period` int(11) NOT NULL default '0',
344   `quantity` int(11) NOT NULL default '0',
345   `refills` int(11) NOT NULL default '0',
346   `taxrates` varchar(255) default NULL,
347   PRIMARY KEY  (`drug_id`,`selector`)
348 ) ENGINE=MyISAM;
350 -- --------------------------------------------------------
352 -- 
353 -- Table structure for table `drugs`
354 -- 
356 DROP TABLE IF EXISTS `drugs`;
357 CREATE TABLE `drugs` (
358   `drug_id` int(11) NOT NULL auto_increment,
359   `name` varchar(255) NOT NULL DEFAULT '',
360   `ndc_number` varchar(20) NOT NULL DEFAULT '',
361   `on_order` int(11) NOT NULL default '0',
362   `reorder_point` int(11) NOT NULL default '0',
363   `last_notify` date NOT NULL default '0000-00-00',
364   `reactions` text,
365   `form` int(3) NOT NULL default '0',
366   `size` float unsigned NOT NULL default '0',
367   `unit` int(11) NOT NULL default '0',
368   `route` int(11) NOT NULL default '0',
369   `substitute` int(11) NOT NULL default '0',
370   `related_code` varchar(255) NOT NULL DEFAULT '' COMMENT 'may reference a related codes.code',
371   `cyp_factor` float NOT NULL DEFAULT 0 COMMENT 'quantity representing a years supply',
372   `active` TINYINT(1) DEFAULT 1 COMMENT '0 = inactive, 1 = active',
373   `allow_combining` tinyint(1) NOT NULL DEFAULT 0 COMMENT '1 = allow filling an order from multiple lots',
374   `allow_multiple`  tinyint(1) NOT NULL DEFAULT 1 COMMENT '1 = allow multiple lots at one warehouse',
375   PRIMARY KEY  (`drug_id`)
376 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
378 -- --------------------------------------------------------
380 -- 
381 -- Table structure for table `employer_data`
382 -- 
384 DROP TABLE IF EXISTS `employer_data`;
385 CREATE TABLE `employer_data` (
386   `id` bigint(20) NOT NULL auto_increment,
387   `name` varchar(255) default NULL,
388   `street` varchar(255) default NULL,
389   `postal_code` varchar(255) default NULL,
390   `city` varchar(255) default NULL,
391   `state` varchar(255) default NULL,
392   `country` varchar(255) default NULL,
393   `date` datetime default NULL,
394   `pid` bigint(20) NOT NULL default '0',
395   PRIMARY KEY  (`id`),
396   KEY `pid` (`pid`)
397 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
399 -- --------------------------------------------------------
401 -- 
402 -- Table structure for table `facility`
403 -- 
405 DROP TABLE IF EXISTS `facility`;
406 CREATE TABLE `facility` (
407   `id` int(11) NOT NULL auto_increment,
408   `name` varchar(255) default NULL,
409   `phone` varchar(30) default NULL,
410   `fax` varchar(30) default NULL,
411   `street` varchar(255) default NULL,
412   `city` varchar(255) default NULL,
413   `state` varchar(50) default NULL,
414   `postal_code` varchar(11) default NULL,
415   `country_code` varchar(10) default NULL,
416   `federal_ein` varchar(15) default NULL,
417   `service_location` tinyint(1) NOT NULL default '1',
418   `billing_location` tinyint(1) NOT NULL default '0',
419   `accepts_assignment` tinyint(1) NOT NULL default '0',
420   `pos_code` tinyint(4) default NULL,
421   `x12_sender_id` varchar(25) default NULL,
422   `attn` varchar(65) default NULL,
423   `domain_identifier` varchar(60) default NULL,
424   `facility_npi` varchar(15) default NULL,
425   PRIMARY KEY  (`id`)
426 ) ENGINE=MyISAM AUTO_INCREMENT=4 ;
428 -- 
429 -- Dumping data for table `facility`
430 -- 
432 INSERT INTO `facility` VALUES (3, 'Your Clinic Name Here', '000-000-0000', '000-000-0000', '', '', '', '', '', '', 1, 0, 0, NULL, '', '', '', '');
434 -- --------------------------------------------------------
436 -- 
437 -- Table structure for table `fee_sheet_options`
438 -- 
440 DROP TABLE IF EXISTS `fee_sheet_options`;
441 CREATE TABLE `fee_sheet_options` (
442   `fs_category` varchar(63) default NULL,
443   `fs_option` varchar(63) default NULL,
444   `fs_codes` varchar(255) default NULL
445 ) ENGINE=MyISAM;
447 -- 
448 -- Dumping data for table `fee_sheet_options`
449 -- 
451 INSERT INTO `fee_sheet_options` VALUES ('1New Patient', '1Brief', 'CPT4|99201|');
452 INSERT INTO `fee_sheet_options` VALUES ('1New Patient', '2Limited', 'CPT4|99202|');
453 INSERT INTO `fee_sheet_options` VALUES ('1New Patient', '3Detailed', 'CPT4|99203|');
454 INSERT INTO `fee_sheet_options` VALUES ('1New Patient', '4Extended', 'CPT4|99204|');
455 INSERT INTO `fee_sheet_options` VALUES ('1New Patient', '5Comprehensive', 'CPT4|99205|');
456 INSERT INTO `fee_sheet_options` VALUES ('2Established Patient', '1Brief', 'CPT4|99211|');
457 INSERT INTO `fee_sheet_options` VALUES ('2Established Patient', '2Limited', 'CPT4|99212|');
458 INSERT INTO `fee_sheet_options` VALUES ('2Established Patient', '3Detailed', 'CPT4|99213|');
459 INSERT INTO `fee_sheet_options` VALUES ('2Established Patient', '4Extended', 'CPT4|99214|');
460 INSERT INTO `fee_sheet_options` VALUES ('2Established Patient', '5Comprehensive', 'CPT4|99215|');
462 -- --------------------------------------------------------
464 -- 
465 -- Table structure for table `form_dictation`
466 -- 
468 DROP TABLE IF EXISTS `form_dictation`;
469 CREATE TABLE `form_dictation` (
470   `id` bigint(20) NOT NULL auto_increment,
471   `date` datetime default NULL,
472   `pid` bigint(20) default NULL,
473   `user` varchar(255) default NULL,
474   `groupname` varchar(255) default NULL,
475   `authorized` tinyint(4) default NULL,
476   `activity` tinyint(4) default NULL,
477   `dictation` longtext,
478   `additional_notes` longtext,
479   PRIMARY KEY  (`id`)
480 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
482 -- --------------------------------------------------------
484 -- 
485 -- Table structure for table `form_encounter`
486 -- 
488 DROP TABLE IF EXISTS `form_encounter`;
489 CREATE TABLE `form_encounter` (
490   `id` bigint(20) NOT NULL auto_increment,
491   `date` datetime default NULL,
492   `reason` longtext,
493   `facility` longtext,
494   `facility_id` int(11) NOT NULL default '0',
495   `pid` bigint(20) default NULL,
496   `encounter` bigint(20) default NULL,
497   `onset_date` datetime default NULL,
498   `sensitivity` varchar(30) default NULL,
499   `billing_note` text,
500   `pc_catid` int(11) NOT NULL default '5' COMMENT 'event category from openemr_postcalendar_categories',
501   `last_level_billed` int  NOT NULL DEFAULT 0 COMMENT '0=none, 1=ins1, 2=ins2, etc',
502   `last_level_closed` int  NOT NULL DEFAULT 0 COMMENT '0=none, 1=ins1, 2=ins2, etc',
503   `last_stmt_date`    date DEFAULT NULL,
504   `stmt_count`        int  NOT NULL DEFAULT 0,
505   `provider_id` INT(11) DEFAULT '0' COMMENT 'default and main provider for this visit',
506   `supervisor_id` INT(11) DEFAULT '0' COMMENT 'supervising provider, if any, for this visit',
507   `invoice_refno` varchar(31) NOT NULL DEFAULT '',
508   PRIMARY KEY  (`id`),
509   KEY `pid` (`pid`)
510 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
512 -- --------------------------------------------------------
514 -- 
515 -- Table structure for table `form_misc_billing_options`
516 -- 
518 DROP TABLE IF EXISTS `form_misc_billing_options`;
519 CREATE TABLE `form_misc_billing_options` (
520   `id` bigint(20) NOT NULL auto_increment,
521   `date` datetime default NULL,
522   `pid` bigint(20) default NULL,
523   `user` varchar(255) default NULL,
524   `groupname` varchar(255) default NULL,
525   `authorized` tinyint(4) default NULL,
526   `activity` tinyint(4) default NULL,
527   `employment_related` tinyint(1) default NULL,
528   `auto_accident` tinyint(1) default NULL,
529   `accident_state` varchar(2) default NULL,
530   `other_accident` tinyint(1) default NULL,
531   `outside_lab` tinyint(1) default NULL,
532   `lab_amount` decimal(5,2) default NULL,
533   `is_unable_to_work` tinyint(1) default NULL,
534   `off_work_from` date default NULL,
535   `off_work_to` date default NULL,
536   `is_hospitalized` tinyint(1) default NULL,
537   `hospitalization_date_from` date default NULL,
538   `hospitalization_date_to` date default NULL,
539   `medicaid_resubmission_code` varchar(10) default NULL,
540   `medicaid_original_reference` varchar(15) default NULL,
541   `prior_auth_number` varchar(20) default NULL,
542   `comments` varchar(255) default NULL,
543   `replacement_claim` tinyint(1) default 0,
544   PRIMARY KEY  (`id`)
545 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
547 -- --------------------------------------------------------
549 -- 
550 -- Table structure for table `form_reviewofs`
551 -- 
553 DROP TABLE IF EXISTS `form_reviewofs`;
554 CREATE TABLE `form_reviewofs` (
555   `id` bigint(20) NOT NULL auto_increment,
556   `date` datetime default NULL,
557   `pid` bigint(20) default NULL,
558   `user` varchar(255) default NULL,
559   `groupname` varchar(255) default NULL,
560   `authorized` tinyint(4) default NULL,
561   `activity` tinyint(4) default NULL,
562   `fever` varchar(5) default NULL,
563   `chills` varchar(5) default NULL,
564   `night_sweats` varchar(5) default NULL,
565   `weight_loss` varchar(5) default NULL,
566   `poor_appetite` varchar(5) default NULL,
567   `insomnia` varchar(5) default NULL,
568   `fatigued` varchar(5) default NULL,
569   `depressed` varchar(5) default NULL,
570   `hyperactive` varchar(5) default NULL,
571   `exposure_to_foreign_countries` varchar(5) default NULL,
572   `cataracts` varchar(5) default NULL,
573   `cataract_surgery` varchar(5) default NULL,
574   `glaucoma` varchar(5) default NULL,
575   `double_vision` varchar(5) default NULL,
576   `blurred_vision` varchar(5) default NULL,
577   `poor_hearing` varchar(5) default NULL,
578   `headaches` varchar(5) default NULL,
579   `ringing_in_ears` varchar(5) default NULL,
580   `bloody_nose` varchar(5) default NULL,
581   `sinusitis` varchar(5) default NULL,
582   `sinus_surgery` varchar(5) default NULL,
583   `dry_mouth` varchar(5) default NULL,
584   `strep_throat` varchar(5) default NULL,
585   `tonsillectomy` varchar(5) default NULL,
586   `swollen_lymph_nodes` varchar(5) default NULL,
587   `throat_cancer` varchar(5) default NULL,
588   `throat_cancer_surgery` varchar(5) default NULL,
589   `heart_attack` varchar(5) default NULL,
590   `irregular_heart_beat` varchar(5) default NULL,
591   `chest_pains` varchar(5) default NULL,
592   `shortness_of_breath` varchar(5) default NULL,
593   `high_blood_pressure` varchar(5) default NULL,
594   `heart_failure` varchar(5) default NULL,
595   `poor_circulation` varchar(5) default NULL,
596   `vascular_surgery` varchar(5) default NULL,
597   `cardiac_catheterization` varchar(5) default NULL,
598   `coronary_artery_bypass` varchar(5) default NULL,
599   `heart_transplant` varchar(5) default NULL,
600   `stress_test` varchar(5) default NULL,
601   `emphysema` varchar(5) default NULL,
602   `chronic_bronchitis` varchar(5) default NULL,
603   `interstitial_lung_disease` varchar(5) default NULL,
604   `shortness_of_breath_2` varchar(5) default NULL,
605   `lung_cancer` varchar(5) default NULL,
606   `lung_cancer_surgery` varchar(5) default NULL,
607   `pheumothorax` varchar(5) default NULL,
608   `stomach_pains` varchar(5) default NULL,
609   `peptic_ulcer_disease` varchar(5) default NULL,
610   `gastritis` varchar(5) default NULL,
611   `endoscopy` varchar(5) default NULL,
612   `polyps` varchar(5) default NULL,
613   `colonoscopy` varchar(5) default NULL,
614   `colon_cancer` varchar(5) default NULL,
615   `colon_cancer_surgery` varchar(5) default NULL,
616   `ulcerative_colitis` varchar(5) default NULL,
617   `crohns_disease` varchar(5) default NULL,
618   `appendectomy` varchar(5) default NULL,
619   `divirticulitis` varchar(5) default NULL,
620   `divirticulitis_surgery` varchar(5) default NULL,
621   `gall_stones` varchar(5) default NULL,
622   `cholecystectomy` varchar(5) default NULL,
623   `hepatitis` varchar(5) default NULL,
624   `cirrhosis_of_the_liver` varchar(5) default NULL,
625   `splenectomy` varchar(5) default NULL,
626   `kidney_failure` varchar(5) default NULL,
627   `kidney_stones` varchar(5) default NULL,
628   `kidney_cancer` varchar(5) default NULL,
629   `kidney_infections` varchar(5) default NULL,
630   `bladder_infections` varchar(5) default NULL,
631   `bladder_cancer` varchar(5) default NULL,
632   `prostate_problems` varchar(5) default NULL,
633   `prostate_cancer` varchar(5) default NULL,
634   `kidney_transplant` varchar(5) default NULL,
635   `sexually_transmitted_disease` varchar(5) default NULL,
636   `burning_with_urination` varchar(5) default NULL,
637   `discharge_from_urethra` varchar(5) default NULL,
638   `rashes` varchar(5) default NULL,
639   `infections` varchar(5) default NULL,
640   `ulcerations` varchar(5) default NULL,
641   `pemphigus` varchar(5) default NULL,
642   `herpes` varchar(5) default NULL,
643   `osetoarthritis` varchar(5) default NULL,
644   `rheumotoid_arthritis` varchar(5) default NULL,
645   `lupus` varchar(5) default NULL,
646   `ankylosing_sondlilitis` varchar(5) default NULL,
647   `swollen_joints` varchar(5) default NULL,
648   `stiff_joints` varchar(5) default NULL,
649   `broken_bones` varchar(5) default NULL,
650   `neck_problems` varchar(5) default NULL,
651   `back_problems` varchar(5) default NULL,
652   `back_surgery` varchar(5) default NULL,
653   `scoliosis` varchar(5) default NULL,
654   `herniated_disc` varchar(5) default NULL,
655   `shoulder_problems` varchar(5) default NULL,
656   `elbow_problems` varchar(5) default NULL,
657   `wrist_problems` varchar(5) default NULL,
658   `hand_problems` varchar(5) default NULL,
659   `hip_problems` varchar(5) default NULL,
660   `knee_problems` varchar(5) default NULL,
661   `ankle_problems` varchar(5) default NULL,
662   `foot_problems` varchar(5) default NULL,
663   `insulin_dependent_diabetes` varchar(5) default NULL,
664   `noninsulin_dependent_diabetes` varchar(5) default NULL,
665   `hypothyroidism` varchar(5) default NULL,
666   `hyperthyroidism` varchar(5) default NULL,
667   `cushing_syndrom` varchar(5) default NULL,
668   `addison_syndrom` varchar(5) default NULL,
669   `additional_notes` longtext,
670   PRIMARY KEY  (`id`)
671 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
673 -- --------------------------------------------------------
675 -- 
676 -- Table structure for table `form_ros`
677 -- 
679 DROP TABLE IF EXISTS `form_ros`;
680 CREATE TABLE `form_ros` (
681   `id` int(11) NOT NULL auto_increment,
682   `pid` int(11) NOT NULL,
683   `activity` int(11) NOT NULL default '1',
684   `date` datetime default NULL,
685   `weight_change` varchar(3) default NULL,
686   `weakness` varchar(3) default NULL,
687   `fatigue` varchar(3) default NULL,
688   `anorexia` varchar(3) default NULL,
689   `fever` varchar(3) default NULL,
690   `chills` varchar(3) default NULL,
691   `night_sweats` varchar(3) default NULL,
692   `insomnia` varchar(3) default NULL,
693   `irritability` varchar(3) default NULL,
694   `heat_or_cold` varchar(3) default NULL,
695   `intolerance` varchar(3) default NULL,
696   `change_in_vision` varchar(3) default NULL,
697   `glaucoma_history` varchar(3) default NULL,
698   `eye_pain` varchar(3) default NULL,
699   `irritation` varchar(3) default NULL,
700   `redness` varchar(3) default NULL,
701   `excessive_tearing` varchar(3) default NULL,
702   `double_vision` varchar(3) default NULL,
703   `blind_spots` varchar(3) default NULL,
704   `photophobia` varchar(3) default NULL,
705   `hearing_loss` varchar(3) default NULL,
706   `discharge` varchar(3) default NULL,
707   `pain` varchar(3) default NULL,
708   `vertigo` varchar(3) default NULL,
709   `tinnitus` varchar(3) default NULL,
710   `frequent_colds` varchar(3) default NULL,
711   `sore_throat` varchar(3) default NULL,
712   `sinus_problems` varchar(3) default NULL,
713   `post_nasal_drip` varchar(3) default NULL,
714   `nosebleed` varchar(3) default NULL,
715   `snoring` varchar(3) default NULL,
716   `apnea` varchar(3) default NULL,
717   `breast_mass` varchar(3) default NULL,
718   `breast_discharge` varchar(3) default NULL,
719   `biopsy` varchar(3) default NULL,
720   `abnormal_mammogram` varchar(3) default NULL,
721   `cough` varchar(3) default NULL,
722   `sputum` varchar(3) default NULL,
723   `shortness_of_breath` varchar(3) default NULL,
724   `wheezing` varchar(3) default NULL,
725   `hemoptsyis` varchar(3) default NULL,
726   `asthma` varchar(3) default NULL,
727   `copd` varchar(3) default NULL,
728   `chest_pain` varchar(3) default NULL,
729   `palpitation` varchar(3) default NULL,
730   `syncope` varchar(3) default NULL,
731   `pnd` varchar(3) default NULL,
732   `doe` varchar(3) default NULL,
733   `orthopnea` varchar(3) default NULL,
734   `peripheal` varchar(3) default NULL,
735   `edema` varchar(3) default NULL,
736   `legpain_cramping` varchar(3) default NULL,
737   `history_murmur` varchar(3) default NULL,
738   `arrythmia` varchar(3) default NULL,
739   `heart_problem` varchar(3) default NULL,
740   `dysphagia` varchar(3) default NULL,
741   `heartburn` varchar(3) default NULL,
742   `bloating` varchar(3) default NULL,
743   `belching` varchar(3) default NULL,
744   `flatulence` varchar(3) default NULL,
745   `nausea` varchar(3) default NULL,
746   `vomiting` varchar(3) default NULL,
747   `hematemesis` varchar(3) default NULL,
748   `gastro_pain` varchar(3) default NULL,
749   `food_intolerance` varchar(3) default NULL,
750   `hepatitis` varchar(3) default NULL,
751   `jaundice` varchar(3) default NULL,
752   `hematochezia` varchar(3) default NULL,
753   `changed_bowel` varchar(3) default NULL,
754   `diarrhea` varchar(3) default NULL,
755   `constipation` varchar(3) default NULL,
756   `polyuria` varchar(3) default NULL,
757   `polydypsia` varchar(3) default NULL,
758   `dysuria` varchar(3) default NULL,
759   `hematuria` varchar(3) default NULL,
760   `frequency` varchar(3) default NULL,
761   `urgency` varchar(3) default NULL,
762   `incontinence` varchar(3) default NULL,
763   `renal_stones` varchar(3) default NULL,
764   `utis` varchar(3) default NULL,
765   `hesitancy` varchar(3) default NULL,
766   `dribbling` varchar(3) default NULL,
767   `stream` varchar(3) default NULL,
768   `nocturia` varchar(3) default NULL,
769   `erections` varchar(3) default NULL,
770   `ejaculations` varchar(3) default NULL,
771   `g` varchar(3) default NULL,
772   `p` varchar(3) default NULL,
773   `ap` varchar(3) default NULL,
774   `lc` varchar(3) default NULL,
775   `mearche` varchar(3) default NULL,
776   `menopause` varchar(3) default NULL,
777   `lmp` varchar(3) default NULL,
778   `f_frequency` varchar(3) default NULL,
779   `f_flow` varchar(3) default NULL,
780   `f_symptoms` varchar(3) default NULL,
781   `abnormal_hair_growth` varchar(3) default NULL,
782   `f_hirsutism` varchar(3) default NULL,
783   `joint_pain` varchar(3) default NULL,
784   `swelling` varchar(3) default NULL,
785   `m_redness` varchar(3) default NULL,
786   `m_warm` varchar(3) default NULL,
787   `m_stiffness` varchar(3) default NULL,
788   `muscle` varchar(3) default NULL,
789   `m_aches` varchar(3) default NULL,
790   `fms` varchar(3) default NULL,
791   `arthritis` varchar(3) default NULL,
792   `loc` varchar(3) default NULL,
793   `seizures` varchar(3) default NULL,
794   `stroke` varchar(3) default NULL,
795   `tia` varchar(3) default NULL,
796   `n_numbness` varchar(3) default NULL,
797   `n_weakness` varchar(3) default NULL,
798   `paralysis` varchar(3) default NULL,
799   `intellectual_decline` varchar(3) default NULL,
800   `memory_problems` varchar(3) default NULL,
801   `dementia` varchar(3) default NULL,
802   `n_headache` varchar(3) default NULL,
803   `s_cancer` varchar(3) default NULL,
804   `psoriasis` varchar(3) default NULL,
805   `s_acne` varchar(3) default NULL,
806   `s_other` varchar(3) default NULL,
807   `s_disease` varchar(3) default NULL,
808   `p_diagnosis` varchar(3) default NULL,
809   `p_medication` varchar(3) default NULL,
810   `depression` varchar(3) default NULL,
811   `anxiety` varchar(3) default NULL,
812   `social_difficulties` varchar(3) default NULL,
813   `thyroid_problems` varchar(3) default NULL,
814   `diabetes` varchar(3) default NULL,
815   `abnormal_blood` varchar(3) default NULL,
816   `anemia` varchar(3) default NULL,
817   `fh_blood_problems` varchar(3) default NULL,
818   `bleeding_problems` varchar(3) default NULL,
819   `allergies` varchar(3) default NULL,
820   `frequent_illness` varchar(3) default NULL,
821   `hiv` varchar(3) default NULL,
822   `hai_status` varchar(3) default NULL,
823   PRIMARY KEY  (`id`)
824 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
826 -- --------------------------------------------------------
828 -- 
829 -- Table structure for table `form_soap`
830 -- 
832 DROP TABLE IF EXISTS `form_soap`;
833 CREATE TABLE `form_soap` (
834   `id` bigint(20) NOT NULL auto_increment,
835   `date` datetime default NULL,
836   `pid` bigint(20) default '0',
837   `user` varchar(255) default NULL,
838   `groupname` varchar(255) default NULL,
839   `authorized` tinyint(4) default '0',
840   `activity` tinyint(4) default '0',
841   `subjective` text,
842   `objective` text,
843   `assessment` text,
844   `plan` text,
845   PRIMARY KEY  (`id`)
846 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
848 -- --------------------------------------------------------
850 -- 
851 -- Table structure for table `form_vitals`
852 -- 
854 DROP TABLE IF EXISTS `form_vitals`;
855 CREATE TABLE `form_vitals` (
856   `id` bigint(20) NOT NULL auto_increment,
857   `date` datetime default NULL,
858   `pid` bigint(20) default '0',
859   `user` varchar(255) default NULL,
860   `groupname` varchar(255) default NULL,
861   `authorized` tinyint(4) default '0',
862   `activity` tinyint(4) default '0',
863   `bps` varchar(40) default NULL,
864   `bpd` varchar(40) default NULL,
865   `weight` float(5,2) default '0.00',
866   `height` float(5,2) default '0.00',
867   `temperature` float(5,2) default '0.00',
868   `temp_method` varchar(255) default NULL,
869   `pulse` float(5,2) default '0.00',
870   `respiration` float(5,2) default '0.00',
871   `note` varchar(255) default NULL,
872   `BMI` float(4,1) default '0.0',
873   `BMI_status` varchar(255) default NULL,
874   `waist_circ` float(5,2) default '0.00',
875   `head_circ` float(4,2) default '0.00',
876   `oxygen_saturation` float(5,2) default '0.00',
877   PRIMARY KEY  (`id`)
878 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
880 -- --------------------------------------------------------
882 -- 
883 -- Table structure for table `forms`
884 -- 
886 DROP TABLE IF EXISTS `forms`;
887 CREATE TABLE `forms` (
888   `id` bigint(20) NOT NULL auto_increment,
889   `date` datetime default NULL,
890   `encounter` bigint(20) default NULL,
891   `form_name` longtext,
892   `form_id` bigint(20) default NULL,
893   `pid` bigint(20) default NULL,
894   `user` varchar(255) default NULL,
895   `groupname` varchar(255) default NULL,
896   `authorized` tinyint(4) default NULL,
897   `deleted` tinyint(4) DEFAULT '0' NOT NULL COMMENT 'flag indicates form has been deleted',
898   `formdir` longtext,
899   PRIMARY KEY  (`id`)
900 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
902 -- --------------------------------------------------------
904 -- 
905 -- Table structure for table `geo_country_reference`
906 -- 
908 DROP TABLE IF EXISTS `geo_country_reference`;
909 CREATE TABLE `geo_country_reference` (
910   `countries_id` int(5) NOT NULL auto_increment,
911   `countries_name` varchar(64) default NULL,
912   `countries_iso_code_2` char(2) NOT NULL default '',
913   `countries_iso_code_3` char(3) NOT NULL default '',
914   PRIMARY KEY  (`countries_id`),
915   KEY `IDX_COUNTRIES_NAME` (`countries_name`)
916 ) ENGINE=MyISAM AUTO_INCREMENT=240 ;
918 -- 
919 -- Dumping data for table `geo_country_reference`
920 -- 
922 INSERT INTO `geo_country_reference` VALUES (1, 'Afghanistan', 'AF', 'AFG');
923 INSERT INTO `geo_country_reference` VALUES (2, 'Albania', 'AL', 'ALB');
924 INSERT INTO `geo_country_reference` VALUES (3, 'Algeria', 'DZ', 'DZA');
925 INSERT INTO `geo_country_reference` VALUES (4, 'American Samoa', 'AS', 'ASM');
926 INSERT INTO `geo_country_reference` VALUES (5, 'Andorra', 'AD', 'AND');
927 INSERT INTO `geo_country_reference` VALUES (6, 'Angola', 'AO', 'AGO');
928 INSERT INTO `geo_country_reference` VALUES (7, 'Anguilla', 'AI', 'AIA');
929 INSERT INTO `geo_country_reference` VALUES (8, 'Antarctica', 'AQ', 'ATA');
930 INSERT INTO `geo_country_reference` VALUES (9, 'Antigua and Barbuda', 'AG', 'ATG');
931 INSERT INTO `geo_country_reference` VALUES (10, 'Argentina', 'AR', 'ARG');
932 INSERT INTO `geo_country_reference` VALUES (11, 'Armenia', 'AM', 'ARM');
933 INSERT INTO `geo_country_reference` VALUES (12, 'Aruba', 'AW', 'ABW');
934 INSERT INTO `geo_country_reference` VALUES (13, 'Australia', 'AU', 'AUS');
935 INSERT INTO `geo_country_reference` VALUES (14, 'Austria', 'AT', 'AUT');
936 INSERT INTO `geo_country_reference` VALUES (15, 'Azerbaijan', 'AZ', 'AZE');
937 INSERT INTO `geo_country_reference` VALUES (16, 'Bahamas', 'BS', 'BHS');
938 INSERT INTO `geo_country_reference` VALUES (17, 'Bahrain', 'BH', 'BHR');
939 INSERT INTO `geo_country_reference` VALUES (18, 'Bangladesh', 'BD', 'BGD');
940 INSERT INTO `geo_country_reference` VALUES (19, 'Barbados', 'BB', 'BRB');
941 INSERT INTO `geo_country_reference` VALUES (20, 'Belarus', 'BY', 'BLR');
942 INSERT INTO `geo_country_reference` VALUES (21, 'Belgium', 'BE', 'BEL');
943 INSERT INTO `geo_country_reference` VALUES (22, 'Belize', 'BZ', 'BLZ');
944 INSERT INTO `geo_country_reference` VALUES (23, 'Benin', 'BJ', 'BEN');
945 INSERT INTO `geo_country_reference` VALUES (24, 'Bermuda', 'BM', 'BMU');
946 INSERT INTO `geo_country_reference` VALUES (25, 'Bhutan', 'BT', 'BTN');
947 INSERT INTO `geo_country_reference` VALUES (26, 'Bolivia', 'BO', 'BOL');
948 INSERT INTO `geo_country_reference` VALUES (27, 'Bosnia and Herzegowina', 'BA', 'BIH');
949 INSERT INTO `geo_country_reference` VALUES (28, 'Botswana', 'BW', 'BWA');
950 INSERT INTO `geo_country_reference` VALUES (29, 'Bouvet Island', 'BV', 'BVT');
951 INSERT INTO `geo_country_reference` VALUES (30, 'Brazil', 'BR', 'BRA');
952 INSERT INTO `geo_country_reference` VALUES (31, 'British Indian Ocean Territory', 'IO', 'IOT');
953 INSERT INTO `geo_country_reference` VALUES (32, 'Brunei Darussalam', 'BN', 'BRN');
954 INSERT INTO `geo_country_reference` VALUES (33, 'Bulgaria', 'BG', 'BGR');
955 INSERT INTO `geo_country_reference` VALUES (34, 'Burkina Faso', 'BF', 'BFA');
956 INSERT INTO `geo_country_reference` VALUES (35, 'Burundi', 'BI', 'BDI');
957 INSERT INTO `geo_country_reference` VALUES (36, 'Cambodia', 'KH', 'KHM');
958 INSERT INTO `geo_country_reference` VALUES (37, 'Cameroon', 'CM', 'CMR');
959 INSERT INTO `geo_country_reference` VALUES (38, 'Canada', 'CA', 'CAN');
960 INSERT INTO `geo_country_reference` VALUES (39, 'Cape Verde', 'CV', 'CPV');
961 INSERT INTO `geo_country_reference` VALUES (40, 'Cayman Islands', 'KY', 'CYM');
962 INSERT INTO `geo_country_reference` VALUES (41, 'Central African Republic', 'CF', 'CAF');
963 INSERT INTO `geo_country_reference` VALUES (42, 'Chad', 'TD', 'TCD');
964 INSERT INTO `geo_country_reference` VALUES (43, 'Chile', 'CL', 'CHL');
965 INSERT INTO `geo_country_reference` VALUES (44, 'China', 'CN', 'CHN');
966 INSERT INTO `geo_country_reference` VALUES (45, 'Christmas Island', 'CX', 'CXR');
967 INSERT INTO `geo_country_reference` VALUES (46, 'Cocos (Keeling) Islands', 'CC', 'CCK');
968 INSERT INTO `geo_country_reference` VALUES (47, 'Colombia', 'CO', 'COL');
969 INSERT INTO `geo_country_reference` VALUES (48, 'Comoros', 'KM', 'COM');
970 INSERT INTO `geo_country_reference` VALUES (49, 'Congo', 'CG', 'COG');
971 INSERT INTO `geo_country_reference` VALUES (50, 'Cook Islands', 'CK', 'COK');
972 INSERT INTO `geo_country_reference` VALUES (51, 'Costa Rica', 'CR', 'CRI');
973 INSERT INTO `geo_country_reference` VALUES (52, 'Cote D Ivoire', 'CI', 'CIV');
974 INSERT INTO `geo_country_reference` VALUES (53, 'Croatia', 'HR', 'HRV');
975 INSERT INTO `geo_country_reference` VALUES (54, 'Cuba', 'CU', 'CUB');
976 INSERT INTO `geo_country_reference` VALUES (55, 'Cyprus', 'CY', 'CYP');
977 INSERT INTO `geo_country_reference` VALUES (56, 'Czech Republic', 'CZ', 'CZE');
978 INSERT INTO `geo_country_reference` VALUES (57, 'Denmark', 'DK', 'DNK');
979 INSERT INTO `geo_country_reference` VALUES (58, 'Djibouti', 'DJ', 'DJI');
980 INSERT INTO `geo_country_reference` VALUES (59, 'Dominica', 'DM', 'DMA');
981 INSERT INTO `geo_country_reference` VALUES (60, 'Dominican Republic', 'DO', 'DOM');
982 INSERT INTO `geo_country_reference` VALUES (61, 'East Timor', 'TP', 'TMP');
983 INSERT INTO `geo_country_reference` VALUES (62, 'Ecuador', 'EC', 'ECU');
984 INSERT INTO `geo_country_reference` VALUES (63, 'Egypt', 'EG', 'EGY');
985 INSERT INTO `geo_country_reference` VALUES (64, 'El Salvador', 'SV', 'SLV');
986 INSERT INTO `geo_country_reference` VALUES (65, 'Equatorial Guinea', 'GQ', 'GNQ');
987 INSERT INTO `geo_country_reference` VALUES (66, 'Eritrea', 'ER', 'ERI');
988 INSERT INTO `geo_country_reference` VALUES (67, 'Estonia', 'EE', 'EST');
989 INSERT INTO `geo_country_reference` VALUES (68, 'Ethiopia', 'ET', 'ETH');
990 INSERT INTO `geo_country_reference` VALUES (69, 'Falkland Islands (Malvinas)', 'FK', 'FLK');
991 INSERT INTO `geo_country_reference` VALUES (70, 'Faroe Islands', 'FO', 'FRO');
992 INSERT INTO `geo_country_reference` VALUES (71, 'Fiji', 'FJ', 'FJI');
993 INSERT INTO `geo_country_reference` VALUES (72, 'Finland', 'FI', 'FIN');
994 INSERT INTO `geo_country_reference` VALUES (73, 'France', 'FR', 'FRA');
995 INSERT INTO `geo_country_reference` VALUES (74, 'France, MEtropolitan', 'FX', 'FXX');
996 INSERT INTO `geo_country_reference` VALUES (75, 'French Guiana', 'GF', 'GUF');
997 INSERT INTO `geo_country_reference` VALUES (76, 'French Polynesia', 'PF', 'PYF');
998 INSERT INTO `geo_country_reference` VALUES (77, 'French Southern Territories', 'TF', 'ATF');
999 INSERT INTO `geo_country_reference` VALUES (78, 'Gabon', 'GA', 'GAB');
1000 INSERT INTO `geo_country_reference` VALUES (79, 'Gambia', 'GM', 'GMB');
1001 INSERT INTO `geo_country_reference` VALUES (80, 'Georgia', 'GE', 'GEO');
1002 INSERT INTO `geo_country_reference` VALUES (81, 'Germany', 'DE', 'DEU');
1003 INSERT INTO `geo_country_reference` VALUES (82, 'Ghana', 'GH', 'GHA');
1004 INSERT INTO `geo_country_reference` VALUES (83, 'Gibraltar', 'GI', 'GIB');
1005 INSERT INTO `geo_country_reference` VALUES (84, 'Greece', 'GR', 'GRC');
1006 INSERT INTO `geo_country_reference` VALUES (85, 'Greenland', 'GL', 'GRL');
1007 INSERT INTO `geo_country_reference` VALUES (86, 'Grenada', 'GD', 'GRD');
1008 INSERT INTO `geo_country_reference` VALUES (87, 'Guadeloupe', 'GP', 'GLP');
1009 INSERT INTO `geo_country_reference` VALUES (88, 'Guam', 'GU', 'GUM');
1010 INSERT INTO `geo_country_reference` VALUES (89, 'Guatemala', 'GT', 'GTM');
1011 INSERT INTO `geo_country_reference` VALUES (90, 'Guinea', 'GN', 'GIN');
1012 INSERT INTO `geo_country_reference` VALUES (91, 'Guinea-bissau', 'GW', 'GNB');
1013 INSERT INTO `geo_country_reference` VALUES (92, 'Guyana', 'GY', 'GUY');
1014 INSERT INTO `geo_country_reference` VALUES (93, 'Haiti', 'HT', 'HTI');
1015 INSERT INTO `geo_country_reference` VALUES (94, 'Heard and Mc Donald Islands', 'HM', 'HMD');
1016 INSERT INTO `geo_country_reference` VALUES (95, 'Honduras', 'HN', 'HND');
1017 INSERT INTO `geo_country_reference` VALUES (96, 'Hong Kong', 'HK', 'HKG');
1018 INSERT INTO `geo_country_reference` VALUES (97, 'Hungary', 'HU', 'HUN');
1019 INSERT INTO `geo_country_reference` VALUES (98, 'Iceland', 'IS', 'ISL');
1020 INSERT INTO `geo_country_reference` VALUES (99, 'India', 'IN', 'IND');
1021 INSERT INTO `geo_country_reference` VALUES (100, 'Indonesia', 'ID', 'IDN');
1022 INSERT INTO `geo_country_reference` VALUES (101, 'Iran (Islamic Republic of)', 'IR', 'IRN');
1023 INSERT INTO `geo_country_reference` VALUES (102, 'Iraq', 'IQ', 'IRQ');
1024 INSERT INTO `geo_country_reference` VALUES (103, 'Ireland', 'IE', 'IRL');
1025 INSERT INTO `geo_country_reference` VALUES (104, 'Israel', 'IL', 'ISR');
1026 INSERT INTO `geo_country_reference` VALUES (105, 'Italy', 'IT', 'ITA');
1027 INSERT INTO `geo_country_reference` VALUES (106, 'Jamaica', 'JM', 'JAM');
1028 INSERT INTO `geo_country_reference` VALUES (107, 'Japan', 'JP', 'JPN');
1029 INSERT INTO `geo_country_reference` VALUES (108, 'Jordan', 'JO', 'JOR');
1030 INSERT INTO `geo_country_reference` VALUES (109, 'Kazakhstan', 'KZ', 'KAZ');
1031 INSERT INTO `geo_country_reference` VALUES (110, 'Kenya', 'KE', 'KEN');
1032 INSERT INTO `geo_country_reference` VALUES (111, 'Kiribati', 'KI', 'KIR');
1033 INSERT INTO `geo_country_reference` VALUES (112, 'Korea, Democratic Peoples Republic of', 'KP', 'PRK');
1034 INSERT INTO `geo_country_reference` VALUES (113, 'Korea, Republic of', 'KR', 'KOR');
1035 INSERT INTO `geo_country_reference` VALUES (114, 'Kuwait', 'KW', 'KWT');
1036 INSERT INTO `geo_country_reference` VALUES (115, 'Kyrgyzstan', 'KG', 'KGZ');
1037 INSERT INTO `geo_country_reference` VALUES (116, 'Lao Peoples Democratic Republic', 'LA', 'LAO');
1038 INSERT INTO `geo_country_reference` VALUES (117, 'Latvia', 'LV', 'LVA');
1039 INSERT INTO `geo_country_reference` VALUES (118, 'Lebanon', 'LB', 'LBN');
1040 INSERT INTO `geo_country_reference` VALUES (119, 'Lesotho', 'LS', 'LSO');
1041 INSERT INTO `geo_country_reference` VALUES (120, 'Liberia', 'LR', 'LBR');
1042 INSERT INTO `geo_country_reference` VALUES (121, 'Libyan Arab Jamahiriya', 'LY', 'LBY');
1043 INSERT INTO `geo_country_reference` VALUES (122, 'Liechtenstein', 'LI', 'LIE');
1044 INSERT INTO `geo_country_reference` VALUES (123, 'Lithuania', 'LT', 'LTU');
1045 INSERT INTO `geo_country_reference` VALUES (124, 'Luxembourg', 'LU', 'LUX');
1046 INSERT INTO `geo_country_reference` VALUES (125, 'Macau', 'MO', 'MAC');
1047 INSERT INTO `geo_country_reference` VALUES (126, 'Macedonia, The Former Yugoslav Republic of', 'MK', 'MKD');
1048 INSERT INTO `geo_country_reference` VALUES (127, 'Madagascar', 'MG', 'MDG');
1049 INSERT INTO `geo_country_reference` VALUES (128, 'Malawi', 'MW', 'MWI');
1050 INSERT INTO `geo_country_reference` VALUES (129, 'Malaysia', 'MY', 'MYS');
1051 INSERT INTO `geo_country_reference` VALUES (130, 'Maldives', 'MV', 'MDV');
1052 INSERT INTO `geo_country_reference` VALUES (131, 'Mali', 'ML', 'MLI');
1053 INSERT INTO `geo_country_reference` VALUES (132, 'Malta', 'MT', 'MLT');
1054 INSERT INTO `geo_country_reference` VALUES (133, 'Marshall Islands', 'MH', 'MHL');
1055 INSERT INTO `geo_country_reference` VALUES (134, 'Martinique', 'MQ', 'MTQ');
1056 INSERT INTO `geo_country_reference` VALUES (135, 'Mauritania', 'MR', 'MRT');
1057 INSERT INTO `geo_country_reference` VALUES (136, 'Mauritius', 'MU', 'MUS');
1058 INSERT INTO `geo_country_reference` VALUES (137, 'Mayotte', 'YT', 'MYT');
1059 INSERT INTO `geo_country_reference` VALUES (138, 'Mexico', 'MX', 'MEX');
1060 INSERT INTO `geo_country_reference` VALUES (139, 'Micronesia, Federated States of', 'FM', 'FSM');
1061 INSERT INTO `geo_country_reference` VALUES (140, 'Moldova, Republic of', 'MD', 'MDA');
1062 INSERT INTO `geo_country_reference` VALUES (141, 'Monaco', 'MC', 'MCO');
1063 INSERT INTO `geo_country_reference` VALUES (142, 'Mongolia', 'MN', 'MNG');
1064 INSERT INTO `geo_country_reference` VALUES (143, 'Montserrat', 'MS', 'MSR');
1065 INSERT INTO `geo_country_reference` VALUES (144, 'Morocco', 'MA', 'MAR');
1066 INSERT INTO `geo_country_reference` VALUES (145, 'Mozambique', 'MZ', 'MOZ');
1067 INSERT INTO `geo_country_reference` VALUES (146, 'Myanmar', 'MM', 'MMR');
1068 INSERT INTO `geo_country_reference` VALUES (147, 'Namibia', 'NA', 'NAM');
1069 INSERT INTO `geo_country_reference` VALUES (148, 'Nauru', 'NR', 'NRU');
1070 INSERT INTO `geo_country_reference` VALUES (149, 'Nepal', 'NP', 'NPL');
1071 INSERT INTO `geo_country_reference` VALUES (150, 'Netherlands', 'NL', 'NLD');
1072 INSERT INTO `geo_country_reference` VALUES (151, 'Netherlands Antilles', 'AN', 'ANT');
1073 INSERT INTO `geo_country_reference` VALUES (152, 'New Caledonia', 'NC', 'NCL');
1074 INSERT INTO `geo_country_reference` VALUES (153, 'New Zealand', 'NZ', 'NZL');
1075 INSERT INTO `geo_country_reference` VALUES (154, 'Nicaragua', 'NI', 'NIC');
1076 INSERT INTO `geo_country_reference` VALUES (155, 'Niger', 'NE', 'NER');
1077 INSERT INTO `geo_country_reference` VALUES (156, 'Nigeria', 'NG', 'NGA');
1078 INSERT INTO `geo_country_reference` VALUES (157, 'Niue', 'NU', 'NIU');
1079 INSERT INTO `geo_country_reference` VALUES (158, 'Norfolk Island', 'NF', 'NFK');
1080 INSERT INTO `geo_country_reference` VALUES (159, 'Northern Mariana Islands', 'MP', 'MNP');
1081 INSERT INTO `geo_country_reference` VALUES (160, 'Norway', 'NO', 'NOR');
1082 INSERT INTO `geo_country_reference` VALUES (161, 'Oman', 'OM', 'OMN');
1083 INSERT INTO `geo_country_reference` VALUES (162, 'Pakistan', 'PK', 'PAK');
1084 INSERT INTO `geo_country_reference` VALUES (163, 'Palau', 'PW', 'PLW');
1085 INSERT INTO `geo_country_reference` VALUES (164, 'Panama', 'PA', 'PAN');
1086 INSERT INTO `geo_country_reference` VALUES (165, 'Papua New Guinea', 'PG', 'PNG');
1087 INSERT INTO `geo_country_reference` VALUES (166, 'Paraguay', 'PY', 'PRY');
1088 INSERT INTO `geo_country_reference` VALUES (167, 'Peru', 'PE', 'PER');
1089 INSERT INTO `geo_country_reference` VALUES (168, 'Philippines', 'PH', 'PHL');
1090 INSERT INTO `geo_country_reference` VALUES (169, 'Pitcairn', 'PN', 'PCN');
1091 INSERT INTO `geo_country_reference` VALUES (170, 'Poland', 'PL', 'POL');
1092 INSERT INTO `geo_country_reference` VALUES (171, 'Portugal', 'PT', 'PRT');
1093 INSERT INTO `geo_country_reference` VALUES (172, 'Puerto Rico', 'PR', 'PRI');
1094 INSERT INTO `geo_country_reference` VALUES (173, 'Qatar', 'QA', 'QAT');
1095 INSERT INTO `geo_country_reference` VALUES (174, 'Reunion', 'RE', 'REU');
1096 INSERT INTO `geo_country_reference` VALUES (175, 'Romania', 'RO', 'ROM');
1097 INSERT INTO `geo_country_reference` VALUES (176, 'Russian Federation', 'RU', 'RUS');
1098 INSERT INTO `geo_country_reference` VALUES (177, 'Rwanda', 'RW', 'RWA');
1099 INSERT INTO `geo_country_reference` VALUES (178, 'Saint Kitts and Nevis', 'KN', 'KNA');
1100 INSERT INTO `geo_country_reference` VALUES (179, 'Saint Lucia', 'LC', 'LCA');
1101 INSERT INTO `geo_country_reference` VALUES (180, 'Saint Vincent and the Grenadines', 'VC', 'VCT');
1102 INSERT INTO `geo_country_reference` VALUES (181, 'Samoa', 'WS', 'WSM');
1103 INSERT INTO `geo_country_reference` VALUES (182, 'San Marino', 'SM', 'SMR');
1104 INSERT INTO `geo_country_reference` VALUES (183, 'Sao Tome and Principe', 'ST', 'STP');
1105 INSERT INTO `geo_country_reference` VALUES (184, 'Saudi Arabia', 'SA', 'SAU');
1106 INSERT INTO `geo_country_reference` VALUES (185, 'Senegal', 'SN', 'SEN');
1107 INSERT INTO `geo_country_reference` VALUES (186, 'Seychelles', 'SC', 'SYC');
1108 INSERT INTO `geo_country_reference` VALUES (187, 'Sierra Leone', 'SL', 'SLE');
1109 INSERT INTO `geo_country_reference` VALUES (188, 'Singapore', 'SG', 'SGP');
1110 INSERT INTO `geo_country_reference` VALUES (189, 'Slovakia (Slovak Republic)', 'SK', 'SVK');
1111 INSERT INTO `geo_country_reference` VALUES (190, 'Slovenia', 'SI', 'SVN');
1112 INSERT INTO `geo_country_reference` VALUES (191, 'Solomon Islands', 'SB', 'SLB');
1113 INSERT INTO `geo_country_reference` VALUES (192, 'Somalia', 'SO', 'SOM');
1114 INSERT INTO `geo_country_reference` VALUES (193, 'south Africa', 'ZA', 'ZAF');
1115 INSERT INTO `geo_country_reference` VALUES (194, 'South Georgia and the South Sandwich Islands', 'GS', 'SGS');
1116 INSERT INTO `geo_country_reference` VALUES (195, 'Spain', 'ES', 'ESP');
1117 INSERT INTO `geo_country_reference` VALUES (196, 'Sri Lanka', 'LK', 'LKA');
1118 INSERT INTO `geo_country_reference` VALUES (197, 'St. Helena', 'SH', 'SHN');
1119 INSERT INTO `geo_country_reference` VALUES (198, 'St. Pierre and Miquelon', 'PM', 'SPM');
1120 INSERT INTO `geo_country_reference` VALUES (199, 'Sudan', 'SD', 'SDN');
1121 INSERT INTO `geo_country_reference` VALUES (200, 'Suriname', 'SR', 'SUR');
1122 INSERT INTO `geo_country_reference` VALUES (201, 'Svalbard and Jan Mayen Islands', 'SJ', 'SJM');
1123 INSERT INTO `geo_country_reference` VALUES (202, 'Swaziland', 'SZ', 'SWZ');
1124 INSERT INTO `geo_country_reference` VALUES (203, 'Sweden', 'SE', 'SWE');
1125 INSERT INTO `geo_country_reference` VALUES (204, 'Switzerland', 'CH', 'CHE');
1126 INSERT INTO `geo_country_reference` VALUES (205, 'Syrian Arab Republic', 'SY', 'SYR');
1127 INSERT INTO `geo_country_reference` VALUES (206, 'Taiwan, Province of China', 'TW', 'TWN');
1128 INSERT INTO `geo_country_reference` VALUES (207, 'Tajikistan', 'TJ', 'TJK');
1129 INSERT INTO `geo_country_reference` VALUES (208, 'Tanzania, United Republic of', 'TZ', 'TZA');
1130 INSERT INTO `geo_country_reference` VALUES (209, 'Thailand', 'TH', 'THA');
1131 INSERT INTO `geo_country_reference` VALUES (210, 'Togo', 'TG', 'TGO');
1132 INSERT INTO `geo_country_reference` VALUES (211, 'Tokelau', 'TK', 'TKL');
1133 INSERT INTO `geo_country_reference` VALUES (212, 'Tonga', 'TO', 'TON');
1134 INSERT INTO `geo_country_reference` VALUES (213, 'Trinidad and Tobago', 'TT', 'TTO');
1135 INSERT INTO `geo_country_reference` VALUES (214, 'Tunisia', 'TN', 'TUN');
1136 INSERT INTO `geo_country_reference` VALUES (215, 'Turkey', 'TR', 'TUR');
1137 INSERT INTO `geo_country_reference` VALUES (216, 'Turkmenistan', 'TM', 'TKM');
1138 INSERT INTO `geo_country_reference` VALUES (217, 'Turks and Caicos Islands', 'TC', 'TCA');
1139 INSERT INTO `geo_country_reference` VALUES (218, 'Tuvalu', 'TV', 'TUV');
1140 INSERT INTO `geo_country_reference` VALUES (219, 'Uganda', 'UG', 'UGA');
1141 INSERT INTO `geo_country_reference` VALUES (220, 'Ukraine', 'UA', 'UKR');
1142 INSERT INTO `geo_country_reference` VALUES (221, 'United Arab Emirates', 'AE', 'ARE');
1143 INSERT INTO `geo_country_reference` VALUES (222, 'United Kingdom', 'GB', 'GBR');
1144 INSERT INTO `geo_country_reference` VALUES (223, 'United States', 'US', 'USA');
1145 INSERT INTO `geo_country_reference` VALUES (224, 'United States Minor Outlying Islands', 'UM', 'UMI');
1146 INSERT INTO `geo_country_reference` VALUES (225, 'Uruguay', 'UY', 'URY');
1147 INSERT INTO `geo_country_reference` VALUES (226, 'Uzbekistan', 'UZ', 'UZB');
1148 INSERT INTO `geo_country_reference` VALUES (227, 'Vanuatu', 'VU', 'VUT');
1149 INSERT INTO `geo_country_reference` VALUES (228, 'Vatican City State (Holy See)', 'VA', 'VAT');
1150 INSERT INTO `geo_country_reference` VALUES (229, 'Venezuela', 'VE', 'VEN');
1151 INSERT INTO `geo_country_reference` VALUES (230, 'Viet Nam', 'VN', 'VNM');
1152 INSERT INTO `geo_country_reference` VALUES (231, 'Virgin Islands (British)', 'VG', 'VGB');
1153 INSERT INTO `geo_country_reference` VALUES (232, 'Virgin Islands (U.S.)', 'VI', 'VIR');
1154 INSERT INTO `geo_country_reference` VALUES (233, 'Wallis and Futuna Islands', 'WF', 'WLF');
1155 INSERT INTO `geo_country_reference` VALUES (234, 'Western Sahara', 'EH', 'ESH');
1156 INSERT INTO `geo_country_reference` VALUES (235, 'Yemen', 'YE', 'YEM');
1157 INSERT INTO `geo_country_reference` VALUES (236, 'Yugoslavia', 'YU', 'YUG');
1158 INSERT INTO `geo_country_reference` VALUES (237, 'Zaire', 'ZR', 'ZAR');
1159 INSERT INTO `geo_country_reference` VALUES (238, 'Zambia', 'ZM', 'ZMB');
1160 INSERT INTO `geo_country_reference` VALUES (239, 'Zimbabwe', 'ZW', 'ZWE');
1162 -- --------------------------------------------------------
1164 -- 
1165 -- Table structure for table `geo_zone_reference`
1166 -- 
1168 DROP TABLE IF EXISTS `geo_zone_reference`;
1169 CREATE TABLE `geo_zone_reference` (
1170   `zone_id` int(5) NOT NULL auto_increment,
1171   `zone_country_id` int(5) NOT NULL default '0',
1172   `zone_code` varchar(5) default NULL,
1173   `zone_name` varchar(32) default NULL,
1174   PRIMARY KEY  (`zone_id`)
1175 ) ENGINE=MyISAM AUTO_INCREMENT=83 ;
1177 -- 
1178 -- Dumping data for table `geo_zone_reference`
1179 -- 
1181 INSERT INTO `geo_zone_reference` VALUES (1, 223, 'AL', 'Alabama');
1182 INSERT INTO `geo_zone_reference` VALUES (2, 223, 'AK', 'Alaska');
1183 INSERT INTO `geo_zone_reference` VALUES (3, 223, 'AS', 'American Samoa');
1184 INSERT INTO `geo_zone_reference` VALUES (4, 223, 'AZ', 'Arizona');
1185 INSERT INTO `geo_zone_reference` VALUES (5, 223, 'AR', 'Arkansas');
1186 INSERT INTO `geo_zone_reference` VALUES (6, 223, 'AF', 'Armed Forces Africa');
1187 INSERT INTO `geo_zone_reference` VALUES (7, 223, 'AA', 'Armed Forces Americas');
1188 INSERT INTO `geo_zone_reference` VALUES (8, 223, 'AC', 'Armed Forces Canada');
1189 INSERT INTO `geo_zone_reference` VALUES (9, 223, 'AE', 'Armed Forces Europe');
1190 INSERT INTO `geo_zone_reference` VALUES (10, 223, 'AM', 'Armed Forces Middle East');
1191 INSERT INTO `geo_zone_reference` VALUES (11, 223, 'AP', 'Armed Forces Pacific');
1192 INSERT INTO `geo_zone_reference` VALUES (12, 223, 'CA', 'California');
1193 INSERT INTO `geo_zone_reference` VALUES (13, 223, 'CO', 'Colorado');
1194 INSERT INTO `geo_zone_reference` VALUES (14, 223, 'CT', 'Connecticut');
1195 INSERT INTO `geo_zone_reference` VALUES (15, 223, 'DE', 'Delaware');
1196 INSERT INTO `geo_zone_reference` VALUES (16, 223, 'DC', 'District of Columbia');
1197 INSERT INTO `geo_zone_reference` VALUES (17, 223, 'FM', 'Federated States Of Micronesia');
1198 INSERT INTO `geo_zone_reference` VALUES (18, 223, 'FL', 'Florida');
1199 INSERT INTO `geo_zone_reference` VALUES (19, 223, 'GA', 'Georgia');
1200 INSERT INTO `geo_zone_reference` VALUES (20, 223, 'GU', 'Guam');
1201 INSERT INTO `geo_zone_reference` VALUES (21, 223, 'HI', 'Hawaii');
1202 INSERT INTO `geo_zone_reference` VALUES (22, 223, 'ID', 'Idaho');
1203 INSERT INTO `geo_zone_reference` VALUES (23, 223, 'IL', 'Illinois');
1204 INSERT INTO `geo_zone_reference` VALUES (24, 223, 'IN', 'Indiana');
1205 INSERT INTO `geo_zone_reference` VALUES (25, 223, 'IA', 'Iowa');
1206 INSERT INTO `geo_zone_reference` VALUES (26, 223, 'KS', 'Kansas');
1207 INSERT INTO `geo_zone_reference` VALUES (27, 223, 'KY', 'Kentucky');
1208 INSERT INTO `geo_zone_reference` VALUES (28, 223, 'LA', 'Louisiana');
1209 INSERT INTO `geo_zone_reference` VALUES (29, 223, 'ME', 'Maine');
1210 INSERT INTO `geo_zone_reference` VALUES (30, 223, 'MH', 'Marshall Islands');
1211 INSERT INTO `geo_zone_reference` VALUES (31, 223, 'MD', 'Maryland');
1212 INSERT INTO `geo_zone_reference` VALUES (32, 223, 'MA', 'Massachusetts');
1213 INSERT INTO `geo_zone_reference` VALUES (33, 223, 'MI', 'Michigan');
1214 INSERT INTO `geo_zone_reference` VALUES (34, 223, 'MN', 'Minnesota');
1215 INSERT INTO `geo_zone_reference` VALUES (35, 223, 'MS', 'Mississippi');
1216 INSERT INTO `geo_zone_reference` VALUES (36, 223, 'MO', 'Missouri');
1217 INSERT INTO `geo_zone_reference` VALUES (37, 223, 'MT', 'Montana');
1218 INSERT INTO `geo_zone_reference` VALUES (38, 223, 'NE', 'Nebraska');
1219 INSERT INTO `geo_zone_reference` VALUES (39, 223, 'NV', 'Nevada');
1220 INSERT INTO `geo_zone_reference` VALUES (40, 223, 'NH', 'New Hampshire');
1221 INSERT INTO `geo_zone_reference` VALUES (41, 223, 'NJ', 'New Jersey');
1222 INSERT INTO `geo_zone_reference` VALUES (42, 223, 'NM', 'New Mexico');
1223 INSERT INTO `geo_zone_reference` VALUES (43, 223, 'NY', 'New York');
1224 INSERT INTO `geo_zone_reference` VALUES (44, 223, 'NC', 'North Carolina');
1225 INSERT INTO `geo_zone_reference` VALUES (45, 223, 'ND', 'North Dakota');
1226 INSERT INTO `geo_zone_reference` VALUES (46, 223, 'MP', 'Northern Mariana Islands');
1227 INSERT INTO `geo_zone_reference` VALUES (47, 223, 'OH', 'Ohio');
1228 INSERT INTO `geo_zone_reference` VALUES (48, 223, 'OK', 'Oklahoma');
1229 INSERT INTO `geo_zone_reference` VALUES (49, 223, 'OR', 'Oregon');
1230 INSERT INTO `geo_zone_reference` VALUES (50, 223, 'PW', 'Palau');
1231 INSERT INTO `geo_zone_reference` VALUES (51, 223, 'PA', 'Pennsylvania');
1232 INSERT INTO `geo_zone_reference` VALUES (52, 223, 'PR', 'Puerto Rico');
1233 INSERT INTO `geo_zone_reference` VALUES (53, 223, 'RI', 'Rhode Island');
1234 INSERT INTO `geo_zone_reference` VALUES (54, 223, 'SC', 'South Carolina');
1235 INSERT INTO `geo_zone_reference` VALUES (55, 223, 'SD', 'South Dakota');
1236 INSERT INTO `geo_zone_reference` VALUES (56, 223, 'TN', 'Tenessee');
1237 INSERT INTO `geo_zone_reference` VALUES (57, 223, 'TX', 'Texas');
1238 INSERT INTO `geo_zone_reference` VALUES (58, 223, 'UT', 'Utah');
1239 INSERT INTO `geo_zone_reference` VALUES (59, 223, 'VT', 'Vermont');
1240 INSERT INTO `geo_zone_reference` VALUES (60, 223, 'VI', 'Virgin Islands');
1241 INSERT INTO `geo_zone_reference` VALUES (61, 223, 'VA', 'Virginia');
1242 INSERT INTO `geo_zone_reference` VALUES (62, 223, 'WA', 'Washington');
1243 INSERT INTO `geo_zone_reference` VALUES (63, 223, 'WV', 'West Virginia');
1244 INSERT INTO `geo_zone_reference` VALUES (64, 223, 'WI', 'Wisconsin');
1245 INSERT INTO `geo_zone_reference` VALUES (65, 223, 'WY', 'Wyoming');
1246 INSERT INTO `geo_zone_reference` VALUES (66, 38, 'AB', 'Alberta');
1247 INSERT INTO `geo_zone_reference` VALUES (67, 38, 'BC', 'British Columbia');
1248 INSERT INTO `geo_zone_reference` VALUES (68, 38, 'MB', 'Manitoba');
1249 INSERT INTO `geo_zone_reference` VALUES (69, 38, 'NF', 'Newfoundland');
1250 INSERT INTO `geo_zone_reference` VALUES (70, 38, 'NB', 'New Brunswick');
1251 INSERT INTO `geo_zone_reference` VALUES (71, 38, 'NS', 'Nova Scotia');
1252 INSERT INTO `geo_zone_reference` VALUES (72, 38, 'NT', 'Northwest Territories');
1253 INSERT INTO `geo_zone_reference` VALUES (73, 38, 'NU', 'Nunavut');
1254 INSERT INTO `geo_zone_reference` VALUES (74, 38, 'ON', 'Ontario');
1255 INSERT INTO `geo_zone_reference` VALUES (75, 38, 'PE', 'Prince Edward Island');
1256 INSERT INTO `geo_zone_reference` VALUES (76, 38, 'QC', 'Quebec');
1257 INSERT INTO `geo_zone_reference` VALUES (77, 38, 'SK', 'Saskatchewan');
1258 INSERT INTO `geo_zone_reference` VALUES (78, 38, 'YT', 'Yukon Territory');
1259 INSERT INTO `geo_zone_reference` VALUES (79, 61, 'QLD', 'Queensland');
1260 INSERT INTO `geo_zone_reference` VALUES (80, 61, 'SA', 'South Australia');
1261 INSERT INTO `geo_zone_reference` VALUES (81, 61, 'ACT', 'Australian Capital Territory');
1262 INSERT INTO `geo_zone_reference` VALUES (82, 61, 'VIC', 'Victoria');
1264 -- --------------------------------------------------------
1266 -- 
1267 -- Table structure for table `groups`
1268 -- 
1270 DROP TABLE IF EXISTS `groups`;
1271 CREATE TABLE `groups` (
1272   `id` bigint(20) NOT NULL auto_increment,
1273   `name` longtext,
1274   `user` longtext,
1275   PRIMARY KEY  (`id`)
1276 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1278 -- --------------------------------------------------------
1280 -- 
1281 -- Table structure for table `history_data`
1282 -- 
1284 DROP TABLE IF EXISTS `history_data`;
1285 CREATE TABLE `history_data` (
1286   `id` bigint(20) NOT NULL auto_increment,
1287   `coffee` longtext,
1288   `tobacco` longtext,
1289   `alcohol` longtext,
1290   `sleep_patterns` longtext,
1291   `exercise_patterns` longtext,
1292   `seatbelt_use` longtext,
1293   `counseling` longtext,
1294   `hazardous_activities` longtext,
1295   `recreational_drugs` longtext,
1296   `last_breast_exam` varchar(255) default NULL,
1297   `last_mammogram` varchar(255) default NULL,
1298   `last_gynocological_exam` varchar(255) default NULL,
1299   `last_rectal_exam` varchar(255) default NULL,
1300   `last_prostate_exam` varchar(255) default NULL,
1301   `last_physical_exam` varchar(255) default NULL,
1302   `last_sigmoidoscopy_colonoscopy` varchar(255) default NULL,
1303   `last_ecg` varchar(255) default NULL,
1304   `last_cardiac_echo` varchar(255) default NULL,
1305   `last_retinal` varchar(255) default NULL,
1306   `last_fluvax` varchar(255) default NULL,
1307   `last_pneuvax` varchar(255) default NULL,
1308   `last_ldl` varchar(255) default NULL,
1309   `last_hemoglobin` varchar(255) default NULL,
1310   `last_psa` varchar(255) default NULL,
1311   `last_exam_results` varchar(255) default NULL,
1312   `history_mother` longtext,
1313   `history_father` longtext,
1314   `history_siblings` longtext,
1315   `history_offspring` longtext,
1316   `history_spouse` longtext,
1317   `relatives_cancer` longtext,
1318   `relatives_tuberculosis` longtext,
1319   `relatives_diabetes` longtext,
1320   `relatives_high_blood_pressure` longtext,
1321   `relatives_heart_problems` longtext,
1322   `relatives_stroke` longtext,
1323   `relatives_epilepsy` longtext,
1324   `relatives_mental_illness` longtext,
1325   `relatives_suicide` longtext,
1326   `cataract_surgery` datetime default NULL,
1327   `tonsillectomy` datetime default NULL,
1328   `cholecystestomy` datetime default NULL,
1329   `heart_surgery` datetime default NULL,
1330   `hysterectomy` datetime default NULL,
1331   `hernia_repair` datetime default NULL,
1332   `hip_replacement` datetime default NULL,
1333   `knee_replacement` datetime default NULL,
1334   `appendectomy` datetime default NULL,
1335   `date` datetime default NULL,
1336   `pid` bigint(20) NOT NULL default '0',
1337   `name_1` varchar(255) default NULL,
1338   `value_1` varchar(255) default NULL,
1339   `name_2` varchar(255) default NULL,
1340   `value_2` varchar(255) default NULL,
1341   `additional_history` text,
1342   `exams`      text         NOT NULL DEFAULT '',
1343   `usertext11` varchar(255) NOT NULL DEFAULT '',
1344   `usertext12` varchar(255) NOT NULL DEFAULT '',
1345   `usertext13` varchar(255) NOT NULL DEFAULT '',
1346   `usertext14` varchar(255) NOT NULL DEFAULT '',
1347   `usertext15` varchar(255) NOT NULL DEFAULT '',
1348   `usertext16` varchar(255) NOT NULL DEFAULT '',
1349   `usertext17` varchar(255) NOT NULL DEFAULT '',
1350   `usertext18` varchar(255) NOT NULL DEFAULT '',
1351   `usertext19` varchar(255) NOT NULL DEFAULT '',
1352   `usertext20` varchar(255) NOT NULL DEFAULT '',
1353   `usertext21` varchar(255) NOT NULL DEFAULT '',
1354   `usertext22` varchar(255) NOT NULL DEFAULT '',
1355   `usertext23` varchar(255) NOT NULL DEFAULT '',
1356   `usertext24` varchar(255) NOT NULL DEFAULT '',
1357   `usertext25` varchar(255) NOT NULL DEFAULT '',
1358   `usertext26` varchar(255) NOT NULL DEFAULT '',
1359   `usertext27` varchar(255) NOT NULL DEFAULT '',
1360   `usertext28` varchar(255) NOT NULL DEFAULT '',
1361   `usertext29` varchar(255) NOT NULL DEFAULT '',
1362   `usertext30` varchar(255) NOT NULL DEFAULT '',
1363   `userdate11` date DEFAULT NULL,
1364   `userdate12` date DEFAULT NULL,
1365   `userdate13` date DEFAULT NULL,
1366   `userdate14` date DEFAULT NULL,
1367   `userdate15` date DEFAULT NULL,
1368   `userarea11` text NOT NULL DEFAULT '',
1369   `userarea12` text NOT NULL DEFAULT '',
1370   PRIMARY KEY  (`id`),
1371   KEY `pid` (`pid`)
1372 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1374 -- --------------------------------------------------------
1376 -- 
1377 -- Table structure for table `immunizations`
1378 -- 
1380 DROP TABLE IF EXISTS `immunizations`;
1381 CREATE TABLE `immunizations` (
1382   `id` bigint(20) NOT NULL auto_increment,
1383   `patient_id` int(11) default NULL,
1384   `administered_date` date default NULL,
1385   `immunization_id` int(11) default NULL,
1386   `manufacturer` varchar(100) default NULL,
1387   `lot_number` varchar(50) default NULL,
1388   `administered_by_id` bigint(20) default NULL,
1389   `administered_by` VARCHAR( 255 ) default NULL COMMENT 'Alternative to administered_by_id',
1390   `education_date` date default NULL,
1391   `vis_date` date default NULL COMMENT 'Date of VIS Statement', 
1392   `note` text,
1393   `create_date` datetime default NULL,
1394   `update_date` timestamp NOT NULL,
1395   `created_by` bigint(20) default NULL,
1396   `updated_by` bigint(20) default NULL,
1397   `facility_id` int(11) NOT NULL default '0',
1398   `phone_num` varchar(255) NOT NULL default '',
1399   `injection_site` varchar(255) NOT NULL default '',
1400   PRIMARY KEY  (`id`)
1401 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1403 -- --------------------------------------------------------
1405 -- 
1406 -- Table structure for table `insurance_companies`
1407 -- 
1409 DROP TABLE IF EXISTS `insurance_companies`;
1410 CREATE TABLE `insurance_companies` (
1411   `id` int(11) NOT NULL default '0',
1412   `name` varchar(255) default NULL,
1413   `attn` varchar(255) default NULL,
1414   `cms_id` varchar(15) default NULL,
1415   `freeb_type` tinyint(2) default NULL,
1416   `x12_receiver_id` varchar(25) default NULL,
1417   `x12_default_partner_id` int(11) default NULL,
1418   `alt_cms_id` varchar(15) NOT NULL DEFAULT '',
1419   PRIMARY KEY  (`id`)
1420 ) ENGINE=MyISAM;
1422 -- --------------------------------------------------------
1424 -- 
1425 -- Table structure for table `insurance_data`
1426 -- 
1428 DROP TABLE IF EXISTS `insurance_data`;
1429 CREATE TABLE `insurance_data` (
1430   `id` bigint(20) NOT NULL auto_increment,
1431   `type` enum('primary','secondary','tertiary') default NULL,
1432   `provider` varchar(255) default NULL,
1433   `plan_name` varchar(255) default NULL,
1434   `policy_number` varchar(255) default NULL,
1435   `group_number` varchar(255) default NULL,
1436   `subscriber_lname` varchar(255) default NULL,
1437   `subscriber_mname` varchar(255) default NULL,
1438   `subscriber_fname` varchar(255) default NULL,
1439   `subscriber_relationship` varchar(255) default NULL,
1440   `subscriber_ss` varchar(255) default NULL,
1441   `subscriber_DOB` date default NULL,
1442   `subscriber_street` varchar(255) default NULL,
1443   `subscriber_postal_code` varchar(255) default NULL,
1444   `subscriber_city` varchar(255) default NULL,
1445   `subscriber_state` varchar(255) default NULL,
1446   `subscriber_country` varchar(255) default NULL,
1447   `subscriber_phone` varchar(255) default NULL,
1448   `subscriber_employer` varchar(255) default NULL,
1449   `subscriber_employer_street` varchar(255) default NULL,
1450   `subscriber_employer_postal_code` varchar(255) default NULL,
1451   `subscriber_employer_state` varchar(255) default NULL,
1452   `subscriber_employer_country` varchar(255) default NULL,
1453   `subscriber_employer_city` varchar(255) default NULL,
1454   `copay` varchar(255) default NULL,
1455   `date` date NOT NULL default '0000-00-00',
1456   `pid` bigint(20) NOT NULL default '0',
1457   `subscriber_sex` varchar(25) default NULL,
1458   `accept_assignment` varchar(5) NOT NULL DEFAULT 'TRUE',
1459   PRIMARY KEY  (`id`),
1460   UNIQUE KEY `pid_type_date` (`pid`,`type`,`date`)
1461 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1463 -- --------------------------------------------------------
1465 -- 
1466 -- Table structure for table `insurance_numbers`
1467 -- 
1469 DROP TABLE IF EXISTS `insurance_numbers`;
1470 CREATE TABLE `insurance_numbers` (
1471   `id` int(11) NOT NULL default '0',
1472   `provider_id` int(11) NOT NULL default '0',
1473   `insurance_company_id` int(11) default NULL,
1474   `provider_number` varchar(20) default NULL,
1475   `rendering_provider_number` varchar(20) default NULL,
1476   `group_number` varchar(20) default NULL,
1477   `provider_number_type` varchar(4) default NULL,
1478   `rendering_provider_number_type` varchar(4) default NULL,
1479   PRIMARY KEY  (`id`)
1480 ) ENGINE=MyISAM;
1482 -- --------------------------------------------------------
1484 -- 
1485 -- Table structure for table `integration_mapping`
1486 -- 
1488 DROP TABLE IF EXISTS `integration_mapping`;
1489 CREATE TABLE `integration_mapping` (
1490   `id` int(11) NOT NULL default '0',
1491   `foreign_id` int(11) NOT NULL default '0',
1492   `foreign_table` varchar(125) default NULL,
1493   `local_id` int(11) NOT NULL default '0',
1494   `local_table` varchar(125) default NULL,
1495   PRIMARY KEY  (`id`),
1496   UNIQUE KEY `foreign_id` (`foreign_id`,`foreign_table`,`local_id`,`local_table`)
1497 ) ENGINE=MyISAM;
1499 -- --------------------------------------------------------
1501 -- 
1502 -- Table structure for table `issue_encounter`
1503 -- 
1505 DROP TABLE IF EXISTS `issue_encounter`;
1506 CREATE TABLE `issue_encounter` (
1507   `pid` int(11) NOT NULL,
1508   `list_id` int(11) NOT NULL,
1509   `encounter` int(11) NOT NULL,
1510   `resolved` tinyint(1) NOT NULL,
1511   PRIMARY KEY  (`pid`,`list_id`,`encounter`)
1512 ) ENGINE=MyISAM;
1514 -- --------------------------------------------------------
1516 -- 
1517 -- Table structure for table `lang_constants`
1518 -- 
1520 DROP TABLE IF EXISTS `lang_constants`;
1521 CREATE TABLE `lang_constants` (
1522   `cons_id` int(11) NOT NULL auto_increment,
1523   `constant_name` varchar(255) BINARY default NULL,
1524   UNIQUE KEY `cons_id` (`cons_id`),
1525   KEY `constant_name` (`constant_name`)
1526 ) ENGINE=MyISAM ;
1528 -- 
1529 -- Table structure for table `lang_definitions`
1530 -- 
1532 DROP TABLE IF EXISTS `lang_definitions`;
1533 CREATE TABLE `lang_definitions` (
1534   `def_id` int(11) NOT NULL auto_increment,
1535   `cons_id` int(11) NOT NULL default '0',
1536   `lang_id` int(11) NOT NULL default '0',
1537   `definition` mediumtext,
1538   UNIQUE KEY `def_id` (`def_id`),
1539   KEY `cons_id` (`cons_id`)
1540 ) ENGINE=MyISAM ;
1542 -- 
1543 -- Table structure for table `lang_languages`
1544 -- 
1546 DROP TABLE IF EXISTS `lang_languages`;
1547 CREATE TABLE `lang_languages` (
1548   `lang_id` int(11) NOT NULL auto_increment,
1549   `lang_code` char(2) NOT NULL default '',
1550   `lang_description` varchar(100) default NULL,
1551   UNIQUE KEY `lang_id` (`lang_id`)
1552 ) ENGINE=MyISAM AUTO_INCREMENT=2 ;
1554 -- 
1555 -- Dumping data for table `lang_languages`
1556 -- 
1558 INSERT INTO `lang_languages` VALUES (1, 'en', 'English');
1560 -- --------------------------------------------------------
1563 -- Table structure for table `lang_custom`
1566 DROP TABLE IF EXISTS `lang_custom`;
1567 CREATE TABLE `lang_custom` (
1568   `lang_description` varchar(100) NOT NULL default '',
1569   `lang_code` char(2) NOT NULL default '',
1570   `constant_name` varchar(255) NOT NULL default '',
1571   `definition` mediumtext NOT NULL default ''
1572 ) ENGINE=MyISAM ;
1574 -- --------------------------------------------------------
1576 -- 
1577 -- Table structure for table `layout_options`
1578 -- 
1580 DROP TABLE IF EXISTS `layout_options`;
1581 CREATE TABLE `layout_options` (
1582   `form_id` varchar(31) NOT NULL default '',
1583   `field_id` varchar(31) NOT NULL default '',
1584   `group_name` varchar(31) NOT NULL default '',
1585   `title` varchar(63) NOT NULL default '',
1586   `seq` int(11) NOT NULL default '0',
1587   `data_type` tinyint(3) NOT NULL default '0',
1588   `uor` tinyint(1) NOT NULL default '1',
1589   `fld_length` int(11) NOT NULL default '15',
1590   `max_length` int(11) NOT NULL default '0',
1591   `list_id` varchar(31) NOT NULL default '',
1592   `titlecols` tinyint(3) NOT NULL default '1',
1593   `datacols` tinyint(3) NOT NULL default '1',
1594   `default_value` varchar(255) NOT NULL default '',
1595   `edit_options` varchar(36) NOT NULL default '',
1596   `description` varchar(255) NOT NULL default '',
1597   PRIMARY KEY  (`form_id`,`field_id`,`seq`)
1598 ) ENGINE=MyISAM;
1600 -- 
1601 -- Dumping data for table `layout_options`
1602 -- 
1603 INSERT INTO `layout_options` VALUES ('DEM', 'title', '1Who', 'Name', 1, 1, 1, 0, 0, 'titles', 1, 1, '', 'N', 'Title');
1604 INSERT INTO `layout_options` VALUES ('DEM', 'fname', '1Who', '', 2, 2, 2, 10, 63, '', 0, 0, '', 'CD', 'First Name');
1605 INSERT INTO `layout_options` VALUES ('DEM', 'mname', '1Who', '', 3, 2, 1, 2, 63, '', 0, 0, '', 'C', 'Middle Name');
1606 INSERT INTO `layout_options` VALUES ('DEM', 'lname', '1Who', '', 4, 2, 2, 10, 63, '', 0, 0, '', 'CD', 'Last Name');
1607 INSERT INTO `layout_options` VALUES ('DEM', 'pubpid', '1Who', 'External ID', 5, 2, 1, 10, 15, '', 1, 1, '', 'ND', 'External identifier');
1608 INSERT INTO `layout_options` VALUES ('DEM', 'DOB', '1Who', 'DOB', 6, 4, 2, 10, 10, '', 1, 1, '', 'D', 'Date of Birth');
1609 INSERT INTO `layout_options` VALUES ('DEM', 'sex', '1Who', 'Sex', 7, 1, 2, 0, 0, 'sex', 1, 1, '', 'N', 'Sex');
1610 INSERT INTO `layout_options` VALUES ('DEM', 'ss', '1Who', 'S.S.', 8, 2, 1, 11, 11, '', 1, 1, '', '', 'Social Security Number');
1611 INSERT INTO `layout_options` VALUES ('DEM', 'drivers_license', '1Who', 'License/ID', 9, 2, 1, 15, 63, '', 1, 1, '', '', 'Drivers License or State ID');
1612 INSERT INTO `layout_options` VALUES ('DEM', 'status', '1Who', 'Marital Status', 10, 1, 1, 0, 0, 'marital', 1, 3, '', '', 'Marital Status');
1613 INSERT INTO `layout_options` VALUES ('DEM', 'genericname1', '1Who', 'User Defined', 11, 2, 1, 15, 63, '', 1, 3, '', '', 'User Defined Field');
1614 INSERT INTO `layout_options` VALUES ('DEM', 'genericval1', '1Who', '', 12, 2, 1, 15, 63, '', 0, 0, '', '', 'User Defined Field');
1615 INSERT INTO `layout_options` VALUES ('DEM', 'genericname2', '1Who', '', 13, 2, 1, 15, 63, '', 0, 0, '', '', 'User Defined Field');
1616 INSERT INTO `layout_options` VALUES ('DEM', 'genericval2', '1Who', '', 14, 2, 1, 15, 63, '', 0, 0, '', '', 'User Defined Field');
1617 INSERT INTO `layout_options` VALUES ('DEM', 'squad', '1Who', 'Squad', 15, 13, 0, 0, 0, '', 1, 3, '', '', 'Squad Membership');
1618 INSERT INTO `layout_options` VALUES ('DEM', 'pricelevel', '1Who', 'Price Level', 16, 1, 0, 0, 0, 'pricelevel', 1, 1, '', '', 'Discount Level');
1619 INSERT INTO `layout_options` VALUES ('DEM', 'street', '2Contact', 'Address', 1, 2, 1, 25, 63, '', 1, 1, '', 'C', 'Street and Number');
1620 INSERT INTO `layout_options` VALUES ('DEM', 'city', '2Contact', 'City', 2, 2, 1, 15, 63, '', 1, 1, '', 'C', 'City Name');
1621 INSERT INTO `layout_options` VALUES ('DEM', 'state', '2Contact', 'State', 3, 26, 1, 0, 0, 'state', 1, 1, '', '', 'State/Locality');
1622 INSERT INTO `layout_options` VALUES ('DEM', 'postal_code', '2Contact', 'Postal Code', 4, 2, 1, 6, 63, '', 1, 1, '', '', 'Postal Code');
1623 INSERT INTO `layout_options` VALUES ('DEM', 'country_code', '2Contact', 'Country', 5, 26, 1, 0, 0, 'country', 1, 1, '', '', 'Country');
1624 INSERT INTO `layout_options` VALUES ('DEM', 'mothersname', '2Contact', 'Mother''s Name', 6, 2, 1, 20, 63, '', 1, 1, '', '', '');
1625 INSERT INTO `layout_options` VALUES ('DEM', 'guardiansname', '2Contact', 'Guardian''s Name', 7, 2, 1, 20, 63, '', 1, 1, '', '', '');
1626 INSERT INTO `layout_options` VALUES ('DEM', 'contact_relationship', '2Contact', 'Emergency Contact', 8, 2, 1, 10, 63, '', 1, 1, '', 'C', 'Emergency Contact Person');
1627 INSERT INTO `layout_options` VALUES ('DEM', 'phone_contact', '2Contact', 'Emergency Phone', 9, 2, 1, 20, 63, '', 1, 1, '', 'P', 'Emergency Contact Phone Number');
1628 INSERT INTO `layout_options` VALUES ('DEM', 'phone_home', '2Contact', 'Home Phone', 10, 2, 1, 20, 63, '', 1, 1, '', 'P', 'Home Phone Number');
1629 INSERT INTO `layout_options` VALUES ('DEM', 'phone_biz', '2Contact', 'Work Phone', 11, 2, 1, 20, 63, '', 1, 1, '', 'P', 'Work Phone Number');
1630 INSERT INTO `layout_options` VALUES ('DEM', 'phone_cell', '2Contact', 'Mobile Phone', 12, 2, 1, 20, 63, '', 1, 1, '', 'P', 'Cell Phone Number');
1631 INSERT INTO `layout_options` VALUES ('DEM', 'email', '2Contact', 'Contact Email', 13, 2, 1, 30, 9, '', 1, 1, '', '', 'Contact Email Address');
1632 INSERT INTO `layout_options` VALUES ('DEM', 'providerID', '3Choices', 'Provider', 1, 11, 1, 0, 0, '', 1, 3, '', '', 'Referring Provider');
1633 INSERT INTO `layout_options` VALUES ('DEM', 'pharmacy_id', '3Choices', 'Pharmacy', 2, 12, 1, 0, 0, '', 1, 3, '', '', 'Preferred Pharmacy');
1634 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?');
1635 INSERT INTO `layout_options` VALUES ('DEM', 'hipaa_voice', '3Choices', 'Allow Voice Message', 4, 1, 1, 0, 0, 'yesno', 1, 1, '', '', 'Allow telephone messages?');
1636 INSERT INTO `layout_options` VALUES ('DEM', 'hipaa_message', '3Choices', 'Leave Message With', 5, 2, 1, 20, 63, '', 1, 1, '', '', 'With whom may we leave a message?');
1637 INSERT INTO `layout_options` VALUES ('DEM', 'hipaa_mail', '3Choices', 'Allow Mail Message', 6, 1, 1, 0, 0, 'yesno', 1, 1, '', '', 'Allow email messages?');
1638 INSERT INTO `layout_options` VALUES ('DEM', 'hipaa_allowsms'  , '3Choices', 'Allow SMS'  , 7, 1, 1, 0, 0, 'yesno', 1, 1, '', '', 'Allow SMS (text messages)?');
1639 INSERT INTO `layout_options` VALUES ('DEM', 'hipaa_allowemail', '3Choices', 'Allow Email', 8, 1, 1, 0, 0, 'yesno', 1, 1, '', '', 'Allow Email?');
1641 INSERT INTO `layout_options` VALUES ('DEM', 'allow_imm_reg_use', '3Choices', 'Allow Immunization Registry Use', 9, 1, 1, 0, 0, 'yesno', 1, 1, '', '', '');
1642 INSERT INTO `layout_options` VALUES ('DEM', 'allow_imm_info_share', '3Choices', 'Allow Immunization Info Sharing', 10, 1, 1, 0, 0, 'yesno', 1, 1, '', '', '');
1643 INSERT INTO `layout_options` VALUES ('DEM', 'allow_health_info_ex', '3Choices', 'Allow Health Information Exchange', 11, 1, 1, 0, 0, 'yesno', 1, 1, '', '', '');
1644 INSERT INTO `layout_options` VALUES ('DEM', 'occupation', '4Employer', 'Occupation', 1, 2, 1, 20, 63, '', 1, 1, '', 'C', 'Occupation');
1645 INSERT INTO `layout_options` VALUES ('DEM', 'em_name', '4Employer', 'Employer Name', 2, 2, 1, 20, 63, '', 1, 1, '', 'C', 'Employer Name');
1646 INSERT INTO `layout_options` VALUES ('DEM', 'em_street', '4Employer', 'Employer Address', 3, 2, 1, 25, 63, '', 1, 1, '', 'C', 'Street and Number');
1647 INSERT INTO `layout_options` VALUES ('DEM', 'em_city', '4Employer', 'City', 4, 2, 1, 15, 63, '', 1, 1, '', 'C', 'City Name');
1648 INSERT INTO `layout_options` VALUES ('DEM', 'em_state', '4Employer', 'State', 5, 26, 1, 0, 0, 'state', 1, 1, '', '', 'State/Locality');
1649 INSERT INTO `layout_options` VALUES ('DEM', 'em_postal_code', '4Employer', 'Postal Code', 6, 2, 1, 6, 63, '', 1, 1, '', '', 'Postal Code');
1650 INSERT INTO `layout_options` VALUES ('DEM', 'em_country', '4Employer', 'Country', 7, 26, 1, 0, 0, 'country', 1, 1, '', '', 'Country');
1651 INSERT INTO `layout_options` VALUES ('DEM', 'language', '5Stats', 'Language', 1, 26, 1, 0, 0, 'language', 1, 1, '', '', 'Preferred Language');
1652 INSERT INTO `layout_options` VALUES ('DEM', 'ethnoracial', '5Stats', 'Race/Ethnicity', 2, 26, 1, 0, 0, 'ethrace', 1, 1, '', '', 'Ethnicity or Race');
1653 INSERT INTO `layout_options` VALUES ('DEM', 'financial_review', '5Stats', 'Financial Review Date', 3, 2, 1, 10, 10, '', 1, 1, '', 'D', 'Financial Review Date');
1654 INSERT INTO `layout_options` VALUES ('DEM', 'family_size', '5Stats', 'Family Size', 4, 2, 1, 20, 63, '', 1, 1, '', '', 'Family Size');
1655 INSERT INTO `layout_options` VALUES ('DEM', 'monthly_income', '5Stats', 'Monthly Income', 5, 2, 1, 20, 63, '', 1, 1, '', '', 'Monthly Income');
1656 INSERT INTO `layout_options` VALUES ('DEM', 'homeless', '5Stats', 'Homeless, etc.', 6, 2, 1, 20, 63, '', 1, 1, '', '', 'Homeless or similar?');
1657 INSERT INTO `layout_options` VALUES ('DEM', 'interpretter', '5Stats', 'Interpreter', 7, 2, 1, 20, 63, '', 1, 1, '', '', 'Interpreter needed?');
1658 INSERT INTO `layout_options` VALUES ('DEM', 'migrantseasonal', '5Stats', 'Migrant/Seasonal', 8, 2, 1, 20, 63, '', 1, 1, '', '', 'Migrant or seasonal worker?');
1659 INSERT INTO `layout_options` VALUES ('DEM', 'contrastart', '5Stats', 'Contraceptives Start',9,4,0,10,10,'',1,1,'','','Date contraceptive services initially provided');
1660 INSERT INTO `layout_options` VALUES ('DEM', 'referral_source', '5Stats', 'Referral Source',10, 26, 1, 0, 0, 'refsource', 1, 1, '', '', 'How did they hear about us');
1661 INSERT INTO `layout_options` VALUES ('DEM', 'vfc', '5Stats', 'VFC', 12, 1, 1, 20, 0, 'eligibility', 1, 1, '', '', 'Eligibility status for Vaccine for Children supplied vaccine');
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');
1680 INSERT INTO layout_options VALUES ('REF','refer_date'      ,'1Referral','Referral Date'                  , 1, 4,2, 0,  0,''         ,1,1,'C','D','Date of referral');
1681 INSERT INTO layout_options VALUES ('REF','refer_from'      ,'1Referral','Refer By'                       , 2,10,2, 0,  0,''         ,1,1,'' ,'' ,'Referral By');
1682 INSERT INTO layout_options VALUES ('REF','refer_external'  ,'1Referral','External Referral'              , 3, 1,1, 0,  0,'boolean'  ,1,1,'' ,'' ,'External referral?');
1683 INSERT INTO layout_options VALUES ('REF','refer_to'        ,'1Referral','Refer To'                       , 4,14,2, 0,  0,''         ,1,1,'' ,'' ,'Referral To');
1684 INSERT INTO layout_options VALUES ('REF','body'            ,'1Referral','Reason'                         , 5, 3,2,30,  3,''         ,1,1,'' ,'' ,'Reason for referral');
1685 INSERT INTO layout_options VALUES ('REF','refer_diag'      ,'1Referral','Referrer Diagnosis'             , 6, 2,1,30,255,''         ,1,1,'' ,'X','Referrer diagnosis');
1686 INSERT INTO layout_options VALUES ('REF','refer_risk_level','1Referral','Risk Level'                     , 7, 1,1, 0,  0,'risklevel',1,1,'' ,'' ,'Level of urgency');
1687 INSERT INTO layout_options VALUES ('REF','refer_vitals'    ,'1Referral','Include Vitals'                 , 8, 1,1, 0,  0,'boolean'  ,1,1,'' ,'' ,'Include vitals data?');
1688 INSERT INTO layout_options VALUES ('REF','refer_related_code','1Referral','Requested Service'            , 9,15,1,30,255,''         ,1,1,'' ,'' ,'Billing Code for Requested Service');
1689 INSERT INTO layout_options VALUES ('REF','reply_date'      ,'2Counter-Referral','Reply Date'             ,10, 4,1, 0,  0,''         ,1,1,'' ,'D','Date of reply');
1690 INSERT INTO layout_options VALUES ('REF','reply_from'      ,'2Counter-Referral','Reply From'             ,11, 2,1,30,255,''         ,1,1,'' ,'' ,'Who replied?');
1691 INSERT INTO layout_options VALUES ('REF','reply_init_diag' ,'2Counter-Referral','Presumed Diagnosis'     ,12, 2,1,30,255,''         ,1,1,'' ,'' ,'Presumed diagnosis by specialist');
1692 INSERT INTO layout_options VALUES ('REF','reply_final_diag','2Counter-Referral','Final Diagnosis'        ,13, 2,1,30,255,''         ,1,1,'' ,'' ,'Final diagnosis by specialist');
1693 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?');
1694 INSERT INTO layout_options VALUES ('REF','reply_findings'  ,'2Counter-Referral','Findings'               ,15, 3,1,30,  3,''         ,1,1,'' ,'' ,'Findings by specialist');
1695 INSERT INTO layout_options VALUES ('REF','reply_services'  ,'2Counter-Referral','Services Provided'      ,16, 3,1,30,  3,''         ,1,1,'' ,'' ,'Service provided by specialist');
1696 INSERT INTO layout_options VALUES ('REF','reply_recommend' ,'2Counter-Referral','Recommendations'        ,17, 3,1,30,  3,''         ,1,1,'' ,'' ,'Recommendations by specialist');
1697 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');
1699 INSERT INTO layout_options VALUES ('HIS','usertext11','1General','Risk Factors',1,21,1,0,0,'riskfactors',1,1,'','' ,'Risk Factors');
1700 INSERT INTO layout_options VALUES ('HIS','exams'     ,'1General','Exams/Tests' ,2,23,1,0,0,'exams'      ,1,1,'','' ,'Exam and test results');
1701 INSERT INTO layout_options VALUES ('HIS','history_father'   ,'2Family History','Father'   ,1, 2,1,20,255,'',1,1,'','' ,'');
1702 INSERT INTO layout_options VALUES ('HIS','history_mother'   ,'2Family History','Mother'   ,2, 2,1,20,255,'',1,1,'','' ,'');
1703 INSERT INTO layout_options VALUES ('HIS','history_siblings' ,'2Family History','Siblings' ,3, 2,1,20,255,'',1,1,'','' ,'');
1704 INSERT INTO layout_options VALUES ('HIS','history_spouse'   ,'2Family History','Spouse'   ,4, 2,1,20,255,'',1,1,'','' ,'');
1705 INSERT INTO layout_options VALUES ('HIS','history_offspring','2Family History','Offspring',5, 2,1,20,255,'',1,3,'','' ,'');
1706 INSERT INTO layout_options VALUES ('HIS','relatives_cancer'             ,'3Relatives','Cancer'             ,1, 2,1,20,255,'',1,1,'','' ,'');
1707 INSERT INTO layout_options VALUES ('HIS','relatives_tuberculosis'       ,'3Relatives','Tuberculosis'       ,2, 2,1,20,255,'',1,1,'','' ,'');
1708 INSERT INTO layout_options VALUES ('HIS','relatives_diabetes'           ,'3Relatives','Diabetes'           ,3, 2,1,20,255,'',1,1,'','' ,'');
1709 INSERT INTO layout_options VALUES ('HIS','relatives_high_blood_pressure','3Relatives','High Blood Pressure',4, 2,1,20,255,'',1,1,'','' ,'');
1710 INSERT INTO layout_options VALUES ('HIS','relatives_heart_problems'     ,'3Relatives','Heart Problems'     ,5, 2,1,20,255,'',1,1,'','' ,'');
1711 INSERT INTO layout_options VALUES ('HIS','relatives_stroke'             ,'3Relatives','Stroke'             ,6, 2,1,20,255,'',1,1,'','' ,'');
1712 INSERT INTO layout_options VALUES ('HIS','relatives_epilepsy'           ,'3Relatives','Epilepsy'           ,7, 2,1,20,255,'',1,1,'','' ,'');
1713 INSERT INTO layout_options VALUES ('HIS','relatives_mental_illness'     ,'3Relatives','Mental Illness'     ,8, 2,1,20,255,'',1,1,'','' ,'');
1714 INSERT INTO layout_options VALUES ('HIS','relatives_suicide'            ,'3Relatives','Suicide'            ,9, 2,1,20,255,'',1,3,'','' ,'');
1715 INSERT INTO layout_options VALUES ('HIS','coffee'              ,'4Lifestyle','Coffee'              ,1,28,1,20,255,'',1,3,'','' ,'Caffeine consumption');
1716 INSERT INTO layout_options VALUES ('HIS','tobacco'             ,'4Lifestyle','Tobacco'             ,2,28,1,20,255,'',1,3,'','' ,'Tobacco use');
1717 INSERT INTO layout_options VALUES ('HIS','alcohol'             ,'4Lifestyle','Alcohol'             ,3,28,1,20,255,'',1,3,'','' ,'Alcohol consumption');
1718 INSERT INTO layout_options VALUES ('HIS','recreational_drugs'  ,'4Lifestyle','Recreational Drugs'  ,4,28,1,20,255,'',1,3,'','' ,'Recreational drug use');
1719 INSERT INTO layout_options VALUES ('HIS','counseling'          ,'4Lifestyle','Counseling'          ,5,28,1,20,255,'',1,3,'','' ,'Counseling activities');
1720 INSERT INTO layout_options VALUES ('HIS','exercise_patterns'   ,'4Lifestyle','Exercise Patterns'   ,6,28,1,20,255,'',1,3,'','' ,'Exercise patterns');
1721 INSERT INTO layout_options VALUES ('HIS','hazardous_activities','4Lifestyle','Hazardous Activities',7,28,1,20,255,'',1,3,'','' ,'Hazardous activities');
1722 INSERT INTO layout_options VALUES ('HIS','sleep_patterns'      ,'4Lifestyle','Sleep Patterns'      ,8, 2,1,20,255,'',1,3,'','' ,'Sleep patterns');
1723 INSERT INTO layout_options VALUES ('HIS','seatbelt_use'        ,'4Lifestyle','Seatbelt Use'        ,9, 2,1,20,255,'',1,3,'','' ,'Seatbelt use');
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   `mapping` varchar(31) NOT NULL DEFAULT '',
1747   `notes` varchar(255) NOT NULL DEFAULT '',
1748   PRIMARY KEY  (`list_id`,`option_id`)
1749 ) ENGINE=MyISAM;
1751 -- 
1752 -- Dumping data for table `list_options`
1753 -- 
1755 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('yesno', 'NO', 'NO', 1, 0);
1756 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('yesno', 'YES', 'YES', 2, 0);
1757 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('titles', 'Mr.', 'Mr.', 1, 0);
1758 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('titles', 'Mrs.', 'Mrs.', 2, 0);
1759 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('titles', 'Ms.', 'Ms.', 3, 0);
1760 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('titles', 'Dr.', 'Dr.', 4, 0);
1761 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('sex', 'Female', 'Female', 1, 0);
1762 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('sex', 'Male', 'Male', 2, 0);
1763 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('marital', 'married', 'Married', 1, 0);
1764 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('marital', 'single', 'Single', 2, 0);
1765 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('marital', 'divorced', 'Divorced', 3, 0);
1766 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('marital', 'widowed', 'Widowed', 4, 0);
1767 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('marital', 'separated', 'Separated', 5, 0);
1768 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('marital', 'domestic partner', 'Domestic Partner', 6, 0);
1770 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'armenian', 'Armenian', 10, 0);
1771 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'chinese', 'Chinese', 20, 0);
1772 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'danish', 'Danish', 30, 0);
1773 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'deaf', 'Deaf', 40, 0);
1774 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'English', 'English', 50, 0);
1775 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'farsi', 'Farsi', 60, 0);
1776 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'french', 'French', 70, 0);
1777 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'german', 'German', 80, 0);
1778 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'greek', 'Greek', 90, 0);
1779 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'hmong', 'Hmong', 100, 0);
1780 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'italian', 'Italian', 110, 0);
1781 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'japanese', 'Japanese', 120, 0);
1782 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'korean', 'Korean', 130, 0);
1783 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'laotian', 'Laotian', 140, 0);
1784 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'mien', 'Mien', 150, 0);
1785 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'norwegian', 'Norwegian', 160, 0);
1786 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'othrs', 'Others', 170, 0);
1787 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'portuguese', 'Portuguese', 180, 0);
1788 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'punjabi', 'Punjabi', 190, 0);
1789 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'russian', 'Russian', 200, 0);
1790 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'Spanish', 'Spanish', 210, 0);
1791 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'tagalog', 'Tagalog', 220, 0);
1792 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'turkish', 'Turkish', 230, 0);
1793 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'vietnamese', 'Vietnamese', 240, 0);
1794 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'yiddish', 'Yiddish', 250, 0);
1795 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('language', 'zulu', 'Zulu', 260, 0);
1796 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'aleut', 'ALEUT', 10,  0);
1797 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'amer_indian', 'American Indian', 20, 0);
1798 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'Asian', 'Asian', 30, 0);
1799 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'Black', 'Black', 40, 0);
1800 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'cambodian', 'Cambodian', 50, 0);
1801 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'Caucasian', 'Caucasian', 60, 0);
1802 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'cs_american', 'Central/South American', 70, 0);
1803 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'chinese', 'Chinese', 80, 0);
1804 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'cuban', 'Cuban', 90, 0);
1805 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'eskimo', 'Eskimo', 100, 0);
1806 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'filipino', 'Filipino', 110, 0);
1807 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'guamanian', 'Guamanian', 120, 0);
1808 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'hawaiian', 'Hawaiian', 130, 0);
1809 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'Hispanic', 'Hispanic', 140, 0);
1810 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'othr_us', 'Hispanic - Other (Born in US)', 150, 0);
1811 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'othr_non_us', 'Hispanic - Other (Born outside US)', 160, 0);
1812 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'hmong', 'Hmong', 170, 0);
1813 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'indian', 'Indian', 180, 0);
1814 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'japanese', 'Japanese', 190, 0);
1815 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'korean', 'Korean', 200, 0);
1816 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'laotian', 'Laotian', 210, 0);
1817 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'mexican', 'Mexican/MexAmer/Chicano', 220, 0);
1818 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'mlt-race', 'Multiracial', 230, 0);
1819 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'othr', 'Other', 240, 0);
1820 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'othr_spec', 'Other - Specified', 250, 0);
1821 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'pac_island', 'Pacific Islander', 260, 0);
1822 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'puerto_rican', 'Puerto Rican', 270, 0);
1823 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'refused', 'Refused To State', 280, 0);
1824 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'samoan', 'Samoan', 290, 0);
1825 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'spec', 'Specified', 300, 0);
1826 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'thai', 'Thai', 310, 0);
1827 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'unknown', 'Unknown', 320, 0);
1828 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'unspec', 'Unspecified', 330, 0);
1829 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'vietnamese', 'Vietnamese', 340, 0);
1830 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'white', 'White', 350, 0);
1831 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ethrace', 'withheld', 'Withheld', 360, 0);
1833 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('userlist1', 'sample', 'Sample', 1, 0);
1834 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('userlist2', 'sample', 'Sample', 1, 0);
1835 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('userlist3','sample','Sample',1,0);
1836 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('userlist4','sample','Sample',1,0);
1837 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('userlist5','sample','Sample',1,0);
1838 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('userlist6','sample','Sample',1,0);
1839 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('userlist7','sample','Sample',1,0);
1840 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('pricelevel', 'standard', 'Standard', 1, 1);
1841 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('risklevel', 'low', 'Low', 1, 0);
1842 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('risklevel', 'medium', 'Medium', 2, 1);
1843 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('risklevel', 'high', 'High', 3, 0);
1844 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('boolean', '0', 'No', 1, 0);
1845 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('boolean', '1', 'Yes', 2, 0);
1846 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('country', 'USA', 'USA', 1, 0);
1848 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','AL','Alabama'             , 1,0);
1849 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','AK','Alaska'              , 2,0);
1850 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','AZ','Arizona'             , 3,0);
1851 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','AR','Arkansas'            , 4,0);
1852 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','CA','California'          , 5,0);
1853 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','CO','Colorado'            , 6,0);
1854 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','CT','Connecticut'         , 7,0);
1855 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','DE','Delaware'            , 8,0);
1856 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','DC','District of Columbia', 9,0);
1857 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','FL','Florida'             ,10,0);
1858 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','GA','Georgia'             ,11,0);
1859 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','HI','Hawaii'              ,12,0);
1860 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','ID','Idaho'               ,13,0);
1861 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','IL','Illinois'            ,14,0);
1862 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','IN','Indiana'             ,15,0);
1863 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','IA','Iowa'                ,16,0);
1864 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','KS','Kansas'              ,17,0);
1865 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','KY','Kentucky'            ,18,0);
1866 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','LA','Louisiana'           ,19,0);
1867 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','ME','Maine'               ,20,0);
1868 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','MD','Maryland'            ,21,0);
1869 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','MA','Massachusetts'       ,22,0);
1870 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','MI','Michigan'            ,23,0);
1871 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','MN','Minnesota'           ,24,0);
1872 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','MS','Mississippi'         ,25,0);
1873 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','MO','Missouri'            ,26,0);
1874 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','MT','Montana'             ,27,0);
1875 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','NE','Nebraska'            ,28,0);
1876 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','NV','Nevada'              ,29,0);
1877 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','NH','New Hampshire'       ,30,0);
1878 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','NJ','New Jersey'          ,31,0);
1879 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','NM','New Mexico'          ,32,0);
1880 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','NY','New York'            ,33,0);
1881 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','NC','North Carolina'      ,34,0);
1882 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','ND','North Dakota'        ,35,0);
1883 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','OH','Ohio'                ,36,0);
1884 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','OK','Oklahoma'            ,37,0);
1885 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','OR','Oregon'              ,38,0);
1886 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','PA','Pennsylvania'        ,39,0);
1887 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','RI','Rhode Island'        ,40,0);
1888 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','SC','South Carolina'      ,41,0);
1889 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','SD','South Dakota'        ,42,0);
1890 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','TN','Tennessee'           ,43,0);
1891 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','TX','Texas'               ,44,0);
1892 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','UT','Utah'                ,45,0);
1893 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','VT','Vermont'             ,46,0);
1894 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','VA','Virginia'            ,47,0);
1895 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','WA','Washington'          ,48,0);
1896 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','WV','West Virginia'       ,49,0);
1897 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','WI','Wisconsin'           ,50,0);
1898 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('state','WY','Wyoming'             ,51,0);
1900 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('refsource','Patient'      ,'Patient'      , 1,0);
1901 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('refsource','Employee'     ,'Employee'     , 2,0);
1902 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('refsource','Walk-In'      ,'Walk-In'      , 3,0);
1903 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('refsource','Newspaper'    ,'Newspaper'    , 4,0);
1904 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('refsource','Radio'        ,'Radio'        , 5,0);
1905 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('refsource','T.V.'         ,'T.V.'         , 6,0);
1906 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('refsource','Direct Mail'  ,'Direct Mail'  , 7,0);
1907 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('refsource','Coupon'       ,'Coupon'       , 8,0);
1908 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('refsource','Referral Card','Referral Card', 9,0);
1909 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('refsource','Other'        ,'Other'        ,10,0);
1910 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','vv' ,'Varicose Veins'                      , 1,0);
1911 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','ht' ,'Hypertension'                        , 2,0);
1912 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','db' ,'Diabetes'                            , 3,0);
1913 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','sc' ,'Sickle Cell'                         , 4,0);
1914 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','fib','Fibroids'                            , 5,0);
1915 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','pid','PID (Pelvic Inflammatory Disease)'   , 6,0);
1916 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','mig','Severe Migraine'                     , 7,0);
1917 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','hd' ,'Heart Disease'                       , 8,0);
1918 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','str','Thrombosis/Stroke'                   , 9,0);
1919 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','hep','Hepatitis'                           ,10,0);
1920 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','gb' ,'Gall Bladder Condition'              ,11,0);
1921 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','br' ,'Breast Disease'                      ,12,0);
1922 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','dpr','Depression'                          ,13,0);
1923 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','all','Allergies'                           ,14,0);
1924 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','inf','Infertility'                         ,15,0);
1925 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','ast','Asthma'                              ,16,0);
1926 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','ep' ,'Epilepsy'                            ,17,0);
1927 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','cl' ,'Contact Lenses'                      ,18,0);
1928 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','coc','Contraceptive Complication (specify)',19,0);
1929 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('riskfactors','oth','Other (specify)'                     ,20,0);
1930 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('exams' ,'brs','Breast Exam'          , 1,0);
1931 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('exams' ,'cec','Cardiac Echo'         , 2,0);
1932 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('exams' ,'ecg','ECG'                  , 3,0);
1933 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('exams' ,'gyn','Gynecological Exam'   , 4,0);
1934 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('exams' ,'mam','Mammogram'            , 5,0);
1935 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('exams' ,'phy','Physical Exam'        , 6,0);
1936 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('exams' ,'pro','Prostate Exam'        , 7,0);
1937 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('exams' ,'rec','Rectal Exam'          , 8,0);
1938 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('exams' ,'sic','Sigmoid/Colonoscopy'  , 9,0);
1939 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('exams' ,'ret','Retinal Exam'         ,10,0);
1940 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('exams' ,'flu','Flu Vaccination'      ,11,0);
1941 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('exams' ,'pne','Pneumonia Vaccination',12,0);
1942 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('exams' ,'ldl','LDL'                  ,13,0);
1943 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('exams' ,'hem','Hemoglobin'           ,14,0);
1944 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('exams' ,'psa','PSA'                  ,15,0);
1945 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_form','0',''           ,0,0);
1946 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_form','1','suspension' ,1,0);
1947 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_form','2','tablet'     ,2,0);
1948 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_form','3','capsule'    ,3,0);
1949 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_form','4','solution'   ,4,0);
1950 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_form','5','tsp'        ,5,0);
1951 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_form','6','ml'         ,6,0);
1952 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_form','7','units'      ,7,0);
1953 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_form','8','inhalations',8,0);
1954 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_form','9','gtts(drops)',9,0);
1955 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_form','10','cream'   ,10,0);
1956 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_form','11','ointment',11,0);
1957 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_units','0',''          ,0,0);
1958 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_units','1','mg'    ,1,0);
1959 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_units','2','mg/1cc',2,0);
1960 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_units','3','mg/2cc',3,0);
1961 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_units','4','mg/3cc',4,0);
1962 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_units','5','mg/4cc',5,0);
1963 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_units','6','mg/5cc',6,0);
1964 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_units','7','mcg'   ,7,0);
1965 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_units','8','grams' ,8,0);
1966 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_route', '0',''                 , 0,0);
1967 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_route', '1','Per Oris'         , 1,0);
1968 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_route', '2','Per Rectum'       , 2,0);
1969 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_route', '3','To Skin'          , 3,0);
1970 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_route', '4','To Affected Area' , 4,0);
1971 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_route', '5','Sublingual'       , 5,0);
1972 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_route', '6','OS'               , 6,0);
1973 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_route', '7','OD'               , 7,0);
1974 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_route', '8','OU'               , 8,0);
1975 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_route', '9','SQ'               , 9,0);
1976 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_route','10','IM'               ,10,0);
1977 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_route','11','IV'               ,11,0);
1978 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_route','12','Per Nostril'      ,12,0);
1979 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_route','13','Both Ears',13,0);
1980 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_route','14','Left Ear' ,14,0);
1981 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_route','15','Right Ear',15,0);
1982 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','0',''      ,0,0);
1983 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','1','b.i.d.',1,0);
1984 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','2','t.i.d.',2,0);
1985 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','3','q.i.d.',3,0);
1986 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','4','q.3h'  ,4,0);
1987 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','5','q.4h'  ,5,0);
1988 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','6','q.5h'  ,6,0);
1989 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','7','q.6h'  ,7,0);
1990 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','8','q.8h'  ,8,0);
1991 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','9','q.d.'  ,9,0);
1992 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','10','a.c.'  ,10,0);
1993 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','11','p.c.'  ,11,0);
1994 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','12','a.m.'  ,12,0);
1995 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','13','p.m.'  ,13,0);
1996 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','14','ante'  ,14,0);
1997 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','15','h'     ,15,0);
1998 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','16','h.s.'  ,16,0);
1999 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','17','p.r.n.',17,0);
2000 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('drug_interval','18','stat'  ,18,0);
2002 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('chartloc','fileroom','File Room'              ,1,0);
2003 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'boolean'      ,'Boolean'            , 1,0);
2004 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'chartloc'     ,'Chart Storage Locations',1,0);
2005 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'country'      ,'Country'            , 2,0);
2006 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'drug_form'    ,'Drug Forms'         , 3,0);
2007 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'drug_units'   ,'Drug Units'         , 4,0);
2008 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'drug_route'   ,'Drug Routes'        , 5,0);
2009 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'drug_interval','Drug Intervals'     , 6,0);
2010 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'exams'        ,'Exams/Tests'        , 7,0);
2011 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'feesheet'     ,'Fee Sheet'          , 8,0);
2012 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'language'     ,'Language'           , 9,0);
2013 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'lbfnames'     ,'Layout-Based Visit Forms',9,0);
2014 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'marital'      ,'Marital Status'     ,10,0);
2015 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'pricelevel'   ,'Price Level'        ,11,0);
2016 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'ethrace'      ,'Race/Ethnicity'     ,12,0);
2017 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'refsource'    ,'Referral Source'    ,13,0);
2018 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'riskfactors'  ,'Risk Factors'       ,14,0);
2019 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'risklevel'    ,'Risk Level'         ,15,0);
2020 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'superbill'    ,'Service Category'   ,16,0);
2021 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'sex'          ,'Sex'                ,17,0);
2022 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'state'        ,'State'              ,18,0);
2023 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'taxrate'      ,'Tax Rate'           ,19,0);
2024 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'titles'       ,'Titles'             ,20,0);
2025 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'yesno'        ,'Yes/No'             ,21,0);
2026 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'userlist1'    ,'User Defined List 1',22,0);
2027 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'userlist2'    ,'User Defined List 2',23,0);
2028 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'userlist3'    ,'User Defined List 3',24,0);
2029 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'userlist4'    ,'User Defined List 4',25,0);
2030 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'userlist5'    ,'User Defined List 5',26,0);
2031 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'userlist6'    ,'User Defined List 6',27,0);
2032 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'userlist7'    ,'User Defined List 7',28,0);
2034 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists'    ,'adjreason'      ,'Adjustment Reasons',1,0);
2035 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('adjreason','Adm adjust'     ,'Adm adjust'     , 5,0);
2036 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('adjreason','After hrs calls','After hrs calls',10,0);
2037 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('adjreason','Bad check'      ,'Bad check'      ,15,0);
2038 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('adjreason','Bad debt'       ,'Bad debt'       ,20,0);
2039 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('adjreason','Coll w/o'       ,'Coll w/o'       ,25,0);
2040 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('adjreason','Discount'       ,'Discount'       ,30,0);
2041 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('adjreason','Hardship w/o'   ,'Hardship w/o'   ,35,0);
2042 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('adjreason','Ins adjust'     ,'Ins adjust'     ,40,0);
2043 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('adjreason','Ins bundling'   ,'Ins bundling'   ,45,0);
2044 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('adjreason','Ins overpaid'   ,'Ins overpaid'   ,50,0);
2045 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('adjreason','Ins refund'     ,'Ins refund'     ,55,0);
2046 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('adjreason','Pt overpaid'    ,'Pt overpaid'    ,60,0);
2047 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('adjreason','Pt refund'      ,'Pt refund'      ,65,0);
2048 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('adjreason','Pt released'    ,'Pt released'    ,70,0);
2049 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('adjreason','Sm debt w/o'    ,'Sm debt w/o'    ,75,0);
2050 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('adjreason','To copay'       ,'To copay'       ,80,0);
2051 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('adjreason','To ded\'ble'    ,'To ded\'ble'    ,85,0);
2052 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('adjreason','Untimely filing','Untimely filing',90,0);
2054 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists'       ,'sub_relation','Subscriber Relationship',18,0);
2055 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('sub_relation','self'        ,'Self'                   , 1,0);
2056 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('sub_relation','spouse'      ,'Spouse'                 , 2,0);
2057 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('sub_relation','child'       ,'Child'                  , 3,0);
2058 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('sub_relation','other'       ,'Other'                  , 4,0);
2060 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists'     ,'occurrence','Occurrence'                  ,10,0);
2061 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('occurrence','0'         ,'Unknown or N/A'              , 5,0);
2062 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('occurrence','1'         ,'First'                       ,10,0);
2063 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('occurrence','6'         ,'Early Recurrence (<2 Mo)'    ,15,0);
2064 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('occurrence','7'         ,'Late Recurrence (2-12 Mo)'   ,20,0);
2065 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('occurrence','8'         ,'Delayed Recurrence (> 12 Mo)',25,0);
2066 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('occurrence','4'         ,'Chronic/Recurrent'           ,30,0);
2067 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('occurrence','5'         ,'Acute on Chronic'            ,35,0);
2069 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists'  ,'outcome','Outcome'         ,10,0);
2070 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('outcome','0'      ,'Unassigned'      , 2,0);
2071 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('outcome','1'      ,'Resolved'        , 5,0);
2072 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('outcome','2'      ,'Improved'        ,10,0);
2073 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('outcome','3'      ,'Status quo'      ,15,0);
2074 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('outcome','4'      ,'Worse'           ,20,0);
2075 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('outcome','5'      ,'Pending followup',25,0);
2077 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists'    ,'note_type'      ,'Patient Note Types',10,0);
2078 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('note_type','Unassigned'     ,'Unassigned'        , 1,0);
2079 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('note_type','Chart Note'     ,'Chart Note'        , 2,0);
2080 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('note_type','Insurance'      ,'Insurance'         , 3,0);
2081 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('note_type','New Document'   ,'New Document'      , 4,0);
2082 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('note_type','Pharmacy'       ,'Pharmacy'          , 5,0);
2083 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('note_type','Prior Auth'     ,'Prior Auth'        , 6,0);
2084 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('note_type','Referral'       ,'Referral'          , 7,0);
2085 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('note_type','Test Scheduling','Test Scheduling'   , 8,0);
2086 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('note_type','Bill/Collect'   ,'Bill/Collect'      , 9,0);
2087 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('note_type','Other'          ,'Other'             ,10,0);
2089 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists'        ,'immunizations','Immunizations'           ,  8,0);
2090 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','1'            ,'DTaP 1'                  , 30,0);
2091 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','2'            ,'DTaP 2'                  , 35,0);
2092 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','3'            ,'DTaP 3'                  , 40,0);
2093 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','4'            ,'DTaP 4'                  , 45,0);
2094 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','5'            ,'DTaP 5'                  , 50,0);
2095 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','6'            ,'DT 1'                    ,  5,0);
2096 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','7'            ,'DT 2'                    , 10,0);
2097 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','8'            ,'DT 3'                    , 15,0);
2098 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','9'            ,'DT 4'                    , 20,0);
2099 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','10'           ,'DT 5'                    , 25,0);
2100 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','11'           ,'IPV 1'                   ,110,0);
2101 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','12'           ,'IPV 2'                   ,115,0);
2102 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','13'           ,'IPV 3'                   ,120,0);
2103 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','14'           ,'IPV 4'                   ,125,0);
2104 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','15'           ,'Hib 1'                   , 80,0);
2105 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','16'           ,'Hib 2'                   , 85,0);
2106 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','17'           ,'Hib 3'                   , 90,0);
2107 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','18'           ,'Hib 4'                   , 95,0);
2108 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','19'           ,'Pneumococcal Conjugate 1',140,0);
2109 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','20'           ,'Pneumococcal Conjugate 2',145,0);
2110 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','21'           ,'Pneumococcal Conjugate 3',150,0);
2111 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','22'           ,'Pneumococcal Conjugate 4',155,0);
2112 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','23'           ,'MMR 1'                   ,130,0);
2113 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','24'           ,'MMR 2'                   ,135,0);
2114 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','25'           ,'Varicella 1'             ,165,0);
2115 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','26'           ,'Varicella 2'             ,170,0);
2116 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','27'           ,'Hepatitis B 1'           , 65,0);
2117 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','28'           ,'Hepatitis B 2'           , 70,0);
2118 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','29'           ,'Hepatitis B 3'           , 75,0);
2119 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','30'           ,'Influenza 1'             ,100,0);
2120 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','31'           ,'Influenza 2'             ,105,0);
2121 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','32'           ,'Td'                      ,160,0);
2122 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','33'           ,'Hepatitis A 1'           , 55,0);
2123 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','34'           ,'Hepatitis A 2'           , 60,0);
2124 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('immunizations','35'           ,'Other'                   ,175,0);
2126 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists'   ,'apptstat','Appointment Statuses', 1,0);
2127 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('apptstat','-'       ,'- None'              , 5,0);
2128 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('apptstat','*'       ,'* Reminder done'     ,10,0);
2129 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('apptstat','+'       ,'+ Chart pulled'      ,15,0);
2130 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('apptstat','x'       ,'x Canceled'          ,20,0);
2131 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('apptstat','?'       ,'? No show'           ,25,0);
2132 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('apptstat','@'       ,'@ Arrived'           ,30,0);
2133 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('apptstat','~'       ,'~ Arrived late'      ,35,0);
2134 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('apptstat','!'       ,'! Left w/o visit'    ,40,0);
2135 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('apptstat','#'       ,'# Ins/fin issue'     ,45,0);
2136 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('apptstat','<'       ,'< In exam room'      ,50,0);
2137 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('apptstat','>'       ,'> Checked out'       ,55,0);
2138 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('apptstat','$'       ,'$ Coding done'       ,60,0);
2139 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('apptstat','%'       ,'% Canceled < 24h'    ,65,0);
2141 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists'    ,'warehouse','Warehouses',21,0);
2142 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('warehouse','onsite'   ,'On Site'   , 5,0);
2144 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists','abook_type'  ,'Address Book Types'  , 1,0);
2145 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('abook_type','ord_img','Imaging Service'     , 5,0);
2146 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('abook_type','ord_imm','Immunization Service',10,0);
2147 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('abook_type','ord_lab','Lab Service'         ,15,0);
2148 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('abook_type','spe'    ,'Specialist'          ,20,0);
2149 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('abook_type','vendor' ,'Vendor'              ,25,0);
2150 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('abook_type','oth'    ,'Other'               ,95,0);
2152 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists','proc_type','Procedure Types', 1,0);
2153 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_type','grp','Group'          ,10,0);
2154 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_type','ord','Procedure Order',20,0);
2155 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_type','res','Discrete Result',30,0);
2156 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_type','rec','Recommendation' ,40,0);
2158 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists','proc_body_site','Procedure Body Sites', 1,0);
2159 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_body_site','arm'    ,'Arm'    ,10,0);
2160 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_body_site','buttock','Buttock',20,0);
2161 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_body_site','oth'    ,'Other'  ,90,0);
2163 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists','proc_specimen','Procedure Specimen Types', 1,0);
2164 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_specimen','blood' ,'Blood' ,10,0);
2165 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_specimen','saliva','Saliva',20,0);
2166 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_specimen','urine' ,'Urine' ,30,0);
2167 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_specimen','oth'   ,'Other' ,90,0);
2169 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists','proc_route','Procedure Routes', 1,0);
2170 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_route','inj' ,'Injection',10,0);
2171 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_route','oral','Oral'     ,20,0);
2172 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_route','oth' ,'Other'    ,90,0);
2174 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists','proc_lat','Procedure Lateralities', 1,0);
2175 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_lat','left' ,'Left'     ,10,0);
2176 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_lat','right','Right'    ,20,0);
2177 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_lat','bilat','Bilateral',30,0);
2179 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('lists','proc_unit','Procedure Units', 1);
2180 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','bool'       ,'Boolean'    ,  5);
2181 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','cu_mm'      ,'CU.MM'      , 10);
2182 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','fl'         ,'FL'         , 20);
2183 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','g_dl'       ,'G/DL'       , 30);
2184 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','gm_dl'      ,'GM/DL'      , 40);
2185 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','hmol_l'     ,'HMOL/L'     , 50);
2186 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','iu_l'       ,'IU/L'       , 60);
2187 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','mg_dl'      ,'MG/DL'      , 70);
2188 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','mil_cu_mm'  ,'Mil/CU.MM'  , 80);
2189 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','percent'    ,'Percent'    , 90);
2190 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','percentile' ,'Percentile' ,100);
2191 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','pg'         ,'PG'         ,110);
2192 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','ratio'      ,'Ratio'      ,120);
2193 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','thous_cu_mm','Thous/CU.MM',130);
2194 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','units'      ,'Units'      ,140);
2195 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','units_l'    ,'Units/L'    ,150);
2196 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','days'       ,'Days'       ,600);
2197 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','weeks'      ,'Weeks'      ,610);
2198 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','months'     ,'Months'     ,620);
2199 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('proc_unit','oth'        ,'Other'      ,990);
2201 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists','ord_priority','Order Priorities', 1,0);
2202 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ord_priority','high'  ,'High'  ,10,0);
2203 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ord_priority','normal','Normal',20,0);
2205 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists','ord_status','Order Statuses', 1,0);
2206 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ord_status','pending' ,'Pending' ,10,0);
2207 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ord_status','routed'  ,'Routed'  ,20,0);
2208 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ord_status','complete','Complete',30,0);
2209 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('ord_status','canceled','Canceled',40,0);
2211 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists','proc_rep_status','Procedure Report Statuses', 1,0);
2212 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_rep_status','final'  ,'Final'      ,10,0);
2213 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_rep_status','review' ,'Reviewed'   ,20,0);
2214 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_rep_status','prelim' ,'Preliminary',30,0);
2215 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_rep_status','cancel' ,'Canceled'   ,40,0);
2216 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_rep_status','error'  ,'Error'      ,50,0);
2217 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_rep_status','correct','Corrected'  ,60,0);
2219 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists','proc_res_abnormal','Procedure Result Abnormal', 1,0);
2220 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_res_abnormal','no'  ,'No'  ,10,0);
2221 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_res_abnormal','yes' ,'Yes' ,20,0);
2222 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_res_abnormal','high','High',30,0);
2223 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_res_abnormal','low' ,'Low' ,40,0);
2225 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists','proc_res_status','Procedure Result Statuses', 1,0);
2226 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_res_status','final'     ,'Final'      ,10,0);
2227 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_res_status','prelim'    ,'Preliminary',20,0);
2228 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_res_status','cancel'    ,'Canceled'   ,30,0);
2229 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_res_status','error'     ,'Error'      ,40,0);
2230 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_res_status','correct'   ,'Corrected'  ,50,0);
2231 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_res_status','incomplete','Incomplete' ,60,0);
2233 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists','proc_res_bool','Procedure Boolean Results', 1,0);
2234 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_res_bool','neg' ,'Negative',10,0);
2235 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('proc_res_bool','pos' ,'Positive',20,0);
2237 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists'         ,'message_status','Message Status',45,0);
2238 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('message_status','Done'           ,'Done'         , 5,0);
2239 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('message_status','Forwarded'      ,'Forwarded'    ,10,0);
2240 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('message_status','New'            ,'New'          ,15,0);
2241 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('message_status','Read'           ,'Read'         ,20,0);
2243 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('note_type','Lab Results' ,'Lab Results', 15,0);
2244 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('note_type','New Orders' ,'New Orders', 20,0);
2245 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('note_type','Patient Reminders' ,'Patient Reminders', 25,0);
2247 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists'   ,'irnpool','Invoice Reference Number Pools', 1,0);
2248 INSERT INTO list_options ( list_id, option_id, title, seq, is_default, notes ) VALUES ('irnpool','main','Main',1,1,'000001');
2250 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists', 'eligibility', 'Eligibility', 60, 0);
2251 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('eligibility', 'eligible', 'Eligible', 10, 0);
2252 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('eligibility', 'ineligible', 'Ineligible', 20, 0);
2254 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists', 'transactions', 'Transactions', 20, 0);
2255 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('transactions', 'Referral', 'Referral', 10, 0);
2256 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('transactions', 'Patient Request', 'Patient Request', 20, 0);
2257 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('transactions', 'Physician Request', 'Physician Request', 30, 0);
2258 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('transactions', 'Legal', 'Legal', 40, 0);
2259 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('transactions', 'Billing', 'Billing', 50, 0);
2261 -- --------------------------------------------------------
2263 -- 
2264 -- Table structure for table `lists`
2265 -- 
2267 DROP TABLE IF EXISTS `lists`;
2268 CREATE TABLE `lists` (
2269   `id` bigint(20) NOT NULL auto_increment,
2270   `date` datetime default NULL,
2271   `type` varchar(255) default NULL,
2272   `title` varchar(255) default NULL,
2273   `begdate` date default NULL,
2274   `enddate` date default NULL,
2275   `returndate` date default NULL,
2276   `occurrence` int(11) default '0',
2277   `classification` int(11) default '0',
2278   `referredby` varchar(255) default NULL,
2279   `extrainfo` varchar(255) default NULL,
2280   `diagnosis` varchar(255) default NULL,
2281   `activity` tinyint(4) default NULL,
2282   `comments` longtext,
2283   `pid` bigint(20) default NULL,
2284   `user` varchar(255) default NULL,
2285   `groupname` varchar(255) default NULL,
2286   `outcome` int(11) NOT NULL default '0',
2287   `destination` varchar(255) default NULL,
2288   `reinjury_id` bigint(20)  NOT NULL DEFAULT 0,
2289   `injury_part` varchar(31) NOT NULL DEFAULT '',
2290   `injury_type` varchar(31) NOT NULL DEFAULT '',
2291   PRIMARY KEY  (`id`)
2292 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2294 -- --------------------------------------------------------
2296 -- 
2297 -- Table structure for table `log`
2298 -- 
2300 DROP TABLE IF EXISTS `log`;
2301 CREATE TABLE `log` (
2302   `id` bigint(20) NOT NULL auto_increment,
2303   `date` datetime default NULL,
2304   `event` varchar(255) default NULL,
2305   `user` varchar(255) default NULL,
2306   `groupname` varchar(255) default NULL,
2307   `comments` longtext,
2308   `user_notes` longtext,
2309   `patient_id` bigint(20) default NULL,
2310   `success` tinyint(1) default 1,
2311   `checksum` longtext default NULL,
2312   `crt_user` varchar(255) default NULL,
2313   PRIMARY KEY  (`id`)
2314 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2316 -- --------------------------------------------------------
2318 -- 
2319 -- Table structure for table `notes`
2320 -- 
2322 DROP TABLE IF EXISTS `notes`;
2323 CREATE TABLE `notes` (
2324   `id` int(11) NOT NULL default '0',
2325   `foreign_id` int(11) NOT NULL default '0',
2326   `note` varchar(255) default NULL,
2327   `owner` int(11) default NULL,
2328   `date` datetime default NULL,
2329   `revision` timestamp NOT NULL,
2330   PRIMARY KEY  (`id`),
2331   KEY `foreign_id` (`owner`),
2332   KEY `foreign_id_2` (`foreign_id`),
2333   KEY `date` (`date`)
2334 ) ENGINE=MyISAM;
2336 -- --------------------------------------------------------
2338 -- 
2339 -- Table structure for table `onotes`
2340 -- 
2342 DROP TABLE IF EXISTS `onotes`;
2343 CREATE TABLE `onotes` (
2344   `id` bigint(20) NOT NULL auto_increment,
2345   `date` datetime default NULL,
2346   `body` longtext,
2347   `user` varchar(255) default NULL,
2348   `groupname` varchar(255) default NULL,
2349   `activity` tinyint(4) default NULL,
2350   PRIMARY KEY  (`id`)
2351 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2353 -- --------------------------------------------------------
2355 -- 
2356 -- Table structure for table `openemr_module_vars`
2357 -- 
2359 DROP TABLE IF EXISTS `openemr_module_vars`;
2360 CREATE TABLE `openemr_module_vars` (
2361   `pn_id` int(11) unsigned NOT NULL auto_increment,
2362   `pn_modname` varchar(64) default NULL,
2363   `pn_name` varchar(64) default NULL,
2364   `pn_value` longtext,
2365   PRIMARY KEY  (`pn_id`),
2366   KEY `pn_modname` (`pn_modname`),
2367   KEY `pn_name` (`pn_name`)
2368 ) ENGINE=MyISAM AUTO_INCREMENT=235 ;
2370 -- 
2371 -- Dumping data for table `openemr_module_vars`
2372 -- 
2374 INSERT INTO `openemr_module_vars` VALUES (234, 'PostCalendar', 'pcNotifyEmail', '');
2375 INSERT INTO `openemr_module_vars` VALUES (233, 'PostCalendar', 'pcNotifyAdmin', '0');
2376 INSERT INTO `openemr_module_vars` VALUES (232, 'PostCalendar', 'pcCacheLifetime', '3600');
2377 INSERT INTO `openemr_module_vars` VALUES (231, 'PostCalendar', 'pcUseCache', '0');
2378 INSERT INTO `openemr_module_vars` VALUES (230, 'PostCalendar', 'pcDefaultView', 'day');
2379 INSERT INTO `openemr_module_vars` VALUES (229, 'PostCalendar', 'pcTimeIncrement', '5');
2380 INSERT INTO `openemr_module_vars` VALUES (228, 'PostCalendar', 'pcAllowUserCalendar', '1');
2381 INSERT INTO `openemr_module_vars` VALUES (227, 'PostCalendar', 'pcAllowSiteWide', '1');
2382 INSERT INTO `openemr_module_vars` VALUES (226, 'PostCalendar', 'pcTemplate', 'default');
2383 INSERT INTO `openemr_module_vars` VALUES (225, 'PostCalendar', 'pcEventDateFormat', '%Y-%m-%d');
2384 INSERT INTO `openemr_module_vars` VALUES (224, 'PostCalendar', 'pcDisplayTopics', '0');
2385 INSERT INTO `openemr_module_vars` VALUES (223, 'PostCalendar', 'pcListHowManyEvents', '15');
2386 INSERT INTO `openemr_module_vars` VALUES (222, 'PostCalendar', 'pcAllowDirectSubmit', '1');
2387 INSERT INTO `openemr_module_vars` VALUES (221, 'PostCalendar', 'pcUsePopups', '0');
2388 INSERT INTO `openemr_module_vars` VALUES (220, 'PostCalendar', 'pcDayHighlightColor', '#EEEEEE');
2389 INSERT INTO `openemr_module_vars` VALUES (219, 'PostCalendar', 'pcFirstDayOfWeek', '1');
2390 INSERT INTO `openemr_module_vars` VALUES (218, 'PostCalendar', 'pcUseInternationalDates', '0');
2391 INSERT INTO `openemr_module_vars` VALUES (217, 'PostCalendar', 'pcEventsOpenInNewWindow', '0');
2392 INSERT INTO `openemr_module_vars` VALUES (216, 'PostCalendar', 'pcTime24Hours', '0');
2394 -- --------------------------------------------------------
2396 -- 
2397 -- Table structure for table `openemr_modules`
2398 -- 
2400 DROP TABLE IF EXISTS `openemr_modules`;
2401 CREATE TABLE `openemr_modules` (
2402   `pn_id` int(11) unsigned NOT NULL auto_increment,
2403   `pn_name` varchar(64) default NULL,
2404   `pn_type` int(6) NOT NULL default '0',
2405   `pn_displayname` varchar(64) default NULL,
2406   `pn_description` varchar(255) default NULL,
2407   `pn_regid` int(11) unsigned NOT NULL default '0',
2408   `pn_directory` varchar(64) default NULL,
2409   `pn_version` varchar(10) default NULL,
2410   `pn_admin_capable` tinyint(1) NOT NULL default '0',
2411   `pn_user_capable` tinyint(1) NOT NULL default '0',
2412   `pn_state` tinyint(1) NOT NULL default '0',
2413   PRIMARY KEY  (`pn_id`)
2414 ) ENGINE=MyISAM AUTO_INCREMENT=47 ;
2416 -- 
2417 -- Dumping data for table `openemr_modules`
2418 -- 
2420 INSERT INTO `openemr_modules` VALUES (46, 'PostCalendar', 2, 'PostCalendar', 'PostNuke Calendar Module', 0, 'PostCalendar', '4.0.0', 1, 1, 3);
2422 -- --------------------------------------------------------
2424 -- 
2425 -- Table structure for table `openemr_postcalendar_categories`
2426 -- 
2428 DROP TABLE IF EXISTS `openemr_postcalendar_categories`;
2429 CREATE TABLE `openemr_postcalendar_categories` (
2430   `pc_catid` int(11) unsigned NOT NULL auto_increment,
2431   `pc_catname` varchar(100) default NULL,
2432   `pc_catcolor` varchar(50) default NULL,
2433   `pc_catdesc` text,
2434   `pc_recurrtype` int(1) NOT NULL default '0',
2435   `pc_enddate` date default NULL,
2436   `pc_recurrspec` text,
2437   `pc_recurrfreq` int(3) NOT NULL default '0',
2438   `pc_duration` bigint(20) NOT NULL default '0',
2439   `pc_end_date_flag` tinyint(1) NOT NULL default '0',
2440   `pc_end_date_type` int(2) default NULL,
2441   `pc_end_date_freq` int(11) NOT NULL default '0',
2442   `pc_end_all_day` tinyint(1) NOT NULL default '0',
2443   `pc_dailylimit` int(2) NOT NULL default '0',
2444   PRIMARY KEY  (`pc_catid`),
2445   KEY `basic_cat` (`pc_catname`,`pc_catcolor`)
2446 ) ENGINE=MyISAM AUTO_INCREMENT=11 ;
2448 -- 
2449 -- Dumping data for table `openemr_postcalendar_categories`
2450 -- 
2452 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);
2453 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);
2454 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);
2455 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);
2456 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);
2457 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);
2458 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);
2459 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);
2460 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);
2462 -- --------------------------------------------------------
2464 -- 
2465 -- Table structure for table `openemr_postcalendar_events`
2466 -- 
2468 DROP TABLE IF EXISTS `openemr_postcalendar_events`;
2469 CREATE TABLE `openemr_postcalendar_events` (
2470   `pc_eid` int(11) unsigned NOT NULL auto_increment,
2471   `pc_catid` int(11) NOT NULL default '0',
2472   `pc_multiple` int(10) unsigned NOT NULL,
2473   `pc_aid` varchar(30) default NULL,
2474   `pc_pid` varchar(11) default NULL,
2475   `pc_title` varchar(150) default NULL,
2476   `pc_time` datetime default NULL,
2477   `pc_hometext` text,
2478   `pc_comments` int(11) default '0',
2479   `pc_counter` mediumint(8) unsigned default '0',
2480   `pc_topic` int(3) NOT NULL default '1',
2481   `pc_informant` varchar(20) default NULL,
2482   `pc_eventDate` date NOT NULL default '0000-00-00',
2483   `pc_endDate` date NOT NULL default '0000-00-00',
2484   `pc_duration` bigint(20) NOT NULL default '0',
2485   `pc_recurrtype` int(1) NOT NULL default '0',
2486   `pc_recurrspec` text,
2487   `pc_recurrfreq` int(3) NOT NULL default '0',
2488   `pc_startTime` time default NULL,
2489   `pc_endTime` time default NULL,
2490   `pc_alldayevent` int(1) NOT NULL default '0',
2491   `pc_location` text,
2492   `pc_conttel` varchar(50) default NULL,
2493   `pc_contname` varchar(50) default NULL,
2494   `pc_contemail` varchar(255) default NULL,
2495   `pc_website` varchar(255) default NULL,
2496   `pc_fee` varchar(50) default NULL,
2497   `pc_eventstatus` int(11) NOT NULL default '0',
2498   `pc_sharing` int(11) NOT NULL default '0',
2499   `pc_language` varchar(30) default NULL,
2500   `pc_apptstatus` varchar(15) NOT NULL default '-',
2501   `pc_prefcatid` int(11) NOT NULL default '0',
2502   `pc_facility` smallint(6) NOT NULL default '0' COMMENT 'facility id for this event',
2503   `pc_sendalertsms` VARCHAR(3) NOT NULL DEFAULT 'NO',
2504   `pc_sendalertemail` VARCHAR( 3 ) NOT NULL DEFAULT 'NO',
2505   PRIMARY KEY  (`pc_eid`),
2506   KEY `basic_event` (`pc_catid`,`pc_aid`,`pc_eventDate`,`pc_endDate`,`pc_eventstatus`,`pc_sharing`,`pc_topic`)
2507 ) ENGINE=MyISAM AUTO_INCREMENT=7 ;
2509 -- 
2510 -- Dumping data for table `openemr_postcalendar_events`
2511 -- 
2513 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');
2514 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');
2515 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');
2517 -- --------------------------------------------------------
2519 -- 
2520 -- Table structure for table `openemr_postcalendar_limits`
2521 -- 
2523 DROP TABLE IF EXISTS `openemr_postcalendar_limits`;
2524 CREATE TABLE `openemr_postcalendar_limits` (
2525   `pc_limitid` int(11) NOT NULL auto_increment,
2526   `pc_catid` int(11) NOT NULL default '0',
2527   `pc_starttime` time NOT NULL default '00:00:00',
2528   `pc_endtime` time NOT NULL default '00:00:00',
2529   `pc_limit` int(11) NOT NULL default '1',
2530   PRIMARY KEY  (`pc_limitid`)
2531 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2533 -- --------------------------------------------------------
2535 -- 
2536 -- Table structure for table `openemr_postcalendar_topics`
2537 -- 
2539 DROP TABLE IF EXISTS `openemr_postcalendar_topics`;
2540 CREATE TABLE `openemr_postcalendar_topics` (
2541   `pc_catid` int(11) unsigned NOT NULL auto_increment,
2542   `pc_catname` varchar(100) default NULL,
2543   `pc_catcolor` varchar(50) default NULL,
2544   `pc_catdesc` text,
2545   PRIMARY KEY  (`pc_catid`),
2546   KEY `basic_cat` (`pc_catname`,`pc_catcolor`)
2547 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2549 -- --------------------------------------------------------
2551 -- 
2552 -- Table structure for table `openemr_session_info`
2553 -- 
2555 DROP TABLE IF EXISTS `openemr_session_info`;
2556 CREATE TABLE `openemr_session_info` (
2557   `pn_sessid` varchar(32) NOT NULL default '',
2558   `pn_ipaddr` varchar(20) default NULL,
2559   `pn_firstused` int(11) NOT NULL default '0',
2560   `pn_lastused` int(11) NOT NULL default '0',
2561   `pn_uid` int(11) NOT NULL default '0',
2562   `pn_vars` blob,
2563   PRIMARY KEY  (`pn_sessid`)
2564 ) ENGINE=MyISAM;
2566 -- 
2567 -- Dumping data for table `openemr_session_info`
2568 -- 
2570 INSERT INTO `openemr_session_info` VALUES ('978d31441dccd350d406bfab98978f20', '127.0.0.1', 1109233952, 1109234177, 0, NULL);
2572 -- --------------------------------------------------------
2574 -- 
2575 -- Table structure for table `patient_data`
2576 -- 
2578 DROP TABLE IF EXISTS `patient_data`;
2579 CREATE TABLE `patient_data` (
2580   `id` bigint(20) NOT NULL auto_increment,
2581   `title` varchar(255) NOT NULL default '',
2582   `language` varchar(255) NOT NULL default '',
2583   `financial` varchar(255) NOT NULL default '',
2584   `fname` varchar(255) NOT NULL default '',
2585   `lname` varchar(255) NOT NULL default '',
2586   `mname` varchar(255) NOT NULL default '',
2587   `DOB` date default NULL,
2588   `street` varchar(255) NOT NULL default '',
2589   `postal_code` varchar(255) NOT NULL default '',
2590   `city` varchar(255) NOT NULL default '',
2591   `state` varchar(255) NOT NULL default '',
2592   `country_code` varchar(255) NOT NULL default '',
2593   `drivers_license` varchar(255) NOT NULL default '',
2594   `ss` varchar(255) NOT NULL default '',
2595   `occupation` longtext,
2596   `phone_home` varchar(255) NOT NULL default '',
2597   `phone_biz` varchar(255) NOT NULL default '',
2598   `phone_contact` varchar(255) NOT NULL default '',
2599   `phone_cell` varchar(255) NOT NULL default '',
2600   `pharmacy_id` int(11) NOT NULL default '0',
2601   `status` varchar(255) NOT NULL default '',
2602   `contact_relationship` varchar(255) NOT NULL default '',
2603   `date` datetime default NULL,
2604   `sex` varchar(255) NOT NULL default '',
2605   `referrer` varchar(255) NOT NULL default '',
2606   `referrerID` varchar(255) NOT NULL default '',
2607   `providerID` int(11) default NULL,
2608   `email` varchar(255) NOT NULL default '',
2609   `ethnoracial` varchar(255) NOT NULL default '',
2610   `interpretter` varchar(255) NOT NULL default '',
2611   `migrantseasonal` varchar(255) NOT NULL default '',
2612   `family_size` varchar(255) NOT NULL default '',
2613   `monthly_income` varchar(255) NOT NULL default '',
2614   `homeless` varchar(255) NOT NULL default '',
2615   `financial_review` datetime default NULL,
2616   `pubpid` varchar(255) NOT NULL default '',
2617   `pid` bigint(20) NOT NULL default '0',
2618   `genericname1` varchar(255) NOT NULL default '',
2619   `genericval1` varchar(255) NOT NULL default '',
2620   `genericname2` varchar(255) NOT NULL default '',
2621   `genericval2` varchar(255) NOT NULL default '',
2622   `hipaa_mail` varchar(3) NOT NULL default '',
2623   `hipaa_voice` varchar(3) NOT NULL default '',
2624   `hipaa_notice` varchar(3) NOT NULL default '',
2625   `hipaa_message` varchar(20) NOT NULL default '',
2626   `hipaa_allowsms` VARCHAR(3) NOT NULL DEFAULT 'NO',
2627   `hipaa_allowemail` VARCHAR(3) NOT NULL DEFAULT 'NO',
2628   `squad` varchar(32) NOT NULL default '',
2629   `fitness` int(11) NOT NULL default '0',
2630   `referral_source` varchar(30) NOT NULL default '',
2631   `usertext1` varchar(255) NOT NULL DEFAULT '',
2632   `usertext2` varchar(255) NOT NULL DEFAULT '',
2633   `usertext3` varchar(255) NOT NULL DEFAULT '',
2634   `usertext4` varchar(255) NOT NULL DEFAULT '',
2635   `usertext5` varchar(255) NOT NULL DEFAULT '',
2636   `usertext6` varchar(255) NOT NULL DEFAULT '',
2637   `usertext7` varchar(255) NOT NULL DEFAULT '',
2638   `usertext8` varchar(255) NOT NULL DEFAULT '',
2639   `userlist1` varchar(255) NOT NULL DEFAULT '',
2640   `userlist2` varchar(255) NOT NULL DEFAULT '',
2641   `userlist3` varchar(255) NOT NULL DEFAULT '',
2642   `userlist4` varchar(255) NOT NULL DEFAULT '',
2643   `userlist5` varchar(255) NOT NULL DEFAULT '',
2644   `userlist6` varchar(255) NOT NULL DEFAULT '',
2645   `userlist7` varchar(255) NOT NULL DEFAULT '',
2646   `pricelevel` varchar(255) NOT NULL default 'standard',
2647   `regdate`     date DEFAULT NULL COMMENT 'Registration Date',
2648   `contrastart` date DEFAULT NULL COMMENT 'Date contraceptives initially used',
2649   `completed_ad` VARCHAR(3) NOT NULL DEFAULT 'NO',
2650   `ad_reviewed` date DEFAULT NULL,
2651   `vfc` varchar(255) NOT NULL DEFAULT '',
2652   `mothersname` varchar(255) NOT NULL DEFAULT '',
2653   `guardiansname` varchar(255) NOT NULL DEFAULT '',
2654   `allow_imm_reg_use` varchar(255) NOT NULL DEFAULT '',
2655   `allow_imm_info_share` varchar(255) NOT NULL DEFAULT '',
2656   `allow_health_info_ex` varchar(255) NOT NULL DEFAULT '',
2657   UNIQUE KEY `pid` (`pid`),
2658   KEY `id` (`id`)
2659 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2661 -- --------------------------------------------------------
2663 -- 
2664 -- Table structure for table `payments`
2665 -- 
2667 DROP TABLE IF EXISTS `payments`;
2668 CREATE TABLE `payments` (
2669   `id` bigint(20) NOT NULL auto_increment,
2670   `pid` bigint(20) NOT NULL default '0',
2671   `dtime` datetime NOT NULL,
2672   `encounter` bigint(20) NOT NULL default '0',
2673   `user` varchar(255) default NULL,
2674   `method` varchar(255) default NULL,
2675   `source` varchar(255) default NULL,
2676   `amount1` decimal(12,2) NOT NULL default '0.00',
2677   `amount2` decimal(12,2) NOT NULL default '0.00',
2678   `posted1` decimal(12,2) NOT NULL default '0.00',
2679   `posted2` decimal(12,2) NOT NULL default '0.00',
2680   PRIMARY KEY  (`id`),
2681   KEY `pid` (`pid`)
2682 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2684 -- --------------------------------------------------------
2686 -- 
2687 -- Table structure for table `pharmacies`
2688 -- 
2690 DROP TABLE IF EXISTS `pharmacies`;
2691 CREATE TABLE `pharmacies` (
2692   `id` int(11) NOT NULL default '0',
2693   `name` varchar(255) default NULL,
2694   `transmit_method` int(11) NOT NULL default '1',
2695   `email` varchar(255) default NULL,
2696   PRIMARY KEY  (`id`)
2697 ) ENGINE=MyISAM;
2699 -- --------------------------------------------------------
2701 -- 
2702 -- Table structure for table `phone_numbers`
2703 -- 
2705 DROP TABLE IF EXISTS `phone_numbers`;
2706 CREATE TABLE `phone_numbers` (
2707   `id` int(11) NOT NULL default '0',
2708   `country_code` varchar(5) default NULL,
2709   `area_code` char(3) default NULL,
2710   `prefix` char(3) default NULL,
2711   `number` varchar(4) default NULL,
2712   `type` int(11) default NULL,
2713   `foreign_id` int(11) default NULL,
2714   PRIMARY KEY  (`id`),
2715   KEY `foreign_id` (`foreign_id`)
2716 ) ENGINE=MyISAM;
2718 -- --------------------------------------------------------
2720 -- 
2721 -- Table structure for table `pma_bookmark`
2722 -- 
2724 DROP TABLE IF EXISTS `pma_bookmark`;
2725 CREATE TABLE `pma_bookmark` (
2726   `id` int(11) NOT NULL auto_increment,
2727   `dbase` varchar(255) default NULL,
2728   `user` varchar(255) default NULL,
2729   `label` varchar(255) default NULL,
2730   `query` text,
2731   PRIMARY KEY  (`id`)
2732 ) ENGINE=MyISAM COMMENT='Bookmarks' AUTO_INCREMENT=10 ;
2734 -- 
2735 -- Dumping data for table `pma_bookmark`
2736 -- 
2738 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');
2739 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');
2740 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;');
2741 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');
2743 -- --------------------------------------------------------
2745 -- 
2746 -- Table structure for table `pma_column_info`
2747 -- 
2749 DROP TABLE IF EXISTS `pma_column_info`;
2750 CREATE TABLE `pma_column_info` (
2751   `id` int(5) unsigned NOT NULL auto_increment,
2752   `db_name` varchar(64) default NULL,
2753   `table_name` varchar(64) default NULL,
2754   `column_name` varchar(64) default NULL,
2755   `comment` varchar(255) default NULL,
2756   `mimetype` varchar(255) default NULL,
2757   `transformation` varchar(255) default NULL,
2758   `transformation_options` varchar(255) default NULL,
2759   PRIMARY KEY  (`id`),
2760   UNIQUE KEY `db_name` (`db_name`,`table_name`,`column_name`)
2761 ) ENGINE=MyISAM COMMENT='Column Information for phpMyAdmin' AUTO_INCREMENT=1 ;
2763 -- --------------------------------------------------------
2765 -- 
2766 -- Table structure for table `pma_history`
2767 -- 
2769 DROP TABLE IF EXISTS `pma_history`;
2770 CREATE TABLE `pma_history` (
2771   `id` bigint(20) unsigned NOT NULL auto_increment,
2772   `username` varchar(64) default NULL,
2773   `db` varchar(64) default NULL,
2774   `table` varchar(64) default NULL,
2775   `timevalue` timestamp NOT NULL,
2776   `sqlquery` text,
2777   PRIMARY KEY  (`id`),
2778   KEY `username` (`username`,`db`,`table`,`timevalue`)
2779 ) ENGINE=MyISAM COMMENT='SQL history' AUTO_INCREMENT=1 ;
2781 -- --------------------------------------------------------
2783 -- 
2784 -- Table structure for table `pma_pdf_pages`
2785 -- 
2787 DROP TABLE IF EXISTS `pma_pdf_pages`;
2788 CREATE TABLE `pma_pdf_pages` (
2789   `db_name` varchar(64) default NULL,
2790   `page_nr` int(10) unsigned NOT NULL auto_increment,
2791   `page_descr` varchar(50) default NULL,
2792   PRIMARY KEY  (`page_nr`),
2793   KEY `db_name` (`db_name`)
2794 ) ENGINE=MyISAM COMMENT='PDF Relationpages for PMA' AUTO_INCREMENT=1 ;
2796 -- --------------------------------------------------------
2798 -- 
2799 -- Table structure for table `pma_relation`
2800 -- 
2802 DROP TABLE IF EXISTS `pma_relation`;
2803 CREATE TABLE `pma_relation` (
2804   `master_db` varchar(64) NOT NULL default '',
2805   `master_table` varchar(64) NOT NULL default '',
2806   `master_field` varchar(64) NOT NULL default '',
2807   `foreign_db` varchar(64) default NULL,
2808   `foreign_table` varchar(64) default NULL,
2809   `foreign_field` varchar(64) default NULL,
2810   PRIMARY KEY  (`master_db`,`master_table`,`master_field`),
2811   KEY `foreign_field` (`foreign_db`,`foreign_table`)
2812 ) ENGINE=MyISAM COMMENT='Relation table';
2814 -- --------------------------------------------------------
2816 -- 
2817 -- Table structure for table `pma_table_coords`
2818 -- 
2820 DROP TABLE IF EXISTS `pma_table_coords`;
2821 CREATE TABLE `pma_table_coords` (
2822   `db_name` varchar(64) NOT NULL default '',
2823   `table_name` varchar(64) NOT NULL default '',
2824   `pdf_page_number` int(11) NOT NULL default '0',
2825   `x` float unsigned NOT NULL default '0',
2826   `y` float unsigned NOT NULL default '0',
2827   PRIMARY KEY  (`db_name`,`table_name`,`pdf_page_number`)
2828 ) ENGINE=MyISAM COMMENT='Table coordinates for phpMyAdmin PDF output';
2830 -- --------------------------------------------------------
2832 -- 
2833 -- Table structure for table `pma_table_info`
2834 -- 
2836 DROP TABLE IF EXISTS `pma_table_info`;
2837 CREATE TABLE `pma_table_info` (
2838   `db_name` varchar(64) NOT NULL default '',
2839   `table_name` varchar(64) NOT NULL default '',
2840   `display_field` varchar(64) default NULL,
2841   PRIMARY KEY  (`db_name`,`table_name`)
2842 ) ENGINE=MyISAM COMMENT='Table information for phpMyAdmin';
2844 -- --------------------------------------------------------
2846 -- 
2847 -- Table structure for table `pnotes`
2848 -- 
2850 DROP TABLE IF EXISTS `pnotes`;
2851 CREATE TABLE `pnotes` (
2852   `id` bigint(20) NOT NULL auto_increment,
2853   `date` datetime default NULL,
2854   `body` longtext,
2855   `pid` bigint(20) default NULL,
2856   `user` varchar(255) default NULL,
2857   `groupname` varchar(255) default NULL,
2858   `activity` tinyint(4) default NULL,
2859   `authorized` tinyint(4) default NULL,
2860   `title` varchar(255) default NULL,
2861   `assigned_to` varchar(255) default NULL,
2862   `deleted` tinyint(4) default 0 COMMENT 'flag indicates note is deleted',
2863   `message_status` VARCHAR(20) NOT NULL DEFAULT 'New',
2864   PRIMARY KEY  (`id`)
2865 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2867 -- --------------------------------------------------------
2869 -- 
2870 -- Table structure for table `prescriptions`
2871 -- 
2873 DROP TABLE IF EXISTS `prescriptions`;
2874 CREATE TABLE `prescriptions` (
2875   `id` int(11) NOT NULL auto_increment,
2876   `patient_id` int(11) default NULL,
2877   `filled_by_id` int(11) default NULL,
2878   `pharmacy_id` int(11) default NULL,
2879   `date_added` date default NULL,
2880   `date_modified` date default NULL,
2881   `provider_id` int(11) default NULL,
2882   `start_date` date default NULL,
2883   `drug` varchar(150) default NULL,
2884   `drug_id` int(11) NOT NULL default '0',
2885   `form` int(3) default NULL,
2886   `dosage` varchar(100) default NULL,
2887   `quantity` varchar(31) default NULL,
2888   `size` float unsigned default NULL,
2889   `unit` int(11) default NULL,
2890   `route` int(11) default NULL,
2891   `interval` int(11) default NULL,
2892   `substitute` int(11) default NULL,
2893   `refills` int(11) default NULL,
2894   `per_refill` int(11) default NULL,
2895   `filled_date` date default NULL,
2896   `medication` int(11) default NULL,
2897   `note` text,
2898   `active` int(11) NOT NULL default '1',
2899   PRIMARY KEY  (`id`)
2900 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2902 -- --------------------------------------------------------
2904 -- 
2905 -- Table structure for table `prices`
2906 -- 
2908 DROP TABLE IF EXISTS `prices`;
2909 CREATE TABLE `prices` (
2910   `pr_id` varchar(11) NOT NULL default '',
2911   `pr_selector` varchar(255) NOT NULL default '' COMMENT 'template selector for drugs, empty for codes',
2912   `pr_level` varchar(31) NOT NULL default '',
2913   `pr_price` decimal(12,2) NOT NULL default '0.00' COMMENT 'price in local currency',
2914   PRIMARY KEY  (`pr_id`,`pr_selector`,`pr_level`)
2915 ) ENGINE=MyISAM;
2917 -- --------------------------------------------------------
2919 -- 
2920 -- Table structure for table `registry`
2921 -- 
2923 DROP TABLE IF EXISTS `registry`;
2924 CREATE TABLE `registry` (
2925   `name` varchar(255) default NULL,
2926   `state` tinyint(4) default NULL,
2927   `directory` varchar(255) default NULL,
2928   `id` bigint(20) NOT NULL auto_increment,
2929   `sql_run` tinyint(4) default NULL,
2930   `unpackaged` tinyint(4) default NULL,
2931   `date` datetime default NULL,
2932   `priority` int(11) default '0',
2933   `category` varchar(255) default NULL,
2934   `nickname` varchar(255) default NULL,
2935   PRIMARY KEY  (`id`)
2936 ) ENGINE=MyISAM AUTO_INCREMENT=16 ;
2938 -- 
2939 -- Dumping data for table `registry`
2940 -- 
2942 INSERT INTO `registry` VALUES ('New Encounter Form', 1, 'newpatient', 1, 1, 1, '2003-09-14 15:16:45', 0, 'Administrative', '');
2943 INSERT INTO `registry` VALUES ('Review of Systems Checks', 1, 'reviewofs', 9, 1, 1, '2003-09-14 15:16:45', 0, 'Clinical', '');
2944 INSERT INTO `registry` VALUES ('Speech Dictation', 1, 'dictation', 10, 1, 1, '2003-09-14 15:16:45', 0, 'Clinical', '');
2945 INSERT INTO `registry` VALUES ('SOAP', 1, 'soap', 11, 1, 1, '2005-03-03 00:16:35', 0, 'Clinical', '');
2946 INSERT INTO `registry` VALUES ('Vitals', 1, 'vitals', 12, 1, 1, '2005-03-03 00:16:34', 0, 'Clinical', '');
2947 INSERT INTO `registry` VALUES ('Review Of Systems', 1, 'ros', 13, 1, 1, '2005-03-03 00:16:30', 0, 'Clinical', '');
2948 INSERT INTO `registry` VALUES ('Fee Sheet', 1, 'fee_sheet', 14, 1, 1, '2007-07-28 00:00:00', 0, 'Administrative', '');
2949 INSERT INTO `registry` VALUES ('Misc Billing Options HCFA', 1, 'misc_billing_options', 15, 1, 1, '2007-07-28 00:00:00', 0, 'Administrative', '');
2950 INSERT INTO `registry` VALUES ('Procedure Order', 1, 'procedure_order', 16, 1, 1, '2010-02-25 00:00:00', 0, 'Administrative', '');
2952 -- --------------------------------------------------------
2954 -- 
2955 -- Table structure for table `sequences`
2956 -- 
2958 DROP TABLE IF EXISTS `sequences`;
2959 CREATE TABLE `sequences` (
2960   `id` int(11) unsigned NOT NULL default '0'
2961 ) ENGINE=MyISAM;
2963 -- 
2964 -- Dumping data for table `sequences`
2965 -- 
2967 INSERT INTO `sequences` VALUES (1);
2969 -- --------------------------------------------------------
2971 -- 
2972 -- Table structure for table `transactions`
2973 -- 
2975 DROP TABLE IF EXISTS `transactions`;
2976 CREATE TABLE `transactions` (
2977   `id`                      bigint(20)   NOT NULL auto_increment,
2978   `date`                    datetime     default NULL,
2979   `title`                   varchar(255) NOT NULL DEFAULT '',
2980   `body`                    longtext     NOT NULL DEFAULT '',
2981   `pid`                     bigint(20)   default NULL,
2982   `user`                    varchar(255) NOT NULL DEFAULT '',
2983   `groupname`               varchar(255) NOT NULL DEFAULT '',
2984   `authorized`              tinyint(4)   default NULL,
2985   `refer_date`              date         DEFAULT NULL,
2986   `refer_from`              int(11)      NOT NULL DEFAULT 0,
2987   `refer_to`                int(11)      NOT NULL DEFAULT 0,
2988   `refer_diag`              varchar(255) NOT NULL DEFAULT '',
2989   `refer_risk_level`        varchar(255) NOT NULL DEFAULT '',
2990   `refer_vitals`            tinyint(1)   NOT NULL DEFAULT 0,
2991   `refer_external`          tinyint(1)   NOT NULL DEFAULT 0,
2992   `refer_related_code`      varchar(255) NOT NULL DEFAULT '',
2993   `refer_reply_date`        date         DEFAULT NULL,
2994   `reply_date`              date         DEFAULT NULL,
2995   `reply_from`              varchar(255) NOT NULL DEFAULT '',
2996   `reply_init_diag`         varchar(255) NOT NULL DEFAULT '',
2997   `reply_final_diag`        varchar(255) NOT NULL DEFAULT '',
2998   `reply_documents`         varchar(255) NOT NULL DEFAULT '',
2999   `reply_findings`          text         NOT NULL DEFAULT '',
3000   `reply_services`          text         NOT NULL DEFAULT '',
3001   `reply_recommend`         text         NOT NULL DEFAULT '',
3002   `reply_rx_refer`          text         NOT NULL DEFAULT '',
3003   `reply_related_code`      varchar(255) NOT NULL DEFAULT '',
3004   PRIMARY KEY  (`id`)
3005 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
3007 -- --------------------------------------------------------
3009 -- 
3010 -- Table structure for table `users`
3011 -- 
3013 DROP TABLE IF EXISTS `users`;
3014 CREATE TABLE `users` (
3015   `id` bigint(20) NOT NULL auto_increment,
3016   `username` varchar(255) default NULL,
3017   `password` longtext,
3018   `authorized` tinyint(4) default NULL,
3019   `info` longtext,
3020   `source` tinyint(4) default NULL,
3021   `fname` varchar(255) default NULL,
3022   `mname` varchar(255) default NULL,
3023   `lname` varchar(255) default NULL,
3024   `federaltaxid` varchar(255) default NULL,
3025   `federaldrugid` varchar(255) default NULL,
3026   `upin` varchar(255) default NULL,
3027   `facility` varchar(255) default NULL,
3028   `facility_id` int(11) NOT NULL default '0',
3029   `see_auth` int(11) NOT NULL default '1',
3030   `active` tinyint(1) NOT NULL default '1',
3031   `npi` varchar(15) default NULL,
3032   `title` varchar(30) default NULL,
3033   `specialty` varchar(255) default NULL,
3034   `billname` varchar(255) default NULL,
3035   `email` varchar(255) default NULL,
3036   `url` varchar(255) default NULL,
3037   `assistant` varchar(255) default NULL,
3038   `organization` varchar(255) default NULL,
3039   `valedictory` varchar(255) default NULL,
3040   `street` varchar(60) default NULL,
3041   `streetb` varchar(60) default NULL,
3042   `city` varchar(30) default NULL,
3043   `state` varchar(30) default NULL,
3044   `zip` varchar(20) default NULL,
3045   `street2` varchar(60) default NULL,
3046   `streetb2` varchar(60) default NULL,
3047   `city2` varchar(30) default NULL,
3048   `state2` varchar(30) default NULL,
3049   `zip2` varchar(20) default NULL,
3050   `phone` varchar(30) default NULL,
3051   `fax` varchar(30) default NULL,
3052   `phonew1` varchar(30) default NULL,
3053   `phonew2` varchar(30) default NULL,
3054   `phonecell` varchar(30) default NULL,
3055   `notes` text,
3056   `cal_ui` tinyint(4) NOT NULL default '1',
3057   `taxonomy` varchar(30) NOT NULL DEFAULT '207Q00000X',
3058   `ssi_relayhealth` varchar(64) NULL,
3059   `calendar` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '1 = appears in calendar',
3060   `abook_type` varchar(31) NOT NULL DEFAULT '',
3061   `pwd_expiration_date` date default NULL,
3062   `pwd_history1` longtext default NULL,
3063   `pwd_history2` longtext default NULL,
3064   `default_warehouse` varchar(31) NOT NULL DEFAULT '',
3065   `irnpool` varchar(31) NOT NULL DEFAULT '',
3066   PRIMARY KEY  (`id`)
3067 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
3069 -- --------------------------------------------------------
3071 -- 
3072 -- Table structure for table `x12_partners`
3073 -- 
3075 DROP TABLE IF EXISTS `x12_partners`;
3076 CREATE TABLE `x12_partners` (
3077   `id` int(11) NOT NULL default '0',
3078   `name` varchar(255) default NULL,
3079   `id_number` varchar(255) default NULL,
3080   `x12_sender_id` varchar(255) default NULL,
3081   `x12_receiver_id` varchar(255) default NULL,
3082   `x12_version` varchar(255) default NULL,
3083   `processing_format` enum('standard','medi-cal','cms','proxymed') default NULL,
3084   `x12_isa05` char(2)     NOT NULL DEFAULT 'ZZ',
3085   `x12_isa07` char(2)     NOT NULL DEFAULT 'ZZ',
3086   `x12_isa14` char(1)     NOT NULL DEFAULT '0',
3087   `x12_isa15` char(1)     NOT NULL DEFAULT 'P',
3088   `x12_gs02`  varchar(15) NOT NULL DEFAULT '',
3089   `x12_per06` varchar(80) NOT NULL DEFAULT '',
3090   PRIMARY KEY  (`id`)
3091 ) ENGINE=MyISAM;
3093 ------------------------------------------------------------------------------------- 
3094 -- Table structure for table `automatic_notification`
3095 -- 
3097 DROP TABLE IF EXISTS `automatic_notification`;
3098 CREATE TABLE `automatic_notification` (
3099   `notification_id` int(5) NOT NULL auto_increment,
3100   `sms_gateway_type` varchar(255) NOT NULL,
3101   `next_app_date` date NOT NULL,
3102   `next_app_time` varchar(10) NOT NULL,
3103   `provider_name` varchar(100) NOT NULL,
3104   `message` text NOT NULL,
3105   `email_sender` varchar(100) NOT NULL,
3106   `email_subject` varchar(100) NOT NULL,
3107   `type` enum('SMS','Email') NOT NULL default 'SMS',
3108   `notification_sent_date` datetime NOT NULL,
3109   PRIMARY KEY  (`notification_id`)
3110 ) ENGINE=InnoDB AUTO_INCREMENT=3 ;
3112 -- 
3113 -- Dumping data for table `automatic_notification`
3114 -- 
3116 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'),
3117 (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');
3119 -- --------------------------------------------------------
3121 -- 
3122 -- Table structure for table `notification_log`
3123 -- 
3125 DROP TABLE IF EXISTS `notification_log`;
3126 CREATE TABLE `notification_log` (
3127   `iLogId` int(11) NOT NULL auto_increment,
3128   `pid` int(7) NOT NULL,
3129   `pc_eid` int(11) unsigned NULL,
3130   `sms_gateway_type` varchar(50) NOT NULL,
3131   `smsgateway_info` varchar(255) NOT NULL,
3132   `message` text NOT NULL,
3133   `email_sender` varchar(255) NOT NULL,
3134   `email_subject` varchar(255) NOT NULL,
3135   `type` enum('SMS','Email') NOT NULL,
3136   `patient_info` text NOT NULL,
3137   `pc_eventDate` date NOT NULL,
3138   `pc_endDate` date NOT NULL,
3139   `pc_startTime` time NOT NULL,
3140   `pc_endTime` time NOT NULL,
3141   `dSentDateTime` datetime NOT NULL,
3142   PRIMARY KEY  (`iLogId`)
3143 ) ENGINE=InnoDB AUTO_INCREMENT=5 ;
3145 -- --------------------------------------------------------
3147 -- 
3148 -- Table structure for table `notification_settings`
3149 -- 
3151 DROP TABLE IF EXISTS `notification_settings`;
3152 CREATE TABLE `notification_settings` (
3153   `SettingsId` int(3) NOT NULL auto_increment,
3154   `Send_SMS_Before_Hours` int(3) NOT NULL,
3155   `Send_Email_Before_Hours` int(3) NOT NULL,
3156   `SMS_gateway_username` varchar(100) NOT NULL,
3157   `SMS_gateway_password` varchar(100) NOT NULL,
3158   `SMS_gateway_apikey` varchar(100) NOT NULL,
3159   `type` varchar(50) NOT NULL,
3160   PRIMARY KEY  (`SettingsId`)
3161 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
3163 -- 
3164 -- Dumping data for table `notification_settings`
3165 -- 
3167 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');
3169 -- -------------------------------------------------------------------
3171 CREATE TABLE chart_tracker (
3172   ct_pid            int(11)       NOT NULL,
3173   ct_when           datetime      NOT NULL,
3174   ct_userid         bigint(20)    NOT NULL DEFAULT 0,
3175   ct_location       varchar(31)   NOT NULL DEFAULT '',
3176   PRIMARY KEY (ct_pid, ct_when)
3177 ) ENGINE=MyISAM;
3179 CREATE TABLE ar_session (
3180   session_id     int unsigned  NOT NULL AUTO_INCREMENT,
3181   payer_id       int(11)       NOT NULL            COMMENT '0=pt else references insurance_companies.id',
3182   user_id        int(11)       NOT NULL            COMMENT 'references users.id for session owner',
3183   closed         tinyint(1)    NOT NULL DEFAULT 0  COMMENT '0=no, 1=yes',
3184   reference      varchar(255)  NOT NULL DEFAULT '' COMMENT 'check or EOB number',
3185   check_date     date          DEFAULT NULL,
3186   deposit_date   date          DEFAULT NULL,
3187   pay_total      decimal(12,2) NOT NULL DEFAULT 0,
3188   PRIMARY KEY (session_id),
3189   KEY user_closed (user_id, closed),
3190   KEY deposit_date (deposit_date)
3191 ) ENGINE=MyISAM;
3193 CREATE TABLE ar_activity (
3194   pid            int(11)       NOT NULL,
3195   encounter      int(11)       NOT NULL,
3196   sequence_no    int unsigned  NOT NULL AUTO_INCREMENT,
3197   code           varchar(9)    NOT NULL            COMMENT 'empty means claim level',
3198   modifier       varchar(5)    NOT NULL DEFAULT '',
3199   payer_type     int           NOT NULL            COMMENT '0=pt, 1=ins1, 2=ins2, etc',
3200   post_time      datetime      NOT NULL,
3201   post_user      int(11)       NOT NULL            COMMENT 'references users.id',
3202   session_id     int unsigned  NOT NULL            COMMENT 'references ar_session.session_id',
3203   memo           varchar(255)  NOT NULL DEFAULT '' COMMENT 'adjustment reasons go here',
3204   pay_amount     decimal(12,2) NOT NULL DEFAULT 0  COMMENT 'either pay or adj will always be 0',
3205   adj_amount     decimal(12,2) NOT NULL DEFAULT 0,
3206   PRIMARY KEY (pid, encounter, sequence_no),
3207   KEY session_id (session_id)
3208 ) ENGINE=MyISAM;
3210 CREATE TABLE `users_facility` (
3211   `tablename` varchar(64) NOT NULL,
3212   `table_id` int(11) NOT NULL,
3213   `facility_id` int(11) NOT NULL,
3214   PRIMARY KEY (`tablename`,`table_id`,`facility_id`)
3215 ) ENGINE=InnoDB COMMENT='joins users or patient_data to facility table';
3217 CREATE TABLE `lbf_data` (
3218   `form_id`     int(11)      NOT NULL AUTO_INCREMENT COMMENT 'references forms.form_id',
3219   `field_id`    varchar(31)  NOT NULL COMMENT 'references layout_options.field_id',
3220   `field_value` varchar(255) NOT NULL,
3221   PRIMARY KEY (`form_id`,`field_id`)
3222 ) ENGINE=MyISAM COMMENT='contains all data from layout-based forms';
3224 CREATE TABLE gprelations (
3225   type1 int(2)     NOT NULL,
3226   id1   bigint(20) NOT NULL,
3227   type2 int(2)     NOT NULL,
3228   id2   bigint(20) NOT NULL,
3229   PRIMARY KEY (type1,id1,type2,id2),
3230   KEY key2  (type2,id2)
3231 ) ENGINE=MyISAM COMMENT='general purpose relations';
3233 CREATE TABLE `procedure_type` (
3234   `procedure_type_id`   bigint(20)   NOT NULL AUTO_INCREMENT,
3235   `parent`              bigint(20)   NOT NULL DEFAULT 0  COMMENT 'references procedure_type.procedure_type_id',
3236   `name`                varchar(63)  NOT NULL DEFAULT '' COMMENT 'name for this category, procedure or result type',
3237   `lab_id`              bigint(20)   NOT NULL DEFAULT 0  COMMENT 'references users.id, 0 means default to parent',
3238   `procedure_code`      varchar(31)  NOT NULL DEFAULT '' COMMENT 'code identifying this procedure',
3239   `procedure_type`      varchar(31)  NOT NULL DEFAULT '' COMMENT 'see list proc_type',
3240   `body_site`           varchar(31)  NOT NULL DEFAULT '' COMMENT 'where to do injection, e.g. arm, buttok',
3241   `specimen`            varchar(31)  NOT NULL DEFAULT '' COMMENT 'blood, urine, saliva, etc.',
3242   `route_admin`         varchar(31)  NOT NULL DEFAULT '' COMMENT 'oral, injection',
3243   `laterality`          varchar(31)  NOT NULL DEFAULT '' COMMENT 'left, right, ...',
3244   `description`         varchar(255) NOT NULL DEFAULT '' COMMENT 'descriptive text for procedure_code',
3245   `standard_code`       varchar(255) NOT NULL DEFAULT '' COMMENT 'industry standard code type and code (e.g. CPT4:12345)',
3246   `related_code`        varchar(255) NOT NULL DEFAULT '' COMMENT 'suggested code(s) for followup services if result is abnormal',
3247   `units`               varchar(31)  NOT NULL DEFAULT '' COMMENT 'default for procedure_result.units',
3248   `range`               varchar(255) NOT NULL DEFAULT '' COMMENT 'default for procedure_result.range',
3249   `seq`                 int(11)      NOT NULL default 0  COMMENT 'sequence number for ordering',
3250   PRIMARY KEY (`procedure_type_id`),
3251   KEY parent (parent)
3252 ) ENGINE=MyISAM;
3254 CREATE TABLE `procedure_order` (
3255   `procedure_order_id`     bigint(20)   NOT NULL AUTO_INCREMENT,
3256   `procedure_type_id`      bigint(20)   NOT NULL            COMMENT 'references procedure_type.procedure_type_id',
3257   `provider_id`            bigint(20)   NOT NULL DEFAULT 0  COMMENT 'references users.id',
3258   `patient_id`             bigint(20)   NOT NULL            COMMENT 'references patient_data.pid',
3259   `encounter_id`           bigint(20)   NOT NULL DEFAULT 0  COMMENT 'references form_encounter.encounter',
3260   `date_collected`         datetime     DEFAULT NULL        COMMENT 'time specimen collected',
3261   `date_ordered`           date         DEFAULT NULL,
3262   `order_priority`         varchar(31)  NOT NULL DEFAULT '',
3263   `order_status`           varchar(31)  NOT NULL DEFAULT '' COMMENT 'pending,routed,complete,canceled',
3264   `patient_instructions`   text         NOT NULL DEFAULT '',
3265   `activity`               tinyint(1)   NOT NULL DEFAULT 1  COMMENT '0 if deleted',
3266   `control_id`             bigint(20)   NOT NULL            COMMENT 'This is the CONTROL ID that is sent back from lab',
3267   PRIMARY KEY (`procedure_order_id`),
3268   KEY datepid (date_ordered, patient_id)
3269 ) ENGINE=MyISAM;
3271 CREATE TABLE `procedure_report` (
3272   `procedure_report_id` bigint(20)     NOT NULL AUTO_INCREMENT,
3273   `procedure_order_id`  bigint(20)     DEFAULT NULL   COMMENT 'references procedure_order.procedure_order_id',
3274   `date_collected`      datetime       DEFAULT NULL,
3275   `date_report`         date           DEFAULT NULL,
3276   `source`              bigint(20)     NOT NULL DEFAULT 0  COMMENT 'references users.id, who entered this data',
3277   `specimen_num`        varchar(63)    NOT NULL DEFAULT '',
3278   `report_status`       varchar(31)    NOT NULL DEFAULT '' COMMENT 'received,complete,error',
3279   `review_status`       varchar(31)    NOT NULL DEFAULT 'received' COMMENT 'panding reivew status: received,reviewed',  
3280   PRIMARY KEY (`procedure_report_id`),
3281   KEY procedure_order_id (procedure_order_id)
3282 ) ENGINE=MyISAM; 
3284 CREATE TABLE `procedure_result` (
3285   `procedure_result_id` bigint(20)   NOT NULL AUTO_INCREMENT,
3286   `procedure_report_id` bigint(20)   NOT NULL            COMMENT 'references procedure_report.procedure_report_id',
3287   `procedure_type_id`   bigint(20)   NOT NULL            COMMENT 'references procedure_type.procedure_type_id',
3288   `date`                datetime     DEFAULT NULL        COMMENT 'lab-provided date specific to this result',
3289   `facility`            varchar(255) NOT NULL DEFAULT '' COMMENT 'lab-provided testing facility ID',
3290   `units`               varchar(31)  NOT NULL DEFAULT '',
3291   `result`              varchar(255) NOT NULL DEFAULT '',
3292   `range`               varchar(255) NOT NULL DEFAULT '',
3293   `abnormal`            varchar(31)  NOT NULL DEFAULT '' COMMENT 'no,yes,high,low',
3294   `comments`            text         NOT NULL DEFAULT '' COMMENT 'comments from the lab',
3295   `document_id`         bigint(20)   NOT NULL DEFAULT 0  COMMENT 'references documents.id if this result is a document',
3296   `result_status`       varchar(31)  NOT NULL DEFAULT '' COMMENT 'preliminary, cannot be done, final, corrected, incompete...etc.',
3297   PRIMARY KEY (`procedure_result_id`),
3298   KEY procedure_report_id (procedure_report_id)
3299 ) ENGINE=MyISAM; 
3301 CREATE TABLE `globals` (
3302   `gl_name`             varchar(63)    NOT NULL,
3303   `gl_index`            int(11)        NOT NULL DEFAULT 0,
3304   `gl_value`            varchar(255)   NOT NULL DEFAULT '',
3305   PRIMARY KEY (`gl_name`, `gl_index`)
3306 ) ENGINE=MyISAM; 
3308 CREATE TABLE code_types (
3309   ct_key  varchar(15) NOT NULL           COMMENT 'short alphanumeric name',
3310   ct_id   int(11)     UNIQUE NOT NULL    COMMENT 'numeric identifier',
3311   ct_seq  int(11)     NOT NULL DEFAULT 0 COMMENT 'sort order',
3312   ct_mod  int(11)     NOT NULL DEFAULT 0 COMMENT 'length of modifier field',
3313   ct_just varchar(15) NOT NULL DEFAULT ''COMMENT 'ct_key of justify type, if any',
3314   ct_mask varchar(9)  NOT NULL DEFAULT ''COMMENT 'formatting mask for code values',
3315   ct_fee  tinyint(1)  NOT NULL default 0 COMMENT '1 if fees are used',
3316   ct_rel  tinyint(1)  NOT NULL default 0 COMMENT '1 if can relate to other code types',
3317   ct_nofs tinyint(1)  NOT NULL default 0 COMMENT '1 if to be hidden in the fee sheet',
3318   ct_diag tinyint(1)  NOT NULL default 0 COMMENT '1 if this is a diagnosis type',
3319   PRIMARY KEY (ct_key)
3320 ) ENGINE=MyISAM;
3321 INSERT INTO code_types (ct_key, ct_id, ct_seq, ct_mod, ct_just, ct_fee, ct_rel, ct_nofs, ct_diag ) VALUES ('ICD9' , 2, 1, 2, ''    , 0, 0, 0, 1);
3322 INSERT INTO code_types (ct_key, ct_id, ct_seq, ct_mod, ct_just, ct_fee, ct_rel, ct_nofs, ct_diag ) VALUES ('CPT4' , 1, 2, 2, 'ICD9', 1, 0, 0, 0);
3323 INSERT INTO code_types (ct_key, ct_id, ct_seq, ct_mod, ct_just, ct_fee, ct_rel, ct_nofs, ct_diag ) VALUES ('HCPCS', 3, 3, 2, 'ICD9', 1, 0, 0, 0);
3325 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('lists', 'code_types', 'Code Types', 1);