create table

create table

--- ddl.clj
+++ ddl.clj
@@ -1,1008 +1,1008 @@

-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(1000),
-  "agent_suspect" numeric(38),
-  "agent_notes" varchar(1000),
-  "listedness_notes" varchar(1000),
-  "bfarm_causality" numeric(10,0),
-  "bfarm_manual_text" varchar(3900),
-  "company_diagnosis" varchar(250),
-  "company_diagnosis_notes" varchar(1000),
-  "diagnosis_dict_id" numeric(38),
-  "diagnosis_pref_code" varchar(30),
-  "diagnosis_inc_code" varchar(30),
-  "diagnosis_inc_term" varchar(250),
-  "diagnosis_hlgt_code" varchar(30),
-  "diagnosis_hlgt" varchar(250),
-  "diagnosis_hlt_code" varchar(30),
-  "diagnosis_hlt" varchar(250),
-  "diagnosis_soc_code" varchar(30),
-  "diagnosis_body_sys" varchar(250),
-  "ud_text_1" varchar(100),
-  "ud_text_2" varchar(100),
-  "ud_text_3" varchar(100),
-  "ud_text_4" varchar(100),
-  "ud_text_5" varchar(100),
-  "ud_text_6" varchar(100),
-  "ud_text_7" varchar(100),
-  "ud_text_8" varchar(100),
-  "ud_text_9" varchar(100),
-  "ud_text_10" varchar(100),
-  "ud_text_11" varchar(100),
-  "ud_text_12" varchar(100),
-  "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(5),
-  "event_primary" varchar(400),
-  "diagnosis_reptd" varchar(255),
-  "diagnosis_coded" varchar(255),
-  "diagnosis_syn_code" numeric(38),
-  "diagnosis_code_status" numeric(3,0),
-  "event_primary_j" varchar(400),
-  "agent_notes_j" varchar(1000),
-  "company_diagnosis_j" varchar(250),
-  "company_diagnosis_notes_j" varchar(1000),
-  "diagnosis_body_sys_j" varchar(250),
-  "diagnosis_coded_j" varchar(255),
-  "diagnosis_code_status_j" numeric(38),
-  "diagnosis_hlgt_j" varchar(250),
-  "diagnosis_hlt_j" varchar(250),
-  "diagnosis_inc_code_j" varchar(30),
-  "diagnosis_inc_term_j" varchar(250),
-  "diagnosis_reptd_j" varchar(255),
-  "listedness_notes_j" varchar(1000),
-  "serious_notes_j" varchar(1000),
-  "ud_text_1_j" varchar(100),
-  "ud_text_2_j" varchar(100),
-  "ud_text_3_j" varchar(100),
-  "ud_text_4_j" varchar(100),
-  "ud_text_5_j" varchar(100),
-  "ud_text_6_j" varchar(100),
-  "ud_text_7_j" varchar(100),
-  "ud_text_8_j" varchar(100),
-  "ud_text_9_j" varchar(100),
-  "ud_text_10_j" varchar(100),
-  "ud_text_11_j" varchar(100),
-  "ud_text_12_j" varchar(100),
-  "diagnosis_syn_code_j" numeric(38),
-  "deleted" date,
-  "dlp_revision_number" numeric(38),
-  "revision_delete_flag" number default 0,
-  "deleted_flag" numeric(1,0),
-  "effective_start_date" date,
+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(1000),
+  "agent_suspect" numeric(38),
+  "agent_notes" varchar(1000),
+  "listedness_notes" varchar(1000),
+  "bfarm_causality" numeric(10,0),
+  "bfarm_manual_text" varchar(3900),
+  "company_diagnosis" varchar(250),
+  "company_diagnosis_notes" varchar(1000),
+  "diagnosis_dict_id" numeric(38),
+  "diagnosis_pref_code" varchar(30),
+  "diagnosis_inc_code" varchar(30),
+  "diagnosis_inc_term" varchar(250),
+  "diagnosis_hlgt_code" varchar(30),
+  "diagnosis_hlgt" varchar(250),
+  "diagnosis_hlt_code" varchar(30),
+  "diagnosis_hlt" varchar(250),
+  "diagnosis_soc_code" varchar(30),
+  "diagnosis_body_sys" varchar(250),
+  "ud_text_1" varchar(100),
+  "ud_text_2" varchar(100),
+  "ud_text_3" varchar(100),
+  "ud_text_4" varchar(100),
+  "ud_text_5" varchar(100),
+  "ud_text_6" varchar(100),
+  "ud_text_7" varchar(100),
+  "ud_text_8" varchar(100),
+  "ud_text_9" varchar(100),
+  "ud_text_10" varchar(100),
+  "ud_text_11" varchar(100),
+  "ud_text_12" varchar(100),
+  "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(5),
+  "event_primary" varchar(400),
+  "diagnosis_reptd" varchar(255),
+  "diagnosis_coded" varchar(255),
+  "diagnosis_syn_code" numeric(38),
+  "diagnosis_code_status" numeric(3,0),
+  "event_primary_j" varchar(400),
+  "agent_notes_j" varchar(1000),
+  "company_diagnosis_j" varchar(250),
+  "company_diagnosis_notes_j" varchar(1000),
+  "diagnosis_body_sys_j" varchar(250),
+  "diagnosis_coded_j" varchar(255),
+  "diagnosis_code_status_j" numeric(38),
+  "diagnosis_hlgt_j" varchar(250),
+  "diagnosis_hlt_j" varchar(250),
+  "diagnosis_inc_code_j" varchar(30),
+  "diagnosis_inc_term_j" varchar(250),
+  "diagnosis_reptd_j" varchar(255),
+  "listedness_notes_j" varchar(1000),
+  "serious_notes_j" varchar(1000),
+  "ud_text_1_j" varchar(100),
+  "ud_text_2_j" varchar(100),
+  "ud_text_3_j" varchar(100),
+  "ud_text_4_j" varchar(100),
+  "ud_text_5_j" varchar(100),
+  "ud_text_6_j" varchar(100),
+  "ud_text_7_j" varchar(100),
+  "ud_text_8_j" varchar(100),
+  "ud_text_9_j" varchar(100),
+  "ud_text_10_j" varchar(100),
+  "ud_text_11_j" varchar(100),
+  "ud_text_12_j" varchar(100),
+  "diagnosis_syn_code_j" numeric(38),
+  "deleted" date,
+  "dlp_revision_number" numeric(38),
+  "revision_delete_flag" number default 0,
+  "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" number default 0,
-  "deleted_flag" numeric(1,0),
-  "effective_start_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" number default 0,
+  "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(250),
-  "desc_coded" varchar(255),
-  "diagnosis" numeric(38),
-  "onset" date,
-  "onset_res" numeric(38),
-  "onset_delay" varchar(40),
-  "stop_date" date,
-  "stop_date_res" numeric(38),
-  "duration" varchar(40),
-  "onset_latency" varchar(40),
-  "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(30),
-  "art_code" varchar(30),
-  "pref_term" varchar(250),
-  "inc_term" varchar(250),
-  "body_sys" varchar(250),
-  "med_serious" numeric(38),
-  "past_hist" numeric(38),
-  "dict_id" numeric(38),
-  "dict_key" varchar(20),
-  "code_status" numeric(38),
-  "seriousness" numeric(38),
-  "sort_id" numeric(38),
-  "onset_date_partial" varchar(20),
-  "stop_date_partial" varchar(20),
-  "efficacy" numeric(38),
-  "disease" numeric(38),
-  "withdrawal" numeric(38),
-  "hlgt" varchar(250),
-  "hlt" varchar(250),
-  "hlt_code" varchar(30),
-  "hlgt_code" varchar(30),
-  "soc_code" varchar(30),
-  "study_dropped" numeric(4,0),
-  "inc_code" varchar(30),
-  "onset_minutes" numeric(38),
-  "delay_minutes" numeric(38),
-  "ud_text_1" varchar(100),
-  "ud_text_2" varchar(100),
-  "ud_text_3" varchar(100),
-  "ud_text_4" varchar(100),
-  "ud_text_5" varchar(100),
-  "ud_text_6" varchar(100),
-  "ud_text_7" varchar(100),
-  "ud_text_8" varchar(100),
-  "ud_text_9" varchar(100),
-  "ud_text_10" varchar(100),
-  "ud_text_11" varchar(100),
-  "ud_text_12" varchar(100),
-  "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(250),
-  "code_status_j" numeric(38),
-  "desc_coded_j" varchar(255),
-  "desc_reptd_j" varchar(250),
-  "hlgt_j" varchar(250),
-  "hlt_j" varchar(250),
-  "inc_code_j" varchar(30),
-  "inc_term_j" varchar(250),
-  "pref_term_j" varchar(250),
-  "sc_other_text_j" varchar(30),
-  "report_exclusion" numeric(38),
-  "reportable" numeric(38),
-  "ud_text_1_j" varchar(100),
-  "ud_text_2_j" varchar(100),
-  "ud_text_3_j" varchar(100),
-  "ud_text_4_j" varchar(100),
-  "ud_text_5_j" varchar(100),
-  "ud_text_6_j" varchar(100),
-  "ud_text_7_j" varchar(100),
-  "ud_text_8_j" varchar(100),
-  "ud_text_9_j" varchar(100),
-  "ud_text_10_j" varchar(100),
-  "ud_text_11_j" varchar(100),
-  "ud_text_12_j" varchar(100),
-  "syn_code_j" numeric(38),
-  "infection" numeric(38),
-  "rpt_exclude_cmt" varchar(1000),
-  "rpt_exclude_cmt_j" varchar(1000),
-  "dlp_revision_number" numeric(38),
-  "revision_delete_flag" number default 0,
-  "deleted_flag" numeric(1,0),
-  "effective_start_date" date,
+)
+
+create table rm_case_event
+(
+  "enterprise_id" numeric(38),
+  "case_id" numeric(38),
+  "seq_num" numeric(38),
+  "desc_reptd" varchar(250),
+  "desc_coded" varchar(255),
+  "diagnosis" numeric(38),
+  "onset" date,
+  "onset_res" numeric(38),
+  "onset_delay" varchar(40),
+  "stop_date" date,
+  "stop_date_res" numeric(38),
+  "duration" varchar(40),
+  "onset_latency" varchar(40),
+  "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(30),
+  "art_code" varchar(30),
+  "pref_term" varchar(250),
+  "inc_term" varchar(250),
+  "body_sys" varchar(250),
+  "med_serious" numeric(38),
+  "past_hist" numeric(38),
+  "dict_id" numeric(38),
+  "dict_key" varchar(20),
+  "code_status" numeric(38),
+  "seriousness" numeric(38),
+  "sort_id" numeric(38),
+  "onset_date_partial" varchar(20),
+  "stop_date_partial" varchar(20),
+  "efficacy" numeric(38),
+  "disease" numeric(38),
+  "withdrawal" numeric(38),
+  "hlgt" varchar(250),
+  "hlt" varchar(250),
+  "hlt_code" varchar(30),
+  "hlgt_code" varchar(30),
+  "soc_code" varchar(30),
+  "study_dropped" numeric(4,0),
+  "inc_code" varchar(30),
+  "onset_minutes" numeric(38),
+  "delay_minutes" numeric(38),
+  "ud_text_1" varchar(100),
+  "ud_text_2" varchar(100),
+  "ud_text_3" varchar(100),
+  "ud_text_4" varchar(100),
+  "ud_text_5" varchar(100),
+  "ud_text_6" varchar(100),
+  "ud_text_7" varchar(100),
+  "ud_text_8" varchar(100),
+  "ud_text_9" varchar(100),
+  "ud_text_10" varchar(100),
+  "ud_text_11" varchar(100),
+  "ud_text_12" varchar(100),
+  "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(250),
+  "code_status_j" numeric(38),
+  "desc_coded_j" varchar(255),
+  "desc_reptd_j" varchar(250),
+  "hlgt_j" varchar(250),
+  "hlt_j" varchar(250),
+  "inc_code_j" varchar(30),
+  "inc_term_j" varchar(250),
+  "pref_term_j" varchar(250),
+  "sc_other_text_j" varchar(30),
+  "report_exclusion" numeric(38),
+  "reportable" numeric(38),
+  "ud_text_1_j" varchar(100),
+  "ud_text_2_j" varchar(100),
+  "ud_text_3_j" varchar(100),
+  "ud_text_4_j" varchar(100),
+  "ud_text_5_j" varchar(100),
+  "ud_text_6_j" varchar(100),
+  "ud_text_7_j" varchar(100),
+  "ud_text_8_j" varchar(100),
+  "ud_text_9_j" varchar(100),
+  "ud_text_10_j" varchar(100),
+  "ud_text_11_j" varchar(100),
+  "ud_text_12_j" varchar(100),
+  "syn_code_j" numeric(38),
+  "infection" numeric(38),
+  "rpt_exclude_cmt" varchar(1000),
+  "rpt_exclude_cmt_j" varchar(1000),
+  "dlp_revision_number" numeric(38),
+  "revision_delete_flag" number default 0,
+  "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(1000),
-  "cause_justify" varchar(1000),
-  "lam_assessed" numeric(12,0),
-  "deleted" date,
-  "causality_assessment" varchar(50),
-  "causality_score" numeric(38),
-  "source_id" numeric(38),
-  "prt_causality_id" numeric(38),
-  "cause_justify_j" varchar(1000),
-  "listed_justify_j" varchar(1000),
-  "dlp_revision_number" numeric(38),
-  "last_update_time" date,
-  "revision_delete_flag" number default 0,
-  "deleted_flag" numeric(1,0),
-  "effective_start_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(1000),
+  "cause_justify" varchar(1000),
+  "lam_assessed" numeric(12,0),
+  "deleted" date,
+  "causality_assessment" varchar(50),
+  "causality_score" numeric(38),
+  "source_id" numeric(38),
+  "prt_causality_id" numeric(38),
+  "cause_justify_j" varchar(1000),
+  "listed_justify_j" varchar(1000),
+  "dlp_revision_number" numeric(38),
+  "last_update_time" date,
+  "revision_delete_flag" number default 0,
+  "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(1000),
-  "justification_id" numeric(38),
-  "justification_j" varchar(1000),
-  "just_receipt_date_j" varchar(1000),
-  "receipt_date_j" date,
-  "dlp_revision_number" numeric(38),
-  "revision_delete_flag" number default 0,
-  "deleted_flag" numeric(1,0),
-  "effective_start_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(1000),
+  "justification_id" numeric(38),
+  "justification_j" varchar(1000),
+  "just_receipt_date_j" varchar(1000),
+  "receipt_date_j" date,
+  "dlp_revision_number" numeric(38),
+  "revision_delete_flag" number default 0,
+  "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(20),
-  "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(128),
-  "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(200),
-  "date_locked" date,
-  "ud_text_1" varchar(100),
-  "ud_text_2" varchar(100),
-  "ud_text_3" varchar(100),
-  "ud_text_4" varchar(100),
-  "ud_text_5" varchar(100),
-  "ud_text_6" varchar(100),
-  "ud_text_7" varchar(100),
-  "ud_text_8" varchar(100),
-  "ud_text_9" varchar(100),
-  "ud_text_10" varchar(100),
-  "ud_text_11" varchar(100),
-  "ud_text_12" varchar(100),
-  "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(20),
-  "priority_date_assessed" date,
-  "lam_assess_done" numeric(1,0),
-  "e2b_ww_number" varchar(100),
-  "worklist_owner_id" numeric(38),
-  "susar" numeric(38),
-  "last_update_event" date,
-  "initial_justification" varchar(1000),
-  "force_soon" date,
-  "due_soon_j" date,
-  "followup_date_j" date,
-  "init_rept_date_j" date,
-  "just_init_rept_date_j" varchar(1000),
-  "ud_text_1_j" varchar(100),
-  "ud_text_2_j" varchar(100),
-  "ud_text_3_j" varchar(100),
-  "ud_text_4_j" varchar(100),
-  "ud_text_5_j" varchar(100),
-  "ud_text_6_j" varchar(100),
-  "ud_text_7_j" varchar(100),
-  "ud_text_8_j" varchar(100),
-  "ud_text_9_j" varchar(100),
-  "ud_text_10_j" varchar(100),
-  "ud_text_11_j" varchar(100),
-  "ud_text_12_j" varchar(100),
-  "initial_justification_j" varchar(1000),
-  "dlp_revision_number" numeric(38),
-  "revision_delete_flag" number default 0,
-  "deleted_flag" numeric(1,0),
-  "effective_start_date" date,
+)
+
+create table rm_case_master
+(
+  "enterprise_id" numeric(38),
+  "case_id" numeric(38),
+  "case_num" varchar(20),
+  "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(128),
+  "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(200),
+  "date_locked" date,
+  "ud_text_1" varchar(100),
+  "ud_text_2" varchar(100),
+  "ud_text_3" varchar(100),
+  "ud_text_4" varchar(100),
+  "ud_text_5" varchar(100),
+  "ud_text_6" varchar(100),
+  "ud_text_7" varchar(100),
+  "ud_text_8" varchar(100),
+  "ud_text_9" varchar(100),
+  "ud_text_10" varchar(100),
+  "ud_text_11" varchar(100),
+  "ud_text_12" varchar(100),
+  "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(20),
+  "priority_date_assessed" date,
+  "lam_assess_done" numeric(1,0),
+  "e2b_ww_number" varchar(100),
+  "worklist_owner_id" numeric(38),
+  "susar" numeric(38),
+  "last_update_event" date,
+  "initial_justification" varchar(1000),
+  "force_soon" date,
+  "due_soon_j" date,
+  "followup_date_j" date,
+  "init_rept_date_j" date,
+  "just_init_rept_date_j" varchar(1000),
+  "ud_text_1_j" varchar(100),
+  "ud_text_2_j" varchar(100),
+  "ud_text_3_j" varchar(100),
+  "ud_text_4_j" varchar(100),
+  "ud_text_5_j" varchar(100),
+  "ud_text_6_j" varchar(100),
+  "ud_text_7_j" varchar(100),
+  "ud_text_8_j" varchar(100),
+  "ud_text_9_j" varchar(100),
+  "ud_text_10_j" varchar(100),
+  "ud_text_11_j" varchar(100),
+  "ud_text_12_j" varchar(100),
+  "initial_justification_j" varchar(1000),
+  "dlp_revision_number" numeric(38),
+  "revision_delete_flag" number default 0,
+  "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" number default 0,
-  "deleted_flag" numeric(1,0),
-  "effective_start_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" number default 0,
+  "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(10),
-  "pat_subj_num" varchar(20),
-  "pat_initials" varchar(10),
-  "pat_firstname" varchar(35),
-  "pat_mi" varchar(15),
-  "pat_lastname" varchar(50),
-  "pat_address" varchar(120),
-  "pat_city" varchar(35),
-  "pat_state" varchar(40),
-  "pat_postal_code" varchar(15),
-  "pat_country" varchar(50),
-  "pat_phone" varchar(20),
-  "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(20),
-  "rand_num" varchar(15),
-  "confidential" numeric(1,0),
-  "number_of_patients" varchar(8),
-  "ud_text_1" varchar(100),
-  "ud_text_2" varchar(100),
-  "ud_text_3" varchar(100),
-  "ud_text_4" varchar(100),
-  "ud_text_5" varchar(100),
-  "ud_text_6" varchar(100),
-  "ud_text_7" varchar(100),
-  "ud_text_8" varchar(100),
-  "ud_text_9" varchar(100),
-  "ud_text_10" varchar(100),
-  "ud_text_11" varchar(100),
-  "ud_text_12" varchar(100),
-  "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(120),
-  "pat_city_j" varchar(35),
-  "pat_firstname_j" varchar(35),
-  "pat_lastname_j" varchar(50),
-  "pat_mi_j" varchar(15),
-  "pat_state_j" varchar(40),
-  "ud_text_1_j" varchar(100),
-  "ud_text_2_j" varchar(100),
-  "ud_text_3_j" varchar(100),
-  "ud_text_4_j" varchar(100),
-  "ud_text_5_j" varchar(100),
-  "ud_text_6_j" varchar(100),
-  "ud_text_7_j" varchar(100),
-  "ud_text_8_j" varchar(100),
-  "ud_text_9_j" varchar(100),
-  "ud_text_10_j" varchar(100),
-  "ud_text_11_j" varchar(100),
-  "ud_text_12_j" varchar(100),
-  "pat_country_id" numeric(38),
-  "dlp_revision_number" numeric(38),
-  "revision_delete_flag" number default 0,
-  "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),
+)
+
+create table rm_case_pat_info
+(
+  "enterprise_id" numeric(38),
+  "case_id" numeric(38),
+  "pat_id" varchar(10),
+  "pat_subj_num" varchar(20),
+  "pat_initials" varchar(10),
+  "pat_firstname" varchar(35),
+  "pat_mi" varchar(15),
+  "pat_lastname" varchar(50),
+  "pat_address" varchar(120),
+  "pat_city" varchar(35),
+  "pat_state" varchar(40),
+  "pat_postal_code" varchar(15),
+  "pat_country" varchar(50),
+  "pat_phone" varchar(20),
+  "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(20),
+  "rand_num" varchar(15),
+  "confidential" numeric(1,0),
+  "number_of_patients" varchar(8),
+  "ud_text_1" varchar(100),
+  "ud_text_2" varchar(100),
+  "ud_text_3" varchar(100),
+  "ud_text_4" varchar(100),
+  "ud_text_5" varchar(100),
+  "ud_text_6" varchar(100),
+  "ud_text_7" varchar(100),
+  "ud_text_8" varchar(100),
+  "ud_text_9" varchar(100),
+  "ud_text_10" varchar(100),
+  "ud_text_11" varchar(100),
+  "ud_text_12" varchar(100),
+  "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(120),
+  "pat_city_j" varchar(35),
+  "pat_firstname_j" varchar(35),
+  "pat_lastname_j" varchar(50),
+  "pat_mi_j" varchar(15),
+  "pat_state_j" varchar(40),
+  "ud_text_1_j" varchar(100),
+  "ud_text_2_j" varchar(100),
+  "ud_text_3_j" varchar(100),
+  "ud_text_4_j" varchar(100),
+  "ud_text_5_j" varchar(100),
+  "ud_text_6_j" varchar(100),
+  "ud_text_7_j" varchar(100),
+  "ud_text_8_j" varchar(100),
+  "ud_text_9_j" varchar(100),
+  "ud_text_10_j" varchar(100),
+  "ud_text_11_j" varchar(100),
+  "ud_text_12_j" varchar(100),
+  "pat_country_id" numeric(38),
+  "dlp_revision_number" numeric(38),
+  "revision_delete_flag" number default 0,
+  "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" number
-)
-
-create table "rm_case_prod_drugs"
-(
-  "enterprise_id" numeric(38),
-  "case_id" numeric(38),
-  "seq_num" numeric(38),
-  "formulation_id" numeric(38),
-  "concentration" varchar(10),
-  "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(20),
-  "last_dose_partial" varchar(20),
-  "tampering" numeric(4,0),
-  "cumulative_dose" numeric(22,7),
-  "cumulative_dose_unit" varchar(10),
-  "deleted" date,
-  "ud_text_1" varchar(100),
-  "ud_text_2" varchar(100),
-  "ud_text_3" varchar(100),
-  "ud_text_4" varchar(100),
-  "ud_text_5" varchar(100),
-  "ud_text_6" varchar(100),
-  "ud_text_7" varchar(100),
-  "ud_text_8" varchar(100),
-  "ud_text_9" varchar(100),
-  "ud_text_10" varchar(100),
-  "ud_text_11" varchar(100),
-  "ud_text_12" varchar(100),
-  "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(100),
-  "ud_text_2_j" varchar(100),
-  "ud_text_3_j" varchar(100),
-  "ud_text_4_j" varchar(100),
-  "ud_text_5_j" varchar(100),
-  "ud_text_6_j" varchar(100),
-  "ud_text_7_j" varchar(100),
-  "ud_text_8_j" varchar(100),
-  "ud_text_9_j" varchar(100),
-  "ud_text_10_j" varchar(100),
-  "ud_text_11_j" varchar(100),
-  "ud_text_12_j" varchar(100),
-  "dlp_revision_number" numeric(38),
-  "revision_delete_flag" number default 0,
-  "deleted_flag" numeric(1,0),
-  "effective_start_date" date,
+)
+
+create table rm_case_prod_drugs
+(
+  "enterprise_id" numeric(38),
+  "case_id" numeric(38),
+  "seq_num" numeric(38),
+  "formulation_id" numeric(38),
+  "concentration" varchar(10),
+  "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(20),
+  "last_dose_partial" varchar(20),
+  "tampering" numeric(4,0),
+  "cumulative_dose" numeric(22,7),
+  "cumulative_dose_unit" varchar(10),
+  "deleted" date,
+  "ud_text_1" varchar(100),
+  "ud_text_2" varchar(100),
+  "ud_text_3" varchar(100),
+  "ud_text_4" varchar(100),
+  "ud_text_5" varchar(100),
+  "ud_text_6" varchar(100),
+  "ud_text_7" varchar(100),
+  "ud_text_8" varchar(100),
+  "ud_text_9" varchar(100),
+  "ud_text_10" varchar(100),
+  "ud_text_11" varchar(100),
+  "ud_text_12" varchar(100),
+  "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(100),
+  "ud_text_2_j" varchar(100),
+  "ud_text_3_j" varchar(100),
+  "ud_text_4_j" varchar(100),
+  "ud_text_5_j" varchar(100),
+  "ud_text_6_j" varchar(100),
+  "ud_text_7_j" varchar(100),
+  "ud_text_8_j" varchar(100),
+  "ud_text_9_j" varchar(100),
+  "ud_text_10_j" varchar(100),
+  "ud_text_11_j" varchar(100),
+  "ud_text_12_j" varchar(100),
+  "dlp_revision_number" numeric(38),
+  "revision_delete_flag" number default 0,
+  "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(16),
-  "who_drug_code" varchar(45),
-  "co_drug_code" varchar(20),
-  "product_name" varchar(70),
-  "generic_name" varchar(3900),
-  "generic_name_j" varchar(3900),
-  "ud_text_1" varchar(100),
-  "ud_text_2" varchar(100),
-  "ud_text_3" varchar(100),
-  "ud_text_4" varchar(100),
-  "ud_text_5" varchar(100),
-  "ud_text_6" varchar(100),
-  "ud_text_7" varchar(100),
-  "ud_text_8" varchar(100),
-  "ud_text_9" varchar(100),
-  "ud_text_10" varchar(100),
-  "ud_text_11" varchar(100),
-  "ud_text_12" varchar(100),
-  "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(255),
-  "prod_coded" varchar(255),
-  "prod_syn_id" numeric(38),
-  "prod_code_status" numeric(3,0),
-  "deleted" date,
-  "study_product_num" numeric(2,0),
-  "qc_quantity" varchar(10),
-  "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(10),
-  "family_id" numeric(38),
-  "existing_rpt_seq_mod_flg" numeric(38),
-  "drug_code_j" varchar(20),
-  "drug_code_type_j" numeric(38),
-  "product_name_j" varchar(70),
-  "prod_coded_j" varchar(255),
-  "prod_reptd_j" varchar(255),
-  "qc_cross_reference_j" varchar(16),
-  "ud_text_1_j" varchar(100),
-  "ud_text_2_j" varchar(100),
-  "ud_text_3_j" varchar(100),
-  "ud_text_4_j" varchar(100),
-  "ud_text_5_j" varchar(100),
-  "ud_text_6_j" varchar(100),
-  "ud_text_7_j" varchar(100),
-  "ud_text_8_j" varchar(100),
-  "ud_text_9_j" varchar(100),
-  "ud_text_10_j" varchar(100),
-  "ud_text_11_j" varchar(100),
-  "ud_text_12_j" varchar(100),
-  "dlp_revision_number" numeric(38),
-  "last_update_time" date,
-  "revision_delete_flag" number default 0,
-  "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),
+)
+
+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(16),
+  "who_drug_code" varchar(45),
+  "co_drug_code" varchar(20),
+  "product_name" varchar(70),
+  "generic_name" varchar(3900),
+  "generic_name_j" varchar(3900),
+  "ud_text_1" varchar(100),
+  "ud_text_2" varchar(100),
+  "ud_text_3" varchar(100),
+  "ud_text_4" varchar(100),
+  "ud_text_5" varchar(100),
+  "ud_text_6" varchar(100),
+  "ud_text_7" varchar(100),
+  "ud_text_8" varchar(100),
+  "ud_text_9" varchar(100),
+  "ud_text_10" varchar(100),
+  "ud_text_11" varchar(100),
+  "ud_text_12" varchar(100),
+  "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(255),
+  "prod_coded" varchar(255),
+  "prod_syn_id" numeric(38),
+  "prod_code_status" numeric(3,0),
+  "deleted" date,
+  "study_product_num" numeric(2,0),
+  "qc_quantity" varchar(10),
+  "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(10),
+  "family_id" numeric(38),
+  "existing_rpt_seq_mod_flg" numeric(38),
+  "drug_code_j" varchar(20),
+  "drug_code_type_j" numeric(38),
+  "product_name_j" varchar(70),
+  "prod_coded_j" varchar(255),
+  "prod_reptd_j" varchar(255),
+  "qc_cross_reference_j" varchar(16),
+  "ud_text_1_j" varchar(100),
+  "ud_text_2_j" varchar(100),
+  "ud_text_3_j" varchar(100),
+  "ud_text_4_j" varchar(100),
+  "ud_text_5_j" varchar(100),
+  "ud_text_6_j" varchar(100),
+  "ud_text_7_j" varchar(100),
+  "ud_text_8_j" varchar(100),
+  "ud_text_9_j" varchar(100),
+  "ud_text_10_j" varchar(100),
+  "ud_text_11_j" varchar(100),
+  "ud_text_12_j" varchar(100),
+  "dlp_revision_number" numeric(38),
+  "last_update_time" date,
+  "revision_delete_flag" number default 0,
+  "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" number
-)
-
-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(15),
-  "middle_name" varchar(15),
-  "prefix" varchar(50),
-  "first_name" varchar(35),
-  "last_name" varchar(50),
-  "reporter_id" varchar(20),
-  "institution" varchar(60),
-  "department" varchar(60),
-  "city" varchar(35),
-  "state" varchar(40),
-  "postcode" varchar(15),
-  "country" varchar(50),
-  "phone" varchar(20),
-  "altphone" varchar(20),
-  "fax" varchar(50),
-  "reporter_ref" varchar(20),
-  "email" varchar(100),
-  "address" varchar(120),
-  "suffix_j" varchar(15),
-  "address_j" varchar(120),
-  "city_j" varchar(35),
-  "department_j" varchar(60),
-  "first_name_j" varchar(35),
-  "institution_j" varchar(60),
-  "last_name_j" varchar(50),
-  "middle_name_j" varchar(15),
-  "prefix_j" varchar(50),
-  "state_j" varchar(40),
-  "deleted" date,
-  "dlp_revision_number" numeric(38),
-  "revision_delete_flag" number default 0,
-  "deleted_flag" numeric(1,0),
-  "effective_start_date" date,
-  "effective_end_date" date,
-  "notes" varchar(3900),
-  "notes_j" varchar(3900),
+)
+
+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(15),
+  "middle_name" varchar(15),
+  "prefix" varchar(50),
+  "first_name" varchar(35),
+  "last_name" varchar(50),
+  "reporter_id" varchar(20),
+  "institution" varchar(60),
+  "department" varchar(60),
+  "city" varchar(35),
+  "state" varchar(40),
+  "postcode" varchar(15),
+  "country" varchar(50),
+  "phone" varchar(20),
+  "altphone" varchar(20),
+  "fax" varchar(50),
+  "reporter_ref" varchar(20),
+  "email" varchar(100),
+  "address" varchar(120),
+  "suffix_j" varchar(15),
+  "address_j" varchar(120),
+  "city_j" varchar(35),
+  "department_j" varchar(60),
+  "first_name_j" varchar(35),
+  "institution_j" varchar(60),
+  "last_name_j" varchar(50),
+  "middle_name_j" varchar(15),
+  "prefix_j" varchar(50),
+  "state_j" varchar(40),
+  "deleted" date,
+  "dlp_revision_number" numeric(38),
+  "revision_delete_flag" number default 0,
+  "deleted_flag" numeric(1,0),
+  "effective_start_date" date,
+  "effective_end_date" date,
+  "notes" varchar(3900),
+  "notes_j" varchar(3900),
   "institution_id" varchar(15)
