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