Changes between Version 6 and Version 7 of i2b2 HowTo Create an Ontology
- Timestamp:
- 03/13/14 11:41:56 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
i2b2 HowTo Create an Ontology
v6 v7 119 119 120 120 DECLARE @OntologyName VARCHAR(50), -- The name of the ontology, e.g. 'Onyx' 121 @Prefix VARCHAR(10), -- The prefix for the concept code, e.g. 'ONX'122 @OntologyDescription VARCHAR(100), -- A nice description, e.g. 'BRICCS Onyx Questionnaire'123 @OntologyBaseNode VARCHAR(50), -- The name of the base node of the tree within i2b2, e.g. 'Onyx'124 @SourceSystem VARCHAR(50), -- The system from where the data came, e.g. 'BRICCS Onyx'125 @MetaDatabaseName VARCHAR(50), -- The name of the Meta Database in which to create the Ontology, e.g. 'i2b2_b1_metadata'126 @DataDatabaseName VARCHAR(50) -- The name of the Data Database in which to create the Ontology, e.g. 'i2b2_b1_data'127 128 SET @OntologyName = ' TestCiviCRM' -- Must not contain spaces129 SET @Prefix = ' TestGenCV'130 SET @OntologyDescription = ' TestGenvasc Study Details from CiviCRM'131 SET @OntologyBaseNode = ' TestCiviCRM'132 SET @SourceSystem = ' TestGenvasc CiviCRM'133 SET @MetaDatabaseName = 'i2b2_ b1_metadata'134 SET @DataDatabaseName = 'i2b2_ b1_data'121 @Prefix VARCHAR(10), -- The prefix for the concept code, e.g. 'ONX' 122 @OntologyDescription VARCHAR(100), -- A nice description, e.g. 'BRICCS Onyx Questionnaire' 123 @OntologyBaseNode VARCHAR(50), -- The name of the base node of the tree within i2b2, e.g. 'Onyx' 124 @SourceSystem VARCHAR(50), -- The system from where the data came, e.g. 'BRICCS Onyx' 125 @MetaDatabaseName VARCHAR(50), -- The name of the Meta Database in which to create the Ontology, e.g. 'i2b2_b1_metadata' 126 @DataDatabaseName VARCHAR(50) -- The name of the Data Database in which to create the Ontology, e.g. 'i2b2_b1_data' 127 128 SET @OntologyName = 'PrimaryCareData' -- Must not contain spaces 129 SET @Prefix = 'PCD' 130 SET @OntologyDescription = 'Primary Care Data from GEM' 131 SET @OntologyBaseNode = 'PrimaryCareData' 132 SET @SourceSystem = 'Gem Risk Stratification' 133 SET @MetaDatabaseName = 'i2b2_app03_genvasc_MetaData' 134 SET @DataDatabaseName = 'i2b2_app03_genvasc_Data' 135 135 136 136 ---------------------------------------------------------------- … … 179 179 SET @UpgradeOntology1_6A = ' 180 180 ALTER TABLE ' + @OntologyName + ' 181 ADD m_applied_path varchar(700) NULL181 ADD m_applied_path varchar(700) NULL 182 182 ; 183 183 184 184 ALTER TABLE ' + @OntologyName + ' 185 ADD m_exclusion_cd varchar(25) NULL185 ADD m_exclusion_cd varchar(25) NULL 186 186 ; 187 187 188 188 ALTER TABLE ' + @OntologyName + ' 189 ADD C_PATHVARCHAR(700) NULL189 ADD C_PATH VARCHAR(700) NULL 190 190 ; 191 191 192 192 ALTER TABLE ' + @OntologyName + ' 193 ADD C_SYMBOL VARCHAR(50)NULL193 ADD C_SYMBOL VARCHAR(50) NULL 194 194 ; 195 195 ' … … 201 201 202 202 ALTER TABLE ' + @OntologyName + ' 203 ALTER COLUMN [m_applied_path] varchar(700) NOT NULL204 ; 205 203 ALTER COLUMN [m_applied_path] varchar(700) NOT NULL 204 ; 205 206 206 CREATE INDEX ' + @OntologyName + '_META_FULLNAME_IDX ON ' + @OntologyName + '(C_FULLNAME); 207 207 208 CREATE INDEX ' + @OntologyName + '_META_APPLIED_PATH_IDX ON ' + @OntologyName + '(M_APPLIED_PATH); 208 CREATE INDEX ' + @OntologyName + '_META_APPLIED_PATH_IDX ON ' + @OntologyName + '(M_APPLIED_PATH); 209 209 ' 210 210 … … 248 248 INSERT INTO [i2b2ClinDataIntegration].[dbo].[Ontology] ([Name],[Prefix],[SourceSystem]) 249 249 VALUES ( 250 @OntologyName250 @OntologyName 251 251 ,@Prefix 252 252 ,@SourceSystem); … … 258 258 INSERT INTO [i2b2ClinDataIntegration].[dbo].[OntologyCode] ([ParentID],[OntologyID],[Code],[Name],[OntologyNodeTypeCode],[OntologyNodeStatusCode],[Editable],[MetaDataTypeCode],[MetaUnits]) 259 259 VALUES ( 260 NULL260 NULL 261 261 ,@OntologyID 262 262 ,1 … … 267 267 ,NULL 268 268 ,NULL 269 );270 269 ); 270 */ 271 271 -- Insert the base code into the Ontology table 272 272 DECLARE @TCreateBaseInOntologyTable VARCHAR(MAX) … … 274 274 USE ' + @MetaDatabaseName + '; 275 275 276 INSERT INTO Onyxv2276 INSERT INTO ' + @OntologyName + ' 277 277 SELECT [C_HLEVEL] 278 278 ,[C_FULLNAME]