-)
-
-create table "rm_case_study"
-(
-  "enterprise_id" numeric(38),
-  "case_id" numeric(38),
-  "study_key" numeric(38),
-  "study_num" varchar(35),
-  "study_type" numeric(38),
-  "center_id" numeric(38),
-  "center_name" varchar(40),
-  "protocol_id" numeric(38),
-  "protocol_num" varchar(40),
-  "other_id" varchar(20),
-  "code_broken" numeric(38),
-  "broken_by" numeric(38),
-  "broken_date" date,
-  "reason" varchar(100),
-  "week" varchar(5),
-  "visit" varchar(5),
-  "deleted" date,
-  "product_count" numeric(2,0),
-  "classification_id" numeric(38),
-  "blind_name" varchar(70),
-  "study_desc" varchar(3900),
-  "study_desc_j" varchar(3900),
-  "blind_name_j" varchar(70),
-  "center_name_j" varchar(40),
-  "clin_compound_num_j" varchar(70),
-  "protocol_num_j" varchar(40),
-  "study_num_j" varchar(35),
-  "dev_phase_id" numeric(38),
-  "dlp_revision_number" numeric(38),
-  "revision_delete_flag" number default 0,
-  "deleted_flag" numeric(1,0),
-  "effective_start_date" date,
-  "effective_end_date" date,
+)
+
+create table rm_case_study
+(
+  "enterprise_id" numeric(38),
+  "case_id" numeric(38),
+  "study_key" numeric(38),
+  "study_num" varchar(35),
+  "study_type" numeric(38),
+  "center_id" numeric(38),
+  "center_name" varchar(40),
+  "protocol_id" numeric(38),
+  "protocol_num" varchar(40),
+  "other_id" varchar(20),
+  "code_broken" numeric(38),
+  "broken_by" numeric(38),
+  "broken_date" date,
+  "reason" varchar(100),
+  "week" varchar(5),
+  "visit" varchar(5),
+  "deleted" date,
+  "product_count" numeric(2,0),
+  "classification_id" numeric(38),
+  "blind_name" varchar(70),
+  "study_desc" varchar(3900),
+  "study_desc_j" varchar(3900),
+  "blind_name_j" varchar(70),
+  "center_name_j" varchar(40),
+  "clin_compound_num_j" varchar(70),
+  "protocol_num_j" varchar(40),
+  "study_num_j" varchar(35),
+  "dev_phase_id" numeric(38),
+  "dlp_revision_number" numeric(38),
+  "revision_delete_flag" number default 0,
+  "deleted_flag" numeric(1,0),
+  "effective_start_date" date,
+  "effective_end_date" date,
   "cohort_id" number
-)
-
-create table "rm_lm_case_classification"
-(
-  "enterprise_id" numeric(38),
-  "classification_id" numeric(38),
-  "description" varchar(30),
-  "protected" numeric(38),
-  "display" numeric(38),
-  "description_j" varchar(30),
-  "deleted" date,
+)
+
+create table rm_lm_case_classification
+(
+  "enterprise_id" numeric(38),
+  "classification_id" numeric(38),
+  "description" varchar(30),
+  "protected" numeric(38),
+  "display" numeric(38),
+  "description_j" varchar(30),
+  "deleted" date,
   "e2b_code" number
-)
-
-create table "rm_lm_causality"
-(
-  "enterprise_id" numeric(38),
-  "causality_id" numeric(38),
-  "causality" varchar(35),
-  "reportability" numeric(38),
-  "protected" numeric(38),
-  "display" numeric(38),
-  "causality_j" varchar(35),
+)
+
+create table rm_lm_causality
+(
+  "enterprise_id" numeric(38),
+  "causality_id" numeric(38),
+  "causality" varchar(35),
+  "reportability" numeric(38),
+  "protected" numeric(38),
+  "display" numeric(38),
+  "causality_j" varchar(35),
   "deleted" date
-)
-
-create table "rm_lm_countries"
-(
-  "enterprise_id" numeric(38),
-  "country_id" numeric(38),
-  "country" varchar(50),
-  "a2" varchar(2),
-  "a3" varchar(3),
-  "num" numeric(38),
-  "protected" numeric(38),
-  "deleted" date,
-  "country_group_id" numeric(38),
-  "country_group" varchar(50),
-  "country_j" varchar(50),
+)
+
+create table rm_lm_countries
+(
+  "enterprise_id" numeric(38),
+  "country_id" numeric(38),
+  "country" varchar(50),
+  "a2" varchar(2),
+  "a3" varchar(3),
+  "num" numeric(38),
+  "protected" numeric(38),
+  "deleted" date,
+  "country_group_id" numeric(38),
+  "country_group" varchar(50),
+  "country_j" varchar(50),
   "group_2_country" number
-)
-
-create table "rm_lm_product"
-(
-  "enterprise_id" numeric(38),
-  "product_id" numeric(38),
-  "prod_name" varchar(70),
-  "family_id" numeric(38),
-  "formulation_id" numeric(38),
-  "manufacturer_id" numeric(38),
-  "concentration" varchar(10),
-  "conc_unit_id" numeric(38),
-  "indication_id" varchar(50),
-  "code_dict" numeric(38),
-  "indication_text" varchar(250),
-  "intl_birth_date" date,
-  "model_no" varchar(20),
-  "drl_id" varchar(45),
-  "drug_code" varchar(20),
-  "deleted" date,
-  "prod_generic_name" varchar(3900),
-  "prod_generic_name_j" varchar(3900),
-  "ind_llt_code" varchar(50),
-  "ind_llt" varchar(250),
-  "ind_hlt_code" varchar(50),
-  "ind_hlt" varchar(250),
-  "ind_hlgt_code" varchar(50),
-  "ind_hlgt" varchar(250),
-  "ind_soc_code" varchar(50),
-  "ind_soc" varchar(250),
-  "ind_syn_code" numeric(38),
-  "ind_code_status" numeric(38),
-  "medicinal_prod_id" varchar(10),
-  "prod_name_abbrv" varchar(5),
-  "device_code" varchar(50),
-  "psur_group_name" varchar(50),
-  "comments" varchar(1000),
-  "ind_coded" varchar(250),
-  "ind_reptd" varchar(250),
-  "drl_id_j" varchar(45),
-  "drug_code_j" varchar(20),
-  "drug_code_type_j" numeric(38),
-  "indication_text_j" varchar(250),
-  "ind_code_status_j" numeric(38),
-  "ind_hlgt_j" varchar(250),
-  "ind_hlt_j" varchar(250),
-  "ind_llt_code_j" varchar(50),
-  "ind_llt_j" varchar(250),
-  "ind_soc_j" varchar(250),
-  "prod_name_j" varchar(70),
-  "ind_syn_code_j" numeric(38),
-  "ind_coded_j" varchar(250),
-  "ind_reptd_j" varchar(250),
-  "dev_intl_birth_date" date,
+)
+
+create table rm_lm_product
+(
+  "enterprise_id" numeric(38),
+  "product_id" numeric(38),
+  "prod_name" varchar(70),
+  "family_id" numeric(38),
+  "formulation_id" numeric(38),
+  "manufacturer_id" numeric(38),
+  "concentration" varchar(10),
+  "conc_unit_id" numeric(38),
+  "indication_id" varchar(50),
+  "code_dict" numeric(38),
+  "indication_text" varchar(250),
+  "intl_birth_date" date,
+  "model_no" varchar(20),
+  "drl_id" varchar(45),
+  "drug_code" varchar(20),
+  "deleted" date,
+  "prod_generic_name" varchar(3900),
+  "prod_generic_name_j" varchar(3900),
+  "ind_llt_code" varchar(50),
+  "ind_llt" varchar(250),
+  "ind_hlt_code" varchar(50),
+  "ind_hlt" varchar(250),
+  "ind_hlgt_code" varchar(50),
+  "ind_hlgt" varchar(250),
+  "ind_soc_code" varchar(50),
+  "ind_soc" varchar(250),
+  "ind_syn_code" numeric(38),
+  "ind_code_status" numeric(38),
+  "medicinal_prod_id" varchar(10),
+  "prod_name_abbrv" varchar(5),
+  "device_code" varchar(50),
+  "psur_group_name" varchar(50),
+  "comments" varchar(1000),
+  "ind_coded" varchar(250),
+  "ind_reptd" varchar(250),
+  "drl_id_j" varchar(45),
+  "drug_code_j" varchar(20),
+  "drug_code_type_j" numeric(38),
+  "indication_text_j" varchar(250),
+  "ind_code_status_j" numeric(38),
+  "ind_hlgt_j" varchar(250),
+  "ind_hlt_j" varchar(250),
+  "ind_llt_code_j" varchar(50),
+  "ind_llt_j" varchar(250),
+  "ind_soc_j" varchar(250),
+  "prod_name_j" varchar(70),
+  "ind_syn_code_j" numeric(38),
+  "ind_coded_j" varchar(250),
+  "ind_reptd_j" varchar(250),
+  "dev_intl_birth_date" date,
   "comments_j" varchar(1000)
-)
-
-create table "rm_lm_product_family"
-(
-  "enterprise_id" numeric(38),
-  "family_id" numeric(38),
-  "name" varchar(40),
-  "primary_view" numeric(38),
-  "deleted" date,
-  "product_group_id" numeric(38),
-  "comments" varchar(1000),
-  "search_equation_number" varchar(10),
-  "name_j" varchar(40),
+)
+
+create table rm_lm_product_family
+(
+  "enterprise_id" numeric(38),
+  "family_id" numeric(38),
+  "name" varchar(40),
+  "primary_view" numeric(38),
+  "deleted" date,
+  "product_group_id" numeric(38),
+  "comments" varchar(1000),
+  "search_equation_number" varchar(10),
+  "name_j" varchar(40),
   "comments_j" varchar(1000)
-)
-
-create table "rm_lm_report_type"
-(
-  "enterprise_id" numeric(38),
-  "rpt_type_id" numeric(38),
-  "report_type" varchar(30),
-  "protected" numeric(38),
-  "display" numeric(38),
-  "incl_lit" numeric(38),
-  "incl_trial" numeric(38),
-  "e2b_code" numeric(38),
-  "abrv" varchar(3),
-  "investigational" numeric(38),
-  "report_type_j" varchar(30),
-  "deleted" date,
+)
+
+create table rm_lm_report_type
+(
+  "enterprise_id" numeric(38),
+  "rpt_type_id" numeric(38),
+  "report_type" varchar(30),
+  "protected" numeric(38),
+  "display" numeric(38),
+  "incl_lit" numeric(38),
+  "incl_trial" numeric(38),
+  "e2b_code" numeric(38),
+  "abrv" varchar(3),
+  "investigational" numeric(38),
+  "report_type_j" varchar(30),
+  "deleted" date,
   "incl_research" number
-)
-
-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(1),
-  "term_weight" numeric(38),
-  "term_status" varchar(1),
-  "term_addition_version" varchar(5),
+)
+
+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(1),
+  "term_weight" numeric(38),
+  "term_status" varchar(1),
+  "term_addition_version" varchar(5),
   "term_last_modified_version" varchar(5)
