OHDSI/WebAPI

Name: WebAPI

Owner: Observational Health Data Sciences and Informatics

Description: [Under development] OHDSI WebAPI contains all OHDSI services that can be called from OHDSI applications

Created: 2014-12-03 19:49:51.0

Updated: 2017-12-30 07:02:44.0

Pushed: 2018-01-15 20:36:58.0

Homepage:

Size: 3334

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

WebAPI

OHDSI WebAPI contains all OHDSI services that can be called from OHDSI applications

NOTE: Check license information for individual sources on the Web API documentation page

Getting Started

New documentation can be found a the Web API Installation Guide

Compilation

Compiling the WebAPI project will require Maven. Maven is a command line tool that will build the WAR for deployment to a servlet container.

JDBC Drivers

JDBC Drivers are not included with the source or any release packages. Obtaining JDBC Drivers and making them available on the hosting server via environment classpath or web server configuration are left as an excercise for the developer / system administrator.

Configuration

Once the source code is built and the resulting libraries are deployed to your web environment the web.xml file needs to be updated for your specific environment

database.driver : this parameter specifies the class name of the driver for your database environment (ie com.microsoft.sqlserver.jdbc.SQLServerDriver)

database.url : this parameter specifies the connection string for your database environment

database.dialect this parameter specifies the dialect of your database environment and is used by the SQLRender library to translate the embedded templated queries to one of the supported dialects (SQL Server, Oracle, PostgreSQL, Amazon RedShift)

Testing

Once your configuration is completed you can test the functionality of the WebAPI with the following types of requests:

Services

The collection of RESTful services available in the WebAPI project.

VocabularyService

A RESTful service for querying the CDM Vocabulary. Leveraged by HERMES.

SqlRenderService

A RESTful service that wraps the SQLRender project.

JobService

A RESTful service that returns JobInstanceResource or JobExecutionResource objects. Typically a service will launch/queue a job and will be given JobExecutionResource. This object will encapsulate the Job's id and Job's executionId, start/end times, and status.

The JobService can be used to check on the status of a Job's execution as well as query information of a Job.

/job/{jobId} - returns JobInstanceResource from which you can obtain Job id and Job name.

/job/{jobId}/execution/{executionId} - return JobExecutionResource from which you can obtain JobInstanceResource information as well as the start/end times, status, etc.

/job/execution/{executionId} - is an alternative to the previous endpoint.

See Jobs below for more detail.

Jobs

Services within WebAPI may submit asynchronous jobs. WebAPI uses Spring Batch for this “job server”. Spring Batch requires a few DB objects and will attempt to create these (tables, sequences) upon startup. Spring Batch will review the DataSource to determine the vendor-specific script to execute. You may review DDL for your specific RDBMS vendor here: https://github.com/spring-projects/spring-batch/blob/3.0.3.RELEASE/spring-batch-core/src/main/resources/org/springframework/batch/core/

Services should use the org.ohdsi.webapi.JobTemplate to launch Jobs.

See org.ohdsi.webapi.exampleapplication.ExampleApplicationConfig & ExampleApplicationWithJobService for how to submit jobs.

See JobServiceIT (integration test) for more detail (java client).


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.