incremented database counter for prior commit and removed trailing whitespacing
[openemr.git] / sql / 4_2_2-to-5_0_0_upgrade.sql
blobdc8852f7755b6bb1e79209da422732a276518e61
1 --
2 --  Comment Meta Language Constructs:
3 --
4 --  #IfNotTable
5 --    argument: table_name
6 --    behavior: if the table_name does not exist,  the block will be executed
8 --  #IfTable
9 --    argument: table_name
10 --    behavior: if the table_name does exist, the block will be executed
12 --  #IfColumn
13 --    arguments: table_name colname
14 --    behavior:  if the table and column exist,  the block will be executed
16 --  #IfMissingColumn
17 --    arguments: table_name colname
18 --    behavior:  if the table exists but the column does not,  the block will be executed
20 --  #IfNotColumnType
21 --    arguments: table_name colname value
22 --    behavior:  If the table table_name does not have a column colname with a data type equal to value, then the block will be executed
24 --  #IfNotRow
25 --    arguments: table_name colname value
26 --    behavior:  If the table table_name does not have a row where colname = value, the block will be executed.
28 --  #IfNotRow2D
29 --    arguments: table_name colname value colname2 value2
30 --    behavior:  If the table table_name does not have a row where colname = value AND colname2 = value2, the block will be executed.
32 --  #IfNotRow3D
33 --    arguments: table_name colname value colname2 value2 colname3 value3
34 --    behavior:  If the table table_name does not have a row where colname = value AND colname2 = value2 AND colname3 = value3, the block will be executed.
36 --  #IfNotRow4D
37 --    arguments: table_name colname value colname2 value2 colname3 value3 colname4 value4
38 --    behavior:  If the table table_name does not have a row where colname = value AND colname2 = value2 AND colname3 = value3 AND colname4 = value4, the block will be executed.
40 --  #IfNotRow2Dx2
41 --    desc:      This is a very specialized function to allow adding items to the list_options table to avoid both redundant option_id and title in each element.
42 --    arguments: table_name colname value colname2 value2 colname3 value3
43 --    behavior:  The block will be executed if both statements below are true:
44 --               1) The table table_name does not have a row where colname = value AND colname2 = value2.
45 --               2) The table table_name does not have a row where colname = value AND colname3 = value3.
47 --  #IfRow2D
48 --    arguments: table_name colname value colname2 value2
49 --    behavior:  If the table table_name does have a row where colname = value AND colname2 = value2, the block will be executed.
51 --  #IfRow3D
52 --        arguments: table_name colname value colname2 value2 colname3 value3
53 --        behavior:  If the table table_name does have a row where colname = value AND colname2 = value2 AND colname3 = value3, the block will be executed.
55 --  #IfIndex
56 --    desc:      This function is most often used for dropping of indexes/keys.
57 --    arguments: table_name colname
58 --    behavior:  If the table and index exist the relevant statements are executed, otherwise not.
60 --  #IfNotIndex
61 --    desc:      This function will allow adding of indexes/keys.
62 --    arguments: table_name colname
63 --    behavior:  If the index does not exist, it will be created
65 --  #EndIf
66 --    all blocks are terminated with a #EndIf statement.
68 --  #IfNotListReaction
69 --    Custom function for creating Reaction List
71 --  #IfNotListOccupation
72 --    Custom function for creating Occupation List
74 --  #IfTextNullFixNeeded
75 --    desc: convert all text fields without default null to have default null.
76 --    arguments: none
78 --  #IfTableEngine
79 --    desc:      Execute SQL if the table has been created with given engine specified.
80 --    arguments: table_name engine
81 --    behavior:  Use when engine conversion requires more than one ALTER TABLE
83 --  #IfInnoDBMigrationNeeded
84 --    desc: find all MyISAM tables and convert them to InnoDB.
85 --    arguments: none
86 --    behavior: can take a long time.
89 -- To ensure proper compatibility with MySQL/MariaDB and InnoDB, changing all *TEXT fields to
90 -- correctly use NULL as default.
91 #IfTextNullFixNeeded
92 #EndIf
95 -- The following 4 tables were using AUTO_INCREMENT field in the end of primary key, which needed to be
96 -- modified to support InnoDB,
99 -- 1. ar_activity
101 #IfTableEngine ar_activity MyISAM
102 ALTER TABLE `ar_activity` MODIFY `sequence_no` int UNSIGNED NOT NULL COMMENT 'Sequence_no, incremented in code';
103 ALTER TABLE `ar_activity` ENGINE="InnoDB";
104 #EndIf
106 -- 2. claims
108 #IfTableEngine claims MyISAM
109 ALTER TABLE `claims` MODIFY `version` int(10) UNSIGNED NOT NULL COMMENT 'Version, incremented in code';
110 ALTER TABLE `claims` ENGINE="InnoDB";
111 #EndIf
113 -- 3. procedure_answers
115 #IfTableEngine procedure_answers MyISAM
116 ALTER TABLE `procedure_answers` MODIFY `answer_seq` int(11) NOT NULL COMMENT 'Supports multiple-choice questions. Answer_seq, incremented in code';
117 ALTER TABLE `procedure_answers` ENGINE="InnoDB";
118 #EndIf
120 -- 4. procedure_order_code
122 #IfTableEngine procedure_order_code MyISAM
123 -- Modify the table for InnoDB
124 -- remove NOT NULL DEFAULT "" declaration from TEXT field.
125 -- remove AUTO_INCREMENT field declaration
126 ALTER TABLE `procedure_order_code` MODIFY `procedure_order_seq` int(11) NOT NULL COMMENT 'Supports multiple tests per order. Procedure_order_seq incremented in code';
127 ALTER TABLE `procedure_order_code` ENGINE="InnoDB";
128 #EndIf
131 -- Other tables do not need special treatment before conversion to InnoDB.
132 -- Warning: running this query can take a long time.
133 #IfInnoDBMigrationNeeded
134 -- Modifies all remaining MyISAM tables to InnoDB
135 #EndIf
137 #IfNotTable valueset
138 CREATE TABLE `valueset` (
139   `nqf_code` varchar(255) NOT NULL DEFAULT '',
140   `code` varchar(255) NOT NULL DEFAULT '',
141   `code_system` varchar(255) NOT NULL DEFAULT '',
142   `code_type` varchar(255) DEFAULT NULL,
143   `valueset` varchar(255) NOT NULL DEFAULT '',
144   `description` varchar(255) DEFAULT NULL,
145   `valueset_name` varchar(500) DEFAULT NULL,
146   PRIMARY KEY (`nqf_code`,`code`,`valueset`)
147 ) ENGINE=InnoDB;
148 #EndIf
150 #IfMissingColumn openemr_postcalendar_categories pc_active
151         ALTER TABLE `openemr_postcalendar_categories` ADD `pc_active` tinyint(1) NOT NULL DEFAULT 1;
152 #Endif
154 #IfMissingColumn openemr_postcalendar_categories pc_seq
155         ALTER TABLE `openemr_postcalendar_categories` ADD `pc_seq` int(11) NOT NULL DEFAULT '0';
156         UPDATE `openemr_postcalendar_categories` set pc_seq = pc_catid;
157 #EndIf
159 -- Mu2 New Encounter Categories
160 #IfNotRow openemr_postcalendar_categories pc_catname Health and Behavioral Assessment
161         SET @catid = (SELECT MAX(pc_catid) FROM  openemr_postcalendar_categories);
162         INSERT INTO `openemr_postcalendar_categories` (`pc_catid`, `pc_catname`, `pc_catcolor`, `pc_catdesc`, `pc_recurrtype`, `pc_enddate`, `pc_recurrspec`, `pc_recurrfreq`, `pc_duration`, `pc_end_date_flag`, `pc_end_date_type`, `pc_end_date_freq`, `pc_end_all_day`, `pc_dailylimit`, `pc_cattype`, `pc_active`, `pc_seq`) VALUES (@catid+1, 'Health and Behavioral Assessment', '#C7C7C7', 'Health and Behavioral Assessment', 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,0,1,@catid+1);
163         INSERT INTO `enc_category_map` ( `rule_enc_id`, `main_cat_id` ) VALUES ('enc_hea_and_beh', @catid+1);
164 #EndIf
166 #IfNotRow openemr_postcalendar_categories pc_catname Preventive Care Services
167         SET @catid = (SELECT MAX(pc_catid) FROM  openemr_postcalendar_categories);
168         INSERT INTO `openemr_postcalendar_categories` (`pc_catid`, `pc_catname`, `pc_catcolor`, `pc_catdesc`, `pc_recurrtype`, `pc_enddate`, `pc_recurrspec`, `pc_recurrfreq`, `pc_duration`, `pc_end_date_flag`, `pc_end_date_type`, `pc_end_date_freq`, `pc_end_all_day`, `pc_dailylimit`, `pc_cattype`, `pc_active`, `pc_seq`) VALUES (@catid+1, 'Preventive Care Services', '#CCCCFF', 'Preventive Care Services', 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,0,1,@catid+1);
169         INSERT INTO `enc_category_map` ( `rule_enc_id`, `main_cat_id` ) VALUES ('enc_pre_ind_counsel', @catid+1);
170         INSERT INTO `enc_category_map` ( `rule_enc_id`, `main_cat_id` ) VALUES ('enc_pre_med_group_counsel', @catid+1);
171         INSERT INTO `enc_category_map` ( `rule_enc_id`, `main_cat_id` ) VALUES ('enc_pre_med_other_serv', @catid+1);
172         INSERT INTO `enc_category_map` ( `rule_enc_id`, `main_cat_id` ) VALUES ('enc_pre_med_ser_18_older', @catid+1);
173         INSERT INTO `enc_category_map` ( `rule_enc_id`, `main_cat_id` ) VALUES ('enc_pre_med_ser_40_older', @catid+1);
174 #EndIf
176 #IfNotRow2D list_options list_id order_type option_id enc_checkup_procedure
177         SET @max_seq = (select max(seq) from list_options where list_id = 'order_type');
178         INSERT INTO `list_options` (`list_id`,`option_id`,`title`,`seq`,`is_default`) values ('order_type','enc_checkup_procedure','Encounter Checkup Procedure',@max_seq+10,0);
179 #EndIf
181 -- updating nqf code for cqm measure blood pressure
182 UPDATE `clinical_rules` set `cqm_nqf_code` = '0018' where `id` = 'rule_htn_bp_measure_cqm';
185 #IfNotTable calendar_external
186 CREATE TABLE calendar_external (
187   `id` INT NOT NULL AUTO_INCREMENT,
188   `date` DATE NOT NULL,
189   `description` VARCHAR(45) NOT NULL,
190   `source` VARCHAR(45) NULL,
191   PRIMARY KEY (`id`)
192   ) ENGINE=InnoDB;
193 #EndIf
195 #IfNotRow openemr_postcalendar_categories pc_catid 6
196 INSERT INTO `openemr_postcalendar_categories` (`pc_catid`, `pc_catname`, `pc_catcolor`, `pc_catdesc`, `pc_recurrtype`, `pc_enddate`, `pc_recurrspec`, `pc_recurrfreq`, `pc_duration`, `pc_end_date_flag`, `pc_end_date_type`, `pc_end_date_freq`, `pc_end_all_day`, `pc_dailylimit`, `pc_cattype`, `pc_active`, `pc_seq`)
197 VALUES (6,'Holidays','#9676DB','Clinic holiday',0,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,86400,1,3,2,0,0,2,1,6);
198 #EndIf
200 #IfNotRow openemr_postcalendar_categories pc_catid 7
201 INSERT INTO `openemr_postcalendar_categories` (`pc_catid`, `pc_catname`, `pc_catcolor`, `pc_catdesc`, `pc_recurrtype`, `pc_enddate`, `pc_recurrspec`, `pc_recurrfreq`, `pc_duration`, `pc_end_date_flag`, `pc_end_date_type`, `pc_end_date_freq`, `pc_end_all_day`, `pc_dailylimit`, `pc_cattype`, `pc_active`, `pc_seq`)
202 VALUES (7,'Closed','#2374AB','Clinic closed',0,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,86400,1,3,2,0,0,2,1,7);
203 #EndIf
207 #IfMissingColumn immunizations information_source
208 ALTER TABLE `immunizations` ADD COLUMN `information_source` VARCHAR(31) DEFAULT NULL;
209 #EndIf
211 #IfMissingColumn immunizations refusal_reason
212 ALTER TABLE `immunizations` ADD COLUMN `refusal_reason` VARCHAR(31) DEFAULT NULL;
213 #EndIf
215 #IfMissingColumn immunizations ordering_provider
216 ALTER TABLE `immunizations` ADD COLUMN `ordering_provider` INT(11) DEFAULT NULL;
217 #EndIf
219 #IfNotRow2D list_options list_id lists option_id immunization_registry_status
220 INSERT INTO list_options (list_id, option_id, title) VALUES ('lists','immunization_registry_status','Immunization Registry Status');
221 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_registry_status','active','Active','A', '10');
222 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_registry_status','inactive_lost_to_follow_up','Inactive - Lost to follow - up','L', '20');
223 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_registry_status','inactive_moved_gone_elsewhere','Inactive - Moved or gone elsewhere','M', '30');
224 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_registry_status','inactive_permanently_inactive','Inactive - Permanently inactive','P', '40');
225 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_registry_status','inactive_unspecified','Inactive - Unspecified','I', '50');
226 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_registry_status','unknown','Unknown','U', '60');
227 #EndIf
229 #IfNotRow2D list_options list_id lists option_id publicity_code
230 INSERT INTO list_options (list_id, option_id, title) VALUES ('lists','publicity_code','Publicity Code');
231 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('publicity_code','no_reminder_recall','No reminder/recall','SI', '10');
232 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('publicity_code','reminder_recall_any_method','Reminder/recall - any method','02', '20');
233 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('publicity_code','reminder_recall_no_calls','Reminder/recall - no calls','03', '30');
234 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('publicity_code','reminder_only_any_method','Reminder only - any method','04', '40');
235 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('publicity_code','reminder_only_no_calls','Reminder only - no calls','05', '50');
236 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('publicity_code','recall_only_any_method','Recall only - any method','06', '60');
237 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('publicity_code','recall_only_no_calls','Recall only - no calls','07', '70');
238 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('publicity_code','reminder_recall_to_provider','Reminder/recall - to provider','08', '80');
239 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('publicity_code','reminder_to_provider','Reminder to provider','09', '90');
240 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('publicity_code','reminder_to_provider_no_recall','Only reminder to provider, no recall','10', '100');
241 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('publicity_code','recall_to_provider','Recall to provider','11', '110');
242 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('publicity_code','recall_to_provider_no_reminder','Only recall to provider, no reminder','12', '120');
243 #EndIf
245 #IfNotRow2D list_options list_id lists option_id immunization_refusal_reason
246 INSERT INTO list_options (list_id, option_id, title) VALUES ('lists','immunization_refusal_reason','Immunization Refusal Reason');
247 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_refusal_reason','parental_decision','Parental decision','00', '10');
248 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_refusal_reason','religious_exemption','Religious exemption','01', '20');
249 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_refusal_reason','other','Other','02', '30');
250 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_refusal_reason','patient_decision','Patient decision','03', '40');
251 #EndIf
253 #IfNotRow2D list_options list_id lists option_id immunization_informationsource
254 INSERT INTO list_options (list_id, option_id, title) VALUES ('lists','immunization_informationsource','Immunization Information Source');
255 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_informationsource','new_immunization_record','New Immunization Record','00', '10');
256 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_informationsource','hist_inf_src_unspecified','Historical information -source unspecified','01', '20');
257 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_informationsource','other_provider','Other Provider','02', '30');
258 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_informationsource','parent_written_record','Parent Written Record','03', '40');
259 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_informationsource','parent_recall','Parent Recall','04', '50');
260 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_informationsource','other_registry','Other Registry','05', '60');
261 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_informationsource','birth_certificate','Birth Certificate','06', '70');
262 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_informationsource','school_record','School Record','07', '80');
263 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_informationsource','public_agency','Public Agency','08', '90');
264 #EndIf
266 #IfNotRow2D list_options list_id lists option_id next_of_kin_relationship
267 INSERT INTO `list_options` (list_id, option_id, title) VALUES ('lists','next_of_kin_relationship','Next of Kin Relationship');
268 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','associate','Associate','10','ASC');
269 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) values ('next_of_kin_relationship','brother','Brother','20','BRO');
270 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','care_giver','Care giver','30','CGV');
271 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','child','Child','40','CHD');
272 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','handicapped_dependent','Handicapped dependent','50','DEP');
273 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','life_partner','Life partner','60','DOM');
274 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','emergency_contact','Emergency contact','70','EMC');
275 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','employee','Employee','80','EME');
276 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','employer','Employer','90','EMR');
277 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','extended_family','Extended family','100','EXF');
278 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','foster_child','Foster Child','110','FCH');
279 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','friend','Friend','120','FND');
280 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','father','Father','130','FTH');
281 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','grandchild','Grandchild','140','GCH');
282 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','guardian','Guardian','150','GRD');
283 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','grandparent','Grandparent','160','GRP');
284 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','manager','Manager','170','MGR');
285 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','mother','Mother','180','MTH');
286 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','natural_child','Natural child','190','NCH');
287 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','none','None','200','NON');
288 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','other_adult','Other adult','210','OAD');
289 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','other','Other','220','OTH');
290 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','owner','Owner','230','OWN');
291 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','parent','Parent','240','PAR');
292 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','stepchild','Stepchild','250','SCH');
293 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','self','Self','260','SEL');
294 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','sibling','Sibling','270','SIB');
295 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','sister','Sister','280','SIS');
296 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','spouse','Spouse','290','SPO');
297 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','trainer','Trainer','300','TRA');
298 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','unknown','Unknown','310','UNK');
299 INSERT INTO `list_options` (list_id, option_id, title, seq, notes) VALUES ('next_of_kin_relationship','ward_of_court','Ward of court','320','WRD');
300 #EndIf
302 #IfNotRow2D list_options list_id lists option_id immunization_administered_site
303 INSERT INTO list_options (list_id, option_id, title) VALUES ('lists','immunization_administered_site','Immunization Administered Site');
304 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_administered_site','left_thigh','Left Thigh','LT', '10');
305 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_administered_site','left_arm','Left Arm','LA', '20');
306 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_administered_site','left_deltoid','Left Deltoid','LD', '30');
307 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_administered_site','left_gluteus_medius','Left Gluteus Medius','LG', '40');
308 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_administered_site','left_vastus_lateralis','Left Vastus Lateralis','LVL', '50');
309 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_administered_site','left_lower_forearm','Left Lower Forearm','LLFA', '60');
310 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_administered_site','nose','Nose','Nose', '70');
311 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_administered_site','right_arm','Right Arm','RA', '80');
312 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_administered_site','right_thigh','Right Thigh','RT', '90');
313 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_administered_site','right_vastus_lateralis','Right Vastus Lateralis','RVL', '100');
314 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_administered_site','right_gluteus_medius','Right Gluteus Medius','RG', '110');
315 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_administered_site','right_deltoid','Right Deltoid','RD', '120');
316 INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('immunization_administered_site','right_lower_forearm','Right Lower Forearm','RLFA', '130');
317 #EndIf
319 #IfNotRow2D list_options list_id lists option_id immunization_observation
320 INSERT INTO `list_options`(`list_id`, `option_id`, `title`) VALUES ('lists','immunization_observation','Immunization Observation Criteria');
321 INSERT INTO `list_options`(`list_id`, `option_id`, `title`, `seq`, `notes`, `codes`) VALUES ('immunization_observation','funding_program_eligibility','Vaccine funding program eligibility category','10','LN','LOINC:64994-7');
322 INSERT INTO `list_options`(`list_id`, `option_id`, `title`, `seq`, `notes`, `codes`) VALUES ('immunization_observation','vaccine_type','Vaccine Type','20','LN','LOINC:30956-7');
323 INSERT INTO `list_options`(`list_id`, `option_id`, `title`, `seq`, `notes`, `codes`) VALUES ('immunization_observation','disease_with_presumed_immunity','Disease with presumed immunity','30','LN','LOINC:59784-9');
324 #EndIf
326 #IfNotRow2D list_options list_id lists option_id imm_vac_eligibility_results
327 INSERT INTO `list_options`(`list_id`, `option_id`, `title`) VALUES ('lists','imm_vac_eligibility_results','Immunization Vaccine Eligibility Results');
328 INSERT INTO `list_options`(list_id, option_id, title, seq, notes) VALUES ('imm_vac_eligibility_results','not_vfc_eligible','Not VFC eligible','10','V01');
329 INSERT INTO `list_options`(list_id, option_id, title, seq, notes) VALUES ('imm_vac_eligibility_results','medicaid_managed_care','VFC eligible-Medicaid/Medicaid Managed Care','20','V02');
330 INSERT INTO `list_options`(list_id, option_id, title, seq, notes) VALUES ('imm_vac_eligibility_results','uninsured','VFC eligible- Uninsured','30','V03');
331 INSERT INTO `list_options`(list_id, option_id, title, seq, notes) VALUES ('imm_vac_eligibility_results','american_indian_alaskan_native','VFC eligible- American Indian/Alaskan Native','40','V04');
332 INSERT INTO `list_options`(list_id, option_id, title, seq, notes) VALUES ('imm_vac_eligibility_results','health_center_patient','VFC eligible-Federally Qualified Health Center Patient (under-insured)','50','V05');
333 #EndIf
335 #IfNotTable immunization_observation
336 CREATE TABLE `immunization_observation` (
337   `imo_id` int(11) NOT NULL AUTO_INCREMENT,
338   `imo_im_id` int(11) NOT NULL,
339   `imo_pid` int(11) DEFAULT NULL,
340   `imo_criteria` varchar(255) DEFAULT NULL,
341   `imo_criteria_value` varchar(255) DEFAULT NULL,
342   `imo_user` int(11) DEFAULT NULL,
343   `imo_code` varchar(255) DEFAULT NULL,
344   `imo_codetext` varchar(255) DEFAULT NULL,
345   `imo_codetype` varchar(255) DEFAULT NULL,
346   `imo_vis_date_published` date DEFAULT NULL,
347   `imo_vis_date_presented` date DEFAULT NULL,
348   `imo_date_observation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
349   PRIMARY KEY (`imo_id`)
350 ) ENGINE=InnoDB;
351 #EndIf
353 #IfMissingColumn patient_data imm_reg_status
354 SET @group_name = (SELECT group_name FROM layout_options WHERE form_id='DEM' AND group_name LIKE '%Choices' LIMIT 1);
355 SET @backup_group_name = (SELECT group_name FROM layout_options WHERE field_id='hipaa_notice' AND form_id='DEM');
356 SET @seq = (SELECT MAX(seq) FROM layout_options WHERE group_name = IFNULL(@group_name,@backup_group_name) AND form_id='DEM');
357 INSERT INTO `layout_options` (`form_id`, `field_id`, `group_name`, `title`, `seq`, `data_type`, `uor`, `fld_length`, `max_length`, `list_id`, `titlecols`, `datacols`, `default_value`, `edit_options`, `description`, `fld_rows`) VALUES ('DEM', 'imm_reg_status', IFNULL(@group_name,@backup_group_name), 'Immunization Registry Status', @seq+1, 1, 1, 1, 0, 'immunization_registry_status', 1, 1, '', '', 'Immunization Registry Status', 0) ;
358 ALTER TABLE `patient_data` ADD COLUMN `imm_reg_status` TEXT;
359 #EndIf
361 #IfMissingColumn patient_data imm_reg_stat_effdate
362 SET @group_name = (SELECT group_name FROM layout_options WHERE form_id='DEM' AND group_name LIKE '%Choices' LIMIT 1);
363 SET @backup_group_name = (SELECT group_name FROM layout_options WHERE field_id='hipaa_notice' AND form_id='DEM');
364 SET @seq = (SELECT MAX(seq) FROM layout_options WHERE group_name = IFNULL(@group_name,@backup_group_name) AND form_id='DEM');
365 INSERT INTO `layout_options` (`form_id`, `field_id`, `group_name`, `title`, `seq`, `data_type`, `uor`, `fld_length`, `max_length`, `list_id`, `titlecols`, `datacols`, `default_value`, `edit_options`, `description`, `fld_rows`) VALUES ('DEM', 'imm_reg_stat_effdate', IFNULL(@group_name,@backup_group_name), 'Immunization Registry Status Effective Date', @seq+1, 4, 1, 10, 10, '', 1, 1, '', '', 'Immunization Registry Status Effective Date', 0) ;
366 ALTER TABLE `patient_data` ADD COLUMN `imm_reg_stat_effdate` TEXT;
367 #EndIf
369 #IfMissingColumn patient_data publicity_code
370 SET @group_name = (SELECT group_name FROM layout_options WHERE form_id='DEM' AND group_name LIKE '%Choices' LIMIT 1);
371 SET @backup_group_name = (SELECT group_name FROM layout_options WHERE field_id='hipaa_notice' AND form_id='DEM');
372 SET @seq = (SELECT MAX(seq) FROM layout_options WHERE group_name = IFNULL(@group_name,@backup_group_name) AND form_id='DEM');
373 INSERT INTO `layout_options` (`form_id`, `field_id`, `group_name`, `title`, `seq`, `data_type`, `uor`, `fld_length`, `max_length`, `list_id`, `titlecols`, `datacols`, `default_value`, `edit_options`, `description`, `fld_rows`) VALUES ('DEM', 'publicity_code', IFNULL(@group_name,@backup_group_name), 'Publicity Code', @seq+1, 1, 1, 1, 0, 'publicity_code', 1, 1, '', '', 'Publicity Code', 0) ;
374 ALTER TABLE `patient_data` ADD COLUMN `publicity_code` TEXT;
375 #EndIf
377 #IfMissingColumn patient_data publ_code_eff_date
378 SET @group_name = (SELECT group_name FROM layout_options WHERE form_id='DEM' AND group_name LIKE '%Choices' LIMIT 1);
379 SET @backup_group_name = (SELECT group_name FROM layout_options WHERE field_id='hipaa_notice' AND form_id='DEM');
380 SET @seq = (SELECT MAX(seq) FROM layout_options WHERE group_name = IFNULL(@group_name,@backup_group_name) AND form_id='DEM');
381 INSERT INTO `layout_options` (`form_id`, `field_id`, `group_name`, `title`, `seq`, `data_type`, `uor`, `fld_length`, `max_length`, `list_id`, `titlecols`, `datacols`, `default_value`, `edit_options`, `description`, `fld_rows`) VALUES ('DEM', 'publ_code_eff_date', IFNULL(@group_name,@backup_group_name), 'Publicity Code Effective Date', @seq+1, 4, 1, 10, 10, '', 1, 1, '', '', 'Publicity Code Effective Date', 0) ;
382 ALTER TABLE `patient_data` ADD COLUMN `publ_code_eff_date` TEXT;
383 #EndIf
385 #IfMissingColumn patient_data protect_indicator
386 SET @group_name = (SELECT group_name FROM layout_options WHERE form_id='DEM' AND group_name LIKE '%Choices' LIMIT 1);
387 SET @backup_group_name = (SELECT group_name FROM layout_options WHERE field_id='hipaa_notice' AND form_id='DEM');
388 SET @seq = (SELECT MAX(seq) FROM layout_options WHERE group_name = IFNULL(@group_name,@backup_group_name) AND form_id='DEM');
389 INSERT INTO `layout_options` (`form_id`, `field_id`, `group_name`, `title`, `seq`, `data_type`, `uor`, `fld_length`, `max_length`, `list_id`, `titlecols`, `datacols`, `default_value`, `edit_options`, `description`, `fld_rows`) VALUES ('DEM', 'protect_indicator', IFNULL(@group_name,@backup_group_name), 'Protection Indicator', @seq+1, 1, 1, 1, 0, 'yesno', 1, 1, '', '', 'Protection Indicator', 0) ;
390 ALTER TABLE `patient_data` ADD COLUMN `protect_indicator` TEXT;
391 #EndIf
393 #IfMissingColumn patient_data prot_indi_effdate
394 SET @group_name = (SELECT group_name FROM layout_options WHERE form_id='DEM' AND group_name LIKE '%Choices' LIMIT 1);
395 SET @backup_group_name = (SELECT group_name FROM layout_options WHERE field_id='hipaa_notice' AND form_id='DEM');
396 SET @seq = (SELECT MAX(seq) FROM layout_options WHERE group_name = IFNULL(@group_name,@backup_group_name) AND form_id='DEM');
397 INSERT INTO `layout_options` (`form_id`, `field_id`, `group_name`, `title`, `seq`, `data_type`, `uor`, `fld_length`, `max_length`, `list_id`, `titlecols`, `datacols`, `default_value`, `edit_options`, `description`, `fld_rows`) VALUES ('DEM', 'prot_indi_effdate', IFNULL(@group_name,@backup_group_name), 'Protection Indicator Effective Date', @seq+1, 4, 1, 10, 10, '', 1, 1, '', '', 'Protection Indicator Effective Date', 0) ;
398 ALTER TABLE `patient_data` ADD COLUMN `prot_indi_effdate` TEXT;
399 #EndIf
401 #IfRow2D layout_options form_id DEM field_id guardiansname
402 UPDATE `layout_options` SET group_name='8Guardian',title='Name',seq='10' WHERE form_id='DEM' AND field_id='guardiansname' AND group_name LIKE '%Contact';
403 #EndIf
405 #IfNotColumnType patient_data guardiansname TEXT
406 ALTER TABLE `patient_data` MODIFY `guardiansname` TEXT;
407 #EndIf
409 #IfMissingColumn patient_data guardiansname
410 ALTER TABLE patient_data ADD COLUMN `guardiansname` TEXT;
411 #EndIf
413 #IfMissingColumn patient_data guardianrelationship
414 ALTER TABLE `patient_data` ADD COLUMN `guardianrelationship` TEXT;
415 INSERT INTO `layout_options` (`form_id`,`field_id`,`group_name`,`title`,`seq`,`data_type`,`uor`,`fld_length`,`max_length`,`list_id`,`titlecols`,`datacols`,`default_value`,`edit_options`,`description`,`fld_rows`) VALUES ('DEM', 'guardianrelationship'  , '8Guardian', 'Relationship'  ,20, 1, 1,0,0, 'next_of_kin_relationship', 1, 1, '', '', 'Relationship', 0);
416 #EndIf
418 #IfMissingColumn patient_data guardiansex
419 ALTER TABLE `patient_data` ADD COLUMN `guardiansex` TEXT;
420 INSERT INTO `layout_options` (`form_id`,`field_id`,`group_name`,`title`,`seq`,`data_type`,`uor`,`fld_length`,`max_length`,`list_id`,`titlecols`,`datacols`,`default_value`,`edit_options`,`description`,`fld_rows`) VALUES ('DEM', 'guardiansex'  , '8Guardian', 'Sex'  ,30, 1, 1,0,0, 'sex', 1, 1, '', '', 'Sex', 0);
421 #EndIf
423 #IfMissingColumn patient_data guardianaddress
424 ALTER TABLE `patient_data` ADD COLUMN `guardianaddress` TEXT;
425 INSERT INTO `layout_options` (`form_id`,`field_id`,`group_name`,`title`,`seq`,`data_type`,`uor`,`fld_length`,`max_length`,`list_id`,`titlecols`,`datacols`,`default_value`,`edit_options`,`description`,`fld_rows`) VALUES ('DEM', 'guardianaddress'  , '8Guardian', 'Address'  ,40, 2, 1,25,63, '', 1, 1, '', '', 'Address', 0);
426 #EndIf
428 #IfMissingColumn patient_data guardiancity
429 ALTER TABLE `patient_data` ADD COLUMN `guardiancity` TEXT;
430 INSERT INTO `layout_options` (`form_id`,`field_id`,`group_name`,`title`,`seq`,`data_type`,`uor`,`fld_length`,`max_length`,`list_id`,`titlecols`,`datacols`,`default_value`,`edit_options`,`description`,`fld_rows`) VALUES ('DEM', 'guardiancity'  , '8Guardian', 'City'  ,50, 2, 1,15,63, '', 1, 1, '', '', 'City', 0);
431 #EndIf
433 #IfMissingColumn patient_data guardianstate
434 ALTER TABLE `patient_data` ADD COLUMN `guardianstate` TEXT;
435 INSERT INTO `layout_options` (`form_id`,`field_id`,`group_name`,`title`,`seq`,`data_type`,`uor`,`fld_length`,`max_length`,`list_id`,`titlecols`,`datacols`,`default_value`,`edit_options`,`description`,`fld_rows`) VALUES ('DEM', 'guardianstate'  , '8Guardian', 'State'  ,60, 26, 1,0,0, 'state', 1, 1, '', '', 'State', 0);
436 #EndIf
438 #IfMissingColumn patient_data guardianpostalcode
439 ALTER TABLE `patient_data` ADD COLUMN `guardianpostalcode` TEXT;
440 INSERT INTO `layout_options` (`form_id`,`field_id`,`group_name`,`title`,`seq`,`data_type`,`uor`,`fld_length`,`max_length`,`list_id`,`titlecols`,`datacols`,`default_value`,`edit_options`,`description`,`fld_rows`) VALUES ('DEM', 'guardianpostalcode'  , '8Guardian', 'Postal Code'  ,70, 2, 1,6,63, '', 1, 1, '', '', 'Postal Code', 0);
441 #EndIf
443 #IfMissingColumn patient_data guardiancountry
444 ALTER TABLE `patient_data` ADD COLUMN `guardiancountry` TEXT;
445 INSERT INTO `layout_options` (`form_id`,`field_id`,`group_name`,`title`,`seq`,`data_type`,`uor`,`fld_length`,`max_length`,`list_id`,`titlecols`,`datacols`,`default_value`,`edit_options`,`description`,`fld_rows`) VALUES ('DEM', 'guardiancountry'  , '8Guardian', 'Country'  ,80, 26, 1,0,0, 'country', 1, 1, '', '', 'Country', 0);
446 #EndIf
448 #IfMissingColumn patient_data guardianphone
449 ALTER TABLE `patient_data` ADD COLUMN `guardianphone` TEXT;
450 INSERT INTO `layout_options` (`form_id`,`field_id`,`group_name`,`title`,`seq`,`data_type`,`uor`,`fld_length`,`max_length`,`list_id`,`titlecols`,`datacols`,`default_value`,`edit_options`,`description`,`fld_rows`) VALUES ('DEM', 'guardianphone'  , '8Guardian', 'Phone'  ,90, 2, 1,20,63, '', 1, 1, '', '', 'Phone', 0);
451 #EndIf
453 #IfMissingColumn patient_data guardianworkphone
454 ALTER TABLE `patient_data` ADD COLUMN `guardianworkphone` TEXT;
455 INSERT INTO `layout_options` (`form_id`,`field_id`,`group_name`,`title`,`seq`,`data_type`,`uor`,`fld_length`,`max_length`,`list_id`,`titlecols`,`datacols`,`default_value`,`edit_options`,`description`,`fld_rows`) VALUES ('DEM', 'guardianworkphone'  , '8Guardian', 'Work Phone'  ,100, 2, 1,20,63, '', 1, 1, '', '', 'Work Phone', 0);
456 #EndIf
458 #IfMissingColumn patient_data guardianemail
459 ALTER TABLE `patient_data` ADD COLUMN `guardianemail` TEXT;
460 INSERT INTO `layout_options` (`form_id`,`field_id`,`group_name`,`title`,`seq`,`data_type`,`uor`,`fld_length`,`max_length`,`list_id`,`titlecols`,`datacols`,`default_value`,`edit_options`,`description`,`fld_rows`) VALUES ('DEM', 'guardianemail'  , '8Guardian', 'Email'  ,110, 2, 1,20,63, '', 1, 1, '', '', 'Guardian Email Address', 0);
461 #EndIf
463 #IfNotRow2D list_options list_id drug_units title mL
464 SET @option_id = (SELECT MAX(CAST(option_id AS UNSIGNED)) FROM list_options WHERE list_id = 'drug_units');
465 SET @seq = (SELECT MAX(seq) FROM list_options WHERE list_id = 'drug_units');
466 INSERT INTO `list_options` ( `list_id`, `option_id`, `title`, `seq`, `is_default` ) VALUES ('drug_units', @option_id+1, 'mL', @seq+1, 0);
467 #EndIf
469 #IfNotRow2Dx2 list_options list_id drug_route option_id intramuscular title Intramuscular
470 INSERT INTO list_options ( `list_id`, `option_id`, `title`, `seq`, `is_default`, `notes`, `codes` ) VALUES ('drug_route','intramuscular','Intramuscular' ,20, 0, 'IM', 'NCI-CONCEPT-ID:C28161');
471 #EndIf
473 #IfNotRow3D list_options list_id yesno option_id NO notes N
474 UPDATE `list_options` SET notes='N' WHERE list_id='yesno' and option_id='NO';
475 #EndIf
477 #IfNotRow3D list_options list_id yesno option_id YES notes Y
478 UPDATE `list_options` SET notes='Y' WHERE list_id='yesno' and option_id='YES';
479 #EndIf
481 #IfNotRow2Dx2 list_options list_id reaction option_id shortness_of_breath title Shortness of Breath
482 INSERT INTO `list_options` ( `list_id`, `option_id`, `title`, `seq`, `codes` ) VALUES ('reaction', 'shortness_of_breath', 'Shortness of Breath', 40, 'SNOMED-CT:267036007');
483 #EndIf
485 #IfNotRow2Dx2 list_options list_id drug_route option_id inhale title Inhale
486 INSERT INTO `list_options` ( `list_id`, `option_id`, `title`, `seq`, `notes`, `codes` ) VALUES ('drug_route','inhale','Inhale' , 16, 'RESPIR', 'NCI-CONCEPT-ID:C38216');
487 #EndIf
489 #IfNotRow3D list_options list_id drug_route codes NCI-CONCEPT-ID:C38288 title Per Oris
490 UPDATE `list_options` SET codes='NCI-CONCEPT-ID:C38288' WHERE list_id='drug_route' and title='Per Oris';
491 #EndIf
493 #IfNotColumnType immunizations cvx_code varchar(10)
494 ALTER TABLE `immunizations` MODIFY `cvx_code` varchar(10) default NULL;
495 #EndIf
497 #IfMissingColumn drugs drug_code
498 ALTER TABLE drugs ADD COLUMN drug_code VARCHAR(25) NULL;
499 #EndIf
501 #IfNotRow code_types ct_key NCI-CONCEPT-ID
502 DROP TABLE IF EXISTS `temp_table_one`;
503 CREATE TABLE `temp_table_one` (`id` int(11) NOT NULL DEFAULT '0',`seq` int(11) NOT NULL DEFAULT '0') ENGINE=MyISAM;
504 INSERT INTO `temp_table_one` (`id`, `seq`) VALUES (
505   IF(((SELECT MAX(`ct_id` ) FROM `code_types`) >= 100), ((SELECT MAX(`ct_id` ) FROM `code_types`) + 1), 100),
506   IF(((SELECT MAX(`ct_seq`) FROM `code_types`) >= 100), ((SELECT MAX(`ct_seq`) FROM `code_types`) + 1), 100));
507 INSERT INTO code_types (ct_key, ct_id, ct_seq, ct_mod, ct_just, ct_fee, ct_rel, ct_nofs, ct_diag, ct_active, ct_label, ct_external, ct_claim, ct_proc, ct_term, ct_problem ) VALUES ('NCI-CONCEPT-ID', (SELECT MAX(`id`) FROM `temp_table_one`), (SELECT MAX(`seq`) FROM `temp_table_one`), 0, '', 0, 0, 1, 0, 1, 'NCI CONCEPT ID', 0, 0, 0, 0, 0);
508 INSERT INTO `codes` (`code_text`,`code`,`code_type`) VALUES ('suspension','C60928',(SELECT MAX(`id` ) FROM `temp_table_one`));
509 INSERT INTO `codes` (`code_text`,`code`,`code_type`) VALUES ('tablet','C42998',(SELECT MAX(`id` ) FROM `temp_table_one`));
510 INSERT INTO `codes` (`code_text`,`code`,`code_type`) VALUES ('capsule','C25158',(SELECT MAX(`id` ) FROM `temp_table_one`));
511 INSERT INTO `codes` (`code_text`,`code`,`code_type`) VALUES ('solution','C42986',(SELECT MAX(`id` ) FROM `temp_table_one`));
512 INSERT INTO `codes` (`code_text`,`code`,`code_type`) VALUES ('tsp','C48544',(SELECT MAX(`id` ) FROM `temp_table_one`));
513 INSERT INTO `codes` (`code_text`,`code`,`code_type`) VALUES ('ml','C28254',(SELECT MAX(`id` ) FROM `temp_table_one`));
514 INSERT INTO `codes` (`code_text`,`code`,`code_type`) VALUES ('units','C44278',(SELECT MAX(`id` ) FROM `temp_table_one`));
515 INSERT INTO `codes` (`code_text`,`code`,`code_type`) VALUES ('inhalations','C42944',(SELECT MAX(`id` ) FROM `temp_table_one`));
516 INSERT INTO `codes` (`code_text`,`code`,`code_type`) VALUES ('gtts(drops)','C48491',(SELECT MAX(`id` ) FROM `temp_table_one`));
517 INSERT INTO `codes` (`code_text`,`code`,`code_type`) VALUES ('cream','C28944',(SELECT MAX(`id` ) FROM `temp_table_one`));
518 INSERT INTO `codes` (`code_text`,`code`,`code_type`) VALUES ('ointment','C42966',(SELECT MAX(`id` ) FROM `temp_table_one`));
519 INSERT INTO `codes` (`code_text`,`code`,`code_type`) VALUES ('Per Oris','C38288',(SELECT MAX(`id` ) FROM `temp_table_one`));
520 INSERT INTO `codes` (`code_text`,`code`,`code_type`) VALUES ('Inhale','C38216',(SELECT MAX(`id` ) FROM `temp_table_one`));
521 INSERT INTO `codes` (`code_text`,`code`,`code_type`) VALUES ('Intramuscular','C28161',(SELECT MAX(`id` ) FROM `temp_table_one`));
522 INSERT INTO `codes` (`code_text`,`code`,`code_type`) VALUES ('mg','C28253',(SELECT MAX(`id` ) FROM `temp_table_one`));
523 DROP TABLE `temp_table_one`;
524 #EndIf
526 #IfNotRow3D list_options list_id drug_units title mg codes NCI-CONCEPT-ID:C28253
527 UPDATE `list_options` SET codes='NCI-CONCEPT-ID:C28253' WHERE list_id='drug_units' and title='mg';
528 #EndIf
530 #IfNotRow3D list_options list_id drug_form title suspension codes NCI-CONCEPT-ID:C60928
531 UPDATE `list_options` SET codes='NCI-CONCEPT-ID:C60928' WHERE list_id='drug_form' and title='suspension';
532 #EndIf
534 #IfNotRow3D list_options list_id drug_form title tablet codes NCI-CONCEPT-ID:C42998
535 UPDATE `list_options` SET codes='NCI-CONCEPT-ID:C42998' WHERE list_id='drug_form' and title='tablet';
536 #EndIf
538 #IfNotRow3D list_options list_id drug_form title capsule codes NCI-CONCEPT-ID:C25158
539 UPDATE `list_options` SET codes='NCI-CONCEPT-ID:C25158' WHERE list_id='drug_form' and title='capsule';
540 #EndIf
542 #IfNotRow3D list_options list_id drug_form title solution codes NCI-CONCEPT-ID:C42986
543 UPDATE `list_options` SET codes='NCI-CONCEPT-ID:C42986' WHERE list_id='drug_form' and title='solution';
544 #EndIf
546 #IfNotRow3D list_options list_id drug_form title tsp codes NCI-CONCEPT-ID:C48544
547 UPDATE `list_options` SET codes='NCI-CONCEPT-ID:C48544' WHERE list_id='drug_form' and title='tsp';
548 #EndIf
550 #IfNotRow3D list_options list_id drug_form title ml codes NCI-CONCEPT-ID:C28254
551 UPDATE `list_options` SET codes='NCI-CONCEPT-ID:C28254' WHERE list_id='drug_form' and title='ml';
552 #EndIf
554 #IfNotRow3D list_options list_id drug_form title units codes NCI-CONCEPT-ID:C44278
555 UPDATE `list_options` SET codes='NCI-CONCEPT-ID:C44278' WHERE list_id='drug_form' and title='units';
556 #EndIf
558 #IfNotRow3D list_options list_id drug_form title inhalations codes NCI-CONCEPT-ID:C42944
559 UPDATE `list_options` SET codes='NCI-CONCEPT-ID:C42944' WHERE list_id='drug_form' and title='inhalations';
560 #EndIf
562 #IfNotRow3D list_options list_id drug_form title gtts(drops) codes NCI-CONCEPT-ID:C48491
563 UPDATE `list_options` SET codes='NCI-CONCEPT-ID:C48491' WHERE list_id='drug_form' and title='gtts(drops)';
564 #EndIf
566 #IfNotRow3D list_options list_id drug_form title cream codes NCI-CONCEPT-ID:C28944
567 UPDATE `list_options` SET codes='NCI-CONCEPT-ID:C28944' WHERE list_id='drug_form' and title='cream';
568 #EndIf
570 #IfNotRow3D list_options list_id drug_form title ointment codes NCI-CONCEPT-ID:C42966
571 UPDATE `list_options` SET codes='NCI-CONCEPT-ID:C42966' WHERE list_id='drug_form' and title='ointment';
572 #EndIf
574 #IfNotRow2D list_options list_id drug_form title puff
575 SET @option_id = (SELECT MAX(CAST(option_id AS UNSIGNED)) FROM list_options WHERE list_id = 'drug_form');
576 SET @seq = (SELECT MAX(seq) FROM list_options WHERE list_id = 'drug_form');
577 INSERT INTO `list_options` ( `list_id`, `option_id`, `title`, `seq`, `is_default`, `codes` ) VALUES ('drug_form', @option_id+1, 'puff', @seq+1, 0, 'NCI-CONCEPT-ID:C42944');
578 #EndIf
580 #IfNotRow3D list_options list_id drug_route title Inhale codes NCI-CONCEPT-ID:C38216
581 UPDATE `list_options` SET codes='NCI-CONCEPT-ID:C38216' WHERE list_id='drug_route' and title='Inhale';
582 #EndIf
584 #IfNotRow openemr_postcalendar_categories pc_catname Ophthalmological Services
585 SET @catid = (SELECT MAX(pc_catid) FROM  openemr_postcalendar_categories);
586 INSERT INTO `openemr_postcalendar_categories` (`pc_catid`, `pc_catname`, `pc_catcolor`, `pc_catdesc`, `pc_recurrtype`, `pc_enddate`, `pc_recurrspec`, `pc_recurrfreq`, `pc_duration`, `pc_end_date_flag`, `pc_end_date_type`, `pc_end_date_freq`, `pc_end_all_day`, `pc_dailylimit`, `pc_cattype`, `pc_active`, `pc_seq`) VALUES (@catid+1, 'Ophthalmological Services', '#F89219', 'Ophthalmological Services', 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,0,1,@catid+1);
587 INSERT INTO `enc_category_map` ( `rule_enc_id`, `main_cat_id` ) VALUES ('enc_ophthal_serv', @catid+1);
588 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_hea_and_beh' and main_cat_id = 5;
589 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_hea_and_beh' and main_cat_id = 9;
590 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_hea_and_beh' and main_cat_id = 10;
591 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_pre_med_ser_18_older' and main_cat_id = 5;
592 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_pre_med_ser_18_older' and main_cat_id = 9;
593 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_pre_med_ser_18_older' and main_cat_id = 10;
594 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_pre_med_ser_40_older' and main_cat_id = 5;
595 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_pre_med_ser_40_older' and main_cat_id = 9;
596 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_pre_med_ser_40_older' and main_cat_id = 10;
597 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_pre_ind_counsel' and main_cat_id = 5;
598 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_pre_ind_counsel' and main_cat_id = 9;
599 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_pre_ind_counsel' and main_cat_id = 10;
600 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_pre_med_group_counsel' and main_cat_id = 5;
601 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_pre_med_group_counsel' and main_cat_id = 9;
602 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_pre_med_group_counsel' and main_cat_id = 10;
603 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_pre_med_other_serv' and main_cat_id = 5;
604 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_pre_med_other_serv' and main_cat_id = 9;
605 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_pre_med_other_serv' and main_cat_id = 10;
606 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_pregnancy' and main_cat_id = 5;
607 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_pregnancy' and main_cat_id = 9;
608 DELETE FROM `enc_category_map` where rule_enc_id = 'enc_pregnancy' and main_cat_id = 10;
609 #EndIf
611 #IfMissingColumn documents thumb_url
612 ALTER TABLE  `documents` ADD  `thumb_url` VARCHAR( 255 ) DEFAULT NULL;
613 #EndIf
615 #IfMissingColumn layout_options validation
616 ALTER TABLE layout_options ADD COLUMN validation varchar(100) default NULL;
617 #EndIf
619 #IfNotRow2D list_options list_id lists option_id LBF_Validations
620 INSERT INTO `list_options` ( list_id, option_id, title) VALUES ( 'lists','LBF_Validations','LBF_Validations');
621 INSERT INTO `list_options` (`list_id`,`option_id`,`title`,`notes`, `seq`) VALUES ('LBF_Validations','int1','Integers1-100','{\"numericality\": {\"onlyInteger\": true,\"greaterThanOrEqualTo\": 1,\"lessThanOrEqualTo\":100}}','10');
622 INSERT INTO `list_options` (`list_id`,`option_id`,`title`,`notes`, `seq`) VALUES ('LBF_Validations','names','Names','{"format\":{\"pattern\":\"[a-zA-z]+([ \'-\\\\s][a-zA-Z]+)*\"}}','20');
623 INSERT INTO `list_options` (`list_id`,`option_id`,`title`,`notes`, `seq`) VALUES ('LBF_Validations','past_date','Past Date','{\"pastDate\":{\"message\":\"must be past date\"}}','30');
624 INSERT INTO `list_options` (`list_id`,`option_id`,`title`,`notes`,`seq`) VALUES ('LBF_Validations','past_year','Past Year','{\"date\":{\"dateOnly\":true},\"pastDate\":{\"onlyYear\":true}}','35');
625 INSERT INTO `list_options` (`list_id`,`option_id`,`title`,`notes`,`seq`) VALUES ('LBF_Validations','email','E-Mail','{\"email\":true}','40');
626 INSERT INTO `list_options` (`list_id`,`option_id`,`title`,`notes`,`seq`) VALUES ('LBF_Validations','url','URL','{\"url\":true}','50');
627 INSERT INTO `list_options` (`list_id`,`option_id`,`title`,`notes`,`seq`) VALUES ('LBF_Validations','luhn','Luhn','{"numericality": {"onlyInteger": true}, "luhn":true}','80');
628 #EndIf
630 #IfMissingColumn facility extra_validation
631 ALTER TABLE facility ADD extra_validation tinyint(1) NOT NULL DEFAULT '1';
632 #EndIf
634 #IfMissingColumn drugs consumable
635 ALTER TABLE drugs
636   ADD consumable tinyint(1) NOT NULL DEFAULT 0 COMMENT '1 = will not show on the fee sheet';
637 #EndIf
639 #IfMissingColumn billing pricelevel
640 ALTER TABLE `billing` ADD COLUMN `pricelevel` varchar(31) default '';
641 # Fill in missing price levels where possible. Specific to IPPF but will not hurt anyone else.
642 UPDATE billing AS b, codes AS c, prices AS p
643   SET b.pricelevel = p.pr_level WHERE
644   b.code_type = 'MA' AND b.activity = 1 AND b.pricelevel = '' AND b.units = 1 AND b.fee > 0.00 AND
645   c.code_type = '12' AND c.code = b.code AND c.modifier = b.modifier AND
646   p.pr_id = c.id AND p.pr_selector = '' AND p.pr_price = b.fee;
647 #EndIf
649 #IfMissingColumn drug_sales pricelevel
650 ALTER TABLE `drug_sales` ADD COLUMN `pricelevel` varchar(31) default '';
651 #EndIf
653 #IfMissingColumn drug_sales selector
654 ALTER TABLE `drug_sales` ADD COLUMN `selector` varchar(255) default '' comment 'references drug_templates.selector';
655 # Fill in missing selector values where not ambiguous.
656 UPDATE drug_sales AS s, drug_templates AS t
657   SET s.selector = t.selector WHERE
658   s.pid != 0 AND s.selector = '' AND t.drug_id = s.drug_id AND
659   (SELECT COUNT(*) FROM drug_templates AS t2 WHERE t2.drug_id = s.drug_id) = 1;
660 # Fill in missing price levels where not ambiguous.
661 UPDATE drug_sales AS s, drug_templates AS t, prices AS p
662   SET s.pricelevel = p.pr_level WHERE
663   s.pid != 0 AND s.selector != '' AND s.pricelevel = '' AND
664   t.drug_id = s.drug_id AND t.selector = s.selector AND t.quantity = s.quantity AND
665   p.pr_id = s.drug_id AND p.pr_selector = s.selector AND p.pr_price = s.fee;
666 #EndIf
668 #IfMissingColumn drug_sales bill_date
669 ALTER TABLE `drug_sales` ADD COLUMN `bill_date` datetime default NULL;
670 UPDATE drug_sales AS s, billing     AS b SET s.bill_date = b.bill_date WHERE s.billed = 1 AND s.bill_date IS NULL AND b.pid = s.pid AND b.encounter = s.encounter AND b.bill_date IS NOT NULL AND b.activity = 1;
671 UPDATE drug_sales AS s, ar_activity AS a SET s.bill_date = a.post_time WHERE s.billed = 1 AND s.bill_date IS NULL AND a.pid = s.pid AND a.encounter = s.encounter;
672 UPDATE drug_sales AS s SET s.bill_date = s.sale_date WHERE s.billed = 1 AND s.bill_date IS NULL;
673 #EndIf
675 #IfNotTable voids
676 CREATE TABLE `voids` (
677   `void_id`                bigint(20)    NOT NULL AUTO_INCREMENT,
678   `patient_id`             bigint(20)    NOT NULL            COMMENT 'references patient_data.pid',
679   `encounter_id`           bigint(20)    NOT NULL DEFAULT 0  COMMENT 'references form_encounter.encounter',
680   `what_voided`            varchar(31)   NOT NULL            COMMENT 'checkout,receipt and maybe other options later',
681   `date_original`          datetime      DEFAULT NULL        COMMENT 'time of original action that is now voided',
682   `date_voided`            datetime      NOT NULL            COMMENT 'time of void action',
683   `user_id`                bigint(20)    NOT NULL            COMMENT 'references users.id',
684   `amount1`                decimal(12,2) NOT NULL DEFAULT 0  COMMENT 'for checkout,receipt total voided adjustments',
685   `amount2`                decimal(12,2) NOT NULL DEFAULT 0  COMMENT 'for checkout,receipt total voided payments',
686   `other_info`             text                              COMMENT 'for checkout,receipt the old invoice refno',
687   PRIMARY KEY (`void_id`),
688   KEY datevoided (date_voided),
689   KEY pidenc (patient_id, encounter_id)
690 ) ENGINE=InnoDB;
691 #EndIf
693 #IfMissingColumn drugs dispensable
694 UPDATE drug_sales AS s, prescriptions AS p, form_encounter AS fe
695   SET s.prescription_id = p.id WHERE
696   s.pid > 0 AND
697   s.encounter > 0 AND
698   s.prescription_id = 0 AND
699   fe.pid = s.pid AND
700   fe.encounter = s.encounter AND
701   p.patient_id = s.pid AND
702   p.drug_id = s.drug_id AND
703   p.start_date = fe.date;
704 ALTER TABLE drugs
705   ADD dispensable tinyint(1) NOT NULL DEFAULT 1 COMMENT '0 = pharmacy elsewhere, 1 = dispensed here';
706 #EndIf
708 #IfNotColumnType list_options notes TEXT
709 ALTER TABLE `list_options` MODIFY `notes` TEXT;
710 #EndIf
712 #IfNotRow2D list_options list_id lists option_id page_validation
713 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`) VALUES ('lists', 'page_validation', 'Page Validation', 298);
714 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `notes`, `activity`) VALUES ('page_validation', 'add_edit_issue#theform', '/interface/patient_file/summary/add_edit_issue.php', 10, '{form_title:{presence: true}}', 0);
715 #EndIf
717 #IfMissingColumn procedure_order history_order
718 ALTER TABLE procedure_order ADD COLUMN history_order enum('0','1') DEFAULT '0';
719 #EndIf
721 #IfMissingColumn amc_misc_data soc_provided
722        ALTER TABLE `amc_misc_data` add column `soc_provided` DATETIME default NULL;
723 #EndIf
725 #IfNotRow clinical_rules id cpoe_med_stage1_amc_alternative
726         INSERT INTO `clinical_rules`(`id`, `pid`, `active_alert_flag`, `passive_alert_flag`, `cqm_flag`, `cqm_nqf_code`, `cqm_pqri_code`, `amc_flag`, `amc_code`, `patient_reminder_flag`, `amc_2011_flag`, `amc_2014_flag`, `amc_code_2014`, `cqm_2011_flag`, `cqm_2014_flag`, `amc_2014_stage1_flag`, `amc_2014_stage2_flag`) VALUES ('cpoe_med_stage1_amc_alternative', 0, 0, 0, 0, '', '', 1, '170.304(a)', 0, 0, 1, '170.314(g)(1)/(2)–7', 0, 0, 1, 0);
727         INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`, `mapping`, `notes`, `codes`, `toggle_setting_1`, `toggle_setting_2`) VALUES('clinical_rules', 'cpoe_med_stage1_amc_alternative', 'Use CPOE for medication orders.(Alternative)', 48, 0, 0, '', '', '', 0, 0);
728 #EndIf
730 #IfNotRow2D clinical_rules id cpoe_med_stage2_amc amc_2014_stage1_flag 0
731         UPDATE `clinical_rules` set amc_2014_stage1_flag = 0 where id='cpoe_med_stage2_amc';
732 #EndIf
734 #IfNotRow3D list_options list_id clinical_rules option_id cpoe_med_stage2_amc title Use CPOE for medication orders.
735         UPDATE list_options set title = 'Use CPOE for medication orders.' where list_id = 'clinical_rules' and option_id = 'cpoe_med_stage2_amc';
736 #EndIf
738 #IfRow2D globals gl_name css_header gl_value style_tan_no_icons.css
739 UPDATE `globals` SET `gl_value` = 'style_tan.css' WHERE `gl_name` = 'css_header';
740 #EndIf
742 #IfColumn users ssi_relayhealth
743 ALTER TABLE `users` DROP COLUMN `ssi_relayhealth`;
744 #EndIf
746 #IfNotRow2D list_options list_id page_validation option_id common#new_encounter
747 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `notes`, `activity`) VALUES ('page_validation', 'common#new_encounter', '/interface/forms/newpatient/common.php', 50, '{pc_catid:{exclusion: ["_blank"]}}', 1);
748 #EndIf
750 #IfColumn insurance_companies freeb_type
751 ALTER TABLE `insurance_companies` CHANGE `freeb_type` `ins_type_code` tinyint(2) Default NULL;
752 #EndIf
754 #IfTable integration_mapping
755 DROP TABLE IF EXISTS `integration_mapping`;
756 #EndIf
758 #IfNotRow4D supported_external_dataloads load_type ICD10 load_source CMS load_release_date 2016-10-01 load_filename 2017-PCS-Long-Abbrev-Titles.zip
759 INSERT INTO `supported_external_dataloads` (`load_type`, `load_source`, `load_release_date`, `load_filename`, `load_checksum`) VALUES ('ICD10', 'CMS', '2016-10-01', '2017-PCS-Long-Abbrev-Titles.zip', '4669c47f6a9ca34bf4c14d7f93b37993');
760 #EndIf
762 #IfNotRow4D supported_external_dataloads load_type ICD10 load_source CMS load_release_date 2016-10-01 load_filename 2017-GEM-DC.zip
763 INSERT INTO `supported_external_dataloads` (`load_type`, `load_source`, `load_release_date`, `load_filename`, `load_checksum`) VALUES ('ICD10', 'CMS', '2016-10-01', '2017-GEM-DC.zip', '5a0affdc77a152e6971781233ee969c1');
764 #EndIf
766 #IfNotRow4D supported_external_dataloads load_type ICD10 load_source CMS load_release_date 2016-10-01 load_filename 2017-ICD10-Code-Descriptions.zip
767 INSERT INTO `supported_external_dataloads` (`load_type`, `load_source`, `load_release_date`, `load_filename`, `load_checksum`) VALUES ('ICD10', 'CMS', '2016-10-01', '2017-ICD10-Code-Descriptions.zip', 'ed9c159cb4ac4ae4f145062e15f83291');
768 #EndIf
770 #IfNotRow4D supported_external_dataloads load_type ICD10 load_source CMS load_release_date 2016-10-01 load_filename 2017-GEM-PCS.zip
771 INSERT INTO `supported_external_dataloads` (`load_type`, `load_source`, `load_release_date`, `load_filename`, `load_checksum`) VALUES ('ICD10', 'CMS', '2016-10-01', '2017-GEM-PCS.zip', 'a4e08b08fb9a53c81385867c82aa8a9e');
772 #EndIf
774 #IfMissingColumn form_encounter pos_code
775 ALTER TABLE `form_encounter` ADD `pos_code` tinyint(4) default NULL;
776 #EndIf
778 #IfNotColumnType drugs size varchar(25)
779 ALTER TABLE `drugs` CHANGE `size` `size` varchar(25) NOT NULL default '';
780 #EndIf
782 #IfNotColumnType prescriptions size varchar(25)
783 ALTER TABLE `prescriptions` CHANGE `size` `size` varchar(25) default NULL;
784 #EndIf
786 #IfNotColumnType user_settings setting_label varchar(100)
787 ALTER TABLE `user_settings` CHANGE `setting_label` `setting_label` varchar(100) NOT NULL;
788 #EndIf
790 #IfNotRow2D list_options list_id page_validation option_id add_edit_event#theform
791 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `notes`, `activity`) VALUES ('page_validation', 'add_edit_event#theform', '/interface/main/calendar/add_edit_event.php', 60, '{form_patient:{presence: {message: "Patient Name Required"}}}', 1);
792 #EndIf
794 #IfNotRow2D list_options list_id page_validation option_id usergroup_admin_add#new_user
795 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `notes`, `activity`) VALUES ('page_validation', 'usergroup_admin_add#new_user', '/interface/usergroup/usergroup_admin_add.php', 70, '{rumple:{presence: {message:"Required field missing: Please enter the User Name"}}, stiltskin:{presence: {message:"Please enter the password"}}, fname:{presence: {message:"Required field missing: Please enter the First name"}}, lname:{presence: {message:"Required field missing: Please enter the Last name"}}}', 1);
796 #EndIf
798 #IfNotRow2D list_options list_id page_validation option_id user_admin#user_form
799 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `notes`, `activity`) VALUES ('page_validation', 'user_admin#user_form', '/interface/usergroup/user_admin.php', 80, '{fname:{presence: {message:"Required field missing: Please enter the First name"}}, lname:{presence: {message:"Required field missing: Please enter the Last name"}}}', 1);
800 #EndIf
802 #IfNotRow2D list_options list_id page_validation option_id facility_admin#facility-form
803 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `notes`, `activity`) VALUES ('page_validation', 'facility_admin#facility-form', '/interface/usergroup/facility_admin.php', 90, '{facility:{presence: true}, ncolor:{presence: true}}', 1);
804 #EndIf
806 #IfNotRow2D list_options list_id page_validation option_id facilities_add#facility-add
807 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `notes`, `activity`) VALUES ('page_validation', 'facilities_add#facility-add', '/interface/usergroup/facilities_add.php', 100, '{facility:{presence: true}, ncolor:{presence: true}}', 1);
808 #EndIf
810 #IfNotTable form_eye_mag_dispense
811 CREATE TABLE `form_eye_mag_dispense` (
812 `id` bigint(20) NOT NULL AUTO_INCREMENT,
813 `date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
814 `encounter` bigint(20) NULL,
815 `pid` bigint(20) DEFAULT NULL,
816 `user` varchar(255) DEFAULT NULL,
817 `groupname` varchar(255) DEFAULT NULL,
818 `authorized` tinyint(4) DEFAULT NULL,
819 `activity` tinyint(4) DEFAULT NULL,
820 `REFDATE` DATETIME NULL DEFAULT NULL,
821 `REFTYPE` varchar(10) DEFAULT NULL,
822 `RXTYPE` varchar(20)DEFAULT NULL,
823 `ODSPH` varchar(10) DEFAULT NULL,
824 `ODCYL` varchar(10) DEFAULT NULL,
825 `ODAXIS` varchar(10) DEFAULT NULL,
826 `OSSPH` varchar(10) DEFAULT NULL,
827 `OSCYL` varchar(10) DEFAULT NULL,
828 `OSAXIS` varchar(10) DEFAULT NULL,
829 `ODMIDADD` varchar(10) DEFAULT NULL,
830 `OSMIDADD` varchar(10) DEFAULT NULL,
831 `ODADD` varchar(10) DEFAULT NULL,
832 `OSADD` varchar(10) DEFAULT NULL,
833 `ODHPD` varchar(20) DEFAULT NULL,
834 `ODHBASE` varchar(20) DEFAULT NULL,
835 `ODVPD` varchar(20) DEFAULT NULL,
836 `ODVBASE` varchar(20) DEFAULT NULL,
837 `ODSLABOFF` varchar(20) DEFAULT NULL,
838 `ODVERTEXDIST` varchar(20) DEFAULT NULL,
839 `OSHPD` varchar(20) DEFAULT NULL,
840 `OSHBASE` varchar(20) DEFAULT NULL,
841 `OSVPD` varchar(20) DEFAULT NULL,
842 `OSVBASE` varchar(20) DEFAULT NULL,
843 `OSSLABOFF` varchar(20) DEFAULT NULL,
844 `OSVERTEXDIST` varchar(20) DEFAULT NULL,
845 `ODMPDD` varchar(20) DEFAULT NULL,
846 `ODMPDN` varchar(20) DEFAULT NULL,
847 `OSMPDD` varchar(20) DEFAULT NULL,
848 `OSMPDN` varchar(20) DEFAULT NULL,
849 `BPDD` varchar(20) DEFAULT NULL,
850 `BPDN` varchar(20) DEFAULT NULL,
851 `LENS_MATERIAL` varchar(20) DEFAULT NULL,
852 `LENS_TREATMENTS` varchar(100) DEFAULT NULL,
853 `CTLMANUFACTUREROD` varchar(25) DEFAULT NULL,
854 `CTLMANUFACTUREROS` varchar(25) DEFAULT NULL,
855 `CTLSUPPLIEROD` varchar(25) DEFAULT NULL,
856 `CTLSUPPLIEROS` varchar(25) DEFAULT NULL,
857 `CTLBRANDOD` varchar(50) DEFAULT NULL,
858 `CTLBRANDOS` varchar(50) DEFAULT NULL,
859 `ODDIAM` varchar(50) DEFAULT NULL,
860 `ODBC` varchar(50) DEFAULT NULL,
861 `OSDIAM` varchar(50) DEFAULT NULL,
862 `OSBC` varchar(50) DEFAULT NULL,
863 `RXCOMMENTS` text,
864 `COMMENTS` text,
865 PRIMARY KEY (`id`),
866 UNIQUE KEY `pid` (`pid`,`encounter`,`id`)
867 ) ENGINE=InnoDB;
868 #EndIf
870 #IfNotTable form_eye_mag
871 CREATE TABLE `form_eye_mag` (
872 `id` bigint(20) NOT NULL AUTO_INCREMENT,
873 `date` datetime DEFAULT NULL,
874 `pid` bigint(20) DEFAULT NULL,
875 `user` varchar(255) DEFAULT NULL,
876 `groupname` varchar(255) DEFAULT NULL,
877 `authorized` tinyint(4) DEFAULT NULL,
878 `activity` tinyint(4) DEFAULT NULL,
879 `Narrative` text,
880 `VISITTYPE` varchar(50) DEFAULT NULL,
881 `CC1` text,
882 `HPI1` text,
883 `QUALITY1` text,
884 `TIMING1` text,
885 `DURATION1` text,
886 `CONTEXT1` text,
887 `SEVERITY1` text,
888 `MODIFY1` text,
889 `ASSOCIATED1` text,
890 `LOCATION1` text,
891 `CHRONIC1`  text,
892 `CHRONIC2`text,
893 `CHRONIC3`text,
894 `CC2` text,
895 `HPI2` text,
896 `QUALITY2` text,
897 `TIMING2` text,
898 `DURATION2` text,
899 `CONTEXT2` text,
900 `SEVERITY2` text,
901 `MODIFY2` text,
902 `ASSOCIATED2` text,
903 `LOCATION2` text,
904 `CC3` text,
905 `HPI3` text,
906 `QUALITY3` text,
907 `TIMING3` text,
908 `DURATION3` text,
909 `CONTEXT3` text,
910 `SEVERITY3` text,
911 `MODIFY3` text,
912 `ASSOCIATED3` text,
913 `LOCATION3` text,
914 `ROSGENERAL` text,
915 `ROSHEENT` text,
916 `ROSCV` text,
917 `ROSPULM` text,
918 `ROSGI` text,
919 `ROSGU` text,
920 `ROSDERM` text,
921 `ROSNEURO` text,
922 `ROSPSYCH` text,
923 `ROSMUSCULO` text,
924 `ROSIMMUNO` text,
925 `ROSENDOCRINE` text,
926 `alert` char(3) DEFAULT 'yes',
927 `oriented` char(3) DEFAULT 'TPP',
928 `confused` char(3) DEFAULT 'nml',
929 `SCODVA` varchar(20) DEFAULT NULL,
930 `SCOSVA` varchar(20) DEFAULT NULL,
931 `PHODVA` varchar(20) DEFAULT NULL,
932 `PHOSVA` varchar(20) DEFAULT NULL,
933 `WODVA` varchar(20) DEFAULT NULL,
934 `WOSVA` varchar(20) DEFAULT NULL,
935 `CTLODVA` varchar(20) DEFAULT NULL,
936 `CTLOSVA` varchar(20) DEFAULT NULL,
937 `MRODVA` varchar(20) DEFAULT NULL,
938 `MROSVA` varchar(20) DEFAULT NULL,
939 `SCNEARODVA` varchar(20) DEFAULT NULL,
940 `SCNEAROSVA` varchar(20) DEFAULT NULL,
941 `WNEARODVA` varchar(10) DEFAULT NULL,
942 `WNEAROSVA` varchar(10) DEFAULT NULL,
943 `MRNEARODVA` varchar(20) DEFAULT NULL,
944 `MRNEAROSVA` varchar(20) DEFAULT NULL,
945 `GLAREODVA` varchar(20) DEFAULT NULL,
946 `GLAREOSVA` varchar(20) DEFAULT NULL,
947 `GLARECOMMENTS` varchar(100) DEFAULT NULL,
948 `ARODVA` varchar(20) DEFAULT NULL,
949 `AROSVA` varchar(20) DEFAULT NULL,
950 `CRODVA` varchar(20) DEFAULT NULL,
951 `CROSVA` varchar(20) DEFAULT NULL,
952 `CTLODVA1` varchar(20) DEFAULT NULL,
953 `CTLOSVA1` varchar(20) DEFAULT NULL,
954 `PAMODVA` varchar(20) DEFAULT NULL,
955 `PAMOSVA` varchar(20) DEFAULT NULL,
956 `LIODVA` varchar(20) DEFAULT NULL,
957 `LIOSVA` varchar(20) DEFAULT NULL,
958 `NVOCHECKED` varchar(20) DEFAULT NULL,
959 `ADDCHECKED` varchar(20) DEFAULT NULL,
960 `MRODSPH` varchar(20) DEFAULT NULL,
961 `MRODCYL` varchar(20) DEFAULT NULL,
962 `MRODAXIS` varchar(20) DEFAULT NULL,
963 `MRODPRISM` varchar(20) DEFAULT NULL,
964 `MRODBASE` varchar(20) DEFAULT NULL,
965 `MRODADD` varchar(20) DEFAULT NULL,
966 `MROSSPH` varchar(20) DEFAULT NULL,
967 `MROSCYL` varchar(20) DEFAULT NULL,
968 `MROSAXIS` varchar(20) DEFAULT NULL,
969 `MROSPRISM` varchar(20) DEFAULT NULL,
970 `MROSBASE` varchar(20) DEFAULT NULL,
971 `MROSADD` varchar(20) DEFAULT NULL,
972 `MRODNEARSPHERE` varchar(20) DEFAULT NULL,
973 `MRODNEARCYL` varchar(20) DEFAULT NULL,
974 `MRODNEARAXIS` varchar(20) DEFAULT NULL,
975 `MRODPRISMNEAR` varchar(20) DEFAULT NULL,
976 `MRODBASENEAR` varchar(20) DEFAULT NULL,
977 `MROSNEARSHPERE` varchar(20) DEFAULT NULL,
978 `MROSNEARCYL` varchar(20) DEFAULT NULL,
979 `MROSNEARAXIS` varchar(20) DEFAULT NULL,
980 `MROSPRISMNEAR` varchar(20) DEFAULT NULL,
981 `MROSBASENEAR` varchar(20) DEFAULT NULL,
982 `CRODSPH` varchar(20) DEFAULT NULL,
983 `CRODCYL` varchar(20) DEFAULT NULL,
984 `CRODAXIS` varchar(20) DEFAULT NULL,
985 `CROSSPH` varchar(20) DEFAULT NULL,
986 `CROSCYL` varchar(20) DEFAULT NULL,
987 `CROSAXIS` varchar(20) DEFAULT NULL,
988 `CRCOMMENTS` varchar(255) DEFAULT NULL,
989 `BALANCED` varchar(2) DEFAULT NULL,
990 `DIL_RISKS` varchar(2) DEFAULT 'on',
991 `WETTYPE` VARCHAR(10) DEFAULT NULL,
992 `ATROPINE` VARCHAR(25) DEFAULT NULL,
993 `CYCLOMYDRIL` VARCHAR(25) DEFAULT NULL,
994 `TROPICAMIDE` VARCHAR(25) DEFAULT NULL,
995 `CYCLOGYL` VARCHAR(25) DEFAULT NULL,
996 `NEO25` VARCHAR(25) DEFAULT NULL,
997 `ARODSPH` varchar(10) DEFAULT NULL,
998 `ARODCYL` varchar(10) DEFAULT NULL,
999 `ARODAXIS` varchar(10) DEFAULT NULL,
1000 `AROSSPH` varchar(10) DEFAULT NULL,
1001 `AROSCYL` varchar(10) DEFAULT NULL,
1002 `AROSAXIS` varchar(10) DEFAULT NULL,
1003 `ARODADD` varchar(10) DEFAULT NULL,
1004 `AROSADD` varchar(10) DEFAULT NULL,
1005 `ARNEARODVA` varchar(10) DEFAULT NULL,
1006 `ARNEAROSVA` varchar(10) DEFAULT NULL,
1007 `ARODPRISM` varchar(20) DEFAULT NULL,
1008 `AROSPRISM` varchar(20) DEFAULT NULL,
1009 `CTLODSPH` varchar(50) DEFAULT NULL,
1010 `CTLODCYL` varchar(50) DEFAULT NULL,
1011 `CTLODAXIS` varchar(50) DEFAULT NULL,
1012 `CTLODBC` varchar(50) DEFAULT NULL,
1013 `CTLODDIAM` varchar(50) DEFAULT NULL,
1014 `CTLOSSPH` varchar(50) DEFAULT NULL,
1015 `CTLOSCYL` varchar(50) DEFAULT NULL,
1016 `CTLOSAXIS` varchar(50) DEFAULT NULL,
1017 `CTLOSBC` varchar(50) DEFAULT NULL,
1018 `CTLOSDIAM` varchar(50) DEFAULT NULL,
1019 `CTL_COMMENTS` text,
1020 `CTLMANUFACTUREROD` varchar(50) DEFAULT NULL,
1021 `CTLSUPPLIEROD` varchar(50) DEFAULT NULL,
1022 `CTLBRANDOD` varchar(50) DEFAULT NULL,
1023 `CTLMANUFACTUREROS` varchar(50) DEFAULT NULL,
1024 `CTLSUPPLIEROS` varchar(50) DEFAULT NULL,
1025 `CTLBRANDOS` varchar(50) DEFAULT NULL,
1026 `CTLODADD` varchar(50) DEFAULT NULL,
1027 `CTLOSADD` varchar(50) DEFAULT NULL,
1028 `ODIOPAP` varchar(50) DEFAULT NULL,
1029 `OSIOPAP` varchar(50) DEFAULT NULL,
1030 `ODIOPTPN` varchar(10) DEFAULT NULL,
1031 `OSIOPTPN` varchar(10) DEFAULT NULL,
1032 `ODIOPFTN` varchar(10) DEFAULT NULL,
1033 `OSIOPFTN` varchar(10) DEFAULT NULL,
1034 `ODIOPPOST`varchar(10) DEFAULT NULL,
1035 `OSIOPPOST` varchar(10) DEFAULT NULL,
1036 `ODIOPTARGET`varchar(10) DEFAULT NULL,
1037 `OSIOPTARGET` varchar(10) DEFAULT NULL,
1038 `IOPTIME` time DEFAULT NULL,
1039 `IOPPOSTTIME` time DEFAULT NULL,
1040 `AMSLEROD` smallint(1) DEFAULT NULL,
1041 `AMSLEROS` smallint(1) DEFAULT NULL,
1042 `ODK1` varchar(50) DEFAULT NULL,
1043 `ODK2` varchar(50) DEFAULT NULL,
1044 `ODK2AXIS` varchar(50) DEFAULT NULL,
1045 `OSK1` varchar(50) DEFAULT NULL,
1046 `OSK2` varchar(50) DEFAULT NULL,
1047 `OSK2AXIS` varchar(50) DEFAULT NULL,
1048 `ODAXIALLENGTH` varchar(50) DEFAULT NULL,
1049 `OSAXIALLENGTH` varchar(50) DEFAULT NULL,
1050 `ODACD` varchar(50) DEFAULT NULL,
1051 `OSACD` varchar(50) DEFAULT NULL,
1052 `ODW2W` varchar(10) DEFAULT NULL,
1053 `OSW2W` varchar(10) DEFAULT NULL,
1054 `ODLT` varchar(20) DEFAULT NULL,
1055 `OSLT` varchar(20) DEFAULT NULL,
1056 `ODPDMeasured` varchar(25) DEFAULT NULL,
1057 `OSPDMeasured` varchar(25) DEFAULT NULL,
1058 `ACT` char(3) DEFAULT 'on',
1059 `ACT1CCDIST` varchar(50) DEFAULT NULL,
1060 `ACT2CCDIST` varchar(50) DEFAULT NULL,
1061 `ACT3CCDIST` varchar(50) DEFAULT NULL,
1062 `ACT4CCDIST` varchar(50) DEFAULT NULL,
1063 `ACT5CCDIST` varchar(50) DEFAULT NULL,
1064 `ACT6CCDIST` varchar(50) DEFAULT NULL,
1065 `ACT7CCDIST` varchar(50) DEFAULT NULL,
1066 `ACT8CCDIST` varchar(50) DEFAULT NULL,
1067 `ACT9CCDIST` varchar(50) DEFAULT NULL,
1068 `ACT10CCDIST` varchar(50) DEFAULT NULL,
1069 `ACT11CCDIST` varchar(50) DEFAULT NULL,
1070 `ACT1SCDIST` varchar(50) DEFAULT NULL,
1071 `ACT2SCDIST` varchar(50) DEFAULT NULL,
1072 `ACT3SCDIST` varchar(50) DEFAULT NULL,
1073 `ACT4SCDIST` varchar(50) DEFAULT NULL,
1074 `ACT5SCDIST` varchar(50) DEFAULT NULL,
1075 `ACT6SCDIST` varchar(50) DEFAULT NULL,
1076 `ACT7SCDIST` varchar(50) DEFAULT NULL,
1077 `ACT8SCDIST` varchar(50) DEFAULT NULL,
1078 `ACT9SCDIST` varchar(50) DEFAULT NULL,
1079 `ACT10SCDIST` varchar(50) DEFAULT NULL,
1080 `ACT11SCDIST` varchar(50) DEFAULT NULL,
1081 `ACT1SCNEAR` varchar(50) DEFAULT NULL,
1082 `ACT2SCNEAR` varchar(50) DEFAULT NULL,
1083 `ACT3SCNEAR` varchar(50) DEFAULT NULL,
1084 `ACT4SCNEAR` varchar(50) DEFAULT NULL,
1085 `ACT5SCNEAR` varchar(50) DEFAULT NULL,
1086 `ACT6SCNEAR` varchar(50) DEFAULT NULL,
1087 `ACT7SCNEAR` varchar(50) DEFAULT NULL,
1088 `ACT8SCNEAR` varchar(50) DEFAULT NULL,
1089 `ACT9SCNEAR` varchar(50) DEFAULT NULL,
1090 `ACT10SCNEAR` varchar(50) DEFAULT NULL,
1091 `ACT11SCNEAR` varchar(50) DEFAULT NULL,
1092 `ACT1CCNEAR` varchar(50) DEFAULT NULL,
1093 `ACT2CCNEAR` varchar(50) DEFAULT NULL,
1094 `ACT3CCNEAR` varchar(50) DEFAULT NULL,
1095 `ACT4CCNEAR` varchar(50) DEFAULT NULL,
1096 `ACT5CCNEAR` varchar(50) DEFAULT NULL,
1097 `ACT6CCNEAR` varchar(50) DEFAULT NULL,
1098 `ACT7CCNEAR` varchar(50) DEFAULT NULL,
1099 `ACT8CCNEAR` varchar(50) DEFAULT NULL,
1100 `ACT9CCNEAR` varchar(50) DEFAULT NULL,
1101 `ACT10CCNEAR` varchar(50) DEFAULT NULL,
1102 `ACT11CCNEAR` varchar(50) DEFAULT NULL,
1103 `ODVF1` tinyint(1) DEFAULT NULL,
1104 `ODVF2` tinyint(1) DEFAULT NULL,
1105 `ODVF3` tinyint(1) DEFAULT NULL,
1106 `ODVF4` tinyint(1) DEFAULT NULL,
1107 `OSVF1` tinyint(1) DEFAULT NULL,
1108 `OSVF2` tinyint(1) DEFAULT NULL,
1109 `OSVF3` tinyint(1) DEFAULT NULL,
1110 `OSVF4` tinyint(1) DEFAULT NULL,
1111 `MOTILITYNORMAL` char(3) DEFAULT 'on',
1112 `MOTILITY_RS` int(1) DEFAULT NULL,
1113 `MOTILITY_RI` int(1) DEFAULT NULL,
1114 `MOTILITY_RR` int(1) DEFAULT NULL,
1115 `MOTILITY_RL` int(1) DEFAULT NULL,
1116 `MOTILITY_LS` int(1) DEFAULT NULL,
1117 `MOTILITY_LI` int(1) DEFAULT NULL,
1118 `MOTILITY_LR` int(1) DEFAULT NULL,
1119 `MOTILITY_LL` int(1) DEFAULT NULL,
1120 `MOTILITY_RRSO` int(1) DEFAULT NULL,
1121 `MOTILITY_RLSO` int(1) DEFAULT NULL,
1122 `MOTILITY_RRIO` int(1) DEFAULT NULL,
1123 `MOTILITY_RLIO` int(1) DEFAULT NULL,
1124 `MOTILITY_LRSO` int(1) DEFAULT NULL,
1125 `MOTILITY_LLSO` int(1) DEFAULT NULL,
1126 `MOTILITY_LRIO` int(1) DEFAULT NULL,
1127 `MOTILITY_LLIO` int(1) DEFAULT NULL,
1128 `STEREOPSIS` varchar(25) DEFAULT NULL,
1129 `ODNPA` varchar(50) DEFAULT NULL,
1130 `OSNPA` varchar(50) DEFAULT NULL,
1131 `VERTFUSAMPS` varchar(50) DEFAULT NULL,
1132 `DIVERGENCEAMPS` varchar(50) DEFAULT NULL,
1133 `NPC` varchar(10) DEFAULT NULL,
1134 `DACCDIST` varchar(10) DEFAULT NULL,
1135 `DACCNEAR` varchar(10) DEFAULT NULL,
1136 `CACCDIST` varchar(10) DEFAULT NULL,
1137 `CACCNEAR` varchar(10) DEFAULT NULL,
1138 `ODCOLOR` varchar(5) DEFAULT NULL,
1139 `OSCOLOR` varchar(5) DEFAULT NULL,
1140 `ODCOINS` varchar(5) DEFAULT NULL,
1141 `OSCOINS` varchar(5) DEFAULT NULL,
1142 `ODREDDESAT` varchar(10) DEFAULT NULL,
1143 `OSREDDESAT` varchar(10) DEFAULT NULL,
1144 `NEURO_COMMENTS` text,
1145 `RUL` text,
1146 `LUL` text,
1147 `RLL` text,
1148 `LLL` text,
1149 `RBROW` text,
1150 `LBROW` text,
1151 `RMCT` text,
1152 `LMCT` text,
1153 `RADNEXA` varchar(255) DEFAULT NULL,
1154 `LADNEXA` varchar(255) DEFAULT NULL,
1155 `RMRD` varchar(25) DEFAULT NULL,
1156 `LMRD` varchar(25) DEFAULT NULL,
1157 `RLF` varchar(50) DEFAULT NULL,
1158 `LLF` varchar(50) DEFAULT NULL,
1159 `RVFISSURE` varchar(10) DEFAULT NULL,
1160 `LVFISSURE` varchar(10) DEFAULT NULL,
1161 `ODHERTEL` varchar(10) DEFAULT NULL,
1162 `OSHERTEL` varchar(10) DEFAULT NULL,
1163 `HERTELBASE` varchar(10) DEFAULT NULL,
1164 `RCAROTID` varchar(50) DEFAULT NULL,
1165 `LCAROTID` varchar(50) DEFAULT NULL,
1166 `RTEMPART` varchar(50) DEFAULT NULL,
1167 `LTEMPART` varchar(50) DEFAULT NULL,
1168 `RCNV` varchar(50) DEFAULT NULL,
1169 `LCNV` varchar(50) DEFAULT NULL,
1170 `RCNVII` varchar(50) DEFAULT NULL,
1171 `LCNVII` varchar(50) DEFAULT NULL,
1172 `EXT_COMMENTS` text,
1173 `ODSCHIRMER1` varchar(50) DEFAULT NULL,
1174 `OSSCHRIMER1` varchar(50) DEFAULT NULL,
1175 `ODSCHRIMER2` varchar(50) DEFAULT NULL,
1176 `OSSCHRIMER2` varchar(50) DEFAULT NULL,
1177 `OSCONJ` text,
1178 `ODCONJ` text,
1179 `ODCORNEA` text,
1180 `OSCORNEA` text,
1181 `ODAC` text,
1182 `OSAC` text,
1183 `ODLENS` text,
1184 `OSLENS` text,
1185 `ODIRIS` text,
1186 `OSIRIS` text,
1187 `ODKTHICKNESS` varchar(20) DEFAULT NULL,
1188 `OSKTHICKNESS` varchar(20) DEFAULT NULL,
1189 `ODGONIO` varchar(50) DEFAULT NULL,
1190 `OSGONIO` varchar(50) DEFAULT NULL,
1191 `ANTSEG_COMMENTS` text,
1192 `PUPIL_NORMAL` varchar(2) DEFAULT '1',
1193 `ODPUPILSIZE1` varchar(20) DEFAULT NULL,
1194 `ODPUPILSIZE2` varchar(20) DEFAULT NULL,
1195 `ODPUPILREACTIVITY` varchar(10) DEFAULT NULL,
1196 `ODAPD` varchar(10) DEFAULT NULL,
1197 `OSPUPILSIZE1` varchar(20) DEFAULT NULL,
1198 `OSPUPILSIZE2` varchar(20) DEFAULT NULL,
1199 `OSPUPILREACTIVITY` varchar(10) DEFAULT NULL,
1200 `OSAPD` varchar(20) DEFAULT NULL,
1201 `DIMODPUPILSIZE1` varchar(20) DEFAULT NULL,
1202 `DIMODPUPILSIZE2` varchar(20) DEFAULT NULL,
1203 `DIMODPUPILREACTIVITY` varchar(10) DEFAULT NULL,
1204 `DIMOSPUPILSIZE1` varchar(20) DEFAULT NULL,
1205 `DIMOSPUPILSIZE2` varchar(20) DEFAULT NULL,
1206 `DIMOSPUPILREACTIVITY` varchar(10) DEFAULT NULL,
1207 `PUPIL_COMMENTS` text,
1208 `ODVFCONFRONTATION1` int(1) DEFAULT NULL,
1209 `ODVFCONFRONTATION2` int(1) DEFAULT NULL,
1210 `ODVFCONFRONTATION3` int(1) DEFAULT NULL,
1211 `ODVFCONFRONTATION4` int(1) DEFAULT NULL,
1212 `ODVFCONFRONTATION5` int(1) DEFAULT NULL,
1213 `OSVFCONFRONTATION1` int(1) DEFAULT NULL,
1214 `OSVFCONFRONTATION2` int(1) DEFAULT NULL,
1215 `OSVFCONFRONTATION3` int(1) DEFAULT NULL,
1216 `OSVFCONFRONTATION4` int(1) DEFAULT NULL,
1217 `OSVFCONFRONTATION5` int(1) DEFAULT NULL,
1218 `ODDISC` varchar(100) DEFAULT NULL,
1219 `OSDISC` varchar(100) DEFAULT NULL,
1220 `ODCUP` varchar(100) DEFAULT NULL,
1221 `OSCUP` varchar(100) DEFAULT NULL,
1222 `ODMACULA` varchar(100) DEFAULT NULL,
1223 `OSMACULA` varchar(100) DEFAULT NULL,
1224 `ODVESSELS` varchar(100) DEFAULT NULL,
1225 `OSVESSELS` varchar(100) DEFAULT NULL,
1226 `ODPERIPH` varchar(100) DEFAULT NULL,
1227 `OSPERIPH` varchar(100) DEFAULT NULL,
1228 `ODCMT` varchar(50) DEFAULT NULL,
1229 `OSCMT` varchar(50) DEFAULT NULL,
1230 `RETINA_COMMENTS` text,
1231 `IMP` text,
1232 `PLAN` text,
1233 `Technician` varchar(50) DEFAULT NULL,
1234 `Doctor` varchar(50) DEFAULT NULL,
1235 `Resource` varchar(50) DEFAULT NULL,
1236 `LOCKED` VARCHAR( 3 ) NULL DEFAULT NULL,
1237 `LOCKEDDATE` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
1238 `LOCKEDBY` varchar(50) DEFAULT NULL,
1239 `FINISHED` varchar(25) DEFAULT NULL,
1240 PRIMARY KEY (`id`)
1241 ) ENGINE=MyISAM;
1242 INSERT INTO `registry` (`name`,`state`,`directory`,`sql_run`,`unpackaged`,`date`,`priority`,`category`,`nickname`) VALUES ('Eye Exam', 1, 'eye_mag', 1, 1, '2015-10-15 00:00:00', 0, 'Clinical', '');
1243 #EndIf
1245 #IfNotTable form_eye_mag_prefs
1246 CREATE TABLE `form_eye_mag_prefs` (
1247   `PEZONE` varchar(25) DEFAULT NULL,
1248   `LOCATION` varchar(25) DEFAULT NULL,
1249   `LOCATION_text` varchar(25) NOT NULL,
1250   `id` bigint(20) DEFAULT NULL,
1251   `selection` varchar(255) DEFAULT NULL,
1252   `ZONE_ORDER` int(11) DEFAULT NULL,
1253   `GOVALUE` varchar(10) DEFAULT '0',
1254   `ordering` tinyint(4) DEFAULT NULL,
1255   `FILL_ACTION` varchar(10) NOT NULL DEFAULT 'ADD',
1256   `GORIGHT` varchar(50) NOT NULL,
1257   `GOLEFT` varchar(50) NOT NULL,
1258   `UNSPEC` varchar(50) NOT NULL,
1259   UNIQUE KEY `id` (`id`,`PEZONE`,`LOCATION`,`selection`)
1260 ) ENGINE=InnoDB;
1262 INSERT INTO `form_eye_mag_prefs` (`PEZONE`, `LOCATION`, `LOCATION_text`, `id`, `selection`, `ZONE_ORDER`, `GOVALUE`, `ordering`, `FILL_ACTION`, `GORIGHT`, `GOLEFT`, `UNSPEC`) VALUES
1263 ('PREFS', 'ACT_SHOW', 'ACT Show', 2048, 'ACT_SHOW', 65, 'CCDIST', 15, 'ADD', '', '', ''),
1264 ('PREFS', 'ACT_VIEW', 'ACT View', 2048, 'ACT_VIEW', 64, '', 14, 'ADD', '', '', ''),
1265 ('PREFS', 'ADDITIONAL', 'Additional Data Points', 2048, 'ADDITIONAL', 56, '0', 6, 'ADD', '', '', ''),
1266 ('PREFS', 'ANTSEG_DRAW', 'ANTSEG DRAW', 2048, 'ANTSEG_DRAW', 73, NULL, 16, 'ADD', '', '', ''),
1267 ('PREFS', 'ANTSEG_RIGHT', 'ANTSEG DRAW', 2048, 'ANTSEG_RIGHT', 73, 'QP', 19, 'ADD', '', '', ''),
1268 ('PREFS', 'ANTSEG_VIEW', 'Anterior Segment View', 2048, 'ANTSEG_VIEW', 61, '0', 11, 'ADD', '', '', ''),
1269 ('PREFS', 'CLINICAL', 'CLINICAL', 2048, 'CLINICAL', 57, '1', 7, 'ADD', '', '', ''),
1270 ('PREFS', 'CR', 'Cycloplegic Refraction', 2048, 'CR', 54, '0', 4, 'ADD', '', '', ''),
1271 ('PREFS', 'CTL', 'Contact Lens', 2048, 'CTL', 55, '0', 5, 'ADD', '', '', ''),
1272 ('PREFS', 'CYLINDER', 'CYL', 2048, 'CYL', 59, '', 9, 'ADD', '', '', ''),
1273 ('PREFS', 'EXAM', 'EXAM', 2048, 'EXAM', 58, 'QP', 8, 'ADD', '', '', ''),
1274 ('PREFS', 'EXT_DRAW', 'EXT DRAW', 2048, 'EXT_DRAW', 72, NULL, 16, 'ADD', '', '', ''),
1275 ('PREFS', 'EXT_RIGHT', 'EXT DRAW', 2048, 'EXT_RIGHT', 72, 'QP', 18, 'ADD', '', '', ''),
1276 ('PREFS', 'EXT_VIEW', 'External View', 2048, 'EXT_VIEW', 66, '0', 16, 'ADD', '', '', ''),
1277 ('PREFS', 'HPI_DRAW', 'HPI DRAW', 2048, 'HPI_DRAW', 70, NULL, 16, 'ADD', '', '', ''),
1278 ('PREFS', 'HPI_RIGHT', 'HPI DRAW', 2048, 'HPI_RIGHT', 70, '', 16, 'ADD', '', '', ''),
1279 ('PREFS', 'HPI_VIEW', 'HPI View', 2048, 'HPI_VIEW', 60, NULL, 10, 'ADD', '', '', ''),
1280 ('PREFS', 'IMPPLAN_DRAW', 'IMPPLAN DRAW', 2048, 'IMPPLAN_DRAW', 76, NULL, 16, 'ADD', '', '', ''),
1281 ('PREFS', 'IMPPLAN_RIGHT', 'IMPPLAN DRAW', 2048, 'IMPPLAN_RIGHT', 76, NULL, 22, 'ADD', '', '', ''),
1282 ('PREFS', 'IOP', 'Intraocular Pressure', 2048, 'IOP', 67, '', 17, 'ADD', '', '', ''),
1283 ('PREFS', 'KB_VIEW', 'KeyBoard View', 2048, 'KB_VIEW', 78, '0', 24, 'ADD', '', '', ''),
1284 ('PREFS', 'MR', 'Manifest Refraction', 2048, 'MR', 53, '0', 3, 'ADD', '', '', ''),
1285 ('PREFS', 'NEURO_DRAW', 'NEURO DRAW', 2048, 'NEURO_DRAW', 75, NULL, 16, 'ADD', '', '', ''),
1286 ('PREFS', 'NEURO_RIGHT', 'NEURO DRAW', 2048, 'NEURO_RIGHT', 75, '', 21, 'ADD', '', '', ''),
1287 ('PREFS', 'NEURO_VIEW', 'Neuro View', 2048, 'NEURO_VIEW', 63, '', 13, 'ADD', '', '', ''),
1288 ('PREFS', 'PANEL_RIGHT', 'PMSFH Panel', 2048, 'PANEL_RIGHT', 77, '1', 23, 'ADD', '', '', ''),
1289 ('PREFS', 'PMH_DRAW', 'PMH DRAW', 2048, 'PMH_DRAW', 71, NULL, 16, 'ADD', '', '', ''),
1290 ('PREFS', 'PMH_RIGHT', 'PMH DRAW', 2048, 'PMH_RIGHT', 71, '', 17, 'ADD', '', '', ''),
1291 ('PREFS', 'RETINA_DRAW', 'RETINA DRAW', 2048, 'RETINA_DRAW', 74, NULL, 16, 'ADD', '', '', ''),
1292 ('PREFS', 'RETINA_RIGHT', 'RETINA DRAW', 2048, 'RETINA_RIGHT', 74, '', 20, 'ADD', '', '', ''),
1293 ('PREFS', 'RETINA_VIEW', 'Retina View', 2048, 'RETINA_VIEW', 62, '1', 12, 'ADD', '', '', ''),
1294 ('PREFS', 'VA', 'Vision', 2048, 'RS', 51, '1', 2048, 'ADD', '', '', ''),
1295 ('PREFS', 'VAX', 'Visual Acuities', 2048, 'VAX', 65, '0', 15, 'ADD', '', '', ''),
1296 ('PREFS', 'TOOLTIPS', 'Toggle Tooltips', 2048, 'TOOLTIPS', 66, 'on', NULL, 'ADD', '', '', ''),
1297 ('PREFS', 'W', 'Current Rx', 2048, 'W', 52, '1', 2, 'ADD', '', '', ''),
1298 ('PREFS', 'W_width', 'Detailed Rx', 2048, 'W_width', 80, '100', '', '', '', '', ''),
1299 ('PREFS', 'MR_width','Detailed MR', 2048, 'MR_width', 81, '110', '', '', '', '', '');
1300 #EndIf
1302 #IfNotTable form_eye_mag_orders
1303 CREATE TABLE `form_eye_mag_orders` (
1304 `id` bigint(20) NOT NULL AUTO_INCREMENT,
1305 `ORDER_PID` bigint(20) NOT NULL,
1306 `ORDER_DETAILS` varchar(255) NOT NULL,
1307 `ORDER_STATUS` varchar(50) DEFAULT NULL,
1308 `ORDER_PRIORITY` varchar(50) DEFAULT NULL,
1309 `ORDER_DATE_PLACED` date NOT NULL,
1310 `ORDER_PLACED_BYWHOM` varchar(50) DEFAULT NULL,
1311 `ORDER_DATE_COMPLETED` date DEFAULT NULL,
1312 `ORDER_COMPLETED_BYWHOM` varchar(50) DEFAULT NULL,
1313 PRIMARY KEY (`id`),
1314 UNIQUE KEY `VISIT_ID` (`ORDER_PID`,`ORDER_DETAILS`,`ORDER_DATE_PLACED`,`ORDER_PLACED_BYWHOM`,`ORDER_DATE_COMPLETED`)
1315 ) ENGINE=InnoDB;
1316 #EndIf
1318 #IfNotTable form_eye_mag_impplan
1319 CREATE TABLE `form_eye_mag_impplan` (
1320 `id` int(11) NOT NULL AUTO_INCREMENT,
1321 `form_id` bigint(20) NOT NULL,
1322 `pid` bigint(20) NOT NULL,
1323 `title` varchar(255) NOT NULL,
1324 `code` varchar(50) DEFAULT NULL,
1325 `codetype` varchar(50) DEFAULT NULL,
1326 `codedesc` varchar(255) DEFAULT NULL,
1327 `codetext` varchar(255) DEFAULT NULL,
1328 `plan` varchar(3000) DEFAULT NULL,
1329 `PMSFH_link` varchar(50) DEFAULT NULL,
1330 `IMPPLAN_order` tinyint(4) DEFAULT NULL,
1331 PRIMARY KEY (`id`),
1332 UNIQUE KEY `second_index` (`form_id`,`pid`,`title`,`plan`(20))
1333 ) ENGINE=InnoDB;
1334 #EndIf
1336 #IfNotTable form_eye_mag_wearing
1337 CREATE TABLE `form_eye_mag_wearing` (
1338   `id` int(11) NOT NULL AUTO_INCREMENT,
1339   `ENCOUNTER` int(11) NOT NULL,
1340   `FORM_ID` smallint(6) NOT NULL,
1341   `PID` int(11) NOT NULL,
1342   `RX_NUMBER` int(11) NOT NULL,
1343   `ODSPH` varchar(10) DEFAULT NULL,
1344   `ODCYL` varchar(10) DEFAULT NULL,
1345   `ODAXIS` varchar(10) DEFAULT NULL,
1346   `OSSPH` varchar(10) DEFAULT NULL,
1347   `OSCYL` varchar(10) DEFAULT NULL,
1348   `OSAXIS` varchar(10) DEFAULT NULL,
1349   `ODMIDADD` varchar(10) DEFAULT NULL,
1350   `OSMIDADD` varchar(10) DEFAULT NULL,
1351   `ODADD` varchar(10) DEFAULT NULL,
1352   `OSADD` varchar(10) DEFAULT NULL,
1353   `ODVA` varchar(10) DEFAULT NULL,
1354   `OSVA` varchar(10) DEFAULT NULL,
1355   `ODNEARVA` varchar(10) DEFAULT NULL,
1356   `OSNEARVA` varchar(10) DEFAULT NULL,
1357   `ODHPD` varchar(20) DEFAULT NULL,
1358   `ODHBASE` varchar(20) DEFAULT NULL,
1359   `ODVPD` varchar(20) DEFAULT NULL,
1360   `ODVBASE` varchar(20) DEFAULT NULL,
1361   `ODSLABOFF` varchar(20) DEFAULT NULL,
1362   `ODVERTEXDIST` varchar(20) DEFAULT NULL,
1363   `OSHPD` varchar(20) DEFAULT NULL,
1364   `OSHBASE` varchar(20) DEFAULT NULL,
1365   `OSVPD` varchar(20) DEFAULT NULL,
1366   `OSVBASE` varchar(20) DEFAULT NULL,
1367   `OSSLABOFF` varchar(20) DEFAULT NULL,
1368   `OSVERTEXDIST` varchar(20) DEFAULT NULL,
1369   `ODMPDD` varchar(20) DEFAULT NULL,
1370   `ODMPDN` varchar(20) DEFAULT NULL,
1371   `OSMPDD` varchar(20) DEFAULT NULL,
1372   `OSMPDN` varchar(20) DEFAULT NULL,
1373   `BPDD` varchar(20) DEFAULT NULL,
1374   `BPDN` varchar(20) DEFAULT NULL,
1375   `LENS_MATERIAL` varchar(20) DEFAULT NULL,
1376   `LENS_TREATMENTS` varchar(100) DEFAULT NULL,
1377   `RX_TYPE` varchar(25) DEFAULT NULL,
1378   `COMMENTS` text,
1379   UNIQUE KEY `id` (`id`),
1380   UNIQUE KEY `FORM_ID` (`FORM_ID`,`ENCOUNTER`,`PID`,`RX_NUMBER`)
1381 ) ENGINE=InnoDB;
1382 #EndIf
1385 #IfNotTable form_taskman
1386 CREATE TABLE `form_taskman` (
1387     `ID` bigint(20) NOT NULL AUTO_INCREMENT,
1388     `REQ_DATE` datetime NOT NULL,
1389     `FROM_ID` bigint(20) NOT NULL,
1390     `TO_ID` bigint(20) NOT NULL,
1391     `PATIENT_ID` bigint(20) NOT NULL, `DOC_TYPE` varchar(20) DEFAULT NULL,
1392     `DOC_ID` bigint(20) DEFAULT NULL,
1393     `ENC_ID` bigint(20) DEFAULT NULL,
1394     `METHOD` varchar(20) NOT NULL, `COMPLETED` varchar(1) DEFAULT NULL COMMENT '1 = completed',
1395     `COMPLETED_DATE` datetime DEFAULT NULL,
1396     `COMMENT` varchar(50) DEFAULT NULL,
1397     `USERFIELD_1` varchar(50) DEFAULT NULL,
1398     PRIMARY KEY (`ID`)
1399 ) ENGINE=INNODB;
1400 #EndIf
1402 #IfNotRow categories name Eye Module
1403 INSERT INTO categories select (select MAX(id) from categories) + 1, 'Eye Module', '', 1, rght, rght + 25 from categories where name = 'Categories';
1404 INSERT INTO categories select (select MAX(id) from categories) + 1, 'Communication - Eye', '', (select id from categories where name = 'Eye Module'), rght + 1, rght + 2 from categories where name = 'Categories';
1405 INSERT INTO categories select (select MAX(id) from categories) + 1, 'Encounters - Eye', '', (select id from categories where name = 'Eye Module'), rght + 3, rght + 4 from categories where name = 'Categories';
1406 INSERT INTO categories select (select MAX(id) from categories) + 1, 'Imaging - Eye', '', (select id from categories where name = 'Eye Module'), rght + 5, rght + 24 from categories where name = 'Categories';
1407 INSERT INTO categories select (select MAX(id) from categories) + 1, 'OCT - Eye', 'POSTSEG', (select id from categories where name = 'Imaging - Eye'), rght + 6, rght + 7 from categories where name = 'Categories';
1408 INSERT INTO categories select (select MAX(id) from categories) + 1, 'FA/ICG - Eye', 'POSTSEG', (select id from categories where name = 'Imaging - Eye'), rght + 8, rght + 9 from categories where name = 'Categories';
1409 INSERT INTO categories select (select MAX(id) from categories) + 1, 'External Photos - Eye', 'EXT', (select id from categories where name = 'Imaging - Eye'), rght + 10, rght + 11 from categories where name = 'Categories';
1410 INSERT INTO categories select (select MAX(id) from categories) + 1, 'AntSeg Photos - Eye', 'ANTSEG', (select id from categories where name = 'Imaging - Eye'), rght + 12, rght + 13 from categories where name = 'Categories';
1411 INSERT INTO categories select (select MAX(id) from categories) + 1, 'Optic Disc - Eye', 'POSTSEG', (select id from categories where name = 'Imaging - Eye'), rght + 14, rght + 15 from categories where name = 'Categories';
1412 INSERT INTO categories select (select MAX(id) from categories) + 1, 'Fundus - Eye', 'POSTSEG', (select id from categories where name = 'Imaging - Eye'), rght + 16, rght + 17 from categories where name = 'Categories';
1413 INSERT INTO categories select (select MAX(id) from categories) + 1, 'Radiology - Eye', 'NEURO', (select id from categories where name = 'Imaging - Eye'), rght + 18, rght + 19 from categories where name = 'Categories';
1414 INSERT INTO categories select (select MAX(id) from categories) + 1, 'VF - Eye', 'NEURO', (select id from categories where name = 'Imaging - Eye'), rght + 20, rght + 21 from categories where name = 'Categories';
1415 INSERT INTO categories select (select MAX(id) from categories) + 1, 'Drawings - Eye', 'NEURO', (select id from categories where name = 'Imaging - Eye'), rght + 22, rght + 23 from categories where name = 'Categories';
1416 UPDATE categories SET rght = rght + 26 WHERE name = 'Categories';
1417 UPDATE categories_seq SET id = (select MAX(id) from categories);
1418 #EndIf
1420 UPDATE `list_options` SET `codes` = 'ICD10:I10' WHERE `list_id` = 'medical_problem_issue_list' AND `option_id` = 'HTN';
1422 UPDATE `list_options` SET `codes` = 'ICD10:J45.909' WHERE `list_id` = 'medical_problem_issue_list' AND `option_id` = 'asthma';
1424 UPDATE `list_options` SET `codes` = 'ICD10:E78.5' WHERE `list_id` = 'medical_problem_issue_list' AND `option_id` = 'hyperlipidemia';
1426 #IfNotRow2D list_options list_id medical_problem_issue_list option_id poag
1427 INSERT INTO list_options(list_id,option_id,title,seq,codes,subtype) VALUES ('medical_problem_issue_list', 'poag','POAG', 10,'ICD10:H40.11X4','eye');
1428 #EndIf
1430 #IfNotRow2D list_options list_id medical_problem_issue_list option_id dermatochalasis
1431 INSERT INTO list_options(list_id,option_id,title,seq,codes,subtype) VALUES ('medical_problem_issue_list', 'dermatochalasis','Dermatochalasis', 20,'ICD10:H02.839','eye');
1432 #EndIf
1434 #IfNotRow2D list_options list_id medical_problem_issue_list option_id niddm_bdr
1435 INSERT INTO list_options(list_id,option_id,title,seq,codes,subtype) VALUES ('medical_problem_issue_list', 'niddm_bdr','NIDDM w/ BDR', 30,',ICD10:E11.319','eye');
1436 #EndIf
1438 #IfNotRow2D list_options list_id medical_problem_issue_list option_id ns_cataract
1439 INSERT INTO list_options(list_id,option_id,title,seq,codes,subtype) VALUES ('medical_problem_issue_list', 'ns_cataract','NS Cataract', 40,'ICD10:H25.10','eye');
1440 #EndIf
1442 #IfNotRow2D list_options list_id medical_problem_issue_list option_id BCC
1443 INSERT INTO list_options(list_id,option_id,title,seq,codes,subtype) VALUES ('medical_problem_issue_list', 'BCC','BCC', 50,'ICD10:C44.191','eye');
1444 #EndIf
1446 #IfNotRow2D list_options list_id medical_problem_issue_list option_id iddm_bdr
1447 INSERT INTO list_options(list_id,option_id,title,seq,codes,subtype) VALUES ('medical_problem_issue_list', 'iddm_bdr','IDDM w/ BDR', 60,'ICD10:E10.329','eye');
1448 #EndIf
1450 #IfNotRow2D list_options list_id medical_problem_issue_list option_id Keratoconus
1451 INSERT INTO list_options(list_id,option_id,title,seq,codes,subtype) VALUES ('medical_problem_issue_list', 'Keratoconus','Keratoconus', 70,'ICD10:H18.603','eye');
1452 #EndIf
1454 #IfNotRow2D list_options list_id medical_problem_issue_list option_id dry_eye
1455 INSERT INTO list_options(list_id,option_id,title,seq,codes,subtype) VALUES ('medical_problem_issue_list', 'dry_eye','Dry Eye', 80,'ICD10:H04.123','eye');
1456 #EndIf
1458 #IfNotRow2D list_options list_id medical_problem_issue_list option_id SCC
1459 INSERT INTO list_options(list_id,option_id,title,seq,codes,subtype) VALUES ('medical_problem_issue_list', 'SCC','SCC', 90,'ICD10:C44.191','eye');
1460 #EndIf
1462 #IfNotRow2D list_options list_id medical_problem_issue_list option_id stye
1463 INSERT INTO list_options(list_id,option_id,title,seq,codes,subtype) VALUES ('medical_problem_issue_list', 'stye','stye', 100,'ICD10:H00.029','eye');
1464 #EndIf
1466 #IfNotRow2D list_options list_id surgery_issue_list option_id Bleph_Upper
1467 INSERT INTO list_options(list_id,option_id,title,seq,codes,subtype) VALUES ('surgery_issue_list', 'Bleph_Upper', 'Blepharoplasty', 40, 'CPT4:15823-50', 'eye');
1468 #EndIf
1470 #IfNotRow2D list_options list_id surgery_issue_list option_id Phaco_IOL_OD
1471 INSERT INTO list_options(list_id,option_id,title,seq,codes,subtype) VALUES ('surgery_issue_list', 'Phaco_IOL_OD', 'Phaco/IOL OD', 50, 'CPT4:66984-RT', 'eye');
1472 #EndIf
1474 #IfNotRow2D list_options list_id surgery_issue_list option_id Phaco_IOL_OS
1475 INSERT INTO list_options(list_id,option_id,title,seq,codes,subtype) VALUES ('surgery_issue_list', 'Phaco_IOL_OS', 'Phaco/IOL OS', 60, 'CPT4:66984-LT', 'eye');
1476 #EndIf
1478 #IfNotRow2D list_options list_id surgery_issue_list option_id LPI_OD
1479 INSERT INTO list_options(list_id,option_id,title,seq,codes,subtype) VALUES ('surgery_issue_list', 'LPI_OD', 'LPI OD', 70, 'CPT4:66761-RT', 'eye');
1480 #EndIf
1482 #IfNotRow2D list_options list_id surgery_issue_list option_id LPI_OS
1483 INSERT INTO list_options(list_id,option_id,title,seq,codes,subtype) VALUES ('surgery_issue_list', 'LPI_OS', 'LPI OS', 80, 'CPT4:66761-LT', 'eye');
1484 #EndIf
1486 #IfNotRow2D list_options list_id surgery_issue_list option_id ALT_OD
1487 INSERT INTO list_options(list_id,option_id,title,seq,codes,subtype) VALUES ('surgery_issue_list', 'ALT_OD', 'ALT OD', 90, 'CPT4:65855-RT', 'eye');
1488 #EndIf
1490 #IfNotRow2D list_options list_id surgery_issue_list option_id ALT_OS
1491 INSERT INTO list_options(list_id,option_id,title,seq,codes,subtype) VALUES ('surgery_issue_list', 'ALT_OS', 'ALT OS', 100, 'CPT4:65855-LT', 'eye');
1492 #EndIf
1495 #IfNotRow2D list_options list_id lists option_id CTLManufacturer
1496 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists', 'CTLManufacturer', 'Eye Contact Lens Manufacturer list', 1, 0);
1497 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('CTLManufacturer', 'BNL', 'Bausch&Lomb', 10, 0);
1498 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('CTLManufacturer', 'CibaVision', 'Ciba Vision', 20, 0);
1499 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('CTLManufacturer', 'Cooper', 'CooperVision', 30, 0);
1500 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('CTLManufacturer', 'JNJ', 'Johnson&Johnson', 40, 0);
1501 #EndIf
1503 #IfNotRow2D list_options list_id lists option_id CTLSupplier
1504 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists'    ,'CTLSupplier', 'Eye Contact Lens Supplier list', 1,0);
1505 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('CTLSupplier', 'ABB', 'ABB Optical', 10, 0);
1506 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('CTLSupplier', 'JNJ', 'Johnson&Johnson', 20, 0);
1507 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('CTLSupplier', 'LF', 'Lens Ferry', 30, 0);
1508 #EndIf
1510 #IfNotRow2D list_options list_id lists option_id CTLBrand
1511 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists'   ,'CTLBrand', 'Eye Contact Lens Brand list', 1, 0);
1512 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('CTLBrand', 'Acuvue', 'Acuvue', 10, 0);
1513 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('CTLBrand', 'Acuvue2', 'Acuvue 2', 20, 0);
1514 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('CTLBrand', 'AcuvueOa', 'Acuvue Oasys', 30, 0);
1515 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('CTLBrand', 'SF66', 'SofLens Toric', 40, 0);
1516 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('CTLBrand', 'PVMF', 'PureVision MultiFocal', 50, 0);
1517 #EndIf
1519 #IfNotRow2D list_options list_id lists option_id Eye_Coding_Fields
1520 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'Eye_Coding_Fields', 'Eye Coding Fields', 1, 0);
1521 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`, `mapping`, `notes`, `codes`, `toggle_setting_1`, `toggle_setting_2`, `activity`, `subtype`) VALUES
1522 ('Eye_Coding_Fields', 'RUL', 'RUL', 10, 0, 0, '', 'right upper eyelid', '', 0, 0, 1, ''),
1523 ('Eye_Coding_Fields', 'RLL', 'RLL', 20, 0, 0, '', 'right lower eyelid', '', 0, 0, 1, ''),
1524 ('Eye_Coding_Fields', 'LUL', 'LUL', 30, 0, 0, '', 'left upper eyelid', '', 0, 0, 1, ''),
1525 ('Eye_Coding_Fields', 'LLL', 'LLL', 40, 0, 0, '', 'left lower eyelid', '', 0, 0, 1, ''),
1526 ('Eye_Coding_Fields', 'RBROW', 'RBROW', 50, 0, 0, '', 'forehead', '', 0, 0, 1, ''),
1527 ('Eye_Coding_Fields', 'LBROW', 'LBROW', 60, 0, 0, '', 'forehead', '', 0, 0, 1, ''),
1528 ('Eye_Coding_Fields', 'RMCT', 'RMCT', 70, 0, 0, '', 'canthus', '', 0, 0, 1, ''),
1529 ('Eye_Coding_Fields', 'LMCT', 'LMCT', 80, 0, 0, '', 'canthus', '', 0, 0, 1, ''),
1530 ('Eye_Coding_Fields', 'RBROW_unspec', 'RBROW', 90, 0, 0, '', 'unspecified', '', 0, 0, 1, ''),
1531 ('Eye_Coding_Fields', 'LBROW_unspec', 'LBROW', 100, 0, 0, '', 'unspecified', '', 0, 0, 1, ''),
1532 ('Eye_Coding_Fields', 'RADNEXA', 'RADNEXA', 110, 0, 0, '', 'unspecified', '', 0, 0, 1, ''),
1533 ('Eye_Coding_Fields', 'LADNEXA', 'LADNEXA', 120, 0, 0, '', 'unspecified', '', 0, 0, 1, ''),
1534 ('Eye_Coding_Fields', 'ODCONJ', 'ODCONJ', 130, 0, 0, '', 'right conjunctiva', '', 0, 0, 1, ''),
1535 ('Eye_Coding_Fields', 'OSCONJ', 'OSCONJ', 140, 0, 0, '', 'left conjunctiva', '', 0, 0, 1, ''),
1536 ('Eye_Coding_Fields', 'ODCORNEA', 'ODCORNEA', 150, 0, 0, '', 'right cornea', '', 0, 0, 1, ''),
1537 ('Eye_Coding_Fields', 'OSCORNEA', 'OSCORNEA', 160, 0, 0, '', 'left cornea', '', 0, 0, 1, ''),
1538 ('Eye_Coding_Fields', 'ODAC', 'ODAC', 170, 0, 0, '', 'right anterior chamber', '', 0, 0, 1, ''),
1539 ('Eye_Coding_Fields', 'OSAC', 'OSAC', 180, 0, 0, '', 'left anterior chamber', '', 0, 0, 1, ''),
1540 ('Eye_Coding_Fields', 'ODLENS', 'ODLENS', 190, 0, 0, '', 'right lens', '', 0, 0, 1, ''),
1541 ('Eye_Coding_Fields', 'OSLENS', 'OSLENS', 200, 0, 0, '', 'left lens', '', 0, 0, 1, ''),
1542 ('Eye_Coding_Fields', 'ODIRIS', 'ODIRIS', 210, 0, 0, '', 'right iris', '', 0, 0, 1, ''),
1543 ('Eye_Coding_Fields', 'OSIRIS', 'OSIRIS', 220, 0, 0, '', 'left iris', '', 0, 0, 1, ''),
1544 ('Eye_Coding_Fields', 'ODDISC', 'ODDISC', 230, 0, 0, '', 'right', '', 0, 0, 1, ''),
1545 ('Eye_Coding_Fields', 'OSDISC', 'OSDISC', 240, 0, 0, '', 'left', '', 0, 0, 1, ''),
1546 ('Eye_Coding_Fields', 'ODMAC', 'ODMACULA', 250, 0, 0, '', 'right macula', '', 0, 0, 1, ''),
1547 ('Eye_Coding_Fields', 'OSMAC', 'OSMACULA', 260, 0, 0, '', 'left macula', '', 0, 0, 1, ''),
1548 ('Eye_Coding_Fields', 'ODVESSELS', 'ODVESSELS', 270, 0, 0, '', 'right', '', 0, 0, 1, ''),
1549 ('Eye_Coding_Fields', 'OSVESSELS', 'OSVESSELS', 280, 0, 0, '', 'left', '', 0, 0, 1, ''),
1550 ('Eye_Coding_Fields', 'ODPERIPH', 'ODPERIPH', 290, 0, 0, '', 'right', '', 0, 0, 1, ''),
1551 ('Eye_Coding_Fields', 'OSPERIPH', 'OSPERIPH', 300, 0, 0, '', 'left', '', 0, 0, 1, '');
1552 #EndIf
1554 #IfNotRow2D list_options list_id lists option_id Eye_Coding_Terms
1555 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'Eye_Coding_Terms', 'Eye Coding Terms', 1, 0);
1556 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`, `mapping`, `notes`, `codes`, `toggle_setting_1`, `toggle_setting_2`, `activity`, `subtype`) VALUES
1557 ('Eye_Coding_Terms', 'dermato_RUL', 'dermatochalasis', 10, 0, 0, '', 'RUL', '', 0, 0, 1, ''),
1558 ('Eye_Coding_Terms', 'dermato_RLL', 'dermatochalasis', 20, 0, 0, '', 'RLL', '', 0, 0, 1, ''),
1559 ('Eye_Coding_Terms', 'dermato_LUL', 'dermatochalasis', 30, 0, 0, '', 'LUL', '', 0, 0, 1, ''),
1560 ('Eye_Coding_Terms', 'dermato_LLL', 'dermatochalasis', 40, 0, 0, '', 'LLL', '', 0, 0, 1, ''),
1561 ('Eye_Coding_Terms', 'ptosis_RUL', 'ptosis', 50, 0, 0, '', 'RUL', '', 0, 0, 1, ''),
1562 ('Eye_Coding_Terms', 'ptosis_LUL', 'ptosis', 60, 0, 0, '', 'LUL', '', 0, 0, 1, ''),
1563 ('Eye_Coding_Terms', 'chalazion_RUL', 'chalazion', 70, 0, 0, '', 'RUL', '', 0, 0, 1, ''),
1564 ('Eye_Coding_Terms', 'chalazion_RLL', 'chalazion', 80, 0, 0, '', 'RLL', '', 0, 0, 1, ''),
1565 ('Eye_Coding_Terms', 'chalazion_LUL', 'chalazion', 90, 0, 0, '', 'LUL', '', 0, 0, 1, ''),
1566 ('Eye_Coding_Terms', 'chalazion_LLL', 'chalazion', 100, 0, 0, '', 'LLL', '', 0, 0, 1, ''),
1567 ('Eye_Coding_Terms', 'cicectr_RUL', 'cicatricial ectropion', 110, 0, 0, '', 'RUL', 'ICD10:H02.111', 0, 0, 1, ''),
1568 ('Eye_Coding_Terms', 'cicectr_RLL', 'cicatricial ectropion', 120, 0, 0, '', 'RLL', 'ICD10:H02.112', 0, 0, 1, ''),
1569 ('Eye_Coding_Terms', 'cicectr_LUL', 'cicatricial ectropion', 130, 0, 0, '', 'LUL', 'ICD10:H02.114', 0, 0, 1, ''),
1570 ('Eye_Coding_Terms', 'cicectr_LLL', 'cicatricial ectropion', 140, 0, 0, '', 'LLL', 'ICD10:H02.115', 0, 0, 1, ''),
1571 ('Eye_Coding_Terms', 'spasectr_RUL', 'spastic ectropion', 150, 0, 0, '', 'RUL', 'ICD10:H02.141', 0, 0, 1, ''),
1572 ('Eye_Coding_Terms', 'spasentr_RUL', 'spastic entropion', 160, 0, 0, '', 'RUL', 'ICD10:H02.041', 0, 0, 1, ''),
1573 ('Eye_Coding_Terms', 'spasectr_RLL', 'spastic ectropion', 170, 0, 0, '', 'RLL', 'ICD10:H02.142', 0, 0, 1, ''),
1574 ('Eye_Coding_Terms', 'spasentr_RLL', 'spastic entropion', 180, 0, 0, '', 'RLL', 'ICD10:H02.042', 0, 0, 1, ''),
1575 ('Eye_Coding_Terms', 'spasectr_LUL', 'spastic ectropion', 190, 0, 0, '', 'LUL', 'ICD10:H02.144', 0, 0, 1, ''),
1576 ('Eye_Coding_Terms', 'spasentr_LUL', 'spastic entropion', 200, 0, 0, '', 'LUL', 'ICD10:H02.044', 0, 0, 1, ''),
1577 ('Eye_Coding_Terms', 'spasectr_LLL', 'spastic ectropion', 210, 0, 0, '', 'LLL', 'ICD10:H02.145', 0, 0, 1, ''),
1578 ('Eye_Coding_Terms', 'spasentr_LLL', 'spastic entropion', 220, 0, 0, '', 'LLL', 'ICD10:H02.045', 0, 0, 1, ''),
1579 ('Eye_Coding_Terms', 'cicentr_RUL', 'cicatricial entropion', 230, 0, 0, '', 'RUL', 'ICD10:H02.111', 0, 0, 1, ''),
1580 ('Eye_Coding_Terms', 'cicentr_RLL', 'cicatricial entropion', 240, 0, 0, '', 'RLL', 'ICD10:H02.112', 0, 0, 1, ''),
1581 ('Eye_Coding_Terms', 'cicentr_LUL', 'cicatricial entropion', 250, 0, 0, '', 'LUL', 'ICD10:H02.114', 0, 0, 1, ''),
1582 ('Eye_Coding_Terms', 'cicentr_LLL', 'cicatricial entropion', 260, 0, 0, '', 'LLL', 'ICD10:H02.115', 0, 0, 1, ''),
1583 ('Eye_Coding_Terms', 'ect_RUL', 'ectropion', 270, 0, 0, '', 'RUL', 'ICD10:H02.101', 0, 0, 1, ''),
1584 ('Eye_Coding_Terms', 'ect_RLL', 'ectropion', 280, 0, 0, '', 'RLL', 'ICD10:H02.102', 0, 0, 1, ''),
1585 ('Eye_Coding_Terms', 'ect_LUL', 'ectropion', 290, 0, 0, '', 'LUL', 'ICD10:H02.104', 0, 0, 1, ''),
1586 ('Eye_Coding_Terms', 'ect_LLL', 'ectropion', 300, 0, 0, '', 'LLL', 'ICD10:H02.105', 0, 0, 1, ''),
1587 ('Eye_Coding_Terms', 'ent_RUL', 'entropion', 310, 0, 0, '', 'RUL', 'ICD10:H02.001', 0, 0, 1, ''),
1588 ('Eye_Coding_Terms', 'ent_RLL', 'entropion', 320, 0, 0, '', 'RLL', 'ICD10:H02.002', 0, 0, 1, ''),
1589 ('Eye_Coding_Terms', 'ent_LUL', 'entropion', 330, 0, 0, '', 'LUL', 'ICD10:H02.004', 0, 0, 1, ''),
1590 ('Eye_Coding_Terms', 'ent_LLL', 'entropion', 340, 0, 0, '', 'LLL', 'ICD10:H02.005', 0, 0, 1, ''),
1591 ('Eye_Coding_Terms', 'trich_RUL', 'trichiasis', 350, 0, 0, '', 'RUL', 'ICD10:H02.051', 0, 0, 1, ''),
1592 ('Eye_Coding_Terms', 'trich_RLL', 'trichiasis', 360, 0, 0, '', 'RLL', 'ICD10:H02.052', 0, 0, 1, ''),
1593 ('Eye_Coding_Terms', 'trich_LUL', 'trichiasis', 370, 0, 0, '', 'LUL', 'ICD10:H02.054', 0, 0, 1, ''),
1594 ('Eye_Coding_Terms', 'trich_LLL', 'trichiasis', 380, 0, 0, '', 'LLL', 'ICD10:H02.055', 0, 0, 1, ''),
1595 ('Eye_Coding_Terms', 'stye_RUL', 'stye', 390, 0, 0, '', 'RUL', 'ICD10:H00.011', 0, 0, 1, ''),
1596 ('Eye_Coding_Terms', 'stye_RLL', 'stye', 400, 0, 0, '', 'RLL', 'ICD10:H00.012', 0, 0, 1, ''),
1597 ('Eye_Coding_Terms', 'stye_LUL', 'stye', 410, 0, 0, '', 'LUL', 'ICD10:H00.014', 0, 0, 1, ''),
1598 ('Eye_Coding_Terms', 'stye_LLL', 'stye', 420, 0, 0, '', 'LLL', 'ICD10:H00.015', 0, 0, 1, ''),
1599 ('Eye_Coding_Terms', 'papillae_ODCONJ', 'papilla', 430, 0, 0, '', 'ODCONJ', 'ICD10:H10.401', 0, 0, 1, ''),
1600 ('Eye_Coding_Terms', 'papillae_OSCONJ', 'papilla', 440, 0, 0, '', 'OSCONJ', 'ICD10:H10.402', 0, 0, 1, ''),
1601 ('Eye_Coding_Terms', 'folllicles_ODCONJ', 'folllicles', 450, 0, 0, '', 'ODCONJ', 'ICD10:H10.011', 0, 0, 1, ''),
1602 ('Eye_Coding_Terms', 'folllicles_OSCONJ', 'folllicles', 460, 0, 0, '', 'OSCONJ', 'ICD10:H10.012', 0, 0, 1, ''),
1603 ('Eye_Coding_Terms', 'pterygium_ODCORNEA', 'pterygium', 470, 0, 0, '', 'ODCORNEA', 'ICD10:H11.051', 0, 0, 1, ''),
1604 ('Eye_Coding_Terms', 'pterygium_ODCONJ', 'pterygium', 480, 0, 0, '', 'ODCONJ', 'ICD10:H11.811', 0, 0, 1, ''),
1605 ('Eye_Coding_Terms', 'pterygium_OSCONJ', 'pterygium', 490, 0, 0, '', 'OSCONJ', 'ICD10:H11.812', 0, 0, 1, ''),
1606 ('Eye_Coding_Terms', 'pterygium_OSCORNEA', 'pterygium', 500, 0, 0, '', 'OSCORNEA', 'ICD10:H11.052', 0, 0, 1, ''),
1607 ('Eye_Coding_Terms', 'abrasion_ODCORNEA', 'abrasion', 510, 0, 0, '', 'ODCORNEA', 'ICD10:S05.01XA', 0, 0, 1, ''),
1608 ('Eye_Coding_Terms', 'abrasion_OSCORNEA', 'abrasion', 520, 0, 0, '', 'OSCORNEA', 'ICD10:S05.02XA', 0, 0, 1, ''),
1609 ('Eye_Coding_Terms', 'FB_ODCORNEA', 'FB', 530, 0, 0, '', 'ODCORNEA', 'ICD10:T15.01XA', 0, 0, 1, ''),
1610 ('Eye_Coding_Terms', 'FB_OSCORNEA', 'FB', 540, 0, 0, '', 'OSCORNEA', 'ICD10:T15.02XA', 0, 0, 1, ''),
1611 ('Eye_Coding_Terms', 'dendrite_ODCORNEA', 'dendrite', 550, 0, 0, '', 'ODCORNEA', 'ICD10:B00.52', 0, 0, 1, ''),
1612 ('Eye_Coding_Terms', 'dendrite_OSCORNEA', 'dendrite', 560, 0, 0, '', 'OSCORNEA', 'ICD10:B00.52', 0, 0, 1, ''),
1613 ('Eye_Coding_Terms', 'MDF_ODCORNEA', 'MDF', 570, 0, 0, '', 'ODCORNEA', 'ICD10:H18.59', 0, 0, 1, ''),
1614 ('Eye_Coding_Terms', 'MDF_OSCORNEA', 'MDF', 580, 0, 0, '', 'OSCORNEA', 'ICD10:H18.59', 0, 0, 1, ''),
1615 ('Eye_Coding_Terms', 'NS_ODLENS', 'NS', 590, 0, 0, '', 'ODLENS', 'ICD10:H25.11', 0, 0, 1, ''),
1616 ('Eye_Coding_Terms', 'NS_OSLENS', 'NS', 600, 0, 0, '', 'OSLENS', 'ICD10:H25.12', 0, 0, 1, ''),
1617 ('Eye_Coding_Terms', 'PSC_ODLENS', 'PSC', 610, 0, 0, '', 'ODLENS', 'ICD10:H25.041', 0, 0, 1, ''),
1618 ('Eye_Coding_Terms', 'PSC_OSLENS', 'PSC', 620, 0, 0, '', 'OSLENS', 'ICD10:H25.042', 0, 0, 1, ''),
1619 ('Eye_Coding_Terms', 'PCIOL_ODLENS', 'PCIOL', 630, 0, 0, '', 'ODLENS', 'ICD10:Z96.1', 0, 0, 1, ''),
1620 ('Eye_Coding_Terms', 'PCIOL_OSLENS', 'PCIOL', 640, 0, 0, '', 'OSLENS', 'ICD10:Z96.1', 0, 0, 1, ''),
1621 ('Eye_Coding_Terms', 'hyphema_ODAC', 'hyphema', 650, 0, 0, '', 'ODAC', 'ICD10:H21.01', 0, 0, 1, ''),
1622 ('Eye_Coding_Terms', 'hyphema_OSAC', 'hyphema', 660, 0, 0, '', 'OSAC', 'ICD10:H21.02', 0, 0, 1, ''),
1623 ('Eye_Coding_Terms', 'horseshoe_ODPERIPHERY', 'horseshoe', 670, 0, 0, '', 'ODPERIPH', 'ICD10:H33.311', 0, 0, 1, ''),
1624 ('Eye_Coding_Terms', 'horseshoe_OSPERIPHERY', 'horseshoe', 680, 0, 0, '', 'OSPERIPH', 'ICD10:H33.312', 0, 0, 1, ''),
1625 ('Eye_Coding_Terms', 'hole_ODPERIPHERY', 'hole', 690, 0, 0, '', 'ODPERIPH', 'ICD10:H33.321', 0, 0, 1, ''),
1626 ('Eye_Coding_Terms', 'hole_OSPERIPHERY', 'hole', 700, 0, 0, '', 'OSPERIPH', 'ICD10:H33.322', 0, 0, 1, ''),
1627 ('Eye_Coding_Terms', 'CSR_ODMACULA', 'CSR', 710, 0, 0, '', 'ODMACULA', 'ICD10:H35.711', 0, 0, 1, ''),
1628 ('Eye_Coding_Terms', 'hole_ODMACULA', 'Mac hole', 720, 0, 0, '', 'ODMACULA', 'ICD10:H35.341', 0, 0, 1, ''),
1629 ('Eye_Coding_Terms', 'CSR_OSMACULA', 'CSR', 730, 0, 0, '', 'OSMACULA', 'ICD10:H35.712', 0, 0, 1, ''),
1630 ('Eye_Coding_Terms', 'hole_OSMACULA', 'Mac hole', 740, 0, 0, '', 'OSMACULA', 'ICD10:H35.342', 0, 0, 1, ''),
1631 ('Eye_Coding_Terms', 'drusen_ODMACULA', 'drusen', 750, 0, 0, '', 'ODMACULA', 'ICD10:H35.361', 0, 0, 1, ''),
1632 ('Eye_Coding_Terms', 'drusen_OSMACULA', 'drusen', 760, 0, 0, '', 'OSMACULA', 'ICD10:H35.362', 0, 0, 1, ''),
1633 ('Eye_Coding_Terms', 'drusen_ODDISC', 'drusen', 770, 0, 0, '', 'ODDISC', 'ICD10:H47.321', 0, 0, 1, ''),
1634 ('Eye_Coding_Terms', 'drusen_OSDISC', 'drusen', 780, 0, 0, '', 'ODDISC', 'ICD10:H47.322', 0, 0, 1, ''),
1635 ('Eye_Coding_Terms', 'BRVO_ODPERIPHERY', 'BRVO', 790, 0, 0, '', 'ODVESSELS', 'ICD10:H34.831', 0, 0, 1, ''),
1636 ('Eye_Coding_Terms', 'CRVO_ODPERIPHERY', 'CRVO', 800, 0, 0, '', 'ODVESSELS', 'ICD10:H34.811', 0, 0, 1, ''),
1637 ('Eye_Coding_Terms', 'lattice_ODPERIPHERY', 'lattice', 810, 0, 0, '', 'ODPERIPH', 'ICD10:H35.412', 0, 0, 1, ''),
1638 ('Eye_Coding_Terms', 'BRVO_OSPERIPHERY', 'BRVO', 820, 0, 0, '', 'OSVESSELS', 'ICD10:H34.832', 0, 0, 1, ''),
1639 ('Eye_Coding_Terms', 'CRVO_OSPERIPHERY', 'CRVO', 830, 0, 0, '', 'OSVESSELS', 'ICD10:H34.812', 0, 0, 1, ''),
1640 ('Eye_Coding_Terms', 'lattice_OSPERIPHERY', 'lattice', 840, 0, 0, '', 'OSPERIPH', 'ICD10:H35.412', 0, 0, 1, ''),
1641 ('Eye_Coding_Terms', 'NLDO_RMCT', 'NLDO', 850, 0, 0, '', 'RMCT', 'ICD10:H04.411', 0, 0, 1, ''),
1642 ('Eye_Coding_Terms', 'NLDO_LMCT', 'NLDO', 860, 0, 0, '', 'LMCT', 'ICD10:H04.412', 0, 0, 1, ''),
1643 ('Eye_Coding_Terms', 'NVD_ODDISC', 'NVD:DM', 870, 0, 0, '', 'ODDISC', '', 0, 0, 1, ''),
1644 ('Eye_Coding_Terms', 'NVD_OSDISC', 'NVD:DM', 880, 0, 0, '', 'OSDISC', '', 0, 0, 1, ''),
1645 ('Eye_Coding_Terms', 'CSME_ODMACULA', 'CSME:DM|IOL|RVO', 890, 0, 0, '', 'ODMACULA', '', 0, 0, 1, ''),
1646 ('Eye_Coding_Terms', 'CSME_OSMACULA', 'CSME:DM|IOL|RVO', 900, 0, 0, '', 'OSMACULA', '', 0, 0, 1, ''),
1647 ('Eye_Coding_Terms', 'NVE_ODVESSELS', 'NVE:DM', 910, 0, 0, '', 'ODVESSELS', '', 0, 0, 1, ''),
1648 ('Eye_Coding_Terms', 'NVE_OSVESSELS', 'NVE:DM', 920, 0, 0, '', 'OSVESSELS', '', 0, 0, 1, ''),
1649 ('Eye_Coding_Terms', 'NVE_ODPERIPHERY', 'NVE:DM', 930, 0, 0, '', 'ODPERIPH', '', 0, 0, 1, ''),
1650 ('Eye_Coding_Terms', 'NVE_OSPERIPHERY', 'NVE:DM', 940, 0, 0, '', 'OSPERIPH', '', 0, 0, 1, ''),
1651 ('Eye_Coding_Terms', 'BDR_ODMACULA', 'BDR:DM', 950, 0, 0, '', 'ODMACULA', '', 0, 0, 1, ''),
1652 ('Eye_Coding_Terms', 'BDR_OSMACULA', 'BDR:DM', 960, 0, 0, '', 'OSMACULA', '', 0, 0, 1, '');
1653 #EndIf
1655 #IfNotRow2D list_options list_id lists option_id Eye_QP_ANTSEG_defaults
1656 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'Eye_QP_ANTSEG_defaults', 'Eye QP List ANTSEG for New Providers', 1, 0);
1657 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`, `mapping`, `notes`, `codes`, `toggle_setting_1`, `toggle_setting_2`, `activity`, `subtype`) VALUES
1658 ('Eye_QP_ANTSEG_defaults', 'ODCONJ_cl', 'c: clear field', 10, 0, 0, 'CONJ', '', '', 0, 0, 1, 'OD'),
1659 ('Eye_QP_ANTSEG_defaults', 'OSCONJ_cl', 'c: clear field', 20, 0, 0, 'CONJ', '', '', 0, 0, 1, 'OS'),
1660 ('Eye_QP_ANTSEG_defaults', 'OUCONJ_cl', 'c: clear field', 30, 0, 0, 'CONJ', '', '', 0, 0, 1, 'OU'),
1661 ('Eye_QP_ANTSEG_defaults', 'ODCONJ_quiet', 'c: quiet', 40, 0, 0, 'CONJ', 'quiet', '', 0, 0, 1, 'OD'),
1662 ('Eye_QP_ANTSEG_defaults', 'OSCONJ_quiet', 'c: quiet', 50, 0, 0, 'CONJ', 'quiet', '', 0, 0, 1, 'OS'),
1663 ('Eye_QP_ANTSEG_defaults', 'OUCONJ_quiet', 'c: quiet', 60, 0, 0, 'CONJ', 'quiet', '', 0, 0, 1, 'OU'),
1664 ('Eye_QP_ANTSEG_defaults', 'ODCONJ_inj', 'c: injection', 70, 0, 0, 'CONJ', 'injection', 'ICD10:H10.31', 0, 0, 0, 'OD'),
1665 ('Eye_QP_ANTSEG_defaults', 'OSCONJ_inj', 'c: injection', 80, 0, 0, 'CONJ', 'injection', 'ICD10:H10.32', 0, 0, 0, 'OS'),
1666 ('Eye_QP_ANTSEG_defaults', 'OUCONJ_inj', 'c: injection', 90, 0, 0, 'CONJ', 'injection', 'ICD10:H10.33', 0, 0, 0, 'OU'),
1667 ('Eye_QP_ANTSEG_defaults', 'ODCONJ_pap', 'c: papillae', 100, 0, 0, 'CONJ', 'papillae', 'ICD10:H10.31', 0, 0, 0, 'OD'),
1668 ('Eye_QP_ANTSEG_defaults', 'OSCONJ_pap', 'c: papillae', 110, 0, 0, 'CONJ', 'papillae', 'ICD10:H10.32', 0, 0, 0, 'OS'),
1669 ('Eye_QP_ANTSEG_defaults', 'OUCONJ_pap', 'c: papillae', 120, 0, 0, 'CONJ', 'papillae', 'ICD10:H10.33', 0, 0, 0, 'OU'),
1670 ('Eye_QP_ANTSEG_defaults', 'ODCONJ_gpap', 'c: giant pap', 130, 0, 0, 'CONJ', 'giant papillae', 'ICD10:H10.411', 0, 0, 0, 'OD'),
1671 ('Eye_QP_ANTSEG_defaults', 'OSCONJ_gpap', 'c: giant pap', 140, 0, 0, 'CONJ', 'giant papillae', 'ICD10:H10.412', 0, 0, 0, 'OS'),
1672 ('Eye_QP_ANTSEG_defaults', 'OUCONJ_gpap', 'c: giant pap', 150, 0, 0, 'CONJ', 'giant papillae', 'ICD10:H10.413', 0, 0, 0, 'OU'),
1673 ('Eye_QP_ANTSEG_defaults', 'ODCONJ_pinq', 'c: pinquecula', 160, 0, 0, 'CONJ', 'pinquecula', 'ICD10:H11.151', 0, 0, 0, 'OD'),
1674 ('Eye_QP_ANTSEG_defaults', 'OSCONJ_pinq', 'c: pinquecula', 170, 0, 0, 'CONJ', 'pinquecula', 'ICD10:H11.152', 0, 0, 0, 'OS'),
1675 ('Eye_QP_ANTSEG_defaults', 'OUCONJ_pinq', 'c: pinquecula', 180, 0, 0, 'CONJ', 'pinquecula', 'ICD10:H11.153', 0, 0, 0, 'OU'),
1676 ('Eye_QP_ANTSEG_defaults', 'ODCONJ_foll', 'c: follicles', 190, 0, 0, 'CONJ', 'follicles', 'ICD10:H10.011', 0, 0, 0, 'OD'),
1677 ('Eye_QP_ANTSEG_defaults', 'OSCONJ_foll', 'c: follicles', 200, 0, 0, 'CONJ', 'follicles', 'ICD10:H10.012', 0, 0, 0, 'OS'),
1678 ('Eye_QP_ANTSEG_defaults', 'OUCONJ_foll', 'c: follicles', 210, 0, 0, 'CONJ', 'follicles', 'ICD10:H10.013', 0, 0, 0, 'OU'),
1679 ('Eye_QP_ANTSEG_defaults', 'ODCONJ_mucop', 'c: mucopurulence', 220, 0, 0, 'CONJ', 'mucopurulence', 'ICD10:H10.013', 0, 0, 0, 'OD'),
1680 ('Eye_QP_ANTSEG_defaults', 'OSCONJ_mucop', 'c: mucopurulence', 230, 0, 0, 'CONJ', 'mucopurulence', 'ICD10:H10.013', 0, 0, 0, 'OS'),
1681 ('Eye_QP_ANTSEG_defaults', 'OUCONJ_mucop', 'c: mucopurulence', 240, 0, 0, 'CONJ', 'mucopurulence', 'ICD10:H10.013', 0, 0, 0, 'OU'),
1682 ('Eye_QP_ANTSEG_defaults', 'ODCONJ_bleb', 'c: mod bleb', 250, 0, 0, 'CONJ', 'moderate bleb', '', 0, 0, 0, 'OD'),
1683 ('Eye_QP_ANTSEG_defaults', 'OSCONJ_bleb', 'c: mod bleb', 260, 0, 0, 'CONJ', 'moderate bleb', '', 0, 0, 0, 'OS'),
1684 ('Eye_QP_ANTSEG_defaults', 'OUCONJ_bleb', 'c: mod bleb', 270, 0, 0, 'CONJ', 'moderate bleb', '', 0, 0, 0, 'OU'),
1685 ('Eye_QP_ANTSEG_defaults', 'ODCONJ_sied', 'c: siedel negative', 280, 0, 0, 'CONJ', 'siedel negative', '', 0, 0, 0, 'OD'),
1686 ('Eye_QP_ANTSEG_defaults', 'OSCONJ_sied', 'c: siedel negative', 290, 0, 0, 'CONJ', 'siedel negative', '', 0, 0, 0, 'OS'),
1687 ('Eye_QP_ANTSEG_defaults', 'OUCONJ_sied', 'c: siedel negative', 300, 0, 0, 'CONJ', 'siedel negative', '', 0, 0, 0, 'OU'),
1688 ('Eye_QP_ANTSEG_defaults', 'ODCORNEA_cl', 'k: clear field', 310, 0, 0, 'CORNEA', '', '', 0, 0, 1, 'OD'),
1689 ('Eye_QP_ANTSEG_defaults', 'OSCORNEA_cl', 'k: clear field', 320, 0, 0, 'CORNEA', '', '', 0, 0, 1, 'OS'),
1690 ('Eye_QP_ANTSEG_defaults', 'OUCORNEA_cl', 'k: clear field', 330, 0, 0, 'CORNEA', '', '', 0, 0, 1, 'OU'),
1691 ('Eye_QP_ANTSEG_defaults', 'ODCORNEA_clear', 'k: clear', 340, 0, 0, 'CORNEA', 'clear', '', 0, 0, 1, 'OD'),
1692 ('Eye_QP_ANTSEG_defaults', 'OSCORNEA_clear', 'k: clear', 350, 0, 0, 'CORNEA', 'clear', '', 0, 0, 1, 'OS'),
1693 ('Eye_QP_ANTSEG_defaults', 'OUCORNEA_clear', 'k: clear', 360, 0, 0, 'CORNEA', 'clear', '', 0, 0, 1, 'OU'),
1694 ('Eye_QP_ANTSEG_defaults', 'ODCORNEA_abr', 'k: abrasion', 370, 0, 0, 'CORNEA', 'abrasion', '', 0, 0, 0, 'OD'),
1695 ('Eye_QP_ANTSEG_defaults', 'OSCORNEA_abr', 'k: abrasion', 380, 0, 0, 'CORNEA', 'abrasion', '', 0, 0, 0, 'OS'),
1696 ('Eye_QP_ANTSEG_defaults', 'OUCORNEA_abr', 'k: abrasion', 390, 0, 0, 'CORNEA', 'abrasion', '', 0, 0, 0, 'OU'),
1697 ('Eye_QP_ANTSEG_defaults', 'ODCORNEA_MDF', 'k: MDFP dystrophy', 400, 0, 0, 'CORNEA', 'MDFP dystrophy', '', 0, 0, 0, 'OD'),
1698 ('Eye_QP_ANTSEG_defaults', 'OSCORNEA_MDF', 'k: MDFP dystrophy', 410, 0, 0, 'CORNEA', 'MDFP dystrophy', '', 0, 0, 0, 'OS'),
1699 ('Eye_QP_ANTSEG_defaults', 'OUCORNEA_MDF', 'k: MDFP dystrophy', 420, 0, 0, 'CORNEA', 'MDFP dystrophy', '', 0, 0, 0, 'OU'),
1700 ('Eye_QP_ANTSEG_defaults', 'ODCORNEA_FB', 'k: metallic FB', 430, 0, 0, 'CORNEA', 'metallic FB', '', 0, 0, 0, 'OD'),
1701 ('Eye_QP_ANTSEG_defaults', 'OSCORNEA_FB', 'k: metallic FB', 440, 0, 0, 'CORNEA', 'metallic FB', '', 0, 0, 0, 'OS'),
1702 ('Eye_QP_ANTSEG_defaults', 'OUCORNEA_FB', 'k: metallic FB', 450, 0, 0, 'CORNEA', 'metallic FB', '', 0, 0, 0, 'OU'),
1703 ('Eye_QP_ANTSEG_defaults', 'ODCORNEA_edema', 'k: edema', 460, 0, 0, 'CORNEA', 'edema', '', 0, 0, 0, 'OD'),
1704 ('Eye_QP_ANTSEG_defaults', 'OSCORNEA_edema', 'k: edema', 470, 0, 0, 'CORNEA', 'edema', '', 0, 0, 0, 'OS'),
1705 ('Eye_QP_ANTSEG_defaults', 'OUCORNEA_edema', 'k: edema', 480, 0, 0, 'CORNEA', 'edema', '', 0, 0, 0, 'OU'),
1706 ('Eye_QP_ANTSEG_defaults', 'ODCORNEA_HSV', 'k: dendrite', 490, 0, 0, 'CORNEA', 'dendrite', '', 0, 0, 0, 'OD'),
1707 ('Eye_QP_ANTSEG_defaults', 'OSCORNEA_HSV', 'k: dendrite', 500, 0, 0, 'CORNEA', 'dendrite', '', 0, 0, 0, 'OS'),
1708 ('Eye_QP_ANTSEG_defaults', 'OUCORNEA_HSV', 'k: dendrite', 510, 0, 0, 'CORNEA', 'dendrite', '', 0, 0, 0, 'OU'),
1709 ('Eye_QP_ANTSEG_defaults', 'ODCORNEA_scar', 'k: stromal scar', 520, 0, 0, 'CORNEA', 'stromal scar', '', 0, 0, 0, 'OD'),
1710 ('Eye_QP_ANTSEG_defaults', 'OSCORNEA_scar', 'k: stromal scar', 530, 0, 0, 'CORNEA', 'stromal scar', '', 0, 0, 0, 'OS'),
1711 ('Eye_QP_ANTSEG_defaults', 'OUCORNEA_scar', 'k: stromal scar', 540, 0, 0, 'CORNEA', 'stromal scar', '', 0, 0, 0, 'OU'),
1712 ('Eye_QP_ANTSEG_defaults', 'ODCORNEA_gut', 'k: guttatae', 550, 0, 0, 'CORNEA', 'guttatae', '', 0, 0, 0, 'OD'),
1713 ('Eye_QP_ANTSEG_defaults', 'OSCORNEA_gut', 'k: guttatae', 560, 0, 0, 'CORNEA', 'guttatae', '', 0, 0, 0, 'OS'),
1714 ('Eye_QP_ANTSEG_defaults', 'OUCORNEA_gut', 'k: guttatae', 570, 0, 0, 'CORNEA', 'guttatae', '', 0, 0, 0, 'OU'),
1715 ('Eye_QP_ANTSEG_defaults', 'ODCORNEA_fkp', 'k: fine KPs', 580, 0, 0, 'CORNEA', 'fine KPs', '', 0, 0, 0, 'OD'),
1716 ('Eye_QP_ANTSEG_defaults', 'OSCORNEA_fkp', 'k: fine KPs', 590, 0, 0, 'CORNEA', 'fine KPs', '', 0, 0, 0, 'OS'),
1717 ('Eye_QP_ANTSEG_defaults', 'OUCORNEA_fkp', 'k: fine KPs', 600, 0, 0, 'CORNEA', 'fine KPs', '', 0, 0, 0, 'OU'),
1718 ('Eye_QP_ANTSEG_defaults', 'ODCORNEA_mkp', 'k: mutton-fat KPs', 610, 0, 0, 'CORNEA', 'mutton-fat keratic precipitates', '', 0, 0, 0, 'OD'),
1719 ('Eye_QP_ANTSEG_defaults', 'OSCORNEA_mkp', 'k: mutton-fat KPs', 620, 0, 0, 'CORNEA', 'mutton-fat keratic precipitates', '', 0, 0, 0, 'OS'),
1720 ('Eye_QP_ANTSEG_defaults', 'OUCORNEA_mkp', 'k: mutton-fat KPs', 630, 0, 0, 'CORNEA', 'mutton-fat keratic precipitates', '', 0, 0, 0, 'OU'),
1721 ('Eye_QP_ANTSEG_defaults', 'ODAC_cl', 'ac: clear field', 640, 0, 0, 'AC', '', '', 0, 0, 1, 'OD'),
1722 ('Eye_QP_ANTSEG_defaults', 'OSAC_cl', 'ac: clear field', 650, 0, 0, 'AC', '', '', 0, 0, 1, 'OS'),
1723 ('Eye_QP_ANTSEG_defaults', 'OUAC_cl', 'ac: clear field', 660, 0, 0, 'AC', '', '', 0, 0, 1, 'OU'),
1724 ('Eye_QP_ANTSEG_defaults', 'ODAC_clear', 'ac: clear', 670, 0, 0, 'AC', 'clear', '', 0, 0, 1, 'OD'),
1725 ('Eye_QP_ANTSEG_defaults', 'OSAC_clear', 'ac: clear', 680, 0, 0, 'AC', 'clear', '', 0, 0, 1, 'OS'),
1726 ('Eye_QP_ANTSEG_defaults', 'OUAC_clear', 'ac: clear', 690, 0, 0, 'AC', 'clear', '', 0, 0, 1, 'OU'),
1727 ('Eye_QP_ANTSEG_defaults', 'ODAC_fc', 'ac: F/C', 700, 0, 0, 'AC', 'F/C', '', 0, 0, 0, 'OD'),
1728 ('Eye_QP_ANTSEG_defaults', 'OSAC_fc', 'ac: F/C', 710, 0, 0, 'AC', 'F/C', '', 0, 0, 0, 'OS'),
1729 ('Eye_QP_ANTSEG_defaults', 'OUAC_fc', 'ac: F/C', 720, 0, 0, 'AC', 'F/C', '', 0, 0, 0, 'OU'),
1730 ('Eye_QP_ANTSEG_defaults', 'ODAC_nar', 'ac :narrow', 730, 0, 0, 'AC', 'narrow', '', 0, 0, 0, 'OD'),
1731 ('Eye_QP_ANTSEG_defaults', 'OSAC_nar', 'ac :narrow', 740, 0, 0, 'AC', 'narrow', '', 0, 0, 0, 'OS'),
1732 ('Eye_QP_ANTSEG_defaults', 'OUAC_nar', 'ac :narrow', 750, 0, 0, 'AC', 'narrow', '', 0, 0, 0, 'OU'),
1733 ('Eye_QP_ANTSEG_defaults', 'ODAC_hyp', 'ac: hyphema', 760, 0, 0, 'AC', 'hyphema', '', 0, 0, 0, 'OD'),
1734 ('Eye_QP_ANTSEG_defaults', 'OSAC_hyp', 'ac: hyphema', 770, 0, 0, 'AC', 'hyphema', '', 0, 0, 0, 'OS'),
1735 ('Eye_QP_ANTSEG_defaults', 'OUAC_hyp', 'ac: hyphema', 780, 0, 0, 'AC', 'hyphema', '', 0, 0, 0, 'OU'),
1736 ('Eye_QP_ANTSEG_defaults', 'ODLENS_cl', 'lens: clear field', 790, 0, 0, 'LENS', '', '', 0, 0, 1, 'OD'),
1737 ('Eye_QP_ANTSEG_defaults', 'OSLENS_cl', 'lens: clear field', 800, 0, 0, 'LENS', '', '', 0, 0, 1, 'OS'),
1738 ('Eye_QP_ANTSEG_defaults', 'OULENS_cl', 'lens: clear field', 810, 0, 0, 'LENS', '', '', 0, 0, 1, 'OU'),
1739 ('Eye_QP_ANTSEG_defaults', 'ODLENS_pxe', 'lens: PXE', 820, 0, 0, 'LENS', 'PXE', '', 0, 0, 0, 'OD'),
1740 ('Eye_QP_ANTSEG_defaults', 'OSLENS_pxe', 'lens: PXE', 830, 0, 0, 'LENS', 'PXE', '', 0, 0, 0, 'OS'),
1741 ('Eye_QP_ANTSEG_defaults', 'OULENS_pxw', 'lens: PXE', 840, 0, 0, 'LENS', 'PXE', '', 0, 0, 0, 'OU'),
1742 ('Eye_QP_ANTSEG_defaults', 'ODLENS_psc', 'lens: PSC', 850, 0, 0, 'LENS', 'PSC', '', 0, 0, 0, 'OD'),
1743 ('Eye_QP_ANTSEG_defaults', 'OSLENS_psc', 'lens: PSC', 860, 0, 0, 'LENS', 'PSC', '', 0, 0, 0, 'OS'),
1744 ('Eye_QP_ANTSEG_defaults', 'OULENS_psc', 'lens: PSC', 870, 0, 0, 'LENS', 'PSC', '', 0, 0, 0, 'OU'),
1745 ('Eye_QP_ANTSEG_defaults', 'ODLENS_ns', 'lens: NS', 880, 0, 0, 'LENS', 'NS', '', 0, 0, 0, 'OD'),
1746 ('Eye_QP_ANTSEG_defaults', 'OSLENS_ns', 'lens: NS', 890, 0, 0, 'LENS', 'NS', '', 0, 0, 0, 'OS'),
1747 ('Eye_QP_ANTSEG_defaults', 'OULENS_ns', 'lens: NS', 900, 0, 0, 'LENS', 'NS', '', 0, 0, 0, 'OU'),
1748 ('Eye_QP_ANTSEG_defaults', 'ODLENS_cort', 'lens: cortical', 910, 0, 0, 'LENS', 'cortical', '', 0, 0, 0, 'OD'),
1749 ('Eye_QP_ANTSEG_defaults', 'OSLENS_cort', 'lens: cortical', 920, 0, 0, 'LENS', 'cortical', '', 0, 0, 0, 'OS'),
1750 ('Eye_QP_ANTSEG_defaults', 'OULENS_cort', 'lens: cortical', 930, 0, 0, 'LENS', 'cortical', '', 0, 0, 0, 'OU'),
1751 ('Eye_QP_ANTSEG_defaults', 'ODLENS_PC', 'lens: PCIOL', 940, 0, 0, 'LENS', 'PCIOL', '', 0, 0, 0, 'OD'),
1752 ('Eye_QP_ANTSEG_defaults', 'OSLENS_PC', 'lens: PCIOL', 950, 0, 0, 'LENS', 'PCIOL', '', 0, 0, 0, 'OS'),
1753 ('Eye_QP_ANTSEG_defaults', 'OULENS_PC', 'lens: PCIOL', 960, 0, 0, 'LENS', 'PCIOL', '', 0, 0, 0, 'OU'),
1754 ('Eye_QP_ANTSEG_defaults', 'ODLENS_yag', 'lens: p YAG', 970, 0, 0, 'LENS', 'PC open', '', 0, 0, 0, 'OD'),
1755 ('Eye_QP_ANTSEG_defaults', 'OSLENS_yag', 'lens: p YAG', 980, 0, 0, 'LENS', 'PC open', '', 0, 0, 0, 'OS'),
1756 ('Eye_QP_ANTSEG_defaults', 'OULENS_yag', 'lens: p YAG', 990, 0, 0, 'LENS', 'PC open', '', 0, 0, 0, 'OU'),
1757 ('Eye_QP_ANTSEG_defaults', 'ODIRIS_cl', 'iris: clear field', 1000, 0, 0, 'IRIS', '', '', 0, 0, 1, 'OD'),
1758 ('Eye_QP_ANTSEG_defaults', 'OSIRIS_cl', 'iris: clear field', 1010, 0, 0, 'IRIS', '', '', 0, 0, 1, 'OS'),
1759 ('Eye_QP_ANTSEG_defaults', 'OUIRIS_cl', 'iris: clear field', 1020, 0, 0, 'IRIS', '', '', 0, 0, 1, 'OU'),
1760 ('Eye_QP_ANTSEG_defaults', 'ODIRIS_pxe', 'iris: PXE', 1030, 0, 0, 'IRIS', 'PXE', '', 0, 0, 0, 'OD'),
1761 ('Eye_QP_ANTSEG_defaults', 'OSIRIS_px', 'iris: PXE', 1040, 0, 0, 'IRIS', 'PXE', '', 0, 0, 0, 'OS'),
1762 ('Eye_QP_ANTSEG_defaults', 'OUIRIS_px', 'iris: PXE', 1050, 0, 0, 'IRIS', 'PXE', '', 0, 0, 0, 'OU'),
1763 ('Eye_QP_ANTSEG_defaults', 'ODIRIS_pi', 'iris: PI', 1060, 0, 0, 'IRIS', 'patent PI', '', 0, 0, 0, 'OD'),
1764 ('Eye_QP_ANTSEG_defaults', 'OSIRIS_pi', 'iris: PI', 1070, 0, 0, 'IRIS', 'patent PI', '', 0, 0, 0, 'OS'),
1765 ('Eye_QP_ANTSEG_defaults', 'OUIRIS_pi', 'iris: PI', 1080, 0, 0, 'IRIS', 'patent PI', '', 0, 0, 0, 'OU'),
1766 ('Eye_QP_ANTSEG_defaults', 'ODIRIS_nev', 'iris: nevus', 1090, 0, 0, 'IRIS', 'nevus', '', 0, 0, 0, 'OD'),
1767 ('Eye_QP_ANTSEG_defaults', 'OSIRIS_nev', 'iris: nevus', 1100, 0, 0, 'IRIS', 'nevus', '', 0, 0, 0, 'OS'),
1768 ('Eye_QP_ANTSEG_defaults', 'OUIRIS_nev', 'iris: nevus', 1110, 0, 0, 'IRIS', 'nevus', '', 0, 0, 0, 'OU'),
1769 ('Eye_QP_ANTSEG_defaults', 'ODIRIS_nv', 'iris: NVI', 1120, 0, 0, 'IRIS', 'NVI', '', 0, 0, 0, 'OD'),
1770 ('Eye_QP_ANTSEG_defaults', 'OSIRIS_nv', 'iris: NVI', 1130, 0, 0, 'LENS', 'NVI', '', 0, 0, 0, 'OS'),
1771 ('Eye_QP_ANTSEG_defaults', 'OUIRIS_nv', 'iris: NVI', 1140, 0, 0, 'IRIS', 'NVI', '', 0, 0, 0, 'OU');
1772 #EndIf
1774 #IfNotRow2D list_options list_id lists option_id Eye_QP_EXT_defaults
1775 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'Eye_QP_EXT_defaults', 'Eye QP List EXT for New Providers', 1, 0);
1776 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`, `mapping`, `notes`, `codes`, `toggle_setting_1`, `toggle_setting_2`, `activity`, `subtype`) VALUES
1777 ('Eye_QP_EXT_defaults', 'RBROW', 'BROW: clear field', 10, 0, 0, 'BROW', '', '', 0, 0, 1, 'R'),
1778 ('Eye_QP_EXT_defaults', 'LBROW', 'BROW: clear field', 20, 0, 0, 'BROW', '', '', 0, 0, 1, 'L'),
1779 ('Eye_QP_EXT_defaults', 'BBROW', 'BROW: clear field', 30, 0, 0, 'BROW', '', '', 0, 0, 1, 'B'),
1780 ('Eye_QP_EXT_defaults', 'RBROW_ptosis', 'BROW: ptosis', 40, 0, 0, 'BROW', 'ptosis', '', 0, 0, 0, 'R'),
1781 ('Eye_QP_EXT_defaults', 'LBROW_ptosis', 'BROW: ptosis', 50, 0, 0, 'BROW', 'ptosis', '', 0, 0, 0, 'L'),
1782 ('Eye_QP_EXT_defaults', 'BBROW_ptosis', 'BROW: ptosis', 60, 0, 0, 'BROW', 'ptosis', '', 0, 0, 0, 'B'),
1783 ('Eye_QP_EXT_defaults', 'RBROW_rhytids', 'BROW: rhytids', 70, 0, 0, 'BROW', 'rhytids', '', 0, 0, 0, 'R'),
1784 ('Eye_QP_EXT_defaults', 'LBROW_rhytids', 'BROW: rhytids', 80, 0, 0, 'BROW', 'rhytids', '', 0, 0, 0, 'L'),
1785 ('Eye_QP_EXT_defaults', 'BBROW_rhytids', 'BROW: rhytids', 90, 0, 0, 'BROW', 'rhytids', '', 0, 0, 0, 'B'),
1786 ('Eye_QP_EXT_defaults', 'RBROW_scar', 'BROW: scar', 100, 0, 0, 'BROW', 'scar', '', 0, 0, 0, 'R'),
1787 ('Eye_QP_EXT_defaults', 'LBROW_scar', 'BROW: scar', 110, 0, 0, 'BROW', 'scar', '', 0, 0, 0, 'L'),
1788 ('Eye_QP_EXT_defaults', 'BBROW_scar', 'BROW: scar', 120, 0, 0, 'BROW', 'scar', '', 0, 0, 0, 'B'),
1789 ('Eye_QP_EXT_defaults', 'RBROW_sebk', 'BROW: seb ker', 130, 0, 0, 'BROW', 'seb ker', '', 0, 0, 0, 'R'),
1790 ('Eye_QP_EXT_defaults', 'LBROW_sebk', 'BROW: seb ker', 140, 0, 0, 'BROW', 'seb ker', '', 0, 0, 0, 'L'),
1791 ('Eye_QP_EXT_defaults', 'BBROW_sebk', 'BROW: seb ker', 150, 0, 0, 'BROW', 'seb ker', '', 0, 0, 0, 'B'),
1792 ('Eye_QP_EXT_defaults', 'RBROW_AK', 'BROW: act ker', 160, 0, 0, 'BROW', 'actinic keratosis', '', 0, 0, 0, 'R'),
1793 ('Eye_QP_EXT_defaults', 'LBROW_AK', 'BROW: act ker', 170, 0, 0, 'BROW', 'actinic keratosis', '', 0, 0, 0, 'L'),
1794 ('Eye_QP_EXT_defaults', 'BBROW_AK', 'BROW: act ker', 180, 0, 0, 'BROW', 'actinic keratosis', '', 0, 0, 0, 'B'),
1795 ('Eye_QP_EXT_defaults', 'RBROW_bcc', 'BROW: BCC', 190, 0, 0, 'BROW', 'BCC', '', 0, 0, 0, 'R'),
1796 ('Eye_QP_EXT_defaults', 'LBROW_bcc', 'BROW: BCC', 200, 0, 0, 'BROW', 'BCC', '', 0, 0, 0, 'L'),
1797 ('Eye_QP_EXT_defaults', 'BBROW_bcc', 'BROW: BCC', 210, 0, 0, 'BROW', 'BCC', '', 0, 0, 0, 'B'),
1798 ('Eye_QP_EXT_defaults', 'RBROW_scc', 'BROW: SCC', 220, 0, 0, 'BROW', 'SCC', '', 0, 0, 0, 'R'),
1799 ('Eye_QP_EXT_defaults', 'LBROW_scc', 'BROW: SCC', 230, 0, 0, 'BROW', 'SCC', '', 0, 0, 0, 'L'),
1800 ('Eye_QP_EXT_defaults', 'BBROW_scc', 'BROW: SCC', 240, 0, 0, 'BROW', 'SCC', '', 0, 0, 0, 'B'),
1801 ('Eye_QP_EXT_defaults', 'RMRD_mrd0', 'MRD: 0', 250, 0, 0, 'MRD', '0', '', 0, 0, 1, 'R'),
1802 ('Eye_QP_EXT_defaults', 'LMRD_mrd0', 'MRD: 0', 260, 0, 0, 'MRD', '0', '', 0, 0, 1, 'L'),
1803 ('Eye_QP_EXT_defaults', 'BMRD_mrd0', 'MRD: 0', 270, 0, 0, 'MRD', '0', '', 0, 0, 1, 'B'),
1804 ('Eye_QP_EXT_defaults', 'RMRD_mrd1', 'MRD: 1', 280, 0, 0, 'MRD', '1', '', 0, 0, 1, 'R'),
1805 ('Eye_QP_EXT_defaults', 'LMRD_mrd1', 'MRD: 1', 290, 0, 0, 'MRD', '1', '', 0, 0, 1, 'L'),
1806 ('Eye_QP_EXT_defaults', 'BMRD_mrd1', 'MRD: 1', 300, 0, 0, 'MRD', '1', '', 0, 0, 1, 'B'),
1807 ('Eye_QP_EXT_defaults', 'RMRD_mrd2', 'MRD: 2', 310, 0, 0, 'MRD', '2', '', 0, 0, 1, 'R'),
1808 ('Eye_QP_EXT_defaults', 'LMRD_mrd2', 'MRD: 2', 320, 0, 0, 'MRD', '2', '', 0, 0, 1, 'L'),
1809 ('Eye_QP_EXT_defaults', 'BMRD_mrd2', 'MRD: 2', 330, 0, 0, 'MRD', '2', '', 0, 0, 1, 'B'),
1810 ('Eye_QP_EXT_defaults', 'RMRD_mrd3', 'MRD: 3', 340, 0, 0, 'MRD', '3', '', 0, 0, 1, 'R'),
1811 ('Eye_QP_EXT_defaults', 'LMRD_mrd3', 'MRD: 3', 350, 0, 0, 'MRD', '3', '', 0, 0, 1, 'L'),
1812 ('Eye_QP_EXT_defaults', 'BMRD_mrd3', 'MRD: 3', 360, 0, 0, 'MRD', '3', '', 0, 0, 1, 'B'),
1813 ('Eye_QP_EXT_defaults', 'RLF_17', 'LF: 17', 370, 0, 0, 'LF', '17', '', 0, 0, 1, 'R'),
1814 ('Eye_QP_EXT_defaults', 'LLF_17', 'LF: 17', 380, 0, 0, 'LF', '17', '', 0, 0, 1, 'L'),
1815 ('Eye_QP_EXT_defaults', 'BLF_17', 'LF: 17', 390, 0, 0, 'LF', '17', '', 0, 0, 1, 'B'),
1816 ('Eye_QP_EXT_defaults', 'RLF_15', 'LF: 15', 400, 0, 0, 'LF', '15', '', 0, 0, 1, 'R'),
1817 ('Eye_QP_EXT_defaults', 'LLF_15', 'LF: 15', 410, 0, 0, 'LF', '15', '', 0, 0, 1, 'L'),
1818 ('Eye_QP_EXT_defaults', 'BLF_15', 'LF: 15', 420, 0, 0, 'LF', '15', '', 0, 0, 1, 'B'),
1819 ('Eye_QP_EXT_defaults', 'RLF_13', 'LF: 13', 430, 0, 0, 'LF', '13', '', 0, 0, 1, 'R'),
1820 ('Eye_QP_EXT_defaults', 'LLF_13', 'LF: 13', 440, 0, 0, 'LF', '13', '', 0, 0, 1, 'L'),
1821 ('Eye_QP_EXT_defaults', 'BLF_13', 'LF: 13', 450, 0, 0, 'LF', '13', '', 0, 0, 1, 'B'),
1822 ('Eye_QP_EXT_defaults', 'RUL_clear', 'UL: clear field', 460, 0, 0, 'UL', '', '', 0, 0, 1, 'R'),
1823 ('Eye_QP_EXT_defaults', 'LUL_clear', 'UL: clear field', 470, 0, 0, 'UL', '', '', 0, 0, 1, 'L'),
1824 ('Eye_QP_EXT_defaults', 'BUL_clear', 'UL: clear field', 480, 0, 0, 'UL', '', '', 0, 0, 1, 'B'),
1825 ('Eye_QP_EXT_defaults', 'RUL_norm', 'UL: normal', 490, 0, 0, 'UL', 'normal lids and lashes', '', 0, 0, 1, 'R'),
1826 ('Eye_QP_EXT_defaults', 'LUL_norm', 'UL: normal', 500, 0, 0, 'UL', 'normal lids and lashes', '', 0, 0, 1, 'L'),
1827 ('Eye_QP_EXT_defaults', 'BUL_norm', 'UL: normal', 510, 0, 0, 'UL', 'normal lids and lashes', '', 0, 0, 1, 'B'),
1828 ('Eye_QP_EXT_defaults', 'RUL_der', 'UL: dermatochalasis', 520, 0, 0, 'UL', 'dermatochalasis', '', 0, 0, 0, 'R'),
1829 ('Eye_QP_EXT_defaults', 'LUL_der', 'UL: dermatochalasis', 530, 0, 0, 'UL', 'dermatochalasis', '', 0, 0, 0, 'L'),
1830 ('Eye_QP_EXT_defaults', 'BUL_der', 'UL: dermatochalasis', 540, 0, 0, 'UL', 'dermatochalasis', '', 0, 0, 0, 'B'),
1831 ('Eye_QP_EXT_defaults', 'RLL_der', 'LL: dermatochalasis', 550, 0, 0, 'LL', 'dermatochalasis', '', 0, 0, 0, 'R'),
1832 ('Eye_QP_EXT_defaults', 'LLL_der', 'LL: dermatochalasis', 560, 0, 0, 'LL', 'dermatochalasis', '', 0, 0, 0, 'L'),
1833 ('Eye_QP_EXT_defaults', 'BLL_der', 'LL: dermatochalasis', 570, 0, 0, 'LL', 'dermatochalasis', '', 0, 0, 0, 'B'),
1834 ('Eye_QP_EXT_defaults', 'RUL_pto2', 'UL: 2mm ptosis', 580, 0, 0, 'UL', '2mm ptosis', '', 0, 0, 0, 'R'),
1835 ('Eye_QP_EXT_defaults', 'LUL_pto2', 'UL: 2mm ptosis', 590, 0, 0, 'UL', '2mm ptosis', '', 0, 0, 0, 'L'),
1836 ('Eye_QP_EXT_defaults', 'BUL_pto2', 'UL: 2mm ptosis', 600, 0, 0, 'UL', '2mm ptosis', '', 0, 0, 0, 'B'),
1837 ('Eye_QP_EXT_defaults', 'RUL_pto3', 'UL: 3mm ptosis', 610, 0, 0, 'UL', '3mm ptosis', '', 0, 0, 0, 'R'),
1838 ('Eye_QP_EXT_defaults', 'LUL_pto3', 'UL: 3mm ptosis', 620, 0, 0, 'UL', '3mm ptosis', '', 0, 0, 0, 'L'),
1839 ('Eye_QP_EXT_defaults', 'BUL_pto3', 'UL: 3mm ptosis', 630, 0, 0, 'UL', '3mm ptosis', '', 0, 0, 0, 'B'),
1840 ('Eye_QP_EXT_defaults', 'RUL_lesion', 'UL: lesion', 640, 0, 0, 'UL', 'lesion', '', 0, 0, 0, 'R'),
1841 ('Eye_QP_EXT_defaults', 'LUL_lesion', 'UL: lesion', 650, 0, 0, 'UL', 'lesion', '', 0, 0, 0, 'L'),
1842 ('Eye_QP_EXT_defaults', 'BUL_lesion', 'UL: lesion', 660, 0, 0, 'UL', 'lesion', '', 0, 0, 0, 'B'),
1843 ('Eye_QP_EXT_defaults', 'RUL_chalazion', 'UL: chalazion', 670, 0, 0, 'UL', 'chalazion', '', 0, 0, 0, 'R'),
1844 ('Eye_QP_EXT_defaults', 'LUL_chalazion', 'UL: chalazion', 680, 0, 0, 'UL', 'chalazion', '', 0, 0, 0, 'L'),
1845 ('Eye_QP_EXT_defaults', 'BUL_chalazion', 'UL: chalazion', 690, 0, 0, 'UL', 'chalazion', '', 0, 0, 0, 'B'),
1846 ('Eye_QP_EXT_defaults', 'RUL_stye', 'UL: stye', 700, 0, 0, 'UL', 'stye', '', 0, 0, 0, 'R'),
1847 ('Eye_QP_EXT_defaults', 'LUL_stye', 'UL: stye', 710, 0, 0, 'UL', 'stye', '', 0, 0, 0, 'L'),
1848 ('Eye_QP_EXT_defaults', 'BUL_stye', 'UL: stye', 720, 0, 0, 'UL', 'stye', '', 0, 0, 0, 'B'),
1849 ('Eye_QP_EXT_defaults', 'RMCT_les', 'MCT: lesion', 730, 0, 0, 'MCT', 'lesion', '', 0, 0, 0, 'R'),
1850 ('Eye_QP_EXT_defaults', 'LMCT_les', 'MCT: lesion', 740, 0, 0, 'MCT', 'lesion', '', 0, 0, 0, 'L'),
1851 ('Eye_QP_EXT_defaults', 'BMCT_les', 'MCT: lesion', 750, 0, 0, 'MCT', 'lesion', '', 0, 0, 0, 'B'),
1852 ('Eye_QP_EXT_defaults', 'RMCT_NLDa', 'MCT: NLDO, acute', 760, 0, 0, 'MCT', 'NLDO, acute', '', 0, 0, 0, 'R'),
1853 ('Eye_QP_EXT_defaults', 'LMCT_NLDa', 'MCT: NLDO, acute', 770, 0, 0, 'MCT', 'NLDO, acute', '', 0, 0, 0, 'L'),
1854 ('Eye_QP_EXT_defaults', 'BMCT_NLDa', 'MCT: NLDO, acute', 780, 0, 0, 'MCT', 'NLDO, acute', '', 0, 0, 0, 'B'),
1855 ('Eye_QP_EXT_defaults', 'RMCT_NLDc', 'MCT: NLDO, chronic', 790, 0, 0, 'MCT', 'NLDO, chronic', '', 0, 0, 0, 'R'),
1856 ('Eye_QP_EXT_defaults', 'LMCT_NLDc', 'MCT: NLDO, chronic', 800, 0, 0, 'MCT', 'NLDO, chronic', '', 0, 0, 0, 'L'),
1857 ('Eye_QP_EXT_defaults', 'BMCT_NLDc', 'MCT: NLDO, chronic', 810, 0, 0, 'MCT', 'NLDO, chronic', '', 0, 0, 0, 'B'),
1858 ('Eye_QP_EXT_defaults', 'RLL_clear', 'LL: clear field', 820, 0, 0, 'LL', '', '', 0, 0, 1, 'R'),
1859 ('Eye_QP_EXT_defaults', 'LLL_clear', 'LL: clear field', 830, 0, 0, 'LL', '', '', 0, 0, 1, 'L'),
1860 ('Eye_QP_EXT_defaults', 'BLL_clear', 'LL: clear field', 840, 0, 0, 'LL', '', '', 0, 0, 1, 'B'),
1861 ('Eye_QP_EXT_defaults', 'RLL_norm', 'LL: good tone', 850, 0, 0, 'LL', 'good tone', '', 0, 0, 1, 'R'),
1862 ('Eye_QP_EXT_defaults', 'LLL_norm', 'LL: good tone', 860, 0, 0, 'LL', 'good tone', '', 0, 0, 1, 'L'),
1863 ('Eye_QP_EXT_defaults', 'BLL_norm', 'LL: good tone', 870, 0, 0, 'LL', 'good tone', '', 0, 0, 1, 'B'),
1864 ('Eye_QP_EXT_defaults', 'RLL_ect', 'LL: ectropion', 880, 0, 0, 'LL', 'ectropion', '', 0, 0, 0, 'R'),
1865 ('Eye_QP_EXT_defaults', 'LLL_ect', 'LL: ectropion', 890, 0, 0, 'LL', 'ectropion', '', 0, 0, 0, 'L'),
1866 ('Eye_QP_EXT_defaults', 'BLL_ect', 'LL: ectropion', 900, 0, 0, 'LL', 'ectropion', '', 0, 0, 0, 'B'),
1867 ('Eye_QP_EXT_defaults', 'RLL_ent', 'LL: entropion', 910, 0, 0, 'LL', 'entropion', '', 0, 0, 0, 'R'),
1868 ('Eye_QP_EXT_defaults', 'LLL_ent', 'LL: entropion', 920, 0, 0, 'LL', 'entropion', '', 0, 0, 0, 'L'),
1869 ('Eye_QP_EXT_defaults', 'BLL_ent', 'LL: entropion', 930, 0, 0, 'LL', 'entropion', '', 0, 0, 0, 'B'),
1870 ('Eye_QP_EXT_defaults', 'RLL_trich', 'LL: trichiasis', 940, 0, 0, 'LL', 'trichiasis', '', 0, 0, 0, 'R'),
1871 ('Eye_QP_EXT_defaults', 'LLL_trich', 'LL: trichiasis', 950, 0, 0, 'LL', 'trichiasis', '', 0, 0, 0, 'L'),
1872 ('Eye_QP_EXT_defaults', 'BLL_trich', 'LL: trichiasis', 960, 0, 0, 'LL', 'trichiasis', '', 0, 0, 0, 'B'),
1873 ('Eye_QP_EXT_defaults', 'RLL_lesion', 'LL: lesion', 970, 0, 0, 'LL', 'lesion', '', 0, 0, 0, 'R'),
1874 ('Eye_QP_EXT_defaults', 'LLL_lesion', 'LL: lesion', 980, 0, 0, 'LL', 'lesion', '', 0, 0, 0, 'L'),
1875 ('Eye_QP_EXT_defaults', 'BLL_lesion', 'LL: lesion', 990, 0, 0, 'LL', 'lesion', '', 0, 0, 0, 'B'),
1876 ('Eye_QP_EXT_defaults', 'RLL_fat', 'LL: fat prolapse', 1010, 0, 0, 'LL', 'fat prolapse', '', 0, 0, 0, 'R'),
1877 ('Eye_QP_EXT_defaults', 'LLL_fat', 'LL: fat prolapse', 1020, 0, 0, 'LL', 'fat prolapse', '', 0, 0, 0, 'L'),
1878 ('Eye_QP_EXT_defaults', 'BLL_fat', 'LL: fat prolapse', 1030, 0, 0, 'LL', 'fat prolapse', '', 0, 0, 0, 'B'),
1879 ('Eye_QP_EXT_defaults', 'RLL_pi', 'LL: erythema', 1040, 0, 0, 'LL', 'erythema', '', 0, 0, 0, 'R'),
1880 ('Eye_QP_EXT_defaults', 'LLL_pi', 'LL: erythema', 1050, 0, 0, 'LL', 'erythema', '', 0, 0, 0, 'L'),
1881 ('Eye_QP_EXT_defaults', 'BLL_pi', 'LL: erythema', 1060, 0, 0, 'LL', 'erythema', '', 0, 0, 0, 'B'),
1882 ('Eye_QP_EXT_defaults', 'RLL_nev', 'LL: ecchymosis', 1070, 0, 0, 'LL', 'ecchymosis', '', 0, 0, 0, 'R'),
1883 ('Eye_QP_EXT_defaults', 'LLL_nev', 'LL: ecchymosis', 1080, 0, 0, 'LL', 'ecchymosis', '', 0, 0, 0, 'L'),
1884 ('Eye_QP_EXT_defaults', 'BLL_nev', 'LL: ecchymosis', 1090, 0, 0, 'LL', 'ecchymosis', '', 0, 0, 0, 'B'),
1885 ('Eye_QP_EXT_defaults', 'RLL_chalazion', 'LL: chalazion', 1100, 0, 0, 'LL', 'chalazion', '', 0, 0, 0, 'R'),
1886 ('Eye_QP_EXT_defaults', 'BLL_chalazion', 'LL: chalazion', 1110, 0, 0, 'LL', 'chalazion', '', 0, 0, 0, 'B'),
1887 ('Eye_QP_EXT_defaults', 'RLL_stye', 'LL: stye', 1120, 0, 0, 'LL', 'stye', '', 0, 0, 0, 'R'),
1888 ('Eye_QP_EXT_defaults', 'LLL_stye', 'LL: stye', 1130, 0, 0, 'LL', 'stye', '', 0, 0, 0, 'L'),
1889 ('Eye_QP_EXT_defaults', 'BLL_stye', 'LL: stye', 1140, 0, 0, 'LL', 'stye', '', 0, 0, 0, 'B');
1890 #EndIf
1892 #IfNotRow2D list_options list_id lists option_id Eye_QP_RETINA_defaults
1893 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'Eye_QP_RETINA_defaults', 'Eye QP List RETINA for New Providers', 1, 0);
1894 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`, `mapping`, `notes`, `codes`, `toggle_setting_1`, `toggle_setting_2`, `activity`, `subtype`) VALUES
1895 ('Eye_QP_RETINA_defaults', 'ODCUP_0', 'cup: clear field', 10, 0, 0, 'CUP', '', '', 0, 0, 1, 'OD'),
1896 ('Eye_QP_RETINA_defaults', 'OSCUP_0', 'cup: clear field', 20, 0, 0, 'CUP', '', '', 0, 0, 1, 'OS'),
1897 ('Eye_QP_RETINA_defaults', 'OUCUP_0', 'cup: clear field', 30, 0, 0, 'CUP', '', '', 0, 0, 1, 'OU'),
1898 ('Eye_QP_RETINA_defaults', 'ODCUP_1', 'cup: 0.1', 40, 0, 0, 'CUP', '0.1', '', 0, 0, 0, 'OD'),
1899 ('Eye_QP_RETINA_defaults', 'OSCUP_1', 'cup: 0.1', 50, 0, 0, 'CUP', '0.1', '', 0, 0, 0, 'OS'),
1900 ('Eye_QP_RETINA_defaults', 'OUCUP_1', 'cup: 0.1', 60, 0, 0, 'CUP', '0.1', '', 0, 0, 0, 'OU'),
1901 ('Eye_QP_RETINA_defaults', 'ODCUP_3', 'cup: 0.3', 70, 0, 0, 'CUP', '0.3', '', 0, 0, 0, 'OD'),
1902 ('Eye_QP_RETINA_defaults', 'OSCUP_3', 'cup: 0.3', 80, 0, 0, 'CUP', '0.3', '', 0, 0, 0, 'OS'),
1903 ('Eye_QP_RETINA_defaults', 'ODCUP_5', 'cup: 0.5', 90, 0, 0, 'CUP', '0.5', '', 0, 0, 0, 'OD'),
1904 ('Eye_QP_RETINA_defaults', 'OUCUP_3', 'cup: 0.3', 100, 0, 0, 'CUP', '0.3', '', 0, 0, 0, 'OU'),
1905 ('Eye_QP_RETINA_defaults', 'OSCUP_5', 'cup: 0.5', 110, 0, 0, 'CUP', '0.5', '', 0, 0, 0, 'OS'),
1906 ('Eye_QP_RETINA_defaults', 'OUCUP_5', 'cup: 0.5', 120, 0, 0, 'CUP', '0.5', '', 0, 0, 0, 'OU'),
1907 ('Eye_QP_RETINA_defaults', 'ODCUP_8', 'cup: 0.8', 130, 0, 0, 'CUP', '0.8', '', 0, 0, 0, 'OD'),
1908 ('Eye_QP_RETINA_defaults', 'OSCUP_8', 'cup: 0.8', 140, 0, 0, 'CUP', '0.8', '', 0, 0, 0, 'OS'),
1909 ('Eye_QP_RETINA_defaults', 'OUCUP_8', 'cup: 0.8', 150, 0, 0, 'CUP', '0.8', '', 0, 0, 0, 'OU'),
1910 ('Eye_QP_RETINA_defaults', 'ODCUP_95', 'cup: 0.95', 160, 0, 0, 'CUP', '0.95', '', 0, 0, 0, 'OD'),
1911 ('Eye_QP_RETINA_defaults', 'OSCUP_95', 'cup: 0.95', 170, 0, 0, 'CUP', '0.95', '', 0, 0, 0, 'OS'),
1912 ('Eye_QP_RETINA_defaults', 'OUCUP_95', 'cup: 0.95', 180, 0, 0, 'CUP', '0.95', '', 0, 0, 0, 'OU'),
1913 ('Eye_QP_RETINA_defaults', 'ODCUP_V', 'cup: V (vert)', 190, 0, 0, 'CUP', 'V', '', 0, 0, 2, 'OD'),
1914 ('Eye_QP_RETINA_defaults', 'OSCUP_V', 'cup: V (vert)', 200, 0, 0, 'CUP', 'V', '', 0, 0, 2, 'OS'),
1915 ('Eye_QP_RETINA_defaults', 'OUCUP_V', 'cup: V (vert)', 210, 0, 0, 'CUP', 'V', '', 0, 0, 2, 'OU'),
1916 ('Eye_QP_RETINA_defaults', 'ODCUP_x', 'cup: x (times)', 220, 0, 0, 'CUP', 'x', '', 0, 0, 2, 'OD'),
1917 ('Eye_QP_RETINA_defaults', 'OSCUP_x', 'cup: x (times)', 230, 0, 0, 'CUP', 'x', '', 0, 0, 2, 'OS'),
1918 ('Eye_QP_RETINA_defaults', 'OUCUP_x', 'cup: x (times)', 240, 0, 0, 'CUP', 'x', '', 0, 0, 2, 'OU'),
1919 ('Eye_QP_RETINA_defaults', 'ODCUP_H', 'cup: H (horiz)', 250, 0, 0, 'CUP', 'H', '', 0, 0, 2, 'OD'),
1920 ('Eye_QP_RETINA_defaults', 'OSCUP_H', 'cup: H (horiz)', 260, 0, 0, 'CUP', 'H', '', 0, 0, 2, 'OS'),
1921 ('Eye_QP_RETINA_defaults', 'OUCUP_H', 'cup: H (horiz)', 270, 0, 0, 'CUP', 'H', '', 0, 0, 2, 'OU'),
1922 ('Eye_QP_RETINA_defaults', 'ODCUP_notch', 'cup: notch', 280, 0, 0, 'CUP', 'notch', '', 0, 0, 0, 'OD'),
1923 ('Eye_QP_RETINA_defaults', 'OSCUP_notch', 'cup: notch', 290, 0, 0, 'CUP', 'notch', '', 0, 0, 0, 'OS'),
1924 ('Eye_QP_RETINA_defaults', 'OUCUP_notch', 'cup: notch', 300, 0, 0, 'CUP', 'notch', '', 0, 0, 0, 'OU'),
1925 ('Eye_QP_RETINA_defaults', 'ODDISC_0', 'd: clear field', 310, 0, 0, 'DISC', '', '', 0, 0, 1, 'OD'),
1926 ('Eye_QP_RETINA_defaults', 'OSDISC_0', 'd: clear field', 320, 0, 0, 'DISC', '', '', 0, 0, 1, 'OS'),
1927 ('Eye_QP_RETINA_defaults', 'OUDISC_0', 'd: clear field', 330, 0, 0, 'DISC', '', '', 0, 0, 1, 'OU'),
1928 ('Eye_QP_RETINA_defaults', 'ODDISC_risk', 'd: at risk', 340, 0, 0, 'DISC', 'disc at risk', '', 0, 0, 1, 'OD'),
1929 ('Eye_QP_RETINA_defaults', 'OSDISC_risk', 'd: at risk', 350, 0, 0, 'DISC', 'disk at risk', '', 0, 0, 1, 'OS'),
1930 ('Eye_QP_RETINA_defaults', 'OUDISC_risk', 'd: at risk', 360, 0, 0, 'DISC', 'disk at risk', '', 0, 0, 1, 'OU'),
1931 ('Eye_QP_RETINA_defaults', 'ODDISC_pal', 'd: pallor', 370, 0, 0, 'DISC', 'pallor', '', 0, 0, 0, 'OD'),
1932 ('Eye_QP_RETINA_defaults', 'OSCUP_pal', 'd: pallor', 380, 0, 0, 'DISC', 'pallor', '', 0, 0, 0, 'OS'),
1933 ('Eye_QP_RETINA_defaults', 'OUDISC_pal', 'd: pallor', 390, 0, 0, 'DISC', 'pallor', '', 0, 0, 0, 'OU'),
1934 ('Eye_QP_RETINA_defaults', 'ODDISC_NVD', 'd: NVD', 400, 0, 0, 'DISC', 'NVD', '', 0, 0, 0, 'OD'),
1935 ('Eye_QP_RETINA_defaults', 'OSDISC_NVD', 'd: NVD', 410, 0, 0, 'DISC', 'NVD', '', 0, 0, 0, 'OS'),
1936 ('Eye_QP_RETINA_defaults', 'OUDISC_NVD', 'd: NVD', 420, 0, 0, 'DISC', 'NVD', '', 0, 0, 0, 'OU'),
1937 ('Eye_QP_RETINA_defaults', 'ODDISC_edema1', 'd: gr I edema', 430, 0, 0, 'DISC', 'Grade I papilledema', '', 0, 0, 1, 'OD'),
1938 ('Eye_QP_RETINA_defaults', 'OSDISC_edema1', 'd: gr I edema', 440, 0, 0, 'DISC', 'Grade I papilledema', '', 0, 0, 1, 'OS'),
1939 ('Eye_QP_RETINA_defaults', 'OUDISC_edema1', 'd: gr I edema', 450, 0, 0, 'DISC', 'Grade I papilledema', '', 0, 0, 1, 'OU'),
1940 ('Eye_QP_RETINA_defaults', 'ODDISC_edema2', 'd: gr III edema', 460, 0, 0, 'DISC', 'Grade III papilledema', '', 0, 0, 1, 'OD'),
1941 ('Eye_QP_RETINA_defaults', 'OSDISC_edema2', 'd: gr III edema', 470, 0, 0, 'DISC', 'Grade III papilledema', '', 0, 0, 1, 'OS'),
1942 ('Eye_QP_RETINA_defaults', 'OUDISC_edema2', 'd: gr III edema', 480, 0, 0, 'DISC', 'Grade III papilledema', '', 0, 0, 1, 'OU'),
1943 ('Eye_QP_RETINA_defaults', 'ODDISC_edemaf', 'd: gr V edema', 490, 0, 0, 'DISC', 'Grade V papilledema', '', 0, 0, 1, 'OD'),
1944 ('Eye_QP_RETINA_defaults', 'OSDISC_edemaf', 'd: gr V edema', 500, 0, 0, 'DISC', 'Grade V papilledema', '', 0, 0, 1, 'OS'),
1945 ('Eye_QP_RETINA_defaults', 'OUDISC_edemaf', 'd: gr V edema', 510, 0, 0, 'DISC', 'Grade V papilledema', '', 0, 0, 1, 'OU'),
1946 ('Eye_QP_RETINA_defaults', 'ODMAC_0', 'm: clear field', 520, 0, 0, 'MACULA', '', '', 0, 0, 1, 'OD'),
1947 ('Eye_QP_RETINA_defaults', 'OSMAC_0', 'm: clear field', 530, 0, 0, 'MACULA', '', '', 0, 0, 1, 'OS'),
1948 ('Eye_QP_RETINA_defaults', 'OUMAC_0', 'm: clear field', 540, 0, 0, 'MACULA', '', '', 0, 0, 1, 'OU'),
1949 ('Eye_QP_RETINA_defaults', 'ODMAC_hd', 'm: hard drusen', 550, 0, 0, 'MACULA', 'hard drusen', '', 0, 0, 0, 'OD'),
1950 ('Eye_QP_RETINA_defaults', 'OSMAC_hd', 'm: hard drusen', 560, 0, 0, 'MACULA', 'hard drusen', '', 0, 0, 0, 'OS'),
1951 ('Eye_QP_RETINA_defaults', 'OUMAC_hd', 'm: hard drusen', 570, 0, 0, 'MACULA', 'hard drusen', '', 0, 0, 0, 'OU'),
1952 ('Eye_QP_RETINA_defaults', 'ODMAC_sd', 'm: soft drusen', 580, 0, 0, 'MACULA', 'soft drusen', '', 0, 0, 0, 'OD'),
1953 ('Eye_QP_RETINA_defaults', 'OSMAC_sd', 'm: soft drusen', 590, 0, 0, 'MACULA', 'soft drusen', '', 0, 0, 0, 'OS'),
1954 ('Eye_QP_RETINA_defaults', 'OUMAC_sd', 'm: soft drusen', 600, 0, 0, 'MACULA', 'soft drusen', '', 0, 0, 0, 'OU'),
1955 ('Eye_QP_RETINA_defaults', 'ODMAC_PED', 'm: PED', 610, 0, 0, 'MACULA', 'PED', '', 0, 0, 0, 'OD'),
1956 ('Eye_QP_RETINA_defaults', 'OSMAC_PED', 'm: PED', 620, 0, 0, 'MACULA', 'PED', '', 0, 0, 0, 'OS'),
1957 ('Eye_QP_RETINA_defaults', 'OUMAC_PED', 'm: PED', 630, 0, 0, 'MACULA', 'PED', '', 0, 0, 0, 'OU'),
1958 ('Eye_QP_RETINA_defaults', 'ODMAC_CSR', 'm: CSR', 640, 0, 0, 'MACULA', 'CSR', '', 0, 0, 0, 'OD'),
1959 ('Eye_QP_RETINA_defaults', 'OSMAC_CSR', 'm: CSR', 650, 0, 0, 'MACULA', 'CSR', '', 0, 0, 0, 'OS'),
1960 ('Eye_QP_RETINA_defaults', 'OUMAC_CSR', 'm: CSR', 660, 0, 0, 'MACULA', 'CSR', '', 0, 0, 0, 'OU'),
1961 ('Eye_QP_RETINA_defaults', 'ODVESSELS_cl', 'v: clear field', 670, 0, 0, 'VESSELS', '', '', 0, 0, 1, 'OD'),
1962 ('Eye_QP_RETINA_defaults', 'OSVESSELS_cl', 'v: clear field', 680, 0, 0, 'VESSELS', '', '', 0, 0, 1, 'OS'),
1963 ('Eye_QP_RETINA_defaults', 'OUVESSELS_cl', 'v: clear field', 690, 0, 0, 'VESSELS', '', '', 0, 0, 1, 'OU'),
1964 ('Eye_QP_RETINA_defaults', 'ODVESSELS_12', 'v: 1:2', 700, 0, 0, 'VESSELS', '1:2', '', 0, 0, 0, 'OD'),
1965 ('Eye_QP_RETINA_defaults', 'OSVESSELS_12', 'v: 1:2', 710, 0, 0, 'VESSELS', '1:2', '', 0, 0, 0, 'OS'),
1966 ('Eye_QP_RETINA_defaults', 'OUVESSELS_12', 'v: 1:2', 720, 0, 0, 'VESSELS', '1:2', '', 0, 0, 0, 'OU'),
1967 ('Eye_QP_RETINA_defaults', 'ODVESSELS_BDR', 'v: BDR', 730, 0, 0, 'VESSELS', 'BDR', '', 0, 0, 0, 'OD'),
1968 ('Eye_QP_RETINA_defaults', 'OSVESSELS_BDR', 'v: BDR', 740, 0, 0, 'VESSELS', 'BDR', '', 0, 0, 0, 'OS'),
1969 ('Eye_QP_RETINA_defaults', 'OUVESSELS_BDR', 'v: BDR', 750, 0, 0, 'VESSELS', 'BDR', '', 0, 0, 0, 'OU'),
1970 ('Eye_QP_RETINA_defaults', 'ODVESSELS_PDR', 'v: PDR', 760, 0, 0, 'VESSELS', 'PDR', '', 0, 0, 0, 'OD'),
1971 ('Eye_QP_RETINA_defaults', 'OSVESSELS_PDR', 'v: PDR', 770, 0, 0, 'VESSELS', 'PDR', '', 0, 0, 0, 'OS'),
1972 ('Eye_QP_RETINA_defaults', 'OUVESSELS_PDR', 'v: PDR', 780, 0, 0, 'VESSELS', 'PDR', '', 0, 0, 0, 'OU'),
1973 ('Eye_QP_RETINA_defaults', 'ODVESSELS_BRVO', 'v: BRVO', 790, 0, 0, 'VESSELS', 'BRVO', '', 0, 0, 0, 'OD'),
1974 ('Eye_QP_RETINA_defaults', 'OSVESSELS_BRVO', 'v: BRVO', 800, 0, 0, 'VESSELS', 'BRVO', '', 0, 0, 0, 'OS'),
1975 ('Eye_QP_RETINA_defaults', 'OUVESSELS_BRVO', 'v: BRVO', 810, 0, 0, 'VESSELS', 'BRVO', '', 0, 0, 0, 'OU'),
1976 ('Eye_QP_RETINA_defaults', 'ODVESSELS_CRVO', 'v: CRVO', 820, 0, 0, 'VESSELS', 'CRVO', '', 0, 0, 0, 'OD'),
1977 ('Eye_QP_RETINA_defaults', 'OSVESSELS_CRVO', 'v: CRVO', 830, 0, 0, 'VESSELS', 'CRVO', '', 0, 0, 0, 'OS'),
1978 ('Eye_QP_RETINA_defaults', 'OUVESSELS_CRVO', 'v: CRVO', 840, 0, 0, 'VESSELS', 'CRVO', '', 0, 0, 0, 'OU'),
1979 ('Eye_QP_RETINA_defaults', 'ODVESSELS_BRAO', 'v: BRAO', 850, 0, 0, 'VESSELS', 'BRAO', '', 0, 0, 0, 'OD'),
1980 ('Eye_QP_RETINA_defaults', 'OSVESSELS_BRAO', 'v: BRAO', 860, 0, 0, 'VESSELS', 'BRAO', '', 0, 0, 0, 'OS'),
1981 ('Eye_QP_RETINA_defaults', 'OUVESSELS_BRAO', 'v: BRAO', 870, 0, 0, 'VESSELS', 'BRAO', '', 0, 0, 0, 'OU'),
1982 ('Eye_QP_RETINA_defaults', 'ODVESSELS_CRAO', 'v: CRAO', 880, 0, 0, 'VESSELS', 'CRAO', '', 0, 0, 0, 'OD'),
1983 ('Eye_QP_RETINA_defaults', 'OSVESSELS_CRAO', 'v: CRAO', 890, 0, 0, 'VESSELS', 'CRAO', '', 0, 0, 0, 'OS'),
1984 ('Eye_QP_RETINA_defaults', 'OUVESSELS_CRAO', 'v: CRAO', 900, 0, 0, 'VESSELS', 'CRAO', '', 0, 0, 0, 'OU'),
1985 ('Eye_QP_RETINA_defaults', 'ODPERIPH_0', 'p: clear field', 910, 0, 0, 'PERIPH', '', '', 0, 0, 1, 'OD'),
1986 ('Eye_QP_RETINA_defaults', 'OSPERIPH_0', 'p: clear field', 920, 0, 0, 'PERIPH', '', '', 0, 0, 1, 'OS'),
1987 ('Eye_QP_RETINA_defaults', 'OUPERIPH_0', 'p: clear field', 930, 0, 0, 'PERIPH', '', '', 0, 0, 1, 'OU'),
1988 ('Eye_QP_RETINA_defaults', 'ODPERIPH_float', 'p: floater', 940, 0, 0, 'PERIPH', 'vitreous floater', '', 0, 0, 0, 'OD'),
1989 ('Eye_QP_RETINA_defaults', 'OSPERIPH_float', 'p: floater', 950, 0, 0, 'PERIPH', 'vitreous floater', '', 0, 0, 0, 'OS'),
1990 ('Eye_QP_RETINA_defaults', 'OUPERIPH_float', 'p: floater', 960, 0, 0, 'PERIPH', 'vitreous floater', '', 0, 0, 0, 'OU'),
1991 ('Eye_QP_RETINA_defaults', 'ODPERIPH_pvd', 'p: PVD', 970, 0, 0, 'PERIPH', 'PVD', '', 0, 0, 0, 'OD'),
1992 ('Eye_QP_RETINA_defaults', 'OSPERIPH_pvd', 'p: PVD', 980, 0, 0, 'PERIPH', 'PVD', '', 0, 0, 0, 'OS'),
1993 ('Eye_QP_RETINA_defaults', 'OUPERIPH_pvd', 'p: PVD', 990, 0, 0, 'PERIPH', 'PVD', '', 0, 0, 0, 'OU'),
1994 ('Eye_QP_RETINA_defaults', 'ODPERIPH_vh', 'p: vit hem', 1000, 0, 0, 'PERIPH', 'vitreous hemorrhage', '', 0, 0, 0, 'OD'),
1995 ('Eye_QP_RETINA_defaults', 'OSPERIPH_vh', 'p: vit hem', 1010, 0, 0, 'PERIPH', 'vitreous hemorrhage', '', 0, 0, 0, 'OS'),
1996 ('Eye_QP_RETINA_defaults', 'OUPERIPH_vh', 'p: vit hem', 1020, 0, 0, 'PERIPH', 'vitreous hemorrhage', '', 0, 0, 0, 'OU'),
1997 ('Eye_QP_RETINA_defaults', 'ODPERIPH_tear', 'p: retinal tear', 1030, 0, 0, 'PERIPH', 'retinal tear', '', 0, 0, 0, 'OD'),
1998 ('Eye_QP_RETINA_defaults', 'OSPERIPH_tear', 'p: retinal tear', 1040, 0, 0, 'PERIPH', 'retinal tear', '', 0, 0, 0, 'OS'),
1999 ('Eye_QP_RETINA_defaults', 'OUPERIPH_tear', 'p: retinal tear', 1050, 0, 0, 'PERIPH', 'retinal tear', '', 0, 0, 0, 'OU'),
2000 ('Eye_QP_RETINA_defaults', 'ODPERIPH_schisis', 'p: retinoschisis', 1060, 0, 0, 'PERIPH', 'retinoschisis', '', 0, 0, 0, 'OD'),
2001 ('Eye_QP_RETINA_defaults', 'OSPERIPH_schisis', 'p: retinoschisis', 1070, 0, 0, 'PERIPH', 'retinoschisis', '', 0, 0, 0, 'OS'),
2002 ('Eye_QP_RETINA_defaults', 'OUPERIPH_schisis', 'p: retinoschisis', 1080, 0, 0, 'PERIPH', 'retinoschisis', '', 0, 0, 0, 'OU'),
2003 ('Eye_QP_RETINA_defaults', 'ODPERIPH_NVE', 'p: NVE', 1090, 0, 0, 'PERIPH', 'NVE', '', 0, 0, 0, 'OD'),
2004 ('Eye_QP_RETINA_defaults', 'OSPERIPH_NVE', 'p: NVE', 1100, 0, 0, 'PERIPH', 'NVE', '', 0, 0, 0, 'OS'),
2005 ('Eye_QP_RETINA_defaults', 'OUPERIPH_NVE', 'p: NVE', 1110, 0, 0, 'PERIPH', 'NVE', '', 0, 0, 0, 'OU'),
2006 ('Eye_QP_RETINA_defaults', 'ODPERIPH_RD', 'p: RD', 1120, 0, 0, 'PERIPH', 'RD', '', 0, 0, 0, 'OD'),
2007 ('Eye_QP_RETINA_defaults', 'OSPERIPH_RD', 'p: RD', 1130, 0, 0, 'PERIPH', 'RD', '', 0, 0, 0, 'OS'),
2008 ('Eye_QP_RETINA_defaults', 'OUPERIPH_RD', 'p: RD', 1140, 0, 0, 'PERIPH', 'RD', '', 0, 0, 0, 'OU');
2009 #EndIf
2011 #IfNotRow2D list_options list_id lists option_id Eye_todo_done_defaults
2012 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'Eye_todo_done_defaults', 'Eye Orders Defaults', 1, 0);
2013 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`, `mapping`, `notes`, `codes`, `toggle_setting_1`, `toggle_setting_2`, `activity`, `subtype`) VALUES
2014 ('Eye_todo_done_defaults', 'Ascan', 'A scan/IOL calc', 430, 0, 0, '', '', 'CPT4:76519', 0, 0, 1, ''),
2015 ('Eye_todo_done_defaults', 'Bscan', 'B scan', 440, 0, 0, '', '', 'CPT4:76512', 0, 0, 1, ''),
2016 ('Eye_todo_done_defaults', 'dilation', 'Dilated Exam', 90, 0, 0, '', 'Full dilated exam', '', 0, 0, 1, ''),
2017 ('Eye_todo_done_defaults', 'ExtPhoto', 'Ext Photos', 200, 0, 0, '', '', 'CPT4:92285', 0, 0, 1, ''),
2018 ('Eye_todo_done_defaults', 'FundusPhoto', 'Retina Photo', 210, 0, 0, '', '', 'CPT4:92250', 0, 0, 1, ''),
2019 ('Eye_todo_done_defaults', 'Gonio', 'Gonio', 410, 0, 0, '', '', 'CPT4:92020', 0, 0, 1, ''),
2020 ('Eye_todo_done_defaults', 'IOP', 'IOP', 80, 0, 0, '', 'Intraocular pressure check', '', 0, 0, 1, ''),
2021 ('Eye_todo_done_defaults', 'irrigate', 'Irrigate', 450, 0, 0, '', '', 'CPT4:68840', 0, 0, 1, ''),
2022 ('Eye_todo_done_defaults', 'ISHI', 'Color Plates', 320, 0, 0, '', '', '', 0, 0, 1, ''),
2023 ('Eye_todo_done_defaults', 'lesion', 'Surg: office/15 min', 470, 0, 0, '', '', 'CPT4:67840', 0, 0, 1, ''),
2024 ('Eye_todo_done_defaults', 'OCTDisc', 'OCT Disc', 300, 0, 0, '', '', 'CPT4:92133', 0, 0, 1, ''),
2025 ('Eye_todo_done_defaults', 'OCTRetina', 'OCT Retina', 310, 0, 0, '', '', 'CPT4:92134', 0, 0, 1, ''),
2026 ('Eye_todo_done_defaults', 'Pachy', 'Pachymetry', 420, 0, 0, '', '', 'CPT4:76514', 0, 0, 1, ''),
2027 ('Eye_todo_done_defaults', 'refraction', 'Refraction', 460, 0, 0, '', '', 'CPT4:92015', 0, 0, 1, ''),
2028 ('Eye_todo_done_defaults', 'RTC1month', 'RTC 1 month', 20, 0, 0, '', 'F/U 1 month', '', 0, 0, 1, ''),
2029 ('Eye_todo_done_defaults', 'RTC1WK', 'RTC 1 week', 10, 0, 0, '', 'F/U 1 week', '', 0, 0, 1, ''),
2030 ('Eye_todo_done_defaults', 'RTC1yr', 'RTC 1 year', 40, 0, 0, '', 'Recheck 1 year', '', 0, 0, 1, ''),
2031 ('Eye_todo_done_defaults', 'RTC2yr', 'RTC  2 years', 50, 0, 0, '', 'Recheck 2 years', '', 0, 0, 1, ''),
2032 ('Eye_todo_done_defaults', 'RTC3wks', 'RTC 3 weeks', 30, 0, 0, '', '', '', 0, 0, 1, ''),
2033 ('Eye_todo_done_defaults', 'Topo', 'Corneal Topo', 400, 0, 0, '', '', 'CPT4:92025', 0, 0, 1, ''),
2034 ('Eye_todo_done_defaults', 'VFBLEPH', 'VF BLEPH', 130, 0, 0, '', 'Taped and untaped VF, uppers only', 'CPT4:92083', 0, 0, 1, ''),
2035 ('Eye_todo_done_defaults', 'VFC10', 'Visual Field C-10', 100, 0, 0, '', 'Central 10 red target VF', 'CPT4:92083', 0, 0, 1, ''),
2036 ('Eye_todo_done_defaults', 'VFC24', 'VF C-24', 110, 0, 0, '', 'Central 24 VF', 'CPT4:92083', 0, 0, 1, ''),
2037 ('Eye_todo_done_defaults', 'VFC30', 'VF C-30', 120, 0, 0, '', 'Central 30 VF', 'CPT4:92083', 0, 0, 1, ''),
2038 ('Eye_todo_done_defaults', 'Yag', 'Surg: YAG RT/LT', 480, 0, 0, '', '', 'CPT4:66821', 0, 0, 1, '');
2039 #EndIf
2041 #IfNotRow2D list_options list_id lists option_id Eye_Defaults_for_GENERAL
2042 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'Eye_Defaults_for_GENERAL', 'Eye Exam Default Values for New Providers', 1, 0);
2043 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`, `mapping`, `notes`, `codes`, `toggle_setting_1`, `toggle_setting_2`, `activity`, `subtype`) VALUES
2044 ('Eye_Defaults_for_GENERAL', 'LBROW', 'no brow ptosis', 60, 0, 0, '', 'EXT', '', 0, 0, 0, ''),
2045 ('Eye_Defaults_for_GENERAL', 'LLF', '17', 140, 0, 0, '', 'EXT', '', 0, 0, 0, ''),
2046 ('Eye_Defaults_for_GENERAL', 'LLL', 'good tone', 40, 0, 0, '', 'EXT', '', 0, 0, 0, ''),
2047 ('Eye_Defaults_for_GENERAL', 'LMCT', 'no masses', 80, 0, 0, '', 'EXT', '', 0, 0, 0, ''),
2048 ('Eye_Defaults_for_GENERAL', 'LMRD', '+3', 120, 0, 0, '', 'EXT', '', 0, 0, 0, ''),
2049 ('Eye_Defaults_for_GENERAL', 'LUL', 'normal lids and lashes', 20, 0, 0, '', 'EXT', '', 0, 0, 0, ''),
2050 ('Eye_Defaults_for_GENERAL', 'ODAC', 'deep and quiet', 190, 0, 0, '', 'ANTSEG', '', 0, 0, 0, ''),
2051 ('Eye_Defaults_for_GENERAL', 'ODAPD', '0', 280, 0, 0, '', 'NEURO', '', 0, 0, 0, ''),
2052 ('Eye_Defaults_for_GENERAL', 'ODCONJ', 'quiet', 160, 0, 0, '', 'ANTSEG', '', 0, 0, 0, ''),
2053 ('Eye_Defaults_for_GENERAL', 'ODCORNEA', 'clear', 170, 0, 0, '', 'ANTSEG', '', 0, 0, 0, ''),
2054 ('Eye_Defaults_for_GENERAL', 'ODCUP', '0.3', 450, 0, 0, '', 'RETINA', '', 0, 0, 0, ''),
2055 ('Eye_Defaults_for_GENERAL', 'ODDISC', 'pink', 430, 0, 0, '', 'RETINA', '', 0, 0, 0, ''),
2056 ('Eye_Defaults_for_GENERAL', 'ODIOPTARGET', '21', 530, 0, 0, '', 'GLAUCOMA', '', 0, 0, 0, ''),
2057 ('Eye_Defaults_for_GENERAL', 'ODIRIS', 'round', 230, 0, 0, '', 'ANTSEG', '', 0, 0, 0, ''),
2058 ('Eye_Defaults_for_GENERAL', 'ODLENS', 'clear', 210, 0, 0, '', 'ANTSEG', '', 0, 0, 0, ''),
2059 ('Eye_Defaults_for_GENERAL', 'ODMACULA', 'flat', 470, 0, 0, '', 'RETINA', '', 0, 0, 0, ''),
2060 ('Eye_Defaults_for_GENERAL', 'ODPERIPH', 'flat', 510, 0, 0, '', 'RETINA', '', 0, 0, 0, ''),
2061 ('Eye_Defaults_for_GENERAL', 'ODPUPILREACTIVITY', '+2', 270, 0, 0, '', 'NEURO', '', 0, 0, 0, ''),
2062 ('Eye_Defaults_for_GENERAL', 'ODPUPILSIZE1', '3', 250, 0, 0, '', 'NEURO', '', 0, 0, 0, ''),
2063 ('Eye_Defaults_for_GENERAL', 'ODPUPILSIZE2', '2', 260, 0, 0, '', 'NEURO', '', 0, 0, 0, ''),
2064 ('Eye_Defaults_for_GENERAL', 'ODVESSELS', '2:3', 490, 0, 0, '', 'RETINA', '', 0, 0, 0, ''),
2065 ('Eye_Defaults_for_GENERAL', 'ODVFCONFRONTATION1', '0', 330, 0, 0, '', 'NEURO', '', 0, 0, 0, ''),
2066 ('Eye_Defaults_for_GENERAL', 'ODVFCONFRONTATION2', '0', 340, 0, 0, '', 'NEURO', '', 0, 0, 0, ''),
2067 ('Eye_Defaults_for_GENERAL', 'ODVFCONFRONTATION3', '0', 350, 0, 0, '', 'NEURO', '', 0, 0, 0, ''),
2068 ('Eye_Defaults_for_GENERAL', 'ODVFCONFRONTATION4', '0', 360, 0, 0, '', 'NEURO', '', 0, 0, 0, ''),
2069 ('Eye_Defaults_for_GENERAL', 'ODVFCONFRONTATION5', '0', 370, 0, 0, '', 'NEURO', '', 0, 0, 0, ''),
2070 ('Eye_Defaults_for_GENERAL', 'OSAC', 'deep and quiet', 200, 0, 0, '', 'ANTSEG', '', 0, 0, 0, ''),
2071 ('Eye_Defaults_for_GENERAL', 'OSAPD', '0', 320, 0, 0, '', 'NEURO', '', 0, 0, 0, ''),
2072 ('Eye_Defaults_for_GENERAL', 'OSCONJ', 'quiet', 150, 0, 0, '', 'ANTSEG', '', 0, 0, 0, ''),
2073 ('Eye_Defaults_for_GENERAL', 'OSCORNEA', 'clear', 180, 0, 0, '', 'ANTSEG', '', 0, 0, 0, ''),
2074 ('Eye_Defaults_for_GENERAL', 'OSCUP', '0.3', 460, 0, 0, '', 'RETINA', '', 0, 0, 0, ''),
2075 ('Eye_Defaults_for_GENERAL', 'OSDISC', 'pink', 440, 0, 0, '', 'RETINA', '', 0, 0, 0, ''),
2076 ('Eye_Defaults_for_GENERAL', 'OSIOPTARGET', '21', 540, 0, 0, '', 'GLAUCOMA', '', 0, 0, 0, ''),
2077 ('Eye_Defaults_for_GENERAL', 'OSIRIS', 'round', 240, 0, 0, '', 'ANTSEG', '', 0, 0, 0, ''),
2078 ('Eye_Defaults_for_GENERAL', 'OSLENS', 'clear', 220, 0, 0, '', 'ANTSEG', '', 0, 0, 0, ''),
2079 ('Eye_Defaults_for_GENERAL', 'OSMACULA', 'flat', 480, 0, 0, '', 'RETINA', '', 0, 0, 0, ''),
2080 ('Eye_Defaults_for_GENERAL', 'OSPERIPH', 'flat', 520, 0, 0, '', 'RETINA', '', 0, 0, 0, ''),
2081 ('Eye_Defaults_for_GENERAL', 'OSPUPILREACTIVITY', '+2', 310, 0, 0, '', 'NEURO', '', 0, 0, 0, ''),
2082 ('Eye_Defaults_for_GENERAL', 'OSPUPILSIZE1', '3', 290, 0, 0, '', 'NEURO', '', 0, 0, 0, ''),
2083 ('Eye_Defaults_for_GENERAL', 'OSPUPILSIZE2', '2', 300, 0, 0, '', 'NEURO', '', 0, 0, 0, ''),
2084 ('Eye_Defaults_for_GENERAL', 'OSVESSELS', '2:3', 500, 0, 0, '', 'RETINA', '', 0, 0, 0, ''),
2085 ('Eye_Defaults_for_GENERAL', 'OSVFCONFRONTATION1', '0', 380, 0, 0, '', 'NEURO', '', 0, 0, 0, ''),
2086 ('Eye_Defaults_for_GENERAL', 'OSVFCONFRONTATION2', '0', 390, 0, 0, '', 'NEURO', '', 0, 0, 0, ''),
2087 ('Eye_Defaults_for_GENERAL', 'OSVFCONFRONTATION3', '0', 400, 0, 0, '', 'NEURO', '', 0, 0, 0, ''),
2088 ('Eye_Defaults_for_GENERAL', 'OSVFCONFRONTATION4', '0', 410, 0, 0, '', 'NEURO', '', 0, 0, 0, ''),
2089 ('Eye_Defaults_for_GENERAL', 'OSVFCONFRONTATION5', '0', 420, 0, 0, '', 'NEURO', '', 0, 0, 0, ''),
2090 ('Eye_Defaults_for_GENERAL', 'RADNEXA', 'normal lacrimal gland and orbit', 90, 0, 0, '', 'EXT', '', 0, 0, 0, ''),
2091 ('Eye_Defaults_for_GENERAL', â€˜LADNEXA', 'normal lacrimal gland and orbit', 91, 0, 0, '', 'EXT', '', 0, 0, 0, ''),
2092 ('Eye_Defaults_for_GENERAL', 'RBROW', 'no brow ptosis', 50, 0, 0, '', 'EXT', '', 0, 0, 0, ''),
2093 ('Eye_Defaults_for_GENERAL', 'RLF', '17', 130, 0, 0, '', 'EXT', '', 0, 0, 0, ''),
2094 ('Eye_Defaults_for_GENERAL', 'RLL', 'good tone', 30, 0, 0, '', 'EXT', '', 0, 0, 0, ''),
2095 ('Eye_Defaults_for_GENERAL', 'RMCT', 'no masses', 70, 0, 0, '', 'EXT', '', 0, 0, 0, ''),
2096 ('Eye_Defaults_for_GENERAL', 'RMRD', '+3', 110, 0, 0, '', 'EXT', '', 0, 0, 0, ''),
2097 ('Eye_Defaults_for_GENERAL', 'RUL', 'normal lids and lashes', 10, 0, 0, '', 'EXT', '', 0, 0, 0, '');
2098 #EndIf
2100 #IfNotRow2D list_options list_id lists option_id Eye_Lens_Material
2101 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'Eye_Lens_Material', 'Eye Lens Material', 1, 0);
2102 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`, `mapping`, `notes`, `codes`, `toggle_setting_1`, `toggle_setting_2`, `activity`, `subtype`) VALUES
2103 ('Eye_Lens_Material', 'LM_CG', 'Crown Glass', 10, 0, 0, '', 'Excellent optics. Low cost. Downsides: heavy, breakable. Abbe Value: 59', '', 0, 0, 1, ''),
2104 ('Eye_Lens_Material', 'LM_CR', 'CR-39', 20, 0, 0, '', 'Excellent optics. Low cost. Downside: thickness. Abbe Value: 58', '', 0, 0, 1, ''),
2105 ('Eye_Lens_Material', 'LM_HI_PLASTICS_1', 'High-index Plastics (1.6 to 1.67)', 60, 0, 0, '', 'Thin and lightweight. Block 100 percent UV. Less costly than 1.70-1.74 high-index lenses.  Abbe: 36(1.6) - 32 (1.67)', '', 0, 0, 1, ''),
2106 ('Eye_Lens_Material', 'LM_HI_PLASTICS_2', 'High-index Plastics (1.7 to 1.74)', 70, 0, 0, '', 'The thinnest lenses available. Block 100 percent UV. Lightweight.  Abbe: 36(1.7) - 33(1.74)', '', 0, 0, 1, ''),
2107 ('Eye_Lens_Material', 'LM_POLY', 'Polycarbonate', 40, 0, 0, '', 'Superior impact resistance. Blocks 100 percent UV. Lighter than high-index plastic lenses.  Abbe: 30', '', 0, 0, 1, ''),
2108 ('Eye_Lens_Material', 'LM_TRIBRID', 'Tribrid', 50, 0, 0, '', 'Thin and lightweight. Significantly more impact-resistant than CR-39 plastic and high-index plastic lenses (except polycarbonate and Trivex). Higher Abbe value than polycarbonate. Downside: Not yet available in a wide variety of lens designs.  Abbe: 41', '', 0, 0, 1, ''),
2109 ('Eye_Lens_Material', 'LM_TRIVEX', 'Trivex', 30, 0, 0, '', 'Superior impact resistance. Blocks 100 percent UV. Higher Abbe value than polycarbonate. Lightest lens material available. Abbe Value: 45', '', 0, 0, 1, '');
2110 #EndIf
2112 #IfNotRow2D list_options list_id lists option_id Eye_Lens_Treatments
2113 INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists' ,'Eye_Lens_Treatments', 'Eye Lens Treatments', 1, 0);
2114 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`, `mapping`, `notes`, `codes`, `toggle_setting_1`, `toggle_setting_2`, `activity`, `subtype`) VALUES
2115 ('Eye_Lens_Treatments', 'LT_ARCOAT', 'Anti-reflective coating', 20, 0, 0, '', '', '', 0, 0, 1, ''),
2116 ('Eye_Lens_Treatments', 'LT_ASCRATCH', 'Anti-scratch coating', 10, 0, 0, '', '', '', 0, 0, 1, ''),
2117 ('Eye_Lens_Treatments', 'LT_UVBLOCK', 'UV-blocking treatment', 30, 0, 0, '', '', '', 0, 0, 1, ''),
2118 ('Eye_Lens_Treatments', 'LT_PHOTOGREY', 'Photochromic treatment', 40, 0, 0, '', '', '', 0, 0, 1, '');
2119 #EndIf
2121 #IfMissingColumn users suffix
2122 ALTER TABLE `users` ADD `suffix` varchar(255) default NULL;
2123 #EndIf
2125 #IfNotRow2D list_options list_id page_validation option_id addrbook_edit#theform
2126 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `notes`, `activity`) VALUES ('page_validation', 'addrbook_edit#theform', '/interface/usergroup/addrbook_edit.php', 110, '{}', 1);
2127 #EndIf
2129 #IfNotTable product_registration
2130 CREATE TABLE `product_registration` (
2131   `registration_id` char(36) NOT NULL DEFAULT '',
2132   `email` varchar(255) NULL,
2133   `opt_out` TINYINT(1) NULL,
2134   PRIMARY KEY (`registration_id`)
2135 ) ENGINE=InnoDB;
2136 #EndIf
2138 #IfNotRow2D list_options list_id Eye_Defaults_for_GENERAL option_id LADNEXA
2139 INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`, `mapping`, `notes`, `codes`, `toggle_setting_1`, `toggle_setting_2`, `activity`, `subtype`) VALUES ('Eye_Defaults_for_GENERAL', 'LADNEXA', 'normal lacrimal gland and orbit', 91, 0, 0, '', 'EXT', '', 0, 0, 0, '');
2140 #EndIf