| 1 | = i2b2 Create an Ontology |
| 2 | |
| 3 | The procedure to create the tables for a new ontology. |
| 4 | |
| 5 | 1. Create the ontology table in the Meta Database |
| 6 | |
| 7 | [1] Name of the ontology, e.g. 'ONYX' |
| 8 | |
| 9 | {{{#!sql |
| 10 | |
| 11 | CREATE TABLE {Ontology Name from [1]} |
| 12 | ( "C_HLEVEL" INT NOT NULL, |
| 13 | "C_FULLNAME" VARCHAR(700) NOT NULL, |
| 14 | "C_NAME" VARCHAR(2000) NOT NULL, |
| 15 | "C_SYNONYM_CD" CHAR(1) NOT NULL, |
| 16 | "C_VISUALATTRIBUTES" CHAR(3) NOT NULL, |
| 17 | "C_TOTALNUM" INT NULL, |
| 18 | "C_BASECODE" VARCHAR(50) NULL, |
| 19 | "C_METADATAXML" TEXT NULL, |
| 20 | "C_FACTTABLECOLUMN" VARCHAR(50) NOT NULL, |
| 21 | "C_TABLENAME" VARCHAR(50) NOT NULL, |
| 22 | "C_COLUMNNAME" VARCHAR(50) NOT NULL, |
| 23 | "C_COLUMNDATATYPE" VARCHAR(50) NOT NULL, |
| 24 | "C_OPERATOR" VARCHAR(10) NOT NULL, |
| 25 | "C_DIMCODE" VARCHAR(700) NOT NULL, |
| 26 | "C_COMMENT" TEXT NULL, |
| 27 | "C_TOOLTIP" VARCHAR(900) NULL, |
| 28 | "UPDATE_DATE" DATETIME NOT NULL, |
| 29 | "DOWNLOAD_DATE" DATETIME NULL, |
| 30 | "IMPORT_DATE" DATETIME NULL, |
| 31 | "SOURCESYSTEM_CD" VARCHAR(50) NULL, |
| 32 | "VALUETYPE_CD" VARCHAR(50) NULL |
| 33 | ) ; |
| 34 | |
| 35 | }}} |
| 36 | |
| 37 | 2. Create a Scheme |
| 38 | |
| 39 | A scheme is the prefix for a concept code. Not exactly sure what it is used for, but hey ho. You create one like this: |
| 40 | |
| 41 | [2] Scheme name, e.g. 'CBO' |
| 42 | [3] Descriptive name for ontology, e.g. 'Onyx Ontology' |
| 43 | |
| 44 | {{{#!sql |
| 45 | |
| 46 | INSERT INTO SCHEMES(C_KEY, C_NAME, C_DESCRIPTION) |
| 47 | VALUES('{Scheme name from [2]}:', '{Scheme name from [2]}', '{Descriptive name for ontology from [3]}'); |
| 48 | |
| 49 | }}} |
| 50 | |
| 51 | 3. Tell i2b2 about the new ontology |
| 52 | |
| 53 | [4] Base path for ontology, e.g. '\onyx\' |
| 54 | |
| 55 | {{{#!sql |
| 56 | |
| 57 | INSERT INTO TABLE_ACCESS(C_TABLE_CD, C_TABLE_NAME, C_HLEVEL, C_FULLNAME, C_NAME, C_SYNONYM_CD, C_VISUALATTRIBUTES, C_TOTALNUM, C_BASECODE, C_METADATAXML, C_FACTTABLECOLUMN, C_DIMTABLENAME, C_COLUMNNAME, C_COLUMNDATATYPE, C_OPERATOR, C_DIMCODE, C_COMMENT, C_TOOLTIP, C_ENTRY_DATE, C_CHANGE_DATE, C_STATUS_CD, C_PROTECTED_ACCESS, VALUETYPE_CD) |
| 58 | VALUES('{Ontology Name from [1]}', '{Ontology Name from [1]}', 0, '{Base path for ontology [4]}', '{Descriptive name for ontology [3]}', 'N', 'CA', NULL, NULL, NULL, 'concept_cd', 'concept_dimension', 'concept_path', 'T', 'LIKE', '{Base path for ontology [4]}', NULL, '{Descriptive name for ontology [3]}', NULL, NULL, NULL, 'N', NULL); |
| 59 | |
| 60 | }}} |
| 61 | |
| 62 | |