number -> numeric(38)

number -> numeric(38)

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

-  create table "RM_CASE_ASSESS"
-  (	"ENTERPRISE_ID" NUMBER ,
-	"CASE_ID" NUMBER,
-	"TEMPLATE_ID" NUMBER,
-	"LISTEDNESS" NUMBER,
-	"UPDATED" DATE,
-	"OUTCOME" NUMBER,
-	"COMMENT_ID" NUMBER,
-	"COMP_COMMENT_ID" NUMBER,
-	"SERIOUSNESS" NUMBER,
-	"SERIOUS_NOTES" varchar(1000),
-	"AGENT_SUSPECT" NUMBER,
-	"AGENT_NOTES" varchar(1000),
-	"LISTEDNESS_NOTES" varchar(1000),
-	"BFARM_CAUSALITY" NUMBER(10,0),
-	"BFARM_MANUAL_TEXT" varchar(3900),
-	"COMPANY_DIAGNOSIS" varchar(250),
-	"COMPANY_DIAGNOSIS_NOTES" varchar(1000),
-	"DIAGNOSIS_DICT_ID" NUMBER,
-	"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" NUMBER(30,10),
-	"UD_NUMBER_2" NUMBER(30,10),
-	"UD_NUMBER_3" NUMBER(30,10),
-	"UD_NUMBER_4" NUMBER(30,10),
-	"UD_NUMBER_5" NUMBER(30,10),
-	"UD_NUMBER_6" NUMBER(30,10),
-	"UD_NUMBER_7" NUMBER(30,10),
-	"UD_NUMBER_8" NUMBER(30,10),
-	"UD_NUMBER_9" NUMBER(30,10),
-	"UD_NUMBER_10" NUMBER(30,10),
-	"UD_NUMBER_11" NUMBER(30,10),
-	"UD_NUMBER_12" NUMBER(30,10),
-	"EVALUATION" varchar(3900),
-	"EVALUATION_J" varchar(3900),
-	"CO_SUSPECT_COUNT" NUMBER(3,0),
-	"EVENT_SYNOPSIS" varchar(5),
-	"EVENT_PRIMARY" varchar(400),
-	"DIAGNOSIS_REPTD" varchar(255),
-	"DIAGNOSIS_CODED" varchar(255),
-	"DIAGNOSIS_SYN_CODE" NUMBER,
-	"DIAGNOSIS_CODE_STATUS" NUMBER(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" NUMBER,
-	"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" NUMBER,
-	"DELETED" DATE,
-	"DLP_REVISION_NUMBER" NUMBER,
-	"REVISION_DELETE_FLAG" NUMBER DEFAULT 0,
-	"DELETED_FLAG" NUMBER(1,0),
-	"EFFECTIVE_START_DATE" DATE,
-	"EFFECTIVE_END_DATE" DATE
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_CASE_CLASSIFICATIONS"
-   (	"ENTERPRISE_ID" NUMBER ,
-	"CASE_ID" NUMBER,
-	"SEQ_NUM" NUMBER,
-	"CLASSIFICATION_ID" NUMBER,
-	"DELETED" DATE,
-	"DLP_REVISION_NUMBER" NUMBER,
-	"REVISION_DELETE_FLAG" NUMBER DEFAULT 0,
-	"DELETED_FLAG" NUMBER(1,0),
-	"EFFECTIVE_START_DATE" DATE,
-	"EFFECTIVE_END_DATE" DATE
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_CASE_EVENT"
-   (	"ENTERPRISE_ID" NUMBER ,
-	"CASE_ID" NUMBER,
-	"SEQ_NUM" NUMBER,
-	"DESC_REPTD" varchar(250),
-	"DESC_CODED" varchar(255),
-	"DIAGNOSIS" NUMBER,
-	"ONSET" DATE,
-	"ONSET_RES" NUMBER,
-	"ONSET_DELAY" varchar(40),
-	"STOP_DATE" DATE,
-	"STOP_DATE_RES" NUMBER,
-	"DURATION" varchar(40),
-	"ONSET_LATENCY" varchar(40),
-	"EVT_INTENSITY_ID" NUMBER,
-	"EVT_FREQ_ID" NUMBER,
-	"TREATED" NUMBER,
-	"STUDY_RELATED" NUMBER,
-	"RECHALL_RELATED" NUMBER,
-	"PROD_SEQ_NUM" NUMBER,
-	"EVT_OUTCOME_ID" NUMBER,
-	"RECEIPT_DATE" DATE,
-	"RPT_SERIOUS" NUMBER,
-	"SC_DEATH" NUMBER,
-	"SC_HOSP" NUMBER,
-	"SC_CONG_ANOM" NUMBER,
-	"SC_THREAT" NUMBER,
-	"SC_DISABLE" NUMBER,
-	"SC_INT_REQ" NUMBER,
-	"SC_OTHER" NUMBER,
-	"SC_OTHER_TEXT" varchar(30),
-	"ART_CODE" varchar(30),
-	"PREF_TERM" varchar(250),
-	"INC_TERM" varchar(250),
-	"BODY_SYS" varchar(250),
-	"MED_SERIOUS" NUMBER,
-	"PAST_HIST" NUMBER,
-	"DICT_ID" NUMBER,
-	"DICT_KEY" varchar(20),
-	"CODE_STATUS" NUMBER,
-	"SERIOUSNESS" NUMBER,
-	"SORT_ID" NUMBER,
-	"ONSET_DATE_PARTIAL" varchar(20),
-	"STOP_DATE_PARTIAL" varchar(20),
-	"EFFICACY" NUMBER,
-	"DISEASE" NUMBER,
-	"WITHDRAWAL" NUMBER,
-	"HLGT" varchar(250),
-	"HLT" varchar(250),
-	"HLT_CODE" varchar(30),
-	"HLGT_CODE" varchar(30),
-	"SOC_CODE" varchar(30),
-	"STUDY_DROPPED" NUMBER(4,0),
-	"INC_CODE" varchar(30),
-	"ONSET_MINUTES" NUMBER,
-	"DELAY_MINUTES" NUMBER,
-	"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" NUMBER(30,10),
-	"UD_NUMBER_2" NUMBER(30,10),
-	"UD_NUMBER_3" NUMBER(30,10),
-	"UD_NUMBER_4" NUMBER(30,10),
-	"UD_NUMBER_5" NUMBER(30,10),
-	"UD_NUMBER_6" NUMBER(30,10),
-	"UD_NUMBER_7" NUMBER(30,10),
-	"UD_NUMBER_8" NUMBER(30,10),
-	"UD_NUMBER_9" NUMBER(30,10),
-	"UD_NUMBER_10" NUMBER(30,10),
-	"UD_NUMBER_11" NUMBER(30,10),
-	"UD_NUMBER_12" NUMBER(30,10),
-	"DETAILS" varchar(3900),
-	"DETAILS_J" varchar(3900),
-	"SYN_CODE" NUMBER,
-	"DELETED" DATE,
-	"STUDY_RELATED_REPTD" NUMBER(1,0),
-	"DURATION_UNIT_E2B" NUMBER,
-	"ONSET_LATENCY_UNIT_E2B" NUMBER,
-	"ONSET_DELAY_UNIT_E2B" NUMBER,
-	"DURATION_SECONDS" NUMBER,
-	"ONSET_LATENCY_SECONDS" NUMBER,
-	"ONSET_DELAY_SECONDS" NUMBER,
-	"BODY_SYS_J" varchar(250),
-	"CODE_STATUS_J" NUMBER,
-	"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" NUMBER,
-	"REPORTABLE" NUMBER,
-	"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" NUMBER,
-	"INFECTION" NUMBER,
-	"RPT_EXCLUDE_CMT" varchar(1000),
-	"RPT_EXCLUDE_CMT_J" varchar(1000),
-	"DLP_REVISION_NUMBER" NUMBER,
-	"REVISION_DELETE_FLAG" NUMBER DEFAULT 0,
-	"DELETED_FLAG" NUMBER(1,0),
-	"EFFECTIVE_START_DATE" DATE,
-	"EFFECTIVE_END_DATE" DATE
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_CASE_EVENT_ASSESS"
-   (	"ENTERPRISE_ID" NUMBER ,
-	"CASE_ID" NUMBER,
-	"EVENT_SEQ_NUM" NUMBER,
-	"PROD_SEQ_NUM" NUMBER,
-	"DATASHEET_ID" NUMBER,
-	"LICENSE_ID" NUMBER,
-	"SEQ_NUM" NUMBER,
-	"UPDATED" DATE,
-	"DET_LISTEDNESS_ID" NUMBER,
-	"RPT_CAUSALITY_ID" NUMBER,
-	"DET_CAUSALITY_ID" NUMBER,
-	"LISTED_JUSTIFY" varchar(1000),
-	"CAUSE_JUSTIFY" varchar(1000),
-	"LAM_ASSESSED" NUMBER(12,0),
-	"DELETED" DATE,
-	"CAUSALITY_ASSESSMENT" varchar(50),
-	"CAUSALITY_SCORE" NUMBER,
-	"SOURCE_ID" NUMBER,
-	"PRT_CAUSALITY_ID" NUMBER,
-	"CAUSE_JUSTIFY_J" varchar(1000),
-	"LISTED_JUSTIFY_J" varchar(1000),
-	"DLP_REVISION_NUMBER" NUMBER,
-	"LAST_UPDATE_TIME" DATE,
-	"REVISION_DELETE_FLAG" NUMBER DEFAULT 0,
-	"DELETED_FLAG" NUMBER(1,0),
-	"EFFECTIVE_START_DATE" DATE,
-	"EFFECTIVE_END_DATE" DATE
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_CASE_FOLLOWUP"
-   (	"ENTERPRISE_ID" NUMBER ,
-	"CASE_ID" NUMBER,
-	"SEQ_NUM" NUMBER,
-	"RECEIPT_DATE" DATE,
-	"SAFETY_DATE" DATE,
-	"SIGNIFICANT" NUMBER(1,0),
-	"AUDITLOG_TYPE" NUMBER,
-	"TIME_STAMP" DATE,
-	"DELETED" DATE,
-	"SIGNIFICANT_DEVICE" NUMBER(1,0),
-	"DATA_CLEANUP" NUMBER(1,0),
-	"JUSTIFICATION" varchar(1000),
-	"JUSTIFICATION_ID" NUMBER,
-	"JUSTIFICATION_J" varchar(1000),
-	"JUST_RECEIPT_DATE_J" varchar(1000),
-	"RECEIPT_DATE_J" DATE,
-	"DLP_REVISION_NUMBER" NUMBER,
-	"REVISION_DELETE_FLAG" NUMBER DEFAULT 0,
-	"DELETED_FLAG" NUMBER(1,0),
-	"EFFECTIVE_START_DATE" DATE,
-	"EFFECTIVE_END_DATE" DATE
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_CASE_MASTER"
-   (	"ENTERPRISE_ID" NUMBER ,
-	"CASE_ID" NUMBER,
-	"CASE_NUM" varchar(20),
-	"REV" NUMBER,
-	"WORKFLOW_SEQ_NUM" NUMBER,
-	"LAST_WORKFLOW_SEQ_NUM" NUMBER,
-	"CREATE_TIME" DATE,
-	"INIT_REPT_DATE" DATE,
-	"USER_ID" NUMBER,
-	"LAST_UPDATE_TIME" DATE,
-	"LAST_UPDATE_USER_ID" NUMBER,
-	"REQUIRES_FOLLOWUP" NUMBER,
-	"FOLLOWUP_DATE" DATE,
-	"OWNER_ID" NUMBER,
-	"STATE_ID" NUMBER,
-	"COUNTRY_ID" NUMBER,
-	"LANG_ID" NUMBER,
-	"PRIORITY" NUMBER,
-	"SITE_ID" NUMBER,
-	"SERIOUSNESS" NUMBER,
-	"RPT_TYPE_ID" NUMBER,
-	"LAST_STATE_ID" NUMBER,
-	"ASSESSMENT_NEEDED" NUMBER,
-	"PRIORITY_OVERRIDE" NUMBER(1,0),
-	"SID" varchar(128),
-	"SAFETY_DATE" DATE,
-	"NORMAL_TIME" DATE,
-	"MAX_TIME" DATE,
-	"REPORT_SCHEDULING" NUMBER,
-	"PRIORITY_ASSESSMENT" NUMBER,
-	"CLOSE_USER_ID" NUMBER,
-	"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" NUMBER(30,10),
-	"UD_NUMBER_2" NUMBER(30,10),
-	"UD_NUMBER_3" NUMBER(30,10),
-	"UD_NUMBER_4" NUMBER(30,10),
-	"UD_NUMBER_5" NUMBER(30,10),
-	"UD_NUMBER_6" NUMBER(30,10),
-	"UD_NUMBER_7" NUMBER(30,10),
-	"UD_NUMBER_8" NUMBER(30,10),
-	"UD_NUMBER_9" NUMBER(30,10),
-	"UD_NUMBER_10" NUMBER(30,10),
-	"UD_NUMBER_11" NUMBER(30,10),
-	"UD_NUMBER_12" NUMBER(30,10),
-	"DELETED" DATE,
-	"DUE_SOON" DATE,
-	"GLOBAL_NUM" varchar(20),
-	"PRIORITY_DATE_ASSESSED" DATE,
-	"LAM_ASSESS_DONE" NUMBER(1,0),
-	"E2B_WW_NUMBER" varchar(100),
-	"WORKLIST_OWNER_ID" NUMBER,
-	"SUSAR" NUMBER,
-	"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" NUMBER,
-	"REVISION_DELETE_FLAG" NUMBER DEFAULT 0,
-	"DELETED_FLAG" NUMBER(1,0),
-	"EFFECTIVE_START_DATE" DATE,
-	"EFFECTIVE_END_DATE" DATE
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_CASE_NARRATIVE"
-   (	"ENTERPRISE_ID" NUMBER ,
-	"CASE_ID" NUMBER,
-	"ABBREV_NARRATIVE" varchar(3900),
-	"ABBREV_NARRATIVE_J" varchar(3900),
-	"NARRATIVE" varchar(3900),
-	"NARRATIVE_J" varchar(3900),
-	"DELETED" DATE,
-	"DLP_REVISION_NUMBER" NUMBER,
-	"REVISION_DELETE_FLAG" NUMBER DEFAULT 0,
-	"DELETED_FLAG" NUMBER(1,0),
-	"EFFECTIVE_START_DATE" DATE,
-	"EFFECTIVE_END_DATE" DATE
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_CASE_PAT_INFO"
-   (	"ENTERPRISE_ID" NUMBER ,
-	"CASE_ID" NUMBER,
-	"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" NUMBER,
-	"PAT_AGE" NUMBER(22,7),
-	"AGE_UNIT_ID" NUMBER,
-	"AGE_GROUP_ID" NUMBER,
-	"GENDER_ID" NUMBER,
-	"PAT_WEIGHT_LBS" NUMBER(22,7),
-	"PAT_WEIGHT_KG" NUMBER(22,7),
-	"PAT_HEIGHT_IN" NUMBER(22,7),
-	"PAT_HEIGHT_CM" NUMBER(22,7),
-	"ETHNICITY_ID" NUMBER,
-	"OCCUPATION_ID" NUMBER,
-	"PAT_STAT_PREG" NUMBER,
-	"REL_TEST_ID" NUMBER,
-	"PAT_DOB_PARTIAL" varchar(20),
-	"RAND_NUM" varchar(15),
-	"CONFIDENTIAL" NUMBER(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" NUMBER(30,10),
-	"UD_NUMBER_2" NUMBER(30,10),
-	"UD_NUMBER_3" NUMBER(30,10),
-	"UD_NUMBER_4" NUMBER(30,10),
-	"UD_NUMBER_5" NUMBER(30,10),
-	"UD_NUMBER_6" NUMBER(30,10),
-	"UD_NUMBER_7" NUMBER(30,10),
-	"UD_NUMBER_8" NUMBER(30,10),
-	"UD_NUMBER_9" NUMBER(30,10),
-	"UD_NUMBER_10" NUMBER(30,10),
-	"UD_NUMBER_11" NUMBER(30,10),
-	"UD_NUMBER_12" NUMBER(30,10),
-	"DELETED" DATE,
-	"CHILD_ONLY" NUMBER(1,0),
-	"PAT_BMI" NUMBER(22,7),
-	"PAT_BODY_AREA" NUMBER(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" NUMBER,
-	"DLP_REVISION_NUMBER" NUMBER,
-	"REVISION_DELETE_FLAG" NUMBER DEFAULT 0,
-	"DELETED_FLAG" NUMBER(1,0),
-	"EFFECTIVE_START_DATE" DATE,
-	"EFFECTIVE_END_DATE" DATE,
-	"NOTES" varchar(3900),
-	"NOTES_J" varchar(3900),
-	"AGE_UNIT_ID_AT_VACC" NUMBER,
-	"PAT_AGE_AT_VACC" NUMBER
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_CASE_PROD_DRUGS"
-   (	"ENTERPRISE_ID" NUMBER ,
-	"CASE_ID" NUMBER,
-	"SEQ_NUM" NUMBER,
-	"FORMULATION_ID" NUMBER,
-	"CONCENTRATION" varchar(10),
-	"CONC_UNITS_ID" NUMBER,
-	"ACT_TAKEN_ID" NUMBER,
-	"SEVERITY_ID" NUMBER,
-	"INTERACTION" NUMBER,
-	"CONTRAIND" NUMBER,
-	"FIRST_DOSE" DATE,
-	"FIRST_DOSE_RES" NUMBER,
-	"LAST_DOSE" DATE,
-	"LAST_DOSE_RES" NUMBER,
-	"TOTAL_DOSE" NUMBER(22,7),
-	"TOT_DOSE_UNIT_ID" NUMBER,
-	"PREV_USE" NUMBER,
-	"ABUSE" NUMBER,
-	"OVERDOSE" NUMBER,
-	"PROTOCOL" NUMBER,
-	"DECHALLENGE" NUMBER,
-	"DECHALL_DATE" DATE,
-	"RECHALLENGE" NUMBER,
-	"RECHALL_START" DATE,
-	"RECHALL_STOP" DATE,
-	"RECHALL_OUTCOME" NUMBER,
-	"SORT_ID" NUMBER,
-	"B_WEIGHT_GRAMS" NUMBER,
-	"N_SIBLINGS" NUMBER,
-	"B_WEIGHT_OZS" NUMBER,
-	"FIRST_DOSE_PARTIAL" varchar(20),
-	"LAST_DOSE_PARTIAL" varchar(20),
-	"TAMPERING" NUMBER(4,0),
-	"CUMULATIVE_DOSE" NUMBER(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" NUMBER(30,10),
-	"UD_NUMBER_2" NUMBER(30,10),
-	"UD_NUMBER_3" NUMBER(30,10),
-	"UD_NUMBER_4" NUMBER(30,10),
-	"UD_NUMBER_5" NUMBER(30,10),
-	"UD_NUMBER_6" NUMBER(30,10),
-	"UD_NUMBER_7" NUMBER(30,10),
-	"UD_NUMBER_8" NUMBER(30,10),
-	"UD_NUMBER_9" NUMBER(30,10),
-	"UD_NUMBER_10" NUMBER(30,10),
-	"UD_NUMBER_11" NUMBER(30,10),
-	"UD_NUMBER_12" NUMBER(30,10),
-	"CUMULATIVE_DOSE_UNIT_ID" NUMBER,
-	"OBTAIN_DRUG_COUNTRY_ID" NUMBER,
-	"DRUG_AUTH_COUNTRY_ID" NUMBER,
-	"DURATION_SECONDS" NUMBER,
-	"LATENCY_SECONDS" NUMBER,
-	"DELAY_SECONDS" NUMBER,
-	"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" NUMBER,
-	"REVISION_DELETE_FLAG" NUMBER DEFAULT 0,
-	"DELETED_FLAG" NUMBER(1,0),
-	"EFFECTIVE_START_DATE" DATE,
-	"EFFECTIVE_END_DATE" DATE
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_CASE_PRODUCT"
-   (	"ENTERPRISE_ID" NUMBER ,
-	"CASE_ID" NUMBER,
-	"SEQ_NUM" NUMBER,
-	"PRODUCT_ID" NUMBER,
-	"DRUG_TYPE" NUMBER,
-	"PAT_EXPOSURE" NUMBER,
-	"MANUFACTURER_ID" NUMBER,
-	"PROTOCOL_FOLLOWED" NUMBER,
-	"FIRST_SUS_PROD" NUMBER,
-	"SELECTED_VIEW" NUMBER,
-	"SORT_ID" NUMBER,
-	"VIEWS_AVAILABLE" NUMBER,
-	"COUNTRY_ID" NUMBER,
-	"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" NUMBER(30,10),
-	"UD_NUMBER_2" NUMBER(30,10),
-	"UD_NUMBER_3" NUMBER(30,10),
-	"UD_NUMBER_4" NUMBER(30,10),
-	"UD_NUMBER_5" NUMBER(30,10),
-	"UD_NUMBER_6" NUMBER(30,10),
-	"UD_NUMBER_7" NUMBER(30,10),
-	"UD_NUMBER_8" NUMBER(30,10),
-	"UD_NUMBER_9" NUMBER(30,10),
-	"UD_NUMBER_10" NUMBER(30,10),
-	"UD_NUMBER_11" NUMBER(30,10),
-	"UD_NUMBER_12" NUMBER(30,10),
-	"INCLUDE_FREQUENCY" NUMBER,
-	"SDRUG_NOT_ADMIN" NUMBER,
-	"PROD_REPTD" varchar(255),
-	"PROD_CODED" varchar(255),
-	"PROD_SYN_ID" NUMBER,
-	"PROD_CODE_STATUS" NUMBER(3,0),
-	"DELETED" DATE,
-	"STUDY_PRODUCT_NUM" NUMBER(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" NUMBER,
-	"MEDICINAL_PROD_ID" varchar(10),
-	"FAMILY_ID" NUMBER,
-	"EXISTING_RPT_SEQ_MOD_FLG" NUMBER,
-	"DRUG_CODE_J" varchar(20),
-	"DRUG_CODE_TYPE_J" NUMBER,
-	"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" NUMBER,
-	"LAST_UPDATE_TIME" DATE,
-	"REVISION_DELETE_FLAG" NUMBER DEFAULT 0,
-	"DELETED_FLAG" NUMBER(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" NUMBER,
-	"PROD_LIC_ID" NUMBER
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_CASE_REPORTERS"
-   (	"ENTERPRISE_ID" NUMBER ,
-	"CASE_ID" NUMBER,
-	"SEQ_NUM" NUMBER,
-	"MEDIA_ID" NUMBER,
-	"OCCUPATION_ID" NUMBER,
-	"HCP_FLAG" NUMBER,
-	"PRIMARY_CONTACT" NUMBER,
-	"CORR_CONTACT" NUMBER,
-	"REPORTER_TYPE" NUMBER,
-	"INTERMEDIARY_ID" NUMBER,
-	"RPT_SENT" NUMBER,
-	"SORT_ID" NUMBER,
-	"CONFIDENTIAL" NUMBER(1,0),
-	"COUNTRY_ID" NUMBER,
-	"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" NUMBER,
-	"REVISION_DELETE_FLAG" NUMBER DEFAULT 0,
-	"DELETED_FLAG" NUMBER(1,0),
-	"EFFECTIVE_START_DATE" DATE,
-	"EFFECTIVE_END_DATE" DATE,
-	"NOTES" varchar(3900),
-	"NOTES_J" varchar(3900),
-	"INSTITUTION_ID" varchar(15)
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_CASE_STUDY"
-   (	"ENTERPRISE_ID" NUMBER ,
-	"CASE_ID" NUMBER,
-	"STUDY_KEY" NUMBER,
-	"STUDY_NUM" varchar(35),
-	"STUDY_TYPE" NUMBER,
-	"CENTER_ID" NUMBER,
-	"CENTER_NAME" varchar(40),
-	"PROTOCOL_ID" NUMBER,
-	"PROTOCOL_NUM" varchar(40),
-	"OTHER_ID" varchar(20),
-	"CODE_BROKEN" NUMBER,
-	"BROKEN_BY" NUMBER,
-	"BROKEN_DATE" DATE,
-	"REASON" varchar(100),
-	"WEEK" varchar(5),
-	"VISIT" varchar(5),
-	"DELETED" DATE,
-	"PRODUCT_COUNT" NUMBER(2,0),
-	"CLASSIFICATION_ID" NUMBER,
-	"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" NUMBER,
-	"DLP_REVISION_NUMBER" NUMBER,
-	"REVISION_DELETE_FLAG" NUMBER DEFAULT 0,
-	"DELETED_FLAG" NUMBER(1,0),
-	"EFFECTIVE_START_DATE" DATE,
-	"EFFECTIVE_END_DATE" DATE,
-	"COHORT_ID" NUMBER
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_LM_CASE_CLASSIFICATION"
-   (	"ENTERPRISE_ID" NUMBER ,
-	"CLASSIFICATION_ID" NUMBER,
-	"DESCRIPTION" varchar(30),
-	"PROTECTED" NUMBER,
-	"DISPLAY" NUMBER,
-	"DESCRIPTION_J" varchar(30),
-	"DELETED" DATE,
-	"E2B_CODE" NUMBER
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_LM_CAUSALITY"
-   (	"ENTERPRISE_ID" NUMBER ,
-	"CAUSALITY_ID" NUMBER,
-	"CAUSALITY" varchar(35),
-	"REPORTABILITY" NUMBER,
-	"PROTECTED" NUMBER,
-	"DISPLAY" NUMBER,
-	"CAUSALITY_J" varchar(35),
-	"DELETED" DATE
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_LM_COUNTRIES"
-   (	"ENTERPRISE_ID" NUMBER ,
-	"COUNTRY_ID" NUMBER,
-	"COUNTRY" varchar(50),
-	"A2" varchar(2),
-	"A3" varchar(3),
-	"NUM" NUMBER,
-	"PROTECTED" NUMBER,
-	"DELETED" DATE,
-	"COUNTRY_GROUP_ID" NUMBER,
-	"COUNTRY_GROUP" varchar(50),
-	"COUNTRY_J" varchar(50),
-	"GROUP_2_COUNTRY" NUMBER
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_LM_PRODUCT"
-   (	"ENTERPRISE_ID" NUMBER ,
-	"PRODUCT_ID" NUMBER,
-	"PROD_NAME" varchar(70),
-	"FAMILY_ID" NUMBER,
-	"FORMULATION_ID" NUMBER,
-	"MANUFACTURER_ID" NUMBER,
-	"CONCENTRATION" varchar(10),
-	"CONC_UNIT_ID" NUMBER,
-	"INDICATION_ID" varchar(50),
-	"CODE_DICT" NUMBER,
-	"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" NUMBER,
-	"IND_CODE_STATUS" NUMBER,
-	"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" NUMBER,
-	"INDICATION_TEXT_J" varchar(250),
-	"IND_CODE_STATUS_J" NUMBER,
-	"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" NUMBER,
-	"IND_CODED_J" varchar(250),
-	"IND_REPTD_J" varchar(250),
-	"DEV_INTL_BIRTH_DATE" DATE,
-	"COMMENTS_J" varchar(1000)
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_LM_PRODUCT_FAMILY"
-   (	"ENTERPRISE_ID" NUMBER ,
-	"FAMILY_ID" NUMBER,
-	"NAME" varchar(40),
-	"PRIMARY_VIEW" NUMBER,
-	"DELETED" DATE,
-	"PRODUCT_GROUP_ID" NUMBER,
-	"COMMENTS" varchar(1000),
-	"SEARCH_EQUATION_NUMBER" varchar(10),
-	"NAME_J" varchar(40),
-	"COMMENTS_J" varchar(1000)
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_LM_REPORT_TYPE"
-   (	"ENTERPRISE_ID" NUMBER ,
-	"RPT_TYPE_ID" NUMBER,
-	"REPORT_TYPE" varchar(30),
-	"PROTECTED" NUMBER,
-	"DISPLAY" NUMBER,
-	"INCL_LIT" NUMBER,
-	"INCL_TRIAL" NUMBER,
-	"E2B_CODE" NUMBER,
-	"ABRV" varchar(3),
-	"INVESTIGATIONAL" NUMBER,
-	"REPORT_TYPE_J" varchar(30),
-	"DELETED" DATE,
-	"INCL_RESEARCH" NUMBER
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_MEDDRA_SMQ_CONTENT"
-   (	"GLOBAL_DICT_ID" NUMBER ,
-	"SMQ_CODE" NUMBER,
-	"TERM_CODE" NUMBER,
-	"TERM_LEVEL" NUMBER,
-	"TERM_SCOPE" NUMBER,
-	"TERM_CATEGORY" varchar(1),
-	"TERM_WEIGHT" NUMBER,
-	"TERM_STATUS" varchar(1),
-	"TERM_ADDITION_VERSION" varchar(5),
-	"TERM_LAST_MODIFIED_VERSION" varchar(5)
-   ) SEGMENT CREATION IMMEDIATE
-
-  create table "RM_MEDDRA_SMQ_LIST"
-   (	"GLOBAL_DICT_ID" NUMBER ,
-	"SMQ_CODE" NUMBER,
-	"SMQ_NAME" varchar(100),
-	"SMQ_LEVEL" NUMBER,
-	"SMQ_DESCRIPTION" varchar(3000),
-	"SMQ_SOURCE" varchar(2000),
-	"SMQ_NOTE" varchar(2000),
-	"MEDDRA_VERSION" varchar(5),
-	"STATUS" varchar(1),
-	"SMQ_ALGORITHM" varchar(100)
-   ) SEGMENT CREATION IMMEDIATE
+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" NUMBER(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" NUMBER(30,10),
+  "UD_NUMBER_2" NUMBER(30,10),
+  "UD_NUMBER_3" NUMBER(30,10),
+  "UD_NUMBER_4" NUMBER(30,10),
+  "UD_NUMBER_5" NUMBER(30,10),
+  "UD_NUMBER_6" NUMBER(30,10),
+  "UD_NUMBER_7" NUMBER(30,10),
+  "UD_NUMBER_8" NUMBER(30,10),
+  "UD_NUMBER_9" NUMBER(30,10),
+  "UD_NUMBER_10" NUMBER(30,10),
+  "UD_NUMBER_11" NUMBER(30,10),
+  "UD_NUMBER_12" NUMBER(30,10),
+  "EVALUATION" varchar(3900),
+  "EVALUATION_J" varchar(3900),
+  "CO_SUSPECT_COUNT" NUMBER(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" NUMBER(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" NUMBER(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" NUMBER(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" NUMBER(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" NUMBER(30,10),
+  "UD_NUMBER_2" NUMBER(30,10),
+  "UD_NUMBER_3" NUMBER(30,10),
+  "UD_NUMBER_4" NUMBER(30,10),
+  "UD_NUMBER_5" NUMBER(30,10),
+  "UD_NUMBER_6" NUMBER(30,10),
+  "UD_NUMBER_7" NUMBER(30,10),
+  "UD_NUMBER_8" NUMBER(30,10),
+  "UD_NUMBER_9" NUMBER(30,10),
+  "UD_NUMBER_10" NUMBER(30,10),
+  "UD_NUMBER_11" NUMBER(30,10),
+  "UD_NUMBER_12" NUMBER(30,10),
+  "DETAILS" varchar(3900),
+  "DETAILS_J" varchar(3900),
+  "SYN_CODE" numeric(38),
+  "DELETED" DATE,
+  "STUDY_RELATED_REPTD" NUMBER(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" NUMBER(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" NUMBER(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" NUMBER(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" NUMBER(1,0),
+  "AUDITLOG_TYPE" numeric(38),
+  "TIME_STAMP" DATE,
+  "DELETED" DATE,
+  "SIGNIFICANT_DEVICE" NUMBER(1,0),
+  "DATA_CLEANUP" NUMBER(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" NUMBER(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" NUMBER(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" NUMBER(30,10),
+  "UD_NUMBER_2" NUMBER(30,10),
+  "UD_NUMBER_3" NUMBER(30,10),
+  "UD_NUMBER_4" NUMBER(30,10),
+  "UD_NUMBER_5" NUMBER(30,10),
+  "UD_NUMBER_6" NUMBER(30,10),
+  "UD_NUMBER_7" NUMBER(30,10),
+  "UD_NUMBER_8" NUMBER(30,10),
+  "UD_NUMBER_9" NUMBER(30,10),
+  "UD_NUMBER_10" NUMBER(30,10),
+  "UD_NUMBER_11" NUMBER(30,10),
+  "UD_NUMBER_12" NUMBER(30,10),
+  "DELETED" DATE,
+  "DUE_SOON" DATE,
+  "GLOBAL_NUM" varchar(20),
+  "PRIORITY_DATE_ASSESSED" DATE,
+  "LAM_ASSESS_DONE" NUMBER(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" NUMBER(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" NUMBER(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" NUMBER(22,7),
+  "AGE_UNIT_ID" numeric(38),
+  "AGE_GROUP_ID" numeric(38),
+  "GENDER_ID" numeric(38),
+  "PAT_WEIGHT_LBS" NUMBER(22,7),
+  "PAT_WEIGHT_KG" NUMBER(22,7),
+  "PAT_HEIGHT_IN" NUMBER(22,7),
+  "PAT_HEIGHT_CM" NUMBER(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" NUMBER(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" NUMBER(30,10),
+  "UD_NUMBER_2" NUMBER(30,10),
+  "UD_NUMBER_3" NUMBER(30,10),
+  "UD_NUMBER_4" NUMBER(30,10),
+  "UD_NUMBER_5" NUMBER(30,10),
+  "UD_NUMBER_6" NUMBER(30,10),
+  "UD_NUMBER_7" NUMBER(30,10),
+  "UD_NUMBER_8" NUMBER(30,10),
+  "UD_NUMBER_9" NUMBER(30,10),
+  "UD_NUMBER_10" NUMBER(30,10),
+  "UD_NUMBER_11" NUMBER(30,10),
+  "UD_NUMBER_12" NUMBER(30,10),
+  "DELETED" DATE,
+  "CHILD_ONLY" NUMBER(1,0),
+  "PAT_BMI" NUMBER(22,7),
+  "PAT_BODY_AREA" NUMBER(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" NUMBER(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" NUMBER(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" NUMBER(4,0),
+  "CUMULATIVE_DOSE" NUMBER(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" NUMBER(30,10),
+  "UD_NUMBER_2" NUMBER(30,10),
+  "UD_NUMBER_3" NUMBER(30,10),
+  "UD_NUMBER_4" NUMBER(30,10),
+  "UD_NUMBER_5" NUMBER(30,10),
+  "UD_NUMBER_6" NUMBER(30,10),
+  "UD_NUMBER_7" NUMBER(30,10),
+  "UD_NUMBER_8" NUMBER(30,10),
+  "UD_NUMBER_9" NUMBER(30,10),
+  "UD_NUMBER_10" NUMBER(30,10),
+  "UD_NUMBER_11" NUMBER(30,10),
+  "UD_NUMBER_12" NUMBER(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" NUMBER(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" NUMBER(30,10),
+  "UD_NUMBER_2" NUMBER(30,10),
+  "UD_NUMBER_3" NUMBER(30,10),
+  "UD_NUMBER_4" NUMBER(30,10),
+  "UD_NUMBER_5" NUMBER(30,10),
+  "UD_NUMBER_6" NUMBER(30,10),
+  "UD_NUMBER_7" NUMBER(30,10),
+  "UD_NUMBER_8" NUMBER(30,10),
+  "UD_NUMBER_9" NUMBER(30,10),
+  "UD_NUMBER_10" NUMBER(30,10),
+  "UD_NUMBER_11" NUMBER(30,10),
+  "UD_NUMBER_12" NUMBER(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" NUMBER(3,0),
+  "DELETED" DATE,
+  "STUDY_PRODUCT_NUM" NUMBER(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" NUMBER(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" NUMBER(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" NUMBER(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" NUMBER(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" NUMBER(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,
+  "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),
+  "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),
+  "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,
+  "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),
+  "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,
+  "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),
+  "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),
+  "SMQ_ALGORITHM" varchar(100)
+)


Aha! params is a keyword argument

Aha! params is a keyword argument

--- test/takehome/unit/web.clj
+++ test/takehome/unit/web.clj
@@ -41,6 +41,6 @@
          (get-in resp [:body :name]) => "takehome"))

  (fact "Hello returns OK"
-       (let [resp (request :get "/hello" {:nickname "world"})]
+       (let [resp (request :get "/hello" {:params {:nickname "world"}})]
          (:status resp) => 200
          (get-in resp [:body]) => "Hello world!\n")))


Update ring/ring-core to "1.7.1"

Update ring/ring-core to "1.7.1"

--- backend/project.clj
+++ backend/project.clj
@@ -42,7 +42,7 @@
                  [ragtime/ragtime.jdbc "0.6.4"]
                  [raven-clj "1.5.2"]
                  [ring "1.7.1" :exclusions [ring/ring-core]]
-                 [ring/ring-core "1.6.3"]
+                 [ring/ring-core "1.7.1" :exclusions [ring/ring-codec]]
                  [ring/ring-defaults "0.3.2"]
                  [ring/ring-json "0.4.0"]
                  [selmer "1.11.8"]


Clean up conditionals

Clean up conditionals

--- src/clj/jest/compiler/NativeJestCompiler.clj
+++ src/clj/jest/compiler/NativeJestCompiler.clj
@@ -414,15 +414,15 @@
   [this ^JestParser$ConditionalContext ctx]

   (let [conditions (map #( .. this (visitExpression %)) (merge-items (. ctx ifCondition) (. ctx elifExpression)))
-        results (map #( .. this (visitBlock %)) (merge-items (. ctx iftrue) (. ctx elifBlock)))
-        else (if (. ctx elseBlock) (.. this (visitBlock (. ctx elseBlock))) nil)
+        results (map #(wrap-in-do (.. this (visitBlock %))) (merge-items (. ctx iftrue) (. ctx elifBlock)))
+        else (if (. ctx elseBlock) (wrap-in-do (.. this (visitBlock (. ctx elseBlock)))) nil)
         single-if (= (. conditions size) 1)]

     (cond
-      (and single-if else) `(if ~(. conditions (get 0)) ~(wrap-in-do (. results (get 0))) ~(wrap-in-do else))
-      single-if `(if ~(. conditions (get 0)) ~(wrap-in-do (. results (get 0))))
-      (not else) `(cond ~@(apply concat (zip conditions (map wrap-in-do results))))
-      :else `(cond ~@(apply concat (zip conditions (map wrap-in-do results))) :else ~(wrap-in-do else)))))
+      (and single-if else) `(if ~(. conditions (get 0)) ~(. results (get 0)) ~else)
+      single-if `(if ~(. conditions (get 0)) ~(. results (get 0)))
+      (not else) `(cond ~@(apply concat (zip conditions results)))
+      :else `(cond ~@(apply concat (zip conditions results)) :else ~else))))

 (defn -visitClojureVector


Fix remove from album events.

Fix remove from album events.

--- src/cljs/personal_photos_reagent/events.cljs
+++ src/cljs/personal_photos_reagent/events.cljs
@@ -72,6 +72,10 @@
 (defonce select-album-chan (async/chan))
 (async/sub event-publisher :select-album select-album-chan)

+(defn- add-pictures-to-album
+  [pictures album]
+  ())
+
 (defn- select-album-event
   [e]
   (let [album (get e :payload)
@@ -95,18 +99,24 @@
 (defonce remove-from-album-chan (async/chan))
 (async/sub event-publisher :remove-from-album remove-from-album-chan)

+(defn- remove-selected-albums-from-picture
+  [picture]
+  (-> picture
+      (update-in [:albums] difference (:selected picture))
+      (assoc :selected #{})))
+
 (defn- remove-selected-pictures-from-album
-  [pictures]
-  (let [selected-pictures (filter (comp seq :selected) pictures)
-        removed-albums (map #(difference (:albums %) (:selected %)) selected-pictures)
+  [pictures-map]
+  (let [pictures (vals pictures-map)
+        selected-pictures (filter (comp seq :selected) pictures)
+        removed-albums (map remove-selected-albums-from-picture selected-pictures)
         removed-albums-as-map (into {} (map #(vector (:id %) %) removed-albums))]
-    (merge pictures removed-albums-as-map)))
+    (merge pictures-map removed-albums-as-map)))

 (defn- remove-from-album-event
   [event]
   (let [current-picture-state @(app-state :pictures)
-        current-pictures (vals current-picture-state)
-        removed-albums (remove-selected-pictures-from-album current-pictures)]
+        removed-albums (remove-selected-pictures-from-album current-picture-state)]
     (when (compare-and-set! (app-state :pictures) current-picture-state removed-albums)
       (publish-event :event :pictures-changed :payload (vals @(app-state :pictures))))))


update xhr select

update xhr select

--- src/cljs/re_form/inputs/select_xhr_impl.cljs
+++ src/cljs/re_form/inputs/select_xhr_impl.cljs
@@ -39,7 +39,7 @@
           timer (timeout ms)
           [new-val ch] (alts! [in timer])]
       (condp = ch
-        timer (do (swap! state assoc :suggestions (<! (suggest-fn val)))
+        timer (do (swap! state assoc :suggestions  (<! (suggest-fn val)))
                   (recur nil))
         in (when new-val (recur new-val))))))

@@ -51,7 +51,7 @@
   (let [state (r/atom {:current-text nil
                        :focused false
                        :suggestions []})
-
+        close #(swap! state assoc :focused false :current-text nil)
         on-change-ch (chan)
         handle-input-change
         (fn [event]
@@ -60,7 +60,7 @@
             (lookup-suggestions on-change-ch text)))]

     (debounced-callback state suggest-fn on-change-ch 100)
-
+    (.addEventListener (aget js/document "body" ) "click" #(when (:current-text @state) (close)))
     (r/create-class
      {:reagent-render
       (fn [{:keys [value on-change value-fn label-fn match-fn suggest-fn placeholder]}]
@@ -74,15 +74,12 @@
            [:input {:type "text"
                     :on-change handle-input-change
                     :on-focus #(swap! state assoc :focused true)
-                    :on-blur #(js/setTimeout (fn [] (swap! state assoc :focused false :current-text nil)) 100)
                     :value (or (:current-text @state)
-                               (label-fn value))}]
+                               (match-fn value))}]

            (when (and (:focused @state) (not (empty? (:suggestions @state))))
              [:div.suggestions
               (for [i (:suggestions @state)] ^{:key (pr-str (value-fn i))}
-                [:div.option {:on-click (fn []
-                                         (when on-change
-                                           (on-change (value-fn i)))
-                                         (swap! state assoc :current-text nil))}
+                [:div.option {:on-click #(do (when on-change (on-change (value-fn i)))
+                                             (close))}
                  (label-fn i)])])]))})))


Fixed bug in get-concepts that occurred when an empty set of ids was passed in.

--- src/cmr/metadata_db/data/oracle/concepts.clj
+++ src/cmr/metadata_db/data/oracle/concepts.clj
@@ -236,29 +236,31 @@

   (get-concepts
     [db concept-type provider-id concept-id-revision-id-tuples]
-    (let [start (System/currentTimeMillis)]
-      (j/with-db-transaction
-        [conn db]
-        ;; use a temporary table to insert our values so we can use a join to
-        ;; pull everything in one select
-        (apply j/insert! conn
-               "get_concepts_work_area"
-               ["concept_id" "revision_id"]
-               ;; set :transaction? false since we are already inside a transaction, and
-               ;; we want the temp table to persist for the main select
-               (concat concept-id-revision-id-tuples [:transaction? false]))
-        (let [table (tables/get-table-name provider-id concept-type)
-              stmt (su/build (select [:c.*]
-                               (from (as (keyword table) :c)
-                                     (as :get-concepts-work-area :t))
-                               (where `(and (= :c.concept-id :t.concept-id)
-                                            (= :c.revision-id :t.revision-id)))))
-
-              result (doall (map (partial db-result->concept-map concept-type conn provider-id)
-                                 (sql-utils/query conn stmt)))
-              millis (- (System/currentTimeMillis) start)]
-          (debug (format "Getting [%d] concepts took [%d] ms" (count result) millis))
-          result))))
+    (if (> (count concept-id-revision-id-tuples) 0)
+      (let [start (System/currentTimeMillis)]
+        (j/with-db-transaction
+          [conn db]
+          ;; use a temporary table to insert our values so we can use a join to
+          ;; pull everything in one select
+          (apply j/insert! conn
+                 "get_concepts_work_area"
+                 ["concept_id" "revision_id"]
+                 ;; set :transaction? false since we are already inside a transaction, and
+                 ;; we want the temp table to persist for the main select
+                 (concat concept-id-revision-id-tuples [:transaction? false]))
+          (let [table (tables/get-table-name provider-id concept-type)
+                stmt (su/build (select [:c.*]
+                                 (from (as (keyword table) :c)
+                                       (as :get-concepts-work-area :t))
+                                 (where `(and (= :c.concept-id :t.concept-id)
+                                              (= :c.revision-id :t.revision-id)))))
+
+                result (doall (map (partial db-result->concept-map concept-type conn provider-id)
+                                   (sql-utils/query conn stmt)))
+                millis (- (System/currentTimeMillis) start)]
+            (debug (format "Getting [%d] concepts took [%d] ms" (count result) millis))
+            result)))
+      []))

   (get-latest-concepts
     [db concept-type provider-id concept-ids]


Simplified web runna.

Simplified web runna.


adding index to init

adding index to init

--- src/es/systems.clj
+++ src/es/systems.clj
@@ -13,6 +13,7 @@
   "Systems indexing/searching"
   (:refer-clojure :exclude [get])
   (:require
+    [clojure.set :refer (subset?)]
     [clojure.core.strint :refer (<<)]
     [slingshot.slingshot :refer  [throw+]]
     [es.node :as node]
@@ -42,7 +43,7 @@
 (defn initialize
   "Creates systems index and type"
   []
-  (node/start-n-connect)
+  (node/start-n-connect [index])
   (when-not (idx/exists? index)
     (info "Creating index" index)
     (idx/create index :mappings system-types)))
@@ -50,7 +51,7 @@
 (defn clear
   "Creates systems index and type"
   []
-  (node/start-n-connect)
+  (node/start-n-connect [index])
   (when (idx/exists? index)
     (info "Clearing index" index)
     (idx/delete index)))
@@ -93,15 +94,19 @@
    [query]
   (update-in query [:bool :should] (fn [ts] (mapv env-term ts))))

+(defn query-envs [q]
+ (into #{} (filter identity (map #(keyword (get-in % [:term :env])) (get-in q [:bool :should])))))
+
 (defn envs-set
   "set should envs"
   [q {:keys [envs username]}]
-  (let [q-envs (into #{} (filter identity (map #(keyword (get-in % [:term :env])) (get-in q [:bool :should]))))]
-    (if-not (empty? q-envs)
-      (if (clojure.set/subset? q-envs (into #{} envs))
+  (let [es (query-envs q)]
+    (if-not (empty? es)
+      (if (subset? es (into #{} envs))
          (map-env-terms q)
-        (throw+ {:type ::non-legal-env :message (<< "~{username} tried to query in ~{q-envs} he has access only to ~{envs}")}))
-      (update-in q [:bool :should] (fn [v] (into v (mapv #(hash-map :term {:env (str %)}) envs)))))))
+        (throw+ {:type ::non-legal-env :message (<< "~{username} tried to query in ~{es} he has access only to ~{envs}")}))
+      (update-in q [:bool :should]
+        (fn [v] (into v (mapv #(hash-map :term {:env (str %)}) envs)))))))

 (defn- query-for [username q]
   (let [{:keys [envs username] :as user} (p/get-user! username)]
@@ -113,4 +118,5 @@
 (defn systems-for
   "grabs all the systems ids that this user can manipulate from ES"
   [username q from size]
+  (info "query for" (query-for username q))
   (query (query-for username q) :from from :size size))


Pages: Show buttons when pages are wider than...

--- src-cljs/pepa/components/page.cljs
+++ src-cljs/pepa/components/page.cljs
@@ -3,7 +3,8 @@
             [om.dom :as dom]
             [pepa.data :as data]
             [pepa.api :as api]
-            [sablono.core :refer-macros [html]]))
+            [sablono.core :refer-macros [html]]
+            [goog.style :as style]))

 (defn ^:private rotate [deg]
   (let [t (str "rotate(" deg "deg)")]
@@ -25,6 +26,8 @@
                    :style (rotate (:rotation page))
                    :className (when-not rendered?
                                 "pending")}))))
+
+(def +min-rotate-width+ 100)

 (defn ^:private rotate-clicked [page rotation e]
   (println "rotating" page "to" rotation "degrees")
@@ -50,7 +53,10 @@
       (if (and enable-rotate?
                (= :processing-status/processed (:render-status page)))
         (dom/div #js {:className "thumbnail"
-                      :onMouseEnter (fn [e] (om/set-state! owner :overlay? true))
+                      :onMouseEnter (fn [e]
+                                      (when (>= (.-width (style/getSize (om/get-node owner)))
+                                                +min-rotate-width+)
+                                        (om/set-state! owner :overlay? true)))
                       :onMouseLeave (fn [e] (om/set-state! owner :overlay? false))}
                  (when overlay?
                    (om/build rotate-buttons page))


Fix tag-selection in tags-input.

Fix tag-selection in tags-input.

--- src-cljs/pepa/components/tags.cljs
+++ src-cljs/pepa/components/tags.cljs
@@ -70,8 +70,8 @@
   (reify
     om/IDidUpdate
     (did-update [_ prev-props prev-state]
-      (when (and (= tag (om/get-state owner :selected))
-                 (not= tag (:selected prev-state)))
+      (when (and (not (contains? (:selected prev-state) tag))
+                 (contains? (om/get-state owner :selected) tag))
         (.focus (om/get-node owner))))
     om/IRenderState
     (render-state [_ {:keys [selected]}]
@@ -89,7 +89,7 @@
             :on-key-down (partial handle-tag-key-down! tag owner)
             :draggable true
             :on-drag-start (partial handle-drag-start tag)}
-        [:li.tag {:class [(when (= selected tag) "selected")]}
+        [:li.tag {:class [(when (contains? selected tag) "selected")]}
          [:span.color {:style {:background-color (tag-color tag)}}]
          [:span.tag-name tag]]]))))

@@ -159,7 +159,7 @@

         (and (= keycodes/BACKSPACE key-code)
              (cursor-at-start? element))
-        (send-event! owner [:focus (last (:tags document))])))))
+        (send-event! owner [:focus (om/value (last (:tags document)))])))))

 (defn handle-tags-blur! [document owner e]
   (when (store-tag! document owner)


get rid of intermediate schema rule

get rid of intermediate schema rule

--- src/braid/common/schema.cljc
+++ src/braid/common/schema.cljc
@@ -46,16 +46,15 @@
    (s/optional-key :new-message) (s/maybe s/Str)})

 ;; Notification rules schema
-(def NotifyRule
-  "One rule for user notification settings"
-  (s/conditional
-    #(or (= :any (first %)) (= :mention (first %)))
-    [(s/one (s/enum :any :mention) "rule")
-     (s/one (s/cond-pre (s/eq :any) s/Uuid) "id")]
+(def NotifyRules
+  "User notification rules"
+  [(s/conditional
+     #(or (= :any (first %)) (= :mention (first %)))
+     [(s/one (s/enum :any :mention) "rule")
+      (s/one (s/cond-pre (s/eq :any) s/Uuid) "id")]

-    #(= :tag (first %))
-    [(s/one (s/eq :tag) "rule") (s/one s/Uuid "id")]))
-(def NotifyRules "User notification rules" [NotifyRule])
+     #(= :tag (first %))
+     [(s/one (s/eq :tag) "rule") (s/one s/Uuid "id")])])
 (def check-rules! (s/validator NotifyRules))
 (defn rules-valid? [rs]
   (try (check-rules! rs) true


more icons for aside buttons

more icons for aside buttons


Handle abacus status requests for non-existing products

--- src/clj/mdr2/abacus/core.clj
+++ src/clj/mdr2/abacus/core.clj
@@ -153,8 +153,12 @@
     (if (seq errors)
       (->AnnotatedFailure "The provided xml is not valid" errors)
       (let [{product_number :product_number} (read-file f)
-            production (prod/find-by-productnumber product_number)]
-        (>!! queues/notify-abacus production)
+            production (-> product_number
+                           prod/find-by-productnumber
+                           (fail/assert-not-nil?
+                            (format "Product %s number not found" product_number)))]
+        (when-not (fail/failed? production)
+          (>!! queues/notify-abacus production))
         production))))

 (defn import-metadata-update


Interpolation.

Interpolation.

--- src/clj/triangulate/core.clj
+++ src/clj/triangulate/core.clj
@@ -23,7 +23,7 @@
         lat2 (:lat b)
         lon1 (:long a)
         lon2 (:long b)
-        R 6372.8
+        R 6372800
         dlat (Math/toRadians (- lat2 lat1))
         dlon (Math/toRadians (- lon2 lon1))
         lat1 (Math/toRadians lat1)
@@ -31,7 +31,41 @@
         a (+ (* (Math/sin (/ dlat 2)) (Math/sin (/ dlat 2)))
              (* (Math/sin (/ dlon 2)) (Math/sin (/ dlon 2))
                 (Math/cos lat1) (Math/cos lat2)))]
-    (* 1000 (* R 2 (Math/asin (Math/sqrt a))))))
+    (* R 2 (Math/asin (Math/sqrt a)))))
+
+(defn bearing [a b]
+  (let [lat1 (:lat a)
+        lat2 (:lat b)
+        lon1 (:long a)
+        lon2 (:long b)
+        rlat-1 (Math/toRadians lat1)
+        rlat-2 (Math/toRadians lat2)
+        diff (Math/toRadians (- lon2 lon1))
+        y (* (Math/sin diff) (Math/cos rlat-2))
+        x (- (* (Math/cos rlat-1) (Math/sin rlat-2))
+             (* (Math/sin rlat-1) (Math/cos rlat-2) (Math/cos diff)))]
+    (mod (Math/toDegrees (+ (Math/atan2 y x) 360)) 360)))
+
+(defn interpolate-coordinates [a d bearing]
+  (let [lat-1 (:lat a)
+        long-1 (:long a)
+        r 6372800
+        lat-2 (Math/asin (+ (* (Math/sin lat-1)
+                               (Math/cos (/ d r)))
+                            (* (Math/cos lat-1)
+                               (Math/sin (/ d r))
+                               (Math/cos bearing))))
+        long-2 (+ long-1
+                  (Math/atan2 (* (Math/sin bearing) (Math/sin (/ d r)) (Math/cos lat-1))
+                              (- (Math/cos (/ d r)) (* (Math/sin lat-1) (Math/sin lat-2)))))]
+    {:lat lat-2 :long long-2}))
+
+(defn take-segments
+  ([segments distance] (take-segments segments distance 0 0))
+  ([[head & tail] distance k n]
+     (if (>= k distance)
+       n
+       (recur tail distance (+ k head) (inc n)))))

 (def coordinates (reverse (decode-polyline (polyline))))

@@ -40,13 +74,6 @@
 (def pairs (partition 2 1 coordinates))

 (def segments (map (fn [[a b]] (haversine a b)) pairs))
-
-(defn take-segments
-  ([segments distance] (take-segments segments distance 0 0))
-  ([[head & tail] distance k n]
-     (if (>= k distance)
-       n
-       (recur tail distance (+ k head) (inc n)))))

 (def back-segment (take-segments segments meters-away))

@@ -60,7 +87,13 @@

 (def front-coordinate (nth coordinates front-segment))

+(def vehicle-bearing (bearing back-coordinate front-coordinate))
+
 (def distance-to-front-segment (- back-distance meters-away))
+
+;(pprint coordinates)
+
+(interpolate-coordinates front-coordinate distance-to-front-segment vehicle-bearing)

 (defroutes routes
   (POST "/rush-hour/api/triangulate/edn" {:keys [body]}


update lsys module, make parser more whitespace aware, add support for new symbols

--- src/thingybot/modules/lsys/core.clj
+++ src/thingybot/modules/lsys/core.clj
@@ -13,6 +13,9 @@
    :theta  0
    :rot    90})

+(def valid-symbols
+  #{:start :fwd :left :right :push :pop :a :b :c :d :e :x :y :z})
+
 (defn replace-symbols
   [src]
   (let [src (replace
@@ -20,7 +23,8 @@
               \f :fwd
               \+ :right \- :left
               \[ :push \] :pop
-              \a :a \b :b \c :c \d :d \e :e}
+              \a :a \b :b \c :c \d :d \e :e
+              \x :x \y :y \z :z}
              src)
         num (count src)]
     (loop [acc [] i 0]
@@ -40,11 +44,11 @@
 (defn parse-system-spec
   [src]
   (let [src                 (str/lower-case src)
-        [hd rules]          (str/split src #":")
-        [bg iter theta rot] (str/split hd #",")
+        [hd rules]          (str/split src #"\s*:\s*")
+        [bg iter theta rot] (str/split hd #"\s*,\s*")
         rules               (if rules
                               (->> rules
-                                   (re-seq #"(([a-z])=([a-z2-9\-\+\[\]]+))")
+                                   (re-seq #"(([a-z])\s*=\s*([a-z2-9\-\+\[\]]+))")
                                    (map translate-rule)
                                    (into {})))]
     {:bg    (try (col/as-int24 (col/css bg)) (catch Exception e))
@@ -58,7 +62,7 @@
   (and (:start rules)
        (->> rules
             (mapcat val)
-            (every? #{:start :fwd :left :right :push :pop :a :b :c :d :e}))))
+            (every? valid-symbols))))

 (defn process-tweet
   [{:keys [id src params user-id]}]


Added printing an URI of report.

Added printing an URI of report.

--- src/validation_benchmark/report.clj
+++ src/validation_benchmark/report.clj
@@ -11,8 +11,8 @@

 (defn create-report [groups results report-path]
-  (println "Summary:")
-  (let [html-path (str report-path "/index.html")
+  (let [current-directory (System/getProperty "user.dir")
+        html-path (str report-path "/index.html")
         chart-path (str report-path "/chart.png")
         summary (->> (for [[group fns] groups
                            [lib-name lib-data] results
@@ -29,6 +29,8 @@
                      ;; (= v :invalid) returns false for :valid,
                      ;; so it's sorted before :invalid.
                      (sort-by (fn [[[n v] l _]] [n (= v :invalid) l])))]
+    (println "Summary: "
+             (str "file://" current-directory "/" html-path))
     (make-parents html-path)
     (with-open [w (writer html-path)]
       (.write w (render-html summary)))


remove adjective pattern matching: moved to adjectives.cljc

--- src/babel/italiano/morphology/nouns.cljc
+++ src/babel/italiano/morphology/nouns.cljc
@@ -9,32 +9,6 @@

 (def replace-patterns
   [
-
-   {:p [#"(.*)e$" "$1o"] ;; nere -> nero
-    :u {:synsem {:cat :adjective
-                 :agr {:gender :fem
-                       :number :plur}}}}
-
-   {:p [#"(.*)e$" "$1e"] ;; difficile (fem plural) -> difficile (lexical form, which happens to be spelled the same)
-    :u {:synsem {:cat :adjective
-                 :agr {:gender :fem
-                       :number :plur}}}}
-
-   {:p [#"(.*)a$" "$1o"] ;; nera -> nero
-    :u {:synsem {:cat :adjective
-                 :agr {:gender :fem
-                       :number :sing}}}}
-
-   {:p [#"(.*)i$" "$1e"] ;; difficili -> difficile
-    ;; note that we do not specify the [:agr :gender], because
-    ;; the surface form could be either masculine or feminine.
-    :u {:synsem {:cat :adjective
-                 :agr {:number :plur}}}}
-
-   {:p [#"(.*)i$" "$1o"] ;; neri -> nero
-    :u {:synsem {:cat :adjective
-                 :agr {:gender :masc
-                       :number :plur}}}}

    {:p [#"(.*)i$" "$1io"] ;; "bracci" -> "braccio"
     :u {:synsem {:cat :noun


Add missing try-catch clauses to handle exceptions inside threads

--- src/cyanite_remover/core.clj
+++ src/cyanite_remover/core.clj
@@ -301,11 +301,21 @@
     (catch Exception e
       (clog/unhandled-error e))))

+(defn- process-path
+  "Process a path."
+  [processor path]
+  (try
+    (pp-process processor path)
+    (catch Exception e
+      (clog/error (str "Path processing error: " e ", "
+                       "path: " path) e))))
+
 (defn- process-paths
   "Process paths."
   [tenant paths pstore options processor-fn tpool]
   (let [processor (processor-fn pstore tenant options)
-        title (pp-get-title processor)]
+        title (pp-get-title processor)
+        proc-fn (partial process-path processor)]
     (try
       (prog/set-progress-bar!
        "[:bar] :percent :done/:total Elapsed :elapseds ETA :etas")
@@ -315,8 +325,7 @@
       (when-not @clog/print-log?
         (println title)
         (prog/init (count paths)))
-      (let [futures (doall (map #(cp/future tpool (pp-process processor %))
-                                paths))]
+      (let [futures (doall (map #(cp/future tpool (proc-fn %)) paths))]
         (dorun (process-futures futures)))
       (when-not @clog/print-log?
         (prog/done))
@@ -380,19 +389,24 @@
 (defn- check-metric-obsolete
   "Check a metric for obsolescence."
   [mstore tenant from path rollup-def]
-  (let [rollup (first rollup-def)
-        period (last rollup-def)]
-    (when-not @inspecting?
-      (clog/info (str "Checking metrics: "
-                      "path: " path ", "
-                      "rollup: " rollup ", "
-                      "period: " period)))
-    (let [data (mstore/fetch mstore tenant rollup period path from nil 1)]
-      (if (and (not= data :mstore-error) (not (seq data)))
-        (do
-          (log/debug (str "Metrics on path '" path "' are obsolete"))
-          [path rollup-def])
-        nil))))
+  (try
+    (let [rollup (first rollup-def)
+          period (last rollup-def)]
+      (when-not @inspecting?
+        (clog/info (str "Checking metrics: "
+                        "path: " path ", "
+                        "rollup: " rollup ", "
+                        "period: " period)))
+      (let [data (mstore/fetch mstore tenant rollup period path from nil 1)]
+        (if (and (not= data :mstore-error) (not (seq data)))
+          (do
+            (log/debug (str "Metrics on path '" path "' are obsolete"))
+            [path rollup-def])
+          nil)))
+    (catch Exception e
+      (clog/error (str "Metric obsolescence checking error: " e ", "
+                       "path: " path ", "
+                       "rollup: " rollup-def) e))))

 (defn- filter-obsolete-metrics
   "Filter obsolete metrics."


trailing zero to dimacs file

trailing zero to dimacs file


:bug: Show icons in layers panel

:bug: Show icons in layers panel

--- frontend/src/uxbox/main/ui/workspace/sidebar/layers.cljs
+++ frontend/src/uxbox/main/ui/workspace/sidebar/layers.cljs
@@ -261,7 +261,7 @@

 (defn- strip-objects
   [objects]
-  (let [strip-data #(select-keys % [:id :name :blocked :hidden :shapes :type])]
+  (let [strip-data #(select-keys % [:id :name :blocked :hidden :shapes :type :content :metadata])]
     (persistent!
      (reduce-kv (fn [res id obj]
                   (assoc! res id (strip-data obj)))


project.clj

project.clj


added meta-folder deletion test

added meta-folder deletion test

--- src/test/clojure/com/narkisr/integration.clj
+++ src/test/clojure/com/narkisr/integration.clj
@@ -40,6 +40,14 @@
     (is (= (. temp exists) false))
     (is (thrown? java.io.FileNotFoundException (spit temp "{\"some\":value}")))))

+(deftest meta-folder-deletion
+  (is (= (-> "fake/foo/" (File.) (.mkdir)) true))
+  (is (= (-> "fake/.foo/" (File.) (.exists)) true))
+  (is (= (-> "fake/foo/" (File.) (.delete)) true))
+  (sh "find"  "fake/.foo"); without this Java thinks that the file still exists (maybe some caching issue?)
+  (is (= (-> "fake/.foo/" (File.) (.exists)) false )))
+
+
 (deftest mkdir-only-on-root
   (do-template (do
     (is (= (-> _1 (File.) (.mkdir)) _2))


Reformated a piece of code.

Reformated a piece of code.

--- src/blutwurst/value_generators.clj
+++ src/blutwurst/value_generators.clj
@@ -11,7 +11,10 @@
 (defn- crop-to-column-size [column input-string]
   (if (or (nil? input-string) (empty? input-string))
     input-string
-    (subs input-string 0 (min (count input-string) (or (:length column) (-> column :constraints :maximum-length) 20)))))
+    (subs input-string 0 (min (count input-string)
+                              (or (:length column)
+                                  (-> column :constraints :maximum-length)
+                                  20)))))

 (defn- create-regex-generator [generator-name regex]
   {:name generator-name


puny connecton should be set before migrations

--- src/celestial/persistency/core.clj
+++ src/celestial/persistency/core.clj
@@ -30,11 +30,10 @@
   []
   Lifecyle
   (setup [this]
+    (initilize-puny)
     (u/reset-admin)
     (mg/setup-migrations))
-  (start [this]
-    (initilize-puny)
-    )
+  (start [this])
   (stop [this])
   )


Add build-retry api-path util

Add build-retry api-path util

--- src-cljs/frontend/api/path.cljs
+++ src-cljs/frontend/api/path.cljs
@@ -1,6 +1,7 @@
 (ns frontend.api.path
   (:require [goog.string :as gstring]))

+; settings
 (defn settings-path [project]
   (case (:vcs_type project)
     "bitbucket" (gstring/format
@@ -18,3 +19,12 @@
     "github" (gstring/format
                "/api/v1/project/%s/%s/plan"
                (:org project) (:repo project))))
+; builds
+(defn build-retry [{:keys [vcs-type org-name repo-name build-num] :as project}]
+  (case vcs-type
+    "bitbucket" (gstring/format
+                  "/api/dangerzone/project/%s/%s/%s/%s/retry"
+                  vcs-type org-name repo-name build-num)
+    "github" (gstring/format
+               "/api/v1/project/%s/%s/%s/retry"
+               org-name repo-name build-num)))


Simplify transdcuer

Simplify transdcuer

--- src/clj/algorithms_clj/huffman.clj
+++ src/clj/algorithms_clj/huffman.clj
@@ -84,9 +84,7 @@
         ([] (xf))
         ([result] (xf result))
         ([result input]
-          (let [{:keys [lhs rhs]} @curr-branch
-                next-branch (if (= 0 input) lhs rhs)
-                values (:values next-branch)]
+          (let [{:keys [values] :as next-branch} (if (= 0 input) (:lhs @curr-branch) (:rhs @curr-branch))]
             (vreset! curr-branch next-branch)
             (if (= 1 (count values))
               (do (vreset! curr-branch huffman-tree)


Fix type hinting for hinted-args and closures vs. prepare method

--- src/clj/backtype/storm/clojure.clj
+++ src/clj/backtype/storm/clojure.clj
@@ -22,6 +22,13 @@
             (hint collector 'backtype.storm.task.OutputCollector)]
            )

+; Special case for clojure where we use a closure instead of the prepare
+; method
+(defmethod hinted-args 'prepare-fn [_ [conf context collector]]
+  [(hint conf 'java.util.Map)
+   (hint context 'backtype.storm.task.TopologyContext)
+   (hint collector 'java.util.Map)])
+
 (defmethod hinted-args 'execute [_ [tuple]]
            [(hint tuple 'backtype.storm.tuple.Tuple)]
            )
@@ -34,6 +41,11 @@
            []
            )

+(defmethod hinted-args 'open-fn [_ [conf context collector]]
+           [(hint conf 'java.util.Map)
+            (hint context 'backtype.storm.task.TopologyContext)
+            (hint collector 'java.util.Map)]
+           )
 (defmethod hinted-args 'open [_ [conf context collector]]
            [(hint conf 'java.util.Map)
             (hint context 'backtype.storm.task.TopologyContext)
@@ -112,7 +124,7 @@
                     (let [[args & impl-body] impl
                           coll-sym (nth args 1)
                           args (vec (take 1 args))
-                          prepargs (hinted-args 'prepare [(gensym "conf") (gensym "context") coll-sym])]
+                          prepargs (hinted-args 'prepare-fn [(gensym "conf") (gensym "context") coll-sym])]
                       `(fn ~prepargs (bolt (~'execute ~args ~@impl-body)))))
           definer (if params
                     `(defn ~name [& args#]
@@ -140,7 +152,7 @@
                     (cons 'fn impl)
                     (let [[args & impl-body] impl
                           coll-sym (first args)
-                          prepargs (hinted-args 'open [(gensym "conf") (gensym "context") coll-sym])]
+                          prepargs (hinted-args 'open-fn [(gensym "conf") (gensym "context") coll-sym])]
                       `(fn ~prepargs (spout (~'nextTuple [] ~@impl-body)))))
           definer (if params
                     `(defn ~name [& args#]


Add bolt capacities to UI based on execute latency and executed

--- src/clj/backtype/storm/ui/core.clj
+++ src/clj/backtype/storm/ui/core.clj
@@ -250,8 +250,8 @@
             (aggregate-averages (map #(.. ^ExecutorStats % get_specific get_bolt get_execute_ms_avg)
                                      stats-seq)
                                 (map #(.. ^ExecutorStats % get_specific get_bolt get_executed)
-                                     stats-seq))}
-           )))
+                                     stats-seq))
+            })))

 (defn aggregate-spout-stats [stats-seq include-sys?]
   (let [stats-seq (collectify stats-seq)]
@@ -378,6 +378,34 @@
 (defn component-link [storm-id id]
   (link-to (url-format "/topology/%s/component/%s" storm-id id) id))

+(defn render-capacity [capacity]
+  [:span (if (> capacity 0.9)
+               {:class "red"}
+               {})
+         (float-str capacity)])
+
+(defn compute-executor-capacity [^ExecutorSummary e]
+  (let [stats (.get_stats e)
+        stats (if stats
+                (-> stats
+                    (aggregate-bolt-stats true)
+                    (aggregate-bolt-streams)
+                    swap-map-order
+                    (get "600")))
+        uptime (nil-to-zero (.get_uptime_secs e))
+        window (if (< uptime 600) uptime 600)
+        executed (-> stats :executed nil-to-zero)
+        latency (-> stats :execute-latencies nil-to-zero)
+        ]
+   (if (> window 0)
+     (div (* executed latency) (* 1000 window))
+     )))
+
+(defn compute-bolt-capacity [executors]
+  (->> executors
+       (map compute-executor-capacity)
+       (apply max)))
+
 (defn spout-comp-table [top-id summ-map errors window include-sys?]
   (sorted-table
    ["Id" "Executors" "Tasks" "Emitted" "Transferred" "Complete latency (ms)"
@@ -401,7 +429,7 @@

 (defn bolt-comp-table [top-id summ-map errors window include-sys?]
   (sorted-table
-   ["Id" "Executors" "Tasks" "Emitted" "Transferred" "Execute latency (ms)" "Executed" "Process latency (ms)"
+   ["Id" "Executors" "Tasks" "Emitted" "Transferred" "Capacity (last 10m)" "Execute latency (ms)" "Executed" "Process latency (ms)"
     "Acked" "Failed" "Last error"]
    (for [[id summs] summ-map
          :let [stats-seq (get-filled-stats summs)
@@ -414,6 +442,7 @@
       (sum-tasks summs)
       (get-in stats [:emitted window])
       (get-in stats [:transferred window])
+      (render-capacity (compute-bolt-capacity summs))
       (float-str (get-in stats [:execute-latencies window]))
       (get-in stats [:executed window])
       (float-str (get-in stats [:process-latencies window]))
@@ -590,7 +619,7 @@

 (defn bolt-executor-table [topology-id executors window include-sys?]
   (sorted-table
-   ["Id" "Uptime" "Host" "Port" "Emitted" "Transferred"
+   ["Id" "Uptime" "Host" "Port" "Emitted" "Transferred" "Capacity (last 10m)"
     "Execute latency (ms)" "Executed" "Process latency (ms)" "Acked" "Failed"]
    (for [^ExecutorSummary e executors
          :let [stats (.get_stats e)
@@ -606,6 +635,7 @@
       (.get_port e)
       (nil-to-zero (:emitted stats))
       (nil-to-zero (:transferred stats))
+      (render-capacity (compute-executor-capacity e))
       (float-str (:execute-latencies stats))
       (nil-to-zero (:executed stats))
       (float-str (:process-latencies stats))


implement Ankusa

implement Ankusa

--- src/clj/game/cards-icebreakers.clj
+++ src/clj/game/cards-icebreakers.clj
@@ -153,6 +153,18 @@
                                   :msg "break 1 sentry subroutine"}
                                  (strength-pump 2 3)]})

+   "Ankusa"
+   (auto-icebreaker ["Barrier"]
+                    {:abilities [(break-sub 2 1 "barrier")
+                                 (strength-pump 1 1)
+                                 {:label "Add barrier to HQ"
+                                  :req (req (and (has-subtype? current-ice "Barrier")
+                                                 (rezzed? current-ice)))
+                                  :msg (msg "add " (:title current-ice) " to HQ after breaking all its subroutines")
+                                  :effect (req (let [c current-ice]
+                                                 (move state :corp c :hand nil)
+                                                 (trash-ice-in-run state)))}]})
+
    "Atman"
    {:prompt "How many power counters?"
     :choices :credit


start working on station info panel

start working on station info panel

--- src/cljs/om_next_leaflet/core.cljs
+++ src/cljs/om_next_leaflet/core.cljs
@@ -45,6 +45,12 @@
   {:value {:keys [:app/mapstate]}
    :action (fn [] (swap! state assoc :app/mapstate new-mapstate))})

+(defmethod mutate 'app/update-station-info
+  [{:keys [state]} _ {:keys [new-station-info]}]
+  {;; :remote true
+   :value {:keys [:app/station-info]}
+   :action (fn [] (swap! state assoc :app/station-info new-station-info))})
+
 (defmulti read om/dispatch)

 (defmethod read :app/title
@@ -75,6 +81,13 @@
       (if v
         {:value v :remote true}
         {:remote true}))))
+
+(defmethod read :app/station-info
+  [{:keys [state] :as env} k _]
+  (let [st @state]
+    (if-let [v (get st k)]
+      {:value v} ;; :remote true
+      {})))

 (defmethod read :default ;; :app/mapstate
   [{:keys [state] :as env} k params]
@@ -111,7 +124,16 @@
       (let [[lng lat] geometry
             marker (leaflet/create-marker lat lng :radius 6 :fillColor "#0000ff" :fillOpacity 1.0 :weight 1)]
         (doto marker
-          (.bindPopup (str "" line-name "
" station-name))
+          ;; (.bindPopup (str "" line-name "
" station-name))
+          (.on "click" (fn [e] (let [new-station-info (map->StationInfo {:id id
+                                                                         :name station-name
+                                                                         :line-info
+                                                                         (list
+                                                                          (map->StationLineInfo {:station-id id
+                                                                                :line-id line-name
+                                                                                :kilotei 10}))
+                                                                         })]
+                                 (om/transact! this `[(app/update-station-info {:new-station-info ~new-station-info})]))))
           (.on "mouseover" (fn [e] (.setStyle marker (clj->js {:fillColor "#ff0000"}))))
           (.on "mouseout" (fn [e] (.setStyle marker (clj->js {:fillColor "#0000ff"}))))
           (.addTo stations-layer))))))
@@ -139,9 +161,12 @@
     {:line-id 25})
   static om/IQuery
   (query [this]
-    '[:app/title :loading? :app/mapstate :app/lines
+    '[:app/title
+      :loading?
+      :app/mapstate
+      :app/lines
       (:app/stations {:line-id ?line-id})
-      ])
+      :app/station-info])
   Object
   (componentWillMount [this]
     (.log js/console "will-mount"))
@@ -153,10 +178,12 @@
   (componentWillUnmount [this]
     (.log js/console "will-unmount"))
   (render [this]
-    (let [{:keys [app/title loading?
+    (let [{:keys [app/title
+                  loading?
                   app/mapstate
                   app/stations
-                  app/lines]} (om/props this)]
+                  app/lines
+                  app/station-info]} (om/props this)]
       (html
        [:div
         [:div.leaflet-control-layers.leaflet-control-layers-expanded.leaflet-control
@@ -174,6 +201,15 @@
          [:input {:ref "title"}]
          [:p title]
          [:p (str "zoom: " (:zoom mapstate init-zoom))]
+         [:p (str "station-id:" (:id station-info))]
+         [:p (str "station-name:" (:name station-info))]
+         [:p (str "line-id: " (:line-id (first (:line-info station-info))))]
+         [:input {:ref "kilotei" :value (str (:kilotei (first (:line-info station-info))))
+                  :on-change (fn [e] (let [new-text (-> e .-target .-value)
+                                           li (first (:line-info station-info))
+                                           li (list (update li :kilotei (fn [_] constantly new-text)))
+                                           new-value (update station-info :line-info (fn [_] constantly li))]
+                                       (om/transact! this `[(app/update-station-info {:new-station-info ~new-value})])))}]
          [:button {:on-click (fn [e]
                                 (let [new-title (.-value (dom/node this "title"))]
                                   (om/transact! this `[(app/update-title {:new-title ~new-title})


layout touch-ups on match-form

layout touch-ups on match-form

--- src/foosball/views/match.clj
+++ src/foosball/views/match.clj
@@ -27,7 +27,7 @@
         idscore (str prefix "score")
         error-class {:class "control-group error"}]
     [:div.span4
-     [:h3 (str "Team " team-num)]
+     [:h2 (str "Team " team-num ":")]

      [:div.control-group
       (when (validation-error? validation-errors :players (keyword idp1)) error-class)
@@ -50,6 +50,9 @@
                         :or {matchdate (java.util.Date.)}}]]
   (html5
    [:h1 "Report Match Result"]
+   [:p.lead
+    "A match winner is the first team to reach ten goals while atleast two goals ahead of the opposing team." [:br]
+    "In case of tie-break, report 11-9 or 9-11."]
    [:form.form-horizontal {:action "/report/match" :method "POST"}
     [:div.row
      (team-controls :team1 1 team1 players validation-errors)
@@ -57,14 +60,14 @@

     [:div.row
      [:div.span4
-      [:h3 "Match"]
+      [:h2 "Match:"]
       [:div.control-group
        [:label.control-label {:for "matchdate"} "Date played"]
        [:div.controls [:input.input-small {:id "matchdate" :name "matchdate"
                                            :type "date" :value (format-time matchdate)}]]]

       [:div.control-group
-       [:div.controls [:button.btn.btn-primary.btn-large {:type "submit" :value "Report"} "Report"]]]]]]))
+       [:div.controls [:button.btn.btn-primary.btn-large.btn-block.span4 {:type "submit" :value "Report"} "Report"]]]]]]))

 (defn- render-match [{:keys [matchdate team1 team2]}]
   (let [[t1p1 t1p2 t1score] (map team1 [:player1 :player2 :score])


Interleave and interpose problems added

Interleave and interpose problems added

--- src/foreclojure/data_set.clj
+++ src/foreclojure/data_set.clj
@@ -380,4 +380,30 @@
             :tags ["easy" "core-functions"]
             :tests ["(= (__ 1 8 3 4) 8)"
 		    "(= (__ 30 20) 30)"]
-	    :secret-tests ["(= (__ 45 67 11) 67)"]})))+	    :secret-tests ["(= (__ 45 67 11) 67)"]})
+
+
+    (insert! :problems
+           {:_id 39
+            :title "Interleave Two Seqs"
+            :times-solved 0
+	    :restricted ["interleave"]
+            :description "Write a function which takes two sequences and returns the first item from each, then the second item from each, then the third, etc."
+            :tags ["easy" "seqs" "core-functions"]
+	    :tests ["(= (__ [1 2 3] [:a :b :c]) '(1 :a 2 :b 3 :c))"
+		    "(= (__ [1 2] [3 4 5 6]) '(1 3 2 4))"]
+	    :secret-tests ["(= (__ [1 2 3 4] [5]) [1 5])"
+			   "(= (__ [30 20] [25 15]) [30 25 20 15])"]})
+
+
+
+    (insert! :problems
+           {:_id 40
+            :title "Interpose a Seq"
+            :times-solved 0
+	    :restricted ["interpose"]
+            :description "Write a function which separates the items of a sequence by an arbitrary value."
+            :tags ["easy" "seqs" "core-functions"]
+            :tests ["(= (__ 0 [1 2 3]) [1 0 2 0 3])"
+		    "(= (apply str (__ \", \" [\"one\" \"two\" \"three\"])) \"one, two, three\")"]
+	    :secret-tests ["(= (__ :z [:a :b :c :d]) [:a :z :b :z :c :z :d])"]})))