INSERT INTO `redcap_projects_templates` (`project_id`, `title`, `description`, `enabled`)
	VALUES (@project_id,  @project_title,  'Nine data entry forms (beginning with a demography form) for collecting data on two different arms (Drug A and Drug B) with each arm containing eight different events.',  '1');
-- SQL TO CREATE A REDCAP DEMO PROJECT --
set @project_title = 'Single Survey';
-- Obtain default values --
set @institution = (select value from redcap_config where field_name = 'institution' limit 1);
set @site_org_type = (select value from redcap_config where field_name = 'site_org_type' limit 1);
set @grant_cite = (select value from redcap_config where field_name = 'grant_cite' limit 1);
set @project_contact_name = (select value from redcap_config where field_name = 'project_contact_name' limit 1);
set @project_contact_email = (select value from redcap_config where field_name = 'project_contact_email' limit 1);
set @headerlogo = (select value from redcap_config where field_name = 'headerlogo' limit 1);
set @auth_meth = (select value from redcap_config where field_name = 'auth_meth_global' limit 1);
-- Create project --
INSERT INTO `redcap_projects`
(project_name, app_title, status, count_project, auth_meth, creation_time, production_time, institution, site_org_type, grant_cite, project_contact_name, project_contact_email, headerlogo, surveys_enabled, auto_inc_set, display_project_logo_institution) VALUES
(concat('redcap_demo_',LEFT(sha1(rand()),6)), @project_title, 1, 0, @auth_meth, now(), now(), @institution, @site_org_type, @grant_cite, @project_contact_name, @project_contact_email, @headerlogo, 1, 1, 0);
set @project_id = LAST_INSERT_ID();
-- Create single arm --
INSERT INTO redcap_events_arms (project_id, arm_num, arm_name) VALUES (@project_id, 1, 'Arm 1');
set @arm_id = LAST_INSERT_ID();
-- Create single event --
INSERT INTO redcap_events_metadata (arm_id, day_offset, offset_min, offset_max, descrip) VALUES (@arm_id, 0, 0, 0, 'Event 1');
set @event_id = LAST_INSERT_ID();
-- Insert into redcap_surveys
INSERT INTO redcap_surveys (project_id, font_family, form_name, title, instructions, acknowledgement, question_by_section, question_auto_numbering, survey_enabled, save_and_return, logo, hide_title) VALUES
(@project_id, '16', 'survey', 'Example Survey', '<p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; text-align: left; line-height: 1.5em; max-width: 700px; clear: both; padding: 0px;">These are your survey instructions that you would enter for your survey participants. You may put whatever text you like here, which may include information about the purpose of the survey, who is taking the survey, or how to take the survey.</p><br><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; text-align: left; line-height: 1.5em; max-width: 700px; clear: both; padding: 0px;">Surveys can use a single survey link for all respondents, which can be posted on a webpage or emailed out from your email application of choice. <strong>By default, all survey responses are collected anonymously</strong> (that is, unless your survey asks for name, email, or other identifying information). If you wish to track individuals who have taken your survey, you may upload a list of email addresses into a Participant List within REDCap, in which you can have REDCap send them an email invitation, which will track if they have taken the survey and when it was taken. This method still collects responses anonymously, but if you wish to identify an individual respondent\'s answers, you may do so by also providing an Identifier in your Participant List. Of course, in that case you may want to inform your respondents in your survey\'s instructions that their responses are not being collected anonymously and can thus be traced back to them.</p>', '<p><strong>Thank you for taking the survey.</strong></p><br><p>Have a nice day!</p>', 0, 0, 1, 1, NULL, 0);
-- Insert into redcap_metadata --
INSERT INTO redcap_metadata (project_id, field_name, field_phi, form_name, form_menu_description, field_order, field_units, element_preceding_header, element_type, element_label, element_enum, element_note, element_validation_type, element_validation_min, element_validation_max, element_validation_checktype, branching_logic, field_req, edoc_id, edoc_display_img, custom_alignment, stop_actions, question_num) VALUES
(@project_id, 'participant_id', NULL, 'survey', 'Example Survey', 1, NULL, NULL, 'text', 'Participant ID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'radio', NULL, 'survey', NULL, 2, NULL, 'Section 1 (This is a section header with descriptive text. It only provides informational text and is used to divide the survey into sections for organization. If the survey is set to be displayed as "one section per page", then these section headers will begin each new page of the survey.)', 'radio', 'You may create MULTIPLE CHOICE questions and set the answer choices for them. You can have as many answer choices as you need. This multiple choice question is rendered as RADIO buttons.', '1, Choice One \\n 2, Choice Two \\n 3, Choice Three \\n 4, Etc.', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'dropdown', NULL, 'survey', NULL, 3, NULL, NULL, 'select', 'You may also set multiple choice questions as DROP-DOWN MENUs.', '1, Choice One \\n 2, Choice Two \\n 3, Choice Three \\n 4, Etc.', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'textbox', NULL, 'survey', NULL, 4, NULL, NULL, 'text', 'This is a TEXT BOX, which allows respondents to enter a small amount of text. A Text Box can be validated, if needed, as a number, integer, phone number, email, or zipcode. If validated as a number or integer, you may also set the minimum and/or maximum allowable values.\n\nThis question has "number" validation set with a minimum of 1 and a maximum of 10. ', NULL, NULL, 'float', '1', '10', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'ma', NULL, 'survey', NULL, 5, NULL, NULL, 'checkbox', 'This type of multiple choice question, known as CHECKBOXES, allows for more than one answer choice to be selected, whereas radio buttons and drop-downs only allow for one choice.', '1, Choice One \\n 2, Choice Two \\n 3, Choice Three \\n 4, Select as many as you like', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'yn', NULL, 'survey', NULL, 6, NULL, NULL, 'yesno', 'You can create YES-NO questions.<br><br>This question has vertical alignment of choices on the right.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'tf', NULL, 'survey', NULL, 7, NULL, NULL, 'truefalse', 'And you can also create TRUE-FALSE questions.<br><br>This question has horizontal alignment.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 'RH', NULL, NULL),
(@project_id, 'date_ymd', NULL, 'survey', NULL, 8, NULL, NULL, 'text', 'DATE questions are also an option. If you click the calendar icon on the right, a pop-up calendar will appear, thus allowing the respondent to easily select a date. Or it can be simply typed in.', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'file', NULL, 'survey', NULL, 9, NULL, NULL, 'file', 'The FILE UPLOAD question type allows respondents to upload any type of document to the survey that you may afterward download and open when viewing your survey results.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'slider', NULL, 'survey', NULL, 10, NULL, NULL, 'slider', 'A SLIDER is a question type that allows the respondent to choose an answer along a continuum. The respondent''s answer is saved as an integer between 0 (far left) and 100 (far right) with a step of 1.', 'You can provide labels above the slider | Middle label | Right-hand label', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'descriptive', NULL, 'survey', NULL, 11, NULL, NULL, 'descriptive', 'You may also use DESCRIPTIVE TEXT to provide informational text within a survey section. ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL);

INSERT INTO redcap_metadata (project_id, field_name, field_phi, form_name, form_menu_description, field_order, field_units, element_preceding_header, element_type, element_label, element_enum, element_note, element_validation_type, element_validation_min, element_validation_max, element_validation_checktype, branching_logic, field_req, edoc_id, edoc_display_img, custom_alignment, stop_actions, question_num, grid_name, misc) VALUES
(@project_id, 'gym', NULL, 'survey', NULL, 11.1, NULL, 'Below is a matrix of checkbox fields. A matrix can also be displayed as radio button fields.', 'checkbox', 'Gym (Weight Training)', '0, Monday \\n 1, Tuesday \\n 2, Wednesday \\n 3, Thursday \\n 4, Friday', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, 'weekly_schedule', NULL),
(@project_id, 'aerobics', NULL, 'survey', NULL, 11.2, NULL, NULL, 'checkbox', 'Aerobics', '0, Monday \\n 1, Tuesday \\n 2, Wednesday \\n 3, Thursday \\n 4, Friday', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, 'weekly_schedule', NULL),
(@project_id, 'eat', NULL, 'survey', NULL, 11.3, NULL, NULL, 'checkbox', 'Eat Out (Dinner/Lunch)', '0, Monday \\n 1, Tuesday \\n 2, Wednesday \\n 3, Thursday \\n 4, Friday', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, 'weekly_schedule', NULL),
(@project_id, 'drink', NULL, 'survey', NULL, 11.4, NULL, NULL, 'checkbox', 'Drink (Alcoholic Beverages)', '0, Monday \\n 1, Tuesday \\n 2, Wednesday \\n 3, Thursday \\n 4, Friday', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, 'weekly_schedule', NULL);

INSERT INTO redcap_metadata (project_id, field_name, field_phi, form_name, form_menu_description, field_order, field_units, element_preceding_header, element_type, element_label, element_enum, element_note, element_validation_type, element_validation_min, element_validation_max, element_validation_checktype, branching_logic, field_req, edoc_id, edoc_display_img, custom_alignment, stop_actions, question_num) VALUES
(@project_id, 'radio_branch', NULL, 'survey', NULL, 12, NULL, 'ADVANCED FEATURES: The questions below will illustrate how some advanced survey features are used.', 'radio', 'BRANCHING LOGIC: The question immediately following this one is using branching logic, which means that the question will stay hidden until defined criteria are specified.\n\nFor example, the following question has been set NOT to appear until the respondent selects the second option to the right.  ', '1, This option does nothing. \\n 2, Clicking this option will trigger the branching logic to reveal the next question. \\n 3, This option also does nothing.', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'hidden_branch', NULL, 'survey', NULL, 13, NULL, NULL, 'text', 'HIDDEN QUESTION: This question will only appear when you select the second option of the question immediately above.', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[radio_branch] = "2"', 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'stop_actions', NULL, 'survey', NULL, 14, NULL, NULL, 'checkbox', 'STOP ACTIONS may be used with any multiple choice question. Stop actions can be applied to any (or all) answer choices. When that answer choice is selected by a respondent, their survey responses are then saved, and the survey is immediately ended.\n\nThe third option to the right has a stop action.', '1, This option does nothing. \\n 2, This option also does nothing. \\n 3, Click here to trigger the stop action and end the survey.', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, '3', NULL),
(@project_id, 'comment_box', NULL, 'survey', NULL, 15, NULL, NULL, 'textarea', 'If you need the respondent to enter a large amount of text, you may use a NOTES BOX.<br><br>This question has also been set as a REQUIRED QUESTION, so the respondent cannot fully submit the survey until this question has been answered. ANY question type can be set to be required.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 'LH', NULL, NULL),
(@project_id, 'survey_complete', NULL, 'survey', NULL, 16, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL);

INSERT INTO `redcap_projects_templates` (`project_id`, `title`, `description`, `enabled`)
	VALUES (@project_id,  @project_title,  'Single data collection instrument enabled as a survey, which contains questions to demonstrate all the different field types.',  '1');
-- SQL TO CREATE A REDCAP DEMO PROJECT --
set @project_title = 'Basic Demography';


-- Obtain default values --
set @institution = (select value from redcap_config where field_name = 'institution' limit 1);
set @site_org_type = (select value from redcap_config where field_name = 'site_org_type' limit 1);
set @grant_cite = (select value from redcap_config where field_name = 'grant_cite' limit 1);
set @project_contact_name = (select value from redcap_config where field_name = 'project_contact_name' limit 1);
set @project_contact_email = (select value from redcap_config where field_name = 'project_contact_email' limit 1);
set @headerlogo = (select value from redcap_config where field_name = 'headerlogo' limit 1);
set @auth_meth = (select value from redcap_config where field_name = 'auth_meth_global' limit 1);
-- Create project --
INSERT INTO `redcap_projects`
(project_name, app_title, status, count_project, auth_meth, creation_time, production_time, institution, site_org_type, grant_cite, project_contact_name, project_contact_email, headerlogo, display_project_logo_institution, auto_inc_set) VALUES
(concat('redcap_demo_',LEFT(sha1(rand()),6)), @project_title, 1, 0, @auth_meth, now(), now(), @institution, @site_org_type, @grant_cite, @project_contact_name, @project_contact_email, @headerlogo, 0, 1);
set @project_id = LAST_INSERT_ID();
-- Create single arm --
INSERT INTO redcap_events_arms (project_id, arm_num, arm_name) VALUES (@project_id, 1, 'Arm 1');
set @arm_id = LAST_INSERT_ID();
-- Create single event --
INSERT INTO redcap_events_metadata (arm_id, day_offset, offset_min, offset_max, descrip) VALUES (@arm_id, 0, 0, 0, 'Event 1');
set @event_id = LAST_INSERT_ID();
-- Insert into redcap_metadata --
INSERT INTO redcap_metadata (project_id, field_name, field_phi, form_name, form_menu_description, field_order, field_units, element_preceding_header, element_type, element_label, element_enum, element_note, element_validation_type, element_validation_min, element_validation_max, element_validation_checktype, branching_logic, field_req, edoc_id, edoc_display_img, custom_alignment, stop_actions, question_num) VALUES
(@project_id, 'record_id', NULL, 'demographics', 'Basic Demography Form', 1, NULL, NULL, 'text', 'Study ID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'first_name', '1', 'demographics', NULL, 3, NULL, 'Contact Information', 'text', 'First Name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'last_name', '1', 'demographics', NULL, 4, NULL, NULL, 'text', 'Last Name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'address', '1', 'demographics', NULL, 5, NULL, NULL, 'textarea', 'Street, City, State, ZIP', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'telephone', '1', 'demographics', NULL, 6, NULL, NULL, 'text', 'Phone number', NULL, 'Include Area Code', 'phone', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'email', '1', 'demographics', NULL, 8, NULL, NULL, 'text', 'E-mail', NULL, NULL, 'email', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'dob', '1', 'demographics', NULL, 8.1, NULL, NULL, 'text', 'Date of birth', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'age', NULL, 'demographics', NULL, 8.2, NULL, NULL, 'calc', 'Age (years)', 'rounddown(datediff([dob],''today'',''y''))', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'ethnicity', NULL, 'demographics', NULL, 9, NULL, NULL, 'radio', 'Ethnicity', '0, Hispanic or Latino \\n 1, NOT Hispanic or Latino \\n 2, Unknown / Not Reported', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 'LH', NULL, NULL),
(@project_id, 'race', NULL, 'demographics', NULL, 10, NULL, NULL, 'select', 'Race', '0, American Indian/Alaska Native \\n 1, Asian \\n 2, Native Hawaiian or Other Pacific Islander \\n 3, Black or African American \\n 4, White \\n 5, More Than One Race \\n 6, Unknown / Not Reported', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'sex', NULL, 'demographics', NULL, 11, NULL, NULL, 'radio', 'sex', '0, Female \\n 1, Male \\n 2, Other \\n 3, Prefer not to say', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'height', NULL, 'demographics', NULL, 19, 'cm', NULL, 'text', 'Height (cm)', NULL, NULL, 'float', '130', '215', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'weight', NULL, 'demographics', NULL, 20, 'kilograms', NULL, 'text', 'Weight (kilograms)', NULL, NULL, 'int', '35', '200', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'bmi', NULL, 'demographics', NULL, 21, 'kilograms', NULL, 'calc', 'BMI', 'round(([weight]*10000)/(([height])^(2)),1)', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'comments', NULL, 'demographics', NULL, 22, NULL, 'General Comments', 'textarea', 'Comments', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'demographics_complete', NULL, 'demographics', NULL, 23, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL);

INSERT INTO `redcap_projects_templates` (`project_id`, `title`, `description`, `enabled`)
	VALUES (@project_id,  @project_title,  'Single data collection instrument to capture basic demographic information.',  '1');
-- SQL TO CREATE A REDCAP DEMO PROJECT --
set @project_title = 'Project Tracking Database';


-- Obtain default values --
set @institution = (select value from redcap_config where field_name = 'institution' limit 1);
set @site_org_type = (select value from redcap_config where field_name = 'site_org_type' limit 1);
set @grant_cite = (select value from redcap_config where field_name = 'grant_cite' limit 1);
set @project_contact_name = (select value from redcap_config where field_name = 'project_contact_name' limit 1);
set @project_contact_email = (select value from redcap_config where field_name = 'project_contact_email' limit 1);
set @headerlogo = (select value from redcap_config where field_name = 'headerlogo' limit 1);
set @auth_meth = (select value from redcap_config where field_name = 'auth_meth_global' limit 1);
-- Create project --
INSERT INTO `redcap_projects`
(project_name, app_title, status, count_project, auth_meth, creation_time, production_time, institution, site_org_type, grant_cite, project_contact_name, project_contact_email, headerlogo, display_project_logo_institution, auto_inc_set) VALUES
(concat('redcap_demo_',LEFT(sha1(rand()),6)), @project_title, 1, 0, @auth_meth, now(), now(), @institution, @site_org_type, @grant_cite, @project_contact_name, @project_contact_email, @headerlogo, 0, 1);
set @project_id = LAST_INSERT_ID();
-- Create single arm --
INSERT INTO redcap_events_arms (project_id, arm_num, arm_name) VALUES (@project_id, 1, 'Arm 1');
set @arm_id = LAST_INSERT_ID();
-- Create single event --
INSERT INTO redcap_events_metadata (arm_id, day_offset, offset_min, offset_max, descrip) VALUES (@arm_id, 0, 0, 0, 'Event 1');
set @event_id = LAST_INSERT_ID();
-- Insert into redcap_metadata --
INSERT INTO redcap_metadata (project_id, field_name, field_phi, form_name, form_menu_description, field_order, field_units, element_preceding_header, element_type, element_label, element_enum, element_note, element_validation_type, element_validation_min, element_validation_max, element_validation_checktype, branching_logic, field_req, edoc_id, edoc_display_img, custom_alignment, stop_actions, question_num, grid_name, misc) VALUES
(@project_id, 'proj_id', NULL, 'project', 'Project', 1, NULL, NULL, 'text', 'Project ID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'title', NULL, 'project', NULL, 2, NULL, 'Demographic Characteristics', 'textarea', 'Project Title', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pi_firstname', NULL, 'project', NULL, 3, NULL, NULL, 'text', 'PI First Name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pi_lastname', NULL, 'project', NULL, 4, NULL, NULL, 'text', 'PI Last Name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pi_vunetid', NULL, 'project', NULL, 5, NULL, NULL, 'text', 'PI VUnetID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'project_type', NULL, 'project', NULL, 6, NULL, NULL, 'select', 'Project Type', '1, Expedited \\n 2, Full Committee \\n 3, Industry only', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'irb_number', NULL, 'project', NULL, 7, NULL, NULL, 'text', 'IRB Number', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'amendment_status', NULL, 'project', NULL, 8, NULL, 'Amendment Information', 'radio', 'Amendment?', '0, No \\n 1, Yes', '', NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'amendment_number', NULL, 'project', NULL, 9, NULL, NULL, 'select', 'Amendment Number', '0 \\n 1 \\n 2 \\n 3 \\n 4 \\n 5 \\n 6 \\n 7 \\n 8 \\n 9 \\n 10 \\n 11 \\n 12 \\n 13 \\n 14 \\n 15 \\n 16 \\n 17 \\n 18 \\n 19 \\n 20', '', NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'crc_type', NULL, 'project', NULL, 10, NULL, 'CRC Legacy System Data', 'select', 'CRC Type', 'A \\n B \\n C \\n D', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'crc_webcamp_import', NULL, 'project', NULL, 11, NULL, NULL, 'select', 'CRC WebCamp Project Import?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'crc_original_review', NULL, 'project', NULL, 12, NULL, NULL, 'select', 'CRC Original Review?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'file_proposal', NULL, 'project', NULL, 13, NULL, 'Project Files', 'file', 'Research Proposal', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'file_budget', NULL, 'project', NULL, 14, NULL, NULL, 'file', 'Budget', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'file_biosketch1', NULL, 'project', NULL, 15, NULL, NULL, 'file', 'Biosketch(1)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'file_biosketch2', NULL, 'project', NULL, 16, NULL, NULL, 'file', 'Biosketch(2)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'file_biosketch3', NULL, 'project', NULL, 17, NULL, NULL, 'file', 'Biosketch(3)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'file_crc', NULL, 'project', NULL, 18, NULL, NULL, 'file', 'CRC Resources', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'file_other1', NULL, 'project', NULL, 19, NULL, NULL, 'file', 'Other(1)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'file_other2', NULL, 'project', NULL, 20, NULL, NULL, 'file', 'Other(2)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'file_other3', NULL, 'project', NULL, 21, NULL, NULL, 'file', 'Other(3)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'project_complete', NULL, 'project', NULL, 22, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'date_receipt', NULL, 'workflow', 'Workflow', 23, NULL, 'Pre-Pre-Review Information', 'text', 'Project Receipt Date', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'date_start_preprereview', NULL, 'workflow', NULL, 24, NULL, NULL, 'text', 'Pre-Pre-Review - Start Date', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'date_stop_preprereview', NULL, 'workflow', NULL, 25, NULL, NULL, 'text', 'Pre-Pre-Review - Stop Date', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'comments_preprereview', NULL, 'workflow', NULL, 26, NULL, NULL, 'textarea', 'Comments - Pre-Pre-Review', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'owner_prepreview', NULL, 'workflow', NULL, 27, NULL, NULL, 'select', 'Owner (Liaison)', '0, Shraddha \\n 1, Jennifer \\n 2, Terri \\n 3, Cheryl \\n 4, Lynda', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'date_start_prereview', NULL, 'workflow', NULL, 28, NULL, 'Pre-Review Information', 'text', 'Pre-Review Notification Date', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'date_stop_prereview', NULL, 'workflow', NULL, 29, NULL, NULL, 'text', 'Pre-Review Completion Date', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'comments_prereview', NULL, 'workflow', NULL, 30, NULL, NULL, 'textarea', 'Comments - Pre-Review', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'date_pi_notification', NULL, 'workflow', NULL, 31, NULL, 'PI Notification Information', 'text', 'PI Notification Date', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'date_pi_response', NULL, 'workflow', NULL, 32, NULL, NULL, 'text', 'PI Response Date', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'comments_pi_response', NULL, 'workflow', NULL, 33, NULL, NULL, 'textarea', 'Comments - PI Process', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'file_pi_comments', NULL, 'workflow', NULL, 34, NULL, NULL, 'file', 'PI response', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'date_agenda', NULL, 'workflow', NULL, 35, NULL, 'Agenda Information', 'text', 'Agenda Date', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'rev1_name', NULL, 'workflow', NULL, 36, NULL, NULL, 'text', 'Reviewer 1', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'rev2_name', NULL, 'workflow', NULL, 37, NULL, NULL, 'text', 'Reviewer 2', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'rev_notification_date', NULL, 'workflow', NULL, 38, NULL, NULL, 'text', 'Date - Sent to Reviewers', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'src_notification_date', NULL, 'workflow', NULL, 39, NULL, NULL, 'text', 'Date- Sent to SRC', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'status_src_award', NULL, 'workflow', NULL, 40, NULL, NULL, 'select', 'SRC Award Status', '0, Approved \\n 1, Pending \\n 2, Deferred (Studio) \\n 3, Disapproved \\n 4, Tabled \\n 5, Withdrawn', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'src_priority_score', NULL, 'workflow', NULL, 41, NULL, NULL, 'text', 'SRC Priority Score', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'workflow_complete', NULL, 'workflow', NULL, 42, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'needs_administrative', NULL, 'prereview_administrative', 'Pre-Review Administrative', 43, NULL, NULL, 'select', 'Requires Administrative?', '0, Yes \\n 1, No', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_administrative', NULL, 'prereview_administrative', NULL, 44, NULL, 'Enter PI Pre-Review Notes Or Attach File', 'textarea', 'Notes', NULL, NULL, NULL, NULL, NULL, NULL, '[needs_administrative] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_administrative_doc', NULL, 'prereview_administrative', NULL, 45, NULL, NULL, 'file', 'OR File<br><font size=1>(NOTE: If file will not open, then Save it to your computer and then Open it.)</font>', NULL, NULL, NULL, NULL, NULL, NULL, '[needs_administrative] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_administrative_date_sent', NULL, 'prereview_administrative', NULL, 46, NULL, NULL, 'text', 'Date Sent for pre-review', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_administrative_date_received', NULL, 'prereview_administrative', NULL, 47, NULL, NULL, 'text', 'Date received', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_administrative_complete', NULL, 'prereview_administrative', NULL, 48, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'needs_biostatistics', NULL, 'prereview_biostatistics', 'Pre-Review Biostatistics', 49, NULL, NULL, 'select', 'Requires Biostatistics?', '0, Yes \\n 1, No', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_biostatistics', NULL, 'prereview_biostatistics', NULL, 50, NULL, 'Enter Pre-Review Notes Or Attach File', 'textarea', 'PI Suggestions', NULL, NULL, NULL, NULL, NULL, NULL, '[needs_biostatistics] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_biostatistics_doc', NULL, 'prereview_biostatistics', NULL, 51, NULL, NULL, 'file', 'OR File<br><font size=1>(NOTE: If file will not open, then Save it to your computer and then Open it.)</font>', NULL, NULL, NULL, NULL, NULL, NULL, '[needs_biostatistics] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_biostatistics_date_sent', NULL, 'prereview_biostatistics', NULL, 52, NULL, NULL, 'text', 'Date Sent for pre-review', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_biostatistics_date_received', NULL, 'prereview_biostatistics', NULL, 53, NULL, NULL, 'text', 'Date received', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_biostatistics_hours_awarded', NULL, 'prereview_biostatistics', NULL, 54, NULL, 'Biostatistics Award', 'text', 'Consultation Hours Awarded', NULL, NULL, 'float', '0', '5000', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_biostatistics_complete', NULL, 'prereview_biostatistics', NULL, 55, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'needs_scientific', NULL, 'prereview_scientific', 'Pre-Review Scientific', 56, NULL, NULL, 'select', 'Requires Scientific?', '0, Yes \\n 1, No', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_scientific', NULL, 'prereview_scientific', NULL, 57, NULL, 'Enter Pre-Review Notes Or Attach File', 'textarea', 'PI Suggestions', NULL, NULL, NULL, NULL, NULL, NULL, '[needs_scientific] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_scientific_doc', NULL, 'prereview_scientific', NULL, 58, NULL, NULL, 'file', 'OR File<br><font size=1>(NOTE: If file will not open, then Save it to your computer and then Open it.)</font>', NULL, NULL, NULL, NULL, NULL, NULL, '[needs_scientific] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_scientific_date_sent', NULL, 'prereview_scientific', NULL, 59, NULL, NULL, 'text', 'Date Sent for pre-review', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_scientific_date_received', NULL, 'prereview_scientific', NULL, 60, NULL, NULL, 'text', 'Date received', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_scientific_complete', NULL, 'prereview_scientific', NULL, 61, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'needs_participant', NULL, 'prereview_participant', 'Pre-Review Participant', 62, NULL, NULL, 'select', 'Requires Participant?', '0, Yes \\n 1, No', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_participant', NULL, 'prereview_participant', NULL, 63, NULL, 'Enter Pre-Review Notes Or Attach File', 'textarea', 'PI Suggestions', NULL, NULL, NULL, NULL, NULL, NULL, '[needs_participant] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_participant_doc', NULL, 'prereview_participant', NULL, 64, NULL, NULL, 'file', 'OR File<br><font size=1>(NOTE: If file will not open, then Save it to your computer and then Open it.)</font>', NULL, NULL, NULL, NULL, NULL, NULL, '[needs_participant] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_participant_date_sent', NULL, 'prereview_participant', NULL, 65, NULL, NULL, 'text', 'Date Sent for pre-review', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_participant_date_received', NULL, 'prereview_participant', NULL, 66, NULL, NULL, 'text', 'Date received', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_participant_complete', NULL, 'prereview_participant', NULL, 67, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'needs_budget', NULL, 'prereview_budget', 'Pre-Review Budget', 68, NULL, NULL, 'select', 'Requires Budget?', '0, Yes \\n 1, No', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_budget', NULL, 'prereview_budget', NULL, 69, NULL, 'Enter Pre-Review Notes Or Attach File', 'textarea', 'PI Suggestions', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_budget_doc', NULL, 'prereview_budget', NULL, 70, NULL, NULL, 'file', 'OR File<br><font size=1>(NOTE: If file will not open, then Save it to your computer and then Open it.)</font>', NULL, NULL, NULL, NULL, NULL, NULL, '[needs_budget] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_budget_date_sent', NULL, 'prereview_budget', NULL, 71, NULL, NULL, 'text', 'Date Sent for pre-review', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', '[needs_budget] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_budget_date_received', NULL, 'prereview_budget', NULL, 72, NULL, NULL, 'text', 'Date received', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_budget_complete', NULL, 'prereview_budget', NULL, 73, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'needs_nursing', NULL, 'prereview_nursing', 'Pre-Review Nursing', 74, NULL, NULL, 'select', 'Requires Nursing?', '0, Yes \\n 1, No', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_nursing', NULL, 'prereview_nursing', NULL, 75, NULL, 'Enter Pre-Review Notes Or Attach File', 'textarea', 'PI Suggestions', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_nursing_doc', NULL, 'prereview_nursing', NULL, 76, NULL, NULL, 'file', 'OR File<br><font size=1>(NOTE: If file will not open, then Save it to your computer and then Open it.)</font>', NULL, NULL, NULL, NULL, NULL, NULL, '[needs_nursing] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_nursing_date_sent', NULL, 'prereview_nursing', NULL, 77, NULL, NULL, 'text', 'Date Sent for pre-review', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', '[needs_nursing] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_nursing_date_received', NULL, 'prereview_nursing', NULL, 78, NULL, NULL, 'text', 'Date received', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_nursing_complete', NULL, 'prereview_nursing', NULL, 79, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'needs_cores', NULL, 'prereview_cores', 'Pre-Review Cores', 80, NULL, NULL, 'select', 'Requires Cores?', '0, Yes \\n 1, No', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_cores', NULL, 'prereview_cores', NULL, 81, NULL, 'Enter Pre-Review Notes Or Attach File', 'textarea', 'PI Suggestions', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_cores_doc', NULL, 'prereview_cores', NULL, 82, NULL, NULL, 'file', 'OR File<br><font size=1>(NOTE: If file will not open, then Save it to your computer and then Open it.)</font>', NULL, NULL, NULL, NULL, NULL, NULL, '[needs_cores] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_cores_date_sent', NULL, 'prereview_cores', NULL, 83, NULL, NULL, 'text', 'Date Sent for pre-review', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', '[needs_cores] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_cores_date_received', NULL, 'prereview_cores', NULL, 84, NULL, NULL, 'text', 'Date received', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_cores_complete', NULL, 'prereview_cores', NULL, 85, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'needs_sleep', NULL, 'prereview_sleep', 'Pre-Review Sleep', 86, NULL, NULL, 'select', 'Requires Sleep?', '0, Yes \\n 1, No', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_sleep', NULL, 'prereview_sleep', NULL, 87, NULL, 'Enter Pre-Review Notes Or Attach File', 'textarea', 'PI Suggestions', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_sleep_doc', NULL, 'prereview_sleep', NULL, 88, NULL, NULL, 'file', 'OR File<br><font size=1>(NOTE: If file will not open, then Save it to your computer and then Open it.)</font>', NULL, NULL, NULL, NULL, NULL, NULL, '[needs_sleep] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_sleep_date_sent', NULL, 'prereview_sleep', NULL, 89, NULL, NULL, 'text', 'Date Sent for pre-review', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', '[needs_sleep] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_sleep_date_received', NULL, 'prereview_sleep', NULL, 90, NULL, NULL, 'text', 'Date received', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_sleep_complete', NULL, 'prereview_sleep', NULL, 91, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'needs_nutrition', NULL, 'prereview_nutrition', 'Pre-Review Nutrition', 92, NULL, NULL, 'select', 'Requires Nutrition?', '0, Yes \\n 1, No', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_nutrition', NULL, 'prereview_nutrition', NULL, 93, NULL, 'Enter Pre-Review Notes Or Attach File', 'textarea', 'PI Suggestions', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_nutrition_doc', NULL, 'prereview_nutrition', NULL, 94, NULL, NULL, 'file', 'OR File<br><font size=1>(NOTE: If file will not open, then Save it to your computer and then Open it.)</font>', NULL, NULL, NULL, NULL, NULL, NULL, '[needs_nutrition] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_nutrition_date_sent', NULL, 'prereview_nutrition', NULL, 95, NULL, NULL, 'text', 'Date Sent for pre-review', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', '[needs_nutrition] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_nutrition_date_received', NULL, 'prereview_nutrition', NULL, 96, NULL, NULL, 'text', 'Date received', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_nutrition_complete', NULL, 'prereview_nutrition', NULL, 97, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'needs_community', NULL, 'prereview_community', 'Pre-Review Community', 98, NULL, NULL, 'select', 'Requires Community?', '0, Yes \\n 1, No', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_community', NULL, 'prereview_community', NULL, 99, NULL, 'Enter Pre-Review Notes Or Attach File', 'textarea', 'PI Suggestions', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_community_doc', NULL, 'prereview_community', NULL, 100, NULL, NULL, 'file', 'OR File<br><font size=1>(NOTE: If file will not open, then Save it to your computer and then Open it.)</font>', NULL, NULL, NULL, NULL, NULL, NULL, '[needs_community] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_community_date_sent', NULL, 'prereview_community', NULL, 101, NULL, NULL, 'text', 'Date Sent for pre-review', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', '[needs_community] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_community_date_received', NULL, 'prereview_community', NULL, 102, NULL, NULL, 'text', 'Date received', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_community_complete', NULL, 'prereview_community', NULL, 103, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'needs_other', NULL, 'prereview_ctc', 'Pre-Review CTC', 104, NULL, NULL, 'select', 'Requires Other?', '0, Yes \\n 1, No', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_other', NULL, 'prereview_ctc', NULL, 105, NULL, 'Enter Pre-Review Notes Or Attach File', 'textarea', 'PI Suggestions', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_other_doc', NULL, 'prereview_ctc', NULL, 106, NULL, NULL, 'file', 'OR File<br><font size=1>(NOTE: If file will not open, then Save it to your computer and then Open it.)</font>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_other_date_sent', NULL, 'prereview_ctc', NULL, 107, NULL, NULL, 'text', 'Date Sent for pre-review', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_other_date_received', NULL, 'prereview_ctc', NULL, 108, NULL, NULL, 'text', 'Date received', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_ctc_complete', NULL, 'prereview_ctc', NULL, 109, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'needs_pi_response', NULL, 'prereview_pi_response', 'Pre-Review PI Response', 110, NULL, NULL, 'select', 'Requires PI Response?', '0, Yes \\n 1, No', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_pi_response', NULL, 'prereview_pi_response', NULL, 111, NULL, 'Enter Pre-Review Notes Or Attach File', 'textarea', 'PI response', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_pi_response_doc', NULL, 'prereview_pi_response', NULL, 112, NULL, NULL, 'file', 'OR File<br><font size=1>(NOTE: If file will not open, then Save it to your computer and then Open it.)</font>', NULL, NULL, NULL, NULL, NULL, NULL, '[needs_pi_response] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_pi_response_date_sent', NULL, 'prereview_pi_response', NULL, 113, NULL, NULL, 'text', 'Date Sent for pre-review', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_pi_response_date_received', NULL, 'prereview_pi_response', NULL, 114, NULL, NULL, 'text', 'Date received', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prereview_pi_response_complete', NULL, 'prereview_pi_response', NULL, 115, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'src_percent_funded', NULL, 'post_award_administration', 'Post-Award Administration', 116, NULL, 'Post-Award Administration', 'text', 'Percent of request funded (%)', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'src_total_award_amount', NULL, 'post_award_administration', NULL, 117, NULL, NULL, 'text', 'SRC Total Award Amount ($)', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'src_letter_date', NULL, 'post_award_administration', NULL, 118, NULL, NULL, 'text', 'SRC letter sent', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'src_letter_document', NULL, 'post_award_administration', NULL, 119, NULL, NULL, 'file', 'SRC letter', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'src_project_ending', NULL, 'post_award_administration', NULL, 120, NULL, NULL, 'text', 'SRC project ending date', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'src_full_project_period', NULL, 'post_award_administration', NULL, 121, NULL, NULL, 'text', 'SRC full project period', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'src_center_number', NULL, 'post_award_administration', NULL, 122, NULL, NULL, 'text', 'SRC Center Number - Institutional', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'src_center_number_ctsa', NULL, 'post_award_administration', NULL, 123, NULL, NULL, 'text', 'SRC Center Number - CTSA', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'src_center_number_crc', NULL, 'post_award_administration', NULL, 124, NULL, NULL, 'text', 'SRC Center Number - CRC', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'src_center_number_dh', NULL, 'post_award_administration', NULL, 125, NULL, NULL, 'text', 'D & H Number', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'comments_src', NULL, 'post_award_administration', NULL, 126, NULL, NULL, 'textarea', 'Comments - SRC Award', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'crc_facilities', NULL, 'post_award_administration', NULL, 127, NULL, NULL, 'text', 'CRC Facilities ($)', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'crc_personnel', NULL, 'post_award_administration', NULL, 128, NULL, NULL, 'text', 'CRC Nursing ($)', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'crc_cores', NULL, 'post_award_administration', NULL, 129, NULL, NULL, 'text', 'CRC Cores ($)', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'sleep_cores', NULL, 'post_award_administration', NULL, 130, NULL, NULL, 'text', 'Sleep Core ($)', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'vumc_core_facilities', NULL, 'post_award_administration', NULL, 131, NULL, NULL, 'text', 'VUMC Core Facilities ($)', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'personnel', NULL, 'post_award_administration', NULL, 132, NULL, NULL, 'text', 'Personnel ($)', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'equipment', NULL, 'post_award_administration', NULL, 133, NULL, NULL, 'text', 'Equipment ($)', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'misc_services', NULL, 'post_award_administration', NULL, 134, NULL, NULL, 'text', 'Misc. Services ($)', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'hospital_ancillaries', NULL, 'post_award_administration', NULL, 135, NULL, NULL, 'text', 'Hospital Ancillaries ($)', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'victr_status', NULL, 'post_award_administration', NULL, 136, NULL, NULL, 'radio', 'VICTR Status', '0, Inactive \\n 1, Active', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'src_project_completion', NULL, 'post_award_administration', NULL, 137, NULL, NULL, 'text', 'SRC completion date', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'post_award_administration_complete', NULL, 'post_award_administration', NULL, 138, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL);

INSERT INTO `redcap_projects_templates` (`project_id`, `title`, `description`, `enabled`)
	VALUES (@project_id,  @project_title,  'Fifteen data entry forms dedicated to recording the attributes of and tracking and progress of projects/studies.',  '1');
-- SQL TO CREATE A REDCAP DEMO PROJECT --
set @project_title = 'Randomized Clinical Trial';


-- Obtain default values --
set @institution = (select value from redcap_config where field_name = 'institution' limit 1);
set @site_org_type = (select value from redcap_config where field_name = 'site_org_type' limit 1);
set @grant_cite = (select value from redcap_config where field_name = 'grant_cite' limit 1);
set @project_contact_name = (select value from redcap_config where field_name = 'project_contact_name' limit 1);
set @project_contact_email = (select value from redcap_config where field_name = 'project_contact_email' limit 1);
set @headerlogo = (select value from redcap_config where field_name = 'headerlogo' limit 1);
set @auth_meth = (select value from redcap_config where field_name = 'auth_meth_global' limit 1);
-- Create project --
INSERT INTO `redcap_projects`
(project_name, app_title, status, count_project, auth_meth, creation_time, production_time, institution, site_org_type, grant_cite, project_contact_name, project_contact_email, headerlogo, display_project_logo_institution, randomization, auto_inc_set) VALUES
(concat('redcap_demo_',LEFT(sha1(rand()),6)), @project_title, 1, 0, @auth_meth, now(), now(), @institution, @site_org_type, @grant_cite, @project_contact_name, @project_contact_email, @headerlogo, 0, 1, 1);
set @project_id = LAST_INSERT_ID();
-- Create single arm --
INSERT INTO redcap_events_arms (project_id, arm_num, arm_name) VALUES (@project_id, 1, 'Arm 1');
set @arm_id = LAST_INSERT_ID();
-- Create single event --
INSERT INTO redcap_events_metadata (arm_id, day_offset, offset_min, offset_max, descrip) VALUES (@arm_id, 0, 0, 0, 'Event 1');
set @event_id = LAST_INSERT_ID();
-- Insert randomization row
INSERT INTO redcap_randomization (project_id, stratified, group_by, target_field, target_event, source_field1, source_event1, source_field2, source_event2, source_field3, source_event3, source_field4, source_event4, source_field5, source_event5, source_field6, source_event6, source_field7, source_event7, source_field8, source_event8, source_field9, source_event9, source_field10, source_event10, source_field11, source_event11, source_field12, source_event12, source_field13, source_event13, source_field14, source_event14, source_field15, source_event15) VALUES
(@project_id, 1, NULL, 'randomization_group', NULL, 'race', @event_id, 'sex', @event_id, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
-- Insert into redcap_metadata --
INSERT INTO redcap_metadata (project_id, field_name, field_phi, form_name, form_menu_description, field_order, field_units, element_preceding_header, element_type, element_label, element_enum, element_note, element_validation_type, element_validation_min, element_validation_max, element_validation_checktype, branching_logic, field_req, edoc_id, edoc_display_img, custom_alignment, stop_actions, question_num) VALUES
(@project_id, 'study_id', NULL, 'demographics', 'Demographics', 1, NULL, NULL, 'text', 'Study ID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'date_enrolled', NULL, 'demographics', NULL, 2, NULL, 'Consent Information', 'text', 'Date subject signed consent', NULL, 'YYYY-MM-DD', 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'first_name', '1', 'demographics', NULL, 3, NULL, 'Contact Information', 'text', 'First Name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'last_name', '1', 'demographics', NULL, 4, NULL, NULL, 'text', 'Last Name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'dob', '1', 'demographics', NULL, 8.1, NULL, NULL, 'text', 'Date of birth', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'ethnicity', NULL, 'demographics', NULL, 9, NULL, NULL, 'radio', 'Ethnicity', '0, Hispanic or Latino \\n 1, NOT Hispanic or Latino \\n 2, Unknown / Not Reported', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 'LH', NULL, NULL),
(@project_id, 'race', NULL, 'demographics', NULL, 10, NULL, NULL, 'select', 'Race', '0, American Indian/Alaska Native \\n 1, Asian \\n 2, Native Hawaiian or Other Pacific Islander \\n 3, Black or African American \\n 4, White \\n 5, More Than One Race \\n 6, Unknown / Not Reported', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'sex', NULL, 'demographics', NULL, 11, NULL, NULL, 'radio', 'sex', '0, Female \\n 1, Male \\n 2, Other \\n 3, Prefer not to say', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'demographics_complete', NULL, 'demographics', NULL, 23, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),

(@project_id, 'randomization_group', NULL, 'randomization_form', 'Randomization Form', 23.1, NULL, 'General Comments', 'select', 'Randomization Group', '0, Drug A \\n 1, Drug B \\n 2, Drug C', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'randomization_form_complete', NULL, 'randomization_form', NULL, 23.2, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),


(@project_id, 'date_visit_b', NULL, 'baseline_data', 'Baseline Data', 24, NULL, 'Baseline Measurements', 'text', 'Date of baseline visit', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'date_blood_b', NULL, 'baseline_data', NULL, 25, NULL, NULL, 'text', 'Date blood was drawn', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'alb_b', NULL, 'baseline_data', NULL, 26, 'g/dL', NULL, 'text', 'Serum Albumin (g/dL)', NULL, NULL, 'int', '3', '5', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'prealb_b', NULL, 'baseline_data', NULL, 27, 'mg/dL', NULL, 'text', 'Serum Prealbumin (mg/dL)', NULL, NULL, 'float', '10', '40', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'creat_b', NULL, 'baseline_data', NULL, 28, 'mg/dL', NULL, 'text', 'Creatinine (mg/dL)', NULL, NULL, 'float', '0.5', '20', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'npcr_b', NULL, 'baseline_data', NULL, 29, 'g/kg/d', NULL, 'text', 'Normalized Protein Catabolic Rate (g/kg/d)', NULL, NULL, 'float', '0.5', '2', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'chol_b', NULL, 'baseline_data', NULL, 30, 'mg/dL', NULL, 'text', 'Cholesterol (mg/dL)', NULL, NULL, 'float', '100', '300', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'transferrin_b', NULL, 'baseline_data', NULL, 31, 'mg/dL', NULL, 'text', 'Transferrin (mg/dL)', NULL, NULL, 'float', '100', '300', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'kt_v_b', NULL, 'baseline_data', NULL, 32, NULL, NULL, 'text', 'Kt/V', NULL, NULL, 'float', '0.9', '3', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'drywt_b', NULL, 'baseline_data', NULL, 33, 'kilograms', NULL, 'text', 'Dry weight (kilograms)', NULL, NULL, 'float', '35', '200', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'plasma1_b', NULL, 'baseline_data', NULL, 34, NULL, NULL, 'select', 'Collected Plasma 1?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'plasma2_b', NULL, 'baseline_data', NULL, 35, NULL, NULL, 'select', 'Collected Plasma 2?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'plasma3_b', NULL, 'baseline_data', NULL, 36, NULL, NULL, 'select', 'Collected Plasma 3?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'serum1_b', NULL, 'baseline_data', NULL, 37, NULL, NULL, 'select', 'Collected Serum 1?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'serum2_b', NULL, 'baseline_data', NULL, 38, NULL, NULL, 'select', 'Collected Serum 2?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'serum3_b', NULL, 'baseline_data', NULL, 39, NULL, NULL, 'select', 'Collected Serum 3?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'sga_b', NULL, 'baseline_data', NULL, 40, NULL, NULL, 'text', 'Subject Global Assessment (score = 1-7)', NULL, NULL, 'float', '0.9', '7.1', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'date_supplement_dispensed', NULL, 'baseline_data', NULL, 41, NULL, NULL, 'text', 'Date patient begins supplement', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'baseline_data_complete', NULL, 'baseline_data', NULL, 42, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'date_visit_1', NULL, 'month_1_data', 'Month 1 Data', 43, NULL, 'Month 1', 'text', 'Date of Month 1 visit', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'alb_1', NULL, 'month_1_data', NULL, 44, 'g/dL', NULL, 'text', 'Serum Albumin (g/dL)', NULL, NULL, 'float', '3', '5', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'prealb_1', NULL, 'month_1_data', NULL, 45, 'mg/dL', NULL, 'text', 'Serum Prealbumin (mg/dL)', NULL, NULL, 'float', '10', '40', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'creat_1', NULL, 'month_1_data', NULL, 46, 'mg/dL', NULL, 'text', 'Creatinine (mg/dL)', NULL, NULL, 'float', '0.5', '20', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'npcr_1', NULL, 'month_1_data', NULL, 47, 'g/kg/d', NULL, 'text', 'Normalized Protein Catabolic Rate (g/kg/d)', NULL, NULL, 'float', '0.5', '2', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'chol_1', NULL, 'month_1_data', NULL, 48, 'mg/dL', NULL, 'text', 'Cholesterol (mg/dL)', NULL, NULL, 'float', '100', '300', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'transferrin_1', NULL, 'month_1_data', NULL, 49, 'mg/dL', NULL, 'text', 'Transferrin (mg/dL)', NULL, NULL, 'float', '100', '300', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'kt_v_1', NULL, 'month_1_data', NULL, 50, NULL, NULL, 'text', 'Kt/V', NULL, NULL, 'float', '0.9', '3', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'drywt_1', NULL, 'month_1_data', NULL, 51, 'kilograms', NULL, 'text', 'Dry weight (kilograms)', NULL, NULL, 'float', '35', '200', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'no_show_1', NULL, 'month_1_data', NULL, 52, NULL, NULL, 'text', 'Number of treatments missed', NULL, NULL, 'float', '0', '7', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'compliance_1', NULL, 'month_1_data', NULL, 53, NULL, NULL, 'select', 'How compliant was the patient in drinking the supplement?', '0, 100 percent \\n 1, 99-75 percent \\n 2, 74-50 percent \\n 3, 49-25 percent \\n 4, 0-24 percent', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'hospit_1', NULL, 'month_1_data', NULL, 54, NULL, 'Hospitalization Data', 'select', 'Was patient hospitalized since last visit?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'cause_hosp_1', NULL, 'month_1_data', NULL, 55, NULL, NULL, 'select', 'What was the cause of hospitalization?', '1, Vascular access related events \\n 2, CVD events \\n 3, Other', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'admission_date_1', NULL, 'month_1_data', NULL, 56, NULL, NULL, 'text', 'Date of hospital admission', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'discharge_date_1', NULL, 'month_1_data', NULL, 57, NULL, NULL, 'text', 'Date of hospital discharge', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'discharge_summary_1', NULL, 'month_1_data', NULL, 58, NULL, NULL, 'select', 'Discharge summary in patients binder?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'death_1', NULL, 'month_1_data', NULL, 59, NULL, 'Mortality Data', 'select', 'Has patient died since last visit?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'date_death_1', NULL, 'month_1_data', NULL, 60, NULL, NULL, 'text', 'Date of death', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'cause_death_1', NULL, 'month_1_data', NULL, 61, NULL, NULL, 'select', 'What was the cause of death?', '1, All-cause \\n 2, Cardiovascular', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'month_1_data_complete', NULL, 'month_1_data', NULL, 62, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'date_visit_2', NULL, 'month_2_data', 'Month 2 Data', 63, NULL, 'Month 2', 'text', 'Date of Month 2 visit', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'alb_2', NULL, 'month_2_data', NULL, 64, 'g/dL', NULL, 'text', 'Serum Albumin (g/dL)', NULL, NULL, 'float', '3', '5', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'prealb_2', NULL, 'month_2_data', NULL, 65, 'mg/dL', NULL, 'text', 'Serum Prealbumin (mg/dL)', NULL, NULL, 'float', '10', '40', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'creat_2', NULL, 'month_2_data', NULL, 66, 'mg/dL', NULL, 'text', 'Creatinine (mg/dL)', NULL, NULL, 'float', '0.5', '20', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'npcr_2', NULL, 'month_2_data', NULL, 67, 'g/kg/d', NULL, 'text', 'Normalized Protein Catabolic Rate (g/kg/d)', NULL, NULL, 'float', '0.5', '2', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'chol_2', NULL, 'month_2_data', NULL, 68, 'mg/dL', NULL, 'text', 'Cholesterol (mg/dL)', NULL, NULL, 'float', '100', '300', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'transferrin_2', NULL, 'month_2_data', NULL, 69, 'mg/dL', NULL, 'text', 'Transferrin (mg/dL)', NULL, NULL, 'float', '100', '300', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'kt_v_2', NULL, 'month_2_data', NULL, 70, NULL, NULL, 'text', 'Kt/V', NULL, NULL, 'float', '0.9', '3', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'drywt_2', NULL, 'month_2_data', NULL, 71, 'kilograms', NULL, 'text', 'Dry weight (kilograms)', NULL, NULL, 'float', '35', '200', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'no_show_2', NULL, 'month_2_data', NULL, 72, NULL, NULL, 'text', 'Number of treatments missed', NULL, NULL, 'float', '0', '7', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'compliance_2', NULL, 'month_2_data', NULL, 73, NULL, NULL, 'select', 'How compliant was the patient in drinking the supplement?', '0, 100 percent \\n 1, 99-75 percent \\n 2, 74-50 percent \\n 3, 49-25 percent \\n 4, 0-24 percent', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'hospit_2', NULL, 'month_2_data', NULL, 74, NULL, 'Hospitalization Data', 'select', 'Was patient hospitalized since last visit?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'cause_hosp_2', NULL, 'month_2_data', NULL, 75, NULL, NULL, 'select', 'What was the cause of hospitalization?', '1, Vascular access related events \\n 2, CVD events \\n 3, Other', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'admission_date_2', NULL, 'month_2_data', NULL, 76, NULL, NULL, 'text', 'Date of hospital admission', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'discharge_date_2', NULL, 'month_2_data', NULL, 77, NULL, NULL, 'text', 'Date of hospital discharge', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'discharge_summary_2', NULL, 'month_2_data', NULL, 78, NULL, NULL, 'select', 'Discharge summary in patients binder?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'death_2', NULL, 'month_2_data', NULL, 79, NULL, 'Mortality Data', 'select', 'Has patient died since last visit?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'date_death_2', NULL, 'month_2_data', NULL, 80, NULL, NULL, 'text', 'Date of death', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'cause_death_2', NULL, 'month_2_data', NULL, 81, NULL, NULL, 'select', 'What was the cause of death?', '1, All-cause \\n 2, Cardiovascular', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'month_2_data_complete', NULL, 'month_2_data', NULL, 82, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'date_visit_3', NULL, 'month_3_data', 'Month 3 Data', 83, NULL, 'Month 3', 'text', 'Date of Month 3 visit', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'date_blood_3', NULL, 'month_3_data', NULL, 84, NULL, NULL, 'text', 'Date blood was drawn', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'alb_3', NULL, 'month_3_data', NULL, 85, 'g/dL', NULL, 'text', 'Serum Albumin (g/dL)', NULL, NULL, 'float', '3', '5', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'prealb_3', NULL, 'month_3_data', NULL, 86, 'mg/dL', NULL, 'text', 'Serum Prealbumin (mg/dL)', NULL, NULL, 'float', '10', '40', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'creat_3', NULL, 'month_3_data', NULL, 87, 'mg/dL', NULL, 'text', 'Creatinine (mg/dL)', NULL, NULL, 'float', '0.5', '20', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'npcr_3', NULL, 'month_3_data', NULL, 88, 'g/kg/d', NULL, 'text', 'Normalized Protein Catabolic Rate (g/kg/d)', NULL, NULL, 'float', '0.5', '2', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'chol_3', NULL, 'month_3_data', NULL, 89, 'mg/dL', NULL, 'text', 'Cholesterol (mg/dL)', NULL, NULL, 'float', '100', '300', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'transferrin_3', NULL, 'month_3_data', NULL, 90, 'mg/dL', NULL, 'text', 'Transferrin (mg/dL)', NULL, NULL, 'float', '100', '300', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'kt_v_3', NULL, 'month_3_data', NULL, 91, NULL, NULL, 'text', 'Kt/V', NULL, NULL, 'float', '0.9', '3', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'drywt_3', NULL, 'month_3_data', NULL, 92, 'kilograms', NULL, 'text', 'Dry weight (kilograms)', NULL, NULL, 'float', '35', '200', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'plasma1_3', NULL, 'month_3_data', NULL, 93, NULL, NULL, 'select', 'Collected Plasma 1?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'plasma2_3', NULL, 'month_3_data', NULL, 94, NULL, NULL, 'select', 'Collected Plasma 2?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'plasma3_3', NULL, 'month_3_data', NULL, 95, NULL, NULL, 'select', 'Collected Plasma 3?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'serum1_3', NULL, 'month_3_data', NULL, 96, NULL, NULL, 'select', 'Collected Serum 1?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'serum2_3', NULL, 'month_3_data', NULL, 97, NULL, NULL, 'select', 'Collected Serum 2?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'serum3_3', NULL, 'month_3_data', NULL, 98, NULL, NULL, 'select', 'Collected Serum 3?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'sga_3', NULL, 'month_3_data', NULL, 99, NULL, NULL, 'text', 'Subject Global Assessment (score = 1-7)', NULL, NULL, 'float', '0.9', '7.1', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'no_show_3', NULL, 'month_3_data', NULL, 100, NULL, NULL, 'text', 'Number of treatments missed', NULL, NULL, 'float', '0', '7', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'compliance_3', NULL, 'month_3_data', NULL, 101, NULL, NULL, 'select', 'How compliant was the patient in drinking the supplement?', '0, 100 percent \\n 1, 99-75 percent \\n 2, 74-50 percent \\n 3, 49-25 percent \\n 4, 0-24 percent', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'hospit_3', NULL, 'month_3_data', NULL, 102, NULL, 'Hospitalization Data', 'select', 'Was patient hospitalized since last visit?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'cause_hosp_3', NULL, 'month_3_data', NULL, 103, NULL, NULL, 'select', 'What was the cause of hospitalization?', '1, Vascular access related events \\n 2, CVD events \\n 3, Other', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'admission_date_3', NULL, 'month_3_data', NULL, 104, NULL, NULL, 'text', 'Date of hospital admission', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'discharge_date_3', NULL, 'month_3_data', NULL, 105, NULL, NULL, 'text', 'Date of hospital discharge', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'discharge_summary_3', NULL, 'month_3_data', NULL, 106, NULL, NULL, 'select', 'Discharge summary in patients binder?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'death_3', NULL, 'month_3_data', NULL, 107, NULL, 'Mortality Data', 'select', 'Has patient died since last visit?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'date_death_3', NULL, 'month_3_data', NULL, 108, NULL, NULL, 'text', 'Date of death', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'cause_death_3', NULL, 'month_3_data', NULL, 109, NULL, NULL, 'select', 'What was the cause of death?', '1, All-cause \\n 2, Cardiovascular', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'month_3_data_complete', NULL, 'month_3_data', NULL, 110, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'complete_study', NULL, 'completion_data', 'Completion Data', 111, NULL, 'Study Completion Information', 'select', 'Has patient completed study?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'withdraw_date', NULL, 'completion_data', NULL, 112, NULL, NULL, 'text', 'Put a date if patient withdrew study', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'withdraw_reason', NULL, 'completion_data', NULL, 113, NULL, NULL, 'select', 'Reason patient withdrew from study', '0, Non-compliance \\n 1, Did not wish to continue in study \\n 2, Could not tolerate the supplement \\n 3, Hospitalization \\n 4, Other', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'complete_study_date', NULL, 'completion_data', NULL, 114, NULL, NULL, 'text', 'Date of study completion', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'study_comments', NULL, 'completion_data', NULL, 115, NULL, 'General Comments', 'textarea', 'Comments', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL),
(@project_id, 'completion_data_complete', NULL, 'completion_data', NULL, 116, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL);

INSERT INTO `redcap_projects_templates` (`project_id`, `title`, `description`, `enabled`)
	VALUES (@project_id,  @project_title,  'Seven data entry forms for collecting data for a randomized clinical trial. Includes a short demographics form followed by a form where randomization is performed. An example randomization model has already been set up, although randomization allocation tables have not yet been created.',  '1');

-- Since project is in development, go ahead and pre-check items on Project Setup
INSERT INTO redcap_project_checklist (project_id, `name`) VALUES
(@project_id, 'design'),
(@project_id, 'modify_project'),
(@project_id, 'modules');
-- SQL TO CREATE A REDCAP DEMO PROJECT --
set @project_title = 'Human Cancer Tissue Biobank';


-- Obtain default values --
set @institution = (select value from redcap_config where field_name = 'institution' limit 1);
set @site_org_type = (select value from redcap_config where field_name = 'site_org_type' limit 1);
set @grant_cite = (select value from redcap_config where field_name = 'grant_cite' limit 1);
set @project_contact_name = (select value from redcap_config where field_name = 'project_contact_name' limit 1);
set @project_contact_email = (select value from redcap_config where field_name = 'project_contact_email' limit 1);
set @headerlogo = (select value from redcap_config where field_name = 'headerlogo' limit 1);
set @auth_meth = (select value from redcap_config where field_name = 'auth_meth_global' limit 1);
-- Create project --
INSERT INTO `redcap_projects`
(project_name, app_title, status, count_project, auth_meth, creation_time, production_time, institution, site_org_type, grant_cite, project_contact_name, project_contact_email, headerlogo, display_project_logo_institution, randomization, auto_inc_set) VALUES
(concat('redcap_demo_',LEFT(sha1(rand()),6)), @project_title, 1, 0, @auth_meth, now(), now(), @institution, @site_org_type, @grant_cite, @project_contact_name, @project_contact_email, @headerlogo, 0, 0, 1);
set @project_id = LAST_INSERT_ID();
-- Create single arm --
INSERT INTO redcap_events_arms (project_id, arm_num, arm_name) VALUES (@project_id, 1, 'Arm 1');
set @arm_id = LAST_INSERT_ID();
-- Create single event --
INSERT INTO redcap_events_metadata (arm_id, day_offset, offset_min, offset_max, descrip) VALUES (@arm_id, 0, 0, 0, 'Event 1');
set @event_id = LAST_INSERT_ID();
-- Insert into redcap_metadata --
INSERT INTO redcap_metadata (project_id, field_name, field_phi, form_name, form_menu_description, field_order, field_units, element_preceding_header, element_type, element_label, element_enum, element_note, element_validation_type, element_validation_min, element_validation_max, element_validation_checktype, branching_logic, field_req, edoc_id, edoc_display_img, custom_alignment, stop_actions, question_num, grid_name, misc) VALUES
(@project_id, 'lab_id', '0', 'id_shipping', 'ID Shipping', 1, NULL, 'IDs', 'text', 'Lab ID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'trc_id', NULL, 'id_shipping', NULL, 2, NULL, NULL, 'text', 'TRC ID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'first_name', '1', 'id_shipping', NULL, 3, NULL, NULL, 'text', 'First Name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'middle_name', NULL, 'id_shipping', NULL, 4, NULL, NULL, 'text', 'Middle Name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'last_name', '1', 'id_shipping', NULL, 5, NULL, NULL, 'text', 'Last Name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'suffix', NULL, 'id_shipping', NULL, 6, NULL, NULL, 'text', 'Suffix', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'date_of_birth', '1', 'id_shipping', NULL, 7, NULL, NULL, 'text', 'Date of Birth', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'age', NULL, 'id_shipping', NULL, 8, NULL, NULL, 'text', 'Age', NULL, 'Age at surgery, DOB not available', 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'facility_name', NULL, 'id_shipping', NULL, 9, NULL, 'Shipping Information', 'text', 'Facility_Name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'facility_city', NULL, 'id_shipping', NULL, 10, NULL, NULL, 'text', 'Facility_City', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'facility_state', NULL, 'id_shipping', NULL, 11, NULL, NULL, 'text', 'Facility_State', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'receivedate', '1', 'id_shipping', NULL, 12, NULL, NULL, 'text', 'ReceiveDate', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'shipmethod', NULL, 'id_shipping', NULL, 13, NULL, NULL, 'select', 'ShipMethod', '1, FedEx \\n 2, USPS \\n 3, UPS \\n 4, ByPerson \\n 5, Others', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'trackingnumber', NULL, 'id_shipping', NULL, 14, NULL, NULL, 'text', 'ReceiveTracking', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pathaccnumber', '1', 'id_shipping', NULL, 15, NULL, NULL, 'text', 'PathAccNumber', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'otheraccnumber2', NULL, 'id_shipping', NULL, 16, NULL, NULL, 'text', 'OtherAccNumber', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'blk_no_received', NULL, 'id_shipping', NULL, 17, NULL, NULL, 'text', 'Block_ Received', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'stainedslide_received', NULL, 'id_shipping', NULL, 18, NULL, NULL, 'text', 'StainedSlide_Received', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'unstainedslide_received', NULL, 'id_shipping', NULL, 19, NULL, NULL, 'text', 'UnstainedSlide_Received', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'return_needed', NULL, 'id_shipping', NULL, 20, NULL, NULL, 'yesno', 'Return_Needed?', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'return_date', NULL, 'id_shipping', NULL, 21, NULL, NULL, 'text', 'ReturnDate', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'return_tracking', NULL, 'id_shipping', NULL, 22, NULL, NULL, 'text', 'ReturnTracking', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'labcirculation_time', NULL, 'id_shipping', NULL, 23, NULL, NULL, 'calc', 'LabCirculation_time', 'round(datediff([receivedate],[return_date],"d","mdy"))', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'followup_note', NULL, 'id_shipping', NULL, 24, NULL, NULL, 'textarea', 'FollowUp_Note', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'secondtime_getsample', NULL, 'id_shipping', NULL, 25, NULL, 'If Receive Sample 2nd Time', 'yesno', '2nd_Time_Receive', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'follow_up_needed2', NULL, 'id_shipping', NULL, 26, NULL, NULL, 'yesno', 'Follow up needed?', NULL, NULL, NULL, NULL, NULL, NULL, '[secondtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'collection_note2', NULL, 'id_shipping', NULL, 27, NULL, NULL, 'textarea', 'FollowUp_Note2', NULL, NULL, NULL, NULL, NULL, NULL, '[follow_up_needed2] = ''1'' and [secondtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'samefacasbefore', NULL, 'id_shipping', NULL, 28, NULL, NULL, 'yesno', 'SameFacilityAsBefore?', NULL, NULL, NULL, NULL, NULL, NULL, '[secondtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'facility_name2', NULL, 'id_shipping', NULL, 29, NULL, NULL, 'text', 'Facility_Name2', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[samefacasbefore] = ''0'' and [secondtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'facility_city2', NULL, 'id_shipping', NULL, 30, NULL, NULL, 'text', 'Facility_City2', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[secondtime_getsample] = ''1'' and [samefacasbefore] = ''0''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'facility_state2', NULL, 'id_shipping', NULL, 31, NULL, NULL, 'text', 'Facility_State2', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[secondtime_getsample] = ''1'' and [samefacasbefore] = ''0''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'receivedate2', NULL, 'id_shipping', NULL, 32, NULL, NULL, 'text', 'ReceiveDate2', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', '[secondtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'shipmethod2', NULL, 'id_shipping', NULL, 33, NULL, NULL, 'select', 'ShipMethod2', '1, FedEx \\n 2, USPS \\n 3, UPS \\n 4, ByPerson \\n 5, Others', NULL, NULL, NULL, NULL, NULL, '[secondtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'receivetracking2', NULL, 'id_shipping', NULL, 34, NULL, NULL, 'text', 'ReceiveTracking2', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[secondtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pathaccnumber2', NULL, 'id_shipping', NULL, 35, NULL, NULL, 'text', 'PathAccNumber', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[secondtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'otheraccnumber', NULL, 'id_shipping', NULL, 36, NULL, NULL, 'text', 'OtherAccNumber', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[secondtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'block_received2', NULL, 'id_shipping', NULL, 37, NULL, NULL, 'text', 'Block_ Received2', NULL, NULL, 'float', NULL, NULL, 'soft_typed', '[secondtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'stainedslide_received2', NULL, 'id_shipping', NULL, 38, NULL, NULL, 'text', 'StainedSlide_Received2', NULL, NULL, 'float', NULL, NULL, 'soft_typed', '[secondtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'unstainedslide_received2', NULL, 'id_shipping', NULL, 39, NULL, NULL, 'text', 'UnstainedSlide_Received2', NULL, NULL, 'float', NULL, NULL, 'soft_typed', '[secondtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'return_needed2', NULL, 'id_shipping', NULL, 40, NULL, NULL, 'yesno', 'Return_needed?', NULL, NULL, NULL, NULL, NULL, NULL, '[secondtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'returndate2', NULL, 'id_shipping', NULL, 41, NULL, NULL, 'text', 'ReturnDate2', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', '[return_needed2] = ''1'' and [secondtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'return_tracking2', NULL, 'id_shipping', NULL, 42, NULL, NULL, 'text', 'ReturnTracking2', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[return_needed2] = ''1'' and [secondtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'thirdtime_getsample', NULL, 'id_shipping', NULL, 43, NULL, 'If Receive Sample 3rd Time', 'yesno', '3rd_Time_Receive', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'follow_up_needed3', NULL, 'id_shipping', NULL, 44, NULL, NULL, 'yesno', 'Follow up needed?', NULL, NULL, NULL, NULL, NULL, NULL, '[thirdtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'collection_note3', NULL, 'id_shipping', NULL, 45, NULL, NULL, 'textarea', 'FollowUp_Note', NULL, NULL, NULL, NULL, NULL, NULL, '[follow_up_needed3] = ''1'' and [thirdtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'samefacilityasbefore2', NULL, 'id_shipping', NULL, 46, NULL, NULL, 'yesno', 'SameFacilityAsBefore?', NULL, NULL, NULL, NULL, NULL, NULL, '[thirdtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'facility_name3', NULL, 'id_shipping', NULL, 47, NULL, NULL, 'text', 'Facility_Name3', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[samefacilityasbefore2] = ''0'' and [thirdtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'facility_city3', NULL, 'id_shipping', NULL, 48, NULL, NULL, 'text', 'Facility_City3', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[samefacilityasbefore2] = ''0'' and [thirdtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'facility_state3', NULL, 'id_shipping', NULL, 49, NULL, NULL, 'text', 'Facility_State3', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[samefacilityasbefore2] = ''0'' and [thirdtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'receivedate3', NULL, 'id_shipping', NULL, 50, NULL, NULL, 'text', 'ReceiveDate3', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', '[thirdtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'shipmethod3', NULL, 'id_shipping', NULL, 51, NULL, NULL, 'select', 'ShipMethod3', '1, FedEx \\n 2, USPS \\n 3, UPS \\n 4, ByPerson \\n 5, Others', NULL, NULL, NULL, NULL, NULL, '[thirdtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'receivetracking3', NULL, 'id_shipping', NULL, 52, NULL, NULL, 'text', 'ReceiveTracking3', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[thirdtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pathaccnumber3', NULL, 'id_shipping', NULL, 53, NULL, NULL, 'text', 'PathAccNumber3', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[thirdtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'otheraccnumber3', NULL, 'id_shipping', NULL, 54, NULL, NULL, 'text', 'OtherAccNumber', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[thirdtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'block_received3', NULL, 'id_shipping', NULL, 55, NULL, NULL, 'text', 'Block_ Received3', NULL, NULL, 'float', NULL, NULL, 'soft_typed', '[thirdtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'stainedslide_received3', NULL, 'id_shipping', NULL, 56, NULL, NULL, 'text', 'StainedSlide_Received3', NULL, NULL, 'float', NULL, NULL, 'soft_typed', '[thirdtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'unstainedslide_received3', NULL, 'id_shipping', NULL, 57, NULL, NULL, 'text', 'UnstainedSlide_Received3', NULL, NULL, 'float', NULL, NULL, 'soft_typed', '[thirdtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'return_needed3', NULL, 'id_shipping', NULL, 58, NULL, NULL, 'yesno', 'Return_needed?', NULL, NULL, NULL, NULL, NULL, NULL, '[thirdtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'returndate3', NULL, 'id_shipping', NULL, 59, NULL, NULL, 'text', 'ReturnDate3', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', '[return_needed3] = ''1'' and [thirdtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'returntracking3', NULL, 'id_shipping', NULL, 60, NULL, NULL, 'text', 'ReturnTracking3', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[return_needed3] = ''1'' and [thirdtime_getsample] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'id_shipping_complete', NULL, 'id_shipping', NULL, 61, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tumor_origin', NULL, 'pathology_review', 'Pathology Review', 62, NULL, 'Tumor Origin and Location', 'select', 'Tumor_Origin', '1, Breast \\n 2, Prostate \\n 3, Colorectum \\n 4, Lung \\n 5, Others', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'specify_other_origin', NULL, 'pathology_review', NULL, 63, NULL, NULL, 'text', 'Specify_Other_Origin', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[tumor_origin] = ''5''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tumor_location', NULL, 'pathology_review', NULL, 64, NULL, NULL, 'select', 'Location_Breast_Prostate', '1, Left \\n 2, Right \\n 3, Bilateral \\n 4, Multiple \\n 5, Unclear', 'Multiple means 2 or more', NULL, NULL, NULL, NULL, '[tumor_origin] = ''1'' or [tumor_origin] = ''2''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tumor_location_colorectum', NULL, 'pathology_review', NULL, 65, NULL, NULL, 'select', 'Location_Colorectum', '1, Appendix \\n 2, Cecum \\n 3, Ascending \\n 4, Hepatic Flexure \\n 5, Transverse \\n 6, Splenic Flexure \\n 7, Descending \\n 8, Sigmoid \\n 9, Rectum \\n 10, Anus \\n 11, Left \\n 12, Right \\n 13, Unclear', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''3''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tumor_location_lung', NULL, 'pathology_review', NULL, 66, NULL, NULL, 'select', 'Location_Lung', '1, Right Upper Lobe \\n 2, Right Middle Lobe \\n 3, Right Lower Lobe \\n 4, Left Upper Lobe \\n 5, Left Lower Lobe \\n 6, Right Bronchus \\n 7, Left Bronchus \\n 8, Right \\n 9, Left \\n 10, Unclear \\n 11, Others (specify it)', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''4''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'other_location_lung', NULL, 'pathology_review', NULL, 67, NULL, NULL, 'text', 'Other location_lung', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[tumor_origin] = ''4'' and [tumor_location_lung] = ''11''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'specify_other_location', NULL, 'pathology_review', NULL, 68, NULL, NULL, 'text', 'Specify_Other_Location', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[tumor_origin] = ''5''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'date_surgery', NULL, 'pathology_review', NULL, 69, NULL, 'Clinical Pathology Information', 'text', 'Date_Surgery', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'age_at_surgery', NULL, 'pathology_review', NULL, 70, NULL, NULL, 'calc', 'Age at Surgery', 'round(datediff([date_of_birth],[date_surgery],"y","mdy",true),0)', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'sex', NULL, 'pathology_review', NULL, 71, NULL, NULL, 'select', 'sex', '0, Female \\n 1, Male \\n 2, Other \\n 3, Prefer not to say', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pathol_acc_no', '1', 'pathology_review', NULL, 72, NULL, NULL, 'text', 'Pathol_Acc_No', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'other_acc_no', NULL, 'pathology_review', NULL, 73, NULL, NULL, 'text', 'Other_Acc_No', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'block_tumor', NULL, 'pathology_review', NULL, 74, NULL, NULL, 'text', 'BlockNum_Tumor', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'block_normal', NULL, 'pathology_review', NULL, 75, NULL, NULL, 'text', 'BlockNum_Normal', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'block_metastatic', NULL, 'pathology_review', NULL, 76, NULL, NULL, 'text', 'BlockNum_Metastatic', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'block_precancerous', NULL, 'pathology_review', NULL, 77, NULL, NULL, 'text', 'BlockNum_Precancerous', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'invitrosize1', NULL, 'pathology_review', NULL, 78, NULL, NULL, 'text', 'InvitroSize1', NULL, 'Maximum size in centimeter', 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'invitrosize2', NULL, 'pathology_review', NULL, 79, NULL, NULL, 'text', 'InvitroSize2', NULL, 'In % of total tissue volume for prostate cancer', 'float', NULL, NULL, 'soft_typed', '[tumor_origin] = ''2''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'invitrosize3', NULL, 'pathology_review', NULL, 80, NULL, NULL, 'text', 'InvitroSize3', NULL, 'The seceond largest tumor', NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'perineuralinvasion', NULL, 'pathology_review', NULL, 81, NULL, NULL, 'select', 'PerineuralInvasion', '0, No \\n 1, Yes \\n 2, N/A', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'vascular_invasion', NULL, 'pathology_review', NULL, 82, NULL, NULL, 'select', 'Vascular invasion present', '0, No \\n 1, Yes \\n 2, N/A', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'surgical_margin_cancer_pre', NULL, 'pathology_review', NULL, 83, NULL, NULL, 'select', 'Surgical margin cancer present', '0, No \\n 1, Yes \\n 2, N/A', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'clin_diagn_breast', NULL, 'pathology_review', NULL, 84, NULL, 'For Breast Cancer Samples', 'select', 'Clin_Diagn_Breast', '1, Noninvasive carcinoma (NOS) \\n 2, Ductal carcinoma in situ \\n 3, Lobular carcinoma in situ \\n 4, Paget disease without invasive carcinoma \\n 5, Invasive carcinoma (NOS) \\n 6, Invasive ductal carcinoma \\n 7, IDC with an extensive intraductal component \\n 8, IDC with Paget disease \\n 9, Invasive lobular \\n 10, Mucinous \\n 11, Medullary \\n 12, Papillary \\n 13, Tubular \\n 14, Adenoid cystic \\n 15, Secretory (juvenile) \\n 16, Apocrine \\n 17, Cribriform \\n 18, Carcinoma with squamous metaplasia \\n 19, Carcinoma with spindle cell metaplasia \\n 20, Carcinoma with cartilaginous/osseous metaplasia \\n 21, Carcinoma with metaplasia, mixed type \\n 22, Other(s) (specify) \\n 23, Not assessable \\n 24, No cancer tissue \\n 25, IDC+ILC (50 -90% each component)', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'lab_diagn_breast', NULL, 'pathology_review', NULL, 85, NULL, NULL, 'select', 'Lab_Diagn_Breast', '1, Noninvasive carcinoma (NOS) \\n 2, Ductal carcinoma in situ \\n 3, Lobular carcinoma in situ \\n 4, Paget disease without invasive carcinoma \\n 5, Invasive carcinoma (NOS) \\n 6, Invasive ductal carcinoma \\n 7, IDC with an extensive intraductal component \\n 8, IDC with Paget disease \\n 9, Invasive lobular \\n 10, Mucinous \\n 11, Medullary \\n 12, Papillary \\n 13, Tubular \\n 14, Adenoid cystic \\n 15, Secretory (juvenile) \\n 16, Apocrine \\n 17, Cribriform \\n 18, Carcinoma with squamous metaplasia \\n 19, Carcinoma with spindle cell metaplasia \\n 20, Carcinoma with cartilaginous/osseous metaplasia \\n 21, Carcinoma with metaplasia, mixed type \\n 22, Other(s) (specify) \\n 23, Not assessable \\n 24, No cancer tissue \\n 25, IDC+ILC (50 -90% each component)', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'if_ilc_subtype', NULL, 'pathology_review', NULL, 86, NULL, NULL, 'select', 'ILC_Subtype', '901, classical ILC \\n 902, solid ILC \\n 903, pleomorphic ILC \\n 904, alveolar ILC \\n 905, tubulolobular ILC \\n 906, mixed ILC \\n 907, signet ring cell ILC \\n 908, others', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''1'' and [lab_diagn_breast] = ''9''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'specify_if_other_type_br', NULL, 'pathology_review', NULL, 87, NULL, NULL, 'text', 'Specify_If_Other_Type_Br', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[tumor_origin] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'clin_grade_breast', NULL, 'pathology_review', NULL, 88, NULL, NULL, 'select', 'Clin_Grade_Breast', '1, 1 \\n 2, 2 \\n 3, 3 \\n 4, 1~2 \\n 5, 2~3 \\n 6, N/A', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'lab_grade_breast', NULL, 'pathology_review', NULL, 89, NULL, NULL, 'select', 'Lab_Grade_Breast', '1, 1 \\n 2, 2 \\n 3, 3 \\n 4, N/A', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'estrogen_receptor', NULL, 'pathology_review', NULL, 90, NULL, NULL, 'select', 'Estrogen Receptor', '0, negative \\n 1, week (<1%) \\n 2, positive (>=1%) \\n 3, N/A', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'progesterone_receptor', NULL, 'pathology_review', NULL, 91, NULL, NULL, 'select', 'Progesterone Receptor', '0, negative (0~2) \\n 1, week (3~4) \\n 2, intermediate (5~6) \\n 3, strong (7~8) \\n 4, N/A', 'Allred Score System 0-8', NULL, NULL, NULL, NULL, '[tumor_origin] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'her2_immunohistochemistry', NULL, 'pathology_review', NULL, 92, NULL, NULL, 'select', 'HER2_Immunohistochemistry', '0, 0 \\n 1, 1 (1~9% cells positivity) \\n 2, 2 (10-30% cells positivity) \\n 3, 3 (>30% cells positivity with strong color) \\n 4, N/A', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'her2_fish', NULL, 'pathology_review', NULL, 93, NULL, NULL, 'select', 'HER2_FISH', '0, 0 (Non-Amplified, <1.8) \\n 1, 1 (Amplified, >2.2) \\n 2, 2 (Borderline, 1.8~2.2) \\n 3, N/A', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'bc_molecularsubtype', NULL, 'pathology_review', NULL, 94, NULL, NULL, 'select', 'BC_MolecularSubtype', '1, Luminal A \\n 2, Luminal B \\n 3, HER2 \\n 4, Triple Negative \\n 5, N/A', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'ki_67', NULL, 'pathology_review', NULL, 95, NULL, NULL, 'text', 'Ki-67', NULL, 'positive cells in percentage', 'float', NULL, NULL, 'soft_typed', '[tumor_origin] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'p53_ihc', NULL, 'pathology_review', NULL, 96, NULL, NULL, 'text', 'p53_IHC', NULL, 'positive cells in percentage', NULL, NULL, NULL, 'soft_typed', '[tumor_origin] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'dna_index', NULL, 'pathology_review', NULL, 97, NULL, NULL, 'text', 'DNA Index', NULL, 'Unfavorable: >1.1', NULL, NULL, NULL, 'soft_typed', '[tumor_origin] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'bc_precancerous', NULL, 'pathology_review', NULL, 98, NULL, NULL, 'select', 'BC_Precancerous', '1, Not seen \\n 2, DCIS \\n 3, LCIS \\n 4, DCIS+LCIS', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tnm_breast_tumor', NULL, 'pathology_review', NULL, 99, NULL, NULL, 'select', 'TNMbreast_PrimTum(T)', '1, TX:Primary tumor cannot be assessed \\n 2, T0:No evidence of primary tumor \\n 3, Tis:DCIS/LCIS/Paget''s dis w/o associated tumor \\n 4, T1mic:Microinvasion <=0.1 cm \\n 5, T1a:>0.1 but <=0.5 cm \\n 6, T1b:>0.5 cm but <=1.0 cm \\n 7, T1c:>1.0 cm but <=2.0 cm \\n 8, T2:Tumor >2.0 cm but <=5.0 cm \\n 9, T3:Tumor >5.0 cm \\n 10, T4a:Any size with direct extension to chest wall \\n 11, T4b:skin Edema/ulceration;satellite skin nodules \\n 12, T4c:Both of T4a and T4b \\n 13, T4d:Inflammatory carcinoma', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tnmbreast_ln_n', NULL, 'pathology_review', NULL, 100, NULL, NULL, 'select', 'TNMbreast_LN (N)', '1, NX: Regional LNs cannot be assessed \\n 2, N0: No regional LNs metastasis \\n 3, N1: Movable ipsilateral axillary LN(s) \\n 4, N2: Ipsilateral axillary LN(s) fixed \\n 5, N3: Ipsilateral internal mammary LN(s) \\n 6, pNX: Regional LNs cannot be assessed \\n 7, pN0: No regional LNs metastasis \\n 8, pN1: movable ipsilateral axillary LN(s) \\n 9, pN1a:Only micrometastasis <=0.2 cm \\n 10, pN1b: Metastasis any >0.2 cm \\n 11, pN1bi:1 to 3 LNs, any >0.2 cm and all <2.0 cm \\n 12, pN1bii: >=4 LN3, any >0.2 cm and all <2.0 cm \\n 13, pN1biii: beyond LN capsule,metastasis <2.0 cm \\n 14, pN1biv: Metastasis to a LN >=2.0 cm \\n 15, pN2: to ipsilateral axillaryLN(s) fixed \\n 16, pN3: to ipsilateral internal mammary LN(s) \\n 17, pN0(i+)', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tnmbreast_distantmetast_m', NULL, 'pathology_review', NULL, 101, NULL, NULL, 'select', 'TNMbreast_DistantMetast (M)', '1, MX: cannot be assessed \\n 2, M0: No distant metastasis \\n 3, M1: yes includes ipsilateral supraclavicular LNs', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'clin_diagn_prostate', NULL, 'pathology_review', NULL, 102, NULL, 'For Prostate Cancer Samples', 'select', 'Clin_Diagn_Prostate', '1, Adenocarcinoma,NOS \\n 2, Prostatic duct adenocarcinoma \\n 3, Mucinous adenocarcinoma \\n 4, Signet-ring cell carcinoma \\n 5, Adenosquemous carcinoma \\n 6, Small cell carcinoma \\n 7, Sarcomatoid carcinoma \\n 8, Other (specifiy) \\n 9, Undifferentiated carcinoma, NOS \\n 10, Cannot be determined', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''2''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'lab_diag_prostate', NULL, 'pathology_review', NULL, 103, NULL, NULL, 'select', 'Lab_Diag_Prostate', '1, Adenocarcinoma,NOS \\n 2, Prostatic duct adenocarcinoma \\n 3, Mucinous adenocarcinoma \\n 4, Signet-ring cell carcinoma \\n 5, Adenosquemous carcinoma \\n 6, Small cell carcinoma \\n 7, Sarcomatoid carcinoma \\n 8, Other (specifiy) \\n 9, Undifferentiated carcinoma, NOS \\n 10, Cannot be determined', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''2''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'specify_if_other_type_pro', NULL, 'pathology_review', NULL, 104, NULL, NULL, 'text', 'Specify_If_Other_type_Pro', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[tumor_origin] = ''2''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'clin_gleason_score', NULL, 'pathology_review', NULL, 105, NULL, NULL, 'text', 'Clin_Gleason_Score', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[tumor_origin] = ''2''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'clin_grade_pro', NULL, 'pathology_review', NULL, 106, NULL, NULL, 'select', 'Clin_Grade_Pro', '1, Low(1-4) \\n 2, Intermediate(5-7) \\n 3, High(8-10)', 'Gleason Score System', NULL, NULL, NULL, NULL, '[tumor_origin] = ''2''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'lab_gleason_score', NULL, 'pathology_review', NULL, 107, NULL, NULL, 'text', 'Lab_Gleason_Score', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[tumor_origin] = ''2''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'lab_grade_pro', NULL, 'pathology_review', NULL, 108, NULL, NULL, 'select', 'Lab_Grade_Pro', '1, Low(1-4) \\n 2, Intermediate(5-7) \\n 3, High(8-10)', 'Gleason Score System (1-10)', NULL, NULL, NULL, NULL, '[tumor_origin] = ''2''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tnmprostate_t', NULL, 'pathology_review', NULL, 109, NULL, NULL, 'select', 'TNMprostate_T', '1, T1: Microscopic, DRE/Ultrasound undetectable \\n 2, T1a: <=5 percent \\n 3, T1b: >5 percent \\n 4, T1c: as F/U of screening w/ high PSA \\n 5, T2: within prost, DRE/ultrasound detectable \\n 6, T2a: >half of one lobe \\n 7, T2b: >half of one lobe,DRE detectable often \\n 8, T2c: involve both lobes \\n 9, T3: surrounding tissues or seminal vesicles \\n 10, T3a: outside prostate on one side \\n 11, T3b: outside prostate on both sides \\n 12, T3c: to one or both seminal tubes \\n 13, T4a: to bladder or rectum \\n 14, T4b: beyond prostate or levator muscles \\n 15, TX', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''2''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tnmprostate_n', NULL, 'pathology_review', NULL, 110, NULL, NULL, 'select', 'TNMprostate_N', '1, N0: not to pelvic LN \\n 2, N1: a single pelvic LN,<= 2 cm \\n 3, N2: a single pelvic LN,2-5cm \\n 4, N3: >5 cm in size \\n 5, NX', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''2''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tnmprostate_m', NULL, 'pathology_review', NULL, 111, NULL, NULL, 'select', 'TNMprostate_M', '1, M0: spread only regionally in pelvic area \\n 2, M1: spread beyond pelvic area \\n 3, MX', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''2''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'psa_level', NULL, 'pathology_review', NULL, 112, NULL, NULL, 'text', 'PSA_Level', NULL, 'ng/mL', NULL, NULL, NULL, 'soft_typed', '[tumor_origin] = ''2''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'seminalinvasion', NULL, 'pathology_review', NULL, 113, NULL, NULL, 'select', 'SeminalInvasion', '0, No \\n 1, Yes \\n 2, N/A', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''2''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'extraprostate_extention', NULL, 'pathology_review', NULL, 114, NULL, NULL, 'select', 'ExtraProstate Extention', '0, No \\n 1, Yes \\n 2, N/A', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''2''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'clin_giag_colon', NULL, 'pathology_review', NULL, 115, NULL, 'For Colon Cancer Samples', 'select', 'Clin_Diagn_Colon', '1, 1 Adenocarcinoma \\n 2, 2 Mucinous adenocarcinoma \\n 3, 3 Medullary carcinoma \\n 4, 4 Signet ring cell carcinoma \\n 5, 5 Small cell carcinoma \\n 6, 6 Squamous cell carcinoma \\n 7, 7 Adenosquamous carcinoma \\n 8, 8 Others \\n 9, 9 Adenoma', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''3''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'specify_colon_clin', NULL, 'pathology_review', NULL, 116, NULL, NULL, 'text', 'If others_specify', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[tumor_origin] = ''3'' and [clin_giag_colon] = ''8''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'lab_diagn_colon', NULL, 'pathology_review', NULL, 117, NULL, NULL, 'select', 'Lab_Diagn_Colon', '1, 1 Adenocarcinoma \\n 2, 2 Mucinous adenocarcinoma \\n 3, 3 Medullary carcinoma \\n 4, 4 Signet ring cell carcinoma \\n 5, 5 Small cell carcinoma \\n 6, 6 Squamous cell carcinoma \\n 7, 7 Adenosquamous carcinoma \\n 8, 8 Others \\n 9, 9 Adenoma', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''3''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'specify_colon_lab', NULL, 'pathology_review', NULL, 118, NULL, NULL, 'text', 'If others_specify', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[tumor_origin] = ''3'' and [lab_diagn_colon] = ''8''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'clin_grade_colon', NULL, 'pathology_review', NULL, 119, NULL, NULL, 'select', 'Clin_Grade_Colon', '1, Low \\n 2, Intermediate \\n 3, High \\n 4, N/A \\n 5, Low-Intermediate \\n 6, Intermediate-High', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''3''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'lab_grade_colon', NULL, 'pathology_review', NULL, 120, NULL, NULL, 'select', 'Lab_Grade_Colon', '1, Low \\n 2, Intermediate \\n 3, High \\n 4, N/A', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''3''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tnmcolon_t', NULL, 'pathology_review', NULL, 121, NULL, NULL, 'select', 'TNMcolon_T', 'Tx, Tx \\n Tis, Tis earliest stage (in situ) involves only mucosa \\n T1, T1 through the muscularis mucosa \\n T2, T2 through submucosa into muscularis propria \\n T3, T3 through muscularis propria into outermost layers \\n T4a, T4a through serosa/visceral peritoneum \\n T4b, T4b through the wall attach/invade nearby tissues', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''3''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tnmcolon_n', NULL, 'pathology_review', NULL, 122, NULL, NULL, 'select', 'TNMcolon_N', 'Nx, Nx incomplete information. \\n N0, N0 No cancer in nearby LNs \\n N1a, N1a in 1 nearby LN \\n N1b, N1b in 2 to 3 nearby LNs \\n N1c, N1c cancer cells in areas of fat near LN, but not in LNs \\n N2a, N2a in 4 to 6 nearby LN \\n N2b, N2b in 7 or more nearby LNs', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''3''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tnmcolon_m', NULL, 'pathology_review', NULL, 123, NULL, NULL, 'select', 'TNMcolon_M', 'M0, M0 No distant spread \\n M1a, M1a to 1 distant organ or set of distant LNs \\n M1b, M1b to >1 or distant parts peritoneum \\n MX, MX', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''3''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pre_cancerous_colon', NULL, 'pathology_review', NULL, 124, NULL, NULL, 'textarea', 'Pre-cancerous_Colon', NULL, NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''3''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'clin_diagn_lung', NULL, 'pathology_review', NULL, 125, NULL, 'For Lung Cancer Samples', 'select', 'Clin_Diagn_Lung', '1, Squamous cell carcinoma 8070/3 \\n 2, Small cell carcinoma 8041/3 \\n 3, Adenocarcinoma 8140/3 \\n 4, Adenocarcinoma, mixed subtype 8255/3 \\n 5, Adenocarcinoma, Acinar 8550/3 \\n 6, Adenocarcinoma, Papillary 8260/3 \\n 7, Adenocarcinoma, Micropapillary \\n 8, Bronchioloalveolar carcinoma 8250/3 \\n 9, Solid adenocarcinoma with mucin 8230/3 \\n 10, Adenosquamous carcinoma 8560/3 \\n 11, Large cell carcinoma 8012/3 \\n 12, Sarcomatoid carcinoma 8033/3 \\n 13, Carcinoid tumour 8240/3 \\n 14, Mucoepidermoid carcinoma 8430/3 \\n 15, Epithelial-myoepithelial carcinoma 8562/3 \\n 16, Adenoid cystic carcinoma 8200/3 \\n 17, Unclassified carcinoma \\n 18, Others \\n 19, Large cell neuroendocrine carcinoma  8013/3', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''4''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'lab_diagn_lung', NULL, 'pathology_review', NULL, 126, NULL, NULL, 'select', 'Lab_Diagn_Lung', '1, Squamous cell carcinoma 8070/3 \\n 2, Small cell carcinoma 8041/3 \\n 3, Adenocarcinoma 8140/3 \\n 4, Adenocarcinoma, mixed subtype 8255/3 \\n 5, Adenocarcinoma, Acinar 8550/3 \\n 6, Adenocarcinoma, Papillary 8260/3 \\n 7, Adenocarcinoma, Micropapillary \\n 8, Bronchioloalveolar carcinoma 8250/3 \\n 9, Solid adenocarcinoma with mucin 8230/3 \\n 10, Adenosquamous carcinoma 8560/3 \\n 11, Large cell carcinoma 8012/3 \\n 12, Sarcomatoid carcinoma 8033/3 \\n 13, Carcinoid tumour 8240/3 \\n 14, Mucoepidermoid carcinoma 8430/3 \\n 15, Epithelial-myoepithelial carcinoma 8562/3 \\n 16, Adenoid cystic carcinoma 8200/3 \\n 17, Unclassified carcinoma \\n 18, Others \\n 19, Large cell neuroendocrine carcinoma 8013/3', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''4''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'if_others_specify', NULL, 'pathology_review', NULL, 127, NULL, NULL, 'text', 'If_Others_Specify', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[tumor_origin] = ''4'' and [lab_diagn_lung] = ''10''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'clin_grade_lung', NULL, 'pathology_review', NULL, 128, NULL, NULL, 'select', 'Clin_Grade_Lung', '1, Low \\n 2, Intermediate \\n 3, High \\n 4, N/A \\n 5, Low-Intermediate \\n 6, Intermediate-High', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''4''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'lab_grade_lung', NULL, 'pathology_review', NULL, 129, NULL, NULL, 'select', 'Lab_Grade_Lung', '1, Low \\n 2, Intermediate \\n 3, High \\n 4, N/A', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''4''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tnmlung_t', NULL, 'pathology_review', NULL, 130, NULL, NULL, 'select', 'TNMlung_T', '1, TX \\n 2, T0 No evidence of primary tumour \\n 3, Tis Carcinoma in situ \\n 4, T1 <= 3 cm, without invasion \\n 5, T2 > 3 cm; or involves main bronchus(>2 cm distal to carina)/visceral pleura; or Associated with atelectasis or obstructive pneumonitis that does not involve entire lung \\n 6, T3 any size that directly invades any of:chest wall, diaphragm, mediastinal pleura, parietal pericardium; or tumour in main bronchus < 2 cm distal to carina but without involvement of carina; or associated atelectasis or obstructive pneumonitis of entire lung \\n 7, T4 any size that invades any of: mediastinum, heart, great vessels, trachea, oesophagus, vertebral body, carina; separate tumour nodule(s) in same lobe; tumour with malignant pleural effusion', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''4''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tnmlung_n', NULL, 'pathology_review', NULL, 131, NULL, NULL, 'select', 'TNMlung_N', '8, NX \\n 9, N0 \\n 10, N1 Ipsilateral peribronchial/ipsilateral hilar LNs and intrapulmonary LNs \\n 11, N2 ipsilateral mediastinal/subcarinal LNs \\n 12, N3 contralateral mediastinal, contralateral hilar, ipsilateral or contralateral scalene, or supraclavicular LNs', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''4''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tnmlung_m', NULL, 'pathology_review', NULL, 132, NULL, NULL, 'select', 'TNMlung_M', '13, MX \\n 14, M0 \\n 15, M1 Distant metastasis, includes separate tumour nodule(s) in different lobe', NULL, NULL, NULL, NULL, NULL, '[tumor_origin] = ''4''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'clin_diagn_others', NULL, 'pathology_review', NULL, 133, NULL, 'For Other Cancer Samples', 'text', 'Clin_Diagn_Others', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[tumor_origin] = ''5''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'lab_diagn_others', NULL, 'pathology_review', NULL, 134, NULL, NULL, 'text', 'Lab_Diagn_Others', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[tumor_origin] = ''5''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'clin_grade_others', NULL, 'pathology_review', NULL, 135, NULL, NULL, 'text', 'Clin_Grade_Others', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[tumor_origin] = ''5''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'lab_grade_others', NULL, 'pathology_review', NULL, 136, NULL, NULL, 'text', 'Lab_Grade_Others', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[tumor_origin] = ''5''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tnm_stage', NULL, 'pathology_review', NULL, 137, NULL, NULL, 'text', 'TNM_Stage', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[tumor_origin] = ''5''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pathoireview_note', NULL, 'pathology_review', NULL, 138, NULL, NULL, 'textarea', 'PatholReview_Note', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pathology_review_complete', NULL, 'pathology_review', NULL, 139, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'five_um_tumor_quant', NULL, 'slide_information', 'Slide Information', 140, NULL, NULL, 'text', '5um_Tumor_Quant', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'five_um_tumor_currquant', NULL, 'slide_information', NULL, 141, NULL, NULL, 'text', '5um_Tumor_CurrQuant', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'ten_um_tumor_quant', NULL, 'slide_information', NULL, 142, NULL, NULL, 'text', '10um_Tumor_Quant', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'ten_um_tumor_currquant', NULL, 'slide_information', NULL, 143, NULL, NULL, 'text', '10um_Tumor_CurrQuant', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'five_um_nor_quant', NULL, 'slide_information', NULL, 144, NULL, NULL, 'text', '5um_Nor_Quant', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'five_um_nor_currquant', NULL, 'slide_information', NULL, 145, NULL, NULL, 'text', '5um_Nor_CurrQuant', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'ten_um_nor_quant', NULL, 'slide_information', NULL, 146, NULL, NULL, 'text', '10um_Nor_Quant', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'ten_um_nor_currquant', NULL, 'slide_information', NULL, 147, NULL, NULL, 'text', '10um_Nor_CurrQuant', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'slideloc_1', NULL, 'slide_information', NULL, 148, NULL, NULL, 'text', 'SlideLoc_1', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'parapieceloc_1', NULL, 'slide_information', NULL, 149, NULL, NULL, 'text', 'ParaPieceLoc_1', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'is_there_another_accnumber', NULL, 'slide_information', NULL, 150, NULL, NULL, 'yesno', 'Is there another AccNumber?', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pathaccnum_2', NULL, 'slide_information', NULL, 151, NULL, NULL, 'text', 'PathAccNum_2', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[is_there_another_accnumber] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'five_um_tumor_quant2', NULL, 'slide_information', NULL, 152, NULL, NULL, 'text', '5um_Tumor_Quant2', NULL, NULL, 'float', NULL, NULL, 'soft_typed', '[is_there_another_accnumber] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'five_um_tumor_currquant2', NULL, 'slide_information', NULL, 153, NULL, NULL, 'text', '5um_Tumor_CurrQuant2', NULL, NULL, 'float', NULL, NULL, 'soft_typed', '[is_there_another_accnumber] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'ten_um_tumor_quant2', NULL, 'slide_information', NULL, 154, NULL, NULL, 'text', '10um_Tumor_Quant2', NULL, NULL, 'float', NULL, NULL, 'soft_typed', '[is_there_another_accnumber] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'ten_um_tumor_currquant2', NULL, 'slide_information', NULL, 155, NULL, NULL, 'text', '10um_Tumor_CurrQuant2', NULL, NULL, 'float', NULL, NULL, 'soft_typed', '[is_there_another_accnumber] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'five_um_nor_quant2', NULL, 'slide_information', NULL, 156, NULL, NULL, 'text', '5um_Nor_Quant2', NULL, NULL, 'float', NULL, NULL, 'soft_typed', '[is_there_another_accnumber] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'five_um_nor_currquant2', NULL, 'slide_information', NULL, 157, NULL, NULL, 'text', '5um_Nor_CurrQuant2', NULL, NULL, 'float', NULL, NULL, 'soft_typed', '[is_there_another_accnumber] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'ten_um_nor_quant2', NULL, 'slide_information', NULL, 158, NULL, NULL, 'text', '10um_Nor_Quant2', NULL, NULL, 'float', NULL, NULL, 'soft_typed', '[is_there_another_accnumber] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'ten_um_nor_currquant2', NULL, 'slide_information', NULL, 159, NULL, NULL, 'text', '10um_Nor_CurrQuant2', NULL, NULL, 'float', NULL, NULL, 'soft_typed', '[is_there_another_accnumber] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'same_slideloc', NULL, 'slide_information', NULL, 160, NULL, NULL, 'yesno', 'Same_SlideLoc?', NULL, NULL, NULL, NULL, NULL, NULL, '[is_there_another_accnumber] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'if_no_location2', NULL, 'slide_information', NULL, 161, NULL, NULL, 'text', 'If_No_Location2', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[same_slideloc] = ''0'' and [is_there_another_accnumber] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'parapieceloc_2', NULL, 'slide_information', NULL, 162, NULL, NULL, 'text', 'ParaPieceLoc_2', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[is_there_another_accnumber] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'is_there_metastatic_tumor', NULL, 'slide_information', NULL, 163, NULL, NULL, 'yesno', 'Is there Metastatic Tumor?', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'metastatic_accnum', NULL, 'slide_information', NULL, 164, NULL, NULL, 'text', 'Metastatic_AccNum', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[is_there_metastatic_tumor] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'five_um_met_quant', NULL, 'slide_information', NULL, 165, NULL, NULL, 'text', '5um_Met_Quant', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[is_there_metastatic_tumor] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'five_um_met_currentquant', NULL, 'slide_information', NULL, 166, NULL, NULL, 'text', '5um_Met_CurrentQuant', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[is_there_metastatic_tumor] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'ten_um_met_quant', NULL, 'slide_information', NULL, 167, NULL, NULL, 'text', '10um_Met_Quant', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[is_there_metastatic_tumor] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'ten_um_met_currentquant', NULL, 'slide_information', NULL, 168, NULL, NULL, 'text', '10um_Met_CurrentQuant', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[is_there_metastatic_tumor] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'slideloc_metmetastatic', NULL, 'slide_information', NULL, 169, NULL, NULL, 'text', 'SlideLoc_Metmetastatic', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[is_there_metastatic_tumor] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'parapieceloc_metastatic', NULL, 'slide_information', NULL, 170, NULL, NULL, 'text', 'ParaPieceLoc_Metastatic', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[is_there_metastatic_tumor] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'is_there_precancer', NULL, 'slide_information', NULL, 171, NULL, NULL, 'yesno', 'Is There Precancer?', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'precancer_accnum', NULL, 'slide_information', NULL, 172, NULL, NULL, 'text', 'PreCancer_AccNum', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[is_there_precancer] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'five_um_precancer_quant', NULL, 'slide_information', NULL, 173, NULL, NULL, 'text', '5um_Precancer_Quant', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[is_there_precancer] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'five_um_precancer_curquant', NULL, 'slide_information', NULL, 174, NULL, NULL, 'text', '5um_Precancer_CurrentQuant', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[is_there_precancer] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'ten_um_precancer_quant', NULL, 'slide_information', NULL, 175, NULL, NULL, 'text', '10um_Precancer_Quant', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[is_there_precancer] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'ten_um_precancer_curquant', NULL, 'slide_information', NULL, 176, NULL, NULL, 'text', '10um_Precancer_CurQuant', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[is_there_precancer] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'slideloc_precancer', NULL, 'slide_information', NULL, 177, NULL, NULL, 'text', 'SlideLoc_Precancer', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[is_there_precancer] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'parapieceloc_precancer', NULL, 'slide_information', NULL, 178, NULL, NULL, 'text', 'ParaPieceLoc_Precancer', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[is_there_precancer] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'slide_information_complete', NULL, 'slide_information', NULL, 179, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tma_ca_pos1', NULL, 'tma_information', 'TMA Information', 180, NULL, NULL, 'text', 'TMA_Ca_pos1', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tma_ca_pos2', NULL, 'tma_information', NULL, 181, NULL, NULL, 'text', 'TMA_Ca_pos2', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tma_nor_pos1', NULL, 'tma_information', NULL, 182, NULL, NULL, 'text', 'TMA_Nor_pos1', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tma_nor_pos2', NULL, 'tma_information', NULL, 183, NULL, NULL, 'text', 'TMA_Nor_pos2', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tma_preca_pos', NULL, 'tma_information', NULL, 184, NULL, NULL, 'text', 'TMA_ PreCa_pos1', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tma_metastatic_pos', NULL, 'tma_information', NULL, 185, NULL, NULL, 'text', 'TMA Metastatic_pos1', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL);
INSERT INTO redcap_metadata (project_id, field_name, field_phi, form_name, form_menu_description, field_order, field_units, element_preceding_header, element_type, element_label, element_enum, element_note, element_validation_type, element_validation_min, element_validation_max, element_validation_checktype, branching_logic, field_req, edoc_id, edoc_display_img, custom_alignment, stop_actions, question_num, grid_name, misc) VALUES
(@project_id, 'another_accnumber', NULL, 'tma_information', NULL, 186, NULL, NULL, 'yesno', 'Another_AccNumber?', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tma_ca_pos3', NULL, 'tma_information', NULL, 187, NULL, NULL, 'text', 'TMA_Ca_pos3', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[another_accnumber] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tma_ca_pos4', NULL, 'tma_information', NULL, 188, NULL, NULL, 'text', 'TMA_Ca_pos4', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[another_accnumber] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tma_nor_pos3', NULL, 'tma_information', NULL, 189, NULL, NULL, 'text', 'TMA_Nor_pos3', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[another_accnumber] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tma_nor_pos4', NULL, 'tma_information', NULL, 190, NULL, NULL, 'text', 'TMA_Nor_pos4', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[another_accnumber] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tma_preca_pos2', NULL, 'tma_information', NULL, 191, NULL, NULL, 'text', 'TMA_ PreCa_pos2', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[another_accnumber] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tma_metastatic_pos2', NULL, 'tma_information', NULL, 192, NULL, NULL, 'text', 'TMA Metastatic_pos2', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[another_accnumber] = ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'tma_information_complete', NULL, 'tma_information', NULL, 193, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pulling_date1', NULL, 'slide_tracking', 'Slide Tracking', 194, NULL, NULL, 'text', 'Pulling_Date1', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'forwhoseproject', NULL, 'slide_tracking', NULL, 195, NULL, NULL, 'text', 'ForWhoseProject1', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'whichslidepulled1', NULL, 'slide_tracking', NULL, 196, NULL, NULL, 'text', 'WhichSlidePulled1', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pulled_quant1', NULL, 'slide_tracking', NULL, 197, NULL, NULL, 'text', 'Pulled_Quant1', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'slide_tracking_complete', NULL, 'slide_tracking', NULL, 198, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL);

INSERT INTO `redcap_projects_templates` (`project_id`, `title`, `description`, `enabled`)
	VALUES (@project_id,  @project_title,  'Five data entry forms for collecting and tracking information for cancer tissue.',  '1');
-- SQL TO CREATE A REDCAP DEMO PROJECT --
set @project_title = 'Multiple Surveys (classic)';
-- Obtain default values --
set @institution = (select value from redcap_config where field_name = 'institution' limit 1);
set @site_org_type = (select value from redcap_config where field_name = 'site_org_type' limit 1);
set @grant_cite = (select value from redcap_config where field_name = 'grant_cite' limit 1);
set @project_contact_name = (select value from redcap_config where field_name = 'project_contact_name' limit 1);
set @project_contact_email = (select value from redcap_config where field_name = 'project_contact_email' limit 1);
set @headerlogo = (select value from redcap_config where field_name = 'headerlogo' limit 1);
set @auth_meth = (select value from redcap_config where field_name = 'auth_meth_global' limit 1);
-- Create project --
INSERT INTO `redcap_projects`
(survey_email_participant_field, project_name, app_title, status, count_project, auth_meth, creation_time, production_time, institution, site_org_type, grant_cite, project_contact_name, project_contact_email, headerlogo, surveys_enabled, auto_inc_set, display_project_logo_institution) VALUES
('email',concat('redcap_demo_',LEFT(sha1(rand()),6)), @project_title, 1, 0, @auth_meth, now(), now(), @institution, @site_org_type, @grant_cite, @project_contact_name, @project_contact_email, @headerlogo, 1, 1, 0);
set @project_id = LAST_INSERT_ID();
-- Create single arm --
INSERT INTO redcap_events_arms (project_id, arm_num, arm_name) VALUES (@project_id, 1, 'Arm 1');
set @arm_id = LAST_INSERT_ID();
-- Create single event --
INSERT INTO redcap_events_metadata (arm_id, day_offset, offset_min, offset_max, descrip) VALUES (@arm_id, 0, 0, 0, 'Event 1');
set @event_id = LAST_INSERT_ID();
-- Insert into redcap_surveys
INSERT INTO redcap_surveys (project_id, font_family, form_name, title, instructions, acknowledgement, question_by_section, question_auto_numbering, survey_enabled, save_and_return, logo, hide_title, view_results, min_responses_view_results, check_diversity_view_results, end_survey_redirect_url, survey_expiration) VALUES
(@project_id, '16', 'participant_info_survey', 'Follow-Up Survey', '<p><strong>Please complete the survey below.</strong></p>\r\n<p>Thank you!</p>', '<p><strong>Thank you for taking the survey.</strong></p>\r\n<p>Have a nice day!</p>', 0, 1, 1, 1, NULL, 0, 0, 10, 0, NULL, NULL),
(@project_id, '16', 'participant_morale_questionnaire', 'Patient Morale Questionnaire', '<p><strong>Please complete the survey below.</strong></p>\r\n<p>Thank you!</p>', '<p><strong>Thank you for taking the survey.</strong></p>\r\n<p>Have a nice day!</p>', 0, 1, 1, 1, NULL, 0, 0, 10, 0, NULL, NULL),
(@project_id, '16', 'prescreening_survey', 'Pre-Screening Survey', '<p><strong>Please complete the survey below.</strong></p>\r\n<p>Thank you!</p>', '<p><strong>Thank you for taking the survey.</strong></p>\r\n<p>Have a nice day!</p>', 0, 1, 1, 0, NULL, 0, 0, 10, 0, NULL, NULL);
-- Insert into redcap_metadata --
INSERT INTO redcap_metadata (project_id, field_name, field_phi, form_name, form_menu_description, field_order, field_units, element_preceding_header, element_type, element_label, element_enum, element_note, element_validation_type, element_validation_min, element_validation_max, element_validation_checktype, branching_logic, field_req, edoc_id, edoc_display_img, custom_alignment, stop_actions, question_num, grid_name, misc) VALUES
(@project_id, 'participant_id', NULL, 'prescreening_survey', 'Pre-Screening Survey', 1, NULL, NULL, 'text', 'Participant ID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'dob', NULL, 'prescreening_survey', NULL, 2, NULL, 'Please fill out the information below.', 'text', 'Date of birth', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'email', '1', 'prescreening_survey', NULL, 2.1, NULL, NULL, 'text', 'E-mail address', NULL, NULL, 'email', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'has_diabetes', NULL, 'prescreening_survey', NULL, 3, NULL, NULL, 'truefalse', 'I currently have Type 2 Diabetes', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'consent', NULL, 'prescreening_survey', NULL, 4, NULL, NULL, 'checkbox', 'By checking this box, I certify that I am at least 18 years old and that I give my consent freely to participate in this study.', '1, I consent', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prescreening_survey_complete', NULL, 'prescreening_survey', NULL, 5, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'first_name', '1', 'participant_info_survey', 'Participant Info Survey', 6, NULL, 'As a participant in this study, please answer the questions below. Thank you!', 'text', 'First Name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'last_name', '1', 'participant_info_survey', NULL, 7, NULL, NULL, 'text', 'Last Name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'address', '1', 'participant_info_survey', NULL, 8, NULL, NULL, 'textarea', 'Street, City, State, ZIP', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'telephone_1', '1', 'participant_info_survey', NULL, 9, NULL, NULL, 'text', 'Phone number', NULL, 'Include Area Code', 'phone', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'ethnicity', NULL, 'participant_info_survey', NULL, 11, NULL, NULL, 'radio', 'Ethnicity', '0, Hispanic or Latino \\n 1, NOT Hispanic or Latino \\n 2, Unknown / Not Reported', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 'LH', NULL, NULL, NULL, NULL),
(@project_id, 'race', NULL, 'participant_info_survey', NULL, 12, NULL, NULL, 'select', 'Race', '0, American Indian/Alaska Native \\n 1, Asian \\n 2, Native Hawaiian or Other Pacific Islander \\n 3, Black or African American \\n 4, White \\n 5, More Than One Race \\n 6, Unknown / Not Reported', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'sex', NULL, 'participant_info_survey', NULL, 13, NULL, NULL, 'radio', 'sex', '0, Female \\n 1, Male \\n 2, Other \\n 3, Prefer not to say', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'height', NULL, 'participant_info_survey', NULL, 14, NULL, NULL, 'text', 'Height (cm)', NULL, NULL, 'float', '130', '215', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'weight', NULL, 'participant_info_survey', NULL, 15, NULL, NULL, 'text', 'Weight (kilograms)', NULL, NULL, 'int', '35', '200', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'participant_info_survey_complete', NULL, 'participant_info_survey', NULL, 16, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pmq1', NULL, 'participant_morale_questionnaire', 'Participant Morale Questionnaire', 17, NULL, 'As a participant in this study, please answer the questions below. Thank you!', 'select', 'On average, how many pills did you take each day last week?', '0, Less than 5 \\n 1, 5-10 \\n 2, 6-15 \\n 3, Over 15', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pmq2', NULL, 'participant_morale_questionnaire', NULL, 18, NULL, NULL, 'select', 'Using the handout, which level of dependence do you feel you are currently at?', '0, 0 \\n 1, 1 \\n 2, 2 \\n 3, 3 \\n 4, 4 \\n 5, 5', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pmq3', NULL, 'participant_morale_questionnaire', NULL, 19, NULL, NULL, 'yesno', 'Would you be willing to discuss your experiences with a psychiatrist?', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pmq4', NULL, 'participant_morale_questionnaire', NULL, 20, NULL, NULL, 'select', 'How open are you to further testing?', '0, Not open \\n 1, Undecided \\n 2, Very open', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'participant_morale_questionnaire_complete', NULL, 'participant_morale_questionnaire', NULL, 21, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'complete_study', NULL, 'completion_data', 'Completion Data (to be entered by study personnel only)', 22, NULL, 'This form is to be filled out by study personnel.', 'yesno', 'Has patient completed study?', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'withdraw_date', NULL, 'completion_data', NULL, 23, NULL, NULL, 'text', 'Put a date if patient withdrew study', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'withdraw_reason', NULL, 'completion_data', NULL, 24, NULL, NULL, 'select', 'Reason patient withdrew from study', '0, Non-compliance \\n 1, Did not wish to continue in study \\n 2, Could not tolerate the supplement \\n 3, Hospitalization \\n 4, Other', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'date_visit_4', NULL, 'completion_data', NULL, 25, NULL, NULL, 'text', 'Date of last visit', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'discharge_date_4', NULL, 'completion_data', NULL, 26, NULL, NULL, 'text', 'Date of hospital discharge', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'discharge_summary_4', NULL, 'completion_data', NULL, 27, NULL, NULL, 'select', 'Discharge summary in patients binder?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'study_comments', NULL, 'completion_data', NULL, 28, NULL, NULL, 'textarea', 'Comments', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'completion_data_complete', NULL, 'completion_data', NULL, 29, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL);

INSERT INTO `redcap_projects_templates` (`project_id`, `title`, `description`, `enabled`)
	VALUES (@project_id,  @project_title,  'Three surveys and a data entry form. Includes a pre-screening survey followed by two follow-up surveys to capture information from the participant, and then a data entry form for final data to be entered by the study personnel. The project data is captured in classic data collection format.',  '1');
-- SQL TO CREATE A REDCAP DEMO PROJECT --
set @project_title = 'Multiple Surveys (longitudinal)';
-- Obtain default values --
set @institution = (select value from redcap_config where field_name = 'institution' limit 1);
set @site_org_type = (select value from redcap_config where field_name = 'site_org_type' limit 1);
set @grant_cite = (select value from redcap_config where field_name = 'grant_cite' limit 1);
set @project_contact_name = (select value from redcap_config where field_name = 'project_contact_name' limit 1);
set @project_contact_email = (select value from redcap_config where field_name = 'project_contact_email' limit 1);
set @headerlogo = (select value from redcap_config where field_name = 'headerlogo' limit 1);
set @auth_meth = (select value from redcap_config where field_name = 'auth_meth_global' limit 1);
-- Create project --
INSERT INTO `redcap_projects`
(survey_email_participant_field,project_name, app_title, status, repeatforms, count_project, auth_meth, creation_time, production_time, institution, site_org_type, grant_cite, project_contact_name, project_contact_email, headerlogo, surveys_enabled, auto_inc_set, display_project_logo_institution) VALUES
('email',concat('redcap_demo_',LEFT(sha1(rand()),6)), @project_title, 1, 1, 0, @auth_meth, now(), now(), @institution, @site_org_type, @grant_cite, @project_contact_name, @project_contact_email, @headerlogo, 1, 1, 0);
set @project_id = LAST_INSERT_ID();
-- Create single arm --
INSERT INTO redcap_events_arms (project_id, arm_num, arm_name) VALUES (@project_id, 1, 'Arm 1');
set @arm_id = LAST_INSERT_ID();
-- Create events --
INSERT INTO redcap_events_metadata (arm_id, day_offset, offset_min, offset_max, descrip, external_id) VALUES(@arm_id, 0, 0, 0, 'Initial Data', NULL);
set @event_id = LAST_INSERT_ID();
INSERT INTO redcap_events_forms (event_id, form_name) VALUES(@event_id, 'prescreening_survey');
INSERT INTO redcap_events_forms (event_id, form_name) VALUES(@event_id, 'participant_info_survey');
INSERT INTO redcap_events_metadata (arm_id, day_offset, offset_min, offset_max, descrip, external_id) VALUES(@arm_id, 1, 0, 0, 'Week 1', NULL);
set @event_id = LAST_INSERT_ID();
INSERT INTO redcap_events_forms (event_id, form_name) VALUES(@event_id, 'participant_morale_questionnaire');
INSERT INTO redcap_events_metadata (arm_id, day_offset, offset_min, offset_max, descrip, external_id) VALUES(@arm_id, 8, 0, 0, 'Week 2', NULL);
set @event_id = LAST_INSERT_ID();
INSERT INTO redcap_events_forms (event_id, form_name) VALUES(@event_id, 'participant_morale_questionnaire');
INSERT INTO redcap_events_metadata (arm_id, day_offset, offset_min, offset_max, descrip, external_id) VALUES(@arm_id, 15, 0, 0, 'Week 3', NULL);
set @event_id = LAST_INSERT_ID();
INSERT INTO redcap_events_forms (event_id, form_name) VALUES(@event_id, 'participant_morale_questionnaire');
INSERT INTO redcap_events_metadata (arm_id, day_offset, offset_min, offset_max, descrip, external_id) VALUES(@arm_id, 22, 0, 0, 'Week 4', NULL);
set @event_id = LAST_INSERT_ID();
INSERT INTO redcap_events_forms (event_id, form_name) VALUES(@event_id, 'participant_morale_questionnaire');
INSERT INTO redcap_events_metadata (arm_id, day_offset, offset_min, offset_max, descrip, external_id) VALUES(@arm_id, 30, 0, 0, 'Final Data', NULL);
set @event_id = LAST_INSERT_ID();
INSERT INTO redcap_events_forms (event_id, form_name) VALUES(@event_id, 'completion_data');
-- Insert into redcap_surveys
INSERT INTO redcap_surveys (project_id, font_family, form_name, title, instructions, acknowledgement, question_by_section, question_auto_numbering, survey_enabled, save_and_return, logo, hide_title, view_results, min_responses_view_results, check_diversity_view_results, end_survey_redirect_url, survey_expiration) VALUES
(@project_id, '16', 'participant_info_survey', 'Follow-Up Survey', '<p><strong>Please complete the survey below.</strong></p>\r\n<p>Thank you!</p>', '<p><strong>Thank you for taking the survey.</strong></p>\r\n<p>Have a nice day!</p>', 0, 1, 1, 1, NULL, 0, 0, 10, 0, NULL, NULL),
(@project_id, '16', 'participant_morale_questionnaire', 'Patient Morale Questionnaire', '<p><strong>Please complete the survey below.</strong></p>\r\n<p>Thank you!</p>', '<p><strong>Thank you for taking the survey.</strong></p>\r\n<p>Have a nice day!</p>', 0, 1, 1, 1, NULL, 0, 0, 10, 0, NULL, NULL),
(@project_id, '16', 'prescreening_survey', 'Pre-Screening Survey', '<p><strong>Please complete the survey below.</strong></p>\r\n<p>Thank you!</p>', '<p><strong>Thank you for taking the survey.</strong></p>\r\n<p>Have a nice day!</p>', 0, 1, 1, 0, NULL, 0, 0, 10, 0, NULL, NULL);
-- Insert into redcap_metadata --
INSERT INTO redcap_metadata (project_id, field_name, field_phi, form_name, form_menu_description, field_order, field_units, element_preceding_header, element_type, element_label, element_enum, element_note, element_validation_type, element_validation_min, element_validation_max, element_validation_checktype, branching_logic, field_req, edoc_id, edoc_display_img, custom_alignment, stop_actions, question_num, grid_name, misc) VALUES
(@project_id, 'participant_id', NULL, 'prescreening_survey', 'Pre-Screening Survey', 1, NULL, NULL, 'text', 'Participant ID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'dob', NULL, 'prescreening_survey', NULL, 2, NULL, 'Please fill out the information below.', 'text', 'Date of birth', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'email', '1', 'prescreening_survey', NULL, 2.1, NULL, NULL, 'text', 'E-mail address', NULL, NULL, 'email', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'has_diabetes', NULL, 'prescreening_survey', NULL, 3, NULL, NULL, 'truefalse', 'I currently have Type 2 Diabetes', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'consent', NULL, 'prescreening_survey', NULL, 4, NULL, NULL, 'checkbox', 'By checking this box, I certify that I am at least 18 years old and that I give my consent freely to participate in this study.', '1, I consent', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'prescreening_survey_complete', NULL, 'prescreening_survey', NULL, 5, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'first_name', '1', 'participant_info_survey', 'Participant Info Survey', 6, NULL, 'As a participant in this study, please answer the questions below. Thank you!', 'text', 'First Name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'last_name', '1', 'participant_info_survey', NULL, 7, NULL, NULL, 'text', 'Last Name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'address', '1', 'participant_info_survey', NULL, 8, NULL, NULL, 'textarea', 'Street, City, State, ZIP', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'telephone_1', '1', 'participant_info_survey', NULL, 9, NULL, NULL, 'text', 'Phone number', NULL, 'Include Area Code', 'phone', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'ethnicity', NULL, 'participant_info_survey', NULL, 11, NULL, NULL, 'radio', 'Ethnicity', '0, Hispanic or Latino \\n 1, NOT Hispanic or Latino \\n 2, Unknown / Not Reported', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 'LH', NULL, NULL, NULL, NULL),
(@project_id, 'race', NULL, 'participant_info_survey', NULL, 12, NULL, NULL, 'select', 'Race', '0, American Indian/Alaska Native \\n 1, Asian \\n 2, Native Hawaiian or Other Pacific Islander \\n 3, Black or African American \\n 4, White \\n 5, More Than One Race \\n 6, Unknown / Not Reported', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'sex', NULL, 'participant_info_survey', NULL, 13, NULL, NULL, 'radio', 'sex', '0, Female \\n 1, Male \\n 2, Other \\n 3, Prefer not to say', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'height', NULL, 'participant_info_survey', NULL, 14, NULL, NULL, 'text', 'Height (cm)', NULL, NULL, 'float', '130', '215', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'weight', NULL, 'participant_info_survey', NULL, 15, NULL, NULL, 'text', 'Weight (kilograms)', NULL, NULL, 'int', '35', '200', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'participant_info_survey_complete', NULL, 'participant_info_survey', NULL, 16, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pmq1', NULL, 'participant_morale_questionnaire', 'Participant Morale Questionnaire', 17, NULL, 'As a participant in this study, please answer the questions below concerning the PAST WEEK. Thank you!', 'select', 'On average, how many pills did you take each day last week?', '0, Less than 5 \\n 1, 5-10 \\n 2, 6-15 \\n 3, Over 15', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'pmq2', NULL, 'participant_morale_questionnaire', NULL, 18, NULL, NULL, 'select', 'Using the handout, which level of dependence do you feel you are currently at?', '0, 0 \\n 1, 1 \\n 2, 2 \\n 3, 3 \\n 4, 4 \\n 5, 5', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'choices', NULL, 'participant_morale_questionnaire', NULL, 19, NULL, 'Concerning the past week, how do you feel about ...', 'radio', 'The choices you made', '1, Not satisfied at all \\n 2, Somewhat dissatisfied \\n 3, Indifferent \\n 4, Somewhat satisfied \\n 5, Very satisfied', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, 'feelings_matrix', NULL),
(@project_id, 'life', NULL, 'participant_morale_questionnaire', NULL, 20, NULL, NULL, 'radio', 'Your life overall', '1, Not satisfied at all \\n 2, Somewhat dissatisfied \\n 3, Indifferent \\n 4, Somewhat satisfied \\n 5, Very satisfied', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, 'feelings_matrix', NULL),
(@project_id, 'job', NULL, 'participant_morale_questionnaire', NULL, 21, NULL, NULL, 'radio', 'Your job', '1, Not satisfied at all \\n 2, Somewhat dissatisfied \\n 3, Indifferent \\n 4, Somewhat satisfied \\n 5, Very satisfied', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, 'feelings_matrix', NULL),
(@project_id, 'family', NULL, 'participant_morale_questionnaire', NULL, 22, NULL, NULL, 'radio', 'Your family life', '1, Not satisfied at all \\n 2, Somewhat dissatisfied \\n 3, Indifferent \\n 4, Somewhat satisfied \\n 5, Very satisfied', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, 'feelings_matrix', NULL),
(@project_id, 'participant_morale_questionnaire_complete', NULL, 'participant_morale_questionnaire', NULL, 23, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'complete_study', NULL, 'completion_data', 'Completion Data (to be entered by study personnel only)', 24, NULL, 'This form is to be filled out by study personnel.', 'yesno', 'Has patient completed study?', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'withdraw_date', NULL, 'completion_data', NULL, 25, NULL, NULL, 'text', 'Put a date if patient withdrew study', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'withdraw_reason', NULL, 'completion_data', NULL, 26, NULL, NULL, 'select', 'Reason patient withdrew from study', '0, Non-compliance \\n 1, Did not wish to continue in study \\n 2, Could not tolerate the supplement \\n 3, Hospitalization \\n 4, Other', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'date_visit_4', NULL, 'completion_data', NULL, 27, NULL, NULL, 'text', 'Date of last visit', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'discharge_date_4', NULL, 'completion_data', NULL, 28, NULL, NULL, 'text', 'Date of hospital discharge', NULL, NULL, 'date_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'discharge_summary_4', NULL, 'completion_data', NULL, 29, NULL, NULL, 'select', 'Discharge summary in patients binder?', '0, No \\n 1, Yes', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'study_comments', NULL, 'completion_data', NULL, 30, NULL, NULL, 'textarea', 'Comments', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'completion_data_complete', NULL, 'completion_data', NULL, 31, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL);

INSERT INTO `redcap_projects_templates` (`project_id`, `title`, `description`, `enabled`)
	VALUES (@project_id,  @project_title,  'Three surveys and a data entry form. Includes a pre-screening survey followed by two follow-up surveys, one of which is a questionnaire takenly weekly to capture participant information longitudinally over a period of one month. The surveys are followed by a data entry form for final data to be entered by the study personnel. The project data is captured in longitudinal data collection format.',  '1');
-- SQL TO CREATE A REDCAP DEMO PROJECT --
set @project_title = 'Piping Example Project';
-- Obtain default values --
set @institution = (select value from redcap_config where field_name = 'institution' limit 1);
set @site_org_type = (select value from redcap_config where field_name = 'site_org_type' limit 1);
set @grant_cite = (select value from redcap_config where field_name = 'grant_cite' limit 1);
set @project_contact_name = (select value from redcap_config where field_name = 'project_contact_name' limit 1);
set @project_contact_email = (select value from redcap_config where field_name = 'project_contact_email' limit 1);
set @headerlogo = (select value from redcap_config where field_name = 'headerlogo' limit 1);
set @auth_meth = (select value from redcap_config where field_name = 'auth_meth_global' limit 1);
-- Create project --
INSERT INTO `redcap_projects`
(project_name, app_title, status, count_project, auth_meth, creation_time, production_time, institution, site_org_type, grant_cite, project_contact_name, project_contact_email, headerlogo, surveys_enabled, auto_inc_set, display_project_logo_institution) VALUES
(concat('redcap_demo_',LEFT(sha1(rand()),6)), @project_title, 1, 0, @auth_meth, now(), now(), @institution, @site_org_type, @grant_cite, @project_contact_name, @project_contact_email, @headerlogo, 1, 1, 0);
set @project_id = LAST_INSERT_ID();
-- Create single arm --
INSERT INTO redcap_events_arms (project_id, arm_num, arm_name) VALUES (@project_id, 1, 'Arm 1');
set @arm_id = LAST_INSERT_ID();
-- Create single event --
INSERT INTO redcap_events_metadata (arm_id, day_offset, offset_min, offset_max, descrip) VALUES (@arm_id, 0, 0, 0, 'Event 1');
set @event_id = LAST_INSERT_ID();
-- Insert into redcap_surveys
INSERT INTO redcap_surveys (project_id, form_name, title, instructions, acknowledgement, question_by_section, question_auto_numbering, survey_enabled, save_and_return, logo, hide_title) VALUES
(@project_id, 'survey', 'Example Survey to Demonstrate Piping', 'This survey will demonstrate some basic examples of the Piping feature in REDCap.', '<p style="font-size:14px;"><strong>[first_name], thank you for taking the survey.</strong></p><br><p>Have a nice day!</p>', 1, 0, 1, 0, NULL, 0);
-- Insert into redcap_metadata --
INSERT INTO `redcap_metadata` (`project_id`, `field_name`, `field_phi`, `form_name`, `form_menu_description`, `field_order`, `field_units`, `element_preceding_header`, `element_type`, `element_label`, `element_enum`, `element_note`, `element_validation_type`, `element_validation_min`, `element_validation_max`, `element_validation_checktype`, `branching_logic`, `field_req`, `edoc_id`, `edoc_display_img`, `custom_alignment`, `stop_actions`, `question_num`, `grid_name`, `misc`) VALUES
(@project_id, 'participant_id', NULL, 'survey', 'Example Survey', 1, NULL, NULL, 'text', 'Participant ID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'first_name', NULL, 'survey', NULL, 2, NULL, 'Section 1', 'text', 'Your first name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'last_name', NULL, 'survey', NULL, 3, NULL, NULL, 'text', 'Your last name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'date_today', NULL, 'survey', NULL, 4, NULL, NULL, 'text', '[first_name], please enter today''s date?', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'ice_cream', NULL, 'survey', NULL, 5, NULL, NULL, 'radio', 'What is your favorite ice cream?', '1, Chocolate \\n 2, Vanilla \\n 3, Strawberry', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'slider', NULL, 'survey', NULL, 6, NULL, 'Section 2', 'slider', 'How much do you like [ice_cream] ice cream?', 'Hate it | Indifferent | I love [ice_cream]!', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'number', NULL, 'survey', NULL, 7, NULL, NULL, 'text', 'Enter your favorite number', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'calc', NULL, 'survey', NULL, 8, NULL, NULL, 'calc', 'Your favorite number above multiplied by 4 is:', '[number]*4', '[number] x 4 = [calc]', NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'upload', NULL, 'survey', NULL, 9, NULL, NULL, 'file', 'Upload an image file to see it displayed inline on the page near the end of the survey', NULL, 'File must be PNG, JPG, JPEG, GIF, or BMP', NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'confirm_name', NULL, 'survey', NULL, 10, NULL, NULL, 'radio', 'Please confirm your name', '0, [first_name] Harris \\n 1, [first_name] [last_name] \\n 2, [first_name] Taylor \\n 3, [first_name] deGrasse Tyson', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'confirm_name_error', NULL, 'survey', NULL, 11, NULL, NULL, 'descriptive', '<div class="red" style="padding:30px;"><b>ERROR:</b> Please try again!</div>', NULL, NULL, NULL, NULL, NULL, NULL, '[confirm_name] != '''' and [confirm_name] != ''1''', 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'review_answers', NULL, 'survey', NULL, 12, NULL, 'Review answers', 'descriptive', 'Review your answers below:\n\n<div style="font-size:14px;color:red;">Date: [date_today]\nName: [first_name] [last_name]\nFavorite ice cream: [ice_cream]\nFavorite number multiplied by 4: [calc]</div>\nDisplayed below is the image you uploaded named <u>[upload:label]</u>:\n[upload:inline]\n\nIf all your responses look correct and you did not leave any blank, then click the Submit button below.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL),
(@project_id, 'survey_complete', NULL, 'survey', NULL, 13, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL);

INSERT INTO `redcap_projects_templates` (`project_id`, `title`, `description`, `enabled`)
	VALUES (@project_id,  @project_title,  'Single data collection instrument enabled as a survey, which contains questions to demonstrate the Piping feature.',  '1');
-- SQL TO CREATE A REDCAP DEMO PROJECT --
set @project_title = 'Repeating Instruments';

-- Obtain default values --
set @institution = (select value from redcap_config where field_name = 'institution' limit 1);
set @site_org_type = (select value from redcap_config where field_name = 'site_org_type' limit 1);
set @grant_cite = (select value from redcap_config where field_name = 'grant_cite' limit 1);
set @project_contact_name = (select value from redcap_config where field_name = 'project_contact_name' limit 1);
set @project_contact_email = (select value from redcap_config where field_name = 'project_contact_email' limit 1);
set @headerlogo = (select value from redcap_config where field_name = 'headerlogo' limit 1);
set @auth_meth = (select value from redcap_config where field_name = 'auth_meth_global' limit 1);
-- Create project --
INSERT INTO `redcap_projects`
(project_name, app_title, status, count_project, auth_meth, creation_time, production_time, institution, site_org_type, grant_cite, project_contact_name, project_contact_email, headerlogo, display_project_logo_institution, auto_inc_set) VALUES
(concat('redcap_demo_',LEFT(sha1(rand()),6)), @project_title, 1, 0, @auth_meth, now(), now(), @institution, @site_org_type, @grant_cite, @project_contact_name, @project_contact_email, @headerlogo, 0, 1);
set @project_id = LAST_INSERT_ID();
-- Create single arm --
INSERT INTO redcap_events_arms (project_id, arm_num, arm_name) VALUES (@project_id, 1, 'Arm 1');
set @arm_id = LAST_INSERT_ID();
-- Create single event --
INSERT INTO redcap_events_metadata (arm_id, day_offset, offset_min, offset_max, descrip) VALUES (@arm_id, 0, 0, 0, 'Event 1');
set @event_id = LAST_INSERT_ID();
-- Insert into redcap_metadata --
INSERT INTO `redcap_metadata` (`project_id`, `field_name`, `field_phi`, `form_name`, `form_menu_description`, `field_order`, `field_units`, `element_preceding_header`, `element_type`, `element_label`, `element_enum`, `element_note`, `element_validation_type`, `element_validation_min`, `element_validation_max`, `element_validation_checktype`, `branching_logic`, `field_req`, `edoc_id`, `edoc_display_img`, `custom_alignment`, `stop_actions`, `question_num`, `grid_name`, `grid_rank`, `misc`, `video_url`, `video_display_inline`) VALUES
(@project_id, 'record_id', NULL, 'demographics', 'Demographics', 1, NULL, NULL, 'text', 'Study ID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'first_name', '1', 'demographics', NULL, 2, NULL, NULL, 'text', 'First Name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'last_name', '1', 'demographics', NULL, 3, NULL, NULL, 'text', 'Last Name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'sex', NULL, 'demographics', NULL, 4, NULL, NULL, 'radio', 'sex', '0, Female \\n 1, Male \\n 2, Other \\n 3, Prefer not to say', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'notes', NULL, 'demographics', NULL, 5, NULL, NULL, 'textarea', 'Notes', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'demographics_complete', NULL, 'demographics', NULL, 6, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'medication_name', NULL, 'medications', 'Medications', 7, NULL, NULL, 'text', 'Medication name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'dosage', NULL, 'medications', NULL, 8, NULL, NULL, 'text', 'Dosage', NULL, 'mg', 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'medications_complete', NULL, 'medications', NULL, 9, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'family_member', NULL, 'family_members', 'Family Members', 10, NULL, 'Family member information', 'text', 'Name of family member', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'relation_to_patient', NULL, 'family_members', NULL, 11, NULL, NULL, 'select', 'Relation to patient', '1, Sibling\\n2, Spouse\\n3, Parent\\n4, Child very long choice right here that is long\\n5, Other', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'age_of_family_member', NULL, 'family_members', NULL, 12, NULL, NULL, 'text', 'Age of family member', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'family_members_complete', NULL, 'family_members', NULL, 13, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'visit_date', NULL, 'visits', 'Visits', 14, NULL, NULL, 'text', 'Date', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@TODAY', NULL, 0),
(@project_id, 'weight', NULL, 'visits', NULL, 15, NULL, NULL, 'text', 'Weight', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'other_visit_data', NULL, 'visits', NULL, 16, NULL, NULL, 'textarea', 'Other data', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'visits_complete', NULL, 'visits', NULL, 17, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aeyn', NULL, 'adverse_events', 'Adverse Events', 18, NULL, NULL, 'radio', 'Were any adverse events experienced?', '0, No\\n1, Yes', 'Indicate if the subject experienced any adverse events.', NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aespid', NULL, 'adverse_events', NULL, 19, NULL, NULL, 'text', 'AE Identifier', NULL, 'Record unique identifier for each adverse event for this subject.<br><br>Number sequence for all following forms should not duplicate existing numbers for the subject.', NULL, NULL, NULL, 'soft_typed', '[aeyn] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aeterm', NULL, 'adverse_events', NULL, 20, NULL, NULL, 'text', 'What is the adverse event term?', NULL, 'Record only one diagnosis, sign or symptom per form (e.g., nausea and vomiting should not be recorded in the same entry, but as two separate entries).  See eCRF completion instruction for more information.', NULL, NULL, NULL, 'soft_typed', '[aeyn] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aeoccur', NULL, 'adverse_events', NULL, 21, NULL, NULL, 'radio', 'Does the subject have (specific adverse event)?', '0, No\\n1, Yes', 'Please indicate if (specific adverse event) has occurred /is occurring by checking Yes or No.', NULL, NULL, NULL, NULL, '[aeyn] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aestdat', NULL, 'adverse_events', NULL, 22, NULL, NULL, 'text', 'What is the date the adverse event started?', NULL, 'Record the start date of the adverse event using the MM-DD-YYYY format.', 'date_mdy', NULL, NULL, 'soft_typed', '[aeyn] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aesttim', NULL, 'adverse_events', NULL, 23, NULL, NULL, 'text', 'At what time did the adverse event start?', NULL, 'If appropriate, record the time the AE started using the HH:MM (24-hour clock) format.', 'time', NULL, NULL, 'soft_typed', '[aeyn] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aeongo', NULL, 'adverse_events', NULL, 24, NULL, NULL, 'radio', 'Is the adverse event still ongoing?', '0, No\\n1, Yes', 'Select one.', NULL, NULL, NULL, NULL, '[aeyn] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aeendat', NULL, 'adverse_events', NULL, 25, NULL, NULL, 'text', 'What date did the adverse event end?', NULL, 'Record the end date of the adverse event using the MM-DD-YYYY format.', 'date_mdy', NULL, NULL, 'soft_typed', '[aeongo] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aeentim', NULL, 'adverse_events', NULL, 26, NULL, NULL, 'text', 'At what time did the adverse event end?', NULL, 'If appropriate, record the time the AE ended using the HH:MM (24-hour clock) format.', 'time', NULL, NULL, 'soft_typed', '[aeongo] = "0"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aesev', NULL, 'adverse_events', NULL, 27, NULL, NULL, 'radio', 'What was the severity of the adverse event?', '1, Mild\\n2, Moderate\\n3, Severe', 'The reporting physician/healthcare professional will assess the severity of the event using the sponsor-defined categories. This assessment is subjective and the reporting physician/ healthcare professional should use medical judgment to compare the reported Adverse Event to similar type events observed in clinical practice. Severity is not equivalent to seriousness.', NULL, NULL, NULL, NULL, '[aeyn] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aetoxgr', NULL, 'adverse_events', NULL, 28, NULL, NULL, 'radio', 'What is the toxicity grade of the adverse event?', '1, Grade 1\\n2, Grade 2\\n3, Grade 3\\n4, Grade 4\\n5, Grade 5', 'Severity CTCAE Grade<br><br>The reporting physician/healthcare professional will assess the severity of the adverse event using the toxicity grades.', NULL, NULL, NULL, NULL, '[aeyn] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aeser', NULL, 'adverse_events', NULL, 29, NULL, NULL, 'radio', 'Is the adverse event serious?', '0, No\\n1, Yes', 'Assess if an adverse event should be classified as serious based on the serious criteria defined in the protocol.', NULL, NULL, NULL, NULL, '[aeyn] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aescong', NULL, 'adverse_events', NULL, 30, NULL, NULL, 'radio', 'Is the adverse event associated with a congenital anomaly or birth defect?', '0, No\\n1, Yes', 'Record whether the serious adverse event was associated with congenital anomaly or birth defect.', NULL, NULL, NULL, NULL, '[aeser] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aesdisab', NULL, 'adverse_events', NULL, 31, NULL, NULL, 'radio', 'Did the adverse event result in Persistent or significant disability or incapacity?', '0, No\\n1, Yes', 'Record whether the serious adverse event resulted in a persistent or significant disability or incapacity.', NULL, NULL, NULL, NULL, '[aeser] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aesdth', NULL, 'adverse_events', NULL, 32, NULL, NULL, 'radio', 'Did the adverse event result in death?', '0, No\\n1, Yes', 'Record whether the serious adverse event resulted in death.', NULL, NULL, NULL, NULL, '[aeser] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aeshosp', NULL, 'adverse_events', NULL, 33, NULL, NULL, 'radio', 'Did the adverse event result in initial or prolonged hospitalization for the subject?', '0, No\\n1, Yes', 'Record whether the serious adverse event resulted in an initial or prolonged hospitalization.', NULL, NULL, NULL, NULL, '[aeser] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aeslife', NULL, 'adverse_events', NULL, 34, NULL, NULL, 'radio', 'Is the adverse event Life Threatening?', '0, No\\n1, Yes', 'Record whether the serious adverse event is life threatening.', NULL, NULL, NULL, NULL, '[aeser] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aesmie', NULL, 'adverse_events', NULL, 35, NULL, NULL, 'radio', 'Is the adverse event a medically important event not covered by other ?serious? criteria?', '0, No\\n1, Yes', 'Record whether the serious adverse event is an important medical event, which may be defined in the protocol or in the Investigator Brochure.', NULL, NULL, NULL, NULL, '[aeser] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aerel', NULL, 'adverse_events', NULL, 36, NULL, NULL, 'radio', 'Is this event related to study treatment?', '1, Definitely\\n2, Probably\\n3, Possibly\\n4, Not Related', 'Indicate if the cause of the adverse event is related to the study treatment and cannot be reasonably explained by other factors (e.g., subject\'s clinical state, concomitant therapy, and/or other interventions).', NULL, NULL, NULL, NULL, '[aeyn] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aeacn', NULL, 'adverse_events', NULL, 37, NULL, NULL, 'radio', 'What action was taken with study treatment?', '1, Dose Increased\\n2, Dose Not Changed\\n3, Dose Reduced\\n4, Drug Interrupted\\n5, Drug Withdrawn\\n6, Not Applicable\\n99, Unknown', 'Record changes made to the study treatment resulting from the adverse event.', NULL, NULL, NULL, NULL, '[aeyn] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aeacnoth', NULL, 'adverse_events', NULL, 38, NULL, NULL, 'textarea', 'What other action was taken in response to this adverse event?', NULL, 'Record all action(s) taken resulting from the adverse event.', NULL, NULL, NULL, NULL, '[aeyn] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aeout', NULL, 'adverse_events', NULL, 39, NULL, NULL, 'radio', 'What was the outcome of this adverse event?', '1, Fatal\\n2, Not recovered / Not resolved\\n3, Recovered / Resolved\\n4, Recovered / Resolved with sequelae\\n5, Recovering / Resolving\\n99, Unknown', 'Record the appropriate outcome of the event in relation to the subject\'s status.', NULL, NULL, NULL, NULL, '[aeyn] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'aedis', NULL, 'adverse_events', NULL, 40, NULL, NULL, 'radio', 'Did the adverse event cause the subject to be discontinued from the study?', '0, No\\n1, Yes', 'Record if the AE caused the subject to discontinue from the study.', NULL, NULL, NULL, NULL, '[aeyn] = "1"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'adverse_events_complete', NULL, 'adverse_events', NULL, 41, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0);
INSERT INTO `redcap_events_repeat` (`event_id`, `form_name`, `custom_repeat_form_label`) VALUES
(@event_id, 'adverse_events', NULL),
(@event_id, 'family_members', '[family_member]'),
(@event_id, 'medications', '[medication_name] [dosage]mg'),
(@event_id, 'visits', '[weight]kg ([visit_date])');
INSERT INTO `redcap_projects_templates` (`project_id`, `title`, `description`, `enabled`)
	VALUES (@project_id,  @project_title,  'Example of Repeating Instruments.',  '1');
-- SQL TO CREATE A REDCAP DEMO PROJECT --
set @project_title = 'Field Embedding Example Project';


-- Obtain default values --
set @institution = (select value from redcap_config where field_name = 'institution' limit 1);
set @site_org_type = (select value from redcap_config where field_name = 'site_org_type' limit 1);
set @grant_cite = (select value from redcap_config where field_name = 'grant_cite' limit 1);
set @project_contact_name = (select value from redcap_config where field_name = 'project_contact_name' limit 1);
set @project_contact_email = (select value from redcap_config where field_name = 'project_contact_email' limit 1);
set @headerlogo = (select value from redcap_config where field_name = 'headerlogo' limit 1);
set @auth_meth = (select value from redcap_config where field_name = 'auth_meth_global' limit 1);
-- Create project --
INSERT INTO `redcap_projects`
(project_name, app_title, status, count_project, auth_meth, creation_time, production_time, institution, site_org_type, grant_cite, project_contact_name, project_contact_email, headerlogo, display_project_logo_institution, auto_inc_set) VALUES
(concat('redcap_demo_',LEFT(sha1(rand()),6)), @project_title, 1, 0, @auth_meth, now(), now(), @institution, @site_org_type, @grant_cite, @project_contact_name, @project_contact_email, @headerlogo, 0, 1);
set @project_id = LAST_INSERT_ID();
-- Create single arm --
INSERT INTO redcap_events_arms (project_id, arm_num, arm_name) VALUES (@project_id, 1, 'Arm 1');
set @arm_id = LAST_INSERT_ID();
-- Create single event --
INSERT INTO redcap_events_metadata (arm_id, day_offset, offset_min, offset_max, descrip) VALUES (@arm_id, 0, 0, 0, 'Event 1');
set @event_id = LAST_INSERT_ID();
-- Insert into redcap_metadata --
INSERT INTO `redcap_metadata` (`project_id`, `field_name`, `field_phi`, `form_name`, `form_menu_description`, `field_order`, `field_units`, `element_preceding_header`, `element_type`, `element_label`, `element_enum`, `element_note`, `element_validation_type`, `element_validation_min`, `element_validation_max`, `element_validation_checktype`, `branching_logic`, `field_req`, `edoc_id`, `edoc_display_img`, `custom_alignment`, `stop_actions`, `question_num`, `grid_name`, `grid_rank`, `misc`, `video_url`, `video_display_inline`) VALUES
(@project_id, 'record_id', NULL, 'field_embedding_demo', 'Field Embedding Demo', 1, NULL, NULL, 'text', 'Record ID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'desc1', NULL, 'field_embedding_demo', NULL, 2, NULL, '<div class=\"rich-text-field-label\"><p>The fields below illustrate random examples of <span style=\"color: #e03e2d;\">Field Embedding</span> as a means of customizing your forms and surveys.</p></div>', 'descriptive', '<div class=\"rich-text-field-label\"><table style=\"border-collapse: collapse; width: 100%; height: 80px;\" border=\"0\"> <tbody> <tr style=\"height: 20px;\"> <td style=\"width: 32.02%; height: 20px; text-align: left;\"> </td> <td style=\"width: 80px; height: 20px; text-align: center;\">2012</td> <td style=\"width: 80px; height: 20px; text-align: center;\">2013</td> <td style=\"width: 80px; height: 20px; text-align: center;\">2014</td> <td style=\"width: 80px; height: 20px; text-align: center;\">2015</td> <td style=\"width: 80px; text-align: center;\">2016</td> </tr> <tr style=\"height: 20px;\"> <td style=\"width: 32.02%; height: 20px; text-align: left;\">Federal Grants</td> <td style=\"width: 80px; height: 20px; text-align: center;\">{grant2012}</td> <td style=\"width: 80px; height: 20px; text-align: center;\">{grant2013}</td> <td style=\"width: 80px; height: 20px; text-align: center;\">{grant2014}</td> <td style=\"width: 80px; height: 20px; text-align: center;\">{grant2015}</td> <td style=\"width: 80px; text-align: center;\">{grant2024}</td> </tr> <tr style=\"height: 20px;\"> <td style=\"width: 32.02%; height: 20px; text-align: left;\">Non-federal Grants</td> <td style=\"width: 80px; height: 20px; text-align: center;\">{grant2016}</td> <td style=\"width: 80px; height: 20px; text-align: center;\">{nfgrant2012}</td> <td style=\"width: 80px; height: 20px; text-align: center;\">{nfgrant2013}</td> <td style=\"width: 80px; height: 20px; text-align: center;\">{nfgrant2014}</td> <td style=\"width: 80px; text-align: center;\">{grant2025}</td> </tr> <tr style=\"height: 20px;\"> <td style=\"width: 32.02%; height: 20px; text-align: left;\">Research Agreements/Contracts</td> <td style=\"width: 80px; height: 20px; text-align: center;\">{nfgrant2015}</td> <td style=\"width: 80px; height: 20px; text-align: center;\">{nfgrant2016}</td> <td style=\"width: 80px; height: 20px; text-align: center;\">{grant2022}</td> <td style=\"width: 80px; height: 20px; text-align: center;\">{grant2023}</td> <td style=\"width: 80px; text-align: center;\">{grant2026}</td> </tr> </tbody> </table></div>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'grant2012', NULL, 'field_embedding_demo', NULL, 3, NULL, NULL, 'text', 'Federal Grants 2012', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'grant2013', NULL, 'field_embedding_demo', NULL, 4, NULL, NULL, 'text', 'Federal Grants 2013', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'grant2014', NULL, 'field_embedding_demo', NULL, 5, NULL, NULL, 'text', 'Federal Grants 2014', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'grant2015', NULL, 'field_embedding_demo', NULL, 6, NULL, NULL, 'text', 'Federal Grants 2015', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'grant2016', NULL, 'field_embedding_demo', NULL, 7, NULL, NULL, 'text', 'Federal Grants 2016', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'nfgrant2012', NULL, 'field_embedding_demo', NULL, 8, NULL, NULL, 'text', 'Non-federal Grants 2012', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'nfgrant2013', NULL, 'field_embedding_demo', NULL, 9, NULL, NULL, 'text', 'Non-federal Grants 2013', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'nfgrant2014', NULL, 'field_embedding_demo', NULL, 10, NULL, NULL, 'text', 'Non-federal Grants 2014', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'nfgrant2015', NULL, 'field_embedding_demo', NULL, 11, NULL, NULL, 'text', 'Non-federal Grants 2015', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'nfgrant2016', NULL, 'field_embedding_demo', NULL, 12, NULL, NULL, 'text', 'Non-federal Grants 2016', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'grant2022', NULL, 'field_embedding_demo', NULL, 13, NULL, NULL, 'text', 'Research Agreements/Contracts 2012', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'grant2023', NULL, 'field_embedding_demo', NULL, 14, NULL, NULL, 'text', 'Research Agreements/Contracts 2013', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'grant2024', NULL, 'field_embedding_demo', NULL, 15, NULL, NULL, 'text', 'Research Agreements/Contracts 2014', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'grant2025', NULL, 'field_embedding_demo', NULL, 16, NULL, NULL, 'text', 'Research Agreements/Contracts 2015', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'grant2026', NULL, 'field_embedding_demo', NULL, 17, NULL, NULL, 'text', 'Research Agreements/Contracts 2016', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'desc2', NULL, 'field_embedding_demo', NULL, 18, NULL, 'Food question', 'descriptive', '<div class=\"rich-text-field-label\"><table style=\"border-collapse: collapse; width: 100%;\" border=\"0\"> <tbody> <tr> <td style=\"width: 45.8502%; vertical-align: top;\">How often did you eat spicy foods last year?</td> <td style=\"width: 34.6791%; vertical-align: top;\"> <p><span style=\"font-weight: normal;\">{num_servings} number of servings</span></p> <p><span style=\"font-weight: normal;\">{not_know}</span></p> </td> <td style=\"width: 19.4706%; vertical-align: top;\"><span style=\"font-weight: normal;\">{food_units:icons}</span></td> </tr> </tbody> </table></div>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'num_servings', NULL, 'field_embedding_demo', NULL, 19, NULL, NULL, 'text', 'Number of servings', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'not_know', NULL, 'field_embedding_demo', NULL, 20, NULL, NULL, 'checkbox', 'Do not know / Prefer not to answer', '1, Do not know / Prefer not to answer', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'food_units', NULL, 'field_embedding_demo', NULL, 21, NULL, NULL, 'radio', 'Food units', '1, Per day\\n2, Per week\\n3, Per month', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'radio_choices', NULL, 'field_embedding_demo', NULL, 22, NULL, ' Combo radio buttons with text boxes', 'radio', 'Radio choices with custom \"other\" option', '1, My first choice\\n2, My second choice\\n3, Other     {other1}', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'other1', NULL, 'field_embedding_demo', NULL, 23, NULL, NULL, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[radio_choices] = "3"', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@PLACEHOLDER=\"Enter custom text\"', NULL, 0),
(@project_id, 'asdf', NULL, 'field_embedding_demo', NULL, 24, NULL, 'Lots of comments', 'descriptive', '<div class=\"rich-text-field-label\"><table style=\"border-collapse: collapse; width: 100%;\" border=\"0\"> <tbody> <tr> <td style=\"width: 25%; text-align: center;\">Main feedback about the event</td> <td style=\"width: 25%; text-align: center;\">Feedback regarding the amenities</td> <td style=\"width: 25%; text-align: center;\">Feedback regarding the venue</td> <td style=\"width: 25%; text-align: center;\">Additional comments</td> </tr> <tr> <td style=\"width: 25%; text-align: center;\">{notes1}</td> <td style=\"width: 25%; text-align: center;\">{notes2}</td> <td style=\"width: 25%; text-align: center;\">{notes3}</td> <td style=\"width: 25%; text-align: center;\">{notes4}</td> </tr> </tbody> </table></div>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'notes1', NULL, 'field_embedding_demo', NULL, 25, NULL, NULL, 'textarea', 'Main feedback about the event', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'notes2', NULL, 'field_embedding_demo', NULL, 26, NULL, NULL, 'textarea', 'Feedback regarding the amenities', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'notes3', NULL, 'field_embedding_demo', NULL, 27, NULL, NULL, 'textarea', 'Feedback regarding the venue', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'notes4', NULL, 'field_embedding_demo', NULL, 28, NULL, NULL, 'textarea', 'Additional comments', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'pname', NULL, 'field_embedding_demo', NULL, 29, NULL, ' Patient Information', 'descriptive', '<div class=\"rich-text-field-label\"><table style=\"border-collapse: collapse; width: 100%;\"> <tbody> <tr> <td style=\"width: 33.3333%;\">Patient name:</td> <td style=\"width: 33.3333%;\">{first_name}</td> <td style=\"width: 33.3333%;\">{last_name}</td> </tr> </tbody> </table></div>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'first_name', '1', 'field_embedding_demo', NULL, 30, NULL, NULL, 'text', 'Patient first name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@PLACEHOLDER=\"First\"', NULL, 0),
(@project_id, 'last_name', '1', 'field_embedding_demo', NULL, 31, NULL, NULL, 'text', 'Patient last name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@PLACEHOLDER=\"Last\"', NULL, 0),
(@project_id, 'dob_descriptive', NULL, 'field_embedding_demo', NULL, 32, NULL, NULL, 'descriptive', '<div class=\"rich-text-field-label\"><table style=\"border-collapse: collapse; width: 100%;\" cellpadding=\"5\"> <tbody> <tr style=\"height: 42px;\"> <th style=\"width: 31.0544%; height: 42px;\">Date of birth:</th> <td style=\"width: 17.6733%; height: 42px;\"> <div>{dob}</div> </td> <td style=\"width: 14.0046%; height: 42px;\"> <div>Sex:</div> <div>{sex}</div> </td> <td style=\"width: 6.51389%; height: 42px;\"> <div> <div>Ethnicity:</div> <div>{ethnicity}</div> </div> </td> </tr> <tr style=\"height: 42px;\"> <th style=\"width: 31.0544%; height: 42px;\">Age (in either years/months/days):</th> <td style=\"height: 42px; width: 17.6733%;\"> <div>{age}</div> </td> <td style=\"width: 14.0046%;\"> <div>Age units: {ageunit}</div> </td> <th style=\"width: 6.51389%; height: 42px;\"> </th> </tr> </tbody> </table></div>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'id_descriptive', NULL, 'field_embedding_demo', NULL, 33, NULL, NULL, 'descriptive', '<div class=\"rich-text-field-label\"><table style=\"border-collapse: collapse; width: 100%;\" cellpadding=\"2\"> <tbody> <tr> <td>Reporting jurisdiction:</td> <td> <div>{state}</div> </td> <td>Case State/local ID:</td> <td> <div>{local_id}</div> </td> </tr> <tr> <td>Reporting health department:</td> <td> <div>{healthdept}</div> </td> <td>CDC 2019-nCoV ID:</td> <td> <div>{cdc_ncov2019_id}</div> </td> </tr> <tr> <th>Contact ID <sup>a</sup>:</th> <td> <div>{contact_id}</div> </td> <th>NNDSS loc.rec.ID/Case ID <sup>b</sup>:</th> <td> <div>{nndss_id}</div> </td> </tr> </tbody> </table></div>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, ' ', NULL, 0),
(@project_id, 'hosp_descriptive', NULL, 'field_embedding_demo', NULL, 34, NULL, NULL, 'descriptive', '<div class=\"rich-text-field-label\"><table> <tbody> <tr> <th>Was the patient hospitalized?</th> <td> <div>{hosp_yn}</div> </td> <th>Admission Date</th> <td> <div>{adm1_dt}</div> </td> <th>Discharge Date</th> <td> <div>{dis1_dt}</div> </td> </tr> </tbody> </table></div>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, ' ', NULL, 0),
(@project_id, 'interviewer_descriptive', NULL, 'field_embedding_demo', NULL, 35, NULL, 'Interviewer information', 'descriptive', '<div class=\"rich-text-field-label\"><table style=\"border-collapse: collapse; width: 100%;\"> <tbody> <tr> <th> Last Name:</th> <td align=\"left\"> <div>{interviewer_ln}</div> </td> <th>First Name:</th> <td align=\"left\"> <div>{interviewer_fn}</div> </td> </tr> <tr> <th>Affiliation/Organization:</th> <td align=\"left\"> <div>{interviewer_org}</div> </td> <th>Telephone:</th> <td align=\"left\"> <div>{interviewer_tele}</div> </td> </tr> <tr> <th>Email:</th> <td align=\"left\"> <div>{interviewer_email}</div> </td> </tr> </tbody> </table></div>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'symptom_descriptive', NULL, 'field_embedding_demo', NULL, 36, NULL, 'Symptoms, clinical course, past medical history and social history', 'descriptive', '<div class=\"rich-text-field-label\"><table> <tbody> <tr> <th style=\"width: 639.219px;\" colspan=\"2\"> <p><strong>During the illness, did the patient experience any of the following symptoms?</strong></p> </th> <th style=\"width: 126.219px;\"> <p><strong>Onset Date</strong></p> </th> </tr> <tr> <th style=\"width: 226.219px;\">Fever>100.4F(38C)</th> <td style=\"width: 399.219px;\"> <div>{fever_yn}</div> </td> <td style=\"width: 126.219px;\"> <div>{fever_onset}</div> </td> </tr> <tr> <th style=\"width: 226.219px;\">Subjective fever (felt feverish)</th> <td style=\"width: 399.219px;\"> <div>{sfever_yn}</div> </td> <td style=\"width: 126.219px;\"> <div>{sfever_onset}</div> </td> </tr> <tr> <th style=\"width: 226.219px;\">Chills</th> <td style=\"width: 399.219px;\"> <div>{chills_yn}</div> </td> <td style=\"width: 126.219px;\"> <div>{chills_onset}</div> </td> </tr> <tr> <th style=\"width: 226.219px;\">Muscle aches (myalgia)</th> <td style=\"width: 399.219px;\"> <div>{myalgia_yn}</div> </td> <td style=\"width: 126.219px;\"> <div>{myalgia_onset}</div> </td> </tr> <tr> <th style=\"width: 226.219px;\">Other symptom 1</th> <td style=\"width: 399.219px;\"> <div>{othsym1_spec}</div> </td> <td style=\"width: 126.219px;\"> <div>{othsym1_onset}</div> </td> </tr> <tr> <th style=\"width: 226.219px;\">Other symptom 2</th> <td style=\"width: 399.219px;\"> <div>{othsym2_spec}</div> </td> <td style=\"width: 126.219px;\"> <div>{othsym2_onset}</div> </td> </tr> </tbody> </table></div>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'state', NULL, 'field_embedding_demo', NULL, 37, NULL, NULL, 'text', 'Reporting jurisdiction', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'healthdept', NULL, 'field_embedding_demo', NULL, 38, NULL, NULL, 'text', 'Reporting health department', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'contact_id', NULL, 'field_embedding_demo', NULL, 39, NULL, NULL, 'text', 'Contact ID\n\nOnly complete if case-patient is a known contact of prior source case-patient. Assign Contact ID using CDC 2019-nCoV ID and sequential contact ID, e.g., Confirmed case CA102034567 has contacts CA102034567-01 and CA102034567-02', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'local_id', NULL, 'field_embedding_demo', NULL, 40, NULL, NULL, 'text', 'Case state/local ID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'cdc_ncov2019_id', NULL, 'field_embedding_demo', NULL, 41, NULL, NULL, 'text', 'CDC 2019-nCoV ID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'nndss_id', NULL, 'field_embedding_demo', NULL, 42, NULL, NULL, 'text', 'NNDSS loc. rec. ID/Case ID\n\nFor NNDSS reporters, use GenV2 or NETSS patient identifier', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'interviewer_ln', NULL, 'field_embedding_demo', NULL, 43, NULL, NULL, 'text', 'Interviewer last name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, 'LV', NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'interviewer_fn', NULL, 'field_embedding_demo', NULL, 44, NULL, NULL, 'text', 'Interviewer first name', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'interviewer_org', NULL, 'field_embedding_demo', NULL, 45, NULL, NULL, 'text', 'Affiliation/Organization', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'interviewer_tele', NULL, 'field_embedding_demo', NULL, 46, NULL, NULL, 'text', 'Telephone', NULL, NULL, 'phone', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'interviewer_email', NULL, 'field_embedding_demo', NULL, 47, NULL, NULL, 'text', 'Email', NULL, NULL, 'email', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'sex', NULL, 'field_embedding_demo', NULL, 48, NULL, NULL, 'radio', 'Sex', '1, Male\\n2, Female\\n9, Unknown\\n3, Other', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 'LV', NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'ethnicity', NULL, 'field_embedding_demo', NULL, 49, NULL, NULL, 'radio', 'Ethnicity', '1, Hispanic/Latino\\n0, Non-Hispanic-Latino\\n9, Not specified', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 'LV', NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'dob', NULL, 'field_embedding_demo', NULL, 50, NULL, NULL, 'text', 'Date of birth', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDEBUTTON', NULL, 0),
(@project_id, 'age', NULL, 'field_embedding_demo', NULL, 51, NULL, NULL, 'text', 'Age\n\nPlease give age in either:\n-years (most common)\n-months\n-days\n\nYou will pick the age unit in the next question.', NULL, NULL, 'float', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'ageunit', NULL, 'field_embedding_demo', NULL, 52, NULL, NULL, 'radio', 'Age units\n\nThe number you gave above was in what units?', '1, Years\\n2, Months\\n3, Days', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'hosp_yn', NULL, 'field_embedding_demo', NULL, 53, NULL, NULL, 'radio', 'Was the patient hospitalized?', '1, Yes\\n0, No\\n9, Unknown', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'adm1_dt', NULL, 'field_embedding_demo', NULL, 54, NULL, NULL, 'text', 'If yes, admission date 1', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDEBUTTON', NULL, 0),
(@project_id, 'dis1_dt', NULL, 'field_embedding_demo', NULL, 55, NULL, NULL, 'text', 'If yes, discharge date 1', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDEBUTTON', NULL, 0),
(@project_id, 'fever_yn', NULL, 'field_embedding_demo', NULL, 56, NULL, NULL, 'radio', 'Fever >100.4F (38C)', '1, Yes \\n 0, No \\n 9, Unknown', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, 'symptoms', 0, NULL, NULL, 0),
(@project_id, 'sfever_yn', NULL, 'field_embedding_demo', NULL, 57, NULL, NULL, 'radio', 'Subjective fever (felt feverish)', '1, Yes \\n 0, No \\n 9, Unknown', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, 'symptoms', 0, NULL, NULL, 0),
(@project_id, 'chills_yn', NULL, 'field_embedding_demo', NULL, 58, NULL, NULL, 'radio', 'Chills', '1, Yes \\n 0, No \\n 9, Unknown', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, 'symptoms', 0, NULL, NULL, 0),
(@project_id, 'myalgia_yn', NULL, 'field_embedding_demo', NULL, 59, NULL, NULL, 'radio', 'Muscle aches (myalgia)', '1, Yes \\n 0, No \\n 9, Unknown', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, 'symptoms', 0, NULL, NULL, 0),
(@project_id, 'fever_onset', NULL, 'field_embedding_demo', NULL, 60, NULL, NULL, 'text', 'Fever onset date', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDEBUTTON', NULL, 0),
(@project_id, 'sfever_onset', NULL, 'field_embedding_demo', NULL, 61, NULL, NULL, 'text', 'Subjective fever (felt feverish) onset date', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDEBUTTON', NULL, 0),
(@project_id, 'chills_onset', NULL, 'field_embedding_demo', NULL, 62, NULL, NULL, 'text', 'Chills onset date', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDEBUTTON', NULL, 0),
(@project_id, 'myalgia_onset', NULL, 'field_embedding_demo', NULL, 63, NULL, NULL, 'text', 'Muscle aches (myalgia) onset date', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDEBUTTON', NULL, 0),
(@project_id, 'othsym1_spec', NULL, 'field_embedding_demo', NULL, 64, NULL, NULL, 'text', 'Other symptoms - 1, specify:', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'othsym2_spec', NULL, 'field_embedding_demo', NULL, 65, NULL, NULL, 'text', 'Other symptoms - 2, specify:', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'othsym1_onset', NULL, 'field_embedding_demo', NULL, 66, NULL, NULL, 'text', 'Other symptoms 1 onset date', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDEBUTTON', NULL, 0),
(@project_id, 'othsym2_onset', NULL, 'field_embedding_demo', NULL, 67, NULL, NULL, 'text', 'Other symptoms 2 onset date', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDEBUTTON', NULL, 0),
(@project_id, 'field_embedding_demo_complete', NULL, 'field_embedding_demo', NULL, 68, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0);

INSERT INTO `redcap_projects_templates` (`project_id`, `title`, `description`, `enabled`)
	VALUES (@project_id,  @project_title,  'Example of the Field Embedding feature.',  '1');
-- SQL TO CREATE A REDCAP DEMO PROJECT --
set @project_title = 'Project Dashboards, Smart Functions, Smart Tables, & Smart Charts';


-- Obtain default values --
set @institution = (select value from redcap_config where field_name = 'institution' limit 1);
set @site_org_type = (select value from redcap_config where field_name = 'site_org_type' limit 1);
set @grant_cite = (select value from redcap_config where field_name = 'grant_cite' limit 1);
set @project_contact_name = (select value from redcap_config where field_name = 'project_contact_name' limit 1);
set @project_contact_email = (select value from redcap_config where field_name = 'project_contact_email' limit 1);
set @headerlogo = (select value from redcap_config where field_name = 'headerlogo' limit 1);
set @auth_meth = (select value from redcap_config where field_name = 'auth_meth_global' limit 1);
-- Create project --
INSERT INTO `redcap_projects`
(project_name, app_title, status, count_project, auth_meth, creation_time, production_time, institution, site_org_type, grant_cite, project_contact_name, project_contact_email, headerlogo, display_project_logo_institution, auto_inc_set) VALUES
(concat('redcap_demo_',LEFT(sha1(rand()),6)), @project_title, 1, 0, @auth_meth, now(), now(), @institution, @site_org_type, @grant_cite, @project_contact_name, @project_contact_email, @headerlogo, 0, 1);
set @project_id = LAST_INSERT_ID();
-- Create single arm --
INSERT INTO redcap_events_arms (project_id, arm_num, arm_name) VALUES (@project_id, 1, 'Arm 1');
set @arm_id = LAST_INSERT_ID();
-- Create single event --
INSERT INTO redcap_events_metadata (arm_id, day_offset, offset_min, offset_max, descrip) VALUES (@arm_id, 0, 0, 0, 'Event 1');
set @event_id = LAST_INSERT_ID();
-- Insert into redcap_metadata --
INSERT INTO `redcap_metadata` (`project_id`, `field_name`, `field_phi`, `form_name`, `form_menu_description`, `field_order`, `field_units`, `element_preceding_header`, `element_type`, `element_label`, `element_enum`, `element_note`, `element_validation_type`, `element_validation_min`, `element_validation_max`, `element_validation_checktype`, `branching_logic`, `field_req`, `edoc_id`, `edoc_display_img`, `custom_alignment`, `stop_actions`, `question_num`, `grid_name`, `grid_rank`, `misc`, `video_url`, `video_display_inline`) VALUES
(@project_id, 'study_id', NULL, 'demographics', 'Demographics', 1, NULL, NULL, 'text', 'Study ID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'age', NULL, 'demographics', NULL, 2, NULL, NULL, 'text', 'Age (years)', NULL, NULL, 'int', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'ethnicity', NULL, 'demographics', NULL, 3, NULL, NULL, 'radio', 'Ethnicity', 'H, Hispanic or Latino\\nN, NOT Hispanic or Latino\\nU, Unknown / Not Reported', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 'LH', NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'race', NULL, 'demographics', NULL, 4, NULL, NULL, 'select', 'Race', 'AI, American Indian/Alaska Native\\nA, Asian\\nP, Native Hawaiian or Other Pacific Islander\\nB, Black or African American\\nW, White\\nM, More Than One Race\\nU, Unknown / Not Reported', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'sex', NULL, 'demographics', NULL, 5, NULL, NULL, 'radio', 'sex', 'F, Female\\nM, Male\\nO, Other\\nN, Prefer not to say', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'height', NULL, 'demographics', NULL, 6, NULL, NULL, 'text', 'Height (cm)', NULL, NULL, 'float', '130', '215', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'weight', NULL, 'demographics', NULL, 7, NULL, NULL, 'text', 'Weight (kilograms)', NULL, NULL, 'int', '35', '200', 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'demographics_complete', NULL, 'demographics', NULL, 8, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0);
-- Insert DAGS
INSERT INTO `redcap_data_access_groups` (`project_id`, `group_name`) VALUES
(@project_id, 'Duke'),
(@project_id, 'Harvard');
INSERT INTO `redcap_data_access_groups` (`project_id`, `group_name`) VALUES
(@project_id, 'Vanderbilt');
set @dag_id = LAST_INSERT_ID();
-- Insert into redcap_data
INSERT INTO `redcap_data` (`project_id`, `event_id`, `record`, `field_name`, `value`, `instance`) VALUES
(@project_id, @event_id, '101', 'age', '30', NULL),
(@project_id, @event_id, '101', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '101', 'ethnicity', 'N', NULL),
(@project_id, @event_id, '101', 'sex', 'F', NULL),
(@project_id, @event_id, '101', 'height', '198', NULL),
(@project_id, @event_id, '101', 'race', 'A', NULL),
(@project_id, @event_id, '101', 'study_id', '101', NULL),
(@project_id, @event_id, '101', 'weight', '75', NULL),
(@project_id, @event_id, '102', 'age', '27', NULL),
(@project_id, @event_id, '102', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '102', 'ethnicity', 'N', NULL),
(@project_id, @event_id, '102', 'sex', 'M', NULL),
(@project_id, @event_id, '102', 'height', '168', NULL),
(@project_id, @event_id, '102', 'race', 'B', NULL),
(@project_id, @event_id, '102', 'study_id', '102', NULL),
(@project_id, @event_id, '102', 'weight', '182', NULL),
(@project_id, @event_id, '103', '__GROUPID__', @dag_id, NULL),
(@project_id, @event_id, '103', 'age', '102', NULL),
(@project_id, @event_id, '103', 'demographics_complete', '1', NULL),
(@project_id, @event_id, '103', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '103', 'sex', 'F', NULL),
(@project_id, @event_id, '103', 'height', '142', NULL),
(@project_id, @event_id, '103', 'race', 'A', NULL),
(@project_id, @event_id, '103', 'study_id', '103', NULL),
(@project_id, @event_id, '103', 'weight', '169', NULL),
(@project_id, @event_id, '104', 'age', '87', NULL),
(@project_id, @event_id, '104', 'demographics_complete', '0', NULL),
(@project_id, @event_id, '104', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '104', 'sex', 'M', NULL),
(@project_id, @event_id, '104', 'height', '202', NULL),
(@project_id, @event_id, '104', 'race', 'AI', NULL),
(@project_id, @event_id, '104', 'study_id', '104', NULL),
(@project_id, @event_id, '104', 'weight', '91', NULL),
(@project_id, @event_id, '105', 'age', '25', NULL),
(@project_id, @event_id, '105', 'demographics_complete', '0', NULL),
(@project_id, @event_id, '105', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '105', 'sex', 'M', NULL),
(@project_id, @event_id, '105', 'height', '211', NULL),
(@project_id, @event_id, '105', 'race', 'A', NULL),
(@project_id, @event_id, '105', 'study_id', '105', NULL),
(@project_id, @event_id, '105', 'weight', '126', NULL),
(@project_id, @event_id, '106', '__GROUPID__', @dag_id, NULL),
(@project_id, @event_id, '106', 'age', '6', NULL),
(@project_id, @event_id, '106', 'demographics_complete', '1', NULL),
(@project_id, @event_id, '106', 'ethnicity', 'U', NULL),
(@project_id, @event_id, '106', 'sex', 'M', NULL),
(@project_id, @event_id, '106', 'height', '196', NULL),
(@project_id, @event_id, '106', 'race', 'W', NULL),
(@project_id, @event_id, '106', 'study_id', '106', NULL),
(@project_id, @event_id, '106', 'weight', '193', NULL),
(@project_id, @event_id, '107', 'age', '93', NULL),
(@project_id, @event_id, '107', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '107', 'ethnicity', 'U', NULL),
(@project_id, @event_id, '107', 'sex', 'M', NULL),
(@project_id, @event_id, '107', 'height', '148', NULL),
(@project_id, @event_id, '107', 'race', 'A', NULL),
(@project_id, @event_id, '107', 'study_id', '107', NULL),
(@project_id, @event_id, '107', 'weight', '88', NULL),
(@project_id, @event_id, '108', 'age', '62', NULL),
(@project_id, @event_id, '108', 'demographics_complete', '0', NULL),
(@project_id, @event_id, '108', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '108', 'sex', 'F', NULL),
(@project_id, @event_id, '108', 'height', '133', NULL),
(@project_id, @event_id, '108', 'race', 'P', NULL),
(@project_id, @event_id, '108', 'study_id', '108', NULL),
(@project_id, @event_id, '108', 'weight', '103', NULL),
(@project_id, @event_id, '109', 'age', '87', NULL),
(@project_id, @event_id, '109', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '109', 'ethnicity', 'U', NULL),
(@project_id, @event_id, '109', 'sex', 'F', NULL),
(@project_id, @event_id, '109', 'height', '192', NULL),
(@project_id, @event_id, '109', 'race', 'B', NULL),
(@project_id, @event_id, '109', 'study_id', '109', NULL),
(@project_id, @event_id, '109', 'weight', '49', NULL),
(@project_id, @event_id, '110', 'age', '5', NULL),
(@project_id, @event_id, '110', 'demographics_complete', '0', NULL),
(@project_id, @event_id, '110', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '110', 'sex', 'M', NULL),
(@project_id, @event_id, '110', 'height', '202', NULL),
(@project_id, @event_id, '110', 'race', 'U', NULL),
(@project_id, @event_id, '110', 'study_id', '110', NULL),
(@project_id, @event_id, '110', 'weight', '179', NULL),
(@project_id, @event_id, '111', 'age', '53', NULL),
(@project_id, @event_id, '111', 'demographics_complete', '1', NULL),
(@project_id, @event_id, '111', 'ethnicity', 'N', NULL),
(@project_id, @event_id, '111', 'sex', 'M', NULL),
(@project_id, @event_id, '111', 'height', '182', NULL),
(@project_id, @event_id, '111', 'race', 'B', NULL),
(@project_id, @event_id, '111', 'study_id', '111', NULL),
(@project_id, @event_id, '111', 'weight', '98', NULL),
(@project_id, @event_id, '112', '__GROUPID__', @dag_id, NULL),
(@project_id, @event_id, '112', 'age', '82', NULL),
(@project_id, @event_id, '112', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '112', 'ethnicity', 'U', NULL),
(@project_id, @event_id, '112', 'sex', 'M', NULL),
(@project_id, @event_id, '112', 'height', '202', NULL),
(@project_id, @event_id, '112', 'race', 'AI', NULL),
(@project_id, @event_id, '112', 'study_id', '112', NULL),
(@project_id, @event_id, '112', 'weight', '47', NULL),
(@project_id, @event_id, '113', 'age', '21', NULL),
(@project_id, @event_id, '113', 'demographics_complete', '0', NULL),
(@project_id, @event_id, '113', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '113', 'sex', 'M', NULL),
(@project_id, @event_id, '113', 'height', '194', NULL),
(@project_id, @event_id, '113', 'race', 'U', NULL),
(@project_id, @event_id, '113', 'study_id', '113', NULL),
(@project_id, @event_id, '113', 'weight', '118', NULL),
(@project_id, @event_id, '114', 'age', '22', NULL),
(@project_id, @event_id, '114', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '114', 'ethnicity', 'N', NULL),
(@project_id, @event_id, '114', 'sex', 'F', NULL),
(@project_id, @event_id, '114', 'height', '160', NULL),
(@project_id, @event_id, '114', 'race', 'B', NULL),
(@project_id, @event_id, '114', 'study_id', '114', NULL),
(@project_id, @event_id, '114', 'weight', '93', NULL),
(@project_id, @event_id, '115', 'age', '48', NULL),
(@project_id, @event_id, '115', 'demographics_complete', '1', NULL),
(@project_id, @event_id, '115', 'ethnicity', 'N', NULL),
(@project_id, @event_id, '115', 'sex', 'F', NULL),
(@project_id, @event_id, '115', 'height', '202', NULL),
(@project_id, @event_id, '115', 'race', 'A', NULL),
(@project_id, @event_id, '115', 'study_id', '115', NULL),
(@project_id, @event_id, '115', 'weight', '117', NULL),
(@project_id, @event_id, '116', 'age', '35', NULL),
(@project_id, @event_id, '116', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '116', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '116', 'sex', 'F', NULL),
(@project_id, @event_id, '116', 'height', '155', NULL),
(@project_id, @event_id, '116', 'race', 'P', NULL),
(@project_id, @event_id, '116', 'study_id', '116', NULL),
(@project_id, @event_id, '116', 'weight', '124', NULL),
(@project_id, @event_id, '117', 'age', '72', NULL),
(@project_id, @event_id, '117', 'demographics_complete', '0', NULL),
(@project_id, @event_id, '117', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '117', 'sex', 'M', NULL),
(@project_id, @event_id, '117', 'height', '179', NULL),
(@project_id, @event_id, '117', 'race', 'P', NULL),
(@project_id, @event_id, '117', 'study_id', '117', NULL),
(@project_id, @event_id, '117', 'weight', '69', NULL),
(@project_id, @event_id, '118', 'age', '46', NULL),
(@project_id, @event_id, '118', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '118', 'ethnicity', 'U', NULL),
(@project_id, @event_id, '118', 'sex', 'M', NULL),
(@project_id, @event_id, '118', 'height', '184', NULL),
(@project_id, @event_id, '118', 'race', 'M', NULL),
(@project_id, @event_id, '118', 'study_id', '118', NULL),
(@project_id, @event_id, '118', 'weight', '81', NULL),
(@project_id, @event_id, '119', 'age', '28', NULL),
(@project_id, @event_id, '119', 'demographics_complete', '0', NULL),
(@project_id, @event_id, '119', 'ethnicity', 'N', NULL),
(@project_id, @event_id, '119', 'sex', 'M', NULL),
(@project_id, @event_id, '119', 'height', '173', NULL),
(@project_id, @event_id, '119', 'race', 'U', NULL),
(@project_id, @event_id, '119', 'study_id', '119', NULL),
(@project_id, @event_id, '119', 'weight', '136', NULL),
(@project_id, @event_id, '120', '__GROUPID__', @dag_id, NULL),
(@project_id, @event_id, '120', 'age', '21', NULL),
(@project_id, @event_id, '120', 'demographics_complete', '1', NULL),
(@project_id, @event_id, '120', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '120', 'sex', 'M', NULL),
(@project_id, @event_id, '120', 'height', '187', NULL),
(@project_id, @event_id, '120', 'race', 'W', NULL),
(@project_id, @event_id, '120', 'study_id', '120', NULL),
(@project_id, @event_id, '120', 'weight', '190', NULL),
(@project_id, @event_id, '121', '__GROUPID__', @dag_id, NULL),
(@project_id, @event_id, '121', 'age', '81', NULL),
(@project_id, @event_id, '121', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '121', 'ethnicity', 'N', NULL),
(@project_id, @event_id, '121', 'sex', 'M', NULL),
(@project_id, @event_id, '121', 'height', '173', NULL),
(@project_id, @event_id, '121', 'race', 'B', NULL),
(@project_id, @event_id, '121', 'study_id', '121', NULL),
(@project_id, @event_id, '121', 'weight', '58', NULL),
(@project_id, @event_id, '122', '__GROUPID__', @dag_id, NULL),
(@project_id, @event_id, '122', 'age', '85', NULL),
(@project_id, @event_id, '122', 'demographics_complete', '0', NULL),
(@project_id, @event_id, '122', 'ethnicity', 'U', NULL),
(@project_id, @event_id, '122', 'sex', 'M', NULL),
(@project_id, @event_id, '122', 'height', '173', NULL),
(@project_id, @event_id, '122', 'race', 'W', NULL),
(@project_id, @event_id, '122', 'study_id', '122', NULL),
(@project_id, @event_id, '122', 'weight', '105', NULL),
(@project_id, @event_id, '123', 'age', '49', NULL),
(@project_id, @event_id, '123', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '123', 'ethnicity', 'N', NULL),
(@project_id, @event_id, '123', 'sex', 'M', NULL),
(@project_id, @event_id, '123', 'height', '212', NULL),
(@project_id, @event_id, '123', 'race', 'B', NULL),
(@project_id, @event_id, '123', 'study_id', '123', NULL),
(@project_id, @event_id, '123', 'weight', '115', NULL),
(@project_id, @event_id, '124', 'age', '27', NULL),
(@project_id, @event_id, '124', 'demographics_complete', '1', NULL),
(@project_id, @event_id, '124', 'ethnicity', 'U', NULL),
(@project_id, @event_id, '124', 'sex', 'F', NULL),
(@project_id, @event_id, '124', 'height', '136', NULL),
(@project_id, @event_id, '124', 'race', 'W', NULL),
(@project_id, @event_id, '124', 'study_id', '124', NULL),
(@project_id, @event_id, '124', 'weight', '105', NULL),
(@project_id, @event_id, '125', 'age', '11', NULL),
(@project_id, @event_id, '125', 'demographics_complete', '1', NULL),
(@project_id, @event_id, '125', 'ethnicity', 'N', NULL),
(@project_id, @event_id, '125', 'sex', 'F', NULL),
(@project_id, @event_id, '125', 'height', '212', NULL),
(@project_id, @event_id, '125', 'race', 'U', NULL),
(@project_id, @event_id, '125', 'study_id', '125', NULL),
(@project_id, @event_id, '125', 'weight', '116', NULL),
(@project_id, @event_id, '126', 'age', '31', NULL),
(@project_id, @event_id, '126', 'demographics_complete', '0', NULL),
(@project_id, @event_id, '126', 'ethnicity', 'N', NULL),
(@project_id, @event_id, '126', 'sex', 'M', NULL),
(@project_id, @event_id, '126', 'height', '160', NULL),
(@project_id, @event_id, '126', 'race', 'W', NULL),
(@project_id, @event_id, '126', 'study_id', '126', NULL),
(@project_id, @event_id, '126', 'weight', '49', NULL),
(@project_id, @event_id, '127', 'age', '96', NULL),
(@project_id, @event_id, '127', 'demographics_complete', '1', NULL),
(@project_id, @event_id, '127', 'ethnicity', 'U', NULL),
(@project_id, @event_id, '127', 'sex', 'F', NULL),
(@project_id, @event_id, '127', 'height', '150', NULL),
(@project_id, @event_id, '127', 'race', 'B', NULL),
(@project_id, @event_id, '127', 'study_id', '127', NULL),
(@project_id, @event_id, '127', 'weight', '77', NULL),
(@project_id, @event_id, '128', 'age', '8', NULL),
(@project_id, @event_id, '128', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '128', 'ethnicity', 'N', NULL),
(@project_id, @event_id, '128', 'sex', 'M', NULL),
(@project_id, @event_id, '128', 'height', '182', NULL),
(@project_id, @event_id, '128', 'race', 'M', NULL),
(@project_id, @event_id, '128', 'study_id', '128', NULL),
(@project_id, @event_id, '128', 'weight', '125', NULL),
(@project_id, @event_id, '129', 'age', '55', NULL),
(@project_id, @event_id, '129', 'demographics_complete', '1', NULL),
(@project_id, @event_id, '129', 'ethnicity', 'N', NULL),
(@project_id, @event_id, '129', 'sex', 'M', NULL),
(@project_id, @event_id, '129', 'height', '171', NULL),
(@project_id, @event_id, '129', 'race', 'U', NULL),
(@project_id, @event_id, '129', 'study_id', '129', NULL),
(@project_id, @event_id, '129', 'weight', '194', NULL),
(@project_id, @event_id, '130', 'age', '16', NULL),
(@project_id, @event_id, '130', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '130', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '130', 'sex', 'M', NULL),
(@project_id, @event_id, '130', 'height', '160', NULL),
(@project_id, @event_id, '130', 'race', 'M', NULL),
(@project_id, @event_id, '130', 'study_id', '130', NULL),
(@project_id, @event_id, '130', 'weight', '197', NULL),
(@project_id, @event_id, '131', 'age', '91', NULL),
(@project_id, @event_id, '131', 'demographics_complete', '1', NULL),
(@project_id, @event_id, '131', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '131', 'sex', 'M', NULL),
(@project_id, @event_id, '131', 'height', '165', NULL),
(@project_id, @event_id, '131', 'race', 'P', NULL),
(@project_id, @event_id, '131', 'study_id', '131', NULL),
(@project_id, @event_id, '131', 'weight', '82', NULL),
(@project_id, @event_id, '132', 'age', '87', NULL),
(@project_id, @event_id, '132', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '132', 'ethnicity', 'N', NULL),
(@project_id, @event_id, '132', 'sex', 'M', NULL),
(@project_id, @event_id, '132', 'height', '214', NULL),
(@project_id, @event_id, '132', 'race', 'W', NULL),
(@project_id, @event_id, '132', 'study_id', '132', NULL),
(@project_id, @event_id, '132', 'weight', '76', NULL),
(@project_id, @event_id, '133', 'age', '45', NULL),
(@project_id, @event_id, '133', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '133', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '133', 'sex', 'M', NULL),
(@project_id, @event_id, '133', 'height', '194', NULL),
(@project_id, @event_id, '133', 'race', 'U', NULL),
(@project_id, @event_id, '133', 'study_id', '133', NULL),
(@project_id, @event_id, '133', 'weight', '121', NULL),
(@project_id, @event_id, '134', 'age', '82', NULL),
(@project_id, @event_id, '134', 'demographics_complete', '0', NULL),
(@project_id, @event_id, '134', 'ethnicity', 'U', NULL),
(@project_id, @event_id, '134', 'sex', 'M', NULL),
(@project_id, @event_id, '134', 'height', '141', NULL),
(@project_id, @event_id, '134', 'race', 'W', NULL),
(@project_id, @event_id, '134', 'study_id', '134', NULL),
(@project_id, @event_id, '134', 'weight', '110', NULL),
(@project_id, @event_id, '135', 'age', '68', NULL),
(@project_id, @event_id, '135', 'demographics_complete', '0', NULL),
(@project_id, @event_id, '135', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '135', 'sex', 'M', NULL),
(@project_id, @event_id, '135', 'height', '210', NULL),
(@project_id, @event_id, '135', 'race', 'AI', NULL),
(@project_id, @event_id, '135', 'study_id', '135', NULL),
(@project_id, @event_id, '135', 'weight', '80', NULL),
(@project_id, @event_id, '136', 'age', '11', NULL),
(@project_id, @event_id, '136', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '136', 'ethnicity', 'U', NULL),
(@project_id, @event_id, '136', 'sex', 'F', NULL),
(@project_id, @event_id, '136', 'height', '196', NULL),
(@project_id, @event_id, '136', 'race', 'B', NULL),
(@project_id, @event_id, '136', 'study_id', '136', NULL),
(@project_id, @event_id, '136', 'weight', '108', NULL),
(@project_id, @event_id, '137', 'age', '90', NULL),
(@project_id, @event_id, '137', 'demographics_complete', '1', NULL),
(@project_id, @event_id, '137', 'ethnicity', 'U', NULL),
(@project_id, @event_id, '137', 'sex', 'M', NULL),
(@project_id, @event_id, '137', 'height', '157', NULL),
(@project_id, @event_id, '137', 'race', 'A', NULL),
(@project_id, @event_id, '137', 'study_id', '137', NULL),
(@project_id, @event_id, '137', 'weight', '70', NULL),
(@project_id, @event_id, '138', 'age', '28', NULL),
(@project_id, @event_id, '138', 'demographics_complete', '0', NULL),
(@project_id, @event_id, '138', 'ethnicity', 'U', NULL),
(@project_id, @event_id, '138', 'sex', 'M', NULL),
(@project_id, @event_id, '138', 'height', '197', NULL),
(@project_id, @event_id, '138', 'race', 'A', NULL),
(@project_id, @event_id, '138', 'study_id', '138', NULL),
(@project_id, @event_id, '138', 'weight', '84', NULL),
(@project_id, @event_id, '139', 'age', '35', NULL),
(@project_id, @event_id, '139', 'demographics_complete', '0', NULL),
(@project_id, @event_id, '139', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '139', 'sex', 'M', NULL),
(@project_id, @event_id, '139', 'height', '174', NULL),
(@project_id, @event_id, '139', 'race', 'W', NULL),
(@project_id, @event_id, '139', 'study_id', '139', NULL),
(@project_id, @event_id, '139', 'weight', '196', NULL),
(@project_id, @event_id, '140', 'age', '10', NULL),
(@project_id, @event_id, '140', 'demographics_complete', '1', NULL),
(@project_id, @event_id, '140', 'ethnicity', 'U', NULL),
(@project_id, @event_id, '140', 'sex', 'M', NULL),
(@project_id, @event_id, '140', 'height', '134', NULL),
(@project_id, @event_id, '140', 'race', 'U', NULL),
(@project_id, @event_id, '140', 'study_id', '140', NULL),
(@project_id, @event_id, '140', 'weight', '142', NULL),
(@project_id, @event_id, '141', 'age', '97', NULL),
(@project_id, @event_id, '141', 'demographics_complete', '1', NULL),
(@project_id, @event_id, '141', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '141', 'sex', 'M', NULL),
(@project_id, @event_id, '141', 'height', '201', NULL),
(@project_id, @event_id, '141', 'race', 'U', NULL),
(@project_id, @event_id, '141', 'study_id', '141', NULL),
(@project_id, @event_id, '141', 'weight', '134', NULL),
(@project_id, @event_id, '142', 'age', '4', NULL),
(@project_id, @event_id, '142', 'demographics_complete', '0', NULL),
(@project_id, @event_id, '142', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '142', 'sex', 'M', NULL),
(@project_id, @event_id, '142', 'height', '205', NULL),
(@project_id, @event_id, '142', 'race', 'M', NULL),
(@project_id, @event_id, '142', 'study_id', '142', NULL),
(@project_id, @event_id, '142', 'weight', '175', NULL),
(@project_id, @event_id, '143', 'age', '94', NULL),
(@project_id, @event_id, '143', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '143', 'ethnicity', 'U', NULL),
(@project_id, @event_id, '143', 'sex', 'M', NULL),
(@project_id, @event_id, '143', 'height', '137', NULL),
(@project_id, @event_id, '143', 'race', 'U', NULL),
(@project_id, @event_id, '143', 'study_id', '143', NULL),
(@project_id, @event_id, '143', 'weight', '136', NULL),
(@project_id, @event_id, '144', 'age', '36', NULL),
(@project_id, @event_id, '144', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '144', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '144', 'sex', 'F', NULL),
(@project_id, @event_id, '144', 'height', '179', NULL),
(@project_id, @event_id, '144', 'race', 'A', NULL),
(@project_id, @event_id, '144', 'study_id', '144', NULL),
(@project_id, @event_id, '144', 'weight', '164', NULL),
(@project_id, @event_id, '145', 'age', '45', NULL),
(@project_id, @event_id, '145', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '145', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '145', 'sex', 'M', NULL),
(@project_id, @event_id, '145', 'height', '181', NULL),
(@project_id, @event_id, '145', 'race', 'M', NULL),
(@project_id, @event_id, '145', 'study_id', '145', NULL),
(@project_id, @event_id, '145', 'weight', '134', NULL),
(@project_id, @event_id, '146', 'age', '43', NULL),
(@project_id, @event_id, '146', 'demographics_complete', '1', NULL),
(@project_id, @event_id, '146', 'ethnicity', 'N', NULL),
(@project_id, @event_id, '146', 'sex', 'F', NULL),
(@project_id, @event_id, '146', 'height', '163', NULL),
(@project_id, @event_id, '146', 'race', 'W', NULL),
(@project_id, @event_id, '146', 'study_id', '146', NULL),
(@project_id, @event_id, '146', 'weight', '64', NULL),
(@project_id, @event_id, '147', 'age', '29', NULL),
(@project_id, @event_id, '147', 'demographics_complete', '0', NULL),
(@project_id, @event_id, '147', 'ethnicity', 'U', NULL),
(@project_id, @event_id, '147', 'sex', 'M', NULL),
(@project_id, @event_id, '147', 'height', '142', NULL),
(@project_id, @event_id, '147', 'race', 'A', NULL),
(@project_id, @event_id, '147', 'study_id', '147', NULL),
(@project_id, @event_id, '147', 'weight', '83', NULL),
(@project_id, @event_id, '148', 'age', '6', NULL),
(@project_id, @event_id, '148', 'demographics_complete', '0', NULL),
(@project_id, @event_id, '148', 'ethnicity', 'H', NULL),
(@project_id, @event_id, '148', 'sex', 'M', NULL),
(@project_id, @event_id, '148', 'height', '201', NULL),
(@project_id, @event_id, '148', 'race', 'AI', NULL),
(@project_id, @event_id, '148', 'study_id', '148', NULL),
(@project_id, @event_id, '148', 'weight', '70', NULL),
(@project_id, @event_id, '149', 'age', '18', NULL),
(@project_id, @event_id, '149', 'demographics_complete', '0', NULL),
(@project_id, @event_id, '149', 'ethnicity', 'U', NULL),
(@project_id, @event_id, '149', 'sex', 'F', NULL),
(@project_id, @event_id, '149', 'height', '195', NULL),
(@project_id, @event_id, '149', 'race', 'M', NULL),
(@project_id, @event_id, '149', 'study_id', '149', NULL),
(@project_id, @event_id, '149', 'weight', '105', NULL),
(@project_id, @event_id, '150', 'age', '39', NULL),
(@project_id, @event_id, '150', 'demographics_complete', '2', NULL),
(@project_id, @event_id, '150', 'ethnicity', 'U', NULL),
(@project_id, @event_id, '150', 'sex', 'M', NULL),
(@project_id, @event_id, '150', 'height', '136', NULL),
(@project_id, @event_id, '150', 'race', 'AI', NULL),
(@project_id, @event_id, '150', 'study_id', '150', NULL),
(@project_id, @event_id, '150', 'weight', '133', NULL);
-- reports
set @unique_report_name = (select LEFT(UPPER(CONCAT('R-', CAST(FLOOR(10*RAND()) as CHAR), CAST(FLOOR(10*RAND()) as CHAR), CAST(FLOOR(10*RAND()) as CHAR), SHA1(RAND()))), 12) limit 1);
INSERT INTO `redcap_reports` (`project_id`, `title`, `unique_report_name`, `report_order`, `user_access`, `user_edit_access`, `description`, `combine_checkbox_values`, `output_dags`, `output_survey_fields`, `output_missing_data_codes`, `remove_line_breaks_in_values`, `orderby_field1`, `orderby_sort1`, `orderby_field2`, `orderby_sort2`, `orderby_field3`, `orderby_sort3`, `advanced_logic`, `filter_type`, `dynamic_filter1`, `dynamic_filter2`, `dynamic_filter3`) VALUES
(@project_id, 'All Participants', null, 1, 'ALL', 'ALL', NULL, 0, 0, 0, 0, 1, 'study_id', 'ASC', NULL, NULL, NULL, NULL, NULL, 'RECORD', NULL, NULL, NULL),
(@project_id, 'Participants (age > 80)', @unique_report_name, 2, 'ALL', 'ALL', NULL, 0, 0, 0, 0, 1, 'study_id', 'ASC', NULL, NULL, NULL, NULL, '([age] > 80)', 'EVENT', NULL, NULL, NULL);
-- project dashboards
INSERT INTO `redcap_project_dashboards` (`project_id`, `title`, `body`) VALUES
(@project_id, 'Project Dashboard Example 1', '<p><strong>SMART FUNCTIONS</strong> are aggregate mathematical functions that are applied across ALL records in a project.</p>\r\n<p>Smart Functions include <strong>min</strong>, <strong>max</strong>, <strong>mean</strong>, <strong>median</strong>, <strong>sum</strong>, <strong>stdev</strong>, <strong>count</strong>, and <strong>unique</strong>.</p>\r\n<p>This project contains <strong>[aggregate-count:study_id] records</strong>. The average age of all participants is <strong>[aggregate-mean:age]</strong> (stdev=[aggregate-stdev:age]). The median weight is <strong>[aggregate-median:weight]</strong> (min: [aggregate-min:weight], max: [aggregate-max:weight]).</p>\r\n<hr />\r\n<p><strong>SMART TABLES</strong> display descriptive statistics for fields with each field as a row in the table.</p>\r\n<table style=\"border-collapse: collapse; width: 100%;\" border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td style=\"width: 43.0038%; vertical-align: top;\">\r\n<p>Smart Tables can be displayed with ALL columns by default:</p>\r\n<p>[stats-table:height,weight,race,sex]</p>\r\n</td>\r\n<td style=\"width: 31.3222%; vertical-align: top;\">\r\n<p>Or with only specified columns:</p>\r\n<p>[stats-table:age,weight,height:mean,stdev]</p>\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n<hr />\r\n<p><strong>SMART CHARTS</strong> can be used to display many types of charts for one or more fields in the project.</p>\r\n<table style=\"border-collapse: collapse; width: 100%; height: 68px;\" border=\"0\" cellspacing=\"10\" cellpadding=\"10\">\r\n<tbody>\r\n<tr>\r\n<td style=\"width: 47.4989%; vertical-align: top;\">\r\n<p>Display a <strong>scatter plot</strong> of two fields (x vs y):</p>\r\n<p>[scatter-plot:height,weight]</p>\r\n<p>Add a third field for grouping (by color):</p>\r\n<p>[scatter-plot:height,weight,sex]</p>\r\n</td>\r\n<td style=\"width: 47.4989%; height: 16px; vertical-align: top;\">\r\n<p>Use <strong>line charts</strong> with two fields (x vs y):</p>\r\n<p>[line-chart:height,weight]</p>\r\n<p>Add a third field for grouping (by color):</p>\r\n<p>[line-chart:height,weight,sex]</p>\r\n</td>\r\n</tr>\r\n<tr style=\"height: 52px;\">\r\n<td style=\"width: 47.4989%; height: 52px; vertical-align: top;\">\r\n<p>Display a <strong>bar chart</strong> with a single multiple choice field:</p>\r\n<p>[bar-chart:race]</p>\r\n</td>\r\n<td style=\"width: 47.4989%; height: 52px; vertical-align: top;\">\r\n<p>Display bar charts vertically, and add a second field for grouping:</p>\r\n<p>[bar-chart:race,sex:bar-vertical]</p>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td style=\"width: 47.4989%; vertical-align: top;\">\r\n<p>Display a <strong>pie chart</strong></p>\r\n<p>[pie-chart:race]</p>\r\n</td>\r\n<td style=\"width: 47.4989%; vertical-align: top;\">\r\n<p>Or a <strong>donut chart</strong></p>\r\n<p>[donut-chart:race]</p>\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n<p> </p>'),
(@project_id, 'Project Dashboard Example 2', concat('<p><strong>Use data filtering via Reports or DAGs to limit the data used by Smart Functions, Smart Tables, or Smart Charts:</strong></p>\r\n<p>There are [aggregate-count:study_id] records in the project.</p>\r\n<p>There are [aggregate-count:age:vanderbilt] records assigned to the Vanderbilt data access group.</p>\r\n<p>There are [aggregate-count:study_id:', @unique_report_name, '] records where age > 80.</p>'));
-- Add template
INSERT INTO `redcap_projects_templates` (`project_id`, `title`, `description`, `enabled`, copy_records)
	VALUES (@project_id,  @project_title,  'Example of Project Dashboards, Smart Functions, Smart Tables, & Smart Charts with fifty records included.', 1, 1);
-- SQL TO CREATE A REDCAP DEMO PROJECT --
set @project_title = 'MyCap Example Project';


-- Obtain default values --
set @institution = (select value from redcap_config where field_name = 'institution' limit 1);
set @site_org_type = (select value from redcap_config where field_name = 'site_org_type' limit 1);
set @grant_cite = (select value from redcap_config where field_name = 'grant_cite' limit 1);
set @project_contact_name = (select value from redcap_config where field_name = 'project_contact_name' limit 1);
set @project_contact_email = (select value from redcap_config where field_name = 'project_contact_email' limit 1);
set @headerlogo = (select value from redcap_config where field_name = 'headerlogo' limit 1);
set @auth_meth = (select value from redcap_config where field_name = 'auth_meth_global' limit 1);
set @pcode = upper(concat(LEFT(sha1(rand()),20)));
-- Create project --
INSERT INTO `redcap_projects`
(project_name, app_title, status, count_project, auth_meth, creation_time, production_time, institution, site_org_type, grant_cite, project_contact_name, project_contact_email, headerlogo, display_project_logo_institution, auto_inc_set, mycap_enabled, custom_record_label, survey_email_participant_field, surveys_enabled) VALUES
(concat('redcap_demo_',LEFT(sha1(rand()),6)), @project_title, 1, 0, @auth_meth, now(), now(), @institution, @site_org_type, @grant_cite, @project_contact_name, @project_contact_email, @headerlogo, 0, 1, 1, '[name] [email]', 'email', 1);
set @project_id = LAST_INSERT_ID();
-- Create single arm --
INSERT INTO redcap_events_arms (project_id, arm_num, arm_name) VALUES (@project_id, 1, 'Arm 1');
set @arm_id = LAST_INSERT_ID();
-- Create single event --
INSERT INTO redcap_events_metadata (arm_id, day_offset, offset_min, offset_max, descrip) VALUES (@arm_id, 0, 0, 0, 'Event 1');
set @event_id = LAST_INSERT_ID();
-- Set repeating instruments
INSERT INTO `redcap_events_repeat` (`event_id`, `form_name`, `custom_repeat_form_label`) VALUES
(@event_id, 'welcome', NULL),
(@event_id, 'morning_checkin', NULL),
(@event_id, 'weekend_plans', NULL),
(@event_id, 'peak_flow_rate', NULL),
(@event_id, 'tapping_interval_task', NULL),
(@event_id, 'tower_of_hanoi_active_task', NULL),
(@event_id, 'tone_audiometry_active_task', NULL),
(@event_id, 'timed_walk_active_task', NULL),
(@event_id, 'spatial_span_memory_test_active_task', NULL),
(@event_id, 'fitness_check_active_task', NULL),
(@event_id, 'reaction_time_active_task', NULL),
(@event_id, 'psat_active_task', NULL),
(@event_id, 'short_walk_active_task', NULL),
(@event_id, 'audio_active_task', NULL),
(@event_id, 'selfie_capture', NULL);

INSERT INTO `redcap_surveys` (`project_id`, `form_name`, `title`, `instructions`, `offline_instructions`, `acknowledgement`, `stop_action_acknowledgement`, `stop_action_delete_response`, `question_by_section`, `display_page_number`, `question_auto_numbering`, `survey_enabled`, `save_and_return`, `save_and_return_code_bypass`, `logo`, `hide_title`, `view_results`, `min_responses_view_results`, `check_diversity_view_results`, `end_survey_redirect_url`, `survey_expiration`, `promis_skip_question`, `survey_auth_enabled_single`, `edit_completed_response`, `hide_back_button`, `show_required_field_text`, `confirmation_email_subject`, `confirmation_email_content`, `confirmation_email_from`, `confirmation_email_from_display`, `confirmation_email_attach_pdf`, `confirmation_email_attachment`, `text_to_speech`, `text_to_speech_language`, `end_survey_redirect_next_survey`, `end_survey_redirect_next_survey_logic`, `theme`, `text_size`, `font_family`, `theme_text_buttons`, `theme_bg_page`, `theme_text_title`, `theme_bg_title`, `theme_text_sectionheader`, `theme_bg_sectionheader`, `theme_text_question`, `theme_bg_question`, `enhanced_choices`, `repeat_survey_enabled`, `repeat_survey_btn_text`, `repeat_survey_btn_location`, `response_limit`, `response_limit_include_partials`, `response_limit_custom_text`, `survey_time_limit_days`, `survey_time_limit_hours`, `survey_time_limit_minutes`, `email_participant_field`, `end_of_survey_pdf_download`, `pdf_save_to_field`, `pdf_save_to_event_id`, `pdf_save_translated`, `pdf_auto_archive`, `pdf_econsent_version`, `pdf_econsent_type`, `pdf_econsent_firstname_field`, `pdf_econsent_firstname_event_id`, `pdf_econsent_lastname_field`, `pdf_econsent_lastname_event_id`, `pdf_econsent_dob_field`, `pdf_econsent_dob_event_id`, `pdf_econsent_allow_edit`, `pdf_econsent_signature_field1`, `pdf_econsent_signature_field2`, `pdf_econsent_signature_field3`, `pdf_econsent_signature_field4`, `pdf_econsent_signature_field5`, `survey_width_percent`, `survey_show_font_resize`, `survey_btn_text_prev_page`, `survey_btn_text_next_page`, `survey_btn_text_submit`, `survey_btn_hide_submit`, `survey_btn_hide_submit_logic`) VALUES
(@project_id, 'participant_intake', 'Participant Intake', NULL, NULL, '<p><strong>Use one of the options below to join the project on MyCap:</strong></p>\n<ol>\n<li>[mycap-participant-link:Click this MyCap link] while on your mobile device, which will prompt you to install MyCap if it\'s not already installed. After MyCap is open, tap \"Join Project\". (Note: If you have other MyCap projects, you may need to go to your Profile and click \"Join Another Project\").</li>\n<li>To scan the QR Code below, install the MyCap app on your mobile device (iOS: <a href=\"https://apps.apple.com/us/app/pacym/id6448734173\"><u>App Store</u></a>, Android: <a href=\"https://play.google.com/store/apps/details?id=org.vumc.victr.mycap\"><u>Play Store</u></a>), open the MyCap app, and tap \"Join Project\".<br /><img src=\"http://localhost/redcap_standard/redcap_v13.0.0/MyCap/participant_info.php?action=displayParticipantQrCode&pid=[project-id]&preview_pid=80&par_code=[mycap-participant-code]\" width=\"185\" height=\"185\" /></li>\n</ol>', NULL, 0, 0, 0, 1, 1, 0, 0, NULL, 0, 0, 10, 0, NULL, NULL, 0, 0, 0, 0, 1, 'Join Your Project', '<p><strong>Use one of the options below to join the project on MyCap:</strong></p>\n<ol>\n<li>[mycap-participant-link:Click this MyCap link] while on your mobile device, which will prompt you to install MyCap if it\'s not already installed. After MyCap is open, tap \"Join Project\". (Note: If you have other MyCap projects, you may need to go to your Profile and click \"Join Another Project\").</li>\n<li>To scan the QR Code below, install the MyCap app on your mobile device (iOS: <a href=\"https://itunes.apple.com/us/app/mycap/id1209842552?ls=1&mt=8\"><u>App Store</u></a>, Android: <a href=\"https://play.google.com/store/apps/details?id=org.vumc.victr.mycap\"><u>Play Store</u></a>), open the MyCap app, and tap \"Join Project\".<br /><img src=\"http://localhost/redcap_standard/redcap_v13.0.0/MyCap/participant_info.php?action=displayParticipantQrCode&pid=[project-id]&preview_pid=80&par_code=[mycap-participant-code]\" width=\"185\" height=\"185\" /></li>\n</ol>', 'mycap@vumc.org', 'MyCap', 0, NULL, 0, 'en', 0, NULL, NULL, 1, 16, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, 'HIDDEN', NULL, 1, '<p>Thank you for your interest; however, the survey is closed because the maximum number of responses has been reached.</p>', NULL, NULL, NULL, NULL, 0, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, 0, NULL);

-- Insert into redcap_metadata --
INSERT INTO `redcap_metadata` (`project_id`, `field_name`, `field_phi`, `form_name`, `form_menu_description`, `field_order`, `field_units`, `element_preceding_header`, `element_type`, `element_label`, `element_enum`, `element_note`, `element_validation_type`, `element_validation_min`, `element_validation_max`, `element_validation_checktype`, `branching_logic`, `field_req`, `edoc_id`, `edoc_display_img`, `custom_alignment`, `stop_actions`, `question_num`, `grid_name`, `grid_rank`, `misc`, `video_url`, `video_display_inline`) VALUES
(@project_id, 'record_id', NULL, 'participant_intake', 'Participant Intake', 1, NULL, NULL, 'text', 'Record ID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'name', NULL, 'participant_intake', NULL, 2, NULL, NULL, 'text', 'Name/Study ID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'site', NULL, 'participant_intake', NULL, 3, NULL, NULL, 'text', 'Site ID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'email', NULL, 'participant_intake', NULL, 4, NULL, NULL, 'text', '<div class=\"rich-text-field-label\"><p>Email <br /><br /><span style=\"font-weight: normal;\">After completing this survey, a QR Code and Dynamic Link to join the project will be displayed. You can use either method to join. If you enter your email address, you will receive an email with this information, too.</span></p></div>', NULL, NULL, 'email', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'baseline', NULL, 'participant_intake', NULL, 5, NULL, NULL, 'text', 'Baseline', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDDEN', NULL, 0),
(@project_id, 'par_joindate', NULL, 'participant_intake', NULL, 5.1, NULL, NULL, 'text', 'Install Date', NULL, NULL, 'datetime_seconds_ymd', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-PARTICIPANT-JOINDATE @HIDDEN', NULL, 0),
(@project_id, 'participant_intake_complete', NULL, 'participant_intake', NULL, 6, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'wel_whyinterested', NULL, 'welcome', 'Welcome', 7, NULL, NULL, 'radio', 'RADIO BUTTON: Why are you interested in MyCap?', '1, I am a researcher and want to test MyCap\\n2, I am interested in participating in a project that uses MyCap\\n3, Other', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'wel_whyinterestedother', NULL, 'welcome', NULL, 8, NULL, NULL, 'textarea', 'NOTES BOX: Describe why you are interested in MyCap', NULL, NULL, NULL, NULL, NULL, NULL, '[wel_whyinterested] = \'3\'', 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'wel_hasfavoritefood', NULL, 'welcome', NULL, 9, NULL, NULL, 'yesno', 'YES - NO: Do you have a favorite food?', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'true_false', NULL, 'welcome', NULL, 10, NULL, NULL, 'truefalse', 'TRUE - FALSE: Santa Claus is real.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'wel_favoritefood', NULL, 'welcome', NULL, 11, NULL, NULL, 'text', 'TEXT BOX (Required): What is your favorite food?', NULL, NULL, NULL, NULL, NULL, 'soft_typed', '[wel_hasfavoritefood] = \'1\'', 1, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'wel_favoriteday', NULL, 'welcome', NULL, 12, NULL, NULL, 'text', 'TEXT BOX (datetime validation): What time did you wake up today?', NULL, NULL, 'datetime_mdy', NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, 'RH', NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'wel_age', NULL, 'welcome', NULL, 13, NULL, NULL, 'select', 'DROP-DOWN: What is your age?', '1, Under 18\\n2, 18 to 30\\n3, 31 to 45\\n4, 46 to 67\\n5, 68+', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'image', NULL, 'welcome', NULL, 16, NULL, NULL, 'file', 'IMAGE CAPTURE: Take a photo', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-FIELD-FILE-IMAGECAPTURE', NULL, 0),
(@project_id, 'video', NULL, 'welcome', NULL, 17, NULL, NULL, 'file', 'VIDEO CAPTURE: Record a 10 second video', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-FIELD-FILE-VIDEOCAPTURE=10:YES:OFF:BACK', NULL, 0),
(@project_id, 'wel_uuid', NULL, 'welcome', NULL, 18, NULL, 'Mobile App Fields - Do Not Modify', 'text', 'UUID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDDEN @MC-TASK-UUID', NULL, 0),
(@project_id, 'wel_startdate', NULL, 'welcome', NULL, 19, NULL, NULL, 'text', 'Start Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDDEN @MC-TASK-STARTDATE', NULL, 0),
(@project_id, 'wel_enddate', NULL, 'welcome', NULL, 20, NULL, NULL, 'text', 'End Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDDEN @MC-TASK-ENDDATE', NULL, 0),
(@project_id, 'wel_scheduledate', NULL, 'welcome', NULL, 21, NULL, NULL, 'text', 'Schedule Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SCHEDULEDATE @HIDDEN', NULL, 0),
(@project_id, 'wel_status', NULL, 'welcome', NULL, 22, NULL, NULL, 'select', 'Status', '0, Deleted\\n1, Completed\\n2, Incomplete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STATUS @HIDDEN', NULL, 0),
(@project_id, 'wel_supplementaldata', NULL, 'welcome', NULL, 23, NULL, NULL, 'textarea', 'Supplemental Data (JSON)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDDEN @MC-TASK-SUPPLEMENTALDATA', NULL, 0),
(@project_id, 'wel_serializedresult', NULL, 'welcome', NULL, 24, NULL, NULL, 'file', 'serializedresult', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SERIALIZEDRESULT', NULL, 0),
(@project_id, 'welcome_complete', NULL, 'welcome', NULL, 25, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'mor_didtakemeds', NULL, 'morning_checkin', 'Morning Checkin', 26, NULL, NULL, 'yesno', 'YES-NO: Did you take your medications this morning?', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'mor_uuid', NULL, 'morning_checkin', NULL, 28, NULL, 'Mobile App Fields - Do Not Modify', 'text', 'UUID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDDEN @MC-TASK-UUID', NULL, 0),
(@project_id, 'mor_startdate', NULL, 'morning_checkin', NULL, 29, NULL, NULL, 'text', 'Start Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDDEN @MC-TASK-STARTDATE', NULL, 0),
(@project_id, 'mor_enddate', NULL, 'morning_checkin', NULL, 30, NULL, NULL, 'text', 'End Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDDEN @MC-TASK-ENDDATE', NULL, 0),
(@project_id, 'mor_scheduledate', NULL, 'morning_checkin', NULL, 31, NULL, NULL, 'text', 'Schedule Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SCHEDULEDATE @HIDDEN', NULL, 0),
(@project_id, 'mor_status', NULL, 'morning_checkin', NULL, 32, NULL, NULL, 'select', 'Status', '0, Deleted\\n1, Completed\\n2, Incomplete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STATUS @HIDDEN', NULL, 0),
(@project_id, 'mor_supplementaldata', NULL, 'morning_checkin', NULL, 33, NULL, NULL, 'textarea', 'Supplemental Data (JSON)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDDEN @MC-TASK-SUPPLEMENTALDATA', NULL, 0),
(@project_id, 'mor_serializedresult', NULL, 'morning_checkin', NULL, 34, NULL, NULL, 'file', 'serializedresult', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SERIALIZEDRESULT', NULL, 0),
(@project_id, 'morning_checkin_complete', NULL, 'morning_checkin', NULL, 35, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'wee_plans', NULL, 'weekend_plans', 'Weekend Plans', 36, NULL, NULL, 'checkbox', 'CHECKBOX: What are you going to do this weekend?', '1, Go out to eat\\n2, Play a sport\\n3, Watch a movie\\n4, Visit with friends or family\\n5, Travel', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'wee_weather', NULL, 'weekend_plans', NULL, 37, NULL, NULL, 'radio', 'RADIO BUTTON: What does the weather look like for this weekend?', '1, Rainy\\n2, Stormy\\n3, Sunny\\n4, Cloudy', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'wee_uuid', NULL, 'weekend_plans', NULL, 38, NULL, 'Mobile App Fields - Do Not Modify', 'text', 'UUID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDDEN @MC-TASK-UUID', NULL, 0),
(@project_id, 'wee_startdate', NULL, 'weekend_plans', NULL, 39, NULL, NULL, 'text', 'Start Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDDEN @MC-TASK-STARTDATE', NULL, 0),
(@project_id, 'wee_enddate', NULL, 'weekend_plans', NULL, 40, NULL, NULL, 'text', 'End Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDDEN @MC-TASK-ENDDATE', NULL, 0),
(@project_id, 'wee_scheduledate', NULL, 'weekend_plans', NULL, 41, NULL, NULL, 'text', 'Schedule Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SCHEDULEDATE @HIDDEN', NULL, 0),
(@project_id, 'wee_status', NULL, 'weekend_plans', NULL, 42, NULL, NULL, 'select', 'Status', '0, Deleted\\n1, Completed\\n2, Incomplete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STATUS @HIDDEN', NULL, 0),
(@project_id, 'wee_supplementaldata', NULL, 'weekend_plans', NULL, 43, NULL, NULL, 'textarea', 'Supplemental Data (JSON)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDDEN @MC-TASK-SUPPLEMENTALDATA', NULL, 0),
(@project_id, 'wee_serializedresult', NULL, 'weekend_plans', NULL, 44, NULL, NULL, 'file', 'serializedresult', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SERIALIZEDRESULT', NULL, 0),
(@project_id, 'weekend_plans_complete', NULL, 'weekend_plans', NULL, 45, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'pea_date', NULL, 'peak_flow_rate', 'Peak Flow Rate', 46, NULL, NULL, 'text', 'TEXT BOX (Date validation): Date', NULL, NULL, 'date_mdy', NULL, NULL, 'soft_typed', NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'pea_time', NULL, 'peak_flow_rate', NULL, 47, NULL, NULL, 'text', 'TEXT BOX (Time validation): Time', NULL, NULL, 'time', NULL, NULL, 'soft_typed', NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'pea_value', NULL, 'peak_flow_rate', NULL, 48, NULL, NULL, 'text', 'TEXT BOX (Integer validation): Pick a number between 1 and 10', NULL, NULL, 'int', '0', '10', 'soft_typed', NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'pea_uuid', NULL, 'peak_flow_rate', NULL, 49, NULL, 'Mobile App Fields - Do Not Modify', 'text', 'UUID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDDEN @MC-TASK-UUID', NULL, 0),
(@project_id, 'pea_startdate', NULL, 'peak_flow_rate', NULL, 50, NULL, NULL, 'text', 'Start Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDDEN @MC-TASK-STARTDATE', NULL, 0),
(@project_id, 'pea_enddate', NULL, 'peak_flow_rate', NULL, 51, NULL, NULL, 'text', 'End Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDDEN @MC-TASK-ENDDATE', NULL, 0),
(@project_id, 'pea_scheduledate', NULL, 'peak_flow_rate', NULL, 52, NULL, NULL, 'text', 'Schedule Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDDEN @MC-TASK-SCHEDULEDATE', NULL, 0),
(@project_id, 'pea_status', NULL, 'peak_flow_rate', NULL, 53, NULL, NULL, 'select', 'Status', '0, Deleted\\n1, Completed\\n2, Incomplete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STATUS @HIDDEN', NULL, 0),
(@project_id, 'pea_supplementaldata', NULL, 'peak_flow_rate', NULL, 54, NULL, NULL, 'textarea', 'Supplemental Data (JSON)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@HIDDEN @MC-TASK-SUPPLEMENTALDATA', NULL, 0),
(@project_id, 'pea_serializedresult', NULL, 'peak_flow_rate', NULL, 55, NULL, NULL, 'file', 'serializedresult', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SERIALIZEDRESULT', NULL, 0),
(@project_id, 'peak_flow_rate_complete', NULL, 'peak_flow_rate', NULL, 56, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'leftjson', NULL, 'tapping_interval_task', 'Tapping Interval Task', 57, NULL, NULL, 'textarea', 'Left Hand JSON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-TWO-LEFT', NULL, 0),
(@project_id, 'leftaccelerometer', NULL, 'tapping_interval_task', NULL, 58, NULL, NULL, 'file', 'Left Hand Accelerometer', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-TWO-LEFT-ACCELEROMETER', NULL, 0),
(@project_id, 'rightjson', NULL, 'tapping_interval_task', NULL, 59, NULL, NULL, 'textarea', 'Right Hand JSON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-TWO-RIGHT', NULL, 0),
(@project_id, 'rightaccelerometer', NULL, 'tapping_interval_task', NULL, 60, NULL, NULL, 'file', 'Right Hand Accelerometer', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-TWO-RIGHT-ACCELEROMETER', NULL, 0),
(@project_id, 'uuid', NULL, 'tapping_interval_task', NULL, 61, NULL, 'MyCap App Fields - Do Not Modify', 'text', 'UUID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-UUID', NULL, 0),
(@project_id, 'startdate', NULL, 'tapping_interval_task', NULL, 62, NULL, NULL, 'text', 'Start Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STARTDATE', NULL, 0),
(@project_id, 'enddate', NULL, 'tapping_interval_task', NULL, 63, NULL, NULL, 'text', 'End Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ENDDATE', NULL, 0),
(@project_id, 'scheduledate', NULL, 'tapping_interval_task', NULL, 64, NULL, NULL, 'text', 'Schedule Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SCHEDULEDATE', NULL, 0),
(@project_id, 'status', NULL, 'tapping_interval_task', NULL, 65, NULL, NULL, 'select', 'Status', '0, Deleted\\n1, Completed\\n2, Incomplete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STATUS', NULL, 0),
(@project_id, 'supplementaldata', NULL, 'tapping_interval_task', NULL, 66, NULL, NULL, 'textarea', 'Supplemental Data (JSON)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SUPPLEMENTALDATA', NULL, 0),
(@project_id, 'serializedresult', NULL, 'tapping_interval_task', NULL, 67, NULL, NULL, 'file', 'Serialized Result', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SERIALIZEDRESULT', NULL, 0),
(@project_id, 'tapping_interval_task_complete', NULL, 'tapping_interval_task', NULL, 68, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'json', NULL, 'tower_of_hanoi_active_task', 'Tower of Hanoi Active Task', 69, NULL, NULL, 'textarea', 'JSON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-TOW', NULL, 0),
(@project_id, 'uuid_11', NULL, 'tower_of_hanoi_active_task', NULL, 70, NULL, 'MyCap App Fields - Do Not Modify', 'text', 'UUID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-UUID', NULL, 0),
(@project_id, 'startdate_11', NULL, 'tower_of_hanoi_active_task', NULL, 71, NULL, NULL, 'text', 'Start Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STARTDATE', NULL, 0),
(@project_id, 'enddate_11', NULL, 'tower_of_hanoi_active_task', NULL, 72, NULL, NULL, 'text', 'End Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ENDDATE', NULL, 0),
(@project_id, 'scheduledate_11', NULL, 'tower_of_hanoi_active_task', NULL, 73, NULL, NULL, 'text', 'Schedule Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SCHEDULEDATE', NULL, 0),
(@project_id, 'status_11', NULL, 'tower_of_hanoi_active_task', NULL, 74, NULL, NULL, 'select', 'Status', '0, Deleted\\n1, Completed\\n2, Incomplete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STATUS', NULL, 0),
(@project_id, 'supplementaldata_11', NULL, 'tower_of_hanoi_active_task', NULL, 75, NULL, NULL, 'textarea', 'Supplemental Data (JSON)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SUPPLEMENTALDATA', NULL, 0),
(@project_id, 'serializedresult_11', NULL, 'tower_of_hanoi_active_task', NULL, 76, NULL, NULL, 'file', 'Serialized Result', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SERIALIZEDRESULT', NULL, 0),
(@project_id, 'tower_of_hanoi_active_task_complete', NULL, 'tower_of_hanoi_active_task', NULL, 77, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'json_2', NULL, 'tone_audiometry_active_task', 'Tone Audiometry Active Task', 78, NULL, NULL, 'textarea', 'JSON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-TON', NULL, 0),
(@project_id, 'uuid_10', NULL, 'tone_audiometry_active_task', NULL, 79, NULL, 'MyCap App Fields - Do Not Modify', 'text', 'UUID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-UUID', NULL, 0),
(@project_id, 'startdate_10', NULL, 'tone_audiometry_active_task', NULL, 80, NULL, NULL, 'text', 'Start Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STARTDATE', NULL, 0),
(@project_id, 'enddate_10', NULL, 'tone_audiometry_active_task', NULL, 81, NULL, NULL, 'text', 'End Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ENDDATE', NULL, 0),
(@project_id, 'scheduledate_10', NULL, 'tone_audiometry_active_task', NULL, 82, NULL, NULL, 'text', 'Schedule Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SCHEDULEDATE', NULL, 0),
(@project_id, 'status_10', NULL, 'tone_audiometry_active_task', NULL, 83, NULL, NULL, 'select', 'Status', '0, Deleted\\n1, Completed\\n2, Incomplete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STATUS', NULL, 0),
(@project_id, 'supplementaldata_10', NULL, 'tone_audiometry_active_task', NULL, 84, NULL, NULL, 'textarea', 'Supplemental Data (JSON)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SUPPLEMENTALDATA', NULL, 0),
(@project_id, 'serializedresult_10', NULL, 'tone_audiometry_active_task', NULL, 85, NULL, NULL, 'file', 'Serialized Result', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SERIALIZEDRESULT', NULL, 0),
(@project_id, 'tone_audiometry_active_task_complete', NULL, 'tone_audiometry_active_task', NULL, 86, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'trial1', NULL, 'timed_walk_active_task', 'Timed Walk Active Task', 87, NULL, NULL, 'text', 'Trial 1 Distance', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-TIM_TRIAL1', NULL, 0),
(@project_id, 'turnaround', NULL, 'timed_walk_active_task', NULL, 88, NULL, NULL, 'text', 'Turn Around Distance', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-TIM_TURNAROUND', NULL, 0),
(@project_id, 'trial2', NULL, 'timed_walk_active_task', NULL, 89, NULL, NULL, 'text', 'Trial 2 Distance', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-TIM_TRIAL2', NULL, 0),
(@project_id, 'uuid_9', NULL, 'timed_walk_active_task', NULL, 90, NULL, 'MyCap App Fields - Do Not Modify', 'text', 'UUID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-UUID', NULL, 0),
(@project_id, 'startdate_9', NULL, 'timed_walk_active_task', NULL, 91, NULL, NULL, 'text', 'Start Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STARTDATE', NULL, 0),
(@project_id, 'enddate_9', NULL, 'timed_walk_active_task', NULL, 92, NULL, NULL, 'text', 'End Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ENDDATE', NULL, 0),
(@project_id, 'scheduledate_9', NULL, 'timed_walk_active_task', NULL, 93, NULL, NULL, 'text', 'Schedule Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SCHEDULEDATE', NULL, 0),
(@project_id, 'status_9', NULL, 'timed_walk_active_task', NULL, 94, NULL, NULL, 'select', 'Status', '0, Deleted\\n1, Completed\\n2, Incomplete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STATUS', NULL, 0),
(@project_id, 'supplementaldata_9', NULL, 'timed_walk_active_task', NULL, 95, NULL, NULL, 'textarea', 'Supplemental Data (JSON)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SUPPLEMENTALDATA', NULL, 0),
(@project_id, 'serializedresult_9', NULL, 'timed_walk_active_task', NULL, 96, NULL, NULL, 'file', 'Serialized Result', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SERIALIZEDRESULT', NULL, 0),
(@project_id, 'timed_walk_active_task_complete', NULL, 'timed_walk_active_task', NULL, 97, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'json_3', NULL, 'spatial_span_memory_test_active_task', 'Spatial Span Memory Test Active Task', 98, NULL, NULL, 'textarea', 'JSON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-SPA', NULL, 0),
(@project_id, 'uuid_8', NULL, 'spatial_span_memory_test_active_task', NULL, 99, NULL, 'MyCap App Fields - Do Not Modify', 'text', 'UUID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-UUID', NULL, 0),
(@project_id, 'startdate_8', NULL, 'spatial_span_memory_test_active_task', NULL, 100, NULL, NULL, 'text', 'Start Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STARTDATE', NULL, 0),
(@project_id, 'enddate_8', NULL, 'spatial_span_memory_test_active_task', NULL, 101, NULL, NULL, 'text', 'End Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ENDDATE', NULL, 0),
(@project_id, 'scheduledate_8', NULL, 'spatial_span_memory_test_active_task', NULL, 102, NULL, NULL, 'text', 'Schedule Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SCHEDULEDATE', NULL, 0),
(@project_id, 'status_8', NULL, 'spatial_span_memory_test_active_task', NULL, 103, NULL, NULL, 'select', 'Status', '0, Deleted\\n1, Completed\\n2, Incomplete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STATUS', NULL, 0),
(@project_id, 'supplementaldata_8', NULL, 'spatial_span_memory_test_active_task', NULL, 104, NULL, NULL, 'textarea', 'Supplemental Data (JSON)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SUPPLEMENTALDATA', NULL, 0),
(@project_id, 'serializedresult_8', NULL, 'spatial_span_memory_test_active_task', NULL, 105, NULL, NULL, 'file', 'Serialized Result', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SERIALIZEDRESULT', NULL, 0),
(@project_id, 'spatial_span_memory_test_active_task_complete', NULL, 'spatial_span_memory_test_active_task', NULL, 106, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'pedometer', NULL, 'fitness_check_active_task', 'Fitness Check Active Task', 107, NULL, NULL, 'file', 'Pedometer', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-FIT-WALK-PEDOMETER', NULL, 0),
(@project_id, 'walkacc', NULL, 'fitness_check_active_task', NULL, 108, NULL, NULL, 'file', 'Walk Accelerometer', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-FIT-WALK-ACCELEROMETER', NULL, 0),
(@project_id, 'walkdevice', NULL, 'fitness_check_active_task', NULL, 109, NULL, NULL, 'file', 'Walk Device Motion', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-FIT-WALK-DEVICEMOTION', NULL, 0),
(@project_id, 'walkloc', NULL, 'fitness_check_active_task', NULL, 110, NULL, NULL, 'file', 'Walk Location', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-FIT-WALK-LOCATION', NULL, 0),
(@project_id, 'restacc', NULL, 'fitness_check_active_task', NULL, 111, NULL, NULL, 'file', 'Rest Accelerometer', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-FIT-REST-ACCELEROMETER', NULL, 0),
(@project_id, 'restdevice', NULL, 'fitness_check_active_task', NULL, 112, NULL, NULL, 'file', 'Rest Device Motion', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-FIT-REST-DEVICEMOTION', NULL, 0),
(@project_id, 'uuid_7', NULL, 'fitness_check_active_task', NULL, 113, NULL, 'MyCap App Fields - Do Not Modify', 'text', 'UUID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-UUID', NULL, 0),
(@project_id, 'startdate_7', NULL, 'fitness_check_active_task', NULL, 114, NULL, NULL, 'text', 'Start Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STARTDATE', NULL, 0),
(@project_id, 'enddate_7', NULL, 'fitness_check_active_task', NULL, 115, NULL, NULL, 'text', 'End Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ENDDATE', NULL, 0),
(@project_id, 'scheduledate_7', NULL, 'fitness_check_active_task', NULL, 116, NULL, NULL, 'text', 'Schedule Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SCHEDULEDATE', NULL, 0),
(@project_id, 'status_7', NULL, 'fitness_check_active_task', NULL, 117, NULL, NULL, 'select', 'Status', '0, Deleted\\n1, Completed\\n2, Incomplete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STATUS', NULL, 0),
(@project_id, 'supplementaldata_7', NULL, 'fitness_check_active_task', NULL, 118, NULL, NULL, 'textarea', 'Supplemental Data (JSON)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SUPPLEMENTALDATA', NULL, 0),
(@project_id, 'serializedresult_7', NULL, 'fitness_check_active_task', NULL, 119, NULL, NULL, 'file', 'Serialized Result', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SERIALIZEDRESULT', NULL, 0),
(@project_id, 'fitness_check_active_task_complete', NULL, 'fitness_check_active_task', NULL, 120, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'json_4', NULL, 'reaction_time_active_task', 'Reaction Time Active Task', 121, NULL, NULL, 'textarea', 'JSON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-REA', NULL, 0),
(@project_id, 'uuid_6', NULL, 'reaction_time_active_task', NULL, 122, NULL, 'MyCap App Fields - Do Not Modify', 'text', 'UUID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-UUID', NULL, 0),
(@project_id, 'startdate_6', NULL, 'reaction_time_active_task', NULL, 123, NULL, NULL, 'text', 'Start Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STARTDATE', NULL, 0),
(@project_id, 'enddate_6', NULL, 'reaction_time_active_task', NULL, 124, NULL, NULL, 'text', 'End Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ENDDATE', NULL, 0),
(@project_id, 'scheduledate_6', NULL, 'reaction_time_active_task', NULL, 125, NULL, NULL, 'text', 'Schedule Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SCHEDULEDATE', NULL, 0),
(@project_id, 'status_6', NULL, 'reaction_time_active_task', NULL, 126, NULL, NULL, 'select', 'Status', '0, Deleted\\n1, Completed\\n2, Incomplete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STATUS', NULL, 0),
(@project_id, 'supplementaldata_6', NULL, 'reaction_time_active_task', NULL, 127, NULL, NULL, 'textarea', 'Supplemental Data (JSON)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SUPPLEMENTALDATA', NULL, 0),
(@project_id, 'serializedresult_6', NULL, 'reaction_time_active_task', NULL, 128, NULL, NULL, 'file', 'Serialized Result', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SERIALIZEDRESULT', NULL, 0),
(@project_id, 'reaction_time_active_task_complete', NULL, 'reaction_time_active_task', NULL, 129, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'json_5', NULL, 'psat_active_task', 'PSAT Active Task', 130, NULL, NULL, 'textarea', 'JSON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-PSA', NULL, 0),
(@project_id, 'uuid_5', NULL, 'psat_active_task', NULL, 131, NULL, 'MyCap App Fields - Do Not Modify', 'text', 'UUID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-UUID', NULL, 0),
(@project_id, 'startdate_5', NULL, 'psat_active_task', NULL, 132, NULL, NULL, 'text', 'Start Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STARTDATE', NULL, 0),
(@project_id, 'enddate_5', NULL, 'psat_active_task', NULL, 133, NULL, NULL, 'text', 'End Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ENDDATE', NULL, 0),
(@project_id, 'scheduledate_5', NULL, 'psat_active_task', NULL, 134, NULL, NULL, 'text', 'Schedule Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SCHEDULEDATE', NULL, 0),
(@project_id, 'status_5', NULL, 'psat_active_task', NULL, 135, NULL, NULL, 'select', 'Status', '0, Deleted\\n1, Completed\\n2, Incomplete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STATUS', NULL, 0),
(@project_id, 'supplementaldata_5', NULL, 'psat_active_task', NULL, 136, NULL, NULL, 'textarea', 'Supplemental Data (JSON)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SUPPLEMENTALDATA', NULL, 0),
(@project_id, 'serializedresult_5', NULL, 'psat_active_task', NULL, 137, NULL, NULL, 'file', 'Serialized Result', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SERIALIZEDRESULT', NULL, 0),
(@project_id, 'psat_active_task_complete', NULL, 'psat_active_task', NULL, 138, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'outacc', NULL, 'short_walk_active_task', 'Short Walk Active Task', 139, NULL, NULL, 'file', 'Outbound Accelerometer', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-SHO-OUTBOUND-ACCELEROMETER', NULL, 0),
(@project_id, 'outdevice', NULL, 'short_walk_active_task', NULL, 140, NULL, NULL, 'file', 'Outbound Device Motion', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-SHO-OUTBOUND-DEVICEMOTION', NULL, 0),
(@project_id, 'returnacc', NULL, 'short_walk_active_task', NULL, 141, NULL, NULL, 'file', 'Return Accelerometer', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-SHO-RETURN-ACCELEROMETER', NULL, 0),
(@project_id, 'returndevice', NULL, 'short_walk_active_task', NULL, 142, NULL, NULL, 'file', 'Return Device Motion', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-SHO-RETURN-DEVICEMOTION', NULL, 0),
(@project_id, 'restacc_2', NULL, 'short_walk_active_task', NULL, 143, NULL, NULL, 'file', 'Rest Accelerometer', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-SHO-REST-ACCELEROMETER', NULL, 0),
(@project_id, 'restdevice_2', NULL, 'short_walk_active_task', NULL, 144, NULL, NULL, 'file', 'Rest Device Motion', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-SHO-REST-DEVICEMOTION', NULL, 0),
(@project_id, 'uuid_4', NULL, 'short_walk_active_task', NULL, 145, NULL, 'MyCap App Fields - Do Not Modify', 'text', 'UUID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-UUID', NULL, 0),
(@project_id, 'startdate_4', NULL, 'short_walk_active_task', NULL, 146, NULL, NULL, 'text', 'Start Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STARTDATE', NULL, 0),
(@project_id, 'enddate_4', NULL, 'short_walk_active_task', NULL, 147, NULL, NULL, 'text', 'End Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ENDDATE', NULL, 0),
(@project_id, 'scheduledate_4', NULL, 'short_walk_active_task', NULL, 148, NULL, NULL, 'text', 'Schedule Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SCHEDULEDATE', NULL, 0),
(@project_id, 'status_4', NULL, 'short_walk_active_task', NULL, 149, NULL, NULL, 'select', 'Status', '0, Deleted\\n1, Completed\\n2, Incomplete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STATUS', NULL, 0),
(@project_id, 'supplementaldata_4', NULL, 'short_walk_active_task', NULL, 150, NULL, NULL, 'textarea', 'Supplemental Data (JSON)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SUPPLEMENTALDATA', NULL, 0),
(@project_id, 'serializedresult_4', NULL, 'short_walk_active_task', NULL, 151, NULL, NULL, 'file', 'Serialized Result', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SERIALIZEDRESULT', NULL, 0),
(@project_id, 'short_walk_active_task_complete', NULL, 'short_walk_active_task', NULL, 152, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'audio', NULL, 'audio_active_task', 'Audio Active Task', 153, NULL, NULL, 'file', 'Audio Recording', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-REC-AUD', NULL, 0),
(@project_id, 'uuid_3', NULL, 'audio_active_task', NULL, 154, NULL, 'MyCap App Fields - Do Not Modify', 'text', 'UUID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-UUID', NULL, 0),
(@project_id, 'startdate_3', NULL, 'audio_active_task', NULL, 155, NULL, NULL, 'text', 'Start Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STARTDATE', NULL, 0),
(@project_id, 'enddate_3', NULL, 'audio_active_task', NULL, 156, NULL, NULL, 'text', 'End Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ENDDATE', NULL, 0),
(@project_id, 'scheduledate_3', NULL, 'audio_active_task', NULL, 157, NULL, NULL, 'text', 'Schedule Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SCHEDULEDATE', NULL, 0),
(@project_id, 'status_3', NULL, 'audio_active_task', NULL, 158, NULL, NULL, 'select', 'Status', '0, Deleted\\n1, Completed\\n2, Incomplete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STATUS', NULL, 0),
(@project_id, 'supplementaldata_3', NULL, 'audio_active_task', NULL, 159, NULL, NULL, 'textarea', 'Supplemental Data (JSON)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SUPPLEMENTALDATA', NULL, 0),
(@project_id, 'serializedresult_3', NULL, 'audio_active_task', NULL, 160, NULL, NULL, 'file', 'Serialized Result', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SERIALIZEDRESULT', NULL, 0),
(@project_id, 'audio_active_task_complete', NULL, 'audio_active_task', NULL, 161, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
(@project_id, 'selfie', NULL, 'selfie_capture', 'Selfie Capture', 162, NULL, NULL, 'file', 'Selfie Capture', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ACTIVE-SEL', NULL, 0),
(@project_id, 'uuid_2', NULL, 'selfie_capture', NULL, 163, NULL, 'MyCap App Fields - Do Not Modify', 'text', 'UUID', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-UUID', NULL, 0),
(@project_id, 'startdate_2', NULL, 'selfie_capture', NULL, 164, NULL, NULL, 'text', 'Start Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STARTDATE', NULL, 0),
(@project_id, 'enddate_2', NULL, 'selfie_capture', NULL, 165, NULL, NULL, 'text', 'End Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-ENDDATE', NULL, 0),
(@project_id, 'scheduledate_2', NULL, 'selfie_capture', NULL, 166, NULL, NULL, 'text', 'Schedule Date', NULL, NULL, NULL, NULL, NULL, 'soft_typed', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SCHEDULEDATE', NULL, 0),
(@project_id, 'status_2', NULL, 'selfie_capture', NULL, 167, NULL, NULL, 'select', 'Status', '0, Deleted\\n1, Completed\\n2, Incomplete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-STATUS', NULL, 0),
(@project_id, 'supplementaldata_2', NULL, 'selfie_capture', NULL, 168, NULL, NULL, 'textarea', 'Supplemental Data (JSON)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SUPPLEMENTALDATA', NULL, 0),
(@project_id, 'serializedresult_2', NULL, 'selfie_capture', NULL, 169, NULL, NULL, 'file', 'Serialized Result', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, '@MC-TASK-SERIALIZEDRESULT', NULL, 0),
(@project_id, 'selfie_capture_complete', NULL, 'selfie_capture', NULL, 170, NULL, 'Form Status', 'select', 'Complete?', '0, Incomplete \\n 1, Unverified \\n 2, Complete', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0);

INSERT INTO `redcap_mycap_aboutpages` (`project_id`, `identifier`, `page_title`, `page_content`, `sub_type`, `image_type`, `system_image_name`, `custom_logo`, `page_order`) VALUES
(@project_id, 'F75458BD-E7EA-4D0B-A6F8-73D212054D68', 'MyCap Sample Project', 'This demo project was created to illustrate how fields appear within the app, various scheduling options, and how to use things like \"About\" pages, \"Contacts\", and \"Links\" to tailor the app to your project.', '.Home', '.System', '.Info', 0, 1),
(@project_id, '6BAC503B-7F55-4467-A222-1E2E2FBD49EA', 'What to expect in the Demo?', 'We have listed the field type and any validations in place at the beginning of each question to help you recognize how REDCap settings appear in the MyCap App for participants.', '.Custom', '.System', '.Info', 0, 2),
(@project_id, '54EB528B-613F-4720-ACFB-8E0AC891930B', 'The Demo Schedule', 'We scheduled tasks using the various scheduling options available in MyCap, including one-time tasks, infinite tasks, repeating and fixed tasks, as well as tasks that stop recurring. Some tasks are scheduled based on the date the participant installs your project and others are based on the baseline date entered. \n\nScroll through the calendar to view what tasks are scheduled in the future.', '.Custom', '.System', '.Info', 0, 3);

INSERT INTO `redcap_mycap_contacts` (`project_id`, `identifier`, `contact_header`, `contact_title`, `phone_number`, `email`, `website`, `additional_info`, `contact_order`) VALUES
(@project_id, '18ADEF10-D83E-41C3-ACF0-6E3D82EFF2F8', 'MyCap Support', NULL, NULL, 'mycap@vumc.org', 'www.projectmycap.org', NULL, 1);

INSERT INTO `redcap_mycap_links` (`project_id`, `identifier`, `link_name`, `link_url`, `link_icon`, `append_project_code`, `append_participant_code`, `link_order`) VALUES
(@project_id, '2A344E51-39AB-48BE-9FBE-6D22DE55DD90', 'MyCap Resources', 'https://projectmycap.org/mycap-resources/', 'ic_library_books', 0, 0, 1),
(@project_id, '4C99C435-657A-467C-9D6A-446437B8D5AD', 'MyCap Use Cases', 'https://projectmycap.org/mycap-use-cases/', 'ic_face', 0, 0, 2);

-- INSERT INTO `redcap_mycap_projectfiles` (`project_code`, `doc_id`, `name`, `category`) VALUES
-- (concat('P-', @pcode), 3, 'ImagePack15.zip', 3);

INSERT INTO `redcap_mycap_projects` (`code`, `hmac_key`, `project_id`, `name`, `allow_new_participants`, `participant_custom_field`, `participant_custom_label`, `participant_allow_condition`, `config`, `baseline_date_field`, `baseline_date_config`, `status`) VALUES
(concat('P-', @pcode), LEFT(sha1(rand()),64), @project_id, @project_title, 1, '', '[name] - [email]', '', '', 'baseline', '{\"enabled\":true,\"instructionStep\":{\"type\":\".TaskInstructionStep\",\"identifier\":\"D5A29702-C4B0-4964-835B-9CEF606C80E8\",\"subType\":\".Custom\",\"title\":\"About the Baseline Date\",\"content\":\"Projects can enable a baseline date if they wish to trigger tasks to be completed after a participant-specific event (e.g., hospital discharge). You can also schedule tasks based on the participant\'s install date. The trigger (install or baseline date) is unique to each task schedule.\\r\\n\\r\\nWhen using a baseline date, if the baseline date is not entered into REDCap when the participant joins your project, they MUST complete the baseline task before any other tasks can be completed, even if the tasks doesn\'t trigger based on the baseline date.\\r\\n\\r\\nThe following questions are an example of how the participant will see the \\\"baseline date\\\" questions in the app.\",\"imageName\":\"\",\"imageType\":\"\",\"sortOrder\":1},\"title\":\"Baseline Date\",\"question1\":\"Were you discharged from the hospital today?\",\"question2\":\"What day were you discharged from the hospital?\"}', 1);

INSERT INTO `redcap_mycap_tasks` (`project_id`, `form_name`, `enabled_for_mycap`, `task_title`, `question_format`, `card_display`, `x_date_field`, `x_time_field`, `y_numeric_field` , `extended_config_json`) VALUES
(@project_id, 'welcome', 1, 'Welcome', '.Questionnaire', '.Percent', NULL, NULL, NULL, '');
INSERT INTO redcap_mycap_tasks_schedules
(task_id, event_id, allow_retro_completion, allow_save_complete_later, include_instruction_step, include_completion_step, instruction_step_title, instruction_step_content, completion_step_title, completion_step_content, schedule_relative_to, schedule_type, schedule_frequency, schedule_interval_week, schedule_days_of_the_week, schedule_interval_month, schedule_days_of_the_month, schedule_days_fixed, schedule_relative_offset, schedule_ends, schedule_end_count, schedule_end_after_days, schedule_end_date)
VALUES
    (LAST_INSERT_ID(), @event_id, 0, 0, 0, 0, '', '', '', '', '',
     '.Infinite', NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, '.Never', NULL, NULL, NULL);

INSERT INTO `redcap_mycap_tasks` (`project_id`, `form_name`, `enabled_for_mycap`, `task_title`, `question_format`, `card_display`, `x_date_field`, `x_time_field`, `y_numeric_field` , `extended_config_json`) VALUES
(@project_id, 'morning_checkin', 1, 'Morning Check-in (Daily)', '.Questionnaire', '.Percent', NULL, NULL, NULL, '');
INSERT INTO redcap_mycap_tasks_schedules
(task_id, event_id, allow_retro_completion, allow_save_complete_later, include_instruction_step, include_completion_step, instruction_step_title, instruction_step_content, completion_step_title, completion_step_content, schedule_relative_to, schedule_type, schedule_frequency, schedule_interval_week, schedule_days_of_the_week, schedule_interval_month, schedule_days_of_the_month, schedule_days_fixed, schedule_relative_offset, schedule_ends, schedule_end_count, schedule_end_after_days, schedule_end_date)
VALUES
    (LAST_INSERT_ID(), @event_id, 0, 0, 0, 0, '', '', '', '', '',
     '.Infinite', NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, '.Never', NULL, NULL, NULL);

INSERT INTO `redcap_mycap_tasks` (`project_id`, `form_name`, `enabled_for_mycap`, `task_title`, `question_format`, `card_display`, `x_date_field`, `x_time_field`, `y_numeric_field` , `extended_config_json`) VALUES
(@project_id, 'weekend_plans', 1, 'Weekend Plans (Recurs on Fridays)', '.Form', '.Percent', NULL, NULL, NULL, '');
INSERT INTO redcap_mycap_tasks_schedules
(task_id, event_id, allow_retro_completion, allow_save_complete_later, include_instruction_step, include_completion_step, instruction_step_title, instruction_step_content, completion_step_title, completion_step_content, schedule_relative_to, schedule_type, schedule_frequency, schedule_interval_week, schedule_days_of_the_week, schedule_interval_month, schedule_days_of_the_month, schedule_days_fixed, schedule_relative_offset, schedule_ends, schedule_end_count, schedule_end_after_days, schedule_end_date)
VALUES
    (LAST_INSERT_ID(), @event_id, 0, 0, 0, 0, '', '', '', '', '',
     '.Infinite', NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, '.Never', NULL, NULL, NULL);

INSERT INTO `redcap_mycap_tasks` (`project_id`, `form_name`, `enabled_for_mycap`, `task_title`, `question_format`, `card_display`, `x_date_field`, `x_time_field`, `y_numeric_field` , `extended_config_json`) VALUES
(@project_id, 'peak_flow_rate', 1, 'Peak Flow Rate', '.Questionnaire', '.DateLine', '[pea_date]', '[pea_time]', '[pea_value]', '');
INSERT INTO redcap_mycap_tasks_schedules
(task_id, event_id, allow_retro_completion, allow_save_complete_later, include_instruction_step, include_completion_step, instruction_step_title, instruction_step_content, completion_step_title, completion_step_content, schedule_relative_to, schedule_type, schedule_frequency, schedule_interval_week, schedule_days_of_the_week, schedule_interval_month, schedule_days_of_the_month, schedule_days_fixed, schedule_relative_offset, schedule_ends, schedule_end_count, schedule_end_after_days, schedule_end_date)
VALUES
    (LAST_INSERT_ID(), @event_id, 0, 0, 0, 0, '', '', '', '', '',
     '.Infinite', NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, '.Never', NULL, NULL, NULL);

INSERT INTO `redcap_mycap_tasks` (`project_id`, `form_name`, `enabled_for_mycap`, `task_title`, `question_format`, `card_display`, `x_date_field`, `x_time_field`, `y_numeric_field` , `extended_config_json`) VALUES
(@project_id, 'tapping_interval_task', 1, 'Tapping Interval Task', '.TwoFingerTappingInterval', '.Percent', NULL, NULL, NULL, '');
INSERT INTO redcap_mycap_tasks_schedules
(task_id, event_id, allow_retro_completion, allow_save_complete_later, include_instruction_step, include_completion_step, instruction_step_title, instruction_step_content, completion_step_title, completion_step_content, schedule_relative_to, schedule_type, schedule_frequency, schedule_interval_week, schedule_days_of_the_week, schedule_interval_month, schedule_days_of_the_month, schedule_days_fixed, schedule_relative_offset, schedule_ends, schedule_end_count, schedule_end_after_days, schedule_end_date)
VALUES
    (LAST_INSERT_ID(), @event_id, 0, 0, 0, 0, '', '', '', '', '',
     '.Infinite', NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, '.Never', NULL, NULL, NULL);

INSERT INTO `redcap_mycap_tasks` (`project_id`, `form_name`, `enabled_for_mycap`, `task_title`, `question_format`, `card_display`, `x_date_field`, `x_time_field`, `y_numeric_field` , `extended_config_json`) VALUES
(@project_id, 'tower_of_hanoi_active_task', 1, 'Tower of Hanoi', '.TowerOfHanoi', '.Percent', NULL, NULL, NULL, '');
INSERT INTO redcap_mycap_tasks_schedules
(task_id, event_id, allow_retro_completion, allow_save_complete_later, include_instruction_step, include_completion_step, instruction_step_title, instruction_step_content, completion_step_title, completion_step_content, schedule_relative_to, schedule_type, schedule_frequency, schedule_interval_week, schedule_days_of_the_week, schedule_interval_month, schedule_days_of_the_month, schedule_days_fixed, schedule_relative_offset, schedule_ends, schedule_end_count, schedule_end_after_days, schedule_end_date)
VALUES
    (LAST_INSERT_ID(), @event_id, 0, 0, 0, 0, '', '', '', '', '',
     '.Infinite', NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, '.Never', NULL, NULL, NULL);

INSERT INTO `redcap_mycap_tasks` (`project_id`, `form_name`, `enabled_for_mycap`, `task_title`, `question_format`, `card_display`, `x_date_field`, `x_time_field`, `y_numeric_field` , `extended_config_json`) VALUES
(@project_id, 'tone_audiometry_active_task', 1, 'Tone Audiometry', '.ToneAudiometry', '.Percent', NULL, NULL, NULL, '');
INSERT INTO redcap_mycap_tasks_schedules
(task_id, event_id, allow_retro_completion, allow_save_complete_later, include_instruction_step, include_completion_step, instruction_step_title, instruction_step_content, completion_step_title, completion_step_content, schedule_relative_to, schedule_type, schedule_frequency, schedule_interval_week, schedule_days_of_the_week, schedule_interval_month, schedule_days_of_the_month, schedule_days_fixed, schedule_relative_offset, schedule_ends, schedule_end_count, schedule_end_after_days, schedule_end_date)
VALUES
    (LAST_INSERT_ID(), @event_id, 0, 0, 0, 0, '', '', '', '', '',
     '.Infinite', NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, '.Never', NULL, NULL, NULL);

INSERT INTO `redcap_mycap_tasks` (`project_id`, `form_name`, `enabled_for_mycap`, `task_title`, `question_format`, `card_display`, `x_date_field`, `x_time_field`, `y_numeric_field` , `extended_config_json`) VALUES
(@project_id, 'timed_walk_active_task', 1, 'Timed Walk', '.TimedWalk', '.Percent', NULL, NULL, NULL, '');
INSERT INTO redcap_mycap_tasks_schedules
(task_id, event_id, allow_retro_completion, allow_save_complete_later, include_instruction_step, include_completion_step, instruction_step_title, instruction_step_content, completion_step_title, completion_step_content, schedule_relative_to, schedule_type, schedule_frequency, schedule_interval_week, schedule_days_of_the_week, schedule_interval_month, schedule_days_of_the_month, schedule_days_fixed, schedule_relative_offset, schedule_ends, schedule_end_count, schedule_end_after_days, schedule_end_date)
VALUES
    (LAST_INSERT_ID(), @event_id, 0, 0, 0, 0, '', '', '', '', '',
     '.Infinite', NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, '.Never', NULL, NULL, NULL);

INSERT INTO `redcap_mycap_tasks` (`project_id`, `form_name`, `enabled_for_mycap`, `task_title`, `question_format`, `card_display`, `x_date_field`, `x_time_field`, `y_numeric_field` , `extended_config_json`) VALUES
(@project_id, 'spatial_span_memory_test_active_task', 1, 'Spatial Span Memory Test', '.SpatialSpanMemory', '.Percent', NULL, NULL, NULL, '');
INSERT INTO redcap_mycap_tasks_schedules
(task_id, event_id, allow_retro_completion, allow_save_complete_later, include_instruction_step, include_completion_step, instruction_step_title, instruction_step_content, completion_step_title, completion_step_content, schedule_relative_to, schedule_type, schedule_frequency, schedule_interval_week, schedule_days_of_the_week, schedule_interval_month, schedule_days_of_the_month, schedule_days_fixed, schedule_relative_offset, schedule_ends, schedule_end_count, schedule_end_after_days, schedule_end_date)
VALUES
    (LAST_INSERT_ID(), @event_id, 0, 0, 0, 0, '', '', '', '', '',
     '.Infinite', NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, '.Never', NULL, NULL, NULL);

INSERT INTO `redcap_mycap_tasks` (`project_id`, `form_name`, `enabled_for_mycap`, `task_title`, `question_format`, `card_display`, `x_date_field`, `x_time_field`, `y_numeric_field` , `extended_config_json`) VALUES
(@project_id, 'fitness_check_active_task', 1, 'Fitness Check Active Task', '.FitnessCheck', '.Percent', NULL, NULL, NULL, '');
INSERT INTO redcap_mycap_tasks_schedules
(task_id, event_id, allow_retro_completion, allow_save_complete_later, include_instruction_step, include_completion_step, instruction_step_title, instruction_step_content, completion_step_title, completion_step_content, schedule_relative_to, schedule_type, schedule_frequency, schedule_interval_week, schedule_days_of_the_week, schedule_interval_month, schedule_days_of_the_month, schedule_days_fixed, schedule_relative_offset, schedule_ends, schedule_end_count, schedule_end_after_days, schedule_end_date)
VALUES
    (LAST_INSERT_ID(), @event_id, 0, 0, 0, 0, '', '', '', '', '',
     '.Infinite', NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, '.Never', NULL, NULL, NULL);

INSERT INTO `redcap_mycap_tasks` (`project_id`, `form_name`, `enabled_for_mycap`, `task_title`, `question_format`, `card_display`, `x_date_field`, `x_time_field`, `y_numeric_field` , `extended_config_json`) VALUES
(@project_id, 'reaction_time_active_task', 1, 'Reaction Time Active Task', '.ReactionTime', '.Percent', NULL, NULL, NULL, '');
INSERT INTO redcap_mycap_tasks_schedules
(task_id, event_id, allow_retro_completion, allow_save_complete_later, include_instruction_step, include_completion_step, instruction_step_title, instruction_step_content, completion_step_title, completion_step_content, schedule_relative_to, schedule_type, schedule_frequency, schedule_interval_week, schedule_days_of_the_week, schedule_interval_month, schedule_days_of_the_month, schedule_days_fixed, schedule_relative_offset, schedule_ends, schedule_end_count, schedule_end_after_days, schedule_end_date)
VALUES
    (LAST_INSERT_ID(), @event_id, 0, 0, 0, 0, '', '', '', '', '',
     '.Infinite', NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, '.Never', NULL, NULL, NULL);

INSERT INTO `redcap_mycap_tasks` (`project_id`, `form_name`, `enabled_for_mycap`, `task_title`, `question_format`, `card_display`, `x_date_field`, `x_time_field`, `y_numeric_field` , `extended_config_json`) VALUES
(@project_id, 'psat_active_task', 1, 'PSAT Active Task', '.PSAT', '.Percent', NULL, NULL, NULL, '');
INSERT INTO redcap_mycap_tasks_schedules
(task_id, event_id, allow_retro_completion, allow_save_complete_later, include_instruction_step, include_completion_step, instruction_step_title, instruction_step_content, completion_step_title, completion_step_content, schedule_relative_to, schedule_type, schedule_frequency, schedule_interval_week, schedule_days_of_the_week, schedule_interval_month, schedule_days_of_the_month, schedule_days_fixed, schedule_relative_offset, schedule_ends, schedule_end_count, schedule_end_after_days, schedule_end_date)
VALUES
    (LAST_INSERT_ID(), @event_id, 0, 0, 0, 0, '', '', '', '', '',
     '.Infinite', NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, '.Never', NULL, NULL, NULL);

INSERT INTO `redcap_mycap_tasks` (`project_id`, `form_name`, `enabled_for_mycap`, `task_title`, `question_format`, `card_display`, `x_date_field`, `x_time_field`, `y_numeric_field` , `extended_config_json`) VALUES
(@project_id, 'short_walk_active_task', 1, 'Short Walk Active Task', '.ShortWalk', '.Percent', NULL, NULL, NULL, '');
INSERT INTO redcap_mycap_tasks_schedules
(task_id, event_id, allow_retro_completion, allow_save_complete_later, include_instruction_step, include_completion_step, instruction_step_title, instruction_step_content, completion_step_title, completion_step_content, schedule_relative_to, schedule_type, schedule_frequency, schedule_interval_week, schedule_days_of_the_week, schedule_interval_month, schedule_days_of_the_month, schedule_days_fixed, schedule_relative_offset, schedule_ends, schedule_end_count, schedule_end_after_days, schedule_end_date)
VALUES
    (LAST_INSERT_ID(), @event_id, 0, 0, 0, 0, '', '', '', '', '',
     '.Infinite', NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, '.Never', NULL, NULL, NULL);

INSERT INTO `redcap_mycap_tasks` (`project_id`, `form_name`, `enabled_for_mycap`, `task_title`, `question_format`, `card_display`, `x_date_field`, `x_time_field`, `y_numeric_field` , `extended_config_json`) VALUES
(@project_id, 'audio_active_task', 1, 'Audio Active Task', '.AudioRecording', '.Percent', NULL, NULL, NULL, '');
INSERT INTO redcap_mycap_tasks_schedules
(task_id, event_id, allow_retro_completion, allow_save_complete_later, include_instruction_step, include_completion_step, instruction_step_title, instruction_step_content, completion_step_title, completion_step_content, schedule_relative_to, schedule_type, schedule_frequency, schedule_interval_week, schedule_days_of_the_week, schedule_interval_month, schedule_days_of_the_month, schedule_days_fixed, schedule_relative_offset, schedule_ends, schedule_end_count, schedule_end_after_days, schedule_end_date)
VALUES
    (LAST_INSERT_ID(), @event_id, 0, 0, 0, 0, '', '', '', '', '',
     '.Infinite', NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, '.Never', NULL, NULL, NULL);

INSERT INTO `redcap_mycap_tasks` (`project_id`, `form_name`, `enabled_for_mycap`, `task_title`, `question_format`, `card_display`, `x_date_field`, `x_time_field`, `y_numeric_field` , `extended_config_json`) VALUES
(@project_id, 'selfie_capture', 1, 'Selfie Capture', '.SelfieCapture', '.Percent', NULL, NULL, NULL, '');
INSERT INTO redcap_mycap_tasks_schedules
(task_id, event_id, allow_retro_completion, allow_save_complete_later, include_instruction_step, include_completion_step, instruction_step_title, instruction_step_content, completion_step_title, completion_step_content, schedule_relative_to, schedule_type, schedule_frequency, schedule_interval_week, schedule_days_of_the_week, schedule_interval_month, schedule_days_of_the_month, schedule_days_fixed, schedule_relative_offset, schedule_ends, schedule_end_count, schedule_end_after_days, schedule_end_date)
VALUES
    (LAST_INSERT_ID(), @event_id, 0, 0, 0, 0, '', '', '', '', '',
     '.Infinite', NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, '.Never', NULL, NULL, NULL);

INSERT INTO `redcap_mycap_themes` (`project_id`, `primary_color`, `light_primary_color`, `accent_color`, `dark_primary_color`, `light_bg_color`, `theme_type`, `system_type`) VALUES
(@project_id, '#853a69', '#f2ebe9', '#243a73', '#73325b', '#fefeff', '.System', '.Purple');

INSERT INTO `redcap_projects_templates` (`project_id`, `title`, `description`, `enabled`)
	VALUES (@project_id,  @project_title,  'Various examples of MyCap tasks and active tasks for collecting data from participants using the MyCap app on a mobile device.',  '1');