Commit 6e4cb6c0 authored by Volker Thiemann's avatar Volker Thiemann
Browse files

Merge branch 'master' of gitlab.uni-oldenburg.de:AKTIN/dwh-import

parents f78712d8 721175dc
......@@ -5,7 +5,7 @@
<groupId>org.aktin</groupId>
<artifactId>cda-import</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.9rc2-SNAPSHOT</version>
<description>
The CDA import module transforms received
......@@ -18,7 +18,7 @@
<parent>
<groupId>org.aktin</groupId>
<artifactId>dwh-import</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.9rc2-SNAPSHOT</version>
</parent>
<properties>
......@@ -33,73 +33,25 @@
</resource>
</resources>
<plugins>
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>org.aktin.cda.etl.demo.Server</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.3.6.v20151106</version>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.22.1</version>
</dependency>
</dependencies>
</plugin>
-->
<!--
<!-- copy dependencies for optional command line processing -->
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>process-test-classes</phase>
<phase>install</phase>
<goals>
<goal>unpack</goal>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-dist</artifactId>
<version>7.1.1.Final</version>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>target</outputDirectory>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/dependencies</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
-->
</plugins>
</build>
<dependencyManagement>
<!--
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.10.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
-->
</dependencyManagement>
<dependencies>
<dependency>
......@@ -109,35 +61,13 @@
<dependency>
<groupId>org.aktin</groupId>
<artifactId>cda-server</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.9rc2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.aktin</groupId>
<artifactId>dwh-api</artifactId>
<version>0.3-SNAPSHOT</version>
</dependency>
<!--
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
<version>1.0.0.CR9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<version>2.3.2.Final</version>
<scope>test</scope>
<version>0.3</version>
</dependency>
-->
<dependency>
......
......@@ -50,6 +50,7 @@ public class CDAImporter extends AbstractCDAImporter implements AutoCloseable{
* Construct a CDAImporter
* @param factory observation factory
* @param prefs preferences
* @param anonymizer anonymizer interface
* @throws NamingException i2b2 data sources could not be found by their names
* @throws SQLException initisiation errors with the database
* @throws IOException unable to load CDA to ETL transformation script
......
......@@ -41,6 +41,7 @@ public class Transformation {
* @param moduleId module id
* @param templateId template id
* @param xslt XSLT document
* @param anonymizer anonzmiyer
* @throws TransformerFactoryConfigurationError if the transformer factory failed to initialize
* @throws TransformerConfigurationException transformer setup error
*/
......
......@@ -37,7 +37,7 @@ public abstract class OneWayHashFunction extends ExtensionFunctionDefinition {
/**
* Implements a call to the hash function with variable arguments.
* For the algorithm, see {@link OneWayHashFunction#calculateHash(String...)}
* The algorithm is delegated to the implementation of {@link Anonymizer}
*
* @author R.W.Majeed
*
......
......@@ -4,6 +4,7 @@ import java.io.IOException;
import java.time.ZoneId;
import java.util.Iterator;
import java.util.function.Consumer;
import java.util.logging.Logger;
import javax.annotation.PreDestroy;
import javax.inject.Singleton;
......@@ -20,12 +21,13 @@ import de.sekmi.histream.impl.SimpleVisitExtension;
@Singleton
public class CDAImporterMockUp extends AbstractCDAImporter implements Consumer<Observation>, AutoCloseable{
private static final Logger log = Logger.getLogger(CDAImporterMockUp.class.getName());
private ObservationFactory factory;
private int insertCount;
public CDAImporterMockUp() throws IOException{
super(new ConcatAnonymizer());
System.out.println("CONSTRUCT CDAImporterMockUp");
log.info("CONSTRUCT CDAImporterMockUp");
factory = new ObservationFactoryImpl(new SimplePatientExtension(), new SimpleVisitExtension());
insertCount = 0;
}
......@@ -33,7 +35,7 @@ public class CDAImporterMockUp extends AbstractCDAImporter implements Consumer<O
@PreDestroy
@Override
public void close() {
System.out.println("CLOSE CDAImporterMockUp (insertCount="+insertCount+")");
log.info("CLOSE CDAImporterMockUp (insertCount="+insertCount+")");
}
@Override
......
......@@ -20,6 +20,22 @@ import de.sekmi.histream.ext.Patient;
import de.sekmi.histream.ext.Visit;
import de.sekmi.histream.io.GroupedXMLReader;
/**
* Test the template transformations from CDA to EAV-XML. Multiple template ids
* and AKTIN modules are supported.
* <p>
* For standalone transformation testing, build the {@code cda-import} module
* with {@code mvn clean install}. When needed, run the build command from the
* parent directory.<br/>
* When the build ist complete, the transformation can be tested with
* a command line application. E.g. from within the {@code cda-import/target/} directory:
* <pre>
* java -classpath "test-classes;classes;dependencies/*" org.aktin.cda.etl.TestTransformToEAV "../../cda-validation/src/main/resources/Additional Examples/basismodul-beispiel-storyboard01-complete.xml"
* </pre>
* </p>
* @author R.W.Majeed
*
*/
public class TestTransformToEAV {
@Test
......@@ -32,6 +48,7 @@ public class TestTransformToEAV {
Assert.assertTrue(templateId.length() > 0);
}
}
@SuppressWarnings("deprecation")
@Test
public void transformExample1() throws Exception{
CDAParser parser = new CDAParser();
......@@ -72,7 +89,7 @@ public class TestTransformToEAV {
/**
* Transform a CDA file to a EAV which is output on stdout.
* Call with {@code java -classpath "cda-import/target/test-classes;cda-import/target/classes;cda-server/target/classes;cda-validation/target/classes;histream-core/target/classes" org.aktin.cda.etl.TestTransformToEAV filename}
* Call with {@code java -classpath "test-classes;classes;dependencies/*" org.aktin.cda.etl.TestTransformToEAV filename}
* @param args file name argument
* @throws Exception error
*/
......
......@@ -4,14 +4,14 @@
<groupId>org.aktin</groupId>
<artifactId>cda-ontology</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.9rc2-SNAPSHOT</version>
<description>
CDA Ontology definitions
</description>
<parent>
<groupId>org.aktin</groupId>
<artifactId>dwh-import</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.9rc2-SNAPSHOT</version>
</parent>
<build>
<resources>
......
......@@ -4,7 +4,7 @@
<groupId>org.aktin</groupId>
<artifactId>cda-server</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.9rc2-SNAPSHOT</version>
<description>
The CDA server provides web service interfaces
......@@ -16,7 +16,7 @@
<parent>
<groupId>org.aktin</groupId>
<artifactId>dwh-import</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.9rc2-SNAPSHOT</version>
</parent>
<properties>
......@@ -77,7 +77,7 @@
<dependency>
<groupId>org.aktin</groupId>
<artifactId>dwh-api</artifactId>
<version>0.2</version>
<version>0.3</version>
</dependency>
<!-- dependency injection -->
......@@ -98,7 +98,7 @@
<dependency>
<groupId>org.aktin</groupId>
<artifactId>cda-validation</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.9rc2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -4,12 +4,12 @@
<groupId>org.aktin</groupId>
<artifactId>cda-validation</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.9rc2-SNAPSHOT</version>
<parent>
<groupId>org.aktin</groupId>
<artifactId>dwh-import</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.9rc2-SNAPSHOT</version>
</parent>
<properties>
<schematronVersion>20170302T140447</schematronVersion>
......
......@@ -6,19 +6,19 @@
<groupId>org.aktin</groupId>
<artifactId>demo-distribution</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.9rc2-SNAPSHOT</version>
<parent>
<groupId>org.aktin</groupId>
<artifactId>dwh-import</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.9rc2-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>org.aktin</groupId>
<artifactId>demo-server</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.9rc2-SNAPSHOT</version>
</dependency>
</dependencies>
......
......@@ -4,7 +4,7 @@
<groupId>org.aktin</groupId>
<artifactId>demo-server</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.9rc2-SNAPSHOT</version>
<description>
Demo server application. The demo server can receive
......@@ -15,7 +15,7 @@
<parent>
<groupId>org.aktin</groupId>
<artifactId>dwh-import</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.9rc2-SNAPSHOT</version>
</parent>
<properties>
......@@ -52,12 +52,12 @@
<dependency>
<groupId>org.aktin</groupId>
<artifactId>cda-validation</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.9rc2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.aktin</groupId>
<artifactId>cda-server</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.9rc2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -4,7 +4,7 @@
<groupId>org.aktin</groupId>
<artifactId>dwh-import</artifactId>
<version>0.9-SNAPSHOT</version>
<version>0.9rc2-SNAPSHOT</version>
<name>AKTIN : DWH Import</name>
<description>AKTIN Software</description>
......@@ -12,7 +12,7 @@
<parent>
<groupId>org.aktin</groupId>
<artifactId>aktin</artifactId>
<version>0.7-SNAPSHOT</version>
<version>0.7</version>
</parent>
<properties>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment