Commit 75a8781c authored by R.W.Majeed's avatar R.W.Majeed
Browse files

prototype implementation of i2b2 server emulation

parent 69820975
Loading
Loading
Loading
Loading

i2b2-server/.gitignore

0 → 100644
+4 −0
Original line number Diff line number Diff line
.settings/
.classpath
.project
target/

i2b2-server/README.md

0 → 100644
+13 −0
Original line number Diff line number Diff line


Dependencies
------------
For development/testing, the server can be started with
`mvn -P jetty jetty:run-war`. This functionality needs i2b2 webclient. 
You may need to download the webclient from i2b2.org/software and 
install the bundle into your local maven repository manually via
```
 mvn install:install-file -Dfile=i2b2webclient-1707c.zip -DgroupId=org.i2b2 -DartifactId=webclient -Dversion=1.7.07c -Dpackaging=zip
```

 
 No newline at end of file

i2b2-server/pom.xml

0 → 100644
+164 −0
Original line number Diff line number Diff line
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<name>HIStream : i2b2 server emulation</name>
	<packaging>war</packaging>

	<description>
	This project emulates the core components
	of an i2b2 server backend. Basic functionality
	of PM, CRC, ONT and WORK cells allows the
	official i2b2 webclient to connect ot this
	emulated server.
	</description>

	<groupId>de.sekmi.histream</groupId>
	<artifactId>i2b2-server</artifactId>
	<version>0.8-SNAPSHOT</version>

	<parent>
		<groupId>de.sekmi.histream</groupId>
		<artifactId>histream</artifactId>
		<version>0.8-SNAPSHOT</version>
	</parent>

	<profiles>
		<profile>
			<id>jetty</id>

			<build>
				<plugins>
					<plugin>
						<groupId>org.eclipse.jetty</groupId>
						<artifactId>jetty-maven-plugin</artifactId>
						<!--<version>9.3.10.v20160621</version> -->
						<version>9.3.8.v20160314</version>
						<configuration>
							<useTestScope>true</useTestScope>
							<useProvidedScope>true</useProvidedScope>
							<scanIntervalSeconds>5</scanIntervalSeconds>
							<contextXml>${project.basedir}/src/main/webapp/WEB-INF/jetty-context.xml</contextXml>
							<webApp>
								<descriptor>${project.basedir}/src/main/webapp/WEB-INF/jetty-defaults-web.xml</descriptor>
								<jettyEnvXml>${project.basedir}/src/main/webapp/WEB-INF/jetty-env.xml</jettyEnvXml>
							</webApp>
						</configuration>
						<dependencies>
							<!-- jackson json media filters -->
							<dependency>
								<groupId>org.glassfish.jersey.media</groupId>
								<artifactId>jersey-media-json-jackson</artifactId>
								<version>2.14</version>
							</dependency>
						</dependencies>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-dependency-plugin</artifactId>
						<version>2.10</version>
						<executions>
							<execution>
								<id>unpack</id>
								<phase>generate-resources</phase>
								<goals>
									<goal>unpack</goal>
								</goals>
								<configuration>
									<artifactItems>
										<!-- this is a non-standard dependency for executing jetty:run-war. 
											See README.md for instructions. -->
										<artifactItem>
											<groupId>org.i2b2</groupId>
											<artifactId>webclient</artifactId>
											<version>1.7.07c</version>
											<type>zip</type>
										</artifactItem>
									</artifactItems>
									<outputDirectory>${project.build.directory}/classes</outputDirectory>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>

			<dependencies>
				<!-- jetty:run dependencies (cannot be moved to plugin/dependencies because 
					of errors) -->
				<dependency>
					<groupId>org.glassfish.jersey.containers</groupId>
					<artifactId>jersey-container-servlet</artifactId>
					<version>2.14</version>
					<scope>provided</scope>
				</dependency>
				<dependency>
					<groupId>org.glassfish.jersey.containers.glassfish</groupId>
					<artifactId>jersey-gf-cdi</artifactId>
					<version>2.14</version>
					<scope>provided</scope>
				</dependency>
				<dependency>
					<groupId>org.glassfish.jersey.containers.glassfish</groupId>
					<artifactId>jersey-gf-cdi-ban-custom-hk2-binding</artifactId>
					<version>2.14</version>
					<scope>provided</scope>
				</dependency>
				<!-- CDI integration -->
				<dependency>
					<groupId>org.jboss.weld.servlet</groupId>
					<artifactId>weld-servlet-core</artifactId>
					<version>2.2.5.Final</version>
					<scope>provided</scope>
				</dependency>
			</dependencies>
		</profile>
	</profiles>

	<build>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
			<resource>
				<directory>target/generated-resources</directory>
			</resource>
		</resources>
		<plugins>

		</plugins>
	</build>

	<dependencies>
		<dependency>
			<groupId>javax.ws.rs</groupId>
			<artifactId>javax.ws.rs-api</artifactId>
			<version>2.0.1</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.inject</groupId>
			<artifactId>javax.inject</artifactId>
			<version>1</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.annotation</groupId>
			<artifactId>javax.annotation-api</artifactId>
			<version>1.2</version>
			<scope>provided</scope>
		</dependency>


		<!-- template processing -->
		<dependency>
			<groupId>org.freemarker</groupId>
			<artifactId>freemarker</artifactId>
			<version>2.3.23</version>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
		</dependency>
	</dependencies>
</project>
 No newline at end of file
+10 −0
Original line number Diff line number Diff line
package de.sekmi.histream.i2b2.api.crc;

import java.util.List;

public interface QueryInstance {
	String getId(); // instance id
	QueryStatus getStatus();
	List<QueryResult> getResults();
	
}
+25 −0
Original line number Diff line number Diff line
package de.sekmi.histream.i2b2.api.crc;

import java.util.List;

import org.w3c.dom.Element;

public interface QueryManager {

	QueryMaster runQuery(Element definition, List<ResultType> results);
	
	QueryMaster getQuery(String queryId);

	/**
	 * List queries for user
	 * @param userId user id
	 * @return queries
	 */
	Iterable<QueryMaster> listQueries(String userId);
	
	/**
	 * Return supported result types
	 * @return result types
	 */
	Iterable<ResultType> getResultTypes();
}
Loading