forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
4_2_0-to-4_3_0_upgrade.sql
12637 lines (9648 loc) · 634 KB
/
4_2_0-to-4_3_0_upgrade.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--
-- Comment Meta Language Constructs:
--
-- #IfNotTable
-- argument: table_name
-- behavior: if the table_name does not exist, the block will be executed
-- #IfTable
-- argument: table_name
-- behavior: if the table_name does exist, the block will be executed
-- #IfColumn
-- arguments: table_name colname
-- behavior: if the table and column exist, the block will be executed
-- #IfMissingColumn
-- arguments: table_name colname
-- behavior: if the table exists but the column does not, the block will be executed
-- #IfNotColumnType
-- arguments: table_name colname value
-- 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
-- #IfNotRow
-- arguments: table_name colname value
-- behavior: If the table table_name does not have a row where colname = value, the block will be executed.
-- #IfNotRow2D
-- arguments: table_name colname value colname2 value2
-- behavior: If the table table_name does not have a row where colname = value AND colname2 = value2, the block will be executed.
-- #IfNotRow3D
-- arguments: table_name colname value colname2 value2 colname3 value3
-- 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.
-- #IfNotRow4D
-- arguments: table_name colname value colname2 value2 colname3 value3 colname4 value4
-- 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.
-- #IfNotRow2Dx2
-- 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.
-- arguments: table_name colname value colname2 value2 colname3 value3
-- behavior: The block will be executed if both statements below are true:
-- 1) The table table_name does not have a row where colname = value AND colname2 = value2.
-- 2) The table table_name does not have a row where colname = value AND colname3 = value3.
-- #IfRow2D
-- arguments: table_name colname value colname2 value2
-- behavior: If the table table_name does have a row where colname = value AND colname2 = value2, the block will be executed.
-- #IfRow3D
-- arguments: table_name colname value colname2 value2 colname3 value3
-- behavior: If the table table_name does have a row where colname = value AND colname2 = value2 AND colname3 = value3, the block will be executed.
-- #IfIndex
-- desc: This function is most often used for dropping of indexes/keys.
-- arguments: table_name colname
-- behavior: If the table and index exist the relevant statements are executed, otherwise not.
-- #IfNotIndex
-- desc: This function will allow adding of indexes/keys.
-- arguments: table_name colname
-- behavior: If the index does not exist, it will be created
-- #EndIf
-- all blocks are terminated with a #EndIf statement.
-- #IfNotListReaction
-- Custom function for creating Reaction List
-- #IfNotListOccupation
-- Custom function for creating Occupation List
#IfNotIndex form_encounter encounter_date
CREATE INDEX encounter_date on form_encounter (`date`);
#EndIf
#IfNotColumnType prescriptions size varchar(16)
ALTER TABLE `prescriptions` CHANGE `size` `size` varchar(16) DEFAULT NULL;
#EndIf
#IfNotRow globals gl_name erx_newcrop_path
UPDATE `globals` SET `gl_name` = 'erx_newcrop_path' WHERE `gl_name` = 'erx_path_production';
#EndIf
#IfNotRow globals gl_name erx_newcrop_path_soap
UPDATE `globals` SET `gl_name` = 'erx_newcrop_path_soap' WHERE `gl_name` = 'erx_path_soap_production';
#EndIf
#IfNotRow globals gl_name erx_account_partner_name
UPDATE `globals` SET `gl_name` = 'erx_account_partner_name' WHERE `gl_name` = 'partner_name_production';
#EndIf
#IfNotRow globals gl_name erx_account_name
UPDATE `globals` SET `gl_name` = 'erx_account_name' WHERE `gl_name` = 'erx_name_production';
#EndIf
#IfNotRow globals gl_name erx_account_password
UPDATE `globals` SET `gl_name` = 'erx_account_password' WHERE `gl_name` = 'erx_password_production';
#EndIf
#IfNotColumnType lang_custom constant_name mediumtext
ALTER TABLE `lang_custom` CHANGE `constant_name` `constant_name` mediumtext NOT NULL default '';
#EndIf
#IfNotTable patient_tracker
CREATE TABLE `patient_tracker` (
`id` bigint(20) NOT NULL auto_increment,
`date` datetime DEFAULT NULL,
`apptdate` date DEFAULT NULL,
`appttime` time DEFAULT NULL,
`eid` bigint(20) NOT NULL default '0',
`pid` bigint(20) NOT NULL default '0',
`original_user` varchar(255) NOT NULL default '' COMMENT 'This is the user that created the original record',
`encounter` bigint(20) NOT NULL default '0',
`lastseq` varchar(4) NOT NULL default '' COMMENT 'The element file should contain this number of elements',
`random_drug_test` TINYINT(1) DEFAULT NULL COMMENT 'NULL if not randomized. If randomized, 0 is no, 1 is yes',
`drug_screen_completed` TINYINT(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY (`eid`),
KEY (`pid`)
) ENGINE=MyISAM AUTO_INCREMENT=1;
#EndIf
#IfNotTable patient_tracker_element
CREATE TABLE `patient_tracker_element` (
`pt_tracker_id` bigint(20) NOT NULL default '0' COMMENT 'maps to id column in patient_tracker table',
`start_datetime` datetime DEFAULT NULL,
`room` varchar(20) NOT NULL default '',
`status` varchar(31) NOT NULL default '',
`seq` varchar(4) NOT NULL default '' COMMENT 'This is a numerical sequence for this pt_tracker_id events',
`user` varchar(255) NOT NULL default '' COMMENT 'This is the user that created this element',
KEY (`pt_tracker_id`,`seq`)
) ENGINE=MyISAM;
#EndIf
#IfMissingColumn openemr_postcalendar_events pc_room
ALTER TABLE `openemr_postcalendar_events` ADD `pc_room` varchar(20) NOT NULL DEFAULT '' ;
#EndIf
#IfMissingColumn list_options toggle_setting_1
ALTER TABLE `list_options` ADD COLUMN `toggle_setting_1` tinyint(1) NOT NULL default '0';
UPDATE `list_options` SET `notes`='FF2414|10' , `toggle_setting_1`='1' WHERE `option_id`='@' AND `list_id` = 'apptstat';
UPDATE `list_options` SET `notes`='FF6619|10' , `toggle_setting_1`='1' WHERE `option_id`='~' AND `list_id` = 'apptstat';
#EndIf
#IfMissingColumn list_options toggle_setting_2
ALTER TABLE `list_options` ADD COLUMN `toggle_setting_2` tinyint(1) NOT NULL DEFAULT '0';
UPDATE `list_options` SET `notes`='0BBA34|0' , `toggle_setting_2`='1' WHERE `option_id`='!' AND `list_id` = 'apptstat';
UPDATE `list_options` SET `notes`='FEFDCF|0' , `toggle_setting_2`='1' WHERE `option_id`='>' AND `list_id` = 'apptstat';
UPDATE `list_options` SET `notes`='FEFDCF|0' WHERE `option_id`='-' AND `list_id` = 'apptstat';
UPDATE `list_options` SET `notes`='FFC9F8|0' WHERE `option_id`='*' AND `list_id` = 'apptstat';
UPDATE `list_options` SET `notes`='87FF1F|0' WHERE `option_id`='+' AND `list_id` = 'apptstat';
UPDATE `list_options` SET `notes`='BFBFBF|0' WHERE `option_id`='x' AND `list_id` = 'apptstat';
UPDATE `list_options` SET `notes`='BFBFBF|0' WHERE `option_id`='?' AND `list_id` = 'apptstat';
UPDATE `list_options` SET `notes`='FFFF2B|0' WHERE `option_id`='#' AND `list_id` = 'apptstat';
UPDATE `list_options` SET `notes`='52D9DE|10' WHERE `option_id`='<' AND `list_id` = 'apptstat';
UPDATE `list_options` SET `notes`='C0FF96|0' WHERE `option_id`='$' AND `list_id` = 'apptstat';
UPDATE `list_options` SET `notes`='BFBFBF|0' WHERE `option_id`='%' AND `list_id` = 'apptstat';
#EndIf
#IfNotRow2D list_options list_id lists option_id patient_flow_board_rooms
INSERT INTO list_options (list_id,option_id,title) VALUES ('lists','patient_flow_board_rooms','Patient Flow Board Rooms');
INSERT INTO list_options (list_id,option_id,title,seq) VALUES ('patient_flow_board_rooms', '1', 'Room 1', 10);
INSERT INTO list_options (list_id,option_id,title,seq) VALUES ('patient_flow_board_rooms', '2', 'Room 2', 20);
INSERT INTO list_options (list_id,option_id,title,seq) VALUES ('patient_flow_board_rooms', '3', 'Room 3', 30);
#EndIf
#IfMissingColumn clinical_rules developer
ALTER TABLE `clinical_rules` ADD `developer` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Clinical Rule Developer';
#EndIf
#IfMissingColumn clinical_rules funding_source
ALTER TABLE `clinical_rules` ADD `funding_source` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Clinical Rule Funding Source';
#EndIf
#IfMissingColumn clinical_rules release_version
ALTER TABLE `clinical_rules` ADD `release_version` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Clinical Rule Release Version';
#EndIf
#IfNotRow2D list_options list_id proc_res_abnormal option_id vhigh
INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`) VALUES ('proc_res_abnormal', 'vhigh', 'Above upper panic limits', 50);
#EndIf
#IfNotRow2D list_options list_id proc_res_abnormal option_id vlow
INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`) VALUES ('proc_res_abnormal', 'vlow', 'Below lower panic limits', 60);
#EndIf
#IfNotRow code_types ct_key LOINC
DROP TABLE IF EXISTS `temp_table_one`;
CREATE TABLE `temp_table_one` (`id` int(11) NOT NULL DEFAULT '0',`seq` int(11) NOT NULL DEFAULT '0') ENGINE=MyISAM;
INSERT INTO `temp_table_one` (`id`, `seq`) VALUES (
IF(((SELECT MAX(`ct_id` ) FROM `code_types`) >= 100), ((SELECT MAX(`ct_id` ) FROM `code_types`) + 1), 100),
IF(((SELECT MAX(`ct_seq`) FROM `code_types`) >= 100), ((SELECT MAX(`ct_seq`) FROM `code_types`) + 1), 100));
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 ('LOINC', (SELECT MAX(`id`) FROM `temp_table_one`), (SELECT MAX(`seq`) FROM `temp_table_one`), 0, '', 0, 0, 1, 0, 1, 'LOINC', 0, 0, 0, 0, 0);
DROP TABLE `temp_table_one`;
#EndIf
#IfNotRow code_types ct_key PHIN Questions
DROP TABLE IF EXISTS `temp_table_one`;
CREATE TABLE `temp_table_one` (`id` int(11) NOT NULL DEFAULT '0',`seq` int(11) NOT NULL DEFAULT '0') ENGINE=MyISAM;
INSERT INTO `temp_table_one` (`id`, `seq`) VALUES (
IF(((SELECT MAX(`ct_id` ) FROM `code_types`) >= 100), ((SELECT MAX(`ct_id` ) FROM `code_types`) + 1), 100),
IF(((SELECT MAX(`ct_seq`) FROM `code_types`) >= 100), ((SELECT MAX(`ct_seq`) FROM `code_types`) + 1), 100));
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 ('PHIN Questions', (SELECT MAX(`id`) FROM `temp_table_one`), (SELECT MAX(`seq`) FROM `temp_table_one`), 0, '', 0, 0, 1, 0, 1, 'PHIN Questions', 0, 0, 0, 0, 0);
DROP TABLE `temp_table_one`;
#EndIf
#IfMissingColumn list_options activity
ALTER TABLE `list_options` ADD COLUMN `activity` TINYINT DEFAULT 1 NOT NULL;
#EndIf
#IfNotTable ccda_components
CREATE TABLE ccda_components (
ccda_components_id int(11) NOT NULL AUTO_INCREMENT,
ccda_components_field varchar(100) DEFAULT NULL,
ccda_components_name varchar(100) DEFAULT NULL,
PRIMARY KEY (ccda_components_id)
) ENGINE=InnoDB AUTO_INCREMENT=10 ;
insert into ccda_components (ccda_components_id, ccda_components_field, ccda_components_name) values('1','progress_note','Progress Notes');
insert into ccda_components (ccda_components_id, ccda_components_field, ccda_components_name) values('2','consultation_note','Consultation Note');
insert into ccda_components (ccda_components_id, ccda_components_field, ccda_components_name) values('3','continuity_care_document','Continuity Care Document');
insert into ccda_components (ccda_components_id, ccda_components_field, ccda_components_name) values('4','diagnostic_image_reporting','Diagnostic Image Reporting');
insert into ccda_components (ccda_components_id, ccda_components_field, ccda_components_name) values('5','discharge_summary','Discharge Summary');
insert into ccda_components (ccda_components_id, ccda_components_field, ccda_components_name) values('6','history_physical_note','History and Physical Note');
insert into ccda_components (ccda_components_id, ccda_components_field, ccda_components_name) values('7','operative_note','Operative Note');
insert into ccda_components (ccda_components_id, ccda_components_field, ccda_components_name) values('8','procedure_note','Procedure Note');
insert into ccda_components (ccda_components_id, ccda_components_field, ccda_components_name) values('9','unstructured_document','Unstructured Document');
#EndIf
#IfNotTable ccda_sections
CREATE TABLE ccda_sections (
ccda_sections_id int(11) NOT NULL AUTO_INCREMENT,
ccda_components_id int(11) DEFAULT NULL,
ccda_sections_field varchar(100) DEFAULT NULL,
ccda_sections_name varchar(100) DEFAULT NULL,
ccda_sections_req_mapping tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (ccda_sections_id)
) ENGINE=InnoDB AUTO_INCREMENT=46;
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('1','1','assessment_plan','Assessment and Plan','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('2','2','assessment_plan','Assessment and Plan','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('3','2','history_of_present_illness','History of Present Illness','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('4','2','physical_exam','Physical Exam','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('5','2','reason_of_visit','Reason for Referral/Reason for Visit','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('6','3','allergies','Allergies','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('7','3','medications','Medications','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('8','3','problem_list','Problem List','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('9','3','procedures','Procedures','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('10','3','results','Results','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('11','4','report','Report','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('12','5','allergies','Allergies','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('13','5','hospital_course','Hospital Course','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('14','5','hospital_discharge_diagnosis','Hospital Discharge Diagnosis','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('15','5','hospital_discharge_medications','Hospital Discharge Medications','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('16','5','plan_of_care','Plan of Care','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('17','6','allergies','Allergies','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('19','6','chief_complaint','Chief Complaint / Reason for Visit','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('21','6','family_history','Family History','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('22','6','general_status','General Status','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('23','6','hpi_past_med','History of Past Illness (Past Medical History)','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('24','6','hpi','History of Present Illness','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('25','6','medications','Medications','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('26','6','physical_exam','Physical Exam','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('28','6','results','Results','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('29','6','review_of_systems','Review of Systems','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('30','6','social_history','Social History','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('31','6','vital_signs','Vital Signs','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('32','7','anesthesia','Anesthesia','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('33','7','complications','Complications','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('34','7','post_operative_diagnosis','Post Operative Diagnosis','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('35','7','pre_operative_diagnosis','Pre Operative Diagnosis','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('36','7','procedure_estimated_blood_loss','Procedure Estimated Blood Loss','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('37','7','procedure_findings','Procedure Findings','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('38','7','procedure_specimens_taken','Procedure Specimens Taken','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('39','7','procedure_description','Procedure Description','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('40','8','assessment_plan','Assessment and Plan','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('41','8','complications','Complications','1');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('42','8','postprocedure_diagnosis','Postprocedure Diagnosis','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('43','8','procedure_description','Procedure Description','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('44','8','procedure_indications','Procedure Indications','0');
insert into ccda_sections (ccda_sections_id, ccda_components_id, ccda_sections_field, ccda_sections_name, ccda_sections_req_mapping) values('45','9','unstructured_doc','Document','0');
#EndIf
#IfNotTable ccda_table_mapping
CREATE TABLE ccda_table_mapping (
id int(11) NOT NULL AUTO_INCREMENT,
ccda_component varchar(100) DEFAULT NULL,
ccda_component_section varchar(100) DEFAULT NULL,
form_dir varchar(100) DEFAULT NULL,
form_type smallint(6) DEFAULT NULL,
form_table varchar(100) DEFAULT NULL,
user_id int(11) DEFAULT NULL,
deleted tinyint(4) NOT NULL DEFAULT '0',
timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=1 ;
#EndIf
#IfNotTable ccda_field_mapping
CREATE TABLE ccda_field_mapping (
id int(11) NOT NULL AUTO_INCREMENT,
table_id int(11) DEFAULT NULL,
ccda_field varchar(100) DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=1 ;
#EndIf
#IfNotTable ccda
CREATE TABLE ccda (
id INT(11) NOT NULL AUTO_INCREMENT,
pid BIGINT(20) DEFAULT NULL,
encounter BIGINT(20) DEFAULT NULL,
ccda_data MEDIUMTEXT,
time VARCHAR(50) DEFAULT NULL,
status SMALLINT(6) DEFAULT NULL,
updated_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
user_id VARCHAR(50) null,
couch_docid VARCHAR(100) NULL,
couch_revid VARCHAR(100) NULL,
`view` tinyint(4) NOT NULL DEFAULT '0',
`transfer` tinyint(4) NOT NULL DEFAULT '0',
`type` VARCHAR(15),
`emr_transfer` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (id),
UNIQUE KEY unique_key (pid,encounter,time)
) ENGINE=InnoDB AUTO_INCREMENT=1 ;
#EndIf
#IfNotRow2D list_options list_id lists option_id religious_affiliation
INSERT INTO list_options(list_id,option_id,title) VALUES ('lists','religious_affiliation','Religious Affiliation');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','adventist','1001','Adventist','5');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','african_religions','1002','African Religions','15');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','afro-caribbean_religions','1003','Afro-Caribbean Religions','25');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','agnosticism','1004','Agnosticism','35');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','anglican','1005','Anglican','45');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','animism','1006','Animism','55');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','assembly_of_god','1061','Assembly of God','65');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','atheism','1007','Atheism','75');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','babi_bahai_faiths','1008','Babi & Baha\'I faiths','85');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','baptist','1009','Baptist','95');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','bon','1010','Bon','105');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','brethren','1062','Brethren','115');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','cao_dai','1011','Cao Dai','125');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','celticism','1012','Celticism','135');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','christiannoncatholicnonspecifc','1013','Christian (non-Catholic, non-specific)','145');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','christian_scientist','1063','Christian Scientist','155');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','church_of_christ','1064','Church of Christ','165');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','church_of_god','1065','Church of God','175');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','confucianism','1014','Confucianism','185');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','congregational','1066','Congregational','195');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','cyberculture_religions','1015','Cyberculture Religions','205');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','disciples_of_christ','1067','Disciples of Christ','215');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','divination','1016','Divination','225');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','eastern_orthodox','1068','Eastern Orthodox','235');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','episcopalian','1069','Episcopalian','245');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','evangelical_covenant','1070','Evangelical Covenant','255');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','fourth_way','1017','Fourth Way','265');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','free_daism','1018','Free Daism','275');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','friends','1071','Friends','285');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','full_gospel','1072','Full Gospel','295');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','gnosis','1019','Gnosis','305');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','hinduism','1020','Hinduism','315');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','humanism','1021','Humanism','325');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','independent','1022','Independent','335');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','islam','1023','Islam','345');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','jainism','1024','Jainism','355');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','jehovahs_witnesses','1025','Jehovah\'s Witnesses','365');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','judaism','1026','Judaism','375');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','latter_day_saints','1027','Latter Day Saints','385');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','lutheran','1028','Lutheran','395');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','mahayana','1029','Mahayana','405');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','meditation','1030','Meditation','415');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','messianic_judaism','1031','Messianic Judaism','425');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','methodist','1073','Methodist','435');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','mitraism','1032','Mitraism','445');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','native_american','1074','Native American','455');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','nazarene','1075','Nazarene','465');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','new_age','1033','New Age','475');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','non-roman_catholic','1034','non-Roman Catholic','485');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','occult','1035','Occult','495');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','orthodox','1036','Orthodox','505');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','paganism','1037','Paganism','515');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','pentecostal','1038','Pentecostal','525');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','presbyterian','1076','Presbyterian','535');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','process_the','1039','Process, The','545');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','protestant','1077','Protestant','555');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','protestant_no_denomination','1078','Protestant, No Denomination','565');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','reformed','1079','Reformed','575');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','reformed_presbyterian','1040','Reformed/Presbyterian','585');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','roman_catholic_church','1041','Roman Catholic Church','595');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','salvation_army','1080','Salvation Army','605');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','satanism','1042','Satanism','615');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','scientology','1043','Scientology','625');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','shamanism','1044','Shamanism','635');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','shiite_islam','1045','Shiite (Islam)','645');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','shinto','1046','Shinto','655');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','sikism','1047','Sikism','665');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','spiritualism','1048','Spiritualism','675');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','sunni_islam','1049','Sunni (Islam)','685');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','taoism','1050','Taoism','695');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','theravada','1051','Theravada','705');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','unitarian_universalist','1081','Unitarian Universalist','715');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','unitarian-universalism','1052','Unitarian-Universalism','725');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','united_church_of_christ','1082','United Church of Christ','735');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','universal_life_church','1053','Universal Life Church','745');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','vajrayana_tibetan','1054','Vajrayana (Tibetan)','755');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','veda','1055','Veda','765');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','voodoo','1056','Voodoo','775');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','wicca','1057','Wicca','785');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','yaohushua','1058','Yaohushua','795');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','zen_buddhism','1059','Zen Buddhism','805');
INSERT INTO list_options (list_id, option_id, notes,title, seq) VALUES ('religious_affiliation','zoroastrianism','1060','Zoroastrianism','815');
#EndIf
#IfNotRow2D list_options list_id lists option_id personal_relationship
INSERT INTO list_options(list_id,option_id,title) VALUES ('lists','personal_relationship','Relationship');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','ADOPT','Adopted Child','ADOPT','10');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','AUNT','Aunt','AUNT','20');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','CHILD','Child','CHILD','30');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','CHLDINLAW','Child in-law','CHLDINLAW','40');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','COUSN','Cousin','COUSN','50');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','DOMPART','Domestic Partner','DOMPART','60');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','FAMMEMB','Family Member','FAMMEMB','70');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','CHLDFOST','Foster Child','CHLDFOST','80');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','GRNDCHILD','Grandchild','GRNDCHILD','90');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','GPARNT','Grandparent','GPARNT','100');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','GRPRN','Grandparent','GRPRN','110');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','GGRPRN','Great Grandparent','GGRPRN','120');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','HSIB','Half-Sibling','HSIB','130');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','MAUNT','MaternalAunt','MAUNT','140');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','MCOUSN','MaternalCousin','MCOUSN','150');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','MGRPRN','MaternalGrandparent','MGRPRN','160');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','MGGRPRN','MaternalGreatgrandparent','MGGRPRN','170');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','MUNCLE','MaternalUncle','MUNCLE','180');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','NCHILD','Natural Child','NCHILD','190');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','NPRN','Natural Parent','NPRN','200');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','NSIB','Natural Sibling','NSIB','210');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','NBOR','Neighbor','NBOR','220');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','NIENEPH','Niece/Nephew','NIENEPH','230');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','PRN','Parent','PRN','240');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','PRNINLAW','parent in-law','PRNINLAW','250');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','PAUNT','PaternalAunt','PAUNT','260');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','PCOUSN','PaternalCousin','PCOUSN','270');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','PGRPRN','PaternalGrandparent','PGRPRN','280');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','PGGRPRN','PaternalGreatgrandparent','PGGRPRN','290');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','PUNCLE','PaternalUncle','PUNCLE','300');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','ROOM','Roommate','ROOM','310');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','SIB','Sibling','SIB','320');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','SIBINLAW','Sibling in-law','SIBINLAW','330');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','SIGOTHR','Significant Other','SIGOTHR','340');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','SPS','Spouse','SPS','350');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','STEP','Step Child','STEP','360');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','STPPRN','Step Parent','STPPRN','370');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','STPSIB','Step Sibling','STPSIB','380');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','UNCLE','Uncle','UNCLE','390');
INSERT INTO list_options (list_id, option_id, title, notes, seq) VALUES ('personal_relationship','FRND','Unrelated Friend','FRND','400');
#EndIf
#IfNotRow3D list_options list_id ethnicity option_id hisp_or_latin notes 2135-2
UPDATE `list_options` SET `notes` = '2135-2' WHERE `option_id` = 'hisp_or_latin' AND `list_id` = 'ethnicity';
#EndIf
#IfNotRow3D list_options list_id ethnicity option_id not_hisp_or_latin notes 2186-5
UPDATE `list_options` SET `notes` = '2186-5' WHERE `option_id` = 'not_hisp_or_latin' AND `list_id` = 'ethnicity';
#EndIf
#IfNotRow3D list_options list_id race option_id amer_ind_or_alaska_native notes 1002-5
UPDATE `list_options` SET `notes` = '1002-5' WHERE `option_id` = 'amer_ind_or_alaska_native' AND `list_id` = 'race';
#EndIf
#IfNotRow3D list_options list_id race option_id Asian notes 2028-9
UPDATE `list_options` SET `notes` = '2028-9' WHERE `option_id` = 'Asian' AND `list_id` = 'race';
#EndIf
#IfNotRow3D list_options list_id race option_id black_or_afri_amer notes 2054-5
UPDATE `list_options` SET `notes` = '2054-5' WHERE `option_id` = 'black_or_afri_amer' AND `list_id` = 'race';
#EndIf
#IfNotRow3D list_options list_id race option_id native_hawai_or_pac_island notes 2076-8
UPDATE `list_options` SET `notes` = '2076-8' WHERE `option_id` = 'native_hawai_or_pac_island' AND `list_id` = 'race';
#EndIf
#IfNotRow3D list_options list_id race option_id white notes 2106-3
UPDATE `list_options` SET `notes` = '2106-3' WHERE `option_id` = 'white' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id abenaki title Abenaki
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','abenaki','Abenaki','60', '0',' 1006-6', 0);
#EndIf
#IfRow2D list_options list_id race option_id abenaki
UPDATE `list_options` SET `notes` = '1006-6' WHERE `option_id` = 'abenaki' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Abenaki
UPDATE `list_options` SET `notes` = '1006-6' WHERE `title` = 'Abenaki' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id absentee_shawnee title Absentee Shawnee
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','absentee_shawnee','Absentee Shawnee','70', '0',' 1579-2', 0);
#EndIf
#IfRow2D list_options list_id race option_id absentee_shawnee
UPDATE `list_options` SET `notes` = '1579-2' WHERE `option_id` = 'absentee_shawnee' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Absentee Shawnee
UPDATE `list_options` SET `notes` = '1579-2' WHERE `title` = 'Absentee Shawnee' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id acoma title Acoma
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','acoma','Acoma','80', '0',' 1490-2', 0);
#EndIf
#IfRow2D list_options list_id race option_id acoma
UPDATE `list_options` SET `notes` = '1490-2' WHERE `option_id` = 'acoma' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Acoma
UPDATE `list_options` SET `notes` = '1490-2' WHERE `title` = 'Acoma' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id afghanistani title Afghanistani
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','afghanistani','Afghanistani','90', '0',' 2126-1', 0);
#EndIf
#IfRow2D list_options list_id race option_id afghanistani
UPDATE `list_options` SET `notes` = '2126-1' WHERE `option_id` = 'afghanistani' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Afghanistani
UPDATE `list_options` SET `notes` = '2126-1' WHERE `title` = 'Afghanistani' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id african title African
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','african','African','100', '0',' 2060-2', 0);
#EndIf
#IfRow2D list_options list_id race option_id african
UPDATE `list_options` SET `notes` = '2060-2' WHERE `option_id` = 'african' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title African
UPDATE `list_options` SET `notes` = '2060-2' WHERE `title` = 'African' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id african_american title African American
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','african_american','African American','110', '0',' 2058-6', 0);
#EndIf
#IfRow2D list_options list_id race option_id african_american
UPDATE `list_options` SET `notes` = '2058-6' WHERE `option_id` = 'african_american' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title African American
UPDATE `list_options` SET `notes` = '2058-6' WHERE `title` = 'African American' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id agdaagux title Agdaagux
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','agdaagux','Agdaagux','120', '0',' 1994-3', 0);
#EndIf
#IfRow2D list_options list_id race option_id agdaagux
UPDATE `list_options` SET `notes` = '1994-3' WHERE `option_id` = 'agdaagux' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Agdaagux
UPDATE `list_options` SET `notes` = '1994-3' WHERE `title` = 'Agdaagux' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id agua_caliente title Agua Caliente
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','agua_caliente','Agua Caliente','130', '0',' 1212-0', 0);
#EndIf
#IfRow2D list_options list_id race option_id agua_caliente
UPDATE `list_options` SET `notes` = '1212-0' WHERE `option_id` = 'agua_caliente' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Agua Caliente
UPDATE `list_options` SET `notes` = '1212-0' WHERE `title` = 'Agua Caliente' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id agua_caliente_cahuilla title Agua Caliente Cahuilla
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','agua_caliente_cahuilla','Agua Caliente Cahuilla','140', '0',' 1045-4', 0);
#EndIf
#IfRow2D list_options list_id race option_id agua_caliente_cahuilla
UPDATE `list_options` SET `notes` = '1045-4' WHERE `option_id` = 'agua_caliente_cahuilla' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Agua Caliente Cahuilla
UPDATE `list_options` SET `notes` = '1045-4' WHERE `title` = 'Agua Caliente Cahuilla' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id ahtna title Ahtna
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','ahtna','Ahtna','150', '0',' 1740-0', 0);
#EndIf
#IfRow2D list_options list_id race option_id ahtna
UPDATE `list_options` SET `notes` = '1740-0' WHERE `option_id` = 'ahtna' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Ahtna
UPDATE `list_options` SET `notes` = '1740-0' WHERE `title` = 'Ahtna' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id ak-chin title Ak-Chin
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','ak-chin','Ak-Chin','160', '0',' 1654-3', 0);
#EndIf
#IfRow2D list_options list_id race option_id ak-chin
UPDATE `list_options` SET `notes` = '1654-3' WHERE `option_id` = 'ak-chin' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Ak-Chin
UPDATE `list_options` SET `notes` = '1654-3' WHERE `title` = 'Ak-Chin' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id akhiok title Akhiok
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','akhiok','Akhiok','170', '0',' 1993-5', 0);
#EndIf
#IfRow2D list_options list_id race option_id akhiok
UPDATE `list_options` SET `notes` = '1993-5' WHERE `option_id` = 'akhiok' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Akhiok
UPDATE `list_options` SET `notes` = '1993-5' WHERE `title` = 'Akhiok' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id akiachak title Akiachak
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','akiachak','Akiachak','180', '0',' 1897-8', 0);
#EndIf
#IfRow2D list_options list_id race option_id akiachak
UPDATE `list_options` SET `notes` = '1897-8' WHERE `option_id` = 'akiachak' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Akiachak
UPDATE `list_options` SET `notes` = '1897-8' WHERE `title` = 'Akiachak' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id akiak title Akiak
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','akiak','Akiak','190', '0',' 1898-6', 0);
#EndIf
#IfRow2D list_options list_id race option_id akiak
UPDATE `list_options` SET `notes` = '1898-6' WHERE `option_id` = 'akiak' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Akiak
UPDATE `list_options` SET `notes` = '1898-6' WHERE `title` = 'Akiak' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id akutan title Akutan
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','akutan','Akutan','200', '0',' 2007-3', 0);
#EndIf
#IfRow2D list_options list_id race option_id akutan
UPDATE `list_options` SET `notes` = '2007-3' WHERE `option_id` = 'akutan' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Akutan
UPDATE `list_options` SET `notes` = '2007-3' WHERE `title` = 'Akutan' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id alabama_coushatta title Alabama Coushatta
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','alabama_coushatta','Alabama Coushatta','210', '0',' 1187-4', 0);
#EndIf
#IfRow2D list_options list_id race option_id alabama_coushatta
UPDATE `list_options` SET `notes` = '1187-4' WHERE `option_id` = 'alabama_coushatta' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Alabama Coushatta
UPDATE `list_options` SET `notes` = '1187-4' WHERE `title` = 'Alabama Coushatta' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id alabama_creek title Alabama Creek
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','alabama_creek','Alabama Creek','220', '0',' 1194-0', 0);
#EndIf
#IfRow2D list_options list_id race option_id alabama_creek
UPDATE `list_options` SET `notes` = '1194-0' WHERE `option_id` = 'alabama_creek' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Alabama Creek
UPDATE `list_options` SET `notes` = '1194-0' WHERE `title` = 'Alabama Creek' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id alabama_quassarte title Alabama Quassarte
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','alabama_quassarte','Alabama Quassarte','230', '0',' 1195-7', 0);
#EndIf
#IfRow2D list_options list_id race option_id alabama_quassarte
UPDATE `list_options` SET `notes` = '1195-7' WHERE `option_id` = 'alabama_quassarte' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Alabama Quassarte
UPDATE `list_options` SET `notes` = '1195-7' WHERE `title` = 'Alabama Quassarte' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id alakanuk title Alakanuk
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','alakanuk','Alakanuk','240', '0',' 1899-4', 0);
#EndIf
#IfRow2D list_options list_id race option_id alakanuk
UPDATE `list_options` SET `notes` = '1899-4' WHERE `option_id` = 'alakanuk' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Alakanuk
UPDATE `list_options` SET `notes` = '1899-4' WHERE `title` = 'Alakanuk' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id alamo_navajo title Alamo Navajo
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','alamo_navajo','Alamo Navajo','250', '0',' 1383-9', 0);
#EndIf
#IfRow2D list_options list_id race option_id alamo_navajo
UPDATE `list_options` SET `notes` = '1383-9' WHERE `option_id` = 'alamo_navajo' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Alamo Navajo
UPDATE `list_options` SET `notes` = '1383-9' WHERE `title` = 'Alamo Navajo' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id alanvik title Alanvik
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','alanvik','Alanvik','260', '0',' 1744-2', 0);
#EndIf
#IfRow2D list_options list_id race option_id alanvik
UPDATE `list_options` SET `notes` = '1744-2' WHERE `option_id` = 'alanvik' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Alanvik
UPDATE `list_options` SET `notes` = '1744-2' WHERE `title` = 'Alanvik' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id alaska_indian title Alaska Indian
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','alaska_indian','Alaska Indian','270', '0',' 1737-6', 0);
#EndIf
#IfRow2D list_options list_id race option_id alaska_indian
UPDATE `list_options` SET `notes` = '1737-6' WHERE `option_id` = 'alaska_indian' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Alaska Indian
UPDATE `list_options` SET `notes` = '1737-6' WHERE `title` = 'Alaska Indian' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id alaska_native title Alaska Native
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','alaska_native','Alaska Native','280', '0',' 1735-0', 0);
#EndIf
#IfRow2D list_options list_id race option_id alaska_native
UPDATE `list_options` SET `notes` = '1735-0' WHERE `option_id` = 'alaska_native' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Alaska Native
UPDATE `list_options` SET `notes` = '1735-0' WHERE `title` = 'Alaska Native' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id alaskan_athabascan title Alaskan Athabascan
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','alaskan_athabascan','Alaskan Athabascan','290', '0',' 1739-2', 0);
#EndIf
#IfRow2D list_options list_id race option_id alaskan_athabascan
UPDATE `list_options` SET `notes` = '1739-2' WHERE `option_id` = 'alaskan_athabascan' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Alaskan Athabascan
UPDATE `list_options` SET `notes` = '1739-2' WHERE `title` = 'Alaskan Athabascan' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id alatna title Alatna
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','alatna','Alatna','300', '0',' 1741-8', 0);
#EndIf
#IfRow2D list_options list_id race option_id alatna
UPDATE `list_options` SET `notes` = '1741-8' WHERE `option_id` = 'alatna' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Alatna
UPDATE `list_options` SET `notes` = '1741-8' WHERE `title` = 'Alatna' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id aleknagik title Aleknagik
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','aleknagik','Aleknagik','310', '0',' 1900-0', 0);
#EndIf
#IfRow2D list_options list_id race option_id aleknagik
UPDATE `list_options` SET `notes` = '1900-0' WHERE `option_id` = 'aleknagik' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Aleknagik
UPDATE `list_options` SET `notes` = '1900-0' WHERE `title` = 'Aleknagik' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id aleut title Aleut
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','aleut','Aleut','320', '0',' 1966-1', 0);
#EndIf
#IfRow2D list_options list_id race option_id aleut
UPDATE `list_options` SET `notes` = '1966-1' WHERE `option_id` = 'aleut' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Aleut
UPDATE `list_options` SET `notes` = '1966-1' WHERE `title` = 'Aleut' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id aleut_corporation title Aleut Corporation
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','aleut_corporation','Aleut Corporation','330', '0',' 2008-1', 0);
#EndIf
#IfRow2D list_options list_id race option_id aleut_corporation
UPDATE `list_options` SET `notes` = '2008-1' WHERE `option_id` = 'aleut_corporation' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Aleut Corporation
UPDATE `list_options` SET `notes` = '2008-1' WHERE `title` = 'Aleut Corporation' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id aleutian title Aleutian
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','aleutian','Aleutian','340', '0',' 2009-9', 0);
#EndIf
#IfRow2D list_options list_id race option_id aleutian
UPDATE `list_options` SET `notes` = '2009-9' WHERE `option_id` = 'aleutian' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Aleutian
UPDATE `list_options` SET `notes` = '2009-9' WHERE `title` = 'Aleutian' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id aleutian_islander title Aleutian Islander
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','aleutian_islander','Aleutian Islander','350', '0',' 2010-7', 0);
#EndIf
#IfRow2D list_options list_id race option_id aleutian_islander
UPDATE `list_options` SET `notes` = '2010-7' WHERE `option_id` = 'aleutian_islander' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Aleutian Islander
UPDATE `list_options` SET `notes` = '2010-7' WHERE `title` = 'Aleutian Islander' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id alexander title Alexander
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','alexander','Alexander','360', '0',' 1742-6', 0);
#EndIf
#IfRow2D list_options list_id race option_id alexander
UPDATE `list_options` SET `notes` = '1742-6' WHERE `option_id` = 'alexander' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Alexander
UPDATE `list_options` SET `notes` = '1742-6' WHERE `title` = 'Alexander' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id algonquian title Algonquian
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','algonquian','Algonquian','370', '0',' 1008-2', 0);
#EndIf
#IfRow2D list_options list_id race option_id algonquian
UPDATE `list_options` SET `notes` = '1008-2' WHERE `option_id` = 'algonquian' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Algonquian
UPDATE `list_options` SET `notes` = '1008-2' WHERE `title` = 'Algonquian' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id allakaket title Allakaket
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','allakaket','Allakaket','380', '0',' 1743-4', 0);
#EndIf
#IfRow2D list_options list_id race option_id allakaket
UPDATE `list_options` SET `notes` = '1743-4' WHERE `option_id` = 'allakaket' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Allakaket
UPDATE `list_options` SET `notes` = '1743-4' WHERE `title` = 'Allakaket' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id allen_canyon title Allen Canyon
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','allen_canyon','Allen Canyon','390', '0',' 1671-7', 0);
#EndIf
#IfRow2D list_options list_id race option_id allen_canyon
UPDATE `list_options` SET `notes` = '1671-7' WHERE `option_id` = 'allen_canyon' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Allen Canyon
UPDATE `list_options` SET `notes` = '1671-7' WHERE `title` = 'Allen Canyon' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id alpine title Alpine
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','alpine','Alpine','400', '0',' 1688-1', 0);
#EndIf
#IfRow2D list_options list_id race option_id alpine
UPDATE `list_options` SET `notes` = '1688-1' WHERE `option_id` = 'alpine' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Alpine
UPDATE `list_options` SET `notes` = '1688-1' WHERE `title` = 'Alpine' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id alsea title Alsea
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','alsea','Alsea','410', '0',' 1392-0', 0);
#EndIf
#IfRow2D list_options list_id race option_id alsea
UPDATE `list_options` SET `notes` = '1392-0' WHERE `option_id` = 'alsea' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Alsea
UPDATE `list_options` SET `notes` = '1392-0' WHERE `title` = 'Alsea' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id alutiiq_aleut title Alutiiq Aleut
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','alutiiq_aleut','Alutiiq Aleut','420', '0',' 1968-7', 0);
#EndIf
#IfRow2D list_options list_id race option_id alutiiq_aleut
UPDATE `list_options` SET `notes` = '1968-7' WHERE `option_id` = 'alutiiq_aleut' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Alutiiq Aleut
UPDATE `list_options` SET `notes` = '1968-7' WHERE `title` = 'Alutiiq Aleut' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id ambler title Ambler
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','ambler','Ambler','430', '0',' 1845-7', 0);
#EndIf
#IfRow2D list_options list_id race option_id ambler
UPDATE `list_options` SET `notes` = '1845-7' WHERE `option_id` = 'ambler' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Ambler
UPDATE `list_options` SET `notes` = '1845-7' WHERE `title` = 'Ambler' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id american_indian title American Indian
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','american_indian','American Indian','440', '0',' 1004-1', 0);
#EndIf
#IfRow2D list_options list_id race option_id american_indian
UPDATE `list_options` SET `notes` = '1004-1' WHERE `option_id` = 'american_indian' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title American Indian
UPDATE `list_options` SET `notes` = '1004-1' WHERE `title` = 'American Indian' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id anaktuvuk title Anaktuvuk
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','anaktuvuk','Anaktuvuk','460', '0',' 1846-5', 0);
#EndIf
#IfRow2D list_options list_id race option_id anaktuvuk
UPDATE `list_options` SET `notes` = '1846-5' WHERE `option_id` = 'anaktuvuk' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Anaktuvuk
UPDATE `list_options` SET `notes` = '1846-5' WHERE `title` = 'Anaktuvuk' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id anaktuvuk_pass title Anaktuvuk Pass
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','anaktuvuk_pass','Anaktuvuk Pass','470', '0',' 1847-3', 0);
#EndIf
#IfRow2D list_options list_id race option_id anaktuvuk_pass
UPDATE `list_options` SET `notes` = '1847-3' WHERE `option_id` = 'anaktuvuk_pass' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Anaktuvuk Pass
UPDATE `list_options` SET `notes` = '1847-3' WHERE `title` = 'Anaktuvuk Pass' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id andreafsky title Andreafsky
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','andreafsky','Andreafsky','480', '0',' 1901-8', 0);
#EndIf
#IfRow2D list_options list_id race option_id andreafsky
UPDATE `list_options` SET `notes` = '1901-8' WHERE `option_id` = 'andreafsky' AND `list_id` = 'race';
#EndIf
#IfRow2D list_options list_id race title Andreafsky
UPDATE `list_options` SET `notes` = '1901-8' WHERE `title` = 'Andreafsky' AND `list_id` = 'race';
#EndIf
#IfNotRow2Dx2 list_options list_id race option_id angoon title Angoon
INSERT INTO list_options (list_id, option_id, title, seq, is_default, notes, activity) VALUES ('race','angoon','Angoon','490', '0',' 1814-3', 0);
#EndIf
#IfRow2D list_options list_id race option_id angoon
UPDATE `list_options` SET `notes` = '1814-3' WHERE `option_id` = 'angoon' AND `list_id` = 'race';
#EndIf