more map-like

more map-like

--- ddl.clj
+++ ddl.clj
@@ -1,1010 +1,1010 @@
--- Oracle has a limit of varchar(4000), so we use 3900 for clob and
--- any size larger than varchar(1000)
+; Oracle has a limit of varchar(4000), so we use 3900 for clob and
+; any size larger than varchar(1000)

-create table rm_case_assess
-(
-  :enterprise_id "numeric(38)"
-  :case_id "numeric(38)"
-  :template_id "numeric(38)"
-  :listedness "numeric(38)"
-  :updated "date"
-  :outcome "numeric(38)"
-  :comment_id "numeric(38)"
-  :comp_comment_id "numeric(38)"
-  :seriousness "numeric(38)"
-  :serious_notes "varchar(3900)"
-  :agent_suspect "numeric(38)"
-  :agent_notes "varchar(3900)"
-  :listedness_notes "varchar(3900)"
-  :bfarm_causality "numeric(10,0)"
-  :bfarm_manual_text "varchar(3900)"
-  :company_diagnosis "varchar(999)"
-  :company_diagnosis_notes "varchar(3900)"
-  :diagnosis_dict_id "numeric(38)"
-  :diagnosis_pref_code "varchar(99)"
-  :diagnosis_inc_code "varchar(99)"
-  :diagnosis_inc_term "varchar(999)"
-  :diagnosis_hlgt_code "varchar(99)"
-  :diagnosis_hlgt "varchar(999)"
-  :diagnosis_hlt_code "varchar(99)"
-  :diagnosis_hlt "varchar(999)"
-  :diagnosis_soc_code "varchar(99)"
-  :diagnosis_body_sys "varchar(999)"
-  :ud_text_1 "varchar(999)"
-  :ud_text_2 "varchar(999)"
-  :ud_text_3 "varchar(999)"
-  :ud_text_4 "varchar(999)"
-  :ud_text_5 "varchar(999)"
-  :ud_text_6 "varchar(999)"
-  :ud_text_7 "varchar(999)"
-  :ud_text_8 "varchar(999)"
-  :ud_text_9 "varchar(999)"
-  :ud_text_10 "varchar(999)"
-  :ud_text_11 "varchar(999)"
-  :ud_text_12 "varchar(999)"
-  :ud_date_1 "date"
-  :ud_date_2 "date"
-  :ud_date_3 "date"
-  :ud_date_4 "date"
-  :ud_date_5 "date"
-  :ud_date_6 "date"
-  :ud_date_7 "date"
-  :ud_date_8 "date"
-  :ud_date_9 "date"
-  :ud_date_10 "date"
-  :ud_date_11 "date"
-  :ud_date_12 "date"
-  :ud_number_1 "numeric(30,10)"
-  :ud_number_2 "numeric(30,10)"
-  :ud_number_3 "numeric(30,10)"
-  :ud_number_4 "numeric(30,10)"
-  :ud_number_5 "numeric(30,10)"
-  :ud_number_6 "numeric(30,10)"
-  :ud_number_7 "numeric(30,10)"
-  :ud_number_8 "numeric(30,10)"
-  :ud_number_9 "numeric(30,10)"
-  :ud_number_10 "numeric(30,10)"
-  :ud_number_11 "numeric(30,10)"
-  :ud_number_12 "numeric(30,10)"
-  :evaluation "varchar(3900)"
-  :evaluation_j "varchar(3900)"
-  :co_suspect_count "numeric(3,0)"
-  :event_synopsis "varchar(9)"
-  :event_primary "varchar(999)"
-  :diagnosis_reptd "varchar(999)"
-  :diagnosis_coded "varchar(999)"
-  :diagnosis_syn_code "numeric(38)"
-  :diagnosis_code_status "numeric(3,0)"
-  :event_primary_j "varchar(999)"
-  :agent_notes_j "varchar(3900)"
-  :company_diagnosis_j "varchar(999)"
-  :company_diagnosis_notes_j "varchar(3900)"
-  :diagnosis_body_sys_j "varchar(999)"
-  :diagnosis_coded_j "varchar(999)"
-  :diagnosis_code_status_j "numeric(38)"
-  :diagnosis_hlgt_j "varchar(999)"
-  :diagnosis_hlt_j "varchar(999)"
-  :diagnosis_inc_code_j "varchar(99)"
-  :diagnosis_inc_term_j "varchar(999)"
-  :diagnosis_reptd_j "varchar(999)"
-  :listedness_notes_j "varchar(3900)"
-  :serious_notes_j "varchar(3900)"
-  :ud_text_1_j "varchar(999)"
-  :ud_text_2_j "varchar(999)"
-  :ud_text_3_j "varchar(999)"
-  :ud_text_4_j "varchar(999)"
-  :ud_text_5_j "varchar(999)"
-  :ud_text_6_j "varchar(999)"
-  :ud_text_7_j "varchar(999)"
-  :ud_text_8_j "varchar(999)"
-  :ud_text_9_j "varchar(999)"
-  :ud_text_10_j "varchar(999)"
-  :ud_text_11_j "varchar(999)"
-  :ud_text_12_j "varchar(999)"
-  :diagnosis_syn_code_j "numeric(38)"
-  :deleted "date"
-  :dlp_revision_number "numeric(38)"
-  :revision_delete_flag "numeric(38)"
-  :deleted_flag "numeric(1,0)"
-  :effective_start_date "date"
-  :effective_end_date "date"
-)
-
-create table rm_case_classifications
-(
-  :enterprise_id "numeric(38)"
-  :case_id "numeric(38)"
-  :seq_num "numeric(38)"
-  :classification_id "numeric(38)"
-  :deleted "date"
-  :dlp_revision_number "numeric(38)"
-  :revision_delete_flag "numeric(38)"
-  :deleted_flag "numeric(1,0)"
-  :effective_start_date "date"
-  :effective_end_date "date"
-)
-
-create table rm_case_event
-(
-  :enterprise_id "numeric(38)"
-  :case_id "numeric(38)"
-  :seq_num "numeric(38)"
-  :desc_reptd "varchar(999)"
-  :desc_coded "varchar(999)"
-  :diagnosis "numeric(38)"
-  :onset "date"
-  :onset_res "numeric(38)"
-  :onset_delay "varchar(99)"
-  :stop_date "date"
-  :stop_date_res "numeric(38)"
-  :duration "varchar(99)"
-  :onset_latency "varchar(99)"
-  :evt_intensity_id "numeric(38)"
-  :evt_freq_id "numeric(38)"
-  :treated "numeric(38)"
-  :study_related "numeric(38)"
-  :rechall_related "numeric(38)"
-  :prod_seq_num "numeric(38)"
-  :evt_outcome_id "numeric(38)"
-  :receipt_date "date"
-  :rpt_serious "numeric(38)"
-  :sc_death "numeric(38)"
-  :sc_hosp "numeric(38)"
-  :sc_cong_anom "numeric(38)"
-  :sc_threat "numeric(38)"
-  :sc_disable "numeric(38)"
-  :sc_int_req "numeric(38)"
-  :sc_other "numeric(38)"
-  :sc_other_text "varchar(99)"
-  :art_code "varchar(99)"
-  :pref_term "varchar(999)"
-  :inc_term "varchar(999)"
-  :body_sys "varchar(999)"
-  :med_serious "numeric(38)"
-  :past_hist "numeric(38)"
-  :dict_id "numeric(38)"
-  :dict_key "varchar(99)"
-  :code_status "numeric(38)"
-  :seriousness "numeric(38)"
-  :sort_id "numeric(38)"
-  :onset_date_partial "varchar(99)"
-  :stop_date_partial "varchar(99)"
-  :efficacy "numeric(38)"
-  :disease "numeric(38)"
-  :withdrawal "numeric(38)"
-  :hlgt "varchar(999)"
-  :hlt "varchar(999)"
-  :hlt_code "varchar(99)"
-  :hlgt_code "varchar(99)"
-  :soc_code "varchar(99)"
-  :study_dropped "numeric(4,0)"
-  :inc_code "varchar(99)"
-  :onset_minutes "numeric(38)"
-  :delay_minutes "numeric(38)"
-  :ud_text_1 "varchar(999)"
-  :ud_text_2 "varchar(999)"
-  :ud_text_3 "varchar(999)"
-  :ud_text_4 "varchar(999)"
-  :ud_text_5 "varchar(999)"
-  :ud_text_6 "varchar(999)"
-  :ud_text_7 "varchar(999)"
-  :ud_text_8 "varchar(999)"
-  :ud_text_9 "varchar(999)"
-  :ud_text_10 "varchar(999)"
-  :ud_text_11 "varchar(999)"
-  :ud_text_12 "varchar(999)"
-  :ud_date_1 "date"
-  :ud_date_2 "date"
-  :ud_date_3 "date"
-  :ud_date_4 "date"
-  :ud_date_5 "date"
-  :ud_date_6 "date"
-  :ud_date_7 "date"
-  :ud_date_8 "date"
-  :ud_date_9 "date"
-  :ud_date_10 "date"
-  :ud_date_11 "date"
-  :ud_date_12 "date"
-  :ud_number_1 "numeric(30,10)"
-  :ud_number_2 "numeric(30,10)"
-  :ud_number_3 "numeric(30,10)"
-  :ud_number_4 "numeric(30,10)"
-  :ud_number_5 "numeric(30,10)"
-  :ud_number_6 "numeric(30,10)"
-  :ud_number_7 "numeric(30,10)"
-  :ud_number_8 "numeric(30,10)"
-  :ud_number_9 "numeric(30,10)"
-  :ud_number_10 "numeric(30,10)"
-  :ud_number_11 "numeric(30,10)"
-  :ud_number_12 "numeric(30,10)"
-  :details "varchar(3900)"
-  :details_j "varchar(3900)"
-  :syn_code "numeric(38)"
-  :deleted "date"
-  :study_related_reptd "numeric(1,0)"
-  :duration_unit_e2b "numeric(38)"
-  :onset_latency_unit_e2b "numeric(38)"
-  :onset_delay_unit_e2b "numeric(38)"
-  :duration_seconds "numeric(38)"
-  :onset_latency_seconds "numeric(38)"
-  :onset_delay_seconds "numeric(38)"
-  :body_sys_j "varchar(999)"
-  :code_status_j "numeric(38)"
-  :desc_coded_j "varchar(999)"
-  :desc_reptd_j "varchar(999)"
-  :hlgt_j "varchar(999)"
-  :hlt_j "varchar(999)"
-  :inc_code_j "varchar(99)"
-  :inc_term_j "varchar(999)"
-  :pref_term_j "varchar(999)"
-  :sc_other_text_j "varchar(99)"
-  :report_exclusion "numeric(38)"
-  :reportable "numeric(38)"
-  :ud_text_1_j "varchar(999)"
-  :ud_text_2_j "varchar(999)"
-  :ud_text_3_j "varchar(999)"
-  :ud_text_4_j "varchar(999)"
-  :ud_text_5_j "varchar(999)"
-  :ud_text_6_j "varchar(999)"
-  :ud_text_7_j "varchar(999)"
-  :ud_text_8_j "varchar(999)"
-  :ud_text_9_j "varchar(999)"
-  :ud_text_10_j "varchar(999)"
-  :ud_text_11_j "varchar(999)"
-  :ud_text_12_j "varchar(999)"
-  :syn_code_j "numeric(38)"
-  :infection "numeric(38)"
-  :rpt_exclude_cmt "varchar(3900)"
-  :rpt_exclude_cmt_j "varchar(3900)"
-  :dlp_revision_number "numeric(38)"
-  :revision_delete_flag "numeric(38)"
-  :deleted_flag "numeric(1,0)"
-  :effective_start_date "date"
-  :effective_end_date "date"
-)
-
-create table rm_case_event_assess
-(
-  :enterprise_id "numeric(38)"
-  :case_id "numeric(38)"
-  :event_seq_num "numeric(38)"
-  :prod_seq_num "numeric(38)"
-  :datasheet_id "numeric(38)"
-  :license_id "numeric(38)"
-  :seq_num "numeric(38)"
-  :updated "date"
-  :det_listedness_id "numeric(38)"
-  :rpt_causality_id "numeric(38)"
-  :det_causality_id "numeric(38)"
-  :listed_justify "varchar(3900)"
-  :cause_justify "varchar(3900)"
-  :lam_assessed "numeric(12,0)"
-  :deleted "date"
-  :causality_assessment "varchar(99)"
-  :causality_score "numeric(38)"
-  :source_id "numeric(38)"
-  :prt_causality_id "numeric(38)"
-  :cause_justify_j "varchar(3900)"
-  :listed_justify_j "varchar(3900)"
-  :dlp_revision_number "numeric(38)"
-  :last_update_time "date"
-  :revision_delete_flag "numeric(38)"
-  :deleted_flag "numeric(1,0)"
-  :effective_start_date "date"
-  :effective_end_date "date"
-)
-
-create table rm_case_followup
-(
-  :enterprise_id "numeric(38)"
-  :case_id "numeric(38)"
-  :seq_num "numeric(38)"
-  :receipt_date "date"
-  :safety_date "date"
-  :significant "numeric(1,0)"
-  :auditlog_type "numeric(38)"
-  :time_stamp "date"
-  :deleted "date"
-  :significant_device "numeric(1,0)"
-  :data_cleanup "numeric(1,0)"
-  :justification "varchar(3900)"
-  :justification_id "numeric(38)"
-  :justification_j "varchar(3900)"
-  :just_receipt_date_j "varchar(3900)"
-  :receipt_date_j "date"
-  :dlp_revision_number "numeric(38)"
-  :revision_delete_flag "numeric(38)"
-  :deleted_flag "numeric(1,0)"
-  :effective_start_date "date"
-  :effective_end_date "date"
-)
-
-create table rm_case_master
-(
-  :enterprise_id "numeric(38)"
-  :case_id "numeric(38)"
-  :case_num "varchar(99)"
-  :rev "numeric(38)"
-  :workflow_seq_num "numeric(38)"
-  :last_workflow_seq_num "numeric(38)"
-  :create_time "date"
-  :init_rept_date "date"
-  :user_id "numeric(38)"
-  :last_update_time "date"
-  :last_update_user_id "numeric(38)"
-  :requires_followup "numeric(38)"
-  :followup_date "date"
-  :owner_id "numeric(38)"
-  :state_id "numeric(38)"
-  :country_id "numeric(38)"
-  :lang_id "numeric(38)"
-  :priority "numeric(38)"
-  :site_id "numeric(38)"
-  :seriousness "numeric(38)"
-  :rpt_type_id "numeric(38)"
-  :last_state_id "numeric(38)"
-  :assessment_needed "numeric(38)"
-  :priority_override "numeric(1,0)"
-  :sid "varchar(999)"
-  :safety_date "date"
-  :normal_time "date"
-  :max_time "date"
-  :report_scheduling "numeric(38)"
-  :priority_assessment "numeric(38)"
-  :close_user_id "numeric(38)"
-  :close_date "date"
-  :close_notes "varchar(999)"
-  :date_locked "date"
-  :ud_text_1 "varchar(999)"
-  :ud_text_2 "varchar(999)"
-  :ud_text_3 "varchar(999)"
-  :ud_text_4 "varchar(999)"
-  :ud_text_5 "varchar(999)"
-  :ud_text_6 "varchar(999)"
-  :ud_text_7 "varchar(999)"
-  :ud_text_8 "varchar(999)"
-  :ud_text_9 "varchar(999)"
-  :ud_text_10 "varchar(999)"
-  :ud_text_11 "varchar(999)"
-  :ud_text_12 "varchar(999)"
-  :ud_date_1 "date"
-  :ud_date_2 "date"
-  :ud_date_3 "date"
-  :ud_date_4 "date"
-  :ud_date_5 "date"
-  :ud_date_6 "date"
-  :ud_date_7 "date"
-  :ud_date_8 "date"
-  :ud_date_9 "date"
-  :ud_date_10 "date"
-  :ud_date_11 "date"
-  :ud_date_12 "date"
-  :ud_number_1 "numeric(30,10)"
-  :ud_number_2 "numeric(30,10)"
-  :ud_number_3 "numeric(30,10)"
-  :ud_number_4 "numeric(30,10)"
-  :ud_number_5 "numeric(30,10)"
-  :ud_number_6 "numeric(30,10)"
-  :ud_number_7 "numeric(30,10)"
-  :ud_number_8 "numeric(30,10)"
-  :ud_number_9 "numeric(30,10)"
-  :ud_number_10 "numeric(30,10)"
-  :ud_number_11 "numeric(30,10)"
-  :ud_number_12 "numeric(30,10)"
-  :deleted "date"
-  :due_soon "date"
-  :global_num "varchar(99)"
-  :priority_date_assessed "date"
-  :lam_assess_done "numeric(1,0)"
-  :e2b_ww_number "varchar(999)"
-  :worklist_owner_id "numeric(38)"
-  :susar "numeric(38)"
-  :last_update_event "date"
-  :initial_justification "varchar(3900)"
-  :force_soon "date"
-  :due_soon_j "date"
-  :followup_date_j "date"
-  :init_rept_date_j "date"
-  :just_init_rept_date_j "varchar(3900)"
-  :ud_text_1_j "varchar(999)"
-  :ud_text_2_j "varchar(999)"
-  :ud_text_3_j "varchar(999)"
-  :ud_text_4_j "varchar(999)"
-  :ud_text_5_j "varchar(999)"
-  :ud_text_6_j "varchar(999)"
-  :ud_text_7_j "varchar(999)"
-  :ud_text_8_j "varchar(999)"
-  :ud_text_9_j "varchar(999)"
-  :ud_text_10_j "varchar(999)"
-  :ud_text_11_j "varchar(999)"
-  :ud_text_12_j "varchar(999)"
-  :initial_justification_j "varchar(3900)"
-  :dlp_revision_number "numeric(38)"
-  :revision_delete_flag "numeric(38)"
-  :deleted_flag "numeric(1,0)"
-  :effective_start_date "date"
-  :effective_end_date "date"
-)
-
-create table rm_case_narrative
-(
-  :enterprise_id "numeric(38)"
-  :case_id "numeric(38)"
-  :abbrev_narrative "varchar(3900)"
-  :abbrev_narrative_j "varchar(3900)"
-  :narrative "varchar(3900)"
-  :narrative_j "varchar(3900)"
-  :deleted "date"
-  :dlp_revision_number "numeric(38)"
-  :revision_delete_flag "numeric(38)"
-  :deleted_flag "numeric(1,0)"
-  :effective_start_date "date"
-  :effective_end_date "date"
-)
-
-create table rm_case_pat_info
-(
-  :enterprise_id "numeric(38)"
-  :case_id "numeric(38)"
-  :pat_id "varchar(99)"
-  :pat_subj_num "varchar(99)"
-  :pat_initials "varchar(99)"
-  :pat_firstname "varchar(99)"
-  :pat_mi "varchar(99)"
-  :pat_lastname "varchar(99)"
-  :pat_address "varchar(999)"
-  :pat_city "varchar(99)"
-  :pat_state "varchar(99)"
-  :pat_postal_code "varchar(99)"
-  :pat_country "varchar(99)"
-  :pat_phone "varchar(99)"
-  :pat_dob "date"
-  :pat_dob_res "numeric(38)"
-  :pat_age "numeric(22,7)"
-  :age_unit_id "numeric(38)"
-  :age_group_id "numeric(38)"
-  :gender_id "numeric(38)"
-  :pat_weight_lbs "numeric(22,7)"
-  :pat_weight_kg "numeric(22,7)"
-  :pat_height_in "numeric(22,7)"
-  :pat_height_cm "numeric(22,7)"
-  :ethnicity_id "numeric(38)"
-  :occupation_id "numeric(38)"
-  :pat_stat_preg "numeric(38)"
-  :rel_test_id "numeric(38)"
-  :pat_dob_partial "varchar(99)"
-  :rand_num "varchar(99)"
-  :confidential "numeric(1,0)"
-  :number_of_patients "varchar(9)"
-  :ud_text_1 "varchar(999)"
-  :ud_text_2 "varchar(999)"
-  :ud_text_3 "varchar(999)"
-  :ud_text_4 "varchar(999)"
-  :ud_text_5 "varchar(999)"
-  :ud_text_6 "varchar(999)"
-  :ud_text_7 "varchar(999)"
-  :ud_text_8 "varchar(999)"
-  :ud_text_9 "varchar(999)"
-  :ud_text_10 "varchar(999)"
-  :ud_text_11 "varchar(999)"
-  :ud_text_12 "varchar(999)"
-  :ud_date_1 "date"
-  :ud_date_2 "date"
-  :ud_date_3 "date"
-  :ud_date_4 "date"
-  :ud_date_5 "date"
-  :ud_date_6 "date"
-  :ud_date_7 "date"
-  :ud_date_8 "date"
-  :ud_date_9 "date"
-  :ud_date_10 "date"
-  :ud_date_11 "date"
-  :ud_date_12 "date"
-  :ud_number_1 "numeric(30,10)"
-  :ud_number_2 "numeric(30,10)"
-  :ud_number_3 "numeric(30,10)"
-  :ud_number_4 "numeric(30,10)"
-  :ud_number_5 "numeric(30,10)"
-  :ud_number_6 "numeric(30,10)"
-  :ud_number_7 "numeric(30,10)"
-  :ud_number_8 "numeric(30,10)"
-  :ud_number_9 "numeric(30,10)"
-  :ud_number_10 "numeric(30,10)"
-  :ud_number_11 "numeric(30,10)"
-  :ud_number_12 "numeric(30,10)"
-  :deleted "date"
-  :child_only "numeric(1,0)"
-  :pat_bmi "numeric(22,7)"
-  :pat_body_area "numeric(22,7)"
-  :pat_address_j "varchar(999)"
-  :pat_city_j "varchar(99)"
-  :pat_firstname_j "varchar(99)"
-  :pat_lastname_j "varchar(99)"
-  :pat_mi_j "varchar(99)"
-  :pat_state_j "varchar(99)"
-  :ud_text_1_j "varchar(999)"
-  :ud_text_2_j "varchar(999)"
-  :ud_text_3_j "varchar(999)"
-  :ud_text_4_j "varchar(999)"
-  :ud_text_5_j "varchar(999)"
-  :ud_text_6_j "varchar(999)"
-  :ud_text_7_j "varchar(999)"
-  :ud_text_8_j "varchar(999)"
-  :ud_text_9_j "varchar(999)"
-  :ud_text_10_j "varchar(999)"
-  :ud_text_11_j "varchar(999)"
-  :ud_text_12_j "varchar(999)"
-  :pat_country_id "numeric(38)"
-  :dlp_revision_number "numeric(38)"
-  :revision_delete_flag "numeric(38)"
-  :deleted_flag "numeric(1,0)"
-  :effective_start_date "date"
-  :effective_end_date "date"
-  :notes "varchar(3900)"
-  :notes_j "varchar(3900)"
-  :age_unit_id_at_vacc "numeric(38)"
-  :pat_age_at_vacc "numeric(38)"
-)
-
-create table rm_case_prod_drugs
-(
-  :enterprise_id "numeric(38)"
-  :case_id "numeric(38)"
-  :seq_num "numeric(38)"
-  :formulation_id "numeric(38)"
-  :concentration "varchar(99)"
-  :conc_units_id "numeric(38)"
-  :act_taken_id "numeric(38)"
-  :severity_id "numeric(38)"
-  :interaction "numeric(38)"
-  :contraind "numeric(38)"
-  :first_dose "date"
-  :first_dose_res "numeric(38)"
-  :last_dose "date"
-  :last_dose_res "numeric(38)"
-  :total_dose "numeric(22,7)"
-  :tot_dose_unit_id "numeric(38)"
-  :prev_use "numeric(38)"
-  :abuse "numeric(38)"
-  :overdose "numeric(38)"
-  :protocol "numeric(38)"
-  :dechallenge "numeric(38)"
-  :dechall_date "date"
-  :rechallenge "numeric(38)"
-  :rechall_start "date"
-  :rechall_stop "date"
-  :rechall_outcome "numeric(38)"
-  :sort_id "numeric(38)"
-  :b_weight_grams "numeric(38)"
-  :n_siblings "numeric(38)"
-  :b_weight_ozs "numeric(38)"
-  :first_dose_partial "varchar(99)"
-  :last_dose_partial "varchar(99)"
-  :tampering "numeric(4,0)"
-  :cumulative_dose "numeric(22,7)"
-  :cumulative_dose_unit "varchar(99)"
-  :deleted "date"
-  :ud_text_1 "varchar(999)"
-  :ud_text_2 "varchar(999)"
-  :ud_text_3 "varchar(999)"
-  :ud_text_4 "varchar(999)"
-  :ud_text_5 "varchar(999)"
-  :ud_text_6 "varchar(999)"
-  :ud_text_7 "varchar(999)"
-  :ud_text_8 "varchar(999)"
-  :ud_text_9 "varchar(999)"
-  :ud_text_10 "varchar(999)"
-  :ud_text_11 "varchar(999)"
-  :ud_text_12 "varchar(999)"
-  :ud_date_1 "date"
-  :ud_date_2 "date"
-  :ud_date_3 "date"
-  :ud_date_4 "date"
-  :ud_date_5 "date"
-  :ud_date_6 "date"
-  :ud_date_7 "date"
-  :ud_date_8 "date"
-  :ud_date_9 "date"
-  :ud_date_10 "date"
-  :ud_date_11 "date"
-  :ud_date_12 "date"
-  :ud_number_1 "numeric(30,10)"
-  :ud_number_2 "numeric(30,10)"
-  :ud_number_3 "numeric(30,10)"
-  :ud_number_4 "numeric(30,10)"
-  :ud_number_5 "numeric(30,10)"
-  :ud_number_6 "numeric(30,10)"
-  :ud_number_7 "numeric(30,10)"
-  :ud_number_8 "numeric(30,10)"
-  :ud_number_9 "numeric(30,10)"
-  :ud_number_10 "numeric(30,10)"
-  :ud_number_11 "numeric(30,10)"
-  :ud_number_12 "numeric(30,10)"
-  :cumulative_dose_unit_id "numeric(38)"
-  :obtain_drug_country_id "numeric(38)"
-  :drug_auth_country_id "numeric(38)"
-  :duration_seconds "numeric(38)"
-  :latency_seconds "numeric(38)"
-  :delay_seconds "numeric(38)"
-  :ud_text_1_j "varchar(999)"
-  :ud_text_2_j "varchar(999)"
-  :ud_text_3_j "varchar(999)"
-  :ud_text_4_j "varchar(999)"
-  :ud_text_5_j "varchar(999)"
-  :ud_text_6_j "varchar(999)"
-  :ud_text_7_j "varchar(999)"
-  :ud_text_8_j "varchar(999)"
-  :ud_text_9_j "varchar(999)"
-  :ud_text_10_j "varchar(999)"
-  :ud_text_11_j "varchar(999)"
-  :ud_text_12_j "varchar(999)"
-  :dlp_revision_number "numeric(38)"
-  :revision_delete_flag "numeric(38)"
-  :deleted_flag "numeric(1,0)"
-  :effective_start_date "date"
-  :effective_end_date "date"
-)
-
-create table rm_case_product
-(
-  :enterprise_id "numeric(38)"
-  :case_id "numeric(38)"
-  :seq_num "numeric(38)"
-  :product_id "numeric(38)"
-  :drug_type "numeric(38)"
-  :pat_exposure "numeric(38)"
-  :manufacturer_id "numeric(38)"
-  :protocol_followed "numeric(38)"
-  :first_sus_prod "numeric(38)"
-  :selected_view "numeric(38)"
-  :sort_id "numeric(38)"
-  :views_available "numeric(38)"
-  :country_id "numeric(38)"
-  :qc_safety_date "date"
-  :qc_sent_date "date"
-  :qc_result_date "date"
-  :qc_cross_reference "varchar(99)"
-  :who_drug_code "varchar(99)"
-  :co_drug_code "varchar(99)"
-  :product_name "varchar(99)"
-  :generic_name "varchar(3900)"
-  :generic_name_j "varchar(3900)"
-  :ud_text_1 "varchar(999)"
-  :ud_text_2 "varchar(999)"
-  :ud_text_3 "varchar(999)"
-  :ud_text_4 "varchar(999)"
-  :ud_text_5 "varchar(999)"
-  :ud_text_6 "varchar(999)"
-  :ud_text_7 "varchar(999)"
-  :ud_text_8 "varchar(999)"
-  :ud_text_9 "varchar(999)"
-  :ud_text_10 "varchar(999)"
-  :ud_text_11 "varchar(999)"
-  :ud_text_12 "varchar(999)"
-  :ud_date_1 "date"
-  :ud_date_2 "date"
-  :ud_date_3 "date"
-  :ud_date_4 "date"
-  :ud_date_5 "date"
-  :ud_date_6 "date"
-  :ud_date_7 "date"
-  :ud_date_8 "date"
-  :ud_date_9 "date"
-  :ud_date_10 "date"
-  :ud_date_11 "date"
-  :ud_date_12 "date"
-  :ud_number_1 "numeric(30,10)"
-  :ud_number_2 "numeric(30,10)"
-  :ud_number_3 "numeric(30,10)"
-  :ud_number_4 "numeric(30,10)"
-  :ud_number_5 "numeric(30,10)"
-  :ud_number_6 "numeric(30,10)"
-  :ud_number_7 "numeric(30,10)"
-  :ud_number_8 "numeric(30,10)"
-  :ud_number_9 "numeric(30,10)"
-  :ud_number_10 "numeric(30,10)"
-  :ud_number_11 "numeric(30,10)"
-  :ud_number_12 "numeric(30,10)"
-  :include_frequency "numeric(38)"
-  :sdrug_not_admin "numeric(38)"
-  :prod_reptd "varchar(999)"
-  :prod_coded "varchar(999)"
-  :prod_syn_id "numeric(38)"
-  :prod_code_status "numeric(3,0)"
-  :deleted "date"
-  :study_product_num "numeric(2,0)"
-  :qc_quantity "varchar(99)"
-  :qc_return_date "date"
-  :qc_complaint_cat_date "date"
-  :qc_analysis_cat_date "date"
-  :qc_analysis_summary_date "date"
-  :primary_event "numeric(38)"
-  :medicinal_prod_id "varchar(99)"
-  :family_id "numeric(38)"
-  :existing_rpt_seq_mod_flg "numeric(38)"
-  :drug_code_j "varchar(99)"
-  :drug_code_type_j "numeric(38)"
-  :product_name_j "varchar(99)"
-  :prod_coded_j "varchar(999)"
-  :prod_reptd_j "varchar(999)"
-  :qc_cross_reference_j "varchar(99)"
-  :ud_text_1_j "varchar(999)"
-  :ud_text_2_j "varchar(999)"
-  :ud_text_3_j "varchar(999)"
-  :ud_text_4_j "varchar(999)"
-  :ud_text_5_j "varchar(999)"
-  :ud_text_6_j "varchar(999)"
-  :ud_text_7_j "varchar(999)"
-  :ud_text_8_j "varchar(999)"
-  :ud_text_9_j "varchar(999)"
-  :ud_text_10_j "varchar(999)"
-  :ud_text_11_j "varchar(999)"
-  :ud_text_12_j "varchar(999)"
-  :dlp_revision_number "numeric(38)"
-  :last_update_time "date"
-  :revision_delete_flag "numeric(38)"
-  :deleted_flag "numeric(1,0)"
-  :effective_start_date "date"
-  :effective_end_date "date"
-  :notes "varchar(3900)"
-  :notes_j "varchar(3900)"
-  :qc_analysis_cat_text "varchar(3900)"
-  :qc_analysis_cat_text_j "varchar(3900)"
-  :qc_anal_summary_text "varchar(3900)"
-  :qc_anal_summary_text_j "varchar(3900)"
-  :qc_result "varchar(3900)"
-  :qc_result_j "varchar(3900)"
-  :qc_comment "varchar(3900)"
-  :qc_comment_j "varchar(3900)"
-  :qc_complaint_cat_text "varchar(3900)"
-  :qc_complaint_cat_text_j "varchar(3900)"
-  :vaers_block_id "numeric(38)"
-  :prod_lic_id "numeric(38)"
-)
-
-create table rm_case_reporters
-(
-  :enterprise_id "numeric(38)"
-  :case_id "numeric(38)"
-  :seq_num "numeric(38)"
-  :media_id "numeric(38)"
-  :occupation_id "numeric(38)"
-  :hcp_flag "numeric(38)"
-  :primary_contact "numeric(38)"
-  :corr_contact "numeric(38)"
-  :reporter_type "numeric(38)"
-  :intermediary_id "numeric(38)"
-  :rpt_sent "numeric(38)"
-  :sort_id "numeric(38)"
-  :confidential "numeric(1,0)"
-  :country_id "numeric(38)"
-  :suffix "varchar(99)"
-  :middle_name "varchar(99)"
-  :prefix "varchar(99)"
-  :first_name "varchar(99)"
-  :last_name "varchar(99)"
-  :reporter_id "varchar(99)"
-  :institution "varchar(99)"
-  :department "varchar(99)"
-  :city "varchar(99)"
-  :state "varchar(99)"
-  :postcode "varchar(99)"
-  :country "varchar(99)"
-  :phone "varchar(99)"
-  :altphone "varchar(99)"
-  :fax "varchar(99)"
-  :reporter_ref "varchar(99)"
-  :email "varchar(999)"
-  :address "varchar(999)"
-  :suffix_j "varchar(99)"
-  :address_j "varchar(999)"
-  :city_j "varchar(99)"
-  :department_j "varchar(99)"
-  :first_name_j "varchar(99)"
-  :institution_j "varchar(99)"
-  :last_name_j "varchar(99)"
-  :middle_name_j "varchar(99)"
-  :prefix_j "varchar(99)"
-  :state_j "varchar(99)"
-  :deleted "date"
-  :dlp_revision_number "numeric(38)"
-  :revision_delete_flag "numeric(38)"
-  :deleted_flag "numeric(1,0)"
-  :effective_start_date "date"
-  :effective_end_date "date"
-  :notes "varchar(3900)"
-  :notes_j "varchar(3900)"
-  :institution_id "varchar(99)"
-)
-
-create table rm_case_study
-(
-  :enterprise_id "numeric(38)"
-  :case_id "numeric(38)"
-  :study_key "numeric(38)"
-  :study_num "varchar(99)"
-  :study_type "numeric(38)"
-  :center_id "numeric(38)"
-  :center_name "varchar(99)"
-  :protocol_id "numeric(38)"
-  :protocol_num "varchar(99)"
-  :other_id "varchar(99)"
-  :code_broken "numeric(38)"
-  :broken_by "numeric(38)"
-  :broken_date "date"
-  :reason "varchar(999)"
-  :week "varchar(9)"
-  :visit "varchar(9)"
-  :deleted "date"
-  :product_count "numeric(2,0)"
-  :classification_id "numeric(38)"
-  :blind_name "varchar(99)"
-  :study_desc "varchar(3900)"
-  :study_desc_j "varchar(3900)"
-  :blind_name_j "varchar(99)"
-  :center_name_j "varchar(99)"
-  :clin_compound_num_j "varchar(99)"
-  :protocol_num_j "varchar(99)"
-  :study_num_j "varchar(99)"
-  :dev_phase_id "numeric(38)"
-  :dlp_revision_number "numeric(38)"
-  :revision_delete_flag "numeric(38)"
-  :deleted_flag "numeric(1,0)"
-  :effective_start_date "date"
-  :effective_end_date "date"
-  :cohort_id "numeric(38)"
-)
-
-create table rm_lm_case_classification
-(
-  :enterprise_id "numeric(38)"
-  :classification_id "numeric(38)"
-  :description "varchar(99)"
-  :protected "numeric(38)"
-  :display "numeric(38)"
-  :description_j "varchar(99)"
-  :deleted "date"
-  :e2b_code "numeric(38)"
-)
-
-create table rm_lm_causality
-(
-  :enterprise_id "numeric(38)"
-  :causality_id "numeric(38)"
-  :causality "varchar(99)"
-  :reportability "numeric(38)"
-  :protected "numeric(38)"
-  :display "numeric(38)"
-  :causality_j "varchar(99)"
-  :deleted "date"
-)
-
-create table rm_lm_countries
-(
-  :enterprise_id "numeric(38)"
-  :country_id "numeric(38)"
-  :country "varchar(99)"
-  :a2 "varchar(9)"
-  :a3 "varchar(9)"
-  :num "numeric(38)"
-  :protected "numeric(38)"
-  :deleted "date"
-  :country_group_id "numeric(38)"
-  :country_group "varchar(99)"
-  :country_j "varchar(99)"
-  :group_2_country "numeric(38)"
-)
-
-create table rm_lm_product
-(
-  :enterprise_id "numeric(38)"
-  :product_id "numeric(38)"
-  :prod_name "varchar(99)"
-  :family_id "numeric(38)"
-  :formulation_id "numeric(38)"
-  :manufacturer_id "numeric(38)"
-  :concentration "varchar(99)"
-  :conc_unit_id "numeric(38)"
-  :indication_id "varchar(99)"
-  :code_dict "numeric(38)"
-  :indication_text "varchar(999)"
-  :intl_birth_date "date"
-  :model_no "varchar(99)"
-  :drl_id "varchar(99)"
-  :drug_code "varchar(99)"
-  :deleted "date"
-  :prod_generic_name "varchar(3900)"
-  :prod_generic_name_j "varchar(3900)"
-  :ind_llt_code "varchar(99)"
-  :ind_llt "varchar(999)"
-  :ind_hlt_code "varchar(99)"
-  :ind_hlt "varchar(999)"
-  :ind_hlgt_code "varchar(99)"
-  :ind_hlgt "varchar(999)"
-  :ind_soc_code "varchar(99)"
-  :ind_soc "varchar(999)"
-  :ind_syn_code "numeric(38)"
-  :ind_code_status "numeric(38)"
-  :medicinal_prod_id "varchar(99)"
-  :prod_name_abbrv "varchar(9)"
-  :device_code "varchar(99)"
-  :psur_group_name "varchar(99)"
-  :comments "varchar(3900)"
-  :ind_coded "varchar(999)"
-  :ind_reptd "varchar(999)"
-  :drl_id_j "varchar(99)"
-  :drug_code_j "varchar(99)"
-  :drug_code_type_j "numeric(38)"
-  :indication_text_j "varchar(999)"
-  :ind_code_status_j "numeric(38)"
-  :ind_hlgt_j "varchar(999)"
-  :ind_hlt_j "varchar(999)"
-  :ind_llt_code_j "varchar(99)"
-  :ind_llt_j "varchar(999)"
-  :ind_soc_j "varchar(999)"
-  :prod_name_j "varchar(99)"
-  :ind_syn_code_j "numeric(38)"
-  :ind_coded_j "varchar(999)"
-  :ind_reptd_j "varchar(999)"
-  :dev_intl_birth_date "date"
-  :comments_j "varchar(3900)"
-)
-
-create table rm_lm_product_family
-(
-  :enterprise_id "numeric(38)"
-  :family_id "numeric(38)"
-  :name "varchar(99)"
-  :primary_view "numeric(38)"
-  :deleted "date"
-  :product_group_id "numeric(38)"
-  :comments "varchar(3900)"
-  :search_equation_number "varchar(99)"
-  :name_j "varchar(99)"
-  :comments_j "varchar(3900)"
-)
-
-create table rm_lm_report_type
-(
-  :enterprise_id "numeric(38)"
-  :rpt_type_id "numeric(38)"
-  :report_type "varchar(99)"
-  :protected "numeric(38)"
-  :display "numeric(38)"
-  :incl_lit "numeric(38)"
-  :incl_trial "numeric(38)"
-  :e2b_code "numeric(38)"
-  :abrv "varchar(9)"
-  :investigational "numeric(38)"
-  :report_type_j "varchar(99)"
-  :deleted "date"
-  :incl_research "numeric(38)"
-)
-
-create table rm_meddra_smq_content
-(
-  :global_dict_id "numeric(38)"
-  :smq_code "numeric(38)"
-  :term_code "numeric(38)"
-  :term_level "numeric(38)"
-  :term_scope "numeric(38)"
-  :term_category "varchar(9)"
-  :term_weight "numeric(38)"
-  :term_status "varchar(9)"
-  :term_addition_version "varchar(9)"
-  :term_last_modified_version "varchar(9)"
-)
-
-create table rm_meddra_smq_list
-(
-  :global_dict_id "numeric(38)"
-  :smq_code "numeric(38)"
-  :smq_name "varchar(999)"
-  :smq_level "numeric(38)"
-  :smq_description "varchar(3900)"
-  :smq_source "varchar(3900)"
-  :smq_note "varchar(3900)"
-  :meddra_version "varchar(9)"
-  :status "varchar(9)"
-  :smq_algorithm "varchar(999)"
-)
+:rm_case_assess
+{
+  :enterprise_id                  "numeric(38)"
+  :case_id                        "numeric(38)"
+  :template_id                    "numeric(38)"
+  :listedness                     "numeric(38)"
+  :updated                        "date"
+  :outcome                        "numeric(38)"
+  :comment_id                     "numeric(38)"
+  :comp_comment_id                "numeric(38)"
+  :seriousness                    "numeric(38)"
+  :serious_notes                  "varchar(3900)"
+  :agent_suspect                  "numeric(38)"
+  :agent_notes                    "varchar(3900)"
+  :listedness_notes               "varchar(3900)"
+  :bfarm_causality                "numeric(10,0)"
+  :bfarm_manual_text              "varchar(3900)"
+  :company_diagnosis              "varchar(999)"
+  :company_diagnosis_notes        "varchar(3900)"
+  :diagnosis_dict_id              "numeric(38)"
+  :diagnosis_pref_code            "varchar(99)"
+  :diagnosis_inc_code             "varchar(99)"
+  :diagnosis_inc_term             "varchar(999)"
+  :diagnosis_hlgt_code            "varchar(99)"
+  :diagnosis_hlgt                 "varchar(999)"
+  :diagnosis_hlt_code             "varchar(99)"
+  :diagnosis_hlt                  "varchar(999)"
+  :diagnosis_soc_code             "varchar(99)"
+  :diagnosis_body_sys             "varchar(999)"
+  :ud_text_1                      "varchar(999)"
+  :ud_text_2                      "varchar(999)"
+  :ud_text_3                      "varchar(999)"
+  :ud_text_4                      "varchar(999)"
+  :ud_text_5                      "varchar(999)"
+  :ud_text_6                      "varchar(999)"
+  :ud_text_7                      "varchar(999)"
+  :ud_text_8                      "varchar(999)"
+  :ud_text_9                      "varchar(999)"
+  :ud_text_10                     "varchar(999)"
+  :ud_text_11                     "varchar(999)"
+  :ud_text_12                     "varchar(999)"
+  :ud_date_1                      "date"
+  :ud_date_2                      "date"
+  :ud_date_3                      "date"
+  :ud_date_4                      "date"
+  :ud_date_5                      "date"
+  :ud_date_6                      "date"
+  :ud_date_7                      "date"
+  :ud_date_8                      "date"
+  :ud_date_9                      "date"
+  :ud_date_10                     "date"
+  :ud_date_11                     "date"
+  :ud_date_12                     "date"
+  :ud_number_1                    "numeric(30,10)"
+  :ud_number_2                    "numeric(30,10)"
+  :ud_number_3                    "numeric(30,10)"
+  :ud_number_4                    "numeric(30,10)"
+  :ud_number_5                    "numeric(30,10)"
+  :ud_number_6                    "numeric(30,10)"
+  :ud_number_7                    "numeric(30,10)"
+  :ud_number_8                    "numeric(30,10)"
+  :ud_number_9                    "numeric(30,10)"
+  :ud_number_10                   "numeric(30,10)"
+  :ud_number_11                   "numeric(30,10)"
+  :ud_number_12                   "numeric(30,10)"
+  :evaluation                     "varchar(3900)"
+  :evaluation_j                   "varchar(3900)"
+  :co_suspect_count               "numeric(3,0)"
+  :event_synopsis                 "varchar(9)"
+  :event_primary                  "varchar(999)"
+  :diagnosis_reptd                "varchar(999)"
+  :diagnosis_coded                "varchar(999)"
+  :diagnosis_syn_code             "numeric(38)"
+  :diagnosis_code_status          "numeric(3,0)"
+  :event_primary_j                "varchar(999)"
+  :agent_notes_j                  "varchar(3900)"
+  :company_diagnosis_j            "varchar(999)"
+  :company_diagnosis_notes_j      "varchar(3900)"
+  :diagnosis_body_sys_j           "varchar(999)"
+  :diagnosis_coded_j              "varchar(999)"
+  :diagnosis_code_status_j        "numeric(38)"
+  :diagnosis_hlgt_j               "varchar(999)"
+  :diagnosis_hlt_j                "varchar(999)"
+  :diagnosis_inc_code_j           "varchar(99)"
+  :diagnosis_inc_term_j           "varchar(999)"
+  :diagnosis_reptd_j              "varchar(999)"
+  :listedness_notes_j             "varchar(3900)"
+  :serious_notes_j                "varchar(3900)"
+  :ud_text_1_j                    "varchar(999)"
+  :ud_text_2_j                    "varchar(999)"
+  :ud_text_3_j                    "varchar(999)"
+  :ud_text_4_j                    "varchar(999)"
+  :ud_text_5_j                    "varchar(999)"
+  :ud_text_6_j                    "varchar(999)"
+  :ud_text_7_j                    "varchar(999)"
+  :ud_text_8_j                    "varchar(999)"
+  :ud_text_9_j                    "varchar(999)"
+  :ud_text_10_j                   "varchar(999)"
+  :ud_text_11_j                   "varchar(999)"
+  :ud_text_12_j                   "varchar(999)"
+  :diagnosis_syn_code_j           "numeric(38)"
+  :deleted                        "date"
+  :dlp_revision_number            "numeric(38)"
+  :revision_delete_flag           "numeric(38)"
+  :deleted_flag                   "numeric(1,0)"
+  :effective_start_date           "date"
+  :effective_end_date             "date"
+}
+
+:rm_case_classifications
+{
+  :enterprise_id                  "numeric(38)"
+  :case_id                        "numeric(38)"
+  :seq_num                        "numeric(38)"
+  :classification_id              "numeric(38)"
+  :deleted                        "date"
+  :dlp_revision_number            "numeric(38)"
+  :revision_delete_flag           "numeric(38)"
+  :deleted_flag                   "numeric(1,0)"
+  :effective_start_date           "date"
+  :effective_end_date             "date"
+}
+
+:rm_case_event
+{
+  :enterprise_id                  "numeric(38)"
+  :case_id                        "numeric(38)"
+  :seq_num                        "numeric(38)"
+  :desc_reptd                     "varchar(999)"
+  :desc_coded                     "varchar(999)"
+  :diagnosis                      "numeric(38)"
+  :onset                          "date"
+  :onset_res                      "numeric(38)"
+  :onset_delay                    "varchar(99)"
+  :stop_date                      "date"
+  :stop_date_res                  "numeric(38)"
+  :duration                       "varchar(99)"
+  :onset_latency                  "varchar(99)"
+  :evt_intensity_id               "numeric(38)"
+  :evt_freq_id                    "numeric(38)"
+  :treated                        "numeric(38)"
+  :study_related                  "numeric(38)"
+  :rechall_related                "numeric(38)"
+  :prod_seq_num                   "numeric(38)"
+  :evt_outcome_id                 "numeric(38)"
+  :receipt_date                   "date"
+  :rpt_serious                    "numeric(38)"
+  :sc_death                       "numeric(38)"
+  :sc_hosp                        "numeric(38)"
+  :sc_cong_anom                   "numeric(38)"
+  :sc_threat                      "numeric(38)"
+  :sc_disable                     "numeric(38)"
+  :sc_int_req                     "numeric(38)"
+  :sc_other                       "numeric(38)"
+  :sc_other_text                  "varchar(99)"
+  :art_code                       "varchar(99)"
+  :pref_term                      "varchar(999)"
+  :inc_term                       "varchar(999)"
+  :body_sys                       "varchar(999)"
+  :med_serious                    "numeric(38)"
+  :past_hist                      "numeric(38)"
+  :dict_id                        "numeric(38)"
+  :dict_key                       "varchar(99)"
+  :code_status                    "numeric(38)"
+  :seriousness                    "numeric(38)"
+  :sort_id                        "numeric(38)"
+  :onset_date_partial             "varchar(99)"
+  :stop_date_partial              "varchar(99)"
+  :efficacy                       "numeric(38)"
+  :disease                        "numeric(38)"
+  :withdrawal                     "numeric(38)"
+  :hlgt                           "varchar(999)"
+  :hlt                            "varchar(999)"
+  :hlt_code                       "varchar(99)"
+  :hlgt_code                      "varchar(99)"
+  :soc_code                       "varchar(99)"
+  :study_dropped                  "numeric(4,0)"
+  :inc_code                       "varchar(99)"
+  :onset_minutes                  "numeric(38)"
+  :delay_minutes                  "numeric(38)"
+  :ud_text_1                      "varchar(999)"
+  :ud_text_2                      "varchar(999)"
+  :ud_text_3                      "varchar(999)"
+  :ud_text_4                      "varchar(999)"
+  :ud_text_5                      "varchar(999)"
+  :ud_text_6                      "varchar(999)"
+  :ud_text_7                      "varchar(999)"
+  :ud_text_8                      "varchar(999)"
+  :ud_text_9                      "varchar(999)"
+  :ud_text_10                     "varchar(999)"
+  :ud_text_11                     "varchar(999)"
+  :ud_text_12                     "varchar(999)"
+  :ud_date_1                      "date"
+  :ud_date_2                      "date"
+  :ud_date_3                      "date"
+  :ud_date_4                      "date"
+  :ud_date_5                      "date"
+  :ud_date_6                      "date"
+  :ud_date_7                      "date"
+  :ud_date_8                      "date"
+  :ud_date_9                      "date"
+  :ud_date_10                     "date"
+  :ud_date_11                     "date"
+  :ud_date_12                     "date"
+  :ud_number_1                    "numeric(30,10)"
+  :ud_number_2                    "numeric(30,10)"
+  :ud_number_3                    "numeric(30,10)"
+  :ud_number_4                    "numeric(30,10)"
+  :ud_number_5                    "numeric(30,10)"
+  :ud_number_6                    "numeric(30,10)"
+  :ud_number_7                    "numeric(30,10)"
+  :ud_number_8                    "numeric(30,10)"
+  :ud_number_9                    "numeric(30,10)"
+  :ud_number_10                   "numeric(30,10)"
+  :ud_number_11                   "numeric(30,10)"
+  :ud_number_12                   "numeric(30,10)"
+  :details                        "varchar(3900)"
+  :details_j                      "varchar(3900)"
+  :syn_code                       "numeric(38)"
+  :deleted                        "date"
+  :study_related_reptd            "numeric(1,0)"
+  :duration_unit_e2b              "numeric(38)"
+  :onset_latency_unit_e2b         "numeric(38)"
+  :onset_delay_unit_e2b           "numeric(38)"
+  :duration_seconds               "numeric(38)"
+  :onset_latency_seconds          "numeric(38)"
+  :onset_delay_seconds            "numeric(38)"
+  :body_sys_j                     "varchar(999)"
+  :code_status_j                  "numeric(38)"
+  :desc_coded_j                   "varchar(999)"
+  :desc_reptd_j                   "varchar(999)"
+  :hlgt_j                         "varchar(999)"
+  :hlt_j                          "varchar(999)"
+  :inc_code_j                     "varchar(99)"
+  :inc_term_j                     "varchar(999)"
+  :pref_term_j                    "varchar(999)"
+  :sc_other_text_j                "varchar(99)"
+  :report_exclusion               "numeric(38)"
+  :reportable                     "numeric(38)"
+  :ud_text_1_j                    "varchar(999)"
+  :ud_text_2_j                    "varchar(999)"
+  :ud_text_3_j                    "varchar(999)"
+  :ud_text_4_j                    "varchar(999)"
+  :ud_text_5_j                    "varchar(999)"
+  :ud_text_6_j                    "varchar(999)"
+  :ud_text_7_j                    "varchar(999)"
+  :ud_text_8_j                    "varchar(999)"
+  :ud_text_9_j                    "varchar(999)"
+  :ud_text_10_j                   "varchar(999)"
+  :ud_text_11_j                   "varchar(999)"
+  :ud_text_12_j                   "varchar(999)"
+  :syn_code_j                     "numeric(38)"
+  :infection                      "numeric(38)"
+  :rpt_exclude_cmt                "varchar(3900)"
+  :rpt_exclude_cmt_j              "varchar(3900)"
+  :dlp_revision_number            "numeric(38)"
+  :revision_delete_flag           "numeric(38)"
+  :deleted_flag                   "numeric(1,0)"
+  :effective_start_date           "date"
+  :effective_end_date             "date"
+}
+
+:rm_case_event_assess
+{
+  :enterprise_id                  "numeric(38)"
+  :case_id                        "numeric(38)"
+  :event_seq_num                  "numeric(38)"
+  :prod_seq_num                   "numeric(38)"
+  :datasheet_id                   "numeric(38)"
+  :license_id                     "numeric(38)"
+  :seq_num                        "numeric(38)"
+  :updated                        "date"
+  :det_listedness_id              "numeric(38)"
+  :rpt_causality_id               "numeric(38)"
+  :det_causality_id               "numeric(38)"
+  :listed_justify                 "varchar(3900)"
+  :cause_justify                  "varchar(3900)"
+  :lam_assessed                   "numeric(12,0)"
+  :deleted                        "date"
+  :causality_assessment           "varchar(99)"
+  :causality_score                "numeric(38)"
+  :source_id                      "numeric(38)"
+  :prt_causality_id               "numeric(38)"
+  :cause_justify_j                "varchar(3900)"
+  :listed_justify_j               "varchar(3900)"
+  :dlp_revision_number            "numeric(38)"
+  :last_update_time               "date"
+  :revision_delete_flag           "numeric(38)"
+  :deleted_flag                   "numeric(1,0)"
+  :effective_start_date           "date"
+  :effective_end_date             "date"
+}
+
+:rm_case_followup
+{
+  :enterprise_id                  "numeric(38)"
+  :case_id                        "numeric(38)"
+  :seq_num                        "numeric(38)"
+  :receipt_date                   "date"
+  :safety_date                    "date"
+  :significant                    "numeric(1,0)"
+  :auditlog_type                  "numeric(38)"
+  :time_stamp                     "date"
+  :deleted                        "date"
+  :significant_device             "numeric(1,0)"
+  :data_cleanup                   "numeric(1,0)"
+  :justification                  "varchar(3900)"
+  :justification_id               "numeric(38)"
+  :justification_j                "varchar(3900)"
+  :just_receipt_date_j            "varchar(3900)"
+  :receipt_date_j                 "date"
+  :dlp_revision_number            "numeric(38)"
+  :revision_delete_flag           "numeric(38)"
+  :deleted_flag                   "numeric(1,0)"
+  :effective_start_date           "date"
+  :effective_end_date             "date"
+}
+
+:rm_case_master
+{
+  :enterprise_id                  "numeric(38)"
+  :case_id                        "numeric(38)"
+  :case_num                       "varchar(99)"
+  :rev                            "numeric(38)"
+  :workflow_seq_num               "numeric(38)"
+  :last_workflow_seq_num          "numeric(38)"
+  :create_time                    "date"
+  :init_rept_date                 "date"
+  :user_id                        "numeric(38)"
+  :last_update_time               "date"
+  :last_update_user_id            "numeric(38)"
+  :requires_followup              "numeric(38)"
+  :followup_date                  "date"
+  :owner_id                       "numeric(38)"
+  :state_id                       "numeric(38)"
+  :country_id                     "numeric(38)"
+  :lang_id                        "numeric(38)"
+  :priority                       "numeric(38)"
+  :site_id                        "numeric(38)"
+  :seriousness                    "numeric(38)"
+  :rpt_type_id                    "numeric(38)"
+  :last_state_id                  "numeric(38)"
+  :assessment_needed              "numeric(38)"
+  :priority_override              "numeric(1,0)"
+  :sid                            "varchar(999)"
+  :safety_date                    "date"
+  :normal_time                    "date"
+  :max_time                       "date"
+  :report_scheduling              "numeric(38)"
+  :priority_assessment            "numeric(38)"
+  :close_user_id                  "numeric(38)"
+  :close_date                     "date"
+  :close_notes                    "varchar(999)"
+  :date_locked                    "date"
+  :ud_text_1                      "varchar(999)"
+  :ud_text_2                      "varchar(999)"
+  :ud_text_3                      "varchar(999)"
+  :ud_text_4                      "varchar(999)"
+  :ud_text_5                      "varchar(999)"
+  :ud_text_6                      "varchar(999)"
+  :ud_text_7                      "varchar(999)"
+  :ud_text_8                      "varchar(999)"
+  :ud_text_9                      "varchar(999)"
+  :ud_text_10                     "varchar(999)"
+  :ud_text_11                     "varchar(999)"
+  :ud_text_12                     "varchar(999)"
+  :ud_date_1                      "date"
+  :ud_date_2                      "date"
+  :ud_date_3                      "date"
+  :ud_date_4                      "date"
+  :ud_date_5                      "date"
+  :ud_date_6                      "date"
+  :ud_date_7                      "date"
+  :ud_date_8                      "date"
+  :ud_date_9                      "date"
+  :ud_date_10                     "date"
+  :ud_date_11                     "date"
+  :ud_date_12                     "date"
+  :ud_number_1                    "numeric(30,10)"
+  :ud_number_2                    "numeric(30,10)"
+  :ud_number_3                    "numeric(30,10)"
+  :ud_number_4                    "numeric(30,10)"
+  :ud_number_5                    "numeric(30,10)"
+  :ud_number_6                    "numeric(30,10)"
+  :ud_number_7                    "numeric(30,10)"
+  :ud_number_8                    "numeric(30,10)"
+  :ud_number_9                    "numeric(30,10)"
+  :ud_number_10                   "numeric(30,10)"
+  :ud_number_11                   "numeric(30,10)"
+  :ud_number_12                   "numeric(30,10)"
+  :deleted                        "date"
+  :due_soon                       "date"
+  :global_num                     "varchar(99)"
+  :priority_date_assessed         "date"
+  :lam_assess_done                "numeric(1,0)"
+  :e2b_ww_number                  "varchar(999)"
+  :worklist_owner_id              "numeric(38)"
+  :susar                          "numeric(38)"
+  :last_update_event              "date"
+  :initial_justification          "varchar(3900)"
+  :force_soon                     "date"
+  :due_soon_j                     "date"
+  :followup_date_j                "date"
+  :init_rept_date_j               "date"
+  :just_init_rept_date_j          "varchar(3900)"
+  :ud_text_1_j                    "varchar(999)"
+  :ud_text_2_j                    "varchar(999)"
+  :ud_text_3_j                    "varchar(999)"
+  :ud_text_4_j                    "varchar(999)"
+  :ud_text_5_j                    "varchar(999)"
+  :ud_text_6_j                    "varchar(999)"
+  :ud_text_7_j                    "varchar(999)"
+  :ud_text_8_j                    "varchar(999)"
+  :ud_text_9_j                    "varchar(999)"
+  :ud_text_10_j                   "varchar(999)"
+  :ud_text_11_j                   "varchar(999)"
+  :ud_text_12_j                   "varchar(999)"
+  :initial_justification_j        "varchar(3900)"
+  :dlp_revision_number            "numeric(38)"
+  :revision_delete_flag           "numeric(38)"
+  :deleted_flag                   "numeric(1,0)"
+  :effective_start_date           "date"
+  :effective_end_date             "date"
+}
+
+:rm_case_narrative
+{
+  :enterprise_id                  "numeric(38)"
+  :case_id                        "numeric(38)"
+  :abbrev_narrative               "varchar(3900)"
+  :abbrev_narrative_j             "varchar(3900)"
+  :narrative                      "varchar(3900)"
+  :narrative_j                    "varchar(3900)"
+  :deleted                        "date"
+  :dlp_revision_number            "numeric(38)"
+  :revision_delete_flag           "numeric(38)"
+  :deleted_flag                   "numeric(1,0)"
+  :effective_start_date           "date"
+  :effective_end_date             "date"
+}
+
+:rm_case_pat_info
+{
+  :enterprise_id                  "numeric(38)"
+  :case_id                        "numeric(38)"
+  :pat_id                         "varchar(99)"
+  :pat_subj_num                   "varchar(99)"
+  :pat_initials                   "varchar(99)"
+  :pat_firstname                  "varchar(99)"
+  :pat_mi                         "varchar(99)"
+  :pat_lastname                   "varchar(99)"
+  :pat_address                    "varchar(999)"
+  :pat_city                       "varchar(99)"
+  :pat_state                      "varchar(99)"
+  :pat_postal_code                "varchar(99)"
+  :pat_country                    "varchar(99)"
+  :pat_phone                      "varchar(99)"
+  :pat_dob                        "date"
+  :pat_dob_res                    "numeric(38)"
+  :pat_age                        "numeric(22,7)"
+  :age_unit_id                    "numeric(38)"
+  :age_group_id                   "numeric(38)"
+  :gender_id                      "numeric(38)"
+  :pat_weight_lbs                 "numeric(22,7)"
+  :pat_weight_kg                  "numeric(22,7)"
+  :pat_height_in                  "numeric(22,7)"
+  :pat_height_cm                  "numeric(22,7)"
+  :ethnicity_id                   "numeric(38)"
+  :occupation_id                  "numeric(38)"
+  :pat_stat_preg                  "numeric(38)"
+  :rel_test_id                    "numeric(38)"
+  :pat_dob_partial                "varchar(99)"
+  :rand_num                       "varchar(99)"
+  :confidential                   "numeric(1,0)"
+  :number_of_patients             "varchar(9)"
+  :ud_text_1                      "varchar(999)"
+  :ud_text_2                      "varchar(999)"
+  :ud_text_3                      "varchar(999)"
+  :ud_text_4                      "varchar(999)"
+  :ud_text_5                      "varchar(999)"
+  :ud_text_6                      "varchar(999)"
+  :ud_text_7                      "varchar(999)"
+  :ud_text_8                      "varchar(999)"
+  :ud_text_9                      "varchar(999)"
+  :ud_text_10                     "varchar(999)"
+  :ud_text_11                     "varchar(999)"
+  :ud_text_12                     "varchar(999)"
+  :ud_date_1                      "date"
+  :ud_date_2                      "date"
+  :ud_date_3                      "date"
+  :ud_date_4                      "date"
+  :ud_date_5                      "date"
+  :ud_date_6                      "date"
+  :ud_date_7                      "date"
+  :ud_date_8                      "date"
+  :ud_date_9                      "date"
+  :ud_date_10                     "date"
+  :ud_date_11                     "date"
+  :ud_date_12                     "date"
+  :ud_number_1                    "numeric(30,10)"
+  :ud_number_2                    "numeric(30,10)"
+  :ud_number_3                    "numeric(30,10)"
+  :ud_number_4                    "numeric(30,10)"
+  :ud_number_5                    "numeric(30,10)"
+  :ud_number_6                    "numeric(30,10)"
+  :ud_number_7                    "numeric(30,10)"
+  :ud_number_8                    "numeric(30,10)"
+  :ud_number_9                    "numeric(30,10)"
+  :ud_number_10                   "numeric(30,10)"
+  :ud_number_11                   "numeric(30,10)"
+  :ud_number_12                   "numeric(30,10)"
+  :deleted                        "date"
+  :child_only                     "numeric(1,0)"
+  :pat_bmi                        "numeric(22,7)"
+  :pat_body_area                  "numeric(22,7)"
+  :pat_address_j                  "varchar(999)"
+  :pat_city_j                     "varchar(99)"
+  :pat_firstname_j                "varchar(99)"
+  :pat_lastname_j                 "varchar(99)"
+  :pat_mi_j                       "varchar(99)"
+  :pat_state_j                    "varchar(99)"
+  :ud_text_1_j                    "varchar(999)"
+  :ud_text_2_j                    "varchar(999)"
+  :ud_text_3_j                    "varchar(999)"
+  :ud_text_4_j                    "varchar(999)"
+  :ud_text_5_j                    "varchar(999)"
+  :ud_text_6_j                    "varchar(999)"
+  :ud_text_7_j                    "varchar(999)"
+  :ud_text_8_j                    "varchar(999)"
+  :ud_text_9_j                    "varchar(999)"
+  :ud_text_10_j                   "varchar(999)"
+  :ud_text_11_j                   "varchar(999)"
+  :ud_text_12_j                   "varchar(999)"
+  :pat_country_id                 "numeric(38)"
+  :dlp_revision_number            "numeric(38)"
+  :revision_delete_flag           "numeric(38)"
+  :deleted_flag                   "numeric(1,0)"
+  :effective_start_date           "date"
+  :effective_end_date             "date"
+  :notes                          "varchar(3900)"
+  :notes_j                        "varchar(3900)"
+  :age_unit_id_at_vacc            "numeric(38)"
+  :pat_age_at_vacc                "numeric(38)"
+}
+
+:rm_case_prod_drugs
+{
+  :enterprise_id                  "numeric(38)"
+  :case_id                        "numeric(38)"
+  :seq_num                        "numeric(38)"
+  :formulation_id                 "numeric(38)"
+  :concentration                  "varchar(99)"
+  :conc_units_id                  "numeric(38)"
+  :act_taken_id                   "numeric(38)"
+  :severity_id                    "numeric(38)"
+  :interaction                    "numeric(38)"
+  :contraind                      "numeric(38)"
+  :first_dose                     "date"
+  :first_dose_res                 "numeric(38)"
+  :last_dose                      "date"
+  :last_dose_res                  "numeric(38)"
+  :total_dose                     "numeric(22,7)"
+  :tot_dose_unit_id               "numeric(38)"
+  :prev_use                       "numeric(38)"
+  :abuse                          "numeric(38)"
+  :overdose                       "numeric(38)"
+  :protocol                       "numeric(38)"
+  :dechallenge                    "numeric(38)"
+  :dechall_date                   "date"
+  :rechallenge                    "numeric(38)"
+  :rechall_start                  "date"
+  :rechall_stop                   "date"
+  :rechall_outcome                "numeric(38)"
+  :sort_id                        "numeric(38)"
+  :b_weight_grams                 "numeric(38)"
+  :n_siblings                     "numeric(38)"
+  :b_weight_ozs                   "numeric(38)"
+  :first_dose_partial             "varchar(99)"
+  :last_dose_partial              "varchar(99)"
+  :tampering                      "numeric(4,0)"
+  :cumulative_dose                "numeric(22,7)"
+  :cumulative_dose_unit           "varchar(99)"
+  :deleted                        "date"
+  :ud_text_1                      "varchar(999)"
+  :ud_text_2                      "varchar(999)"
+  :ud_text_3                      "varchar(999)"
+  :ud_text_4                      "varchar(999)"
+  :ud_text_5                      "varchar(999)"
+  :ud_text_6                      "varchar(999)"
+  :ud_text_7                      "varchar(999)"
+  :ud_text_8                      "varchar(999)"
+  :ud_text_9                      "varchar(999)"
+  :ud_text_10                     "varchar(999)"
+  :ud_text_11                     "varchar(999)"
+  :ud_text_12                     "varchar(999)"
+  :ud_date_1                      "date"
+  :ud_date_2                      "date"
+  :ud_date_3                      "date"
+  :ud_date_4                      "date"
+  :ud_date_5                      "date"
+  :ud_date_6                      "date"
+  :ud_date_7                      "date"
+  :ud_date_8                      "date"
+  :ud_date_9                      "date"
+  :ud_date_10                     "date"
+  :ud_date_11                     "date"
+  :ud_date_12                     "date"
+  :ud_number_1                    "numeric(30,10)"
+  :ud_number_2                    "numeric(30,10)"
+  :ud_number_3                    "numeric(30,10)"
+  :ud_number_4                    "numeric(30,10)"
+  :ud_number_5                    "numeric(30,10)"
+  :ud_number_6                    "numeric(30,10)"
+  :ud_number_7                    "numeric(30,10)"
+  :ud_number_8                    "numeric(30,10)"
+  :ud_number_9                    "numeric(30,10)"
+  :ud_number_10                   "numeric(30,10)"
+  :ud_number_11                   "numeric(30,10)"
+  :ud_number_12                   "numeric(30,10)"
+  :cumulative_dose_unit_id        "numeric(38)"
+  :obtain_drug_country_id         "numeric(38)"
+  :drug_auth_country_id           "numeric(38)"
+  :duration_seconds               "numeric(38)"
+  :latency_seconds                "numeric(38)"
+  :delay_seconds                  "numeric(38)"
+  :ud_text_1_j                    "varchar(999)"
+  :ud_text_2_j                    "varchar(999)"
+  :ud_text_3_j                    "varchar(999)"
+  :ud_text_4_j                    "varchar(999)"
+  :ud_text_5_j                    "varchar(999)"
+  :ud_text_6_j                    "varchar(999)"
+  :ud_text_7_j                    "varchar(999)"
+  :ud_text_8_j                    "varchar(999)"
+  :ud_text_9_j                    "varchar(999)"
+  :ud_text_10_j                   "varchar(999)"
+  :ud_text_11_j                   "varchar(999)"
+  :ud_text_12_j                   "varchar(999)"
+  :dlp_revision_number            "numeric(38)"
+  :revision_delete_flag           "numeric(38)"
+  :deleted_flag                   "numeric(1,0)"
+  :effective_start_date           "date"
+  :effective_end_date             "date"
+}
+
+:rm_case_product
+{
+  :enterprise_id                  "numeric(38)"
+  :case_id                        "numeric(38)"
+  :seq_num                        "numeric(38)"
+  :product_id                     "numeric(38)"
+  :drug_type                      "numeric(38)"
+  :pat_exposure                   "numeric(38)"
+  :manufacturer_id                "numeric(38)"
+  :protocol_followed              "numeric(38)"
+  :first_sus_prod                 "numeric(38)"
+  :selected_view                  "numeric(38)"
+  :sort_id                        "numeric(38)"
+  :views_available                "numeric(38)"
+  :country_id                     "numeric(38)"
+  :qc_safety_date                 "date"
+  :qc_sent_date                   "date"
+  :qc_result_date                 "date"
+  :qc_cross_reference             "varchar(99)"
+  :who_drug_code                  "varchar(99)"
+  :co_drug_code                   "varchar(99)"
+  :product_name                   "varchar(99)"
+  :generic_name                   "varchar(3900)"
+  :generic_name_j                 "varchar(3900)"
+  :ud_text_1                      "varchar(999)"
+  :ud_text_2                      "varchar(999)"
+  :ud_text_3                      "varchar(999)"
+  :ud_text_4                      "varchar(999)"
+  :ud_text_5                      "varchar(999)"
+  :ud_text_6                      "varchar(999)"
+  :ud_text_7                      "varchar(999)"
+  :ud_text_8                      "varchar(999)"
+  :ud_text_9                      "varchar(999)"
+  :ud_text_10                     "varchar(999)"
+  :ud_text_11                     "varchar(999)"
+  :ud_text_12                     "varchar(999)"
+  :ud_date_1                      "date"
+  :ud_date_2                      "date"
+  :ud_date_3                      "date"
+  :ud_date_4                      "date"
+  :ud_date_5                      "date"
+  :ud_date_6                      "date"
+  :ud_date_7                      "date"
+  :ud_date_8                      "date"
+  :ud_date_9                      "date"
+  :ud_date_10                     "date"
+  :ud_date_11                     "date"
+  :ud_date_12                     "date"
+  :ud_number_1                    "numeric(30,10)"
+  :ud_number_2                    "numeric(30,10)"
+  :ud_number_3                    "numeric(30,10)"
+  :ud_number_4                    "numeric(30,10)"
+  :ud_number_5                    "numeric(30,10)"
+  :ud_number_6                    "numeric(30,10)"
+  :ud_number_7                    "numeric(30,10)"
+  :ud_number_8                    "numeric(30,10)"
+  :ud_number_9                    "numeric(30,10)"
+  :ud_number_10                   "numeric(30,10)"
+  :ud_number_11                   "numeric(30,10)"
+  :ud_number_12                   "numeric(30,10)"
+  :include_frequency              "numeric(38)"
+  :sdrug_not_admin                "numeric(38)"
+  :prod_reptd                     "varchar(999)"
+  :prod_coded                     "varchar(999)"
+  :prod_syn_id                    "numeric(38)"
+  :prod_code_status               "numeric(3,0)"
+  :deleted                        "date"
+  :study_product_num              "numeric(2,0)"
+  :qc_quantity                    "varchar(99)"
+  :qc_return_date                 "date"
+  :qc_complaint_cat_date          "date"
+  :qc_analysis_cat_date           "date"
+  :qc_analysis_summary_date       "date"
+  :primary_event                  "numeric(38)"
+  :medicinal_prod_id              "varchar(99)"
+  :family_id                      "numeric(38)"
+  :existing_rpt_seq_mod_flg       "numeric(38)"
+  :drug_code_j                    "varchar(99)"
+  :drug_code_type_j               "numeric(38)"
+  :product_name_j                 "varchar(99)"
+  :prod_coded_j                   "varchar(999)"
+  :prod_reptd_j                   "varchar(999)"
+  :qc_cross_reference_j           "varchar(99)"
+  :ud_text_1_j                    "varchar(999)"
+  :ud_text_2_j                    "varchar(999)"
+  :ud_text_3_j                    "varchar(999)"
+  :ud_text_4_j                    "varchar(999)"
+  :ud_text_5_j                    "varchar(999)"
+  :ud_text_6_j                    "varchar(999)"
+  :ud_text_7_j                    "varchar(999)"
+  :ud_text_8_j                    "varchar(999)"
+  :ud_text_9_j                    "varchar(999)"
+  :ud_text_10_j                   "varchar(999)"
+  :ud_text_11_j                   "varchar(999)"
+  :ud_text_12_j                   "varchar(999)"
+  :dlp_revision_number            "numeric(38)"
+  :last_update_time               "date"
+  :revision_delete_flag           "numeric(38)"
+  :deleted_flag                   "numeric(1,0)"
+  :effective_start_date           "date"
+  :effective_end_date             "date"
+  :notes                          "varchar(3900)"
+  :notes_j                        "varchar(3900)"
+  :qc_analysis_cat_text           "varchar(3900)"
+  :qc_analysis_cat_text_j         "varchar(3900)"
+  :qc_anal_summary_text           "varchar(3900)"
+  :qc_anal_summary_text_j         "varchar(3900)"
+  :qc_result                      "varchar(3900)"
+  :qc_result_j                    "varchar(3900)"
+  :qc_comment                     "varchar(3900)"
+  :qc_comment_j                   "varchar(3900)"
+  :qc_complaint_cat_text          "varchar(3900)"
+  :qc_complaint_cat_text_j        "varchar(3900)"
+  :vaers_block_id                 "numeric(38)"
+  :prod_lic_id                    "numeric(38)"
+}
+
+:rm_case_reporters
+{
+  :enterprise_id                  "numeric(38)"
+  :case_id                        "numeric(38)"
+  :seq_num                        "numeric(38)"
+  :media_id                       "numeric(38)"
+  :occupation_id                  "numeric(38)"
+  :hcp_flag                       "numeric(38)"
+  :primary_contact                "numeric(38)"
+  :corr_contact                   "numeric(38)"
+  :reporter_type                  "numeric(38)"
+  :intermediary_id                "numeric(38)"
+  :rpt_sent                       "numeric(38)"
+  :sort_id                        "numeric(38)"
+  :confidential                   "numeric(1,0)"
+  :country_id                     "numeric(38)"
+  :suffix                         "varchar(99)"
+  :middle_name                    "varchar(99)"
+  :prefix                         "varchar(99)"
+  :first_name                     "varchar(99)"
+  :last_name                      "varchar(99)"
+  :reporter_id                    "varchar(99)"
+  :institution                    "varchar(99)"
+  :department                     "varchar(99)"
+  :city                           "varchar(99)"
+  :state                          "varchar(99)"
+  :postcode                       "varchar(99)"
+  :country                        "varchar(99)"
+  :phone                          "varchar(99)"
+  :altphone                       "varchar(99)"
+  :fax                            "varchar(99)"
+  :reporter_ref                   "varchar(99)"
+  :email                          "varchar(999)"
+  :address                        "varchar(999)"
+  :suffix_j                       "varchar(99)"
+  :address_j                      "varchar(999)"
+  :city_j                         "varchar(99)"
+  :department_j                   "varchar(99)"
+  :first_name_j                   "varchar(99)"
+  :institution_j                  "varchar(99)"
+  :last_name_j                    "varchar(99)"
+  :middle_name_j                  "varchar(99)"
+  :prefix_j                       "varchar(99)"
+  :state_j                        "varchar(99)"
+  :deleted                        "date"
+  :dlp_revision_number            "numeric(38)"
+  :revision_delete_flag           "numeric(38)"
+  :deleted_flag                   "numeric(1,0)"
+  :effective_start_date           "date"
+  :effective_end_date             "date"
+  :notes                          "varchar(3900)"
+  :notes_j                        "varchar(3900)"
+  :institution_id                 "varchar(99)"
+}
+
+:rm_case_study
+{
+  :enterprise_id                  "numeric(38)"
+  :case_id                        "numeric(38)"
+  :study_key                      "numeric(38)"
+  :study_num                      "varchar(99)"
+  :study_type                     "numeric(38)"
+  :center_id                      "numeric(38)"
+  :center_name                    "varchar(99)"
+  :protocol_id                    "numeric(38)"
+  :protocol_num                   "varchar(99)"
+  :other_id                       "varchar(99)"
+  :code_broken                    "numeric(38)"
+  :broken_by                      "numeric(38)"
+  :broken_date                    "date"
+  :reason                         "varchar(999)"
+  :week                           "varchar(9)"
+  :visit                          "varchar(9)"
+  :deleted                        "date"
+  :product_count                  "numeric(2,0)"
+  :classification_id              "numeric(38)"
+  :blind_name                     "varchar(99)"
+  :study_desc                     "varchar(3900)"
+  :study_desc_j                   "varchar(3900)"
+  :blind_name_j                   "varchar(99)"
+  :center_name_j                  "varchar(99)"
+  :clin_compound_num_j            "varchar(99)"
+  :protocol_num_j                 "varchar(99)"
+  :study_num_j                    "varchar(99)"
+  :dev_phase_id                   "numeric(38)"
+  :dlp_revision_number            "numeric(38)"
+  :revision_delete_flag           "numeric(38)"
+  :deleted_flag                   "numeric(1,0)"
+  :effective_start_date           "date"
+  :effective_end_date             "date"
+  :cohort_id                      "numeric(38)"
+}
+
+:rm_lm_case_classification
+{
+  :enterprise_id                  "numeric(38)"
+  :classification_id              "numeric(38)"
+  :description                    "varchar(99)"
+  :protected                      "numeric(38)"
+  :display                        "numeric(38)"
+  :description_j                  "varchar(99)"
+  :deleted                        "date"
+  :e2b_code                       "numeric(38)"
+}
+
+:rm_lm_causality
+{
+  :enterprise_id                  "numeric(38)"
+  :causality_id                   "numeric(38)"
+  :causality                      "varchar(99)"
+  :reportability                  "numeric(38)"
+  :protected                      "numeric(38)"
+  :display                        "numeric(38)"
+  :causality_j                    "varchar(99)"
+  :deleted                        "date"
+}
+
+:rm_lm_countries
+{
+  :enterprise_id                  "numeric(38)"
+  :country_id                     "numeric(38)"
+  :country                        "varchar(99)"
+  :a2                             "varchar(9)"
+  :a3                             "varchar(9)"
+  :num                            "numeric(38)"
+  :protected                      "numeric(38)"
+  :deleted                        "date"
+  :country_group_id               "numeric(38)"
+  :country_group                  "varchar(99)"
+  :country_j                      "varchar(99)"
+  :group_2_country                "numeric(38)"
+}
+
+:rm_lm_product
+{
+  :enterprise_id                  "numeric(38)"
+  :product_id                     "numeric(38)"
+  :prod_name                      "varchar(99)"
+  :family_id                      "numeric(38)"
+  :formulation_id                 "numeric(38)"
+  :manufacturer_id                "numeric(38)"
+  :concentration                  "varchar(99)"
+  :conc_unit_id                   "numeric(38)"
+  :indication_id                  "varchar(99)"
+  :code_dict                      "numeric(38)"
+  :indication_text                "varchar(999)"
+  :intl_birth_date                "date"
+  :model_no                       "varchar(99)"
+  :drl_id                         "varchar(99)"
+  :drug_code                      "varchar(99)"
+  :deleted                        "date"
+  :prod_generic_name              "varchar(3900)"
+  :prod_generic_name_j            "varchar(3900)"
+  :ind_llt_code                   "varchar(99)"
+  :ind_llt                        "varchar(999)"
+  :ind_hlt_code                   "varchar(99)"
+  :ind_hlt                        "varchar(999)"
+  :ind_hlgt_code                  "varchar(99)"
+  :ind_hlgt                       "varchar(999)"
+  :ind_soc_code                   "varchar(99)"
+  :ind_soc                        "varchar(999)"
+  :ind_syn_code                   "numeric(38)"
+  :ind_code_status                "numeric(38)"
+  :medicinal_prod_id              "varchar(99)"
+  :prod_name_abbrv                "varchar(9)"
+  :device_code                    "varchar(99)"
+  :psur_group_name                "varchar(99)"
+  :comments                       "varchar(3900)"
+  :ind_coded                      "varchar(999)"
+  :ind_reptd                      "varchar(999)"
+  :drl_id_j                       "varchar(99)"
+  :drug_code_j                    "varchar(99)"
+  :drug_code_type_j               "numeric(38)"
+  :indication_text_j              "varchar(999)"
+  :ind_code_status_j              "numeric(38)"
+  :ind_hlgt_j                     "varchar(999)"
+  :ind_hlt_j                      "varchar(999)"
+  :ind_llt_code_j                 "varchar(99)"
+  :ind_llt_j                      "varchar(999)"
+  :ind_soc_j                      "varchar(999)"
+  :prod_name_j                    "varchar(99)"
+  :ind_syn_code_j                 "numeric(38)"
+  :ind_coded_j                    "varchar(999)"
+  :ind_reptd_j                    "varchar(999)"
+  :dev_intl_birth_date            "date"
+  :comments_j                     "varchar(3900)"
+}
+
+:rm_lm_product_family
+{
+  :enterprise_id                  "numeric(38)"
+  :family_id                      "numeric(38)"
+  :name                           "varchar(99)"
+  :primary_view                   "numeric(38)"
+  :deleted                        "date"
+  :product_group_id               "numeric(38)"
+  :comments                       "varchar(3900)"
+  :search_equation_number         "varchar(99)"
+  :name_j                         "varchar(99)"
+  :comments_j                     "varchar(3900)"
+}
+
+:rm_lm_report_type
+{
+  :enterprise_id                  "numeric(38)"
+  :rpt_type_id                    "numeric(38)"
+  :report_type                    "varchar(99)"
+  :protected                      "numeric(38)"
+  :display                        "numeric(38)"
+  :incl_lit                       "numeric(38)"
+  :incl_trial                     "numeric(38)"
+  :e2b_code                       "numeric(38)"
+  :abrv                           "varchar(9)"
+  :investigational                "numeric(38)"
+  :report_type_j                  "varchar(99)"
+  :deleted                        "date"
+  :incl_research                  "numeric(38)"
+}
+
+:rm_meddra_smq_content
+{
+  :global_dict_id                 "numeric(38)"
+  :smq_code                       "numeric(38)"
+  :term_code                      "numeric(38)"
+  :term_level                     "numeric(38)"
+  :term_scope                     "numeric(38)"
+  :term_category                  "varchar(9)"
+  :term_weight                    "numeric(38)"
+  :term_status                    "varchar(9)"
+  :term_addition_version          "varchar(9)"
+  :term_last_modified_version     "varchar(9)"
+}
+
+:rm_meddra_smq_list
+{
+  :global_dict_id                 "numeric(38)"
+  :smq_code                       "numeric(38)"
+  :smq_name                       "varchar(999)"
+  :smq_level                      "numeric(38)"
+  :smq_description                "varchar(3900)"
+  :smq_source                     "varchar(3900)"
+  :smq_note                       "varchar(3900)"
+  :meddra_version                 "varchar(9)"
+  :status                         "varchar(9)"
+  :smq_algorithm                  "varchar(999)"
+}


