-
Notifications
You must be signed in to change notification settings - Fork 0
/
CTMM-TraIT_trait_odm_to_i2b2.sql
4 lines (4 loc) · 1.27 KB
/
CTMM-TraIT_trait_odm_to_i2b2.sql
1
2
3
4
CREATE INDEX CD_IDX_UPLOADID ON CONCEPT_DIMENSION(UPLOAD_ID);
SELECT count(*) FROM STUDY WHERE C_HLEVEL =
CREATE TABLE Observation_Fact ( Encounter_Num int NOT NULL, REDCap_Subject_ID varchar(50), Patient_Num int, Concept_Cd varchar(50) NOT NULL, Provider_Id varchar(50) NOT NULL, Start_Date datetime NOT NULL, Modifier_Cd varchar(100) NOT NULL, ValType_Cd varchar(50) NULL, TVal_Char varchar(255) NULL, NVal_Num decimal(18,5) NULL, INSTANCE_NUM int NULL, ValueFlag_Cd varchar(50) NULL, Quantity_Num decimal(18,5) NULL, Units_Cd varchar(50) NULL, End_Date datetime NULL, Location_Cd varchar(50) NULL, Observation_Blob text NULL, Confidence_Num decimal(18,5) NULL, Update_Date datetime NULL, Download_Date datetime NULL, Import_Date datetime NULL, Sourcesystem_Cd varchar(50) NULL, UPLOAD_ID INT NULL, CONSTRAINT OBSERVATION_FACT_PK PRIMARY KEY nonclustered (encounter_num,concept_cd,provider_id,start_date,modifier_cd) )
CREATE TABLE concept_dimension ( concept_path varchar(700) NOT NULL, concept_cd varchar(50) NULL, name_char varchar(2000) NULL, concept_blob text NULL, update_date datetime NULL, download_date datetime NULL, import_date datetime NULL, sourcesystem_cd varchar(50) NULL, UPLOAD_ID INT NULL, CONSTRAINT CONCEPT_DIMENSION_PK PRIMARY KEY(concept_path) )