-)
-
-create table "rm_meddra_smq_list"
-(
-  "global_dict_id" numeric(38),
-  "smq_code" numeric(38),
-  "smq_name" varchar(100),
-  "smq_level" numeric(38),
-  "smq_description" varchar(3000),
-  "smq_source" varchar(2000),
-  "smq_note" varchar(2000),
-  "meddra_version" varchar(5),
-  "status" varchar(1),
+)
+
+create table rm_meddra_smq_list
+(
+  "global_dict_id" numeric(38),
+  "smq_code" numeric(38),
+  "smq_name" varchar(100),
+  "smq_level" numeric(38),
+  "smq_description" varchar(3000),
+  "smq_source" varchar(2000),
+  "smq_note" varchar(2000),
+  "meddra_version" varchar(5),
+  "status" varchar(1),
   "smq_algorithm" varchar(100)
-)
+)


Adding a little more description, and a link back to pauldoo.com.

--- ClojureScript/hello.cljs
+++ ClojureScript/hello.cljs
@@ -374,6 +374,15 @@
                 (dom/createDom "div" {}
                     (dom/createTextNode "My code lives here: ")
                     (dom/createDom "a" (.strobj {"href" my-code-url}) my-code-url))
-                button
-                canvas)))))
-
+                (dom/createDom "div" {}
+                    (dom/createTextNode "This was my entry for the ")
+                    (dom/createDom "a" (.strobj {"href" "http://groups.google.com/group/techmeetup/browse_thread/thread/e9462c7a7815aee"}) "2011 christmas competition")
+                    (dom/createTextNode " at ")
+                    (dom/createDom "a" (.strobj {"href" "http://techmeetup.co.uk"}) "TechMeetup")
+                    (dom/createTextNode ".")
+                )
+                canvas
+                (dom/createDom "div" {}
+                    (dom/createDom "a" (.strobj {"href" "http://pauldoo.com/"}) "http://pauldoo.com/"))
+                )))))
+


