Changes between Version 3 and Version 4 of i2b2 HowTo Create Concept Codes in an Ontology


Ignore:
Timestamp:
09/14/16 14:24:19 (8 years ago)
Author:
dan.lawday
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • i2b2 HowTo Create Concept Codes in an Ontology

    v3 v4  
    33Once you have created an Ontology you can create the codes (which go in the concept_cd column in the facts table).
    44To do this you run the following code (I'll detail the input in a mo).
    5 \\ \\ **execute dbo.CreateOntologyCode @OntologyID = 99, @ParentID = 7777777, @Name = 'ethnicity',@SourceSystem = 'DREAM_RedCap',@SourceCode = 'ethnicity';** \\ \\
     5\\ \\ **execute dbo.!CreateOntologyCode @OntologyID = 99, @ParentID = 7777777, @Name = 'ethnicity',@!SourceSystem = 'DREAM_RedCap',@!SourceCode = 'ethnicity';** \\ \\
    66
    77
     
    1212- @ParentID, this needs must be a container node (top level is possible however if there is a hierarchy then don't add all the codes to the top level, instead create the child container nodes as needed and then add the codes to them).\\ Note that all the codes will be Leaf nodes, this indicates that is will be containing data and that no other codes will hang off them.
    1313the ParentID can be found by using the following code:
    14 \\ \\ ** SELECT *  FROM [i2b2ClinDataIntegration].[dbo].OntologyCode                                    where [OntologyID] = 99;** \\ \\
     14\\ \\ ** SELECT *  FROM [i2b2ClinDataIntegration].[dbo].!OntologyCode                                   where [OntologyID] = 99;** \\ \\
    1515replace 99 with your ontology (49 for example is Dream).
    1616
    1717- @Name, this is what you are going to be calling the code by from now on
    1818\\
    19 - @SourceSystem
     19- @!SourceSystem (will be whatever you put into the !SourceSystem column in the Ontology table
    2020\\
    21 - @SourceCode, this is what the incomming field name is in the source system database (and may not be a helpfully named field, which is why we have the @Name field which gives us a chance to change it to something better.
     21- @!SourceCode, this is what the incomming field name is in the source system database (and may not be a helpfully named field, which is why we have the @Name field which gives us a chance to change it to something better.
    2222
    2323Below is a abstract for the dream ontology as way of example:\\
     
    4646this shows that the ethnicity field is in the demographics_and_social_history page / form of the DREAM_RedCap ontology.
    4747
     48Snipet to change Left nodes to Container nodes:
     49\\ \\ **  update [i2b2ClinDataIntegration].[dbo].!OntologyCode
     50set !OntologyNodeTypeCode = 'C'
     51where Ontologyid = 50
     52and Name in ('Your','list','of','names')  ** \\ \\
     53
     54