Add layout with explanations

Add layout with explanations

--- src/cljs/codejam_practice_solutions/core.cljs
+++ src/cljs/codejam_practice_solutions/core.cljs
@@ -3,23 +3,23 @@
             [quil.middleware :as m]
             [codejam-practice-solutions.practice.b-always-turn-left :as maze]
             [reagent.core :as reagent :refer [atom]]
+            [clojure.string]
             [schema.core :as s :include-macros true]))

 (enable-console-print!)

-(def AppState {(s/required-key :route) s/Str
-               (s/required-key :maze) maze/Labyrinth})
-
-(def app-state (atom {:available-routes ["WWWWWWWLW WLWWWRRWWWWWWWWWW"
-                                         "WRWWLWWLWWLWLWRRWRWWWRWWRWLW WWRRWLWLWWLWWLWWRWWRWWLW"
-                                         (str "WWLWLWRRWRWWLW"
-                                              "WWLWLWWRRWLWLWRRWWLW " ; space
-                                              "WRWLWLWRWRWWLWWLWLWRWRWW"
-                                              "RRWWLWLWRWLWLWRRWRWLWLWW"
-                                              "LWWWRRWWWRWLWLWRRWRWLWLW"
-                                              "RRWWLWLWWRRWWLWLWWRRWLWLWW")]
-                      :route "WWWWWWWLW WLWWWRRWWWWWWWWWW"
-                      :labyrinth nil}))
+(defonce app-state
+  (atom {:selected-route-index 0
+         :available-routes ["WWWWWWWLW WLWWWRRWWWWWWWWWW"
+                            "WRWWLWWLWWLWLWRRWRWWWRWWRWLW WWRRWLWLWWLWWLWWRWWRWWLW"
+                            (str "WWLWLWRRWRWWLW"
+                                 "WWLWLWWRRWLWLWRRWWLW " ; space
+                                 "WRWLWLWRWRWWLWWLWLWRWRWW"
+                                 "RRWWLWLWRWLWLWRRWRWLWLWW"
+                                 "LWWWRRWWWRWLWLWRRWRWLWLW"
+                                 "RRWWLWLWWRRWWLWLWWRRWLWLWW")]
+         :route "WWWWWWWLW WLWWWRRWWWWWWWWWW"
+         :labyrinth nil}))

 (defn main [])