adding spacing between the header navigation and the chunks

--- src-cljs/bitfondue/core.cljs
+++ src-cljs/bitfondue/core.cljs
@@ -54,6 +54,7 @@
   []
   [:div
    [header]
+   [:br]
    [chunks]])

 ;; ---


move the EventType into the :import section

--- src-cljs/bitfondue/core.cljs
+++ src-cljs/bitfondue/core.cljs
@@ -1,12 +1,12 @@
 (ns ^:figwheel-always bitfondue.core
-    (:require [reagent.core :as reagent :refer [atom]]
-              [ajax.core :refer [GET]]
-              [secretary.core :as secretary :refer-macros [defroute]]
-              [goog.events :as events]
-              [goog.history.EventType :as EventType])
-    (:import goog.History))

 ;; define your app data so that it doesn't get over-written on reload
+
+  (:require [reagent.core :as reagent :refer [atom]]
+            [ajax.core :refer [GET]]
+            [secretary.core :as secretary :refer-macros [defroute]]
+            [goog.events :as events])
+  (:import [goog.history Html5History EventType]))

 (defonce chunks-state (atom '()))


Add dev helpers

Add dev helpers

--- tutorial.moan/dev/dev.clj
+++ tutorial.moan/dev/dev.clj
@@ -1,5 +1,7 @@
 (ns dev
   (:require
-    [dev-extras :refer :all]))
+    [dev-extras :refer :all]
+    [tutorial.moan.db :as db]
+    [tutorial.moan.lib :refer :all]))

 ;; Add your helpers here


