Changes between Initial Version and Version 1 of i2b2 HowTo Create Concept Codes in an Ontology


Ignore:
Timestamp:
08/30/16 14:27:25 (8 years ago)
Author:
dan.lawday
Comment:

--

Legend:

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

    v1 v1  
     1
     2
     3Once you have created an Ontology you can create the codes (which go in the concept_cd column in the facts table).
     4To do this you run the following code (I'll detail the input in a mo).
     5\\
     6\\
     7**execute dbo.CreateOntologyCode @OntologyID = 99, @ParentID = 7777777, @Name = 'ethnicity',@SourceSystem = 'DREAM_RedCap',@SourceCode = 'ethnicity';**
     8\\
     9- OntologyID, this is 1 for GenvascCiviCRM, 27 for Gem BRICCS REDCap, the full list can be found by using:
     10SELECT *  FROM [i2b2ClinDataIntegration].[dbo].Ontology;
     11- 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.
     12the ParentID can be found by using the following code: \\
     13SELECT *  FROM [i2b2ClinDataIntegration].[dbo].OntologyCode                                     where [OntologyID] = 99;
     14replace 99 with your ontology (49 for example is Dream).
     15
     16Below is a abstract for the dream ontology as way of example:\\
     17Notice how the Top level (DREAM_RedCap) has a Null ParentID.
     18Notice how the two containers ParentID is the Id of the top level (DREAM_RedCap)
     19Also worth noting that only one of the left nodes conects directly to the top level container (Enrollment Date), most of the codes you'll add will have a sub container.
     20In this simple example there are only three levels however you could have a 5,6 or 7 level hierarchy.
     21\\
     22
     23||||||||||||= Example of the Dream ontology with the Top level,\\ two containers of the Top,\\ and the Leafs of those. =||
     24||      ID      ||      ParentID        ||      OntologyID      ||      Code    ||      Name    ||      OntologyNodeTypeCode    ||
     25||      1969358 ||      NULL    ||      49      ||      1       ||      **DREAM_RedCap**        ||      C       ||
     26||      **//1969362//** ||      1969358 ||      49      ||      5       ||      **demographics_and_social_history**     ||      C       ||
     27||      1969363 ||      1969358 ||      49      ||      6       ||      medical_history_and_exam        ||      C       ||
     28||      1969381 ||      1969358 ||      49      ||      24      ||      Enrollment Date ||      L       ||
     29||      1969383 ||      **//1969362//** ||      49      ||      26      ||      **ethnicity**   ||      L       ||
     30||      1969385 ||      1969363 ||      49      ||      28      ||      medical_history ||      L       ||
     31||      1969391 ||      1969363 ||      49      ||      34      ||      medical_history_other   ||      L       ||
     32||      1969399 ||      1969362 ||      49      ||      42      ||      bmi     ||      L       ||
     33||      1969400 ||      1969363 ||      49      ||      43      ||      diabetes        ||      L       ||
     34||      1969402 ||      1969363 ||      49      ||      45      ||      diastolic_ip    ||      L       ||
     35||      1969409 ||      1969363 ||      49      ||      52      ||      heart_rate_ip   ||      L       ||
     36||      1969411 ||      1969362 ||      49      ||      54      ||      height  ||      L       ||
     37\\
     38To work through one please see the ethnicity code with ID 1969383. This has a Parent ID of 1969362 which is the ID of demographics_and_social_history which in turn has a Parent ID of 1969358 which is the ID of DREAM_RedCap (the top level container).\\
     39this shows that the ethnicity field is in the demographics_and_social_history page / form of the DREAM_RedCap ontology.
     40