@@ -28,7 +28,6 @@
         width 10]
     (+ margin-from-edge
        (* width n))))
-(map maze-pos->canvas-pos (range 10))

 (s/defn draw-player [{:keys [x y]} :- maze/Player]
   (q/rect (+ 2 (maze-pos->canvas-pos x))
@@ -47,35 +46,124 @@
   (doall (map draw-cell
               (maze/get-cells-with-coordinates rows))))

-(s/defn draw [labyrinth :- maze/Labyrinth]
+(defn draw [app-state]
   (q/background 200 200 200)
-  (draw-player (:player labyrinth))
-  (draw-cells (get-in labyrinth [:maze])))
+  (draw-player (get-in @app-state [:labyrinth :player]))
+  (draw-cells (get-in @app-state [:labyrinth :maze])))

-(s/defn change-route [app-state
-                      new-route :- s/Str]
-  (swap! app-state assoc-in [:route] new-route)
-  (swap! app-state update-in [:labyrinth]
-         #(maze/solve-debug new-route)))
+(defn change-route [app-state new-route-index]
+  (let [new-route (nth (:available-routes @app-state)
+                       new-route-index)]
+    (swap! app-state
+           #(some-> %
+                    (assoc-in [:route] new-route)
+                    (assoc-in [:selected-route-index] new-route-index)
+                    (assoc-in [:labyrinth] (maze/solve-debug new-route))))))

 (defn setup [app-state]
-  (change-route app-state (:route @app-state))
-  (q/frame-rate 1))
+  (change-route app-state 0)
+  (q/frame-rate 2))
+
+(defn read-input-file
+  "app-state must be an atom, not a deref'ed thing"
+  [input app-state]
+  (let [file (aget (. input -files) 0)
+        update-available-routes
+        #(let [contents (clojure.string/split-lines
+                         (.. % -target -result))]
+           (print "updating :available-routes to" contents)
+           (swap! app-state assoc-in [:available-routes] contents))
+
+        reader (doto (js/FileReader.)
+                 (set! -onload update-available-routes)
+                 (set! -onerror #(js/alert %)))]
+    (.readAsText reader file)))
+
+(defn get-current-route [app-state]
+  (nth (:available-routes @app-state)
+       (:selected-route-index @app-state)))
+
+(defn get-current-route-in-direction [app-state direction]
+  (let [[forward backward] (clojure.string/split
+                            (get-current-route app-state) #" ")]
+    (case direction
+      :forward forward
+      :backward backward)))
+
+(defn next-route [app-state]
+  (let [routes (:available-routes @app-state)
+        new-route-index (min (inc (:selected-route-index
+                                   @app-state))
+                             (dec (count routes)))]
+    (change-route app-state new-route-index)))
+
+(defn previous-route [app-state]
+  (let [routes (:available-routes @app-state)
+        new-route-index (max (dec (:selected-route-index @app-state))
+                             0)]
+    (change-route app-state new-route-index)))
+
+(defn input-controls []
+  [:div
+   [:div.row
+    [:div.col-xs-12
+     [:p "The goal is to walk through a labyrinth, then walk back, and report what the labyrinth looks like."]
+     [:p "Rules for solving:"
+      [:ul
+       [:li "You get a route from the start to the end of the labyrinth"]
+       [:li "You can only turn left"]
+       [:li "If you can turn left at any point you must turn"]
+       [:li "If you can't turn left you must walk forward"]]]]]
+   [:div.row
+    [:div.col-xs-2
+     [:p "Input file:"]]
+    [:div.col-xs-10
+     [:input#input-file
+      {:type "file"
+       :on-change #(this-as me
+                            (-> me
+                                .getDOMNode
+                                (read-input-file app-state)))}]]]
+   [:div.row
+    [:div.col-xs-12
+
+     [:p
+      "Route "
+      [:span.glyphicon.glyphicon-chevron-left
+       {:on-click #(previous-route app-state)}]
+      (inc (:selected-route-index @app-state))
+      " / "
+      (count (:available-routes @app-state))
+      [:span.glyphicon.glyphicon-chevron-right
+       {:on-click #(next-route app-state)}]]]]
+   [:div.row
+    [:div.col-xs-2
+     [:p "Length: " (count (get-current-route app-state))]]
+    [:div.col-xs-10
+     [:div.row [:p "Forward"]]
+     [:div.row
+      [:textarea {:value (get-current-route-in-direction app-state :forward)
+                  :cols 50
+                  :read-only true}]]
+     [:div.row [:p "Backward"]]
+     [:div.row
+      [:textarea {:value (get-current-route-in-direction app-state :backward)
+                  :cols 50
+                  :read-only true}]]]]])

 (defn main-component []
-  [:div
-   [:canvas#canvas]
-   [:p "Route"
-    [:select
-     {:on-change #(change-route app-state
-                                (.. % -currentTarget -value))}
-     (for [route (get-in @app-state [:available-routes])]
-       [:option route])]]])
+  [:div.container
+   [:div.jumbotron
+    [:p "Visualize a labyrinth"]]
+   [:div.row
+    [:div.col-xs-5 [:canvas#canvas]]
+    [:div.col-xs-7
+     [input-controls]]]])

 (reagent/render main-component (js/document.getElementById "app"))

 (q/defsketch my-sketch
   :host "canvas"
   :setup #(setup app-state)
-  :draw #(draw (:labyrinth @app-state))
-  :size [300 300])
+  :draw #(draw app-state)
+  :size [400 400])


wip: team-player as component

wip: team-player as component

--- src/cljs/foosball/locations/report_match.cljs
+++ src/cljs/foosball/locations/report_match.cljs
@@ -67,20 +67,30 @@
                                            :placeholder "0"
                                            :input-props {:type "number"}}})]]))))