test-runner - remove explicit devtools dep and init now done via :preloads

--- test/re-frame/test_runner.cljs
+++ test/re-frame/test_runner.cljs
@@ -3,14 +3,12 @@
   (:require
     [cljs.test :as cljs-test :include-macros true]
     [jx.reporter.karma :as karma :include-macros true]
-    [devtools.core :as devtools]
     ;; Test Namespaces -------------------------------
     [re-frame.interceptor-test]
     [re-frame.subs-test]
     [re-frame.fx-test]))

 (enable-console-print!)
-(devtools/install! [:custom-formatters :sanity-hints]) ;; we love https://github.com/binaryage/cljs-devtools

 ;; ---- BROWSER based tests ----------------------------------------------------
 (defn ^:export set-print-fn! [f]


Addapt users frontend related ns to path and storage api changes.

--- src/uxbox/frontend/users.clj
+++ src/uxbox/frontend/users.clj
@@ -9,14 +9,14 @@
             [promesa.core :as p]
             [catacumba.http :as http]
             [storages.core :as st]
+            [storages.util :as path]
             [uxbox.media :as media]
             [uxbox.images :as images]
             [uxbox.schema :as us]
             [uxbox.services :as sv]
             [uxbox.services.users :as svu]
             [uxbox.util.response :refer (rsp)]
-            [uxbox.util.uuid :as uuid]
-            [uxbox.util.paths :as paths]))
+            [uxbox.util.uuid :as uuid]))

 ;; --- Helpers

@@ -80,7 +80,7 @@
 (defn update-photo
   [{user :identity data :data}]
   (letfn [(store-photo [file]
-            (let [filename (paths/base-name file)
+            (let [filename (path/base-name file)
                   storage media/images-storage]
               (st/save storage filename file)))
           (assign-photo [path]


Fix a error in the 'show-duration'

Fix a error in the 'show-duration'

--- src/whisper2cyanite/core.clj
+++ src/whisper2cyanite/core.clj
@@ -332,7 +332,7 @@
         duration-pp (.print formatter (.toPeriod interval))
         duration-sec (.getSeconds (.toStandardSeconds (.toDuration interval)))
         duration-str (format "Duration: %ss%s" duration-sec
-                             (if (duration-sec > 59)
+                             (if (> duration-sec 59)
                                (format " (%s)" duration-pp) ""))]
     (log/info duration-str)
     (newline)


Fix calc-size

Fix calc-size

--- src/whisper2cyanite/core.clj
+++ src/whisper2cyanite/core.clj
@@ -161,7 +161,7 @@
         points)
       (process-path [this path file])
       (fetch-data? [this]
-        true))))
+        false))))

 (defn- process-archive
   "Process an archive."
@@ -170,10 +170,11 @@
         points (:points archive)
         period (if retention (/ retention rollup) points)
         retention (if retention retention (* rollup points))
-        data (if (fetch-data? processor)
+        fetch? (fetch-data? processor)
+        data (if fetch?
                (whisper/fetch-archive-seq-ra ra-file file archive from to) nil)
         series (if data (whisper/remove-nulls (:series data)) nil)]
-    (when (not-empty series)
+    (when (or (not-empty series) (not fetch?))
       (process-metrics processor rollup period retention points path
                        file series))))


Initial work on text element options.

Initial work on text element options.

--- src/uxbox/ui/workspace/sidebar/options.cljs
+++ src/uxbox/ui/workspace/sidebar/options.cljs
@@ -22,14 +22,15 @@
 ;; Constants
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(def ^:static ^:private +menus-map+
+(def ^:const ^:private +menus-map+
   {:builtin/icon [:menu/icon-measures :menu/fill :menu/stroke]
    :builtin/rect [:menu/rect-measures :menu/fill :menu/stroke]
    :builtin/line [:menu/line-measures :menu/stroke]
    :builtin/circle [:menu/circle-measures :menu/fill :menu/stroke]
+   :builtin/text [:menu/text]
    :builtin/group []})

-(def ^:static ^:private +menus-by-id+
+(def ^:const ^:private +menus-by-id+
   {:menu/icon-measures
    {:name "Size, position & rotation"
     :icon i/infocard}
@@ -52,7 +53,11 @@

    :menu/stroke
    {:name "Stroke"
-    :icon i/stroke}})
+    :icon i/stroke}
+
+   :menu/text
+   {:name "Text"
+    :icon i/text}})

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Implementation
@@ -95,7 +100,7 @@
          [:option {:value ":dotted"} "Dotted"]
          [:option {:value ":dashed"} "Dashed"]
          [:option {:value ":mixed"} "Mixed"]]
