<?xml version="1.0" encoding="UTF-8"?>
<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>
	<artifactId>eureka-protempa-etl</artifactId>
	<packaging>war</packaging>
	<name>Eureka Protempa ETL</name>
	<description>Eureka Protempa ETL is the backend data processing layer of
		Eureka! Clinical Analytics. It performs clinical phenotyping using the
		Protempa software framework. It currently loads data and found
		phenotypes into an i2b2 project, though ultimately it will support 
		other export formats.
	</description>

	<parent>
		<groupId>org.eurekaclinical</groupId>
		<artifactId>eureka</artifactId>
		<version>2.0-Alpha-25</version>
	</parent>
	
	<build>
		<finalName>eureka-protempa-etl</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.tomcat.maven</groupId>
				<artifactId>tomcat7-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>license-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.jasig.maven</groupId>
				<artifactId>maven-notice-plugin</artifactId>
				<configuration>
					<noticeTemplate>../etc/NOTICE.template</noticeTemplate>
					<licenseMapping>
						<param>../etc/license-mappings.xml</param>
					</licenseMapping>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-eureka-configs</id>
						<phase>process-classes</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/eureka-config</outputDirectory>
							<resources>
								<resource>
									<directory>${basedir}/src/main/resources/tomcat-eureka-config</directory>
									<filtering>true</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-sql-from-aiw-i2b2-etl</id>
						<phase>process-classes</phase>
						<goals>
							<goal>unpack-dependencies</goal>
						</goals>
						<configuration>
							<includeArtifactIds>aiw-i2b2-etl</includeArtifactIds>
							<includes>
								sql/i2b2_data_tables_1_7_h2.sql,
								sql/mock_stored_procedures_h2.sql,
								sql/i2b2_meta_eureka_table_1_7_h2.sql,
								dbmigration/create-table-access-changelog.xml,
								dbmigration/i2b2-data-schema-changelog.xml,
								dbmigration/i2b2-meta-schema-changelog.xml,
								dbmigration/eureka-ontology-EK_DEMOG-changelog.xml,
								dbmigration/eureka-ontology-EK_ICD9D-changelog.xml,
								dbmigration/eureka-ontology-EK_ICD9P-changelog.xml,
								dbmigration/eureka-ontology-EK_LABS-changelog.xml,
								dbmigration/eureka-ontology-EK_MED_ORDERS-changelog.xml,
								dbmigration/eureka-ontology-EK_MED_ORDERS-changelog.DDL.xml,
								dbmigration/eureka-ontology-EK_MED_ORDERS-changelog.0.xml,
								dbmigration/eureka-ontology-EK_MED_ORDERS-changelog.1.xml,
								dbmigration/eureka-ontology-EK_MED_ORDERS-changelog.2.xml,
								dbmigration/eureka-ontology-EK_MED_ORDERS-changelog.3.xml,
								dbmigration/eureka-ontology-EK_MED_ORDERS-changelog.4.xml,
								dbmigration/eureka-ontology-EK_MED_ORDERS-changelog.5.xml,
								dbmigration/eureka-ontology-EK_MED_ORDERS-changelog.6.xml,
								dbmigration/eureka-ontology-EK_MED_ORDERS-changelog.7.xml,
								dbmigration/eureka-ontology-EK_VITALS-changelog.xml,
								dbmigration/eureka-ontology-EK_ICD10CM-changelog.xml,
								dbmigration/eureka-ontology-EK_ICD10CM-changelog.DDL.xml,
								dbmigration/eureka-ontology-EK_ICD10CM-changelog.0.xml,
								dbmigration/eureka-ontology-EK_ICD10CM-changelog.1.xml,
								dbmigration/eureka-ontology-EK_ICD10CM-changelog.2.xml,
								dbmigration/eureka-ontology-EK_ICD10CM-changelog.3.xml,
								dbmigration/eureka-ontology-EK_ICD10CM-changelog.4.xml,
								dbmigration/eureka-ontology-EK_ICD10CM-changelog.5.xml,
								dbmigration/eureka-ontology-EK_ICD10CM-changelog.6.xml,
								dbmigration/eureka-ontology-EK_ICD10PCS-changelog.xml,
								dbmigration/eureka-ontology-EK_ICD10PCS-changelog.DDL.xml,
								dbmigration/eureka-ontology-EK_ICD10PCS-changelog.00.xml,
								dbmigration/eureka-ontology-EK_ICD10PCS-changelog.01.xml,
								dbmigration/eureka-ontology-EK_ICD10PCS-changelog.02.xml,
								dbmigration/eureka-ontology-EK_ICD10PCS-changelog.03.xml,
								dbmigration/eureka-ontology-EK_ICD10PCS-changelog.04.xml,
								dbmigration/eureka-ontology-EK_ICD10PCS-changelog.05.xml,
								dbmigration/eureka-ontology-EK_ICD10PCS-changelog.06.xml,
								dbmigration/eureka-ontology-EK_ICD10PCS-changelog.07.xml,
								dbmigration/eureka-ontology-EK_ICD10PCS-changelog.08.xml,
								dbmigration/eureka-ontology-EK_ICD10PCS-changelog.09.xml,
								dbmigration/eureka-ontology-EK_ICD10PCS-changelog.10.xml,
								dbmigration/eureka-ontology-EK_ICD10PCS-changelog.11.xml,
								dbmigration/eureka-ontology-EK_ICD10PCS-changelog.12.xml
							</includes>
							<outputDirectory>${project.build.directory}/eureka-config</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.liquibase</groupId>
				<artifactId>liquibase-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>liquibase-populate-i2b2-data-schema</id>
						<phase>process-classes</phase>
						<goals>
							<goal>update</goal>
						</goals>
						<configuration>
							<changeLogFile>${project.build.directory}/eureka-config/dbmigration/i2b2-data-schema-changelog.xml</changeLogFile>
							<url>jdbc:h2:file:${project.build.directory}/eureka-db/i2b2-data-schema</url>
							<dropFirst>true</dropFirst>
						</configuration>
					</execution>
					<execution>
						<id>liquibase-populate-backend-db</id>
						<phase>process-classes</phase>
						<goals>
							<goal>update</goal>
						</goals>
						<configuration>
							<expressionVars>
							<property>
								<name>eureka.superuser.username</name>
								<value>superuser</value>
							</property>
						</expressionVars>
							<changeLogFile>${project.build.directory}/eureka-config/dbmigration/eureka-protempa-etl-changelog.xml</changeLogFile>
							<url>jdbc:h2:file:${project.build.directory}/eureka-db/eureka-backend</url>
						</configuration>
					</execution>
					<execution>
						<id>liquibase-create-table-access-meta-schema</id>
						<phase>process-classes</phase>
						<goals>
							<goal>update</goal>
						</goals>
						<configuration>
							<changeLogFile>${project.build.directory}/eureka-config/dbmigration/create-table-access-changelog.xml</changeLogFile>
							<url>jdbc:h2:file:${project.build.directory}/eureka-db/eureka-ontology</url>
							<dropFirst>true</dropFirst>
						</configuration>
					</execution>
					<execution>
						<id>liquibase-populate-i2b2-meta-schema</id>
						<phase>process-classes</phase>
						<goals>
							<goal>update</goal>
						</goals>
						<configuration>
							<changeLogFile>${project.build.directory}/eureka-config/dbmigration/i2b2-meta-schema-changelog.xml</changeLogFile>
							<url>jdbc:h2:file:${project.build.directory}/eureka-db/eureka-ontology</url>
						</configuration>
					</execution>
					<execution>
						<id>liquibase-populate-eureka-ontology-EK_DEMOG</id>
						<phase>process-classes</phase>
						<goals>
							<goal>update</goal>
						</goals>
						<configuration>
							<changeLogFile>${project.build.directory}/eureka-config/dbmigration/eureka-ontology-EK_DEMOG-changelog.xml</changeLogFile>
							<url>jdbc:h2:file:${project.build.directory}/eureka-db/eureka-ontology</url>
						</configuration>
					</execution>
					<execution>
						<id>liquibase-populate-eureka-ontology-EK_ICD9D</id>
						<phase>process-classes</phase>
						<goals>
							<goal>update</goal>
						</goals>
						<configuration>
							<changeLogFile>${project.build.directory}/eureka-config/dbmigration/eureka-ontology-EK_ICD9D-changelog.xml</changeLogFile>
							<url>jdbc:h2:file:${project.build.directory}/eureka-db/eureka-ontology</url>
						</configuration>
					</execution>
					<execution>
						<id>liquibase-populate-eureka-ontology-EK_ICD9P</id>
						<phase>process-classes</phase>
						<goals>
							<goal>update</goal>
						</goals>
						<configuration>
							<changeLogFile>${project.build.directory}/eureka-config/dbmigration/eureka-ontology-EK_ICD9P-changelog.xml</changeLogFile>
							<url>jdbc:h2:file:${project.build.directory}/eureka-db/eureka-ontology</url>
						</configuration>
					</execution>
					<execution>
						<id>liquibase-populate-eureka-ontology-EK_LABS</id>
						<phase>process-classes</phase>
						<goals>
							<goal>update</goal>
						</goals>
						<configuration>
							<changeLogFile>${project.build.directory}/eureka-config/dbmigration/eureka-ontology-EK_LABS-changelog.xml</changeLogFile>
							<url>jdbc:h2:file:${project.build.directory}/eureka-db/eureka-ontology</url>
						</configuration>
					</execution>
					<execution>
						<id>liquibase-populate-eureka-ontology-EK_MED_ORDERS</id>
						<phase>process-classes</phase>
						<goals>
							<goal>update</goal>
						</goals>
						<configuration>
							<changeLogFile>${project.build.directory}/eureka-config/dbmigration/eureka-ontology-EK_MED_ORDERS-changelog.xml</changeLogFile>
							<url>jdbc:h2:file:${project.build.directory}/eureka-db/eureka-ontology</url>
						</configuration>
					</execution>
					<execution>
						<id>liquibase-populate-eureka-ontology-EK_VITALS</id>
						<phase>process-classes</phase>
						<goals>
							<goal>update</goal>
						</goals>
						<configuration>
							<changeLogFile>${project.build.directory}/eureka-config/dbmigration/eureka-ontology-EK_VITALS-changelog.xml</changeLogFile>
							<url>jdbc:h2:file:${project.build.directory}/eureka-db/eureka-ontology</url>
						</configuration>
					</execution>
					<execution>
						<id>liquibase-populate-eureka-ontology-EK_ICD10CM</id>
						<phase>process-classes</phase>
						<goals>
							<goal>update</goal>
						</goals>
						<configuration>
							<changeLogFile>${project.build.directory}/eureka-config/dbmigration/eureka-ontology-EK_ICD10CM-changelog.xml</changeLogFile>
							<url>jdbc:h2:file:${project.build.directory}/eureka-db/eureka-ontology</url>
						</configuration>
					</execution>
					<execution>
						<id>liquibase-populate-eureka-ontology-EK_ICD10PCS</id>
						<phase>process-classes</phase>
						<goals>
							<goal>update</goal>
						</goals>
						<configuration>
							<changeLogFile>${project.build.directory}/eureka-config/dbmigration/eureka-ontology-EK_ICD10PCS-changelog.xml</changeLogFile>
							<url>jdbc:h2:file:${project.build.directory}/eureka-db/eureka-ontology</url>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>sql-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>analyze-eureka-ontology-schema</id>
						<phase>process-classes</phase>
						<goals>
							<goal>execute</goal>
						</goals>
						<configuration>
							<driver>org.h2.Driver</driver>
							<url>jdbc:h2:file:${project.build.directory}/eureka-db/eureka-ontology;INIT=ANALYZE</url>
							<sqlCommand />
						</configuration>
					</execution>
					<execution>
						<id>create-eureka-i2b2-data-schema</id>
						<phase>process-classes</phase>
						<goals>
							<goal>execute</goal>
						</goals>
						<configuration>
							<driver>org.h2.Driver</driver>
							<url>jdbc:h2:file:${project.build.directory}/eureka-db/i2b2-data-schema;INIT=RUNSCRIPT FROM '${project.build.directory}/eureka-config/sql/i2b2_data_tables_1_7_h2.sql'\;RUNSCRIPT FROM '${project.build.directory}/eureka-config/sql/mock_stored_procedures_h2.sql'</url>
							<sqlCommand />
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<systemPropertyVariables>
						<eureka.config.dir>${project.build.directory}/test-classes/eureka-config/eureka</eureka.config.dir>
					</systemPropertyVariables>
				</configuration>
			</plugin>
		</plugins>
		<testResources>
			<testResource>
				<directory>${project.basedir}/src/test/resources</directory>
				<filtering>false</filtering>
			</testResource>
			<testResource>
				<directory>${project.basedir}/src/test/resources</directory>
				<includes>
					<include>eureka-config/eureka/sourceconfig/foo</include>
				</includes>
				<filtering>true</filtering>
			</testResource>
		</testResources>
	</build>
	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
		</dependency>
		<dependency>
			<groupId>com.sun.jersey.jersey-test-framework</groupId>
			<artifactId>jersey-test-framework-grizzly2</artifactId>
		</dependency>
		<dependency>
			<groupId>com.sun.jersey</groupId>
			<artifactId>jersey-server</artifactId>
		</dependency>
		<dependency>
			<groupId>com.sun.jersey</groupId>
			<artifactId>jersey-json</artifactId>
		</dependency>
		<dependency>
			<groupId>com.sun.jersey</groupId>
			<artifactId>jersey-client</artifactId>
		</dependency>
		<dependency>
			<groupId>com.sun.jersey.contribs</groupId>
			<artifactId>jersey-guice</artifactId>
		</dependency>
		<dependency>
			<groupId>com.google.inject</groupId>
			<artifactId>guice</artifactId>
		</dependency>
		<dependency>
			<groupId>com.google.inject.extensions</groupId>
			<artifactId>guice-servlet</artifactId>
		</dependency>
		<dependency>
			<groupId>com.google.inject.extensions</groupId>
			<artifactId>guice-persist</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.transaction</groupId>
			<artifactId>jta</artifactId>
		</dependency>               
		<dependency>
			<groupId>javax.annotation</groupId>
			<artifactId>jsr250-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.hibernate.javax.persistence</groupId>
			<artifactId>hibernate-jpa-2.1-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-entitymanager</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-jdk14</artifactId>
		</dependency>
		<dependency>
			<groupId>org.eurekaclinical</groupId>
			<artifactId>eureka-common</artifactId>
		 <type>jar</type>
		</dependency>
		<dependency>
			<groupId>org.eurekaclinical</groupId>
			<artifactId>eureka-common</artifactId>
			<type>test-jar</type>
		</dependency>
		<dependency>
			<groupId>org.eurekaclinical</groupId>
			<artifactId>aiw-i2b2-etl</artifactId>
		</dependency>
		<dependency>
			<groupId>org.eurekaclinical</groupId>
			<artifactId>aiw-neo4j-etl</artifactId>
		</dependency>
		<dependency>
			<groupId>org.eurekaclinical</groupId>
			<artifactId>protempa-bconfigs-ini4j-ini</artifactId>
		</dependency>
		<dependency>
			<groupId>org.eurekaclinical</groupId>
			<artifactId>protempa-tsb-umls</artifactId>
		</dependency>
		<dependency>
			<groupId>org.eurekaclinical</groupId>
			<artifactId>protempa-dsb-relationaldb</artifactId>
		</dependency>
		<dependency>
			<groupId>org.eurekaclinical</groupId>
			<artifactId>protempa-framework</artifactId>
		</dependency>
		<dependency>
			<groupId>org.eurekaclinical</groupId>
			<artifactId>protempa-dsb-file</artifactId>
		</dependency>
		<dependency>
			<groupId>com.sun.jersey.contribs</groupId>
			<artifactId>jersey-multipart</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-ooxml</artifactId>
		</dependency>
		<dependency>
			<groupId>org.eurekaclinical</groupId>
			<artifactId>javautil</artifactId>
		</dependency>
		<dependency>
			<groupId>org.jasig.cas.client</groupId>
			<artifactId>cas-client-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-csv</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
		</dependency>
		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>

