Update rules in bulk
set role <organisation_db_user>;
-- Subject Type
update subject_type set
program_eligibility_check_rule = replace(program_eligibility_check_rule, 'ruleServiceLibraryInterfaceForSharingModules', 'imports'),
last_modified_date_time = current_timestamp
where program_eligibility_check_rule like '%ruleServiceLibraryInterfaceForSharingModules%';
update subject_type set subject_summary_rule = replace(subject_summary_rule, 'ruleServiceLibraryInterfaceForSharingModules', 'imports'),
last_modified_date_time = current_timestamp
where subject_summary_rule like '%ruleServiceLibraryInterfaceForSharingModules%';
-- Encounter Type
update encounter_type set encounter_eligibility_check_rule = replace(encounter_eligibility_check_rule, 'ruleServiceLibraryInterfaceForSharingModules', 'imports'),
last_modified_date_time = current_timestamp
where encounter_eligibility_check_rule like '%ruleServiceLibraryInterfaceForSharingModules%';
-- Program
update program set enrolment_summary_rule = replace(enrolment_summary_rule, 'ruleServiceLibraryInterfaceForSharingModules', 'imports'),
last_modified_date_time = current_timestamp
where enrolment_summary_rule like '%ruleServiceLibraryInterfaceForSharingModules%';
update program set enrolment_eligibility_check_rule = replace(enrolment_eligibility_check_rule, 'ruleServiceLibraryInterfaceForSharingModules', 'imports'),
last_modified_date_time = current_timestamp
where enrolment_eligibility_check_rule like '%ruleServiceLibraryInterfaceForSharingModules%';
update program set manual_enrolment_eligibility_check_rule = replace(manual_enrolment_eligibility_check_rule, 'ruleServiceLibraryInterfaceForSharingModules', 'imports'),
last_modified_date_time = current_timestamp
where manual_enrolment_eligibility_check_rule like '%ruleServiceLibraryInterfaceForSharingModules%';
-- Form
update form set decision_rule = replace(decision_rule, 'ruleServiceLibraryInterfaceForSharingModules', 'imports'),
last_modified_date_time = current_timestamp
where decision_rule like '%ruleServiceLibraryInterfaceForSharingModules%';
update form set validation_rule = replace(validation_rule, 'ruleServiceLibraryInterfaceForSharingModules', 'imports'),
last_modified_date_time = current_timestamp
where validation_rule like '%ruleServiceLibraryInterfaceForSharingModules%';
update form set visit_schedule_rule = replace(visit_schedule_rule, 'ruleServiceLibraryInterfaceForSharingModules', 'imports'),
last_modified_date_time = current_timestamp
where visit_schedule_rule like '%ruleServiceLibraryInterfaceForSharingModules%';
update form set checklists_rule = replace(checklists_rule, 'ruleServiceLibraryInterfaceForSharingModules', 'imports'),
last_modified_date_time = current_timestamp
where checklists_rule like '%ruleServiceLibraryInterfaceForSharingModules%';
update form set task_schedule_rule = replace(task_schedule_rule, 'ruleServiceLibraryInterfaceForSharingModules', 'imports'),
last_modified_date_time = current_timestamp
where task_schedule_rule like '%ruleServiceLibraryInterfaceForSharingModules%';
-- Form element
update form_element set "rule" = replace("rule", 'ruleServiceLibraryInterfaceForSharingModules', 'imports'),
last_modified_date_time = current_timestamp
where rule like '%ruleServiceLibraryInterfaceForSharingModules%';
-- Form element group
update form_element_group set "rule" = replace("rule", 'ruleServiceLibraryInterfaceForSharingModules', 'imports'),
last_modified_date_time = current_timestamp
where rule like '%ruleServiceLibraryInterfaceForSharingModules%';
-- Report Card
update report_card set query = replace(query, 'ruleServiceLibraryInterfaceForSharingModules', 'imports'),
last_modified_date_time = current_timestamp
where query like '%ruleServiceLibraryInterfaceForSharingModules%'
-- Organisation Config
update organisation_config set worklist_updation_rule = replace(worklist_updation_rule, 'ruleServiceLibraryInterfaceForSharingModules', 'imports'),
last_modified_date_time = current_timestamp
where worklist_updation_rule like '%ruleServiceLibraryInterfaceForSharingModules%';
One example is illustrated here, one can change the text and replace with something else.
Updated 9 months ago