-        [:input#width.input-text
+        [:input.input-text
         {:placeholder "Width"
         :type "number"
         :min "0"
@@ -107,7 +112,7 @@
        (colorpicker :options #(change-stroke {:color (:hex %)}))

        [:div.row-flex
-        [:input#width.input-text
+        [:input.input-text
          {:placeholder "#"
           :type "text"
           :value (:stroke shape "")
@@ -148,7 +153,7 @@
        [:span "Color"]
        (colorpicker :options on-color-picker-event)
        [:div.row-flex
-        [:input#width.input-text
+        [:input.input-text
          {:placeholder "#"
           :type "text"
           :value (:fill shape "")
@@ -200,14 +205,14 @@
          ;; SLIDEBAR FOR ROTATION AND OPACITY
          [:span "Size"]
          [:div.row-flex
-          [:input#width.input-text
+          [:input.input-text
            {:placeholder "Width"
             :type "number"
             :min "0"
             :value (:width size)
             :on-change (partial on-size-change :width)}]
           [:div.lock-size i/lock]
-          [:input#width.input-text
+          [:input.input-text
            {:placeholder "Height"
             :type "number"
             :min "0"
@@ -216,12 +221,12 @@

          [:span "Position"]
          [:div.row-flex
-          [:input#width.input-text
+          [:input.input-text
            {:placeholder "x"
             :type "number"
             :value (:x1 shape "")
             :on-change (partial on-pos-change :x)}]
-          [:input#width.input-text
+          [:input.input-text
            {:placeholder "y"
             :type "number"
             :value (:y1 shape "")
@@ -229,13 +234,13 @@

          [:span "Border radius"]
          [:div.row-flex
-          [:input#width.input-text
+          [:input.input-text
            {:placeholder "rx"
             :type "number"
             :value (:rx shape "")
             :on-change (partial on-border-change :rx)}]
           [:div.lock-size i/lock]
-          [:input#width.input-text
+          [:input.input-text
            {:placeholder "ry"
             :type "number"
             :value (:ry shape "")
@@ -251,7 +256,7 @@
             :on-change on-rotation-change}]]

          [:div.row-flex
-          [:input#width.input-text
+          [:input.input-text
            {:placeholder ""
             :type "number"
             :min 0
@@ -292,14 +297,14 @@
          ;; SLIDEBAR FOR ROTATION AND OPACITY
          [:span "Size"]
          [:div.row-flex
-          [:input#width.input-text
+          [:input.input-text
            {:placeholder "Width"
             :type "number"
             :min "0"
             :value (:width size)
             :on-change (partial on-size-change :width)}]
           [:div.lock-size i/lock]
-          [:input#width.input-text
+          [:input.input-text
            {:placeholder "Height"
             :type "number"
             :min "0"
@@ -308,12 +313,12 @@

          [:span "Position"]
          [:div.row-flex
-          [:input#width.input-text
+          [:input.input-text
            {:placeholder "x"
             :type "number"
             :value (:x1 shape "")
             :on-change (partial on-pos-change :x)}]
-          [:input#width.input-text
+          [:input.input-text
            {:placeholder "y"
             :type "number"
             :value (:y1 shape "")
@@ -329,7 +334,7 @@
             :on-change on-rotation-change}]]

          [:div.row-flex
-          [:input#width.input-text
+          [:input.input-text
            {:placeholder ""
             :type "number"
             :min 0
@@ -368,14 +373,14 @@
        ;; SLIDEBAR FOR ROTATION AND OPACITY
        [:span "Size"]
        [:div.row-flex
-        [:input#width.input-text
+        [:input.input-text
          {:placeholder "Width"
           :type "number"
           :min "0"
           :value (:rx shape)
           :on-change (partial on-size-change :rx)}]
         [:div.lock-size i/lock]
-        [:input#width.input-text
+        [:input.input-text
          {:placeholder "Height"
           :type "number"
           :min "0"
@@ -384,12 +389,12 @@

        [:span "Position"]
        [:div.row-flex
-        [:input#width.input-text
+        [:input.input-text
          {:placeholder "cx"
           :type "number"
           :value (:cx shape "")
           :on-change (partial on-pos-change :x)}]
-        [:input#width.input-text
+        [:input.input-text
          {:placeholder "cy"
           :type "number"
           :value (:cy shape "")
@@ -405,7 +410,7 @@
           :on-change on-rotation-change}]]

        [:div.row-flex
-        [:input#width.input-text
+        [:input.input-text
          {:placeholder ""
           :type "number"
           :min 0
@@ -437,24 +442,24 @@
       [:div.element-set-content
        [:span "Position"]
        [:div.row-flex
-        [:input#width.input-text
+        [:input.input-text
          {:placeholder "x1"
           :type "number"
           :value (:x1 shape "")
           :on-change (partial on-pos-change :x1)}]
-        [:input#width.input-text
+        [:input.input-text
          {:placeholder "y1"
           :type "number"
           :value (:y1 shape "")
           :on-change (partial on-pos-change :y1)}]]

        [:div.row-flex
-        [:input#width.input-text
+        [:input.input-text
          {:placeholder "x2"
           :type "number"
           :value (:x2 shape "")
           :on-change (partial on-pos-change :x2)}]
-        [:input#width.input-text
+        [:input.input-text
          {:placeholder "y2"
           :type "number"
           :value (:y2 shape "")
@@ -470,7 +475,7 @@
           :on-change on-rotation-change}]]

        [:div.row-flex
-        [:input#width.input-text
+        [:input.input-text
          {:placeholder ""
           :type "number"
           :min 0
@@ -482,6 +487,47 @@
          {:style {:visibility "hidden"}}]
         ]]]
      )))
+
+(defmethod -render-menu :menu/text
+  [menu own shape]
+  (letfn [(on-font-family-change [event]
+            (let [value (dom/event->value event)
+                  sid (:id shape)]
+              (println "on-font-family-change" value)))
+          (on-font-size-change [event]
+            (let [value (dom/event->value event)
+                  value (parse-int value)
+                  sid (:id shape)]
+              (println "on-font-size-change" value)))
+          (on-font-weight-change [event]
+            (let [value (dom/event->value event)
+                  value (read-string value)
+                  sid (:id shape)]
+              (println "on-font-size-change" value)))]
+    (html
+     [:div.element-set {:key (str (:id menu))}
+      [:div.element-set-title (:name menu)]
+      [:div.element-set-content
+       [:span "Font family"]
+       [:div.row-flex
+        [:select.input-select {:value (:font-family shape "sans-serif")
+                                     :on-change on-font-family-change}
+         [:option {:value "sans-serif"} "Sans Serif"]
+         [:option {:value "monospace"} "Monospace"]]]
+
+       [:span "Size and Weight"]
+       [:div.row-flex
+        [:input.input-text
+         {:placeholder "Font Size"
+          :type "number"
+          :min "0"
+          :max "200"
+          :value (:font-size shape "16")
+          :on-change on-font-size-change}]
+        [:select.input-select {:value (:font-weight shape ":normal")
+                                     :on-change on-font-weight-change}
+         [:option {:value ":normal"} "Normal"]
+         [:option {:value ":bold"} "Solid"]]]]])))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Components


Fixes #32

Fixes #32

--- test/clojurewerkz/cassaforte/utils_test.clj
+++ test/clojurewerkz/cassaforte/utils_test.clj
@@ -1,4 +1,4 @@
-(ns clojurewerkz.cassaforte.iterate-world-test
+(ns clojurewerkz.cassaforte.utils-test
   (:require [clojurewerkz.cassaforte.test-helper :as th]
             [clojurewerkz.cassaforte.cql :refer :all]
             [clojure.test :refer :all]


Adjust time deltas in tests due to latency of CI executed tests.

--- test/dsbdp/test/experiment_helper_tests.clj
+++ test/dsbdp/test/experiment_helper_tests.clj
@@ -111,20 +111,20 @@
     ((proc-fns 0) in-data nil)
     (reset! end-time (System/nanoTime))
     (is (> (- @end-time @start-time) 100000))
-    (is (< (- @end-time @start-time) 250000))
+    (is (< (- @end-time @start-time) 300000))
     (reset! start-time (System/nanoTime))
     ((proc-fns 1) in-data nil)
     (reset! end-time (System/nanoTime))
     (is (> (- @end-time @start-time) 200000))
-    (is (< (- @end-time @start-time) 350000))
+    (is (< (- @end-time @start-time) 400000))
     (reset! start-time (System/nanoTime))
     ((proc-fns 2) in-data nil)
     (reset! end-time (System/nanoTime))
     (is (> (- @end-time @start-time) 300000))
-    (is (< (- @end-time @start-time) 450000))
+    (is (< (- @end-time @start-time) 500000))
     (reset! start-time (System/nanoTime))
     ((proc-fns 3) in-data nil)
     (reset! end-time (System/nanoTime))
     (is (> (- @end-time @start-time) 400000))
-    (is (< (- @end-time @start-time) 550000))))
+    (is (< (- @end-time @start-time) 600000))))


WIP on split function.  Now mostly works, need to implement the wrappers.

--- PersistentDataStructures/finger_trees.clj
+++ PersistentDataStructures/finger_trees.clj
@@ -1,4 +1,7 @@
 ; :mode=clojure:
+
+;(.printStackTrace *e)
+;for i in /tmp/*.dot ; do echo $i && dot -Tsvg $i -o $i.svg; done

 (defrecord monoid [measure-fn combine-fn])
 (defrecord node-2 [v a b])
@@ -6,6 +9,12 @@
 (defrecord finger-tree-empty [monoid])
 (defrecord finger-tree-single [monoid e])
 (defrecord finger-tree-deep [monoid v l m r])
+
+(declare
+    view-left
+    view-right
+    to-tree
+    to-list)

 (derive Object ::any)

@@ -38,23 +47,60 @@
     (finger-tree-single. monoid e))
 (defn make-finger-tree-deep [monoid l m r]
     (if (delay? m)
-        (finger-tree-deep.
-            monoid
-            (delay (apply
-                (:combine-fn monoid)
-                (map
-                    (fn [e] (extract-measure e monoid))
-                    (concat
-                        l
-                        ((fn [v] (if (nil? v) [] [v])) (force m))
-                        r))))
-            l m r)
+        (if (or
+                (and (not (empty? l)) (not (empty? r)))
+                (instance? finger-tree-empty (force m)))
+            (finger-tree-deep.
+                monoid
+                (delay (apply
+                    (:combine-fn monoid)
+                    (map
+                        (fn [e] (extract-measure e monoid))
+                        (concat
+                            l
+                            ((fn [v] (if (nil? v) [] [v])) (force m))
+                            r))))
+                (vec l) m (vec r))
+            (throw (IllegalArgumentException. "middle tree is not empty, but a digit is")))
         (throw (IllegalArgumentException. "middle tree is not a delay"))))

 ; Reverse cons
 (defn snoc [a lst] (concat lst [a]))
 ; Reverse rest
 (defn tser [lst] (take (dec (count lst)) lst))
+
+
+(defn deep-l [monoid l m r]
+    (if (empty? l)
+        (let [view (view-left (force m))]
+            (if (nil? view)
+                (to-tree monoid r)
+                (let [[a mp] view]
+                    (make-finger-tree-deep monoid (to-list a) mp r))))
+        (make-finger-tree-deep monoid l m r)))
+
+(defn deep-r [monoid l m r]
+    (if (empty? r)
+        (let [view (view-right (force m))]
+            (if (nil? view)
+                (to-tree monoid l)
+                (let [[a mp] view]
+                    (make-finger-tree-deep monoid l mp (to-list a)))))
+        (make-finger-tree-deep monoid l m r)))
+
+(defmulti view-left (fn [tree] (class tree)))
+(defmethod view-left finger-tree-empty [_] nil)
+(defmethod view-left finger-tree-single [{e :e monoid :monoid}]
+    [e (delay (make-finger-tree-empty monoid))])
+(defmethod view-left finger-tree-deep [{monoid :monoid l :l m :m r :r}]
+    [(first l) (delay (deep-l monoid (rest l) m r))])
+
+(defmulti view-right (fn [tree] (class tree)))
+(defmethod view-right finger-tree-empty [_] nil)
+(defmethod view-right finger-tree-single [{e :e monoid :monoid}]
+    [e (delay (make-finger-tree-empty monoid))])
+(defmethod view-right finger-tree-deep [{monoid :monoid l :l m :m r :r}]
+    [(last r) (delay (deep-r monoid l m (tser r)))])

 ; Adds a new element to the front of the finger tree
 (defmulti push-front (fn [tree value] (class tree)))
@@ -102,6 +148,8 @@
         1 [(make-node-3 monoid a b (first r))]
         2 [(make-node-2 monoid a b) (apply make-node-2 monoid r)]
         (cons (make-node-3 monoid a b (first r)) (apply nodes monoid (rest r)))))
+
+(defn force-early [d] (do (force d) d))

 (defmulti app3 (fn [l m r] [(class l) (class r)]))
 (defmethod app3 [finger-tree-empty ::any] [l m r]
@@ -126,10 +174,10 @@
     (make-finger-tree-deep
         (:monoid l)
         (:l l)
-        (app3
+        (force-early (delay (app3
             (force (:m l))
             (apply nodes (:monoid l) (concat (:r l) m (:l r)))
-            (force (:m r)))
+            (force (:m r)))))
         (:r r)))

 (prefer-method app3 [finger-tree-empty ::any] [::any finger-tree-empty])
@@ -147,8 +195,21 @@
     (make-finger-tree-deep
         (:monoid a)
         (:l a)
-        (app3 (force (:m a)) (apply nodes (:monoid a) (concat (:r a) (:l b))) (force (:m b)))
+        (force-early (delay (app3 (force (:m a)) (apply nodes (:monoid a) (concat (:r a) (:l b))) (force (:m b)))))
         (:r b)))
+
+(defmulti to-list (fn [tree] (class tree)))
+(defmethod to-list node-2 [{a :a b :b}] [a b])
+(defmethod to-list node-3 [{a :a b :b c :c}] [a b c])
+
+(defn split-digit [p i [a & as] ems cfn]
+    (if (nil? as)
+        [[] a []]
+        (let [ip (cfn i (ems a))]
+            (if (p ip)
+                [[] a as]
+                (let [[l x r] (split-digit p ip as ems cfn)]
+                    [(cons a l) x r])))))

 (defmulti split-tree (fn [tree p i] (class tree)))
 (defmethod split-tree finger-tree-single [{e :e m :monoid} _ _]
@@ -156,17 +217,19 @@
 (defmethod split-tree finger-tree-deep [{monoid :monoid l :l m :m r :r} p i]
     (let [cfn (:combine-fn monoid)
             ems (fn [v] (extract-measure v monoid))
-            vl (cfn i (ems l))
-            vm (cfn vl (ems m))]
+            vl (cfn i (apply + (map ems l)))
+            vm (cfn vl (ems (force m)))]
         (if (p vl)
-            (let [[a b c] (split-digit p i l)]
-                [(to-tree a) b (make-finger-tree-deep monoid c m r)])
+            (let [[a b c] (split-digit p i l ems cfn)]
+                [(to-tree monoid a) b (deep-l monoid c m r)])
             (if (p vm)
-                (let [[ma mb mc] (split-tree p vl m)
-                        [a b c] (split-digit p (cfn vl (ems ma)) (to-list mb))]
-                    [(make-finger-tree-deep monoid l ma a) b (make-finger-tree-deep c mc)])
-                (let [[a b c] (split-digit p vm r)]
-                    [(make-finger-tree-deep monoid l m a) b (to-tree c)])))))
+                (let [[ma mb mc] (split-tree (force m) p vl)
+                        [a b c] (split-digit p (cfn vl (ems ma)) (to-list mb) ems cfn)]
+                        [(deep-r monoid l (delay ma) a)
+                        b
+                        (deep-l monoid c (delay mc) r)])
+                (let [[a b c] (split-digit p vm r ems cfn)]
+                    [(deep-r monoid l m a) b (to-tree monoid c)])))))

 ; Functions to print finger-trees to graphviz
 (defn object-id [x] (System/identityHashCode x))
@@ -220,24 +283,36 @@
 (def count-monoid
     (monoid. (fn [_] 1) +))

-(defn go [t vec func filename]
+(defn go [t vec func]
     (do
         (println t "\n")
         (if (empty? vec)
-            (do
-                (print-finger-tree-to-file t filename)
-                t)
-            (go (func t (first vec)) (rest vec) func filename))))
+            t
+            (go (func t (first vec)) (rest vec) func))))

 (println "Forwards..")
-(def t1 (go (make-finger-tree-empty count-monoid) (range 1 20) push-front "/tmp/forwards.dot"))
+(def t1 (go (make-finger-tree-empty count-monoid) (range 0 20) push-front))
+(print-finger-tree-to-file t1 "/tmp/forwards.dot")
+
+(println "Splitting")
+
+(defn split-test [tree idx]
+    (let [[l x r] (split-tree tree (fn [i] (< idx i)) 0)]
+        (do
+            (print-finger-tree-to-file l (str "/tmp/forwards-t1-" (print-str idx) "-l.dot"))
+            (print-finger-tree-to-file r (str "/tmp/forwards-t1-" (print-str idx) "-r.dot"))
+            x)))
+
+(doall (map (fn [x] (split-test t1 x)) (range -3 23)))

 (println "Backwards..")
-(def t2 (go (make-finger-tree-empty count-monoid) (range 20 40) push-back "/tmp/backwards.dot"))
+(def t2 (go (make-finger-tree-empty count-monoid) (range 20 40) push-back))
+(print-finger-tree-to-file t2 "/tmp/backwards.dot")

 (print-finger-tree-to-file
     (concatenate t1 t2)
     "/tmp/concat1.dot")
+
 (print-finger-tree-to-file
     (concatenate t2 t1)
     "/tmp/concat2.dot")


Build using multiple jobs by default

Build using multiple jobs by default

--- make/makefile.boot
+++ make/makefile.boot
@@ -79,6 +79,8 @@
 WITH_TCC?= no
 STATIC?= no

+NUM_JOBS?=4
+
 # UP - some systems do not use ../
 UP= ..
 # CD - some systems do not use ./
@@ -100,7 +102,7 @@
 top: makefile
 	$(MAKE) clean
 	$(MAKE) prep
-	$(MAKE) top
+	$(MAKE) -j $(NUM_JOBS) top

 # .FORCE is a file assumed to not exist, and is an idiom in makefiles to have
 # a null "phony target" you can use as a dependency for a target representing


Рефакторинг...

Рефакторинг...

--- radiolamp-6P3/src/r6p3/core.clj
+++ radiolamp-6P3/src/r6p3/core.clj
@@ -1,10 +1,6 @@
 (ns r6p3.core
-
   (:use clojure.pprint)
-
-
   (:import [org.imgscalr Scalr])
-
   (:require [clojure.data :as clojure-data]
             [korma.db :as kdb]
             [korma.core :as kc]
@@ -23,9 +19,7 @@

             [cemerick.friend :as friend]
             (cemerick.friend [workflows :as workflows]
-                             [credentials :as creds])
-            )
-  )
+                             [credentials :as creds])))

 (declare print-debug->>>)
@@ -172,42 +166,50 @@
                           (.setOmitComments true)))

-(defn html-clean-tags [s]
+(defn html-clean-tags
+  "clean and replace string of html spec tags"
+  [s]
   (when s
-    (-> (org.htmlcleaner.HtmlCleaner. html-cleaner-props)
-        (.clean s)
-        .getText
-        str
-        (clojure.string/replace #" " " ")
-        (clojure.string/replace #"£" "£")
-        (clojure.string/replace #"€" "€")
-        (clojure.string/replace #"¶" "¶")
-        (clojure.string/replace #"§" "§")
-        (clojure.string/replace #"©" "©")
-        (clojure.string/replace #"®" "®")
-        (clojure.string/replace #"™" "™")
-        (clojure.string/replace #"°" "°")
-        (clojure.string/replace #"±" "±")
-        (clojure.string/replace #"×" "×")
-        (clojure.string/replace #"÷" "÷")
-        (clojure.string/replace #"ƒ" "ƒ")
-        (clojure.string/replace #""" "\"")
-        (clojure.string/replace #"&" "&")
-        (clojure.string/replace #"<" "<")
-        (clojure.string/replace #">" ">")
-        (clojure.string/replace #"…" "…")
-        (clojure.string/replace #"′" "′")
-        (clojure.string/replace #"″" "″")
-        (clojure.string/replace #"–" "–")
-        (clojure.string/replace #"—" "—")
-        (clojure.string/replace #"‘" "‘")
-        (clojure.string/replace #"’" "’")
-        (clojure.string/replace #"‚" "‚")
-        (clojure.string/replace #"“" "“")
-        (clojure.string/replace #"”" "”")
-        (clojure.string/replace #"„" "„")
-        (clojure.string/replace #"«" "«")
-        (clojure.string/replace #"»" "»"))))
+    (reduce
+
+     (fn [s [m rs]]
+       (clojure.string/replace s m rs))
+
+     (-> (org.htmlcleaner.HtmlCleaner. html-cleaner-props)
+         (.clean s)
+         .getText
+         str)
+
+     (list [#" ", " "]
+           [#"£", "£"]
+           [#"€", "€"]
+           [#"¶", "¶"]
+           [#"§", "§"]
+           [#"©", "©"]
+           [#"®", "®"]
+           [#"™", "™"]
+           [#"°", "°"]
+           [#"±", "±"]
+           [#"×", "×"]
+           [#"÷", "÷"]
+           [#"ƒ", "ƒ"]
+           [#""", "\""]
+           [#"&", "&"]
+           [#"<", "<"]
+           [#">", ">"]
+           [#"…", "…"]
+           [#"′", "′"]
+           [#"″", "″"]
+           [#"–", "–"]
+           [#"—", "—"]
+           [#"‘", "‘"]
+           [#"’", "’"]
+           [#"‚", "‚"]
+           [#"“", "“"]
+           [#"”", "”"]
+           [#"„", "„"]
+           [#"«", "«"]
+           [#"»", "»"]))))

 ;; END html to text tools


Realtime record updates seen working for the first time!

Ok, so it is hardcoded to the todo table for now, but to see it working
was pretty amazing

--- src/webapp/framework/client/coreclient.cljs
+++ src/webapp/framework/client/coreclient.cljs
@@ -1328,6 +1328,20 @@

+(defn get-default-fields-for-data-source [data-source-id]
+
+  (let [fields-atom          (-> @client-datasource-fields  data-source-id)
+        fields-entry         (if fields-atom (into [] @fields-atom))   ]
+
+    ;(log (pr-str "Read fields: " fields-entry))
+
+    (if fields-entry
+      fields-entry)))
+
+
+;(get-default-fields-for-data-source  :cvs)
+
+

@@ -1390,18 +1404,19 @@
              (let [
                    ;xxx          (merge single-changed-realtime-query {:data-source (keyword (get single-changed-realtime-query :db-table)) :realtime true :table nil})
                    ;new-key2     (dissoc (dissoc xxx :start) :end)
+                   record-request    {:source              (keyword the-table)
+                                      :db-table            the-table
+                                      :fields              (get-default-fields-for-data-source  (keyword the-table))
+                                      :id                   id
+                                      :data-session-id     @data-session-id
+                                      :realtime            true
+                                      :force               true
+                                      }
                    ]

                (log "               : " the-table ", " id " = " record)
-               (comment >! client-query-cache-requests  {
-                                                         :query-key     new-key2
-
-                                                         :subset-range  {
-                                                                         :start   (:start  single-changed-realtime-query)
-                                                                         :end     (:end    single-changed-realtime-query)
-                                                                         ;:start    1
-                                                                         ;:end      20
-                                                                         } })
+               (log "               : " record-request)
+                (>! client-record-cache-requests    record-request)
                nil

                )))))
@@ -1609,20 +1624,6 @@

-(defn get-default-fields-for-data-source [data-source-id]
-
-  (let [fields-atom          (-> @client-datasource-fields  data-source-id)
-        fields-entry         (if fields-atom (into [] @fields-atom))   ]
-
-    ;(log (pr-str "Read fields: " fields-entry))
-
-    (if fields-entry
-      fields-entry)))
-
-
-;(get-default-fields-for-data-source  :cvs)
-
-

@@ -1657,30 +1658,19 @@
     (swap!  (get record :queries) conj  query)

-    (let [record-value  (get record :value)]
-
-      (if (not @record-value)
-        (go
-          (>! client-record-cache-requests
-             {:source              (query :data-source)
-              :db-table            (query :db-table)
-              :fields              (get-default-fields-for-data-source (query :data-source))
-              :id                   record-id
-              :query                query
-              :data-session-id     @data-session-id
-              :realtime            (get query :realtime)
-              }))
-        ))))
-
-
-
-
-
-
-
-
-
-
+    (if (not @(get record :value))
+      (go
+       (let [
+             record-request     {:source              (query :data-source)
+                                 :db-table            (query :db-table)
+                                 :fields              (get-default-fields-for-data-source (query :data-source))
+                                 :id                   record-id
+                                 :data-session-id     @data-session-id
+                                 :realtime            (get query :realtime)
+                                 }]
+         (log "    :" record-request)
+         (>! client-record-cache-requests   record-request)))
+      )))

@@ -1854,7 +1844,6 @@
        (if record-value
          (let [
                record-container     (get-or-create-record  source-name  id)
-               queries              (get record-container :queries)
                record-value-atom    (get record-container :value)
                ]


Document lens laws

Document lens laws

--- src/active/clojure/lens.cljc
+++ src/active/clojure/lens.cljc
@@ -1,6 +1,31 @@
 (ns active.clojure.lens)

-;; TODO document lens laws
+;; Lenses should obey the following laws:
+;;
+;; (1) GetPut, or YankShove:
+;;     (= (yank (shove data my-lens val)
+;;              my-lens)
+;;        val)
+;;
+;;     Meaning: you get back what you put in.
+;;
+;; (2) PutGet, or ShoveYank:
+;;     (= (shove data
+;;               my-lens
+;;               (yank data my-lens))
+;;        data)
+;;
+;;     Meaning: putting back what you got does not change anything.
+;;
+;; (3) PutPut, or ShoveShove:
+;;     (= (shove data my-lens val-1)
+;;        (shove (shove data my-lens val-2) my-lens val-1))
+;;
+;;     Meaning: second shove wins, or shoving once is the same as shoving twice.
+;;
+;; A lens that satisfies these three laws is usually called "very well-behaved".
+;;
+;; See also `active.clojure.lens-test/lens-laws-hold`.

 (defn yank
   "Yank a value from the given data value, as defined by the given


Clean up some obsolete bits

Clean up some obsolete bits

--- src/aerobio/htseq/rnaseq.clj
+++ src/aerobio/htseq/rnaseq.clj
@@ -48,7 +48,6 @@
   )

-(def exp-info (atom {}))
 ;;; "/data1/NextSeq/TVOLab/AHL7L3BGXX"
 ;;; "/data1/NextSeq/TVOLab/AHL7L3BGXX/Docs/SampleSheet.csv"
 ;;; "/data1/NextSeq/TVOLab/AHL7L3BGXX/Docs/Exp-AntibioticsRTS_KZ_SD_index.csv"
@@ -153,28 +152,3 @@
    eid recipient "ComparisonSheet.csv" get-toolinfo template))

-
-(defn launch-action
-  [eid recipient get-toolinfo template & {:keys [action rep compfile]}]
-  (prn "LAUNCH: "
-       [eid recipient template action rep compfile])
-  (cond
-    (= action "compare")
-    (let [compfile (if compfile compfile "ComparisonSheet.csv")]
-      (run-rnaseq-comparison eid recipient compfile get-toolinfo template))
-
-    (#{"phase-0" "phase-0b" "phase-0c" "phase-1" "phase-2"} action)
-    (let [phase action]
-      (cond
-        (#{"phase-0" "phase-0b" "phase-0c"} phase)
-        (future
-          (cmn/run-phase-0 eid recipient get-toolinfo template))
-
-        (#{"phase-1"} phase)
-        (future
-          (cmn/run-phase-1 eid recipient get-toolinfo template :repk rep))
-
-        (#{"phase-2"} phase)
-        (run-rnaseq-phase-2 eid recipient get-toolinfo template)))
-
-    :else (str "RNASEQ: unknown action request " action)))


fix handlers that should be fx not db

fix handlers that should be fx not db

--- src/braid/client/events.cljs
+++ src/braid/client/events.cljs
@@ -304,7 +304,7 @@
     (let [current-rules (get (helpers/get-user-preferences state) :notification-rules [])]
       {:dispatch [:set-preference [:notification-rules (conj current-rules rule)]]})))

-(reg-event-db
+(reg-event-fx
   :remove-notification-rule
   (fn [{state :db :as cofx} [_ rule]]
     (let [new-rules (->> (get (helpers/get-user-preferences state) :notification-rules [])
@@ -664,9 +664,9 @@
             state
             tags)))

-(reg-event-db
+(reg-event-fx
   :notify-if-client-out-of-date
-  (fn [state [_ server-checksum]]
+  (fn [cofx [_ server-checksum]]
     (if (not= (aget js/window "checksum") server-checksum)
       {:dispatch [:display-error
                   [:client-out-of-date "Client out of date - please refresh" :info]]}


add python copy

add python copy

--- frontend/components/language_landing.cljs
+++ frontend/components/language_landing.cljs
@@ -46,18 +46,18 @@
                            :author "Aaron Suggs"
                            :title "Operations Engineer @Kickstarter"}]}
    "python" {:language "Python"
-             :headline "CircleCI makes Continous Integration and Deployment for Python projects a breeze."
+             :headline "CircleCI makes continuous Integration and Deployment for Python projects a breeze."
              :logo-path (utils/cdn-path "/img/outer/languages/python-logo.svg")
-             :features [{:feature "CircleCI uses RVM to provide support for a wide variety of Ruby versions and gems. It is also trivial to add any packages or frameworks that are not installed on our machines by default, allowing you to effortlessly customize your test enviroment.  CircleCI also supports Test::Unit, RSpec, Cucumber, Spinach, Jasmine, Konacha, and just about any other testing framework you use for your Ruby project."
-                         :title "Built For Ruby"
+             :features [{:feature "When CircleCI detects a Python project, it automatically uses 'virtualenv' and 'pip' to create an isolated Python environment with all of the dependencies specified in your requirements.txt file. This helps ensure that your CircleCI enviroment replicates your production enviroment and that your projects can be setup quickly."
+                         :title "Built For Python"
                          :icon (utils/cdn-path "/img/outer/languages/gear-icon.svg")}
-                        {:feature "Circle manages all your database requirements for your, such as running your rake commands for creating, loading, and migrating your database. We have pre-installed more than a dozen databases and queues, including PostgreSQL, MySQL, and MongoDB. You can also add custom database commands via your circle.yml."
-                         :title "Database Management"
+                        {:feature "CircleCI intelligently determines the best way to run your tests using 'nosetests', 'tox', or Django. We also provide complete flexibility to override our inferred commands with your own custom commands via the circle.yml."
+                         :title "Intelligent Test Running"
                          :icon (utils/cdn-path "/img/outer/languages/file-icon.svg")}
-                        {:feature "For the majority of Ruby projects no configuration is required; you just run your builds on CircleCI and it works! CircleCI will automatically infer your test commands if you're using Test::Unit, RSpec, Cucumber, Spinach, Jasmine, or Konacha."
-                         :title "Inference That Just Works"
+                        {:feature "CircleCI makes setting up continuous Delivery for your Python application simple and easy. We offer first-class support for deployment to platforms like with Heroku, Elastic Beanstalk, and Google App Engine as well as using tools like Fabric, Ansible, Salt, and others."
+                         :title "Easy continuous Delivery"
                          :icon (utils/cdn-path "/img/outer/languages/book-icon.svg")}]
-             :docs-link "/docs/language-ruby-on-rails"
+             :docs-link "/docs/language-python"
              :testimonials [{:text "The speed is really impressive, the rspec suite alone takes 6 minutes to run on my Macbook Air, but only 2 minutes on Circle."
                              :img (utils/cdn-path "/img/outer/languages/olivier.jpg")
                              :author "Olivier Melcher"
@@ -162,7 +162,7 @@
              [:div.languages-cta-step
               [:div.step-number]
               [:div
-               "Run one of your Ruby projects on Circle"]]
+               "Run one of your " (:language template) " projects on Circle"]]
              [:div.languages-cta-step
               [:div.step-number]
               [:div


Expose view-builds scope for API tokens

Expose view-builds scope for API tokens

Closes #931

--- frontend/components/project_settings.cljs
+++ frontend/components/project_settings.cljs
@@ -911,6 +911,7 @@
    (node
     [:div
      [:p "A token's scope limits what can be done with it."]
+
      [:h5 "Status"]
      [:p
       "Allows read-only access to the build status (passing, failing, etc) of any branch of the project. Its intended use is "
@@ -918,8 +919,14 @@
       " and "
       [:a {:target "_blank", :href "/docs/polling-project-status"} "status polling tools"]
       " for private projects."]
+
+     [:h5 "Build Artifacts"]
+     [:p "Allows read-only access to build artifacts of any branch of the project. Its intended use is for serving files to deployment systems."]
+
      [:h5 "All"]
-     [:p "Allows full read-write access to this project in CircleCI. It is intended for full-fledged API clients which only need to access a single project."]])))
+     [:p "Allows full read-write access to this project in CircleCI. It is intended for full-fledged API clients which only need to access a single project."]
+
+     ])))

 (defn api-tokens [project-data owner]
   (reify
@@ -950,6 +957,7 @@
              [:select {:name "scope" :value scope
                        :on-change #(utils/edit-input controls-ch (conj state/project-data-path :new-api-token :scope) %)}
               [:option {:value "status"} "Status"]
+              [:option {:value "view-builds"} "Build Artifacts"]
               [:option {:value "all"} "All"]]
              [:i.fa.fa-chevron-down]]
             [:input


crossorigin anonymous

crossorigin anonymous

--- src/clj/skidskytte/views.clj
+++ src/clj/skidskytte/views.clj
@@ -29,7 +29,9 @@
     (hp/include-css "/assets/font-awesome/css/font-awesome.min.css")
     (hp/include-css "/css/screen.css")
     (hp/include-css "/css/custom.css")
-    (hp/include-js "https://unpkg.com/@hotwired/turbo@7.0.0-beta.3/dist/turbo.es5-umd.js")
+    [:script {:type "text/javascript"
+              :crossorigin "anonymous"
+              :src "https://unpkg.com/@hotwired/turbo@7.0.0-beta.3/dist/turbo.es5-umd.js"}]
     matomo]
    [:body
     [:div.container


and interpreter for inclusion specs

and interpreter for inclusion specs

--- src/clj_money/validation.clj
+++ src/clj_money/validation.clj
@@ -38,10 +38,23 @@
     (let [attribute (-> problem :pred (nth 2))]
       [attribute (format "%s is required" (humanize attribute))])))

+(defn- interpret-set-inclusion-failure
+  [problem]
+  (when (set? (:pred problem))
+    (let [attribute (-> problem :path first)]
+      [attribute
+       (format "%s must be one of: %s"
+               (humanize attribute)
+               (->> problem
+                    :pred
+                    (map name)
+                    (string/join ", ")))])))
+
 (def problem-interpreters
   [interpret-required-failure
    interpret-regex-failure
-   interpret-empty-string-failure])
+   interpret-empty-string-failure
+   interpret-set-inclusion-failure])

 (defn- problem->message
   [problem]