-(defn render-team-player [report-match players team-path num change-ch]
-  (let [player-selector (keyword (str "player" num))
-        team            (get-in report-match team-path)]
-    [:div.form-group
-     [:label.control-label.col-lg-4 (str "Player " num)]
-     [:div.controls.col-lg-8
-      (render-players-select report-match players (conj team-path player-selector) change-ch)]]))
+(defn team-player-component [{:keys [active-players player-num] :as team} owner {:keys [change-ch]}]
+  (reify
+    om/IRender
+    (render [_]
+      (html
+       (let [player-selector (keyword (str "player" player-num))]
+         [:div.form-group
+          [:label.control-label.col-lg-4 (str "Player " player-num)]
+          [:div.controls.col-lg-8
+           (render-players-select team active-players [player-selector] change-ch)]])))))

 (defn team-selector [team-num]
   (keyword (str "team" team-num)))

-(defn- render-team-controls [report-match players team-num {:keys [score player1 player2] :as chans}]
+(defn- render-team-controls [{:keys [report-match active-players] :as app}
+                             team-num
+                             {:keys [score player1 player2] :as chans}]
   (let [team          ((team-selector team-num) report-match)
-        render-player (partial render-team-player report-match players [team-selector])]
+        render-player (fn [num change-ch]
+                        (om/build team-player-component team
+                                  {:opts      {:change-ch change-ch}
+                                   :react-key (str team-selector "-" num)
+                                   :fn        (fn [t] (merge t {:active-players active-players
+                                                               :player-num num}))}))]
     (debug "render team" team)
     [:div.col-lg-5.well.well-lg
      [:h2 (str "Team " team-num ":")]
@@ -125,9 +135,9 @@

 (defn handle-player-update [report-match path player]
   (debug "handle update" path player)
-  (om/update! report-match path player))
+  (om/update! @report-match path player))

-(defn report-match-component [{:keys [players report-match] :as app} owner]
+(defn report-match-component [{:keys [active-players report-match] :as app} owner]
   (reify
     om/IInitState
     (init-state [_]
@@ -153,10 +163,9 @@

     om/IRenderState
     (render-state [_ {:keys [team1 team2]}]
-      (let [active-players (filterv :active players)
-            _  (debug (map (fn [p]  (str "'" (:name p) "'")) (selected-players report-match)))
+      (let [_  (debug (map (fn [p]  (str "'" (:name p) "'")) (selected-players report-match)))
             __ (debug (map (fn [kw] (get-in report-match [kw :score])) [:team1 :team2]))
-            render-team (partial render-team-controls report-match active-players)]
+            render-team (partial render-team-controls app)]
         (html
          [:div
           [:h1 "Report Match Result"]
@@ -180,5 +189,8 @@

 (defn render [app]
   (if (:auth app)
-    (om/build report-match-component app)
+    (om/build report-match-component app
+              {:fn (fn [{:keys [report-match players]}]
+                     {:report-match   report-match
+                      :active-players (filterv :active players)})})
     (spinner)))


Fix unintended mutation

Fix unintended mutation

--- src/clojure/uncomplicate/neanderthal/core.clj
+++ src/clojure/uncomplicate/neanderthal/core.clj
@@ -1309,7 +1309,7 @@
    (if-not (triangular? a)
      (mv 1.0 a x)
      (let-release [res (copy x)]
-       (mv! a x)))))
+       (mv! a res)))))

 (defn rk!
   "Rank-1 update. Multiplies vector `x` with transposed vector `y`, scales the resulting matrix


spacing

spacing

--- src/metabase/api/dataset.clj
+++ src/metabase/api/dataset.clj
@@ -77,7 +77,7 @@
      :headers {"Content-Disposition" (str "attachment; filename=\"query_result_" (u/date->iso-8601) ".json\"")}}
     ;; failed query, send error message
     {:status 500
-     :body   { :error (:error response) }}))
+     :body   {:error (:error response)}}))

 (defendpoint POST "/csv"
   "Execute a query and download the result data as a CSV file."


tracing guest run

tracing guest run

--- src/vc/guest.clj
+++ src/vc/guest.clj
@@ -81,6 +81,7 @@
           timeout [(hypervisor :vcenter :guest-timeout) :second]
           args* (if uuid (<< "~{args} >> /tmp/run-~{uuid}.log") args)
           pid (.startProgramInGuest m (npa auth) (prog-spec cmd args* auth))]
