This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
documentation:software:webapi:setup [2016/08/23 18:46] jhardin |
documentation:software:webapi:setup [2018/04/23 19:11] (current) lee |
||
|---|---|---|---|
| Line 109: | Line 109: | ||
| You will need to download the Oracle JDBC driver, and install it into your local maven repository. Once you download the jar, you will need to execute the following maven command to install it into the local repository. The simplest way is to navigate via the CLI to the directory the JAR was downloaded to, and execute the following command: | You will need to download the Oracle JDBC driver, and install it into your local maven repository. Once you download the jar, you will need to execute the following maven command to install it into the local repository. The simplest way is to navigate via the CLI to the directory the JAR was downloaded to, and execute the following command: | ||
| - | mvn install:install-file -Dfile=ojdbc.jar -DgroupId=ojdbc -DartifactId=ojdbc -Dversion=6.0.0 -Dpackaging=jar | + | mvn install:install-file -Dfile=ojdbc.jar -DgroupId=ojdbc -DartifactId=ojdbc -Dversion=6.0.0 -Dpackaging=jar |
| (The above is all a single line command.) | (The above is all a single line command.) | ||
| Line 118: | Line 118: | ||
| Open command prompt, go to WebAPI folder, type | Open command prompt, go to WebAPI folder, type | ||
| - | set JAVA_HOME=C:/Program Files/Java/jdk1.7.0_67 | + | set JAVA_HOME=C:/Program Files/Java/jdk1.7.0_67 |
| //Make sure you point to a JDK, not a JRE. It is probably a good idea to stick to the same Java version that is running Tomcat// | //Make sure you point to a JDK, not a JRE. It is probably a good idea to stick to the same Java version that is running Tomcat// | ||
| - | mvn clean package -s /WebAPIConfig/settings.xml -P {profile id} | + | mvn clean package -s /WebAPIConfig/settings.xml -P {profile id} |
| This will create the file WebAPI.war in the target subfolder. | This will create the file WebAPI.war in the target subfolder. | ||
| Line 136: | Line 136: | ||
| Reading the Tomcat logs, the following output should appear indicating that the tables have been created (in this example, we see an Oracle output): | Reading the Tomcat logs, the following output should appear indicating that the tables have been created (in this example, we see an Oracle output): | ||
| - | 2016-02-24 11:01:08.148 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.dbsupport.DbSupportFactory - - Database: jdbc:oracle:thin:@//127.0.0.1:1521/xe (Oracle 11.2) | + | 2016-02-24 11:01:08.148 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.dbsupport.DbSupportFactory - - Database: jdbc:oracle:thin:@//127.0.0.1:1521/xe (Oracle 11.2) |
| - | 2016-02-24 11:01:08.358 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.metadatatable.MetaDataTableImpl - - Creating Metadata table: "OHDSI"."schema_version" | + | 2016-02-24 11:01:08.358 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.metadatatable.MetaDataTableImpl - - Creating Metadata table: "OHDSI"."schema_version" |
| - | 2016-02-24 11:01:08.468 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Current version of schema "OHDSI": << Empty Schema >> | + | 2016-02-24 11:01:08.468 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Current version of schema "OHDSI": << Empty Schema >> |
| - | 2016-02-24 11:01:08.468 WARN org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - outOfOrder mode is active. Migration of schema "OHDSI" may not be reproducible. | + | 2016-02-24 11:01:08.468 WARN org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - outOfOrder mode is active. Migration of schema "OHDSI" may not be reproducible. |
| - | 2016-02-24 11:01:08.468 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.1 | + | 2016-02-24 11:01:08.468 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.1 |
| - | 2016-02-24 11:01:08.608 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.2 | + | 2016-02-24 11:01:08.608 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.2 |
| - | 2016-02-24 11:01:08.628 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.3 | + | 2016-02-24 11:01:08.628 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.3 |
| - | 2016-02-24 11:01:08.668 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.3.1 | + | 2016-02-24 11:01:08.668 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.3.1 |
| - | 2016-02-24 11:01:08.778 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.3.2 | + | 2016-02-24 11:01:08.778 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.3.2 |
| - | 2016-02-24 11:01:08.798 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.4 | + | 2016-02-24 11:01:08.798 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.4 |
| - | 2016-02-24 11:01:08.987 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.4.1 | + | 2016-02-24 11:01:08.987 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.4.1 |
| - | 2016-02-24 11:01:09.007 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.4.2 | + | 2016-02-24 11:01:09.007 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.4.2 |
| - | 2016-02-24 11:01:09.027 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.4.3 | + | 2016-02-24 11:01:09.027 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.4.3 |
| - | 2016-02-24 11:01:09.068 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.5 | + | 2016-02-24 11:01:09.068 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.5 |
| - | 2016-02-24 11:01:09.148 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.5.1 | + | 2016-02-24 11:01:09.148 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.5.1 |
| - | 2016-02-24 11:01:09.168 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.6.1 | + | 2016-02-24 11:01:09.168 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.6.1 |
| - | 2016-02-24 11:01:09.348 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.6.2 | + | 2016-02-24 11:01:09.348 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.6.2 |
| - | 2016-02-24 11:01:09.750 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.6.3 | + | 2016-02-24 11:01:09.750 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.6.3 |
| - | 2016-02-24 11:01:09.780 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.7.0 | + | 2016-02-24 11:01:09.780 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.7.0 |
| - | 2016-02-24 11:01:09.840 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.7.1 | + | 2016-02-24 11:01:09.840 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.7.1 |
| - | 2016-02-24 11:01:09.920 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.7.2 | + | 2016-02-24 11:01:09.920 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.7.2 |
| - | 2016-02-24 11:01:10.020 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.8 | + | 2016-02-24 11:01:10.020 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.0.8 |
| - | 2016-02-24 11:01:10.060 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.1.0 | + | 2016-02-24 11:01:10.060 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.1.0 |
| - | 2016-02-24 11:01:10.090 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.1.1 | + | 2016-02-24 11:01:10.090 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.1.1 |
| - | 2016-02-24 11:01:10.130 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.1.1.1 | + | 2016-02-24 11:01:10.130 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "OHDSI" to version 1.0.1.1.1 |
| - | 2016-02-24 11:01:14.482 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Successfully applied 21 migrations to schema "OHDSI" (execution time 00:06.124s). | + | 2016-02-24 11:01:14.482 INFO org.ohdsi.webapi.WebApi.main() org.flywaydb.core.internal.command.DbMigrate - - Successfully applied 21 migrations to schema "OHDSI" (execution time 00:06.124s). |
| Line 169: | Line 169: | ||
| ---- | ---- | ||
| The webapi.source and webapi.source_daimon tables were created when you started the tomcat service with the WebAPI war deployed. However, these tables must be populated with a source and daimons for CDM, Vocabulary and Results must be added to the source in order to use the OHDSI tools. | The webapi.source and webapi.source_daimon tables were created when you started the tomcat service with the WebAPI war deployed. However, these tables must be populated with a source and daimons for CDM, Vocabulary and Results must be added to the source in order to use the OHDSI tools. | ||
| + | |||
| + | Here are the valid values for the daimon_type in the source_daimon table: | ||
| + | 0 = CDM, 1 = VOCABULARY, 2 = RESULTS, 3 = EVIDENCE | ||
| + | |||
| For this example it is assumed that the CDM and Vocabulary exist as a separate schema in the same database instance. The CDM/Vocabulary tables are in the schema ‘cdm’ and the ohdsi tables are installed in the 'ohdsi' schema. | For this example it is assumed that the CDM and Vocabulary exist as a separate schema in the same database instance. The CDM/Vocabulary tables are in the schema ‘cdm’ and the ohdsi tables are installed in the 'ohdsi' schema. | ||
| === WebAPI SOURCE and SOURE_DAIMON Inserts === | === WebAPI SOURCE and SOURE_DAIMON Inserts === | ||
| - | INSERT INTO ohdsi.source (source_id, source_name, source_key, source_connection, source_dialect) VALUES (1, 'My Cdm', 'MY_CDM', ' jdbc:oracle:thin:ohdsi/{password}@127.0.0.1:1521/xe', 'oracle'); | + | INSERT INTO ohdsi.source (source_id, source_name, source_key, source_connection, source_dialect) VALUES (1, 'My Cdm', 'MY_CDM', ' jdbc:oracle:thin:ohdsi/{password}@127.0.0.1:1521/xe', 'oracle'); |
| - | INSERT INTO ohdsi.source (source_id, source_name, source_key, source_connection, source_dialect) VALUES (2, 'Default vocabulary', 'vocab', 'jdbc:oracle:thin:ohdsi/{password}@127.0.0.1:1521/xe', 'oracle'); | + | INSERT INTO ohdsi.source (source_id, source_name, source_key, source_connection, source_dialect) VALUES (2, 'Default vocabulary', 'vocab', 'jdbc:oracle:thin:ohdsi/{password}@127.0.0.1:1521/xe', 'oracle'); |
| - | + | INSERT INTO webapi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority) VALUES (1,1,0, 'cdm', 0); | |
| - | INSERT INTO webapi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority) VALUES (1,1,0, 'cdm', 0); | + | INSERT INTO webapi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority) VALUES (2,1,1, 'cdm', 0); |
| - | INSERT INTO webapi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority) VALUES (2,1,1, 'cdm', 0); | + | INSERT INTO webapi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority) VALUES (3,1,2, 'ohdsi', 0); |
| - | INSERT INTO webapi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority) VALUES (3,1,2, 'ohdsi', 0); | + | INSERT INTO webapi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority) VALUES (4,2,1, 'cdm', 1); |
| - | INSERT INTO webapi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority) VALUES (4,2,1, 'cdm', 1); | + | |
| Line 187: | Line 190: | ||
| //Note: IF using postgresql, the jdbc connection string is of the form// | //Note: IF using postgresql, the jdbc connection string is of the form// | ||
| - | jdbc:postgresql://<SERVER>:5432/<DATABASE_NAME>?user=<USER_NAME>&password=<USER_PASSWORD> | + | jdbc:postgresql://<SERVER>:5432/<DATABASE_NAME>?user=<USER_NAME>&password=<USER_PASSWORD> |
| === Verify Configuration === | === Verify Configuration === | ||
| Line 193: | Line 196: | ||
| Once WebAPI is started, and the source/source_daimon inserts are complete, you should be able to open a browser to the following URL: | Once WebAPI is started, and the source/source_daimon inserts are complete, you should be able to open a browser to the following URL: | ||
| - | http://localhost:8080/WebAPI/source/sources | + | http://localhost:8080/WebAPI/source/sources |
| This should result in the following output: | This should result in the following output: | ||
| - | [ | + | [ |
| {"sourceId":1,"sourceName":"My Cdm","sourceDialect":"postgresql","sourceKey":"MY_CDM", "daimons": | {"sourceId":1,"sourceName":"My Cdm","sourceDialect":"postgresql","sourceKey":"MY_CDM", "daimons": | ||
| [ | [ | ||
| Line 221: | Line 224: | ||
| ===Errors when calling sources URL=== | ===Errors when calling sources URL=== | ||
| ---- | ---- | ||
| - | The most likely error you will receive when accessing http://localhost:8080/WebAPI/source/sources | + | The most likely error you will receive when accessing %%http://localhost:8080/WebAPI/source/sources%% |
| is the ohdsi_app_user does not have permission on relation ‘source’. This means the default privileges were not assigned when logged into the database as ohdsi_admin_user. These table permissions will have to be granted manually. | is the ohdsi_app_user does not have permission on relation ‘source’. This means the default privileges were not assigned when logged into the database as ohdsi_admin_user. These table permissions will have to be granted manually. | ||
| If no error is appearing in the logs at all, please confirm the Tomcat servlet engine is listening on port 8080. If it is on a different port, you will need to adjust the URLs above to the correct port. | If no error is appearing in the logs at all, please confirm the Tomcat servlet engine is listening on port 8080. If it is on a different port, you will need to adjust the URLs above to the correct port. | ||