Changes between Version 3 and Version 4 of i2b2 HowTo Create Concept Codes in an Ontology
- Timestamp:
- 09/14/16 14:24:19 (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
i2b2 HowTo Create Concept Codes in an Ontology
v3 v4 3 3 Once you have created an Ontology you can create the codes (which go in the concept_cd column in the facts table). 4 4 To 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';** \\ \\ 6 6 7 7 … … 12 12 - @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. 13 13 the 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;** \\ \\ 15 15 replace 99 with your ontology (49 for example is Dream). 16 16 17 17 - @Name, this is what you are going to be calling the code by from now on 18 18 \\ 19 - @ SourceSystem19 - @!SourceSystem (will be whatever you put into the !SourceSystem column in the Ontology table 20 20 \\ 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. 22 22 23 23 Below is a abstract for the dream ontology as way of example:\\ … … 46 46 this shows that the ethnicity field is in the demographics_and_social_history page / form of the DREAM_RedCap ontology. 47 47 48 Snipet to change Left nodes to Container nodes: 49 \\ \\ ** update [i2b2ClinDataIntegration].[dbo].!OntologyCode 50 set !OntologyNodeTypeCode = 'C' 51 where Ontologyid = 50 52 and Name in ('Your','list','of','names') ** \\ \\ 53 54