+         (trace (<< "guest running: ~cmd ~args*"))
          (wait-for {:timeout timeout :sleep [200 :ms]} #(-> (exit-code m pid auth) nil? not)
            {:type ::vc:guest-run-timeout :message (<< "Timed out on running ~{cmd} ~{args} in guest") :timeout timeout})
          (when-not (= (exit-code m pid auth) 0)
@@ -109,7 +110,7 @@
     (debug "setting up guest static ip")
     (assert-sudo hostname auth uuid)
     (upload-file
-      (debian-interfaces (update-in config [:names] (partial join ","))) tmp-file hostname auth)
+      (debian-interfaces (update-in config [:names] (partial join " "))) tmp-file hostname auth)
     (guest-run hostname "/bin/cp" (<< "-v ~{tmp-file} /etc/network/interfaces") auth uuid)
     (guest-run hostname "/bin/rm" (<< "-v ~{tmp-file}") auth uuid)
     (guest-run hostname "sed" (<< "-i '/^.*$/c\\~{hostname}' /etc/hostname") auth uuid)


Removed re-frisk from core

Removed re-frisk from core

--- src/name_bazaar/ui/core.cljs
+++ src/name_bazaar/ui/core.cljs
@@ -19,7 +19,6 @@
     [name-bazaar.ui.subs]
     [print.foo :include-macros true]
     [re-frame.core :refer [dispatch dispatch-sync clear-subscription-cache!]]
