Page History
For the purposes of this installation guide, we will go through the steps that are involved in loading the demo SHRINE ontology and setting up the corresponding adapter mappings file.
The first thing you will need to do is to create the shrine_ont database user within i2b2 and a schema with the same name:
Code Block | ||||
---|---|---|---|---|
| ||||
$ psql -U postgres i2b2
i2b2=# create user shrine_ont with password 'demouser';
i2b2=# create schema authorization shrine_ont;
i2b2=# grant all privileges on all tables in schema shrine_ont to shrine_ont;
i2b2=# grant all privileges on all sequences in schema shrine_ont to shrine_ont;
i2b2=# grant all privileges on all functions in schema shrine_ont to shrine_ont; |
Next, you will need to create the tables that will contain the SHRINE ontology. Please refer to this file for the script: ontology_create_tables.sql
You can run this script by running:
Code Block | ||||
---|---|---|---|---|
| ||||
$ psql "dbname=i2b2 options=--search_path=shrine_ont" -a -f ontology_create_tables.sql |
Next, you will need to download the demo SHRINE SCHEMES file to load into the shrine_ont schema. The file is hosted on our SVN repository here:
https://open.med.harvard.edu/svn/shrine-ontology/SHRINE_Demo_Downloads/trunk/SCHEMES.sql
Once you have downloaded the script, you can run this script by running:
Code Block | ||||
---|---|---|---|---|
| ||||
$ psql "dbname=i2b2 options=--search_path=shrine_ont" -a -f SCHEMES.sql |
Next you will need to create the tables that will contain the SHRINE ontology. Please refer to this file for the script: ontology_create_tables.sql
You can run this script by running:
Code Block | ||||
---|---|---|---|---|
| ||||
$ psql "dbname=i2b2 options=--search_path=shrine_ont" -a -f |
Ontology scripts
ontology_create_user.sql - Creates the shrine_ont user, for loading the SHRINE ontology
ontology_create_tables.sql - Creates shrine_ont, creates SHRINE, TABLE_ACCESS, and SCHEMES tables, and sets up schemas within tables.
DB_Lookups script to add ontology to i2b2hive
...
ontology_create_tables.sql |
- db_lookups.sql
ontology table access
Code Block | ||||
---|---|---|---|---|
| ||||
INSERT into {{ shrine_i2b2_ont.schema }}.TABLE_ACCESS ( C_TABLE_CD, C_TABLE_NAME, C_PROTECTED_ACCESS, C_HLEVEL, C_NAME, C_FULLNAME, C_SYNONYM_CD, C_VISUALATTRIBUTES, C_TOOLTIP, C_FACTTABLECOLUMN, C_DIMTABLENAME, C_COLUMNNAME, C_COLUMNDATATYPE, C_DIMCODE, C_OPERATOR) values ( 'SHRINE', 'SHRINE', 'N', 0, 'SHRINE Ontology', '\SHRINE\', 'N', 'CA', 'SHRINE Ontology', 'concept_cd', 'concept_dimension', 'concept_path', 'T', '\SHRINE\', 'LIKE'); |
psql i2b2.i2b2metadata < script.sql