| 20 | 4. Amend the stored procedure `[dbo].[LoadAllOntologiesIntoConceptDimension]` in the i2b2 data database to add the import of the codes into the `concept_dimension`. |
| 21 | - The line should be of the form: `EXEC dbo.LoadOntologyIntoConceptDimension {Ontology ID};`, where `OntologyID` is the ID of the ontology created above. |
| 22 | 5. Create a stored procedure to import the ontology codes into the i2b2 meta database. The procedure should follow the form: |
| 23 | {{{ |
| 24 | CREATE PROC [dbo].[Update{Ontology Name}] AS |
| 25 | DELETE FROM dbo.{Ontology Table Name}; |
| 26 | |
| 27 | INSERT INTO dbo.{Ontology Table Name} |
| 28 | SELECT [C_HLEVEL] |
| 29 | ,[C_FULLNAME] |
| 30 | ,[C_NAME] |
| 31 | ,[C_SYNONYM_CD] |
| 32 | ,[C_VISUALATTRIBUTES] |
| 33 | ,[C_TOTALNUM] |
| 34 | ,[C_BASECODE] |
| 35 | ,[C_METADATAXML] |
| 36 | ,[C_FACTTABLECOLUMN] |
| 37 | ,[C_TABLENAME] |
| 38 | ,[C_COLUMNNAME] |
| 39 | ,[C_COLUMNDATATYPE] |
| 40 | ,[C_OPERATOR] |
| 41 | ,[C_DIMCODE] |
| 42 | ,[C_COMMENT] |
| 43 | ,[C_TOOLTIP] |
| 44 | ,[UPDATE_DATE] |
| 45 | ,[DOWNLOAD_DATE] |
| 46 | ,[IMPORT_DATE] |
| 47 | ,[SOURCESYSTEM_CD] |
| 48 | ,[VALUETYPE_CD] |
| 49 | ,[m_applied_path] |
| 50 | ,[m_exclusive_cd] |
| 51 | ,[C_PATH] |
| 52 | ,[C_SYMBOL] |
| 53 | FROM [i2b2ClinDataIntegration].[dbo].[i2b2Ontology] |
| 54 | WHERE OntologyID = {Ontology ID} |
| 55 | }}} |
| 56 | - Where: |
| 57 | - `Ontology Name` is the name used for the ontology above |
| 58 | - `Ontology Table Name` is the name of the ontology table created in the i2b2 meta database. |
| 59 | - `OntologyID` is the ID of the ontology created above |