-    [re-frisk.core :refer [enable-re-frisk!]]
     [reagent.core :as r]
     [taoensso.timbre :as logging :refer-macros [info warn error]]))

@@ -27,8 +26,7 @@

 (defn dev-setup []
   (when debug?
-    (enable-console-print!)
-    (enable-re-frisk!)))
+    (enable-console-print!)))

 (defn mount-root []
   (google-analytics-fx/set-enabled! (not debug?))


Fix default output type behavior.

Fix default output type behavior.

--- src/dsbdp/data_processing_dsl.clj
+++ src/dsbdp/data_processing_dsl.clj
@@ -118,7 +118,7 @@
                       (do
                         (println "Unknown output type:" output-type)
                         (println "Defaulting to :java-map as output type.")
-                        (create-proc-fn-body-java-map-out input-sym nil rules)))
+                        (create-proc-fn-body-java-map-out input-sym rules output-sym)))
 ;        _ (println "Created data processing function vector from DSL:" fn-body-vec)
         fn-body (reverse (into '() fn-body-vec))
 ;        _ (println "Created data processing function body:" fn-body)


Making synth controls horizontal so labels are cleanly aligned.

--- src/overtone/gui/control.clj
+++ src/overtone/gui/control.clj
@@ -1,8 +1,6 @@
 (ns overtone.gui.control
-  (:use overtone.libs.event
-        seesaw.core)
-  (:require [seesaw.bind :as bind]
-            [clojure.set :as set]))
+  (:use [seesaw core mig])
+  (:require [seesaw.bind :as bind]))

 (native!)

@@ -16,9 +14,11 @@
         scaled-init (* (/ (- init-val min-val)
                           (double (- max-val min-val)))
                        SLIDER-MAX)
-        slider (slider :value scaled-init :min 0 :max SLIDER-MAX :orientation :vertical)
+        slider (slider :value scaled-init :min 0 :max SLIDER-MAX :orientation :horizontal)
         label  (label name)
-        pane   (vertical-panel :items [slider spinner label])]
+        items  [[label "width 80:80:100"]
+                [spinner "width 80:80:80"]
+                [slider "wrap"]]]
     (bind/bind slider
                (bind/transform (fn [v]
                                  (let [val (+ min-val (* (- max-val min-val)
@@ -30,7 +30,7 @@
                slider)
     (bind/bind spinner val-atom)
     (bind/bind val-atom spinner)
-    pane))
+    items))

 (defn synth-controller
   "Create a GUI for the given synth or instrument.  Requires sufficient parameter metadata in the synthdef.
@@ -52,11 +52,12 @@
           (defsynth foo [freq {:default 440 :min 10 :max 10000 :step 1}] ...)
 ")
   (invoke-now
-    (let [control-panes (map
+    (let [control-panes (mapcat
                           (fn [{:keys [name default min max step value]}]
                             (control-slider name default min max step value))
                           (:params synth))
-          pane (horizontal-panel :items control-panes)
+          pane (mig-panel :constraints ["" "[right][center][center]" ""]
+                          :items control-panes)
           frame (frame :title (:name synth)
                        :content pane
                        :on-close :dispose)]


Add a test that demos latest handshake failure

No idea yet *why* it doesn't work.

--- test/frereth_cp/message/handshake_test.clj
+++ test/frereth_cp/message/handshake_test.clj
@@ -264,15 +264,44 @@
   ;; a *lot* of functionality.
   ;; And I've made it extra-complicated by refusing to consider
   ;; adding serialization by default.
-  (let [s (strm/stream)
-        xfrm-node (decoder s)
-        msg ::message
-        msg-frames (io/encode protocol msg)]
-    (is (= 2 (count msg-frames)))
-    (doseq [frame msg-frames]
-      (strm/put! s frame))
-    (let [outcome (strm/try-take! xfrm-node ::drained 40 ::timed-out)]
-      (is (= msg (deref outcome 10 ::time-out-2))))))
+  (try "Fundamental idea"
+    (let [s (strm/stream)
+          xfrm-node (decoder s)
+          msg ::message
+          msg-frames (io/encode protocol msg)]
+      (is (= 2 (count msg-frames)))
+      (doseq [frame msg-frames]
+        (strm/put! s frame))
+      (let [outcome (strm/try-take! xfrm-node ::drained 40 ::timed-out)]
+        (is (= msg (deref outcome 10 ::time-out-2))))))
+  (testing "Wrappers"
+    (let [decode-src (strm/stream)
+          decode-sink (decoder decode-src)
+          msg {::a 1
+               ::b 2
+               ::c #{3 4 5}}
+          frames (io/encode protocol msg)
+          binary-frames (reduce (fn [acc frame]
+                                  (let [n (- (.limit frame)
+                                             (.position frame))
+                                        result (byte-array n)]
+                                    (.get frame result)
+                                    (conj acc frame)))
+                                []
+                                frames)
+          decoded (map (partial decode-bytes->child
+                                decode-src
+                                decode-sink) binary-frames)]
+      (is (= 2 (count frames)))
+      (is (= 2 (count binary-frames)))
+      (is (= 2 (count decoded)))
+      (is (not (first decoded)))
+      ;; Current test implementation hinges on this.
+      ;; It doesn't work.
+      ;; Just glancing at the gloss source code,
+      ;; based on what I know about it, really
+      ;; seems as though this should work.
+      (is (= msg (second decoded))))))

 (deftest handshake
   (let [prelog (utils/pre-log "Handshake test")]


Wip test fix.

Wip test fix.

--- test/onyx/coordinator/single_peer_test.clj
+++ test/onyx/coordinator/single_peer_test.clj
@@ -161,20 +161,21 @@
                      :node/peer :node/exhaust :node/seal}))

     (extensions/on-change sync (:node/status (:nodes state)) #(>!! status-spy %))
-    (extensions/on-change sync (:node/seal (:nodes state)) #(>!! seal-node-spy %)))
-
-  #_(facts "Touching the ack node triggers the callback"
-         (let [nodes (:nodes (extensions/read-place sync payload-node))]
-           (extensions/touch-place sync (:ack nodes))
+    (extensions/on-change sync (:node/seal (:nodes state)) #(>!! seal-node-spy %))
+
+    (facts "Touching the ack node triggers the callback"
+           (extensions/touch-place sync (:node/ack (:nodes state)))
            (let [event (<!! ack-ch-spy)]
-             (fact (:path event) => (:ack nodes)))))
-
-  #_(extensions/write-place sync peer-node {:pulse pulse-node
+             (fact (:path event) => (:node/ack (:nodes state))))))
+
+  (extensions/write-place sync peer-node {:peer peer-node
+                                          :pulse pulse-node
                                           :shutdown shutdown-node
                                           :payload next-payload-node})
-  #_(extensions/on-change sync next-payload-node #(>!! sync-spy %))
-
-  #_(<!! status-spy)
+
+  (extensions/on-change sync next-payload-node #(>!! sync-spy %))
+
+  (<!! status-spy)

   #_(facts "Touching the exhaustion node triggers the callback"
          (let [nodes (:nodes (extensions/read-place sync payload-node))]


PDOK-1277: bepalen van geometry-index alleen wanneer nodig

--- src/main/clojure/pdok/featured/projectors.clj
+++ src/main/clojure/pdok/featured/projectors.clj
@@ -134,8 +134,8 @@
 (defn- all-fields-constructor [attributes]
   (if (empty? attributes) (constantly nil) (apply juxt (map #(fn [col] (get col %)) attributes))))

-(defn- geo-column [geogroup]
-   (str "_geometry_" (name geogroup)))
+(defn- geo-column [geo-group]
+   (str "_geometry_" (name geo-group)))

 (defn- gs-add-feature
   ([db all-attributes-fn features]
@@ -171,15 +171,15 @@
         ;; group per key collection so we can batch every group
         (let [keyed (group-by feature-keys collection-features)]
           (doseq [[columns vals] keyed]
-            (let [geometry-index (.indexOf columns :_geometry)]
             (when (< 0 (count columns))
-              (let [update-vals (map feature-to-update-record vals)]
+              (let [update-vals (map feature-to-update-record vals)
+                    geometry-index (.indexOf columns :_geometry)]
                 (if (= geometry-index -1)
-                  (execute-update-sql db dataset collection columns update-vals)
-                  (let [per-geotype (group-by (partial update-geometry-group geometry-index) update-vals)]
-                    (doseq [[{:keys [geotype]} grouped-vals] per-geotype]
-                      (let [columns (assoc columns geometry-index (geo-column geotype))]
-                        (execute-update-sql db dataset collection columns update-vals)))))))))))))
+                    (execute-update-sql db dataset collection columns update-vals)
+                    (let [per-geotype (group-by (partial update-geometry-group geometry-index) update-vals)]
+                      (doseq [[{:keys [geotype]} grouped-vals] per-geotype]
+                        (let [columns (assoc columns geometry-index (geo-column geotype))]
+                          (execute-update-sql db dataset collection columns update-vals))))))))))))

 (defn- gs-delete-sql [schema table]


prefix->infix beautify

prefix->infix beautify

--- src/logic/infix.clj
+++ src/logic/infix.clj
@@ -16,20 +16,20 @@
 (defn prefix->infix
   "Transforms formula in prefix to string in infix"
   [expr]
-  (let [transform (fn p->i [e]
-                    (cond
-                      (= e true)  "T"
-                      (= e false) "F"
-                      (symbol? e) (name e)
-                      (list? e)
-                        (if (= (first e) 'not)
-                          (apply str (infix-op 'not) (p->i (second e)))
-                          (str "(" (apply str (interpose (infix-op (first e))
-                                                         (map p->i (rest e)))) ")"))))
-        infix-expr (transform expr)]
+  (let [tf (fn p->i [e]
+             (cond
+               (= e true)  "T"
+               (= e false) "F"
+               (symbol? e) (name e)
+               (list? e)
+                 (if (= (first e) 'not)
+                   (apply str (infix-op 'not) (p->i (second e)))
+                   (str "(" (apply str (interpose (infix-op (first e))
+                                                  (map p->i (rest e)))) ")"))))
+        infix-expr (tf expr)]
     (if (= (first infix-expr) \()
-    (subs infix-expr 1 (dec (.length infix-expr)))
-    infix-expr)))
+      (subs infix-expr 1 (dec (.length infix-expr)))
+      infix-expr)))

 (def exp1 true)


Fix numeral parsing

Fix numeral parsing

--- src/luaclj/core.clj
+++ src/luaclj/core.clj
@@ -150,6 +150,8 @@

 (defn symbol-fn [& args]
    (read-string (first args)))
+(defn numeral-fn [& args]
+  (Double/parseDouble (str/join args)))
 (defn string-fn [& args]
   (println "string:" args)
   (.substring (first args) 1 (dec (count (first args)))))
@@ -361,7 +363,7 @@
    :block block-fn
    :stat stat-fn
    :retstat retstat-fn
-   :Numeral symbol-fn
+   :Numeral numeral-fn
    :binop binop-or-unop-fn
    :unop binop-or-unop-fn
    :LiteralString string-fn
@@ -476,6 +478,11 @@

 (pprint (lua-parser (slurp "resources/test/function.lua")))
+
+
+(def test-fn (eval (insta/transform transform-map (lua-parser (slurp "resources/test/function.lua")))))
+(test-fn 4 5)
+
 (eval (insta/transform transform-map (lua-parser (slurp "resources/test/basic.lua"))))
 (eval (insta/transform transform-map (lua-parser (slurp "resources/test/basic1.lua"))))
 (eval (insta/transform transform-map (lua-parser (slurp "resources/test/for.lua"))))