diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..f9aa743b --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,22 @@ +version: 2 +jobs: + build: + docker: + - image: circleci/openjdk:8-jdk + - image: postgres:9.6 + environment: + POSTGRES_USER: samply + POSTGRES_PASSWORD: samply + POSTGRES_DB: samply.connector + + working_directory: ~/repo + + steps: + - checkout + + - run: mvn -B package + + - setup_remote_docker + - run: docker build -t martinbreu/samply-connector:${CIRCLE_SHA1} . + - run: docker login -u martinbreu -p "${DOCKER_HUB_PASSWD}" + - run: docker push martinbreu/samply-connector:${CIRCLE_SHA1} diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..85eb5731 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +* +!src/docker +!target/connector \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..dfdb8b77 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sh text eol=lf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..de8e6262 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM tomcat:8.5.32-jre8-alpine + +ADD target/connector /usr/local/tomcat/webapps/ROOT/ + +ADD src/docker/context.xml /usr/local/tomcat/conf/Catalina/localhost/ROOT.xml +ADD src/docker/context.xml /usr/local/tomcat/webapps/ROOT/META-INF/context.xml +ADD src/docker/server.xml /usr/local/tomcat/conf + +ADD src/docker/samply_common_urls.xml /root/.config/samply/ +ADD src/docker/samply_common_operator.xml /root/.config/samply/ +ADD src/docker/samply_common_config.xml /root/.config/samply/ +ADD src/docker/samply_bridgehead_info.xml /root/.config/samply/ +ADD src/docker/mailSending.xml /root/.config/samply/ + +# JMX Exporter +ENV JMX_EXPORTER_VERSION 0.3.1 +COPY src/docker/jmx-exporter.yml /samply/jmx-exporter.yml +ADD https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/$JMX_EXPORTER_VERSION/jmx_prometheus_javaagent-$JMX_EXPORTER_VERSION.jar /samply/ + +ADD src/docker/start.sh /samply/ +RUN chmod +x /samply/start.sh + +CMD ["/samply/start.sh"] \ No newline at end of file diff --git a/README.md b/README.md index 35153973..b45ee509 100644 --- a/README.md +++ b/README.md @@ -1,110 +1,64 @@ -# Samply Share Client - -Samply Share Client (also referenced as "Teiler" in certain contexts) is part of a bridgehead -infrastructure. It poses as the interface between the local components (mainly, the local -datamanagement) and central components like searchbrokers for the decentral search infrastructure - -# Features - -- Connect to any amount of search brokers to participate in the decentral search -- Generate quality reports to monitor data quality of your local datasets -- Upload a defined set of attributes (**M**elde**d**aten**s**atz) to a central database - -# Build - -In order to build this project, you need to configure maven properly and use the maven profile that -fits to your project. - -During the build process, the jooq plugin will update the database-related files according to the database -configured in _pom.xml_. So you have to create the necessary tables and relations first. This -can be done via the flyway plugin. - -``` -mvn flyway:migrate +[![Docker Pulls](https://img.shields.io/docker/pulls/martinbreu/samply-connector.svg)](https://hub.docker.com/r/martinbreu/samply-connector/) +[![CircleCI](https://circleci.com/gh/martinbreu/samply-connector/tree/master.svg?style=svg)](https://circleci.com/gh/martinbreu/samply-connector/tree/master) + +# Connector + +A Samply.Connector Docker image based on [tomcat:8.5.32-jre8-alpine][1]. The Samply.Connector is configured alike that one from the windows installer. The Postgres database has to be supplied in another Docker container. The connection settings are given by environment variables which are documented below. + +## Environment + +* POSTGRES_HOST - the host name of the Postgres DB +* POSTGRES_PORT - the port of the Postgres DB, defaults to `5432` +* POSTGRES_DB - the database name, defaults to `samply` +* POSTGRES_USER - the database username, defaults to `samply` +* POSTGRES_PASS - the database password, defaults to `samply` +* STORE_URL - the URL of the store to connect to +* MDR_URL - the URL of the mdr to connect to +* CATALINA_OPTS - JVM options for Tomcat like `-Xmx8g` +* OPERATOR_FIRST_NAME - the IT staff which runs the connector +* OPERATOR_LAST_NAME - the IT staff which runs the connector +* OPERATOR_EMAIL - the IT staff which runs the connector +* OPERATOR_PHONE - the IT staff which runs the connector +* HTTP_PROXY - the URL of the HTTP proxy to use for outgoing connections; enables proxy usage if set +* PROXY_USER - the user of the proxy account (optional) +* PROXY_PASS - the password of the proxy account (optional) +* MAIL_HOST - mail host which is able to send mails, defaults to `` +* MAIL_PORT - port to mail host, defaults to `` +* MAIL_PROTOCOL - protocol for mail, defaults to `` +* MAIL_FROM_ADDRESS - mail address from which mails are sent, defaults to `` +* MAIL_FROM_NAME - subject of mails, defaults to `` + +### Proxy + +You can configure your proxy in `~/.docker/config.json` as described [here][4]. + +## Usage + +```sh +docker run -p 8080:8080 -e POSTGRES_HOST= -e POSTGRES_PASS= akiel/samply.connector:latest ``` -Make sure to generate the Manifest file before, so that the project context will be set. Do so with +Open the following URL in a Browser: -``` -mvn war:manifest -P ``` - -Then, to build the war: - -``` -mvn clean package -P +http://localhost:8080/gba-connector/login.xhtml ``` -# Configuration +You should see the login page. The default username and password is `admin` and `adminpass`. -To configure your instance of Samply Share Client, you have to take care of the following settings. -The necessary tables, sequences and types will be created upon startup, given the configured user (see -below in _context.xml_) has the respecitve privileges. +You can register your Connector with the Search Broker under the following address: `https://search.germanbiobanknode.de/broker`. -### Database Connection +## Metrics -The database connection uses a connection pool, for which the datasource is defined in - _src/main/webapp/META-INF/context.xml_ and _src/main/webapp/WEB-INF/web.xml_. Samply Share Client uses -its own database schema, named "samply". +The Docker image contains an [agent][3] which exports various metrics of the JVM like memory statistics in a text format on port `9100`. After enabling metrics by setting `ENABLE_METRICS` to `true` and exporting port `9100`, the following command shows the metrics: -Your context.xml should resemble - -``` - - - - +```sh +curl http://localhost:9100/metrics ``` -You have to set the parameters "database_url", "database_name", "username" and "password" according to -your setup - -Your web.xml has to contain the following snippet -``` - - - postgreSQL Datasource - jdbc/postgres - javax.sql.DataSource - Container - -``` -where the element "res-ref-name" has to be the exact same as the "name" Attribute from context.xml - -### Network Settings - -Network settings (i.e. proxy settings) are read from _-common-config.xml_. - -### URLs to other interfaces - -#### Local Components - -The URLs to other local components (ID-Management, Local Datamanagement) are read from -_\_common\_urls.xml_. - -#### Central Components - -The connections to central components (Central MDS-Database, MDR, Decentral Searchbrokers) are -stored in the database. Some of them are read-only in the UI since they should rarely (or never) be -changed. You have to change them directly in the database. - -# Jobs / Tasks / Triggers - -Samply.Share.Client uses [Quartz](http://www.quartz-scheduler.org) to schedule Jobs. However, -an actual task (e.g. "execute an inquiry") consists of multiple jobs that are chained (in this case: -post inquiry to local datamanagement, check status, if necessary post again...). - -All Jobs are defined in _/src/main/resources/quartz-jobs.xml_ without any triggers. Thus, all jobs have to be -declared as _durable_, to make sure the scheduler knows them. For jobs that run "on their own" -(e.g. inquiry collection), the cron expression has to be set in the database (table _job_schedule_). -To make the cron-expression changeable by the admin, set the "SHOW" entry of the job data map to true (like it is already -done for some jobs in the xml file). - -For jobs that are spawned by other means (e.g. jobs or user interaction), the triggers are set programmatically. +The metrics should be polled by a [Prometheus][2] instance. -To learn more about jobs and triggers in quartz, check - [this tutorial page](https://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/jobs-and-triggers.html) \ No newline at end of file +[1]: +[2]: +[3]: +[4]: diff --git a/pom.xml b/pom.xml index b5083dfa..affc24d1 100644 --- a/pom.xml +++ b/pom.xml @@ -5,9 +5,8 @@ 4.0.0 share-client - 4.0.0-SNAPSHOT + 3.0.7 war - ${project.context}-share-client de.samply @@ -16,6 +15,7 @@ + samply @@ -36,6 +36,11 @@ osse OSSE.Share + + samplyshare + samplyshare + jdbc:postgresql://localhost:5432/samplyshare + samply @@ -43,35 +48,24 @@ dktk DKTK.Teiler - - - - gbn - - gbn - GBN.Teiler + + samplyshare + samplyshare + jdbc:postgresql://localhost:5432/samplyshare + samply - - - ${project.context} - ${project.context} - jdbc:postgresql://localhost:5432/${project.context}.connector - ${project.context} - - 3.0.3-SNAPSHOT 3.1.0 2.0.0 - 2.1.3-SNAPSHOT + 2.0.0 5.0.0 4.0.1 4.0.1 - 1.1.1 - 1.0.0-SNAPSHOT + 1.1.0 1.1.3 @@ -109,7 +103,7 @@ - ${project.basename}-${project.version} + connector src/main/java @@ -150,14 +144,6 @@ - - - org.apache.maven.plugins - maven-surefire-plugin - - true - - @@ -278,16 +264,19 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + - - de.samply - common-config - ${version.samply.common.config} - com.sun.faces @@ -522,16 +511,23 @@ common-ldmclient.samplystore-biobank ${common-ldmclient.samplystore.biobank.version} - - de.samply - samply.common.ldmclient.fhir - ${common-ldmclient.samplystore.fhir.version} - de.samply share-dto 4.1.1-SNAPSHOT + + + samply-maven-oss-releases + Samply Maven Builds + https://maven.samply.de/nexus/content/repositories/oss-releases + + + samply-maven-oss-snapshots + Samply Maven Builds + https://maven.samply.de/nexus/content/repositories/oss-snapshots + + \ No newline at end of file diff --git a/src/docker/context.xml b/src/docker/context.xml new file mode 100644 index 00000000..15b6bd8e --- /dev/null +++ b/src/docker/context.xml @@ -0,0 +1,47 @@ + + + + + + + + WEB-INF/web.xml + + + + + + \ No newline at end of file diff --git a/src/docker/jmx-exporter.yml b/src/docker/jmx-exporter.yml new file mode 100644 index 00000000..640b22f0 --- /dev/null +++ b/src/docker/jmx-exporter.yml @@ -0,0 +1,4 @@ +--- +lowercaseOutputName: true +lowercaseOutputLabelNames: false +#whitelistObjectNames: [] \ No newline at end of file diff --git a/src/docker/mailSending.xml b/src/docker/mailSending.xml new file mode 100644 index 00000000..4004ba25 --- /dev/null +++ b/src/docker/mailSending.xml @@ -0,0 +1,11 @@ + + + {mail-host} + {mail-port} + {mail-protocol} + {mail-from-address} + {mail-from-name} + /WEB-INF/classes/mailTemplates/ + \ No newline at end of file diff --git a/src/docker/samply_bridgehead_info.xml b/src/docker/samply_bridgehead_info.xml new file mode 100644 index 00000000..9ef84491 --- /dev/null +++ b/src/docker/samply_bridgehead_info.xml @@ -0,0 +1,11 @@ + + + Brückenkopf + Brückenkopf + + + + https://search.germanbiobanknode.de/ + diff --git a/src/docker/samply_common_config.xml b/src/docker/samply_common_config.xml new file mode 100644 index 00000000..b27ca217 --- /dev/null +++ b/src/docker/samply_common_config.xml @@ -0,0 +1,20 @@ + + + + + {proxy-url} + {proxy-user} + {proxy-pass} + + + {proxy-url} + {proxy-user} + {proxy-pass} + + + + + + + diff --git a/src/docker/samply_common_operator.xml b/src/docker/samply_common_operator.xml new file mode 100644 index 00000000..53098a54 --- /dev/null +++ b/src/docker/samply_common_operator.xml @@ -0,0 +1,10 @@ + + + {operator-first-name} + + {operator-last-name} + + {operator-email} + + {operator-phone} + diff --git a/src/docker/samply_common_urls.xml b/src/docker/samply_common_urls.xml new file mode 100644 index 00000000..cc97b84e --- /dev/null +++ b/src/docker/samply_common_urls.xml @@ -0,0 +1,6 @@ + + http://www.company.org/cum/sonoras + http://172.22.53.221:8180/ID-Manager + {store-url} + {mdr-url} + diff --git a/src/docker/server.xml b/src/docker/server.xml new file mode 100644 index 00000000..92b84a93 --- /dev/null +++ b/src/docker/server.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/docker/start.sh b/src/docker/start.sh new file mode 100644 index 00000000..35a50695 --- /dev/null +++ b/src/docker/start.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +set -e + +sed -i "s/{postgres-host}/${POSTGRES_HOST}/" /usr/local/tomcat/conf/Catalina/localhost/ROOT.xml +sed -i "s/{postgres-port}/${POSTGRES_PORT}/" /usr/local/tomcat/conf/Catalina/localhost/ROOT.xml +sed -i "s/{postgres-db}/${POSTGRES_DB}/" /usr/local/tomcat/conf/Catalina/localhost/ROOT.xml +sed -i "s/{postgres-user}/${POSTGRES_USER}/" /usr/local/tomcat/conf/Catalina/localhost/ROOT.xml +sed -i "s/{postgres-pass}/${POSTGRES_PASS}/" /usr/local/tomcat/conf/Catalina/localhost/ROOT.xml + +sed -i "s/{postgres-host}/${POSTGRES_HOST}/" /usr/local/tomcat/webapps/ROOT/META-INF/context.xml +sed -i "s/{postgres-port}/${POSTGRES_PORT}/" /usr/local/tomcat/webapps/ROOT/META-INF/context.xml +sed -i "s/{postgres-db}/${POSTGRES_DB}/" /usr/local/tomcat/webapps/ROOT/META-INF/context.xml +sed -i "s/{postgres-user}/${POSTGRES_USER}/" /usr/local/tomcat/webapps/ROOT/META-INF/context.xml +sed -i "s/{postgres-pass}/${POSTGRES_PASS}/" /usr/local/tomcat/webapps/ROOT/META-INF/context.xml + +sed -i "s~{proxy-url}~${HTTP_PROXY}~" /root/.config/samply/samply_common_config.xml +sed -i "s/{proxy-user}/${PROXY_USER}/" /root/.config/samply/samply_common_config.xml +sed -i "s/{proxy-pass}/${PROXY_PASS}/" /root/.config/samply/samply_common_config.xml + +sed -i "s#{store-url}#${STORE_URL}#" /root/.config/samply/samply_common_urls.xml +sed -i "s#{mdr-url}#${MDR_URL}#" /root/.config/samply/samply_common_urls.xml + +sed -i "s/{operator-first-name}/${OPERATOR_FIRST_NAME}/" /root/.config/samply/samply_common_operator.xml +sed -i "s/{operator-last-name}/${OPERATOR_LAST_NAME}/" /root/.config/samply/samply_common_operator.xml +sed -i "s/{operator-email}/${OPERATOR_EMAIL}/" /root/.config/samply/samply_common_operator.xml +sed -i "s#{operator-phone}#${OPERATOR_PHONE}#" /root/.config/samply/samply_common_operator.xml + +sed -i "s%{mail-host}%${MAIL_HOST}%" /root/.config/samply/mailSending.xml +sed -i "s%{mail-port}%${MAIL_PORT}%" /root/.config/samply/mailSending.xml +sed -i "s%{mail-protocol}%${MAIL_PROTOCOL}%" /root/.config/samply/mailSending.xml +sed -i "s%{mail-from-address}%${MAIL_FROM_ADDRESS}%" /root/.config/samply/mailSending.xml +sed -i "s%{mail-from-name}%${MAIL_FROM_NAME}%" /root/.config/samply/mailSending.xml + +export CATALINA_OPTS="${CATALINA_OPTS} -javaagent:/samply/jmx_prometheus_javaagent-0.3.1.jar=9100:/samply/jmx-exporter.yml" + +# Replace start.sh with catalina.sh +exec /usr/local/tomcat/bin/catalina.sh run diff --git a/src/main/java/de/samply/share/client/control/ApplicationBean.java b/src/main/java/de/samply/share/client/control/ApplicationBean.java index 6f497956..5387d09b 100644 --- a/src/main/java/de/samply/share/client/control/ApplicationBean.java +++ b/src/main/java/de/samply/share/client/control/ApplicationBean.java @@ -11,7 +11,6 @@ import de.samply.common.mdrclient.MdrClient; import de.samply.common.mdrclient.MdrConnectionException; import de.samply.common.mdrclient.MdrInvalidResponseException; -import de.samply.config.util.FileFinderUtil; import de.samply.config.util.JAXBUtil; import de.samply.share.client.job.params.CheckInquiryStatusJobParams; import de.samply.share.client.job.params.QuartzJob; @@ -30,7 +29,10 @@ import de.samply.share.client.quality.report.chainlinks.statistics.manager.ChainStatisticsManager; import de.samply.share.client.util.PatientValidator; import de.samply.share.client.util.Utils; -import de.samply.share.client.util.connector.*; +import de.samply.share.client.util.connector.IdManagerConnector; +import de.samply.share.client.util.connector.LdmConnector; +import de.samply.share.client.util.connector.LdmConnectorCentraxx; +import de.samply.share.client.util.connector.LdmConnectorSamplystoreBiobank; import de.samply.share.client.util.connector.exception.IdManagerConnectorException; import de.samply.share.client.util.connector.exception.LDMConnectorException; import de.samply.share.client.util.db.*; @@ -58,9 +60,7 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.UnmarshalException; -import javax.xml.bind.Unmarshaller; import javax.xml.parsers.ParserConfigurationException; -import java.io.File; import java.io.FileNotFoundException; import java.io.Serializable; import java.util.ArrayList; @@ -69,8 +69,6 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; -import static org.omnifaces.util.Faces.getServletContext; - /** * Backing Bean that is valid during the whole runtime of the application. * @@ -115,8 +113,6 @@ public class ApplicationBean implements Serializable { private ConnectCheckResult ldmAvailability = new ConnectCheckResult(); private ConnectCheckResult idmAvailability = new ConnectCheckResult(); - static String[] fallbacks; - @PostConstruct public void init() { // On startup, check if there are changes to be done in the database @@ -211,7 +207,7 @@ private void initDthValidator() { // TODO: other connector implementations private static void initLdmConnector() { if (ProjectInfo.INSTANCE.getProjectName().toLowerCase().equals("samply")) { - if (ConfigurationUtil.getConfigurationElementValueAsBoolean(EnumConfiguration.LDM_CACHING_ENABLED)) { + if (ConfigurationUtil.getConfigurationElementValueAsBoolean(EnumConfiguration.LDM_CACHING_ENABLED)) { try { int maxCacheSize = Integer.parseInt(ConfigurationUtil.getConfigurationElementValue(EnumConfiguration.LDM_CACHING_MAX_SIZE)); ApplicationBean.ldmConnector = new LdmConnectorSamplystoreBiobank(true, maxCacheSize); @@ -232,8 +228,6 @@ private static void initLdmConnector() { } else { ApplicationBean.ldmConnector = new LdmConnectorCentraxx(false); } - }else if(ProjectInfo.INSTANCE.getProjectName().toLowerCase().equals("fhir")){ - } } @@ -258,7 +252,7 @@ private void resetMdrContext() { // logger.debug("Getting osse mdr url"); // mdrUrl = OsseEdcContext.getOsseEdcConfiguration().getMdrUrl(); // } else { - mdrUrl = ConfigurationUtil.getConfigurationElementValue(EnumConfiguration.MDR_URL); + mdrUrl = ConfigurationUtil.getConfigurationElementValue(EnumConfiguration.MDR_URL); // } mdrClient = new MdrClient(mdrUrl, httpConnector.getJerseyClient(mdrUrl)); mdrClient.cleanCache(); @@ -274,7 +268,7 @@ private static void loadCommonConfig() { JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class); configuration = JAXBUtil .findUnmarshall(ProjectInfo.INSTANCE.getProjectName().toLowerCase() + COMMON_CONFIG_FILENAME_SUFFIX, - jaxbContext, Configuration.class, ProjectInfo.INSTANCE.getProjectName().toLowerCase(), System.getProperty("catalina.base") + File.separator + "conf", getServletContext().getRealPath("/WEB-INF")); + jaxbContext, Configuration.class, ProjectInfo.INSTANCE.getProjectName().toLowerCase()); CredentialsUtil.updateProxyCredentials(configuration); updateProxiesInDb(); } catch (FileNotFoundException e) { @@ -294,7 +288,7 @@ private static void loadUrls() { JAXBContext jaxbContext = JAXBContext.newInstance(de.samply.share.client.model.common.ObjectFactory.class); urls = JAXBUtil .findUnmarshall(ProjectInfo.INSTANCE.getProjectName().toLowerCase() + COMMON_URLS_FILENAME_SUFFIX, - jaxbContext, Urls.class, ProjectInfo.INSTANCE.getProjectName().toLowerCase(), System.getProperty("catalina.base") + File.separator + "conf", getServletContext().getRealPath("/WEB-INF")); + jaxbContext, Urls.class, ProjectInfo.INSTANCE.getProjectName().toLowerCase()); } catch (FileNotFoundException e) { logger.error("No common urls file found by using samply.common.config for project " + ProjectInfo.INSTANCE.getProjectName()); } catch (UnmarshalException ue) { @@ -312,7 +306,7 @@ private static void loadOperator() { JAXBContext jaxbContext = JAXBContext.newInstance(de.samply.share.client.model.common.ObjectFactory.class); operator = JAXBUtil .findUnmarshall(ProjectInfo.INSTANCE.getProjectName().toLowerCase() + COMMON_OPERATOR_FILENAME_SUFFIX, - jaxbContext, Operator.class, ProjectInfo.INSTANCE.getProjectName().toLowerCase(), System.getProperty("catalina.base") + File.separator + "conf", getServletContext().getRealPath("/WEB-INF")); + jaxbContext, Operator.class, ProjectInfo.INSTANCE.getProjectName().toLowerCase()); } catch (FileNotFoundException e) { logger.error("No common operator file found by using samply.common.config for project " + ProjectInfo.INSTANCE.getProjectName()); } catch (UnmarshalException ue) { @@ -330,7 +324,7 @@ private static void loadBridgeheadInfo() { JAXBContext jaxbContext = JAXBContext.newInstance(de.samply.share.client.model.common.ObjectFactory.class); infos = JAXBUtil .findUnmarshall(ProjectInfo.INSTANCE.getProjectName().toLowerCase() + COMMON_INFOS_FILENAME_SUFFIX, - jaxbContext, Bridgehead.class, ProjectInfo.INSTANCE.getProjectName().toLowerCase(), System.getProperty("catalina.base") + File.separator + "conf", getServletContext().getRealPath("/WEB-INF")); + jaxbContext, Bridgehead.class, ProjectInfo.INSTANCE.getProjectName().toLowerCase()); } catch (FileNotFoundException e) { logger.error("No common bridgehead info file found by using samply.common.config for project " + ProjectInfo.INSTANCE.getProjectName()); } catch (UnmarshalException ue) { @@ -349,7 +343,7 @@ private static void updateProxiesInDb() { httpProxyConfigElement.setName(EnumConfiguration.HTTP_PROXY.name()); httpProxyConfigElement.setSetting(configuration.getProxy().getHTTP().getUrl().toString()); ConfigurationUtil.insertOrUpdateConfigurationElement(httpProxyConfigElement); - + de.samply.share.client.model.db.tables.pojos.Configuration httpsProxyConfigElement = new de.samply.share.client.model.db.tables.pojos.Configuration(); httpsProxyConfigElement.setName(EnumConfiguration.HTTPS_PROXY.name()); httpsProxyConfigElement.setSetting(configuration.getProxy().getHTTPS().getUrl().toString()); @@ -378,6 +372,11 @@ private static void updateCommonUrls() { shareConfigElement.setName(EnumConfiguration.SHARE_URL.name()); shareConfigElement.setSetting(urls.getShareUrl()); ConfigurationUtil.insertOrUpdateConfigurationElement(shareConfigElement); + + de.samply.share.client.model.db.tables.pojos.Configuration mdrConfigElement = new de.samply.share.client.model.db.tables.pojos.Configuration(); + mdrConfigElement.setName(EnumConfiguration.MDR_URL.name()); + mdrConfigElement.setSetting(urls.getMdrUrl()); + ConfigurationUtil.insertOrUpdateConfigurationElement(mdrConfigElement); } } diff --git a/src/main/java/de/samply/share/client/control/InquiryBean.java b/src/main/java/de/samply/share/client/control/InquiryBean.java index 947286a5..fe2a16a1 100644 --- a/src/main/java/de/samply/share/client/control/InquiryBean.java +++ b/src/main/java/de/samply/share/client/control/InquiryBean.java @@ -29,7 +29,6 @@ package de.samply.share.client.control; import com.google.common.net.HttpHeaders; -import de.samply.common.ldmclient.samplystoreFHIR.LdmClientSamplystoreFHIR; import de.samply.dktk.converter.EnumValidationHandling; import de.samply.dktk.converter.PatientConverter; import de.samply.dktk.converter.PatientConverterUtil; @@ -51,14 +50,13 @@ import de.samply.share.client.util.db.*; import de.samply.share.common.model.uiquerybuilder.QueryItem; import de.samply.share.common.utils.MdrIdDatatype; -import de.samply.share.common.utils.ProjectInfo; import de.samply.share.common.utils.QueryTreeUtil; import de.samply.share.common.utils.SamplyShareUtils; import de.samply.share.model.bbmri.BbmriResult; -import de.samply.share.model.common.Container; import de.samply.share.model.ccp.QueryResult; -import de.samply.share.model.common.Result; +import de.samply.share.model.common.Container; import de.samply.share.model.common.QueryResultStatistic; +import de.samply.share.model.common.Result; import de.samply.share.utils.Converter; import de.samply.web.mdrFaces.MdrContext; import org.apache.logging.log4j.LogManager; @@ -84,7 +82,8 @@ import java.io.Serializable; import java.nio.file.Files; import java.nio.file.Path; -import java.util.*; +import java.util.ArrayList; +import java.util.List; /** * ViewScoped backing bean, used for pages that deal with inquiries @@ -412,10 +411,10 @@ public void loadResult() { private void populateQueryResult() throws LDMConnectorException { String queryResultLocation = latestInquiryResult.getLocation(); // TODO other types - if (ProjectInfo.INSTANCE.getProjectName().equals("dktk")) { + if (ldmConnector instanceof LdmConnectorCentraxx) { latestQueryResult = (QueryResult) ldmConnector.getResultsFromPage(queryResultLocation, 0); } - if (ProjectInfo.INSTANCE.getProjectName().equals("samply")) { + if (ldmConnector instanceof LdmConnectorSamplystoreBiobank) { latestQueryResult = (BbmriResult) ldmConnector.getResultsFromPage(queryResultLocation, 0); } buildPatientPageTree(latestQueryResult); @@ -437,10 +436,10 @@ public void changeResultPage() { try { // TODO other types - if (ProjectInfo.INSTANCE.getProjectName().equals("dktk")) { + if (ldmConnector instanceof LdmConnectorCentraxx) { latestQueryResult = (QueryResult) ldmConnector.getResultsFromPage(latestInquiryResult.getLocation(), page); } - if (ProjectInfo.INSTANCE.getProjectName().equals("samply")) { + if (ldmConnector instanceof LdmConnectorSamplystoreBiobank) { latestQueryResult = (BbmriResult) ldmConnector.getResultsFromPage(latestInquiryResult.getLocation(), page); } } catch (LDMConnectorException e) { @@ -458,7 +457,7 @@ private void buildPatientPageTree(Result queryResultPage) { if (queryResultPage == null) { logger.error("Could not build tree. Result is null."); } - patientPageTree = resultPageToTree(queryResultPage); + patientPageTree = resultPageToTree(queryResultPage, ldmConnector); } /** @@ -466,10 +465,10 @@ private void buildPatientPageTree(Result queryResultPage) { * * @param queryResultPage xml list of patients */ - private static TreeModel resultPageToTree(Result queryResultPage) { + private static TreeModel resultPageToTree(Result queryResultPage, LdmConnector ldmConnector) { TreeModel containerTree = new ListTreeModel<>(); - if (ProjectInfo.INSTANCE.getProjectName().equals("dktk")) { + if (ldmConnector instanceof LdmConnectorCentraxx) { QueryResult queryResultPageCCP = (QueryResult) queryResultPage; for (de.samply.share.model.ccp.Patient patient : queryResultPageCCP.getPatient()) { de.samply.share.model.ccp.Container patientContainer = new de.samply.share.model.ccp.Container(); @@ -485,7 +484,7 @@ private static TreeModel resultPageToTree(Result queryResultPage) { containerTree = visitContainerNode(containerTree, containerTmp); } } - if (ProjectInfo.INSTANCE.getProjectName().equals("samply")) { + if (ldmConnector instanceof LdmConnectorSamplystoreBiobank) { BbmriResult queryResultPageBBMRI = (BbmriResult) queryResultPage; for (de.samply.share.model.osse.Patient donor : queryResultPageBBMRI.getDonors()) { de.samply.share.model.osse.Container patientContainer = new de.samply.share.model.osse.Container(); @@ -544,7 +543,7 @@ public void generateExportFile(EnumValidationHandling validationHandling) { blacklist); // TODO other types Workbook workbook = null; - if (ProjectInfo.INSTANCE.getProjectName().equals("dktk")) { + if (ldmConnector instanceof LdmConnectorCentraxx) { QueryResult queryResult = (QueryResult) ldmConnector.getResults(queryResultLocation); logger.debug("Result completely loaded...write excel file"); String executionDateString = WebUtils.getExecutionDate(latestInquiryResult); @@ -554,7 +553,7 @@ public void generateExportFile(EnumValidationHandling validationHandling) { ConfigurationUtil.getConfigurationElementValue(EnumConfiguration.ID_MANAGER_INSTANCE_ID), executionDateString ); - } else if (ProjectInfo.INSTANCE.getProjectName().equals("samply")) { + } else if (ldmConnector instanceof LdmConnectorSamplystoreBiobank) { BbmriResult queryResult = (BbmriResult) ldmConnector.getResults(queryResultLocation); logger.debug("Result completely loaded...write excel file"); String executionDateString = WebUtils.getExecutionDate(latestInquiryResult); @@ -597,12 +596,12 @@ public void generateExportFile(EnumValidationHandling validationHandling) { public String reply() { try { BrokerConnector brokerConnector = new BrokerConnector(BrokerUtil.fetchBrokerById(inquiry.getBrokerId())); - if (ProjectInfo.INSTANCE.getProjectName().equals("dktk")) { - brokerConnector.reply(latestInquiryDetails, latestInquiryResult.getSize()); - } else if (ProjectInfo.INSTANCE.getProjectName().equals("samply")) { + if (ldmConnector instanceof LdmConnectorCentraxx) { + brokerConnector.reply(latestInquiryDetails, latestInquiryResult.getSize(),ldmConnector); + } else if (ldmConnector instanceof LdmConnectorSamplystoreBiobank) { try { BbmriResult queryResult = (BbmriResult) ldmConnector.getResults(InquiryResultUtil.fetchLatestInquiryResultForInquiryDetailsById(latestInquiryDetails.getId()).getLocation()); - brokerConnector.reply(latestInquiryDetails, queryResult); + brokerConnector.reply(latestInquiryDetails, queryResult,ldmConnector); } catch (LDMConnectorException e) { e.printStackTrace(); } diff --git a/src/main/java/de/samply/share/client/control/QualityReportController.java b/src/main/java/de/samply/share/client/control/QualityReportController.java index 3162d241..c95db728 100644 --- a/src/main/java/de/samply/share/client/control/QualityReportController.java +++ b/src/main/java/de/samply/share/client/control/QualityReportController.java @@ -28,10 +28,10 @@ import de.samply.share.client.model.EnumConfiguration; import de.samply.share.client.quality.report.chain.Chain; -import de.samply.share.client.quality.report.chain.finalizer.ChainFinalizer; import de.samply.share.client.quality.report.chain.factory.ChainFactory; import de.samply.share.client.quality.report.chain.factory.ChainFactoryException; import de.samply.share.client.quality.report.chain.factory.QualityReportChainFactory_002; +import de.samply.share.client.quality.report.chain.finalizer.ChainFinalizer; import de.samply.share.client.quality.report.chainlinks.statistics.chain.ChainStatistics; import de.samply.share.client.quality.report.chainlinks.statistics.manager.ChainStatisticsManager; import de.samply.share.client.quality.report.faces.QualityReportFileInfo; @@ -44,7 +44,6 @@ import de.samply.share.client.quality.report.file.manager.QualityReportMetadataFileManager; import de.samply.share.client.quality.report.file.manager.QualityReportMetadataFileManagerImpl; import de.samply.share.client.quality.report.file.metadata.txtcolumn.MetadataTxtColumnManager_002; - import de.samply.share.client.util.db.ConfigurationUtil; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/src/main/java/de/samply/share/client/job/CheckInquiryStatusJob.java b/src/main/java/de/samply/share/client/job/CheckInquiryStatusJob.java index 5faef41a..0486c764 100644 --- a/src/main/java/de/samply/share/client/job/CheckInquiryStatusJob.java +++ b/src/main/java/de/samply/share/client/job/CheckInquiryStatusJob.java @@ -45,7 +45,6 @@ import de.samply.share.client.util.connector.exception.BrokerConnectorException; import de.samply.share.client.util.connector.exception.LDMConnectorException; import de.samply.share.client.util.db.*; -import de.samply.share.common.utils.ProjectInfo; import de.samply.share.model.bbmri.BbmriResult; import de.samply.share.model.common.Error; import de.samply.share.model.common.QueryResultStatistic; @@ -410,12 +409,12 @@ private void processReplyRules() { case RR_TOTAL_COUNT: logger.info("Reporting the amount of matching datasets to the broker."); BrokerConnector brokerConnector = new BrokerConnector(BrokerUtil.fetchBrokerById(brokerId)); - if (ProjectInfo.INSTANCE.getProjectName().equals("dktk")) { - brokerConnector.reply(inquiryDetails, inquiryResult.getSize()); - } else if (ProjectInfo.INSTANCE.getProjectName().equals("samply")) { + if (ldmConnector instanceof LdmConnectorCentraxx) { + brokerConnector.reply(inquiryDetails, inquiryResult.getSize(),ldmConnector); + } else if (ldmConnector instanceof LdmConnectorSamplystoreBiobank) { try { BbmriResult queryResult = (BbmriResult) ldmConnector.getResults(InquiryResultUtil.fetchLatestInquiryResultForInquiryDetailsById(inquiryDetails.getId()).getLocation()); - brokerConnector.reply(inquiryDetails, queryResult); + brokerConnector.reply(inquiryDetails, queryResult,ldmConnector); } catch (LDMConnectorException e) { e.printStackTrace(); } diff --git a/src/main/java/de/samply/share/client/job/CheckInquiryStatusJobListener.java b/src/main/java/de/samply/share/client/job/CheckInquiryStatusJobListener.java index 52015f7e..b0bdb227 100644 --- a/src/main/java/de/samply/share/client/job/CheckInquiryStatusJobListener.java +++ b/src/main/java/de/samply/share/client/job/CheckInquiryStatusJobListener.java @@ -29,13 +29,13 @@ package de.samply.share.client.job; import de.samply.share.client.control.ApplicationBean; +import de.samply.share.client.job.params.CheckInquiryStatusJobParams; import de.samply.share.client.job.params.CheckInquiryStatusJobResult; import de.samply.share.client.model.db.enums.EventMessageType; import de.samply.share.client.model.db.enums.InquiryStatusType; import de.samply.share.client.model.db.enums.UploadStatusType; import de.samply.share.client.model.db.tables.pojos.InquiryDetails; import de.samply.share.client.model.db.tables.pojos.InquiryResult; -import de.samply.share.client.job.params.CheckInquiryStatusJobParams; import de.samply.share.client.util.db.*; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -76,10 +76,7 @@ public void jobExecutionVetoed(JobExecutionContext jobExecutionContext) { @Override public void jobWasExecuted(JobExecutionContext jobExecutionContext, JobExecutionException e) { - logger.debug("Job was executed. Context: " + jobExecutionContext); - if (e != null){ - logger.debug(" - Exception: " + e); - } + logger.debug("Job was executed. Context: " + jobExecutionContext + " - exception " + e); CheckInquiryStatusJobResult result; Object resultObject = jobExecutionContext.getResult(); if (resultObject != null) { diff --git a/src/main/java/de/samply/share/client/job/CollectInquiriesJob.java b/src/main/java/de/samply/share/client/job/CollectInquiriesJob.java index d86f496b..0823d7e4 100644 --- a/src/main/java/de/samply/share/client/job/CollectInquiriesJob.java +++ b/src/main/java/de/samply/share/client/job/CollectInquiriesJob.java @@ -3,7 +3,10 @@ import de.samply.share.client.model.EnumInquiryPresent; import de.samply.share.client.model.db.enums.EntityType; import de.samply.share.client.model.db.enums.EventMessageType; -import de.samply.share.client.model.db.tables.pojos.*; +import de.samply.share.client.model.db.tables.pojos.Broker; +import de.samply.share.client.model.db.tables.pojos.Credentials; +import de.samply.share.client.model.db.tables.pojos.InquiryDetails; +import de.samply.share.client.model.db.tables.pojos.RequestedEntity; import de.samply.share.client.util.connector.BrokerConnector; import de.samply.share.client.util.connector.exception.BrokerConnectorException; import de.samply.share.client.util.db.*; @@ -12,16 +15,20 @@ import de.samply.share.utils.QueryConverter; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.quartz.*; +import org.quartz.DisallowConcurrentExecution; +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; -import javax.xml.bind.*; +import javax.xml.bind.JAXBException; import java.net.URISyntaxException; import java.sql.Timestamp; -import java.util.*; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.Map; -import static de.samply.share.client.model.EnumInquiryPresent.IP_DIFFERENT_REVISION; -import static de.samply.share.client.model.EnumInquiryPresent.IP_SAME_REVISION; -import static de.samply.share.client.model.EnumInquiryPresent.IP_UNAVAILABLE; +import static de.samply.share.client.model.EnumInquiryPresent.*; import static de.samply.share.client.model.db.enums.InquiryStatusType.IS_NEW; /** @@ -68,7 +75,6 @@ public void execute(JobExecutionContext jobExecutionContext) throws JobExecution /** * Load and persist inquiries for a given searchbroker. * - * @param broker the broker * @param inquiryIdAndRevision the inquiry id and revision * @return true, if successful */ diff --git a/src/main/java/de/samply/share/client/job/DbCleanupJob.java b/src/main/java/de/samply/share/client/job/DbCleanupJob.java index 61a2c7d0..6b2dab91 100644 --- a/src/main/java/de/samply/share/client/job/DbCleanupJob.java +++ b/src/main/java/de/samply/share/client/job/DbCleanupJob.java @@ -46,7 +46,6 @@ import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; -import java.util.ArrayList; import java.util.List; /** diff --git a/src/main/java/de/samply/share/client/job/ExecuteInquiryJob.java b/src/main/java/de/samply/share/client/job/ExecuteInquiryJob.java index 1c2cbe49..916b76a0 100644 --- a/src/main/java/de/samply/share/client/job/ExecuteInquiryJob.java +++ b/src/main/java/de/samply/share/client/job/ExecuteInquiryJob.java @@ -1,21 +1,20 @@ package de.samply.share.client.job; import de.samply.share.client.control.ApplicationBean; +import de.samply.share.client.job.params.CheckInquiryStatusJobParams; +import de.samply.share.client.job.params.ExecuteInquiryJobParams; import de.samply.share.client.model.EnumConfigurationTimings; import de.samply.share.client.model.db.enums.EventMessageType; import de.samply.share.client.model.db.enums.InquiryStatusType; import de.samply.share.client.model.db.tables.pojos.Inquiry; import de.samply.share.client.model.db.tables.pojos.InquiryDetails; import de.samply.share.client.model.db.tables.pojos.InquiryResult; -import de.samply.share.client.job.params.CheckInquiryStatusJobParams; -import de.samply.share.client.job.params.ExecuteInquiryJobParams; import de.samply.share.client.util.Replace; import de.samply.share.client.util.connector.LdmConnector; import de.samply.share.client.util.connector.LdmConnectorCentraxx; import de.samply.share.client.util.connector.exception.LDMConnectorException; import de.samply.share.client.util.db.*; import de.samply.share.common.model.uiquerybuilder.QueryItem; -import de.samply.share.common.utils.ProjectInfo; import de.samply.share.common.utils.QueryTreeUtil; import de.samply.share.common.utils.QueryValidator; import de.samply.share.common.utils.SamplyShareUtils; @@ -28,7 +27,6 @@ import org.quartz.impl.matchers.KeyMatcher; import javax.xml.bind.JAXBException; - import java.util.List; import static de.samply.share.client.model.db.enums.InquiryStatusType.IS_LDM_ERROR; @@ -85,7 +83,7 @@ public void execute(JobExecutionContext jobExecutionContext) throws JobExecution } // to search the aggregated field - if (ProjectInfo.INSTANCE.getProjectName().equals("dktk")) { + if (ldmConnector instanceof LdmConnectorCentraxx) { inquiryDetails.setCriteriaOriginal(Replace.replaceMDRKey(inquiryDetails.getCriteriaOriginal())); originalQuery = QueryConverter.xmlToQuery(inquiryDetails.getCriteriaOriginal()); // TODO remove this "temporary" workaround as soon as possible! This is linked with the age-old issue of different java date formats in some mdr elements! diff --git a/src/main/java/de/samply/share/client/job/GenerateInquiryResultStatsJob.java b/src/main/java/de/samply/share/client/job/GenerateInquiryResultStatsJob.java index 1c26fd12..84f4f17b 100644 --- a/src/main/java/de/samply/share/client/job/GenerateInquiryResultStatsJob.java +++ b/src/main/java/de/samply/share/client/job/GenerateInquiryResultStatsJob.java @@ -29,7 +29,6 @@ package de.samply.share.client.job; import com.google.gson.Gson; -import de.samply.common.ldmclient.samplystoreBiobank.LdmClientSamplystoreBiobank; import de.samply.dktk.converter.PatientConverterUtil; import de.samply.share.client.control.ApplicationBean; import de.samply.share.client.job.params.GenerateInquiryResultStatsJobParams; @@ -46,10 +45,7 @@ import de.samply.share.client.util.db.InquiryResultStatsUtil; import de.samply.share.client.util.db.InquiryResultUtil; import de.samply.share.common.utils.MdrIdDatatype; -import de.samply.share.common.utils.ProjectInfo; import de.samply.share.model.bbmri.BbmriResult; -import de.samply.share.model.bbmri.Donor; -import de.samply.share.model.ccp.Entity; import de.samply.share.model.ccp.Patient; import de.samply.share.model.ccp.QueryResult; import de.samply.share.utils.Converter; @@ -121,7 +117,7 @@ private void generateStatistics(Object queryResult) { GenderDistribution genderDistribution = new GenderDistribution(); // TODO: other types - if (ProjectInfo.INSTANCE.getProjectName().equals("dktk")) { + if (ldmConnector instanceof LdmConnectorCentraxx) { QueryResult ccpQueryResult = (QueryResult) queryResult; for (Patient patient : ccpQueryResult.getPatient()) { de.samply.share.model.common.Patient patientCommon = new de.samply.share.model.common.Patient(); @@ -134,7 +130,7 @@ private void generateStatistics(Object queryResult) { genderDistribution.increaseCountForGender(getGender(patientCommon,"urn:dktk:dataelement:1:")); } } - if (ProjectInfo.INSTANCE.getProjectName().equals("samply")) { + if (ldmConnector instanceof LdmConnectorSamplystoreBiobank) { for (de.samply.share.model.osse.Patient donor : ((BbmriResult) queryResult).getDonors()) { de.samply.share.model.common.Patient donorCommon = new de.samply.share.model.common.Patient(); try { @@ -170,7 +166,7 @@ private int getAge(de.samply.share.model.common.Patient patient, String mdr_age) return -1; } else { try { - if(ProjectInfo.INSTANCE.getProjectName().equals("samply")){ + if(ldmConnector instanceof LdmConnectorSamplystoreBiobank){ ageString = ageString.replace("\"", ""); LocalDate birthdate = new LocalDate (Integer.parseInt(ageString.split("\\.")[2]), Integer.parseInt(ageString.split("\\.")[1]), Integer.parseInt(ageString.split("\\.")[0])); LocalDate now = new LocalDate(); diff --git a/src/main/java/de/samply/share/client/job/ReportToMonitoringJob.java b/src/main/java/de/samply/share/client/job/ReportToMonitoringJob.java index 4dee45e3..9046255c 100644 --- a/src/main/java/de/samply/share/client/job/ReportToMonitoringJob.java +++ b/src/main/java/de/samply/share/client/job/ReportToMonitoringJob.java @@ -38,7 +38,6 @@ import de.samply.share.client.util.connector.exception.BrokerConnectorException; import de.samply.share.client.util.db.BrokerUtil; import de.samply.share.common.model.dto.monitoring.StatusReportItem; -import de.samply.share.common.utils.ProjectInfo; import org.apache.log4j.LogManager; import org.apache.log4j.Logger; import org.quartz.DisallowConcurrentExecution; @@ -92,52 +91,35 @@ public void execute(JobExecutionContext jobExecutionContext) throws JobExecution private List gatherStatusReportItems(BrokerConnector brokerConnector) { List statusReportItems = new ArrayList<>(); - if(ProjectInfo.INSTANCE.getVersionString().toLowerCase().equals("dktk")) { - if (jobParams.isCountTotal()) { - StatusReportItem totalCount = getTotalCount(); - statusReportItems.add(totalCount); - } - - if (jobParams.isCountDktkFlagged()) { - StatusReportItem dktkCount = getDktkCount(); - statusReportItems.add(dktkCount); - } + if (jobParams.isCountTotal()) { + StatusReportItem totalCount = getTotalCount(); + statusReportItems.add(totalCount); + } - if (jobParams.isCountReferenceQuery() || jobParams.isTimeReferenceQuery()) { - ReferenceQueryCheckResult referenceQueryCheckResult = getReferenceQueryResult(brokerConnector); - if (jobParams.isCountReferenceQuery()) { - StatusReportItem referenceQueryCount = getReferenceQueryCount(referenceQueryCheckResult); - statusReportItems.add(referenceQueryCount); - } - if (jobParams.isTimeReferenceQuery()) { - StatusReportItem referenceQueryTime = getReferenceQueryTime(referenceQueryCheckResult); - statusReportItems.add(referenceQueryTime); - } - } + if (jobParams.isCountDktkFlagged()) { + StatusReportItem dktkCount = getDktkCount(); + statusReportItems.add(dktkCount); + } - if (jobParams.isCentraxxMappingInformation()) { - StatusReportItem centraxxMappingVersion = getCentraxxMappingVersion(); - statusReportItems.add(centraxxMappingVersion); - StatusReportItem centraxxMappingDate = getCentraxxMappingDate(); - statusReportItems.add(centraxxMappingDate); - } - }else if(ProjectInfo.INSTANCE.getProjectName().toLowerCase().equals("samply")){ - if (jobParams.isCountTotal()) { - StatusReportItem totalCount = getTotalCount(); - statusReportItems.add(totalCount); + if (jobParams.isCountReferenceQuery() || jobParams.isTimeReferenceQuery()) { + ReferenceQueryCheckResult referenceQueryCheckResult = getReferenceQueryResult(brokerConnector); + if (jobParams.isCountReferenceQuery()) { + StatusReportItem referenceQueryCount = getReferenceQueryCount(referenceQueryCheckResult); + statusReportItems.add(referenceQueryCount); } - if (jobParams.isCountReferenceQuery() || jobParams.isTimeReferenceQuery()) { - ReferenceQueryCheckResult referenceQueryCheckResult = getReferenceQueryResult(brokerConnector); - if (jobParams.isCountReferenceQuery()) { - StatusReportItem referenceQueryCount = getReferenceQueryCount(referenceQueryCheckResult); - statusReportItems.add(referenceQueryCount); - } - if (jobParams.isTimeReferenceQuery()) { - StatusReportItem referenceQueryTime = getReferenceQueryTime(referenceQueryCheckResult); - statusReportItems.add(referenceQueryTime); - } + if (jobParams.isTimeReferenceQuery()) { + StatusReportItem referenceQueryTime = getReferenceQueryTime(referenceQueryCheckResult); + statusReportItems.add(referenceQueryTime); } } + + if (jobParams.isCentraxxMappingInformation()) { + StatusReportItem centraxxMappingVersion = getCentraxxMappingVersion(); + statusReportItems.add(centraxxMappingVersion); + StatusReportItem centraxxMappingDate = getCentraxxMappingDate(); + statusReportItems.add(centraxxMappingDate); + } + return statusReportItems; } @@ -279,7 +261,7 @@ private static StatusReportItem getCentraxxMappingDate() { centraxxMappingDate.setStatus_text("Does not apply"); } else { try { - String mappingDate = ((LdmConnectorCentraxx)ldmConnector).getMappingDate(); + String mappingDate = ((LdmConnectorCentraxx)ldmConnector).getMappingVersion(); centraxxMappingDate.setExit_status("0"); centraxxMappingDate.setStatus_text(mappingDate); } catch (Exception e) { diff --git a/src/main/java/de/samply/share/client/listener/StartupListener.java b/src/main/java/de/samply/share/client/listener/StartupListener.java index 36cda27d..67a0a05e 100644 --- a/src/main/java/de/samply/share/client/listener/StartupListener.java +++ b/src/main/java/de/samply/share/client/listener/StartupListener.java @@ -1,22 +1,16 @@ package de.samply.share.client.listener; -import de.samply.config.util.FileFinderUtil; import de.samply.share.client.model.db.enums.EventMessageType; import de.samply.share.client.util.db.EventLogUtil; -import de.samply.share.client.util.db.Migration; import de.samply.share.common.utils.ProjectInfo; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.core.config.Configurator; -import org.flywaydb.core.api.FlywayException; import org.omnifaces.util.Faces; import org.omnifaces.util.Messages; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import javax.servlet.annotation.WebListener; -import java.io.File; -import java.io.FileNotFoundException; import java.sql.Driver; import java.sql.DriverManager; import java.sql.SQLException; @@ -40,14 +34,6 @@ public void contextInitialized(ServletContextEvent sce) { logger.info("context initialized!"); setMessagesResolver(); ProjectInfo.INSTANCE.initProjectMetadata(sce); - try { - Configurator.initialize( - null, - FileFinderUtil.findFile( - "log4j2.xml", ProjectInfo.INSTANCE.getProjectName(), System.getProperty("catalina.base") + File.separator + "conf", sce.getServletContext().getRealPath("/WEB-INF")).getAbsolutePath()); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } } @Override diff --git a/src/main/java/de/samply/share/client/messages/messages_de.properties b/src/main/java/de/samply/share/client/messages/messages_de.properties index 7719122b..002d3022 100644 --- a/src/main/java/de/samply/share/client/messages/messages_de.properties +++ b/src/main/java/de/samply/share/client/messages/messages_de.properties @@ -16,28 +16,23 @@ common_passwordChanged=Passwort erfolgreich ge\u00E4ndert common_passwordChangeTitle=Passwort \u00E4ndern common_logout=Abmelden common_selectFile=Datei ausw\u00E4hlen - ConfigurationController_configuration=Konfiguration ConfigurationController_configurationSaved=Konfiguration gespeichert LoginController_loginFailedMessage=Anmeldeinformationen ung\u00FCltig LoginController_loginFailedTitle=Fehler bei der Anmeldung - #WebUtils WebUtils_caseDateYear=aus dem Jahr WebUtils_caseDateUnknown=unbekannten Datums - # Inquiry Status Enum IS_NEW=neu IS_ARCHIVED=archiviert IS_PROCESSING=wird bearbeitet IS_LDM_ERROR=Fehler (LDM) - # index.xhtml index_ldm=Lokales Datenmanagement index_idmanager=ID-Manager index_teiler=Teiler index_unreachable=Nicht erreichbar - # configuration.xhtml configuration_title=Konfiguration configuration_manageCredentials=Zugangsdaten verwalten @@ -73,7 +68,6 @@ configuration_sendReferenceQueryTime=Ausf\u00FChrungszeit des Referenzquery \u00 configuration_sendCentraxxMappingVersion=Centraxx SQL Mappingversion \u00FCbermitteln configuration_misc=Sonstiges configuration_mailNotifyEmptyResults=Suchanfragen ohne Ergebnis in E-Mails aufnehmen - configurationTimings=Timings configurationTimings_collectInquiriesInterval=Suchanfragen abholen alle configurationTimings_checkInquiryStatusInitialDelay=Erstmalige Wartezeit zwischen Anfrage stellen und Status pr\u00FCfen @@ -83,11 +77,9 @@ configurationTimings_checkInquiryStatusResultsRetryInterval=Wartezeit zwischen z configurationTimings_checkInquiryStatusResultsRetryAttempts=Anzahl der Versuche, Ergebnisdatens\u00E4tze abzurufen configurationTimings_parseException=Bitte eine nat\u00FCrliche Zahl eingeben configurationTimings_archiveInquiries=Anfragen archivieren nach - # c_loginPanel.xhtml loginPanel_login=Anmeldung loginPanel_doLogin=Anmelden - # dashboard.xhtml dashboard_title=\u00DCbersicht dashboard_configuration=Konfiguration @@ -116,7 +108,6 @@ dashboard_inquiriesArchive=Archivierte Anfragen dashboard_inquiriesArchiveDetails=Suchanfragen im Archiv derzeit dashboard_tests=Funktionstests dashboard_testsDetails=\u00DCberpr\u00FCfen Sie die Kommunikation mit anderen Komponenten - # export.xhtml export_criteria=Exportkriterien export_dateConjunction=und @@ -124,7 +115,6 @@ pleaseWait=Bitte warten export_saveModalTitle=Export-Vorlage speichern export_setName=Bitte geben sie einen Namen zum Speichern der Export-Vorlage ein: export_query=Suchkriterien f\u00FCr Patienten - # chart*.xhtml charts_query=Patientenmenge einschr\u00E4nken charts_setName=Bitte geben sie einen Namen zum Speichern der Auswertung ein: @@ -133,12 +123,10 @@ charts_nofOccurences=Anzahl der Patienten charts_deleteChartModalTitle=Diagramm l\u00F6schen charts_deleteChartText=Wollen Sie das Diagramm mit dem Parameter "{0}" wirklich l\u00F6schen? charts_deleteChart=Diagramm l\u00F6schen - # event_log.xhtml el_title=Log el_timestamp=Zeitpunkt el_message=Nachricht - # qualityreport_list.xhtml qr_title=Qualit\u00E4tsbericht qr_generation=Generieren @@ -148,7 +136,6 @@ qr_version=Version qr_consumedTime=Bisherige Laufzeit qr_remainingTime=Restlaufzeit qr_startTime=Startzeit - # job_list.xhtml jl_title=Geplante Aufgaben jl_info=Die folgende Liste zeigt diejenigen Aufgaben an, die regelm\u00E4\u00DFig ausgef\u00FChrt werden. Sie k\u00F6nnen die Ausf\u00FChrungszeiten hier anpassen. Sollten Sie Hilfe bzgl. des Formats ben\u00F6tigen, finden Sie diese z.B. auf http://www.cronmaker.com/ @@ -162,11 +149,9 @@ jl_fireNow=Jetzt starten jl_actions=Aktionen jl_suspend=Anhalten jl_resume=Fortsetzen - # rorList.xhtml ror_list=Registerverzeichnisliste ror_url=Adresse - # brokerList.xhtml bl_title=Suchbrokerliste bl_broker=Broker @@ -181,14 +166,12 @@ bl_emailRequiredMsg=Bitte Email Adresse eingeben bl_joinBtn=Beitreten bl_requestFullResultsTooltip=Wenn aktiviert, werden direkt nach der Anfrage, die Ergebnisdatens\u00E4tze vom lokalen Datenmanagement berechnet. Die kann mitunter viel Zeit in Anspruch nehmen. Daher kann es hilfreich sein, dies zu deaktivieren. Bei \u00E4lteren Versionen der REST-Schnittstelle kann unter Umst\u00E4nden die Option nicht deaktiviert werden, bl_requestFullResults=Erg. anfordern - # BrokerStatusType BS_UNREACHABLE=Unerreichbar BS_USER_UNKNOWN=Unbekannter Nutzer BS_AUTHENTICATION_ERROR=Anmeldung fehlgeschlagen BS_ACTIVATION_PENDING=Aktivierung steht aus BS_OK=OK - # userList.xhtml ul_title=Benutzerverwaltung ul_createNewUser=Neuen Benutzer anlegen @@ -203,7 +186,6 @@ ul_notifyBiomaterial=Per E-Mail bei Anfragen zu Biomaterial benachrichtigen ul_notifyClinicalData=Per E-Mail bei Anfragen zu klinischen Daten benachrichtigen ul_notifyPatients=Per E-Mail bei Anfragen zu Studienpatienten benachrichtigen ul_userNameExists=Username existiert bereits - # showInquiry.xhtml si_title=Suchanfrage anzeigen si_noDescription=Der Anfragesteller hat keinen Beschreibungstext eingegeben. @@ -248,7 +230,6 @@ si_actions=Aktionen si_noDocuments=Keine Dokumente angeh\u00E4ngt si_uploadedAt=Hochgeladen am si_noResults=Die Anfrage lieferte keine Ergebnisse - # inquiries_list.xhtml / archived-inquiries.xhtml / erroneous-inquiries.xhtml inqs_inquiriesActiveTitle=Aktive Suchanfragen inqs_inquiriesErroneousTitle=Fehlgeschlagene Suchanfragen @@ -266,7 +247,6 @@ inqs_noLabel=Unbenannte Anfrage inqs_errorCode=Fehlercode inqs_abandoned=Status\u00FCberpr\u00FCfung beendet inqs_processing=wird berechnet - # credentials_list.xhtml cl_title=Liste der Zugangsdaten cl_credentials=Zugangsdaten @@ -277,7 +257,6 @@ cl_credentialType=Art der Authentifizierung cl_addCredentials=Zugangsdaten hinzuf\u00FCgen cl_newUserNameRequiredMsg=Bitte Benutzernamen eingeben cl_newPasswordRequiredMsg=Bitte Passwort eingeben - # upload_list.xhtml ull_title=Uploads zur zentralen MDS Datenbank ull_manualUpload=Upload manuell ausf\u00FChren @@ -287,11 +266,9 @@ ull_triggeredBy=Gestartet von ull_status=Status ull_cancelUpload=Upload abbrechen ull_spawnUpload=Starten - # inquiry_handling.xhtml ih_title=Behandlung von Anfragen ih_autoReply=Automatisch antworten - # tests.xhtml tests_title=Funktionstests tests_check=Pr\u00FCfen @@ -310,11 +287,9 @@ tests_retrieveExportIdsDescription=Holt ein Exportpseudonym f\u00FCr eine gegebe tests_brokerCheckRetrieveAndExecuteTestInquiry=Testanfrage herunterladen und ausf\u00FChren tests_brokerCheckRetrieveAndExecuteTestInquiryDescription=L\u00E4dt eine einfache, vom Suchbroker generierte, Testanfrage herunter und schickt diese an das lokale Datenmanagement. test_localId=DKTK-Standort ID - # monitoring.xhtml mon_title=\u00DCbermittlung von Metadaten mon_info=Legen Sie fest, welche Telemetriedaten zu einer zentralen Monitoring Instanz \u00FCbermittelt werden. - # show_upload.xhtml su_events=Verlauf su_dryrun=Testlauf @@ -326,14 +301,12 @@ su_incremental=inkrementell su_full=komplett su_upload=Upload su_dktk=DKTK - # TargetTypes TT_CENTRALSEARCH=Zentrale Suche TT_HTTP_PROXY=HTTP Proxy TT_HTTPS_PROXY=HTTPS Proxy TT_LDM=Lokales Datenmanagement TT_BROKER=Suchbroker - # AuthSchemeTypes AS_APIKEY=Api Key AS_BASIC=Basic @@ -341,27 +314,24 @@ AS_SPNEGO=Simple and Protected GSSAPI Negotiation Mechanism AS_DIGEST=Digest AS_KERBEROS=Kerberos AS_NTLM=NT LAN Manager - # Reply Rule Types RR_NO_AUTOMATIC_ACTION=Keine automatischen Antworten RR_TOTAL_COUNT=Nur Anzahl RR_DATA=Patientendaten - # Operator List -IS_NOT_NULL = Ist vorhanden -IS_NULL = Ist nicht vorhanden -LIKE = Enth\u00E4lt -NOT_EQUAL_TO = Ungleich -LESS_THEN = Kleiner als -LESS_OR_EQUAL_THEN = Kleiner oder gleich -EQUAL = Gleich -GREATER_OR_EQUAL = Gr\u00F6\u00DFer oder gleich -GREATER = Gr\u00F6\u00DFer als -BETWEEN = Zwischen -IN = Eines von -AND = UND -OR = ODER - +IS_NOT_NULL=Ist vorhanden +IS_NULL=Ist nicht vorhanden +LIKE=Enth\u00E4lt +NOT_EQUAL_TO=Ungleich +LESS_THEN=Kleiner als +LESS_OR_EQUAL_THEN=Kleiner oder gleich +EQUAL=Gleich +GREATER_OR_EQUAL=Gr\u00F6\u00DFer oder gleich +GREATER=Gr\u00F6\u00DFer als +BETWEEN=Zwischen +IN=Eines von +AND=UND +OR=ODER # Session Timeout Modal session_runs_out=Ihre Session l\u00E4uft ab. session_runs_out_explain=Sie k\u00F6nnen die Session verl\u00E4ngern indem Sie auf den unten angezeigten Button klicken. Ansonsten werden Sie vom System nach Ablauf der Session automatisch abgemeldet. @@ -370,13 +340,11 @@ session_timeout_one=Session l\u00E4uft in session_timeout_one_under=unter session_timeout_two=Sekunden ab. session_timeout_two_min=Minuten ab. - # Confirm Upload of Patients without Consent Modal uploadWithLocalConsent_title=Bitte best\u00E4tigen uploadWithLocalConsent_content=Sie sind im Begriff das System so zu konfigurieren, dass der festgelegte und datensparsame MDS-K und MDS-B von Patienten in die zentrale MDS-Datenbank hochgeladen wird. Es werden keine Daten in die zentrale MDS-Datenbank hochgeladen, die eine eindeutige Identifikation erlauben. Vor der Aktivierung dieser Funktion sollte das Einverst\u00E4ndnis der zust\u00E4ndigen lokalen Gremien vorliegen. Wenn Sie sich nicht sicher sind, ob Sie dies aktivieren sollten, kontaktieren Sie bitte Ihren lokalen CCP-Koordinator oder das CCP-Office. Weitere Informationen finden Sie auch im uploadWithLocalConsent_linkText=Datenschutzkonzept der CCP-IT uploadWithLocalConsent_mayDelete=Sie k\u00F6nnen diese Einstellung jederzeit r\u00FCckg\u00E4ngig machen. - # Entity Types E_BIOMATERIAL=Biomaterial E_CLINICAL_DATA=Klinische Daten @@ -386,10 +354,8 @@ E_BIOMATERIAL_ABBR=bio E_CLINICAL_DATA_ABBR=klin. E_PATIENT_FOR_STUDY_ABBR=pat UNKNOWN_ABBR=unbek - # pleaseWaitModal.xhtml pwm.pleaseWait=Bitte warten... - # EVENT_LOG_MESSAGES E_SYSTEM_STARTUP=System gestartet E_SYSTEM_SHUTDOWN=System abgeschaltet @@ -425,7 +391,6 @@ E_NO_CREDENTIALS_CS=Keine Zugangsdaten f\u00FCr zentrale Suche eingetragen E_NO_PREVIOUS_UPLOADS=Keine vorhergehenden Uploads gefunden E_PREVIOUS_UPLOAD_AT=Vorheriger Upload am {0} E_CS_ERROR_LASTUPLOADTIMESTAMP=Statuscode {0} erhalten beim Versuch den Zeitpunkt des letzten Uploads zu ermitteln - # Shorter versions of the EVENT_LOG_MESSAGES for show_inquiry and show_upload E_NEW_INQUIRY_RECEIVED-SHORT=Vom Suchbroker erhalten E_NEW_INQUIRY_CREATED_FOR_UPLOAD-SHORT=Neue Suchanfrage erstellt @@ -458,11 +423,9 @@ E_NO_CREDENTIALS_CS-SHORT=Keine Zugangsdaten f\u00FCr zentrale Suche eingetragen E_NO_PREVIOUS_UPLOADS-SHORT=Keine vorhergehenden Uploads gefunden E_PREVIOUS_UPLOAD_AT-SHORT=Vorheriger Upload am {0} E_CS_ERROR_LASTUPLOADTIMESTAMP-SHORT=Statuscode {0} erhalten beim Versuch den Zeitpunkt des letzten Uploads zu ermitteln - # EnumValidationHandling NO_VALIDATION=Keine Validierung vornehmen. Das erzeugte Dokument kann deshalb Eintr\u00E4ge enthalten, die nicht konform zu den im MDR hinterlegten Validierungsinformationen sind. REMOVE_INVALID_ENTRIES=Werte, die nicht konform zu den im MDR hinterlegten Validierungsinformationen sind, werden nicht in das erzeugte Dokument aufgenommen. KEEP_INVALID_ENTRIES=Werte, die nicht konform zu den im MDR hinterlegten Validierungsinformationen sind, werden im erzeugten Dokument orange hinterlegt. - # Notification mails MAIL_NEW_INQUIRIES_SUBJECT=Neue Suchanfragen in Ihrem Teiler \ No newline at end of file diff --git a/src/main/java/de/samply/share/client/messages/messages_en.properties b/src/main/java/de/samply/share/client/messages/messages_en.properties index 5ef05a0f..ecde4983 100644 --- a/src/main/java/de/samply/share/client/messages/messages_en.properties +++ b/src/main/java/de/samply/share/client/messages/messages_en.properties @@ -16,28 +16,23 @@ common_passwordChanged=Password changed common_passwordChangeTitle=Change Password common_logout=Logout common_selectFile=Select file - ConfigurationController_configuration=Configuration ConfigurationController_configurationSaved=Configuration saved LoginController_loginFailedMessage=Login Data invalid LoginController_loginFailedTitle=Login error - # WebUtils WebUtils_caseDateYear=from the year WebUtils_caseDateUnknown=of unknown date - # Inquiry Status Enum IS_NEW=new IS_ARCHIVED=archived IS_PROCESSING=processing IS_LDM_ERROR=LDM connection error - # index.xhtml index_ldm=Local datamanagement index_idmanager=ID-Manager index_teiler=Samply Share index_unreachable=Unreachable - # configuration.xhtml configuration_title=Configuration configuration_manageCredentials=Manage credentials @@ -73,7 +68,6 @@ configuration_sendReferenceQueryTime=Send reference query execution time configuration_sendCentraxxMappingVersion=Send centraxx mapping script version configuration_misc=Misc configuration_mailNotifyEmptyResults=Include empty results in notification mail - configurationTimings=Timings configurationTimings_collectInquiriesInterval=Check for inquiries each configurationTimings_checkInquiryStatusInitialDelay=Initial delay between posting an inquiry and checking its status @@ -83,11 +77,9 @@ configurationTimings_checkInquiryStatusResultsRetryInterval=Delay between two at configurationTimings_checkInquiryStatusResultsRetryAttempts=Number of attempts to retrieve query result configurationTimings_parseException=Please enter an integer configurationTimings_archiveInquiries=Archive inquiries after - # c_loginPanel.xhtml loginPanel_login=Login loginPanel_doLogin=Login - # dashboard.xhtml dashboard_title=Dashboard dashboard_configuration=Configuration @@ -116,7 +108,6 @@ dashboard_inquiriesArchive=Archived inquiries dashboard_inquiriesArchiveDetails=inquiries currently archived dashboard_tests=Tests dashboard_testsDetails=Check the connectivity with other local components - # export.xhtml export_criteria=Export criteria export_dateConjunction=and @@ -124,7 +115,6 @@ pleaseWait=Please wait export_saveModalTitle=Save export definition export_setName=Please enter a name for saving the export definition: export_query=Search criteria - # chart*.xhtml charts_query=Patient search criteria charts_setName=Please enter a name for saving the chart group: @@ -133,12 +123,10 @@ charts_nofOccurences=Occurences in patients charts_deleteChartModalTitle=Remove chart charts_deleteChartText=Do you really want to remove the chart with item "{0}"? charts_deleteChart=Remove chart - # event_log.xhtml el_title=Log el_timestamp=Timestamp el_message=Message - # qualityreport_list.xhtml qr_title=Quality Report qr_generation=generate @@ -148,7 +136,6 @@ qr_version=version qr_consumedTime=Time consumed qr_remainingTime=Time remaining qr_startTime=Start time - # job_list.xhtml jl_title=Scheduled Jobs jl_info=The following list shows the jobs that are scheduled to be executed regularly. You can change the schedule here, but please do so with caution. If you need help generating cron expressions, check http://www.cronmaker.com/ @@ -162,11 +149,9 @@ jl_fireNow=Run now jl_actions=Actions jl_suspend=Suspend jl_resume=Resume - # rorList.xhtml ror_list=RoR list ror_url=Address - # brokerList.xhtml bl_title=List of Searchbrokers bl_broker=Broker @@ -181,14 +166,12 @@ bl_emailRequiredMsg=Please enter your email address bl_joinBtn=Join bl_requestFullResultsTooltip=When activated, local datamanagement will write all result datasets to the disk. This might be unwanted in some scenarios and can take a while. However, some older versions of the REST api of the local datamanagement might not support turning this off. bl_requestFullResults=Request Result - # BrokerStatusType BS_UNREACHABLE=Unreachable BS_USER_UNKNOWN=Unknown user BS_AUTHENTICATION_ERROR=Authentication error BS_ACTIVATION_PENDING=Activation pending BS_OK=OK - # userList.xhtml ul_title=User management ul_createNewUser=Create new user @@ -203,7 +186,6 @@ ul_notifyBiomaterial=Notify on new inquiries requesting biomaterial ul_notifyClinicalData=Notify on new inquiries requesting clinical data ul_notifyPatients=Notify on new inquiries requesting study patients ul_userNameExists=Username already existing - # showInquiry.xhtml si_title=Show inquiry si_noDescription=The inquirer has not entered any description text. @@ -248,7 +230,6 @@ si_actions=Actions si_noDocuments=No documents attached si_uploadedAt=Uploaded at si_noResults=No results found for inquiry - # inquiries_list.xhtml / archived-inquiries.xhtml / erroneous-inquiries.xhtml inqs_inquiriesActiveTitle=Active inquiries inqs_inquiriesErroneousTitle=Failed inquiries @@ -266,7 +247,6 @@ inqs_noLabel=Unnamed inquiry inqs_errorCode=Error Code inqs_abandoned=Timed out inqs_processing=processing - # credentials_list.xhtml cl_title=Credentials list cl_credentials=Credentials @@ -277,7 +257,6 @@ cl_credentialType=CredentialType cl_addCredentials=Add credentials cl_newUserNameRequiredMsg=Please enter the username cl_newPasswordRequiredMsg=Please enter the password - # upload_list.xhtml ull_title=Uploads to central mds database ull_manualUpload=Trigger Upload manually @@ -287,11 +266,9 @@ ull_triggeredBy=Triggered by ull_status=Status ull_cancelUpload=Cancel Upload Task ull_spawnUpload=Start - # inquiry_handling.xhtml ih_title=Inquiry Handling ih_autoReply=Automatic reply - # tests.xhtml tests_title=Connectivity Checks tests_check=Check @@ -310,11 +287,9 @@ tests_retrieveExportIdsDescription=Gets an export ID for a given DKTK site id. T tests_brokerCheckRetrieveAndExecuteTestInquiry=Retrieve and execute test inquiry tests_brokerCheckRetrieveAndExecuteTestInquiryDescription=Downloads a simple test inquiry that was generated by the searchbroker and posts it to the local datamanagement. test_localId=Local DKTK ID to check - # monitoring.xhtml mon_title=Reporting to central services mon_info=Control, which of the following telemetric data will be submitted to central monitoring services. - # show_upload.xhtml su_events=Events su_dryrun=Dryrun @@ -326,14 +301,12 @@ su_incremental=incremental su_full=complete su_upload=Upload su_dktk=DKTK - # TargetTypes TT_CENTRALSEARCH=Central Search TT_HTTP_PROXY=HTTP Proxy TT_HTTPS_PROXY=HTTPS Proxy TT_LDM=Local Datamanagement TT_BROKER=Searchbroker - # AuthSchemeTypes AS_APIKEY=Api Key AS_BASIC=Basic @@ -341,27 +314,24 @@ AS_SPNEGO=Simple and Protected GSSAPI Negotiation Mechanism AS_DIGEST=Digest AS_KERBEROS=Kerberos AS_NTLM=NT LAN Manager - # Reply Rule Types RR_NO_AUTOMATIC_ACTION=No automatic action RR_TOTAL_COUNT=Total Size RR_DATA=Patient data - # Operator List -IS_NOT_NULL = Is set -IS_NULL = Is not set -LIKE = Contains -NOT_EQUAL_TO = Not equal to -LESS_THEN = Less than -LESS_OR_EQUAL_THEN = Less or equal than -EQUAL = Equals -GREATER_OR_EQUAL = Greater or equal than -GREATER = Greater than -BETWEEN = Between -IN = One of -AND = AND -OR = OR - +IS_NOT_NULL=Is set +IS_NULL=Is not set +LIKE=Contains +NOT_EQUAL_TO=Not equal to +LESS_THEN=Less than +LESS_OR_EQUAL_THEN=Less or equal than +EQUAL=Equals +GREATER_OR_EQUAL=Greater or equal than +GREATER=Greater than +BETWEEN=Between +IN=One of +AND=AND +OR=OR # Session Timeout Modal session_runs_out=Your session is expiring. session_runs_out_explain=You can refresh the session by pressing the button below. You will be logged out automatically otherwise. @@ -370,13 +340,11 @@ session_timeout_one=Session expires in session_timeout_one_under=under session_timeout_two=seconds. session_timeout_two_min=minutes. - # Confirm Upload of Patients with local Consent Modal uploadWithLocalConsent_title=Please confirm this setting uploadWithLocalConsent_content=You are about to enable the upload of patients without consent to the central search database. Please be aware of the implications of this. If you are not sure whether to enable this or not, please contact your local dktk spokesperson. uploadWithLocalConsent_linkText=data protection concept of the CCP-IT uploadWithLocalConsent_mayDelete=You can revert this setting at any time. - # Entity Types E_BIOMATERIAL=Biomaterial E_CLINICAL_DATA=Clinical data @@ -386,10 +354,8 @@ E_BIOMATERIAL_ABBR=bio E_CLINICAL_DATA_ABBR=clin. E_PATIENT_FOR_STUDY_ABBR=pat UNKNOWN_ABBR=unkn - # pleaseWaitModal.xhtml pwm.pleaseWait=Please wait... - # EVENT_LOG_MESSAGES E_SYSTEM_STARTUP=System startup E_SYSTEM_SHUTDOWN=System shutdown @@ -425,7 +391,6 @@ E_NO_CREDENTIALS_CS=No credentials entered for central mds db E_NO_PREVIOUS_UPLOADS=No previous uploads found E_PREVIOUS_UPLOAD_AT=Previous upload at {0} E_CS_ERROR_LASTUPLOADTIMESTAMP=Got status code {0} while trying to get last upload timestamp - # Shorter versions of the EVENT_LOG_MESSAGES for show_inquiry and show_upload E_NEW_INQUIRY_RECEIVED-SHORT=Received from broker E_NEW_INQUIRY_CREATED_FOR_UPLOAD-SHORT=New inquiry created @@ -458,11 +423,9 @@ E_NO_CREDENTIALS_CS-SHORT=No credentials entered for central mds db E_NO_PREVIOUS_UPLOADS-SHORT=No previous uploads found E_PREVIOUS_UPLOAD_AT-SHORT=Previous upload at {0} E_CS_ERROR_LASTUPLOADTIMESTAMP-SHORT=Got status code {0} while trying to get last upload timestamp - # EnumValidationHandling NO_VALIDATION=Do not validate. The resulting document may contain entries that are not compliant with the permitted values in the MDR. REMOVE_INVALID_ENTRIES=Values that are not compliant with the permitted values in the MDR will be left out of the document. KEEP_INVALID_ENTRIES=Values that are not compliant with the permitted values in the MDR will be kept in the document and marked as such by orange background colour. - # Notification mails MAIL_NEW_INQUIRIES_SUBJECT=New inquiries in your samply share client \ No newline at end of file diff --git a/src/main/java/de/samply/share/client/model/EnumConfiguration.java b/src/main/java/de/samply/share/client/model/EnumConfiguration.java index 69722da4..004f0e19 100644 --- a/src/main/java/de/samply/share/client/model/EnumConfiguration.java +++ b/src/main/java/de/samply/share/client/model/EnumConfiguration.java @@ -54,7 +54,6 @@ public enum EnumConfiguration { QUALITY_REPORT_MAX_NUMBER_OF_PATIENT_IDS_TO_BE_SHOWN, QUALITY_REPORT_CENTRAXX_DATAELEMENTS_FILE, QUALITY_REPORT_CENTRAXX_VALUES_FILE, - QUALITY_REPORT_GENERAL_REHEARSAL_PRIORITATION_FILE, QUALITY_REPORT_IGNORED_DATAELEMENTS, QUALITY_REPORT_DIRECTORY, QUALITY_REPORT_LOCATION, diff --git a/src/main/java/de/samply/share/client/model/Inquiries.java b/src/main/java/de/samply/share/client/model/Inquiries.java index 349976e0..882fb98d 100644 --- a/src/main/java/de/samply/share/client/model/Inquiries.java +++ b/src/main/java/de/samply/share/client/model/Inquiries.java @@ -1,11 +1,11 @@ package de.samply.share.client.model; -import java.util.List; - import org.simpleframework.xml.Element; import org.simpleframework.xml.ElementList; import org.simpleframework.xml.Root; +import java.util.List; + /** * A collection of inquiry ids and revisions as read from a searchbroker */ diff --git a/src/main/java/de/samply/share/client/model/User.java b/src/main/java/de/samply/share/client/model/User.java index 79fe8d24..2c747638 100644 --- a/src/main/java/de/samply/share/client/model/User.java +++ b/src/main/java/de/samply/share/client/model/User.java @@ -27,10 +27,9 @@ */ package de.samply.share.client.model; -import java.io.Serializable; - import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; +import java.io.Serializable; /** * Holds user credentials diff --git a/src/main/java/de/samply/share/client/model/common/Bridgehead.java b/src/main/java/de/samply/share/client/model/common/Bridgehead.java index c0cccc0f..336118f7 100644 --- a/src/main/java/de/samply/share/client/model/common/Bridgehead.java +++ b/src/main/java/de/samply/share/client/model/common/Bridgehead.java @@ -2,11 +2,7 @@ package de.samply.share.client.model.common; import javax.annotation.Generated; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** diff --git a/src/main/java/de/samply/share/client/model/common/Operator.java b/src/main/java/de/samply/share/client/model/common/Operator.java index e82f0f46..ed4f236a 100644 --- a/src/main/java/de/samply/share/client/model/common/Operator.java +++ b/src/main/java/de/samply/share/client/model/common/Operator.java @@ -2,11 +2,7 @@ package de.samply.share.client.model.common; import javax.annotation.Generated; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; diff --git a/src/main/java/de/samply/share/client/model/common/Urls.java b/src/main/java/de/samply/share/client/model/common/Urls.java index cadb3b32..d07e0bac 100644 --- a/src/main/java/de/samply/share/client/model/common/Urls.java +++ b/src/main/java/de/samply/share/client/model/common/Urls.java @@ -2,11 +2,7 @@ package de.samply.share.client.model.common; import javax.annotation.Generated; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** diff --git a/src/main/java/de/samply/share/client/model/graphData/AgeDistribution.java b/src/main/java/de/samply/share/client/model/graphData/AgeDistribution.java index 5148c217..5db8caf5 100644 --- a/src/main/java/de/samply/share/client/model/graphData/AgeDistribution.java +++ b/src/main/java/de/samply/share/client/model/graphData/AgeDistribution.java @@ -28,8 +28,8 @@ package de.samply.share.client.model.graphData; -import java.util.TreeMap; import java.util.Map; +import java.util.TreeMap; public class AgeDistribution { private Map data; diff --git a/src/main/java/de/samply/share/client/model/graphData/GenderDistribution.java b/src/main/java/de/samply/share/client/model/graphData/GenderDistribution.java index 2391c833..2bb88490 100644 --- a/src/main/java/de/samply/share/client/model/graphData/GenderDistribution.java +++ b/src/main/java/de/samply/share/client/model/graphData/GenderDistribution.java @@ -28,8 +28,8 @@ package de.samply.share.client.model.graphData; -import java.util.TreeMap; import java.util.Map; +import java.util.TreeMap; public class GenderDistribution { private Map data; diff --git a/src/main/java/de/samply/share/client/model/line/EventLogLine.java b/src/main/java/de/samply/share/client/model/line/EventLogLine.java index c628c298..fa7f05c8 100644 --- a/src/main/java/de/samply/share/client/model/line/EventLogLine.java +++ b/src/main/java/de/samply/share/client/model/line/EventLogLine.java @@ -29,7 +29,6 @@ package de.samply.share.client.model.line; import com.google.common.base.Joiner; -import com.google.common.base.Splitter; import com.google.gson.Gson; import de.samply.share.client.messages.Messages; import de.samply.share.client.model.EventLogEntityTypes; diff --git a/src/main/java/de/samply/share/client/quality/report/centraxx/CentraXxMapper.java b/src/main/java/de/samply/share/client/quality/report/centraxx/CentraXxMapper.java index 4c7be5fb..67960db3 100644 --- a/src/main/java/de/samply/share/client/quality/report/centraxx/CentraXxMapper.java +++ b/src/main/java/de/samply/share/client/quality/report/centraxx/CentraXxMapper.java @@ -30,6 +30,5 @@ public interface CentraXxMapper { public String getCentraXxAttribute (MdrIdDatatype mdrId); public String getCentraXxValue (MdrIdDatatype mdrId, String mdrValue); - public String getGeneralRehearsalPriorization (MdrIdDatatype mdrId); } diff --git a/src/main/java/de/samply/share/client/quality/report/centraxx/CentraXxMapperImpl.java b/src/main/java/de/samply/share/client/quality/report/centraxx/CentraXxMapperImpl.java index 596c649c..96859f99 100644 --- a/src/main/java/de/samply/share/client/quality/report/centraxx/CentraXxMapperImpl.java +++ b/src/main/java/de/samply/share/client/quality/report/centraxx/CentraXxMapperImpl.java @@ -24,9 +24,9 @@ * permission to convey the resulting work. */ -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.model.EnumConfiguration; import de.samply.share.client.util.db.ConfigurationUtil; +import de.samply.share.common.utils.MdrIdDatatype; import java.io.*; import java.nio.charset.StandardCharsets; @@ -37,13 +37,11 @@ public class CentraXxMapperImpl implements CentraXxMapper{ private Map centraXxDataElements = new HashMap<>(); private Map centraXxAttributeValues = new HashMap<>(); - private GeneralRehearsalPriorization generalRehearsalPriorization = new GeneralRehearsalPriorization(); public CentraXxMapperImpl() throws CentraXxMapperException { loadCentraXxDataelements(); loadCentraXxValues(); - loadGeneralRehearsalPriorization(); } @@ -60,79 +58,74 @@ public String getCentraXxValue(MdrIdDatatype mdrId, String mdrValue) { } - @Override - public String getGeneralRehearsalPriorization(MdrIdDatatype mdrId) { - return generalRehearsalPriorization.getPriorization(mdrId); - } - - private void loadCentraXxDataelements() throws CentraXxMapperException { - FilenameReader filenameReader = () -> getConfigurationFilename(EnumConfiguration.QUALITY_REPORT_CENTRAXX_DATAELEMENTS_FILE); - LineLoader lineLoader = (line) -> loadLineOfCentraXxDataElements(line); - - load (filenameReader, lineLoader); + File file = getCentraXxDataelementsFile(); + loadCentraXxDataelements(file); } - private void loadCentraXxValues() throws CentraXxMapperException { + private void loadCentraXxDataelements(File file) throws CentraXxMapperException { - FilenameReader filenameReader = () -> getConfigurationFilename(EnumConfiguration.QUALITY_REPORT_CENTRAXX_VALUES_FILE); - LineLoader lineLoader = (line) -> loadLineOfCentraXxValues(line); + try(BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8))){ - load (filenameReader, lineLoader); + loadCentraXxDataelements(bufferedReader); + + } catch (IOException e) { + throw new CentraXxMapperException(e); + } } - private void loadGeneralRehearsalPriorization() throws CentraXxMapperException { + private void loadCentraXxDataelements(BufferedReader bufferedReader) throws IOException { - FilenameReader filenameReader = () -> getConfigurationFilename(EnumConfiguration.QUALITY_REPORT_GENERAL_REHEARSAL_PRIORITATION_FILE); - LineLoader lineLoader = (line) -> loadLineOfRehearsalPriorization(line); + String line = null; - load (filenameReader, lineLoader); + while ((line = bufferedReader.readLine()) != null){ + loadLineOfCentraXxDataElements(line); + } } - private void load (FilenameReader filenameReader, LineLoader loader) throws CentraXxMapperException { - - File file = getFile(filenameReader); - load(file, loader); + private void loadLineOfCentraXxDataElements(String line){ - } + String[] split = line.split("\t"); - private void load (File file, LineLoader lineLoader)throws CentraXxMapperException { + if (split.length >= 2){ - try(BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8))){ + String mdrId = split[0]; + String dataElement = split[1]; - load(bufferedReader, lineLoader); + putDataElement(mdrId, dataElement); - } catch (IOException e) { - throw new CentraXxMapperException(e); } - } - private void load (BufferedReader bufferedReader, LineLoader lineLoader) throws IOException { - - String line = null; + private void putDataElement(String mdrId, String dataElement){ - while ((line = bufferedReader.readLine()) != null){ - lineLoader.load(line); + String oldDataElement = centraXxDataElements.get(mdrId); + if (oldDataElement != null){ + dataElement = addElement(oldDataElement, dataElement); } + centraXxDataElements.put(mdrId, dataElement); } - private interface FilenameReader{ - public String getFilename(); - } + private String addElement (String oldElement, String newElement){ + + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(oldElement); + stringBuilder.append(" | "); + stringBuilder.append(newElement); + + return stringBuilder.toString(); - private interface LineLoader { - public void load(String line); } - private File getFile(FilenameReader filenameReader) throws CentraXxMapperException { - String filename = filenameReader.getFilename(); + private File getCentraXxDataelementsFile() throws CentraXxMapperException { + + String filename = getCentraXxDataelementsFilename(); return getConfigFile(filename); } @@ -150,42 +143,44 @@ private File getConfigFile (String filename) throws CentraXxMapperException { } - private String getConfigurationFilename (EnumConfiguration enumConfigurationFilename){ - return ConfigurationUtil.getConfigurationElementValue(enumConfigurationFilename); + private String getCentraXxDataelementsFilename(){ + return ConfigurationUtil.getConfigurationElementValue(EnumConfiguration.QUALITY_REPORT_CENTRAXX_DATAELEMENTS_FILE); } - private void loadLineOfCentraXxDataElements(String line){ + private void loadCentraXxValues() throws CentraXxMapperException { - String[] split = line.split("\t"); + File file = getCentraXxValuesFile(); + loadCentraXxValues(file); - if (split.length >= 2){ + } - String mdrId = split[0]; - String dataElement = split[1]; + private File getCentraXxValuesFile() throws CentraXxMapperException { - putDataElement(mdrId, dataElement); + String filename = getCentraXxValuesFilename(); + return getConfigFile(filename); - } } - private void putDataElement(String mdrId, String dataElement){ - String oldDataElement = centraXxDataElements.get(mdrId); - if (oldDataElement != null){ - dataElement = addElement(oldDataElement, dataElement); + private void loadCentraXxValues(File file) throws CentraXxMapperException { + + try(BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8))){ + + loadCentraXxValues(bufferedReader); + + } catch (IOException e) { + throw new CentraXxMapperException(e); } - centraXxDataElements.put(mdrId, dataElement); } - private String addElement (String oldElement, String newElement){ + private void loadCentraXxValues(BufferedReader bufferedReader) throws IOException { - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append(oldElement); - stringBuilder.append(" | "); - stringBuilder.append(newElement); + String line = null; - return stringBuilder.toString(); + while ((line = bufferedReader.readLine()) != null){ + loadLineOfCentraXxValues(line); + } } @@ -217,20 +212,9 @@ private void putValue (AttributeValueKey attributeValueKey, String value){ centraXxAttributeValues.put(attributeValueKey, value); } - private void loadLineOfRehearsalPriorization(String line) { - - String[] split = line.split(";"); - - if (split.length >= 2){ - - String mdrIdKey = split[0]; - String priorization = split[1]; - - generalRehearsalPriorization.setPriorization(mdrIdKey, priorization); - - } + private String getCentraXxValuesFilename(){ + return ConfigurationUtil.getConfigurationElementValue(EnumConfiguration.QUALITY_REPORT_CENTRAXX_VALUES_FILE); } - } diff --git a/src/main/java/de/samply/share/client/quality/report/chain/ChainLinkContext.java b/src/main/java/de/samply/share/client/quality/report/chain/ChainLinkContext.java index 947f4b4d..20e4f2f7 100644 --- a/src/main/java/de/samply/share/client/quality/report/chain/ChainLinkContext.java +++ b/src/main/java/de/samply/share/client/quality/report/chain/ChainLinkContext.java @@ -24,8 +24,6 @@ * permission to convey the resulting work. */ -import de.samply.share.model.ccp.QueryResult; -import de.samply.share.model.common.View; import de.samply.share.client.quality.report.chainlinks.ChainLinkItem; import de.samply.share.client.quality.report.chainlinks.instances.file.FileContext; import de.samply.share.client.quality.report.chainlinks.instances.ignoredelements.QualityResultsContext; @@ -36,6 +34,8 @@ import de.samply.share.client.quality.report.chainlinks.instances.view.ViewsContext; import de.samply.share.client.quality.report.results.QualityResults; import de.samply.share.client.quality.report.results.QualityResultsImpl; +import de.samply.share.model.ccp.QueryResult; +import de.samply.share.model.common.View; import java.util.List; diff --git a/src/main/java/de/samply/share/client/quality/report/chain/factory/QualityReportChainFactory.java b/src/main/java/de/samply/share/client/quality/report/chain/factory/QualityReportChainFactory.java index cf3f7387..b18279ca 100644 --- a/src/main/java/de/samply/share/client/quality/report/chain/factory/QualityReportChainFactory.java +++ b/src/main/java/de/samply/share/client/quality/report/chain/factory/QualityReportChainFactory.java @@ -26,11 +26,10 @@ import de.samply.share.client.quality.report.MdrIgnoredElements; -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.chain.Chain; -import de.samply.share.client.quality.report.chain.finalizer.ChainFinalizer; -import de.samply.share.client.quality.report.chain.QualityReportChain; import de.samply.share.client.quality.report.chain.ChainParameters; +import de.samply.share.client.quality.report.chain.QualityReportChain; +import de.samply.share.client.quality.report.chain.finalizer.ChainFinalizer; import de.samply.share.client.quality.report.chainlinks.statistics.factory.ChainLinkStatisticsFactory; import de.samply.share.client.quality.report.chainlinks.timer.factory.ChainLinkTimerFactory; import de.samply.share.client.quality.report.file.manager.CsvQualityReportFileManager; @@ -44,8 +43,6 @@ import de.samply.share.client.quality.report.results.operations.QualityResultsValidator; import de.samply.share.client.quality.report.views.ViewsCreator; -import java.util.List; - public class QualityReportChainFactory implements ChainFactory { diff --git a/src/main/java/de/samply/share/client/quality/report/chain/factory/QualityReportChainFactory_002.java b/src/main/java/de/samply/share/client/quality/report/chain/factory/QualityReportChainFactory_002.java index d699e3b7..b2208308 100644 --- a/src/main/java/de/samply/share/client/quality/report/chain/factory/QualityReportChainFactory_002.java +++ b/src/main/java/de/samply/share/client/quality/report/chain/factory/QualityReportChainFactory_002.java @@ -32,10 +32,8 @@ import de.samply.common.mdrclient.MdrConnectionException; import de.samply.common.mdrclient.MdrInvalidResponseException; import de.samply.share.client.control.ApplicationBean; -import de.samply.share.client.quality.report.MdrIgnoredElements; -import de.samply.share.client.quality.report.properties.PropertyUtils; -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.model.EnumConfiguration; +import de.samply.share.client.quality.report.MdrIgnoredElements; import de.samply.share.client.quality.report.centraxx.CentraXxMapper; import de.samply.share.client.quality.report.centraxx.CentraXxMapperException; import de.samply.share.client.quality.report.centraxx.CentraXxMapperImpl; @@ -64,6 +62,7 @@ import de.samply.share.client.quality.report.model.mdr.MdrConnectionFactoryException; import de.samply.share.client.quality.report.model.reader.ModelReader; import de.samply.share.client.quality.report.model.reader.QualityReportModelReaderImpl; +import de.samply.share.client.quality.report.properties.PropertyUtils; import de.samply.share.client.quality.report.results.operations.QualityResultsAnalyzer; import de.samply.share.client.quality.report.results.operations.QualityResultsValidator; import de.samply.share.client.quality.report.views.ViewsCreator; @@ -71,6 +70,7 @@ import de.samply.share.client.quality.report.views.fromto.scheduler.ViewFromToScheduler; import de.samply.share.client.quality.report.views.fromto.scheduler.ViewFromToSchedulerFactory; import de.samply.share.client.util.db.ConfigurationUtil; +import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.common.utils.QueryValidator; import de.samply.web.mdrFaces.MdrContext; diff --git a/src/main/java/de/samply/share/client/quality/report/chainlinks/LdmChainLink.java b/src/main/java/de/samply/share/client/quality/report/chainlinks/LdmChainLink.java index b1dad0bd..3e5f8bed 100644 --- a/src/main/java/de/samply/share/client/quality/report/chainlinks/LdmChainLink.java +++ b/src/main/java/de/samply/share/client/quality/report/chainlinks/LdmChainLink.java @@ -24,9 +24,9 @@ * permission to convey the resulting work. */ -import de.samply.share.model.common.Error; import de.samply.share.client.quality.report.localdatamanagement.LocalDataManagementRequester; import de.samply.share.client.quality.report.localdatamanagement.LocalDataManagementResponse; +import de.samply.share.model.common.Error; public abstract class LdmChainLink extends ChainLink { diff --git a/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/file/QualityReportFileWriter_ChainLink.java b/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/file/QualityReportFileWriter_ChainLink.java index 8843dffa..8d3db36e 100644 --- a/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/file/QualityReportFileWriter_ChainLink.java +++ b/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/file/QualityReportFileWriter_ChainLink.java @@ -29,8 +29,8 @@ import de.samply.share.client.quality.report.chainlinks.ChainLinkException; import de.samply.share.client.quality.report.chainlinks.ChainLinkItem; import de.samply.share.client.quality.report.chainlinks.instances.validator.ValidatorContext; -import de.samply.share.client.quality.report.file.manager.QualityReportFileManagerException; import de.samply.share.client.quality.report.file.manager.QualityReportFileManager; +import de.samply.share.client.quality.report.file.manager.QualityReportFileManagerException; import de.samply.share.client.quality.report.results.QualityResults; public class QualityReportFileWriter_ChainLink extends ChainLink { diff --git a/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/ignoredelements/IgnoredElements_ChainLink.java b/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/ignoredelements/IgnoredElements_ChainLink.java index 46db013d..6340dd0a 100644 --- a/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/ignoredelements/IgnoredElements_ChainLink.java +++ b/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/ignoredelements/IgnoredElements_ChainLink.java @@ -27,13 +27,13 @@ import de.samply.common.mdrclient.domain.PermissibleValue; import de.samply.common.mdrclient.domain.Validations; import de.samply.share.client.quality.report.MdrIgnoredElements; -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.chainlinks.ChainLink; import de.samply.share.client.quality.report.chainlinks.ChainLinkException; import de.samply.share.client.quality.report.chainlinks.ChainLinkItem; import de.samply.share.client.quality.report.model.searcher.ModelSearcher; import de.samply.share.client.quality.report.results.QualityResult; import de.samply.share.client.quality.report.results.QualityResults; +import de.samply.share.common.utils.MdrIdDatatype; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/result/GetResults_ChainLink.java b/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/result/GetResults_ChainLink.java index 68f43fac..bb361a62 100644 --- a/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/result/GetResults_ChainLink.java +++ b/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/result/GetResults_ChainLink.java @@ -25,13 +25,13 @@ */ -import de.samply.share.model.ccp.QueryResult; import de.samply.share.client.quality.report.chainlinks.ChainLinkException; import de.samply.share.client.quality.report.chainlinks.ChainLinkItem; import de.samply.share.client.quality.report.chainlinks.LdmChainLink; import de.samply.share.client.quality.report.localdatamanagement.LocalDataManagementRequester; import de.samply.share.client.quality.report.localdatamanagement.LocalDataManagementRequesterException; import de.samply.share.client.quality.report.localdatamanagement.LocalDataManagementResponse; +import de.samply.share.model.ccp.QueryResult; public class GetResults_ChainLink extends LdmChainLink { diff --git a/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/validator/GetResults_To_Validator_Connector.java b/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/validator/GetResults_To_Validator_Connector.java index eb771b05..34c147c8 100644 --- a/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/validator/GetResults_To_Validator_Connector.java +++ b/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/validator/GetResults_To_Validator_Connector.java @@ -24,13 +24,13 @@ * permission to convey the resulting work. */ -import de.samply.share.model.ccp.QueryResult; import de.samply.share.client.quality.report.chainlinks.ChainLink; import de.samply.share.client.quality.report.chainlinks.ChainLinkItem; import de.samply.share.client.quality.report.chainlinks.connector.ChainLinkConnectorFunnel; import de.samply.share.client.quality.report.chainlinks.instances.result.ResultContext; import de.samply.share.client.quality.report.results.QualityResults; import de.samply.share.client.quality.report.results.operations.QualityResultsAnalyzer; +import de.samply.share.model.ccp.QueryResult; public class GetResults_To_Validator_Connector extends ChainLinkConnectorFunnel { diff --git a/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/view/CreateViews_ChainLink.java b/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/view/CreateViews_ChainLink.java index f9fa164c..f50ad0a8 100644 --- a/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/view/CreateViews_ChainLink.java +++ b/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/view/CreateViews_ChainLink.java @@ -24,12 +24,12 @@ * permission to convey the resulting work. */ -import de.samply.share.model.common.View; import de.samply.share.client.quality.report.chainlinks.ChainLink; import de.samply.share.client.quality.report.chainlinks.ChainLinkException; import de.samply.share.client.quality.report.chainlinks.ChainLinkItem; import de.samply.share.client.quality.report.model.Model; import de.samply.share.client.quality.report.views.ViewsCreator; +import de.samply.share.model.common.View; import java.util.List; diff --git a/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/view/CreateViews_To_PostView_Connector.java b/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/view/CreateViews_To_PostView_Connector.java index 93efccda..4691c4a9 100644 --- a/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/view/CreateViews_To_PostView_Connector.java +++ b/src/main/java/de/samply/share/client/quality/report/chainlinks/instances/view/CreateViews_To_PostView_Connector.java @@ -24,10 +24,10 @@ * permission to convey the resulting work. */ -import de.samply.share.model.common.View; import de.samply.share.client.quality.report.chainlinks.ChainLink; import de.samply.share.client.quality.report.chainlinks.ChainLinkItem; import de.samply.share.client.quality.report.chainlinks.connector.ChainLinkConnector; +import de.samply.share.model.common.View; public class CreateViews_To_PostView_Connector extends ChainLinkConnector { diff --git a/src/main/java/de/samply/share/client/quality/report/faces/QualityReportFileInfoManagerImpl.java b/src/main/java/de/samply/share/client/quality/report/faces/QualityReportFileInfoManagerImpl.java index 66ccf683..0387b031 100644 --- a/src/main/java/de/samply/share/client/quality/report/faces/QualityReportFileInfoManagerImpl.java +++ b/src/main/java/de/samply/share/client/quality/report/faces/QualityReportFileInfoManagerImpl.java @@ -25,14 +25,12 @@ */ import de.samply.share.client.model.EnumConfiguration; -import de.samply.share.client.quality.report.file.id.filename.QualityReportFilenameFormat; import de.samply.share.client.quality.report.file.id.path.IdPathManager; import de.samply.share.client.quality.report.file.manager.QualityReportMetadataFileManager; import de.samply.share.client.quality.report.file.metadata.QualityReportMetadata; import de.samply.share.client.util.db.ConfigurationUtil; import org.apache.commons.io.FilenameUtils; - import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.*; diff --git a/src/main/java/de/samply/share/client/quality/report/file/csvline/manager/QualityResultCsvLineManager.java b/src/main/java/de/samply/share/client/quality/report/file/csvline/manager/QualityResultCsvLineManager.java index 232368d2..64343c43 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/csvline/manager/QualityResultCsvLineManager.java +++ b/src/main/java/de/samply/share/client/quality/report/file/csvline/manager/QualityResultCsvLineManager.java @@ -24,10 +24,10 @@ * permission to convey the resulting work. */ -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.file.id.filename.QualityReportFilePattern; import de.samply.share.client.quality.report.results.QualityResult; import de.samply.share.client.quality.report.results.QualityResults; +import de.samply.share.common.utils.MdrIdDatatype; public interface QualityResultCsvLineManager extends QualityReportFilePattern{ diff --git a/src/main/java/de/samply/share/client/quality/report/file/csvline/manager/QualityResultCsvLineManagerImpl_Test1.java b/src/main/java/de/samply/share/client/quality/report/file/csvline/manager/QualityResultCsvLineManagerImpl_Test1.java index b9e24229..e7e3b9c9 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/csvline/manager/QualityResultCsvLineManagerImpl_Test1.java +++ b/src/main/java/de/samply/share/client/quality/report/file/csvline/manager/QualityResultCsvLineManagerImpl_Test1.java @@ -30,12 +30,12 @@ import de.samply.common.mdrclient.domain.Definition; import de.samply.common.mdrclient.domain.Record; import de.samply.common.mdrclient.domain.Validations; -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.file.csvline.PatientDataCsvLinePattern_Test1; import de.samply.share.client.quality.report.model.Model; import de.samply.share.client.quality.report.model.searcher.ModelSearcher; import de.samply.share.client.quality.report.results.QualityResult; import de.samply.share.client.quality.report.results.QualityResults; +import de.samply.share.common.utils.MdrIdDatatype; import java.util.ArrayList; import java.util.HashMap; diff --git a/src/main/java/de/samply/share/client/quality/report/file/csvline/manager/QualityResultCsvLineManager_002.java b/src/main/java/de/samply/share/client/quality/report/file/csvline/manager/QualityResultCsvLineManager_002.java index 4d9ae99b..e9e12226 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/csvline/manager/QualityResultCsvLineManager_002.java +++ b/src/main/java/de/samply/share/client/quality/report/file/csvline/manager/QualityResultCsvLineManager_002.java @@ -24,10 +24,10 @@ * permission to convey the resulting work. */ -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.file.csvline.CsvLine_002; import de.samply.share.client.quality.report.results.QualityResult; import de.samply.share.client.quality.report.results.QualityResults; +import de.samply.share.common.utils.MdrIdDatatype; public class QualityResultCsvLineManager_002 implements QualityResultCsvLineManager { diff --git a/src/main/java/de/samply/share/client/quality/report/file/downloader/FileDownloader.java b/src/main/java/de/samply/share/client/quality/report/file/downloader/FileDownloader.java index 945c5e32..45ef5e41 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/downloader/FileDownloader.java +++ b/src/main/java/de/samply/share/client/quality/report/file/downloader/FileDownloader.java @@ -24,8 +24,6 @@ * permission to convey the resulting work. */ -import java.net.Proxy; - public interface FileDownloader { public void download() throws FileDownloaderException; diff --git a/src/main/java/de/samply/share/client/quality/report/file/downloader/ProxyFactoryImpl.java b/src/main/java/de/samply/share/client/quality/report/file/downloader/ProxyFactoryImpl.java index fc1f23d8..a1d9d42c 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/downloader/ProxyFactoryImpl.java +++ b/src/main/java/de/samply/share/client/quality/report/file/downloader/ProxyFactoryImpl.java @@ -24,17 +24,7 @@ * permission to convey the resulting work. */ -import de.samply.common.http.HttpConnector; -import de.samply.share.client.control.ApplicationBean; -import org.apache.http.HttpHost; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; - -import java.io.IOException; -import java.net.InetSocketAddress; import java.net.Proxy; -import java.net.SocketAddress; -import java.net.URL; public class ProxyFactoryImpl implements ProxyFactory { diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/cell/element/ExcelCellElement.java b/src/main/java/de/samply/share/client/quality/report/file/excel/cell/element/ExcelCellElement.java index 37d565bd..1550c1e1 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/cell/element/ExcelCellElement.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/cell/element/ExcelCellElement.java @@ -60,8 +60,4 @@ public void setExcelCellStyle(ExcelCellStyle excelCellStyle) { this.excelCellStyle = excelCellStyle; } - protected String convertElementToString(){ - return element.toString(); - } - } diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/cell/element/IntegerExcelCellElement.java b/src/main/java/de/samply/share/client/quality/report/file/excel/cell/element/IntegerExcelCellElement.java index 7e990489..0f73909f 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/cell/element/IntegerExcelCellElement.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/cell/element/IntegerExcelCellElement.java @@ -40,5 +40,4 @@ protected Cell setCellValue(Cell cell) { } - } diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/cell/element/LinkExcelCellElement.java b/src/main/java/de/samply/share/client/quality/report/file/excel/cell/element/LinkExcelCellElement.java index 523981bc..a6bdc8c9 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/cell/element/LinkExcelCellElement.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/cell/element/LinkExcelCellElement.java @@ -29,27 +29,23 @@ import org.apache.poi.ss.usermodel.CreationHelper; import org.apache.poi.ss.usermodel.Hyperlink; -public class LinkExcelCellElement extends ExcelCellElement { - - private String link; +public class LinkExcelCellElement extends ExcelCellElement { + private String title; protected HyperlinkType getHyperlinkType (){ return HyperlinkType.URL; } - public LinkExcelCellElement(String link, T element) { - super(element); - this.link = link; + public LinkExcelCellElement(String link, String title) { + super(link); + this.title = title; } @Override protected Cell setCellValue(Cell cell) { Hyperlink link = createHyperlink(cell); - - String title = convertElementToString(); - cell.setHyperlink(link); cell.setCellValue(title); @@ -60,10 +56,10 @@ protected Cell setCellValue(Cell cell) { private Hyperlink createHyperlink(Cell cell){ CreationHelper creationHelper = cell.getSheet().getWorkbook().getCreationHelper(); - Hyperlink hyperlink = creationHelper.createHyperlink(getHyperlinkType()); - hyperlink.setAddress(link); + Hyperlink link = creationHelper.createHyperlink(getHyperlinkType()); + link.setAddress(element); - return hyperlink; + return link; } diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/cell/element/MatchExcelCellElement.java b/src/main/java/de/samply/share/client/quality/report/file/excel/cell/element/MatchExcelCellElement.java index cfa94ba5..b167e0cf 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/cell/element/MatchExcelCellElement.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/cell/element/MatchExcelCellElement.java @@ -26,20 +26,51 @@ import org.apache.poi.ss.usermodel.Cell; -public class MatchExcelCellElement extends ExcelCellElement { +public class MatchExcelCellElement extends ExcelCellElement { - public MatchExcelCellElement(MatchElement element) { + public final static String MATCH = "match"; + public final static String MISMATCH = "mismatch"; + public final static String NOT_MAPPED = "not mapped"; + public final static String NOT_FOUND = "not found"; + + private boolean isNotMapped = false; + private int numberOfElements = 0; + + + public MatchExcelCellElement(Boolean element, int numberOfElements) { super(element); + this.numberOfElements = numberOfElements; } @Override protected Cell setCellValue(Cell cell) { - String value = convertElementToString(); + String value = getCellValue(element); cell.setCellValue(value); return cell; } + private String getCellValue (boolean element){ + + String result = null; + + if (isNotMapped){ + result = NOT_MAPPED; + } else if (numberOfElements <= 0){ + result = NOT_FOUND; + } else if (element){ + result = MATCH; + } else{ + result = MISMATCH; + } + + return result; + + } + + public void setNotMapped() { + isNotMapped = true; + } } diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/cell/reference/CellReferenceExcelCellElement.java b/src/main/java/de/samply/share/client/quality/report/file/excel/cell/reference/CellReferenceExcelCellElement.java index 1964349f..fd67a1ee 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/cell/reference/CellReferenceExcelCellElement.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/cell/reference/CellReferenceExcelCellElement.java @@ -27,15 +27,15 @@ import de.samply.share.client.quality.report.file.excel.cell.element.LinkExcelCellElement; import org.apache.poi.common.usermodel.HyperlinkType; -public class CellReferenceExcelCellElement extends LinkExcelCellElement { +public class CellReferenceExcelCellElement extends LinkExcelCellElement { @Override protected HyperlinkType getHyperlinkType() { return HyperlinkType.DOCUMENT; } - public CellReferenceExcelCellElement(CellReference cellReference, T element) { - super(cellReference.getLink(), element); + public CellReferenceExcelCellElement(CellReference cellReference, String title) { + super(cellReference.getLink(), title); } } diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/cell/style/ExcelCellStyleImpl.java b/src/main/java/de/samply/share/client/quality/report/file/excel/cell/style/ExcelCellStyleImpl.java index 530259db..a926ccd1 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/cell/style/ExcelCellStyleImpl.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/cell/style/ExcelCellStyleImpl.java @@ -32,10 +32,8 @@ public class ExcelCellStyleImpl implements ExcelCellStyle { @Override public void addCellStyle(Cell cell) { - - CellStyle cellStyle = cell.getSheet().getWorkbook().createCellStyle(); + CellStyle cellStyle = (cell.getCellStyle() != null) ? cell.getCellStyle() : cell.getSheet().getWorkbook().createCellStyle(); cell.setCellStyle(cellStyle); - } } diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/instances/basic/BasicExcelRowElements.java b/src/main/java/de/samply/share/client/quality/report/file/excel/instances/basic/BasicExcelRowElements.java index 1c019ac1..eac66d72 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/instances/basic/BasicExcelRowElements.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/instances/basic/BasicExcelRowElements.java @@ -29,7 +29,6 @@ import de.samply.share.client.quality.report.file.excel.cell.element.StringExcelCellElement; import de.samply.share.client.quality.report.file.excel.row.elements.ExcelRowElements; - import java.util.List; diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/instances/patientids/PatientIdsExcelRowContext.java b/src/main/java/de/samply/share/client/quality/report/file/excel/instances/patientids/PatientIdsExcelRowContext.java index aef9050f..085bed98 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/instances/patientids/PatientIdsExcelRowContext.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/instances/patientids/PatientIdsExcelRowContext.java @@ -24,7 +24,6 @@ * permission to convey the resulting work. */ -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.model.EnumConfiguration; import de.samply.share.client.quality.report.file.excel.instances.basic.BasicExcelColumnMetaInfo; import de.samply.share.client.quality.report.file.excel.instances.basic.BasicExcelRowElements; @@ -33,8 +32,12 @@ import de.samply.share.client.quality.report.results.QualityResult; import de.samply.share.client.quality.report.results.sorted.AlphabeticallySortedMismatchedQualityResults; import de.samply.share.client.util.db.ConfigurationUtil; +import de.samply.share.common.utils.MdrIdDatatype; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; public abstract class PatientIdsExcelRowContext implements ExcelRowContext { diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/instances/statistics/dataelementstats/DataElementStats_ExcelRowElements.java b/src/main/java/de/samply/share/client/quality/report/file/excel/instances/statistics/dataelementstats/DataElementStats_ExcelRowElements.java index e996d872..3d1e0c24 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/instances/statistics/dataelementstats/DataElementStats_ExcelRowElements.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/instances/statistics/dataelementstats/DataElementStats_ExcelRowElements.java @@ -43,11 +43,7 @@ public enum ELEMENT_ORDER { PERCENTAGE_OF_PATIENTS_WITH_MATCH_ONLY_FOR_DATA_ELEMENT_OUT_OF_TOTAL_PATIENTS ("% of patients - total"), NUMBER_OF_PATIENTS_WITH_ANY_MISMATCH_FOR_DATA_ELEMENT ("Number of patients with any mismatch"), PERCENTAGE_OF_PATIENTS_WITH_ANY_MISMATCH_FOR_DATA_ELEMENT_OUT_OF_PATIENTS_WITH_DATA_ELEMENT ("% of patients with entry for this element"), - PERCENTAGE_OF_PATIENTS_WITH_ANY_MISMATCH_FOR_DATA_ELEMENT_OUT_OF_TOTAL_PATIENTS ("% of patients - total"), - GENERAL_REHEARSAL_PRIORIZATION("Priorisierung für GP"), - GENERAL_REHEARSAL_A_CONTAINED_IN_QR ("a) im QB enthalten [ja/nein]"), - GENERAL_REHEARSAL_B_LOW_MISMATCH ("b) im QB mismatch <10% zur MDR-Vorgabe [ja/nein]"), - GENERAL_REHEARSAL_A_AND_B ("a,b ist \"ja\" [ja/nein]"); + PERCENTAGE_OF_PATIENTS_WITH_ANY_MISMATCH_FOR_DATA_ELEMENT_OUT_OF_TOTAL_PATIENTS ("% of patients - total"); private final String title; @@ -178,33 +174,4 @@ public void setPercentageOf_PatientsWithAnyMismatchForDataElement_outOf_totalPat } - public void setGeneralRehearsalPriorization(String priorization){ - - StringExcelCellElement cellElement = new StringExcelCellElement(priorization); - addElement(ELEMENT_ORDER.GENERAL_REHEARSAL_PRIORIZATION, cellElement); - - } - - public void setGeneralRehearsal_A_ContainedInQR (boolean value){ - - NaturalLanguageBooleanExcelCellElement excelCellElement = new NaturalLanguageBooleanExcelCellElement(value); - addElement(ELEMENT_ORDER.GENERAL_REHEARSAL_A_CONTAINED_IN_QR, excelCellElement); - - } - - public void setGeneralRehearsal_B_LowMismatch (boolean value){ - - NaturalLanguageBooleanExcelCellElement excelCellElement = new NaturalLanguageBooleanExcelCellElement(value); - addElement(ELEMENT_ORDER.GENERAL_REHEARSAL_B_LOW_MISMATCH, excelCellElement); - - } - - public void setGeneralRehearsal_A_And_B (boolean value){ - - NaturalLanguageBooleanExcelCellElement excelCellElement = new NaturalLanguageBooleanExcelCellElement(value); - addElement(ELEMENT_ORDER.GENERAL_REHEARSAL_A_AND_B, excelCellElement); - - } - - } diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/instances/statistics/dataelementstats/DataElementStats_ExcelRowMapper.java b/src/main/java/de/samply/share/client/quality/report/file/excel/instances/statistics/dataelementstats/DataElementStats_ExcelRowMapper.java index 8b800c15..fa65ea0e 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/instances/statistics/dataelementstats/DataElementStats_ExcelRowMapper.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/instances/statistics/dataelementstats/DataElementStats_ExcelRowMapper.java @@ -28,7 +28,6 @@ import de.samply.share.client.quality.report.dktk.DktkId_MdrId_Converter; import de.samply.share.client.quality.report.file.excel.row.mapper.ExcelRowMapperException; import de.samply.share.client.quality.report.file.excel.row.mapper.ExcelRowMapperUtils; -import de.samply.share.client.quality.report.results.statistics.GeneralRehearsalStatistics; import de.samply.share.client.quality.report.results.statistics.QualityResultsStatistics; import de.samply.share.common.utils.MdrIdDatatype; @@ -50,7 +49,7 @@ public DataElementStats_ExcelRowMapper(DktkId_MdrId_Converter dktkIdManager, Exc public DataElementStats_ExcelRowElements convert (DataElementStats_ExcelRowParameters excelRowParameters) throws ExcelRowMapperException { - DataElementStats_ExcelRowElements excelRowElements = new FormattedDataElementStats_ExcelRowElements(); + DataElementStats_ExcelRowElements excelRowElements = new DataElementStats_ExcelRowElements(); QualityResultsStatistics qualityResultsStatistics = excelRowParameters.getQualityResultsStatistics(); @@ -70,32 +69,6 @@ public DataElementStats_ExcelRowElements convert (DataElementStats_ExcelRowParam double percentageOf_patientsWithAnyMismatchWithMdrId_outOf_patientsWithMdrId = qualityResultsStatistics.getPercentageOf_PatientsWithAnyMismatchWithMdrId_outOf_PatientsWithMdrId(mdrId); double percentageOf_patientsWithAnyMismatchWithMdrId_outOf_totalPatients = qualityResultsStatistics.getPercentageOf_PatientsWithAnyMismatchWithMdrId_outOf_TotalPatients(mdrId); - - - - // Generalprobe - if (qualityResultsStatistics instanceof GeneralRehearsalStatistics){ - - GeneralRehearsalStatistics generalRehearsalStatistics = (GeneralRehearsalStatistics) qualityResultsStatistics; - - String priorization = centraXxMapper.getGeneralRehearsalPriorization(mdrId); - - boolean generalRehearsal_a_containedInQR = generalRehearsalStatistics.getGeneralRehearsal_A_ContainedInQR(mdrId); - boolean generalRehearsal_b_lowMismatch = generalRehearsalStatistics.getGeneralRehearsal_B_LowMismatch(mdrId); - boolean generalRehearsal_a_and_b = generalRehearsalStatistics.getGeneralRehearsal_A_And_B(mdrId); - - - excelRowElements.setGeneralRehearsalPriorization(priorization); - excelRowElements.setGeneralRehearsal_A_ContainedInQR(generalRehearsal_a_containedInQR); - excelRowElements.setGeneralRehearsal_B_LowMismatch(generalRehearsal_b_lowMismatch); - excelRowElements.setGeneralRehearsal_A_And_B(generalRehearsal_a_and_b); - - } - - - - - excelRowElements.setDktkId(dktkId); excelRowElements.setMdrDatenElement(mdrDataElement); excelRowElements.setCxxDatenElement(cxxDatenElement); diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/pattern/ExcelPattern_001.java b/src/main/java/de/samply/share/client/quality/report/file/excel/pattern/ExcelPattern_001.java index 7538d320..f3dc42f2 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/pattern/ExcelPattern_001.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/pattern/ExcelPattern_001.java @@ -40,7 +40,10 @@ import de.samply.share.client.quality.report.file.excel.sheet.ExcelSheetFactory; import de.samply.share.client.quality.report.file.excel.sheet.ExcelSheetFactoryImpl; import de.samply.share.client.quality.report.file.excel.sheet.ExplanatoryExcelSheetFactory; -import de.samply.share.client.quality.report.file.excel.sheet.wrapper.*; +import de.samply.share.client.quality.report.file.excel.sheet.wrapper.ExcelSheetFreezeFirstRowFactory; +import de.samply.share.client.quality.report.file.excel.sheet.wrapper.ExcelSheetWithAutoFilterFactory; +import de.samply.share.client.quality.report.file.excel.sheet.wrapper.ExcelSheetWithAutoSizeColumnFactory; +import de.samply.share.client.quality.report.file.excel.sheet.wrapper.HighlightMismatchInRed_ExcelSheetFactory_002; import de.samply.share.client.quality.report.file.excel.workbook.ExcelWorkbookFactory; import de.samply.share.client.quality.report.file.excel.workbook.ExcelWorkbookFactoryImpl_002; import de.samply.share.client.quality.report.file.excel.workbook.ExcelWorkbookFactoryParameters_002; @@ -132,7 +135,7 @@ private ExcelRowContextFactory_002 createExcelRowContextFactory (){ private ExcelRowMapper_002 createExcelRowMapper (){ - FirstRowCellReferenceFactoryForOneSheet firstRowCellReferenceFactoryForOneSheet = new FirstRowCellReferenceFactoryForOneSheet(ExcelWorkbookFactoryImpl_002.PATIENT_LOCAL_IDS_SHEET_TITLE); + FirstRowCellReferenceFactoryForOneSheet firstRowCellReferenceFactoryForOneSheet = new FirstRowCellReferenceFactoryForOneSheet(ExcelWorkbookFactoryImpl_002.patientLocalIds_sheetTitle); return new ExcelRowMapper_002( centraXxMapper, dktkIdManager, firstRowCellReferenceFactoryForOneSheet, ignoredElements, excelRowMapperUtils); } diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/pattern/ExcelPattern_002.java b/src/main/java/de/samply/share/client/quality/report/file/excel/pattern/ExcelPattern_002.java index 1c10d369..6d58e733 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/pattern/ExcelPattern_002.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/pattern/ExcelPattern_002.java @@ -40,7 +40,10 @@ import de.samply.share.client.quality.report.file.excel.sheet.ExcelSheetFactory; import de.samply.share.client.quality.report.file.excel.sheet.ExcelSheetFactoryImpl; import de.samply.share.client.quality.report.file.excel.sheet.ExplanatoryExcelSheetFactory; -import de.samply.share.client.quality.report.file.excel.sheet.wrapper.*; +import de.samply.share.client.quality.report.file.excel.sheet.wrapper.ExcelSheetFreezeFirstRowFactory; +import de.samply.share.client.quality.report.file.excel.sheet.wrapper.ExcelSheetWithAutoFilterFactory; +import de.samply.share.client.quality.report.file.excel.sheet.wrapper.ExcelSheetWithAutoSizeColumnFactory; +import de.samply.share.client.quality.report.file.excel.sheet.wrapper.HighlightMismatchInRed_ExcelSheetFactory_002; import de.samply.share.client.quality.report.file.excel.workbook.ExcelWorkbookFactory; import de.samply.share.client.quality.report.file.excel.workbook.ExcelWorkbookFactoryImpl_002; import de.samply.share.client.quality.report.file.excel.workbook.ExcelWorkbookFactoryParameters_002; @@ -113,8 +116,6 @@ private ExcelSheetFactory createExcelSheetFactory (ExcelRowFactory excelRowFacto excelSheetFactory = new ExcelSheetWithAutoFilterFactory(excelSheetFactory); excelSheetFactory = new HighlightMismatchInRed_ExcelSheetFactory_002(excelSheetFactory); - excelSheetFactory = new HighlightNotMappedInOrange_ExcelSheetFactory_002(excelSheetFactory); - excelSheetFactory = new HighlightNotFoundInBlue_ExcelSheetFactory_002(excelSheetFactory); excelSheetFactory = new ExcelSheetWithAutoSizeColumnFactory(excelSheetFactory); excelSheetFactory = new ExcelSheetFreezeFirstRowFactory(excelSheetFactory); @@ -132,7 +133,7 @@ private ExcelRowContextFactory_002 createExcelRowContextFactory (){ private ExcelRowMapper_002 createExcelRowMapper (){ - FirstRowCellReferenceFactoryForOneSheet firstRowCellReferenceFactoryForOneSheet = new FirstRowCellReferenceFactoryForOneSheet(ExcelWorkbookFactoryImpl_002.PATIENT_LOCAL_IDS_SHEET_TITLE); + FirstRowCellReferenceFactoryForOneSheet firstRowCellReferenceFactoryForOneSheet = new FirstRowCellReferenceFactoryForOneSheet(ExcelWorkbookFactoryImpl_002.patientLocalIds_sheetTitle); return new ExcelRowMapper_002( centraXxMapper, dktkIdManager, firstRowCellReferenceFactoryForOneSheet, ignoredElements, excelRowMapperUtils); } diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/row/context/ExcelRowContext_002.java b/src/main/java/de/samply/share/client/quality/report/file/excel/row/context/ExcelRowContext_002.java index 48ce7db8..698d9f6c 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/row/context/ExcelRowContext_002.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/row/context/ExcelRowContext_002.java @@ -24,15 +24,15 @@ * permission to convey the resulting work. */ -import de.samply.share.client.quality.report.file.excel.row.mapper.ExcelRowMapperException; -import de.samply.share.client.quality.report.results.statistics.QualityResultsStatistics; -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.file.excel.row.elements.ExcelRowElements; import de.samply.share.client.quality.report.file.excel.row.elements.ExcelRowElements_002; +import de.samply.share.client.quality.report.file.excel.row.mapper.ExcelRowMapperException; import de.samply.share.client.quality.report.file.excel.row.mapper.ExcelRowMapper_002; import de.samply.share.client.quality.report.results.QualityResult; import de.samply.share.client.quality.report.results.QualityResults; import de.samply.share.client.quality.report.results.sorted.AlphabeticallySortedMismatchedQualityResults; +import de.samply.share.client.quality.report.results.statistics.QualityResultsStatistics; +import de.samply.share.common.utils.MdrIdDatatype; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/row/context/ExcelRowParameters_002.java b/src/main/java/de/samply/share/client/quality/report/file/excel/row/context/ExcelRowParameters_002.java index d6196143..d4a10709 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/row/context/ExcelRowParameters_002.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/row/context/ExcelRowParameters_002.java @@ -24,8 +24,8 @@ * permission to convey the resulting work. */ -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.results.QualityResult; +import de.samply.share.common.utils.MdrIdDatatype; public class ExcelRowParameters_002 { diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/row/elements/ExcelRowElements_002.java b/src/main/java/de/samply/share/client/quality/report/file/excel/row/elements/ExcelRowElements_002.java index 3883f17c..d29feb00 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/row/elements/ExcelRowElements_002.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/row/elements/ExcelRowElements_002.java @@ -24,10 +24,10 @@ * permission to convey the resulting work. */ -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.file.excel.cell.element.*; import de.samply.share.client.quality.report.file.excel.cell.reference.CellReference; import de.samply.share.client.quality.report.file.excel.cell.reference.CellReferenceExcelCellElement; +import de.samply.share.common.utils.MdrIdDatatype; public class ExcelRowElements_002 extends ExcelRowElements { @@ -103,7 +103,7 @@ public void setDktkId(String dktkId){ public void setMdrLink (String link, MdrIdDatatype mdrId){ String title = getLinkTitle(mdrId); - LinkExcelCellElement cellElement = new LinkExcelCellElement(link, title); + LinkExcelCellElement cellElement = new LinkExcelCellElement(link, title); addElement(ELEMENT_ORDER.MDR_LINK, cellElement); } @@ -143,32 +143,19 @@ public void setMdrType (String mdrType){ } -// public void setValid (boolean isValid, int numberOfPatients){ -// -// MatchExcelCellElement cellElement = new MatchExcelCellElement(isValid, numberOfPatients); -// addElement(ELEMENT_ORDER.IS_VALID, cellElement); -// -// } - public void setValid (boolean isValid, int numberOfPatients){ - setValid (isValid, numberOfPatients, null); - } - - public void setValid (boolean isValid, int numberOfPatients, CellReference cellReference){ - MatchElement matchElement = new MatchElement(numberOfPatients, isValid); - ExcelCellElement cellElement = (cellReference != null) ? new CellReferenceExcelCellElement(cellReference, matchElement) : new MatchExcelCellElement(matchElement); + MatchExcelCellElement cellElement = new MatchExcelCellElement(isValid, numberOfPatients); addElement(ELEMENT_ORDER.IS_VALID, cellElement); } public void setNotMapped (){ - MatchElement matchElement = new MatchElement(0, true); - matchElement.setNotMapped(); - MatchExcelCellElement matchExcelCellElement = new MatchExcelCellElement(matchElement); + MatchExcelCellElement cellElement = new MatchExcelCellElement(true, 0); + cellElement.setNotMapped(); - addElement(ELEMENT_ORDER.IS_VALID, matchExcelCellElement); + addElement(ELEMENT_ORDER.IS_VALID, cellElement); } @@ -177,12 +164,12 @@ public void setNumberOfPatients (int numberOfPatients){ addElement(ELEMENT_ORDER.NUMBER_OF_PATIENTS, cellElement); } -// public void setNumberOfPatients (CellReference cellReference, int numberOfPatients){ -// -// CellReferenceExcelCellElement cellElement = new CellReferenceExcelCellElement(cellReference, "" + numberOfPatients); -// addElement(ELEMENT_ORDER.NUMBER_OF_PATIENTS, cellElement); -// -// } + public void setNumberOfPatients (CellReference cellReference, int numberOfPatients){ + + CellReferenceExcelCellElement cellElement = new CellReferenceExcelCellElement(cellReference, "" + numberOfPatients); + addElement(ELEMENT_ORDER.NUMBER_OF_PATIENTS, cellElement); + + } public void setPercentageOutOfPatientsWithDataElement(Double percentageOfPatientsWithDataElement){ diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/row/mapper/ExcelRowMapper_002.java b/src/main/java/de/samply/share/client/quality/report/file/excel/row/mapper/ExcelRowMapper_002.java index e933bd67..0c80c84e 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/row/mapper/ExcelRowMapper_002.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/row/mapper/ExcelRowMapper_002.java @@ -70,7 +70,7 @@ public ExcelRowElements_002 createExcelRowElements(ExcelRowParameters_002 excelR String cxxDatenElement = centraXxMapper.getCentraXxAttribute(mdrId); String cxxAttributeValue = isValid ? centraXxMapper.getCentraXxValue(mdrId, mdrAttributeValue) : excelRowParameters.getValue(); String dktkId = dktkIdManager.getDktkId(mdrId); - CellReference cellReference = createCellReference(excelRowParameters); + CellReference numberOfPatientsCellReference = createNumberOfPatientsCellReference(excelRowParameters); Double percentageOutOfPatientWithDataElement = excelRowParameters.getPercentageOutOfPatientWithDataElement(); Double percentageOutOfTotalPatients = excelRowParameters.getPercentageOutOfTotalPatients(); @@ -78,7 +78,7 @@ public ExcelRowElements_002 createExcelRowElements(ExcelRowParameters_002 excelR if (ignoredElements.isIgnored(mdrId)){ rowElements.setNotMapped(); }else{ - rowElements.setValid(isValid, numberOfPatients, cellReference); + rowElements.setValid(isValid, numberOfPatients); } rowElements.setMdrAttributeValue(mdrAttributeValue); @@ -90,13 +90,18 @@ public ExcelRowElements_002 createExcelRowElements(ExcelRowParameters_002 excelR rowElements.setDktkId(dktkId); rowElements.setPercentageOutOfPatientsWithDataElement(percentageOutOfPatientWithDataElement); rowElements.setPercentageOutOfTotalPatients(percentageOutOfTotalPatients); - rowElements.setNumberOfPatients(numberOfPatients); + + if (numberOfPatientsCellReference != null){ + rowElements.setNumberOfPatients(numberOfPatientsCellReference, numberOfPatients); + } else{ + rowElements.setNumberOfPatients(numberOfPatients); + } return rowElements; } - private CellReference createCellReference(ExcelRowParameters_002 excelRowParameters){ + private CellReference createNumberOfPatientsCellReference (ExcelRowParameters_002 excelRowParameters){ Integer mismatchOrdinal = excelRowParameters.getMismatchOrdinal(); boolean isValid = excelRowParameters.getQualityResult().isValid(); diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/sheet/ExplanatoryExcelSheetFactory.java b/src/main/java/de/samply/share/client/quality/report/file/excel/sheet/ExplanatoryExcelSheetFactory.java index 12fde6a1..4d442df9 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/sheet/ExplanatoryExcelSheetFactory.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/sheet/ExplanatoryExcelSheetFactory.java @@ -25,8 +25,6 @@ */ import de.samply.share.client.model.EnumConfiguration; -import de.samply.share.client.quality.report.file.downloader.FileDownloaderException; -import de.samply.share.client.quality.report.file.downloader.ExplanatoryExcelFileDownloader; import de.samply.share.client.quality.report.file.excel.row.context.ExcelRowContext; import de.samply.share.client.util.db.ConfigurationUtil; import org.apache.logging.log4j.LogManager; diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/sheet/wrapper/HighlightMismatchInRed_ExcelSheetFactory_002.java b/src/main/java/de/samply/share/client/quality/report/file/excel/sheet/wrapper/HighlightMismatchInRed_ExcelSheetFactory_002.java index f7b18c10..8e701de1 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/sheet/wrapper/HighlightMismatchInRed_ExcelSheetFactory_002.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/sheet/wrapper/HighlightMismatchInRed_ExcelSheetFactory_002.java @@ -24,7 +24,7 @@ * permission to convey the resulting work. */ -import de.samply.share.client.quality.report.file.excel.cell.element.MatchElement; +import de.samply.share.client.quality.report.file.excel.cell.element.MatchExcelCellElement; import de.samply.share.client.quality.report.file.excel.row.elements.ExcelRowElements_002; import de.samply.share.client.quality.report.file.excel.sheet.ExcelSheetFactory; import org.apache.poi.hssf.util.CellReference; @@ -48,7 +48,7 @@ protected String getRule() { stringBuilder.append('$'); stringBuilder.append(getColumnToBeHighlighted()); stringBuilder.append("1=\""); - stringBuilder.append(MatchElement.MISMATCH); + stringBuilder.append(MatchExcelCellElement.MISMATCH); stringBuilder.append('\"'); return stringBuilder.toString(); diff --git a/src/main/java/de/samply/share/client/quality/report/file/excel/workbook/ExcelWorkbookFactoryImpl_002.java b/src/main/java/de/samply/share/client/quality/report/file/excel/workbook/ExcelWorkbookFactoryImpl_002.java index 1fa772e0..f261c938 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/excel/workbook/ExcelWorkbookFactoryImpl_002.java +++ b/src/main/java/de/samply/share/client/quality/report/file/excel/workbook/ExcelWorkbookFactoryImpl_002.java @@ -65,11 +65,11 @@ public class ExcelWorkbookFactoryImpl_002 implements ExcelWorkbookFactory { private DktkId_MdrId_Converter dktkIdManager; private MdrIgnoredElements mdrIgnoredElements; - public final static String ALL_ELEMENTS_SHEET_TITLE = "all elements"; - public final static String FILTERED_ELEMENTS_SHEET_TITLE = "filtered elements"; - public final static String PATIENT_LOCAL_IDS_SHEET_TITLE = "patient local ids"; - public final static String PATIENT_DKTK_IDS_SHEET_TITLE = "patient dktk ids"; - public final static String DATA_ELEMENT_STATISTICS = "data element stats"; + public final static String allElements_sheetTitle = "all elements"; + public final static String filteredElements_sheetTitle = "filtered elements"; + public final static String patientLocalIds_sheetTitle = "patient local ids"; + public final static String patientDktkIds_sheetTitle = "patient dktk ids"; + public final static String dataElementStatistics = "data element stats"; protected static final Logger logger = LogManager.getLogger(ExcelWorkbookFactoryImpl_002.class); @@ -113,12 +113,12 @@ public XSSFWorkbook createWorkbook(QualityResults qualityResults) throws ExcelWo logger.info("Adding filtered elements to quality report file"); QualityResultsStatistics filteredQualityResultsStatistics = getQualityResultStatistics(filteredQualityResults); - workbook = addSheet(workbook, FILTERED_ELEMENTS_SHEET_TITLE, filteredQualityResults, asmQualityResults, filteredQualityResultsStatistics); + workbook = addSheet(workbook, filteredElements_sheetTitle, filteredQualityResults, asmQualityResults, filteredQualityResultsStatistics); logger.info("Adding all elements to quality report file"); QualityResultsStatistics qualityResultsStatistics = getQualityResultStatistics(qualityResults); - workbook = addSheet(workbook, ALL_ELEMENTS_SHEET_TITLE, sortedQualityResults, asmQualityResults, qualityResultsStatistics); + workbook = addSheet(workbook, allElements_sheetTitle, sortedQualityResults, asmQualityResults, qualityResultsStatistics); logger.info("Adding mismatching patient local ids"); workbook = addPatientLocalIdsSheet(workbook, asmQualityResults); @@ -128,7 +128,7 @@ public XSSFWorkbook createWorkbook(QualityResults qualityResults) throws ExcelWo logger.info("Adding data element statistics"); - workbook = addDataElementStatistics(workbook, DATA_ELEMENT_STATISTICS, sortedQualityResults, qualityResultsStatistics); + workbook = addDataElementStatistics(workbook, dataElementStatistics, sortedQualityResults, qualityResultsStatistics); return workbook; @@ -155,14 +155,14 @@ private XSSFWorkbook addSheet (XSSFWorkbook workbook, String sheetTitle, Quality private XSSFWorkbook addPatientLocalIdsSheet (XSSFWorkbook workbook, AlphabeticallySortedMismatchedQualityResults qualityResults) throws ExcelWorkbookFactoryException { ExcelRowContext excelRowContext = patientLocalIdsExcelRowContextFactory.createExcelRowContext(qualityResults); - return addSheet(workbook, PATIENT_LOCAL_IDS_SHEET_TITLE, excelRowContext); + return addSheet(workbook, patientLocalIds_sheetTitle, excelRowContext); } private XSSFWorkbook addPatientDktkIdsSheet (XSSFWorkbook workbook, AlphabeticallySortedMismatchedQualityResults qualityResults) throws ExcelWorkbookFactoryException { ExcelRowContext excelRowContext = patientDktkIdsExcelRowContextFactory.createExcelRowContext(qualityResults); - return addSheet(workbook, PATIENT_DKTK_IDS_SHEET_TITLE, excelRowContext); + return addSheet(workbook, patientDktkIds_sheetTitle, excelRowContext); } diff --git a/src/main/java/de/samply/share/client/quality/report/file/id/path/IdPathManager_002.java b/src/main/java/de/samply/share/client/quality/report/file/id/path/IdPathManager_002.java index f9906751..027672e7 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/id/path/IdPathManager_002.java +++ b/src/main/java/de/samply/share/client/quality/report/file/id/path/IdPathManager_002.java @@ -26,7 +26,6 @@ import de.samply.share.client.quality.report.file.csvline.manager.QualityResultCsvLineManager_002; import de.samply.share.client.quality.report.file.excel.pattern.ExcelPattern_002; - import de.samply.share.client.quality.report.file.metadata.txtcolumn.MetadataTxtColumnManager_002; public class IdPathManager_002 extends IdPathManagerImpl { diff --git a/src/main/java/de/samply/share/client/quality/report/file/manager/CsvQualityReportFileManager.java b/src/main/java/de/samply/share/client/quality/report/file/manager/CsvQualityReportFileManager.java index 3f5c5008..dc5b2a2e 100644 --- a/src/main/java/de/samply/share/client/quality/report/file/manager/CsvQualityReportFileManager.java +++ b/src/main/java/de/samply/share/client/quality/report/file/manager/CsvQualityReportFileManager.java @@ -24,13 +24,13 @@ * permission to convey the resulting work. */ -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.file.csvline.manager.QualityResultCsvLineManager; import de.samply.share.client.quality.report.file.csvline.manager.QualityResultCsvLineManagerException; import de.samply.share.client.quality.report.file.id.path.IdPathManagerImpl; import de.samply.share.client.quality.report.results.QualityResult; import de.samply.share.client.quality.report.results.QualityResults; import de.samply.share.client.quality.report.results.QualityResultsImpl; +import de.samply.share.common.utils.MdrIdDatatype; import java.io.*; import java.nio.charset.StandardCharsets; diff --git a/src/main/java/de/samply/share/client/quality/report/localdatamanagement/LocalDataManagementConnector.java b/src/main/java/de/samply/share/client/quality/report/localdatamanagement/LocalDataManagementConnector.java index 65b8bd0c..7e5dcc8a 100644 --- a/src/main/java/de/samply/share/client/quality/report/localdatamanagement/LocalDataManagementConnector.java +++ b/src/main/java/de/samply/share/client/quality/report/localdatamanagement/LocalDataManagementConnector.java @@ -36,7 +36,6 @@ import org.apache.http.client.methods.HttpUriRequest; import java.io.IOException; -import java.sql.SQLException; public class LocalDataManagementConnector { diff --git a/src/main/java/de/samply/share/client/quality/report/localdatamanagement/LocalDataManagementRequester.java b/src/main/java/de/samply/share/client/quality/report/localdatamanagement/LocalDataManagementRequester.java index e8efb788..80fe4654 100644 --- a/src/main/java/de/samply/share/client/quality/report/localdatamanagement/LocalDataManagementRequester.java +++ b/src/main/java/de/samply/share/client/quality/report/localdatamanagement/LocalDataManagementRequester.java @@ -24,9 +24,9 @@ * permission to convey the resulting work. */ +import de.samply.common.ldmclient.centraxx.model.QueryResultStatistic; import de.samply.share.model.ccp.QueryResult; import de.samply.share.model.common.View; -import de.samply.common.ldmclient.centraxx.model.QueryResultStatistic; public interface LocalDataManagementRequester { diff --git a/src/main/java/de/samply/share/client/quality/report/localdatamanagement/LocalDataManagementRequesterImpl.java b/src/main/java/de/samply/share/client/quality/report/localdatamanagement/LocalDataManagementRequesterImpl.java index d9905808..72286c20 100644 --- a/src/main/java/de/samply/share/client/quality/report/localdatamanagement/LocalDataManagementRequesterImpl.java +++ b/src/main/java/de/samply/share/client/quality/report/localdatamanagement/LocalDataManagementRequesterImpl.java @@ -25,18 +25,13 @@ */ +import de.samply.common.ldmclient.centraxx.model.QueryResultStatistic; import de.samply.share.client.control.ApplicationBean; -import de.samply.share.client.model.EnumConfiguration; -import de.samply.share.client.util.connector.LdmConnector; import de.samply.share.client.util.connector.LdmConnectorCentraxx; -import de.samply.share.client.util.db.ConfigurationUtil; -import de.samply.share.client.util.db.CredentialsUtil; -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.common.utils.SamplyShareUtils; -import de.samply.share.model.common.Error; import de.samply.share.model.ccp.QueryResult; +import de.samply.share.model.common.Error; import de.samply.share.model.common.View; -import de.samply.common.ldmclient.centraxx.model.QueryResultStatistic; import de.samply.share.utils.QueryConverter; import org.apache.http.*; import org.apache.http.client.methods.CloseableHttpResponse; diff --git a/src/main/java/de/samply/share/client/quality/report/model/mdr/MdrConnectionFactory.java b/src/main/java/de/samply/share/client/quality/report/model/mdr/MdrConnectionFactory.java index bf88326b..e6c353b0 100644 --- a/src/main/java/de/samply/share/client/quality/report/model/mdr/MdrConnectionFactory.java +++ b/src/main/java/de/samply/share/client/quality/report/model/mdr/MdrConnectionFactory.java @@ -31,7 +31,6 @@ import de.samply.share.client.quality.report.properties.PropertyUtils; import de.samply.share.client.util.db.ConfigurationUtil; -import java.net.URISyntaxException; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/de/samply/share/client/quality/report/model/reader/QualityReportModelReaderImpl.java b/src/main/java/de/samply/share/client/quality/report/model/reader/QualityReportModelReaderImpl.java index e81db688..91790bda 100644 --- a/src/main/java/de/samply/share/client/quality/report/model/reader/QualityReportModelReaderImpl.java +++ b/src/main/java/de/samply/share/client/quality/report/model/reader/QualityReportModelReaderImpl.java @@ -31,11 +31,11 @@ import de.samply.common.mdrclient.domain.Result; import de.samply.common.mdrclient.domain.Validations; import de.samply.share.client.model.EnumConfiguration; -import de.samply.share.client.quality.report.properties.PropertyUtils; -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.MdrIdAndValidations; import de.samply.share.client.quality.report.model.Model; +import de.samply.share.client.quality.report.properties.PropertyUtils; import de.samply.share.client.util.db.ConfigurationUtil; +import de.samply.share.common.utils.MdrIdDatatype; import de.samply.web.mdrFaces.MdrContext; import java.util.ArrayList; diff --git a/src/main/java/de/samply/share/client/quality/report/model/searcher/ModelSearcher.java b/src/main/java/de/samply/share/client/quality/report/model/searcher/ModelSearcher.java index 0891d573..7d678972 100644 --- a/src/main/java/de/samply/share/client/quality/report/model/searcher/ModelSearcher.java +++ b/src/main/java/de/samply/share/client/quality/report/model/searcher/ModelSearcher.java @@ -25,9 +25,9 @@ */ import de.samply.common.mdrclient.domain.Validations; -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.MdrIdAndValidations; import de.samply.share.client.quality.report.model.Model; +import de.samply.share.common.utils.MdrIdDatatype; import java.util.HashMap; import java.util.List; diff --git a/src/main/java/de/samply/share/client/quality/report/results/filter/QualityResultsFilter.java b/src/main/java/de/samply/share/client/quality/report/results/filter/QualityResultsFilter.java index a29b488f..e74ff9b4 100644 --- a/src/main/java/de/samply/share/client/quality/report/results/filter/QualityResultsFilter.java +++ b/src/main/java/de/samply/share/client/quality/report/results/filter/QualityResultsFilter.java @@ -24,9 +24,9 @@ * permission to convey the resulting work. */ -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.results.QualityResult; import de.samply.share.client.quality.report.results.QualityResults; +import de.samply.share.common.utils.MdrIdDatatype; import java.util.Set; diff --git a/src/main/java/de/samply/share/client/quality/report/results/filter/QualityResultsSortedMdrIdsFilter.java b/src/main/java/de/samply/share/client/quality/report/results/filter/QualityResultsSortedMdrIdsFilter.java index c425bcfb..226cb71b 100644 --- a/src/main/java/de/samply/share/client/quality/report/results/filter/QualityResultsSortedMdrIdsFilter.java +++ b/src/main/java/de/samply/share/client/quality/report/results/filter/QualityResultsSortedMdrIdsFilter.java @@ -24,9 +24,9 @@ * permission to convey the resulting work. */ -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.results.QualityResults; import de.samply.share.client.quality.report.results.filter.comparator.MdrIdComparator; +import de.samply.share.common.utils.MdrIdDatatype; import java.util.Set; import java.util.SortedSet; diff --git a/src/main/java/de/samply/share/client/quality/report/results/filter/QualityResultsValidValueByTypeFilter.java b/src/main/java/de/samply/share/client/quality/report/results/filter/QualityResultsValidValueByTypeFilter.java index 38a03c4d..fe0c712c 100644 --- a/src/main/java/de/samply/share/client/quality/report/results/filter/QualityResultsValidValueByTypeFilter.java +++ b/src/main/java/de/samply/share/client/quality/report/results/filter/QualityResultsValidValueByTypeFilter.java @@ -25,9 +25,9 @@ */ import de.samply.common.mdrclient.domain.Validations; -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.model.searcher.ModelSearcher; import de.samply.share.client.quality.report.results.QualityResults; +import de.samply.share.common.utils.MdrIdDatatype; public abstract class QualityResultsValidValueByTypeFilter extends QualityResultsValidValueFilter { diff --git a/src/main/java/de/samply/share/client/quality/report/results/filter/QualityResultsValidValueFilter.java b/src/main/java/de/samply/share/client/quality/report/results/filter/QualityResultsValidValueFilter.java index 77c26c6d..1e0d9a0c 100644 --- a/src/main/java/de/samply/share/client/quality/report/results/filter/QualityResultsValidValueFilter.java +++ b/src/main/java/de/samply/share/client/quality/report/results/filter/QualityResultsValidValueFilter.java @@ -24,9 +24,9 @@ * permission to convey the resulting work. */ -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.results.QualityResult; import de.samply.share.client.quality.report.results.QualityResults; +import de.samply.share.common.utils.MdrIdDatatype; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/de/samply/share/client/quality/report/results/filter/comparator/MdrIdComparatorByDktkId.java b/src/main/java/de/samply/share/client/quality/report/results/filter/comparator/MdrIdComparatorByDktkId.java index 71382b3e..f5f6d18c 100644 --- a/src/main/java/de/samply/share/client/quality/report/results/filter/comparator/MdrIdComparatorByDktkId.java +++ b/src/main/java/de/samply/share/client/quality/report/results/filter/comparator/MdrIdComparatorByDktkId.java @@ -24,8 +24,8 @@ * permission to convey the resulting work. */ -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.dktk.DktkId_MdrId_Converter; +import de.samply.share.common.utils.MdrIdDatatype; public class MdrIdComparatorByDktkId extends MdrIdComparator { diff --git a/src/main/java/de/samply/share/client/quality/report/results/operations/QualityResultsAnalyzer.java b/src/main/java/de/samply/share/client/quality/report/results/operations/QualityResultsAnalyzer.java index fa026d3c..09c34ae1 100644 --- a/src/main/java/de/samply/share/client/quality/report/results/operations/QualityResultsAnalyzer.java +++ b/src/main/java/de/samply/share/client/quality/report/results/operations/QualityResultsAnalyzer.java @@ -24,14 +24,14 @@ * permission to convey the resulting work. */ +import de.samply.share.client.quality.report.results.QualityResult; +import de.samply.share.client.quality.report.results.QualityResults; +import de.samply.share.client.quality.report.results.QualityResultsImpl; import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.model.ccp.Attribute; import de.samply.share.model.ccp.Container; import de.samply.share.model.ccp.Patient; import de.samply.share.model.ccp.QueryResult; -import de.samply.share.client.quality.report.results.QualityResult; -import de.samply.share.client.quality.report.results.QualityResults; -import de.samply.share.client.quality.report.results.QualityResultsImpl; import java.util.List; import java.util.Set; diff --git a/src/main/java/de/samply/share/client/quality/report/results/operations/QualityResultsValidator.java b/src/main/java/de/samply/share/client/quality/report/results/operations/QualityResultsValidator.java index a14a26eb..d3076ff4 100644 --- a/src/main/java/de/samply/share/client/quality/report/results/operations/QualityResultsValidator.java +++ b/src/main/java/de/samply/share/client/quality/report/results/operations/QualityResultsValidator.java @@ -28,8 +28,8 @@ import de.dth.mdr.validator.MDRValidator; import de.dth.mdr.validator.exception.ValidatorException; -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.results.QualityResults; +import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.common.utils.QueryValidator; diff --git a/src/main/java/de/samply/share/client/quality/report/results/sorted/AlphabeticallySortedMismatchedQualityResults.java b/src/main/java/de/samply/share/client/quality/report/results/sorted/AlphabeticallySortedMismatchedQualityResults.java index 648e4f5c..71865411 100644 --- a/src/main/java/de/samply/share/client/quality/report/results/sorted/AlphabeticallySortedMismatchedQualityResults.java +++ b/src/main/java/de/samply/share/client/quality/report/results/sorted/AlphabeticallySortedMismatchedQualityResults.java @@ -24,9 +24,9 @@ * permission to convey the resulting work. */ -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.results.QualityResult; import de.samply.share.client.quality.report.results.QualityResults; +import de.samply.share.common.utils.MdrIdDatatype; import java.util.ArrayList; import java.util.Collections; diff --git a/src/main/java/de/samply/share/client/quality/report/results/sorted/SortedQualityResults.java b/src/main/java/de/samply/share/client/quality/report/results/sorted/SortedQualityResults.java index 3dd1068a..d5562696 100644 --- a/src/main/java/de/samply/share/client/quality/report/results/sorted/SortedQualityResults.java +++ b/src/main/java/de/samply/share/client/quality/report/results/sorted/SortedQualityResults.java @@ -24,9 +24,9 @@ * permission to convey the resulting work. */ -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.results.QualityResult; import de.samply.share.client.quality.report.results.QualityResults; +import de.samply.share.common.utils.MdrIdDatatype; public interface SortedQualityResults extends QualityResults, Iterable { diff --git a/src/main/java/de/samply/share/client/quality/report/results/sorted/SortedQualityResultsImpl.java b/src/main/java/de/samply/share/client/quality/report/results/sorted/SortedQualityResultsImpl.java index f8a2ef57..72d6a6e4 100644 --- a/src/main/java/de/samply/share/client/quality/report/results/sorted/SortedQualityResultsImpl.java +++ b/src/main/java/de/samply/share/client/quality/report/results/sorted/SortedQualityResultsImpl.java @@ -24,10 +24,10 @@ * permission to convey the resulting work. */ -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.results.QualityResult; import de.samply.share.client.quality.report.results.QualityResults; import de.samply.share.client.quality.report.results.filter.QualityResultsFilter; +import de.samply.share.common.utils.MdrIdDatatype; import java.util.ArrayList; import java.util.Iterator; diff --git a/src/main/java/de/samply/share/client/quality/report/results/statistics/QualityResultsStatisticsImpl.java b/src/main/java/de/samply/share/client/quality/report/results/statistics/QualityResultsStatisticsImpl.java index 92e228ab..40af5f34 100644 --- a/src/main/java/de/samply/share/client/quality/report/results/statistics/QualityResultsStatisticsImpl.java +++ b/src/main/java/de/samply/share/client/quality/report/results/statistics/QualityResultsStatisticsImpl.java @@ -26,13 +26,13 @@ import de.samply.share.client.quality.report.MdrIgnoredElements; import de.samply.share.client.quality.report.results.QualityResult; -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.results.QualityResults; +import de.samply.share.common.utils.MdrIdDatatype; import java.util.HashSet; import java.util.Set; -public class QualityResultsStatisticsImpl implements QualityResultsStatistics, GeneralRehearsalStatistics { +public class QualityResultsStatisticsImpl implements QualityResultsStatistics { private QualityResults qualityResults; private MdrIgnoredElements mdrIgnoredElements; @@ -43,7 +43,6 @@ public class QualityResultsStatisticsImpl implements QualityResultsStatistics, G private Integer totalNumberOfPatients; - public QualityResultsStatisticsImpl(QualityResults qualityResults, MdrIgnoredElements mdrIgnoredElements) { this.qualityResults = qualityResults; this.mdrIgnoredElements = mdrIgnoredElements; @@ -448,20 +447,6 @@ public double getPercentageOfPatientsOutOfTotalNumberOfPatientsForADataelement ( } - @Override - public boolean getGeneralRehearsal_A_ContainedInQR(MdrIdDatatype mdrId) { - return getNumberOf_PatientsWithMdrId(mdrId) > 0; - } - - @Override - public boolean getGeneralRehearsal_B_LowMismatch(MdrIdDatatype mdrId) { - return getPercentageOf_PatientsWithAnyMismatchWithMdrId_outOf_PatientsWithMdrId(mdrId) < 10.0d; - } - - @Override - public boolean getGeneralRehearsal_A_And_B(MdrIdDatatype mdrId) { - return getGeneralRehearsal_A_ContainedInQR(mdrId) && getGeneralRehearsal_B_LowMismatch(mdrId); - } } diff --git a/src/main/java/de/samply/share/client/quality/report/tests/CentraXxMapperTest.java b/src/main/java/de/samply/share/client/quality/report/tests/CentraXxMapperTest.java index cf8e9a0e..c3f73d16 100644 --- a/src/main/java/de/samply/share/client/quality/report/tests/CentraXxMapperTest.java +++ b/src/main/java/de/samply/share/client/quality/report/tests/CentraXxMapperTest.java @@ -25,10 +25,10 @@ */ -import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.client.quality.report.centraxx.CentraXxMapper; import de.samply.share.client.quality.report.centraxx.CentraXxMapperException; import de.samply.share.client.quality.report.centraxx.CentraXxMapperImpl; +import de.samply.share.common.utils.MdrIdDatatype; import javax.ws.rs.GET; import javax.ws.rs.Path; diff --git a/src/main/java/de/samply/share/client/quality/report/tests/ExcelTest.java b/src/main/java/de/samply/share/client/quality/report/tests/ExcelTest.java index 25f2c40a..070cfb64 100644 --- a/src/main/java/de/samply/share/client/quality/report/tests/ExcelTest.java +++ b/src/main/java/de/samply/share/client/quality/report/tests/ExcelTest.java @@ -50,7 +50,6 @@ import de.samply.share.client.quality.report.results.QualityResults; import de.samply.share.client.util.db.ConfigurationUtil; - import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.QueryParam; diff --git a/src/main/java/de/samply/share/client/quality/report/tests/ValidatorTest.java b/src/main/java/de/samply/share/client/quality/report/tests/ValidatorTest.java index 17f8ae9e..261026ef 100644 --- a/src/main/java/de/samply/share/client/quality/report/tests/ValidatorTest.java +++ b/src/main/java/de/samply/share/client/quality/report/tests/ValidatorTest.java @@ -37,8 +37,8 @@ import de.samply.share.client.quality.report.file.excel.workbook.ExcelWorkbookFactoryException; import de.samply.share.client.quality.report.file.id.path.IdPathManager_002; import de.samply.share.client.quality.report.file.manager.CsvQualityReportFileManager; -import de.samply.share.client.quality.report.file.manager.QualityReportFileManagerException; import de.samply.share.client.quality.report.file.manager.QualityReportFileManager; +import de.samply.share.client.quality.report.file.manager.QualityReportFileManagerException; import de.samply.share.client.quality.report.model.mdr.MdrConnectionFactory; import de.samply.share.client.quality.report.model.mdr.MdrConnectionFactoryException; import de.samply.share.client.quality.report.results.QualityResults; diff --git a/src/main/java/de/samply/share/client/quality/report/views/ViewsCreator.java b/src/main/java/de/samply/share/client/quality/report/views/ViewsCreator.java index 5617c5f3..78e40df5 100644 --- a/src/main/java/de/samply/share/client/quality/report/views/ViewsCreator.java +++ b/src/main/java/de/samply/share/client/quality/report/views/ViewsCreator.java @@ -24,8 +24,8 @@ * permission to convey the resulting work. */ -import de.samply.share.model.common.View; import de.samply.share.client.quality.report.model.Model; +import de.samply.share.model.common.View; import java.util.List; diff --git a/src/main/java/de/samply/share/client/quality/report/views/fromto/FromToViewsCreator.java b/src/main/java/de/samply/share/client/quality/report/views/fromto/FromToViewsCreator.java index fbc1889e..daf7b50e 100644 --- a/src/main/java/de/samply/share/client/quality/report/views/fromto/FromToViewsCreator.java +++ b/src/main/java/de/samply/share/client/quality/report/views/fromto/FromToViewsCreator.java @@ -27,14 +27,14 @@ import de.samply.share.client.model.EnumConfiguration; -import de.samply.share.client.quality.report.MdrIgnoredElements; -import de.samply.share.common.utils.MdrIdDatatype; -import de.samply.share.model.common.*; import de.samply.share.client.quality.report.MdrIdAndValidations; +import de.samply.share.client.quality.report.MdrIgnoredElements; import de.samply.share.client.quality.report.model.Model; import de.samply.share.client.quality.report.views.ViewsCreator; import de.samply.share.client.quality.report.views.fromto.scheduler.ViewFromToScheduler; import de.samply.share.client.util.db.ConfigurationUtil; +import de.samply.share.common.utils.MdrIdDatatype; +import de.samply.share.model.common.*; import javax.xml.bind.JAXBElement; import java.io.Serializable; diff --git a/src/main/java/de/samply/share/client/rest/EventLogDatasource.java b/src/main/java/de/samply/share/client/rest/EventLogDatasource.java index 55921bea..34f6c1b5 100644 --- a/src/main/java/de/samply/share/client/rest/EventLogDatasource.java +++ b/src/main/java/de/samply/share/client/rest/EventLogDatasource.java @@ -29,8 +29,8 @@ package de.samply.share.client.rest; import com.google.gson.Gson; -import de.samply.share.client.model.line.EventLogLine; import de.samply.share.client.model.db.tables.pojos.EventLog; +import de.samply.share.client.model.line.EventLogLine; import de.samply.share.client.util.db.EventLogUtil; import javax.ws.rs.GET; diff --git a/src/main/java/de/samply/share/client/util/MailUtils.java b/src/main/java/de/samply/share/client/util/MailUtils.java index 8da3c18d..76a9314c 100644 --- a/src/main/java/de/samply/share/client/util/MailUtils.java +++ b/src/main/java/de/samply/share/client/util/MailUtils.java @@ -28,9 +28,10 @@ package de.samply.share.client.util; -import java.io.File; -import java.util.List; - +import de.samply.common.mailing.EmailBuilder; +import de.samply.common.mailing.MailSender; +import de.samply.common.mailing.MailSending; +import de.samply.common.mailing.OutgoingEmail; import de.samply.share.client.messages.Messages; import de.samply.share.client.model.EnumConfiguration; import de.samply.share.client.model.db.enums.EntityType; @@ -39,17 +40,13 @@ import de.samply.share.client.model.db.tables.pojos.InquiryResult; import de.samply.share.client.model.db.tables.pojos.User; import de.samply.share.client.util.db.*; +import de.samply.share.common.utils.ProjectInfo; import de.samply.share.common.utils.SamplyShareUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import de.samply.common.mailing.EmailBuilder; -import de.samply.common.mailing.MailSender; -import de.samply.common.mailing.MailSending; -import de.samply.common.mailing.OutgoingEmail; -import de.samply.share.common.utils.ProjectInfo; - import javax.servlet.ServletContext; +import java.util.List; /** * Utility class to help with sending of (notification) mails @@ -142,7 +139,7 @@ private static boolean sendMail(List inquiryResults, EntityType t email.setLocale("de"); email.putParameter("results", generateResultsParameter(shareUrl, inquiryResults)); String projectName = ProjectInfo.INSTANCE.getProjectName(); - MailSending mailSending = MailSender.loadMailSendingConfig(projectName, System.getProperty("catalina.base") + File.separator + "conf", ProjectInfo.INSTANCE.getServletContext().getRealPath("/WEB-INF")); + MailSending mailSending = MailSender.loadMailSendingConfig(projectName); EmailBuilder builder = initializeBuilder(mailSending); builder.addTemplateFile("NewInquiriesContent.soy", "NewInquiriesContent"); diff --git a/src/main/java/de/samply/share/client/util/PatientValidator.java b/src/main/java/de/samply/share/client/util/PatientValidator.java index fd52e640..e9fc69fd 100644 --- a/src/main/java/de/samply/share/client/util/PatientValidator.java +++ b/src/main/java/de/samply/share/client/util/PatientValidator.java @@ -28,26 +28,20 @@ package de.samply.share.client.util; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.concurrent.ExecutionException; - -import javax.xml.bind.JAXBElement; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - import de.samply.common.mdrclient.MdrClient; import de.samply.common.mdrclient.MdrConnectionException; import de.samply.common.mdrclient.MdrInvalidResponseException; import de.samply.common.mdrclient.domain.PermissibleValue; import de.samply.common.mdrclient.domain.Validations; -import de.samply.share.model.ccp.Attribute; -import de.samply.share.model.ccp.Case; -import de.samply.share.model.ccp.ObjectFactory; -import de.samply.share.model.ccp.Patient; -import de.samply.share.model.ccp.Sample; +import de.samply.share.model.ccp.*; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.xml.bind.JAXBElement; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.ExecutionException; /** * Check if the attributes in a patient dataset are valid according to the mdr entry diff --git a/src/main/java/de/samply/share/client/util/Utils.java b/src/main/java/de/samply/share/client/util/Utils.java index 3f0639c0..53542db2 100644 --- a/src/main/java/de/samply/share/client/util/Utils.java +++ b/src/main/java/de/samply/share/client/util/Utils.java @@ -37,9 +37,10 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.*; - -import static org.omnifaces.util.Faces.getServletContext; +import java.util.Calendar; +import java.util.Date; +import java.util.Locale; +import java.util.UUID; /** * A collection of utility methods @@ -224,7 +225,7 @@ public static URL getCentralMdsDbURL() throws MalformedURLException { * @return the byte array */ private static byte[] readFileBytes(String filename) throws IOException { - File file = FileFinderUtil.findFile(ProjectInfo.INSTANCE.getProjectName().toLowerCase() + filename, ProjectInfo.INSTANCE.getProjectName().toLowerCase(), System.getProperty("catalina.base") + File.separator + "conf", getServletContext().getRealPath("/WEB-INF")); + File file = FileFinderUtil.findFile(filename, ProjectInfo.INSTANCE.getProjectName()); return Files.readAllBytes(file.toPath()); } diff --git a/src/main/java/de/samply/share/client/util/WebUtils.java b/src/main/java/de/samply/share/client/util/WebUtils.java index fd923c7a..5a026a32 100644 --- a/src/main/java/de/samply/share/client/util/WebUtils.java +++ b/src/main/java/de/samply/share/client/util/WebUtils.java @@ -27,14 +27,6 @@ */ package de.samply.share.client.util; -import java.net.URI; -import java.sql.Timestamp; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.TimeZone; - import com.google.common.base.Joiner; import com.google.gson.*; import de.samply.share.client.messages.Messages; @@ -57,6 +49,13 @@ import javax.faces.context.FacesContext; import javax.servlet.http.HttpServletRequest; +import java.net.URI; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.TimeZone; /** * The Class WebUtils offers methods to be used directly from xhtml via the corresponding taglib (webutils.taglib.xml) diff --git a/src/main/java/de/samply/share/client/util/connector/BrokerConnector.java b/src/main/java/de/samply/share/client/util/connector/BrokerConnector.java index 00f99b39..3f5519f5 100644 --- a/src/main/java/de/samply/share/client/util/connector/BrokerConnector.java +++ b/src/main/java/de/samply/share/client/util/connector/BrokerConnector.java @@ -31,8 +31,8 @@ import com.google.gson.Gson; import de.samply.common.http.HttpConnector; import de.samply.share.client.control.ApplicationBean; -import de.samply.share.client.model.check.CheckResult; import de.samply.share.client.model.Inquiries; +import de.samply.share.client.model.check.CheckResult; import de.samply.share.client.model.check.Message; import de.samply.share.client.model.db.enums.BrokerStatusType; import de.samply.share.client.model.db.enums.EventMessageType; @@ -44,11 +44,9 @@ import de.samply.share.client.util.db.*; import de.samply.share.common.model.dto.monitoring.StatusReportItem; import de.samply.share.common.utils.Constants; -import de.samply.share.common.utils.ProjectInfo; import de.samply.share.common.utils.SamplyShareUtils; import de.samply.share.model.bbmri.BbmriResult; import de.samply.share.model.common.*; - import org.apache.http.*; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; @@ -582,7 +580,7 @@ public boolean inquiryHasExpose(int inquiryId) throws BrokerConnectorException { * @param inquiryDetails the inquiry details object * @param reply the reply to submit to the broker */ - public void reply(InquiryDetails inquiryDetails, Object reply) throws BrokerConnectorException { + public void reply(InquiryDetails inquiryDetails, Object reply, LdmConnector ldmConnector) throws BrokerConnectorException { try { de.samply.share.client.model.db.tables.pojos.Inquiry inquiry = InquiryUtil.fetchInquiryById(inquiryDetails.getInquiryId()); int inquirySourceId = inquiry.getSourceId(); @@ -595,16 +593,16 @@ public void reply(InquiryDetails inquiryDetails, Object reply) throws BrokerConn String replyString=""; JSONObject stats= new JSONObject(); - if (ProjectInfo.INSTANCE.getProjectName().equals("dktk")) { + if (ldmConnector instanceof LdmConnectorCentraxx) { if (reply.getClass() == Integer.class) { replyString = Integer.toString((Integer) reply); } else { replyString = reply.toString(); } - } else if (ProjectInfo.INSTANCE.getProjectName().equals("samply")) { + } else if (ldmConnector instanceof LdmConnectorSamplystoreBiobank) { BbmriResult result = (BbmriResult) reply; - //stats.put("donor", NumberDisguiser.getDisguisedNumber(result.getNumberOfDonors())); + stats.put("donor", NumberDisguiser.getDisguisedNumber(result.getNumberOfDonors())); stats.put("sample", NumberDisguiser.getDisguisedNumber(result.getNumberOfSamples())); replyString = stats.toString(); } diff --git a/src/main/java/de/samply/share/client/util/connector/CentralSearchConnector.java b/src/main/java/de/samply/share/client/util/connector/CentralSearchConnector.java index b99de3ce..bac71daf 100644 --- a/src/main/java/de/samply/share/client/util/connector/CentralSearchConnector.java +++ b/src/main/java/de/samply/share/client/util/connector/CentralSearchConnector.java @@ -30,12 +30,11 @@ import de.samply.common.http.HttpConnector; import de.samply.share.client.control.ApplicationBean; -import de.samply.share.client.messages.Messages; -import de.samply.share.client.model.check.CheckResult; import de.samply.share.client.model.EnumConfiguration; import de.samply.share.client.model.centralsearch.DateRestriction; import de.samply.share.client.model.centralsearch.PatientUploadResult; import de.samply.share.client.model.centralsearch.UploadStats; +import de.samply.share.client.model.check.CheckResult; import de.samply.share.client.model.check.Message; import de.samply.share.client.model.db.enums.EventMessageType; import de.samply.share.client.model.db.enums.TargetType; diff --git a/src/main/java/de/samply/share/client/util/connector/IdManagerConnector.java b/src/main/java/de/samply/share/client/util/connector/IdManagerConnector.java index 0bb28e64..a12d79b6 100644 --- a/src/main/java/de/samply/share/client/util/connector/IdManagerConnector.java +++ b/src/main/java/de/samply/share/client/util/connector/IdManagerConnector.java @@ -33,10 +33,10 @@ import com.google.gson.JsonSyntaxException; import de.samply.common.http.HttpConnector; import de.samply.share.client.control.ApplicationBean; -import de.samply.share.client.model.check.CheckResult; import de.samply.share.client.model.EnumConfiguration; import de.samply.share.client.model.IdManagerInfo; import de.samply.share.client.model.IdObject; +import de.samply.share.client.model.check.CheckResult; import de.samply.share.client.model.check.Message; import de.samply.share.client.util.connector.exception.IdManagerConnectorException; import de.samply.share.client.util.db.ConfigurationUtil; diff --git a/src/main/java/de/samply/share/client/util/connector/LdmConnectorCentraxx.java b/src/main/java/de/samply/share/client/util/connector/LdmConnectorCentraxx.java index efbe82b2..e8315c37 100644 --- a/src/main/java/de/samply/share/client/util/connector/LdmConnectorCentraxx.java +++ b/src/main/java/de/samply/share/client/util/connector/LdmConnectorCentraxx.java @@ -40,9 +40,9 @@ import de.samply.common.mdrclient.MdrClient; import de.samply.common.mdrclient.MdrConnectionException; import de.samply.share.client.control.ApplicationBean; +import de.samply.share.client.model.EnumConfiguration; import de.samply.share.client.model.EnumConfigurationTimings; import de.samply.share.client.model.check.CheckResult; -import de.samply.share.client.model.EnumConfiguration; import de.samply.share.client.model.check.Message; import de.samply.share.client.model.check.ReferenceQueryCheckResult; import de.samply.share.client.util.MdrUtils; @@ -56,11 +56,12 @@ import de.samply.share.model.ccp.ObjectFactory; import de.samply.share.model.ccp.Patient; import de.samply.share.model.ccp.QueryResult; -import de.samply.share.model.common.*; import de.samply.share.model.common.Error; -import de.samply.share.model.common.QueryResultStatistic; +import de.samply.share.model.common.*; import de.samply.share.utils.QueryConverter; -import org.apache.http.*; +import org.apache.http.HttpEntity; +import org.apache.http.HttpHeaders; +import org.apache.http.HttpHost; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; @@ -71,7 +72,8 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; -import java.io.*; +import java.io.File; +import java.io.IOException; import java.net.MalformedURLException; import java.text.SimpleDateFormat; import java.util.ArrayList; diff --git a/src/main/java/de/samply/share/client/util/connector/LdmConnectorSamplystore.java b/src/main/java/de/samply/share/client/util/connector/LdmConnectorSamplystore.java index 81008079..91216a87 100644 --- a/src/main/java/de/samply/share/client/util/connector/LdmConnectorSamplystore.java +++ b/src/main/java/de/samply/share/client/util/connector/LdmConnectorSamplystore.java @@ -1,12 +1,40 @@ +/* + * Copyright (c) 2017 Medical Informatics Group (MIG), + * Universitätsklinikum Frankfurt + * + * Contact: www.mig-frankfurt.de + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program; if not, see . + * + * Additional permission under GNU GPL version 3 section 7: + * + * If you modify this Program, or any covered work, by linking or combining it + * with Jersey (https://jersey.java.net) (or a modified version of that + * library), containing parts covered by the terms of the General Public + * License, version 2.0, the licensors of this Program grant you additional + * permission to convey the resulting work. + */ + package de.samply.share.client.util.connector; +import com.google.common.base.Splitter; import com.google.common.base.Stopwatch; import de.samply.common.http.HttpConnector; import de.samply.common.ldmclient.LdmClientException; -import de.samply.common.ldmclient.centraxx.LdmClientCentraxx; import de.samply.common.ldmclient.centraxx.LdmClientCentraxxException; -import de.samply.common.ldmclient.samplystoreBiobank.LdmClientSamplystoreBiobank; -import de.samply.common.ldmclient.samplystoreBiobank.LdmClientSamplystoreBiobankException; +import de.samply.common.ldmclient.samplystore.LdmClientSamplystore; +import de.samply.common.ldmclient.samplystore.LdmClientSamplystoreException; import de.samply.common.mdrclient.MdrClient; import de.samply.common.mdrclient.MdrConnectionException; import de.samply.share.client.control.ApplicationBean; @@ -22,11 +50,12 @@ import de.samply.share.common.utils.MdrIdDatatype; import de.samply.share.common.utils.ProjectInfo; import de.samply.share.common.utils.SamplyShareUtils; -import de.samply.share.model.bbmri.BbmriResult; import de.samply.share.model.common.*; import de.samply.share.model.common.Error; +import de.samply.share.model.common.QueryResultStatistic; import de.samply.share.model.osse.ObjectFactory; import de.samply.share.model.osse.Patient; +import de.samply.share.model.osse.QueryResult; import de.samply.share.utils.QueryConverter; import org.apache.http.HttpEntity; import org.apache.http.HttpHost; @@ -52,22 +81,21 @@ import static de.samply.dktk.converter.PatientConverterUtil.convertDate; -public class LdmConnectorSamplystoreBiobank implements LdmConnector { - - /** - * Implementation of the LdmConnector interface for samply store rest backends - */ +/** + * Implementation of the LdmConnector interface for samply store rest backends + */ +public class LdmConnectorSamplystore implements LdmConnector { - private static final Logger logger = LogManager.getLogger(de.samply.share.client.util.connector.LdmConnectorSamplystoreBiobank.class); + private static final Logger logger = LogManager.getLogger(LdmConnectorSamplystore.class); private transient HttpConnector httpConnector; private transient MdrClient mdrClient; - private LdmClientSamplystoreBiobank ldmClient; + private LdmClientSamplystore ldmClient; private CloseableHttpClient httpClient; private String samplystoreBaseUrl; private HttpHost samplystoreHost; - public LdmConnectorSamplystoreBiobank() { + public LdmConnectorSamplystore() { try { init(); this.mdrClient = ApplicationBean.getMdrClient(); @@ -76,7 +104,7 @@ public LdmConnectorSamplystoreBiobank() { } } - public LdmConnectorSamplystoreBiobank(boolean useCaching) { + public LdmConnectorSamplystore(boolean useCaching) { try { init(useCaching); this.mdrClient = ApplicationBean.getMdrClient(); @@ -85,7 +113,7 @@ public LdmConnectorSamplystoreBiobank(boolean useCaching) { } } - public LdmConnectorSamplystoreBiobank(boolean useCaching, int maxCacheSize) { + public LdmConnectorSamplystore(boolean useCaching, int maxCacheSize) { try { init(useCaching, maxCacheSize); this.mdrClient = ApplicationBean.getMdrClient(); @@ -100,7 +128,7 @@ private void init() throws LDMConnectorException { httpConnector = ApplicationBean.getHttpConnector(); this.samplystoreHost = SamplyShareUtils.getAsHttpHost(samplystoreBaseUrl); httpClient = httpConnector.getHttpClient(samplystoreHost); - this.ldmClient = new LdmClientSamplystoreBiobank(httpClient, samplystoreBaseUrl); + this.ldmClient = new LdmClientSamplystore(httpClient, samplystoreBaseUrl); } catch (MalformedURLException | LdmClientException e) { throw new LDMConnectorException(e); } @@ -112,7 +140,7 @@ private void init(boolean useCaching) throws LDMConnectorException { httpConnector = ApplicationBean.getHttpConnector(); this.samplystoreHost = SamplyShareUtils.getAsHttpHost(samplystoreBaseUrl); httpClient = httpConnector.getHttpClient(samplystoreHost); - this.ldmClient = new LdmClientSamplystoreBiobank(httpClient, samplystoreBaseUrl, useCaching); + this.ldmClient = new LdmClientSamplystore(httpClient, samplystoreBaseUrl, useCaching); } catch (MalformedURLException | LdmClientException e) { throw new LDMConnectorException(e); } @@ -124,22 +152,40 @@ private void init(boolean useCaching, int maxCacheSize) throws LDMConnectorExcep httpConnector = ApplicationBean.getHttpConnector(); this.samplystoreHost = SamplyShareUtils.getAsHttpHost(samplystoreBaseUrl); httpClient = httpConnector.getHttpClient(samplystoreHost); - this.ldmClient = new LdmClientSamplystoreBiobank(httpClient, samplystoreBaseUrl, useCaching, maxCacheSize); + this.ldmClient = new LdmClientSamplystore(httpClient, samplystoreBaseUrl, useCaching, maxCacheSize); } catch (MalformedURLException | LdmClientException e) { throw new LDMConnectorException(e); } } + /** + * {@inheritDoc} + * + * @param completeMdsViewFields not yet supported + * @param statisticsOnly not yet supported + */ @Override - public String postQuery(de.samply.share.model.common.Query query, List removeKeysFromView, boolean completeMdsViewFields, boolean statisticsOnly, boolean includeAdditionalViewfields) throws LDMConnectorException { + public String postQuery(Query query, List removeKeysFromView, boolean completeMdsViewFields, boolean statisticsOnly, boolean includeAdditionalViewfields) throws LDMConnectorException { try { View view = new View(); view.setQuery(query); // TODO: How to get viewfields for samply store to use? ViewFields viewFields = new ViewFields(); + // Add additional viewfields, as defined in the config + String additionalViewfields = ConfigurationUtil.getConfigurationElementValue(EnumConfiguration.INQUIRY_ADDITIONAL_MDRKEYS); + if (includeAdditionalViewfields && !SamplyShareUtils.isNullOrEmpty(additionalViewfields)) { + List viewFieldList = Splitter.on(';').splitToList(additionalViewfields); + for (String viewField : viewFieldList) { + viewFields.getMdrKey().add(viewField); + } + } + view.setViewFields(viewFields); - return ldmClient.postView(view,statisticsOnly); + if (!SamplyShareUtils.isNullOrEmpty(removeKeysFromView)) { + view = QueryConverter.removeAttributesFromView(view, removeKeysFromView); + } + return ldmClient.postView(view); } catch (LdmClientException e) { throw new LDMConnectorException(e); } @@ -174,7 +220,7 @@ public String postCriteriaString(String criteria, boolean completeMdsViewFields, * {@inheritDoc} */ @Override - public BbmriResult getResults(String location) throws LDMConnectorException { + public QueryResult getResults(String location) throws LDMConnectorException { try { return ldmClient.getResult(location); } catch (LdmClientException e) { @@ -186,10 +232,10 @@ public BbmriResult getResults(String location) throws LDMConnectorException { * {@inheritDoc} */ @Override - public BbmriResult getResultsFromPage(String location, int page) throws LDMConnectorException { + public QueryResult getResultsFromPage(String location, int page) throws LDMConnectorException { try { return ldmClient.getResultPage(location, page); - } catch (LdmClientSamplystoreBiobankException e) { + } catch (LdmClientSamplystoreException e) { throw new LDMConnectorException(e); } } @@ -213,7 +259,7 @@ public boolean isQueryPresent(String location) throws LDMConnectorException { public Object getStatsOrError(String location) throws LDMConnectorException { try { return ldmClient.getStatsOrError(location); - } catch (LdmClientSamplystoreBiobankException e) { + } catch (LdmClientSamplystoreException e) { throw new LDMConnectorException(e); } } @@ -225,7 +271,7 @@ public Object getStatsOrError(String location) throws LDMConnectorException { public QueryResultStatistic getQueryResultStatistic(String location) throws LDMConnectorException { try { return ldmClient.getQueryResultStatistic(location); - } catch (LdmClientSamplystoreBiobankException e) { + } catch (LdmClientSamplystoreException e) { throw new LDMConnectorException(e); } } @@ -237,7 +283,7 @@ public QueryResultStatistic getQueryResultStatistic(String location) throws LDMC public Integer getResultCount(String location) throws LDMConnectorException { try { return ldmClient.getResultCount(location); - } catch (LdmClientSamplystoreBiobankException e) { + } catch (LdmClientSamplystoreException e) { throw new LDMConnectorException(e); } } @@ -272,35 +318,39 @@ public boolean isFirstResultPageAvailable(String location) throws LDMConnectorEx return ldmClient.isResultPageAvailable(location, 0); } + /** + * {@inheritDoc} + */ @Override - public boolean isResultDone(String location, de.samply.share.model.common.QueryResultStatistic qrs) throws LDMConnectorException { + public boolean isResultDone(String location, QueryResultStatistic queryResultStatistic) throws LDMConnectorException { if (SamplyShareUtils.isNullOrEmpty(location)) { throw new LDMConnectorException("Location of query is empty"); } - if (qrs != null) { - if (qrs.getTotalSize() == 0) { + + if (queryResultStatistic != null) { + if (queryResultStatistic.getTotalSize() == 0) { return true; } - int lastPageIndex = qrs.getNumberOfPages() - 1; + int lastPageIndex = queryResultStatistic.getNumberOfPages() - 1; return ldmClient.isResultPageAvailable(location, lastPageIndex); } else { throw new LDMConnectorException("QueryResultStatistic is null."); } } - /** * {@inheritDoc} */ @Override - public void writeQueryResultPageToDisk(BbmriResult queryResult, int index) throws IOException { + public void writeQueryResultPageToDisk(QueryResult queryResult, int index) throws IOException { try { File dir = (File) ProjectInfo.INSTANCE.getServletContext().getAttribute(TEMPDIR); - File xmlFile = new File(dir + System.getProperty("file.separator") + queryResult.getQueryId() + "_" + index + "_transformed" + XML_SUFFIX); - final JAXBContext context = JAXBContext.newInstance(BbmriResult.class); + File xmlFile = new File(dir + System.getProperty("file.separator") + queryResult.getId() + "_" + index + "_transformed" + XML_SUFFIX); + final JAXBContext context = JAXBContext.newInstance(QueryResult.class); final Marshaller marshaller = context.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); - marshaller.marshal(queryResult, xmlFile); + ObjectFactory objectFactory = new ObjectFactory(); + marshaller.marshal(objectFactory.createQueryResult(queryResult), xmlFile); } catch (JAXBException e) { throw new IOException(e); } @@ -353,40 +403,42 @@ public CheckResult checkConnection() { */ @Override public int getPatientCount(boolean dktkFlagged) throws LDMConnectorException, InterruptedException { - int maxAttempts = ConfigurationUtil.getConfigurationTimingsElementValue( - EnumConfigurationTimings.JOB_CHECK_INQUIRY_STATUS_RESULTS_RETRY_ATTEMPTS); - int secondsSleep = ConfigurationUtil.getConfigurationTimingsElementValue( - EnumConfigurationTimings.JOB_CHECK_INQUIRY_STATUS_RESULTS_RETRY_INTERVAL_SECONDS); - int retryNr = 0; - - View view = createViewForMonitoring(); - String resultLocation = null; try { - resultLocation = ldmClient.postView(view); - } catch (LdmClientException e) { - e.printStackTrace(); - } - do { - try { - Integer resultCount = getResultCount(resultLocation); - if (resultCount != null) { - return resultCount; + int maxAttempts = ConfigurationUtil.getConfigurationTimingsElementValue( + EnumConfigurationTimings.JOB_CHECK_INQUIRY_STATUS_RESULTS_RETRY_ATTEMPTS); + int secondsSleep = ConfigurationUtil.getConfigurationTimingsElementValue( + EnumConfigurationTimings.JOB_CHECK_INQUIRY_STATUS_RESULTS_RETRY_INTERVAL_SECONDS); + int retryNr = 0; + + View view = createViewForMonitoring(dktkFlagged); + String resultLocation = ldmClient.postView(view); + do { + try { + Integer resultCount = getResultCount(resultLocation); + if (resultCount != null) { + return resultCount; + } + } catch (LDMConnectorException e) { + // Catch the exception since it might just mean the result is not ready yet } - } catch (LDMConnectorException e) { - // Catch the exception since it might just mean the result is not ready yet - } - TimeUnit.SECONDS.sleep(secondsSleep); - } while (++retryNr < maxAttempts); + TimeUnit.SECONDS.sleep(secondsSleep); + } while (++retryNr < maxAttempts); + } catch (LdmClientSamplystoreException e) { + throw new LDMConnectorException(e); + } return 0; } + /** + * {@inheritDoc} + */ @Override - public ReferenceQueryCheckResult getReferenceQueryCheckResult(de.samply.share.model.common.Query referenceQuery) throws LDMConnectorException { + public ReferenceQueryCheckResult getReferenceQueryCheckResult(Query referenceQuery) throws LDMConnectorException { ReferenceQueryCheckResult result = new ReferenceQueryCheckResult(); try { View referenceView = createReferenceViewForMonitoring(referenceQuery); Stopwatch stopwatch = Stopwatch.createStarted(); - String resultLocation = ldmClient.postView(referenceView, false); + String resultLocation = ldmClient.postView(referenceView); int maxAttempts = ConfigurationUtil.getConfigurationTimingsElementValue( EnumConfigurationTimings.JOB_CHECK_INQUIRY_STATUS_RESULTS_RETRY_ATTEMPTS); @@ -402,18 +454,13 @@ public ReferenceQueryCheckResult getReferenceQueryCheckResult(de.samply.share.mo Error error = (Error) statsOrError; switch (error.getErrorCode()) { - case LdmClientCentraxx.ERROR_CODE_DATE_PARSING_ERROR: - case LdmClientCentraxx.ERROR_CODE_UNIMPLEMENTED: - case LdmClientCentraxx.ERROR_CODE_UNCLASSIFIED_WITH_STACKTRACE: - logger.warn("Could not execute reference query correctly. Error: " + error.getErrorCode() + ": " + error.getDescription()); - return result; - case LdmClientCentraxx.ERROR_CODE_UNKNOWN_MDRKEYS: + case LdmClientSamplystore.ERROR_CODE_UNKNOWN_MDRKEYS: default: ArrayList unknownKeys = new ArrayList<>(); unknownKeys.addAll(error.getMdrKey()); referenceView = QueryConverter.removeAttributesFromView(referenceView, unknownKeys); stopwatch.start(); - resultLocation = ldmClient.postView(referenceView, false); + resultLocation = ldmClient.postView(referenceView); break; } } else if (statsOrError.getClass().equals(QueryResultStatistic.class)) { @@ -432,8 +479,8 @@ public ReferenceQueryCheckResult getReferenceQueryCheckResult(de.samply.share.mo return result; } } while (retryNr < maxAttempts); - } catch (LdmClientSamplystoreBiobankException e) { - e.printStackTrace(); + } catch (LdmClientSamplystoreException e) { + throw new LDMConnectorException(e); } return result; } @@ -444,12 +491,26 @@ public ReferenceQueryCheckResult getReferenceQueryCheckResult(de.samply.share.mo * @param dktkFlagged when true, only count those with dktk consent. when false, count ALL (not just those without consent) * @return the constructed view object that can be posted to centraxx */ - private View createViewForMonitoring() throws LDMConnectorException { + private View createViewForMonitoring(boolean dktkFlagged) throws LDMConnectorException { MdrIdDatatype mdrKeyDktkConsent = new MdrIdDatatype(ConfigurationUtil.getConfigurationElementValue(EnumConfiguration.MDR_KEY_CONSENT_DKTK)); View view = new View(); Query query = new Query(); + ObjectFactory objectFactory = new ObjectFactory(); Where where = new Where(); + And and = new And(); + + if (dktkFlagged) { + Attribute attr_dktkFlag = new Attribute(); + attr_dktkFlag.setMdrKey(mdrKeyDktkConsent.getLatestCentraxx()); + attr_dktkFlag.setValue(objectFactory.createValue("true")); + + Eq equals = new Eq(); + equals.setAttribute(attr_dktkFlag); + and.getAndOrEqOrLike().add(equals); + where.getAndOrEqOrLike().add(and); + } + query.setWhere(where); view.setQuery(query); try { @@ -469,11 +530,11 @@ private View createViewForMonitoring() throws LDMConnectorException { private View createReferenceViewForMonitoring(Query referenceQuery) throws LDMConnectorException { View view = new View(); view.setQuery(referenceQuery); -// try { -// view.setViewFields(MdrUtils.getViewFields(true)); -// } catch (MdrConnectionException | ExecutionException e) { -// throw new LDMConnectorException(e); -// } + try { + view.setViewFields(MdrUtils.getViewFields(true)); + } catch (MdrConnectionException | ExecutionException e) { + throw new LDMConnectorException(e); + } return view; } @@ -512,4 +573,3 @@ public de.samply.share.model.ccp.QueryResult getExportQueryResult(de.samply.shar return null; } } - diff --git a/src/main/java/de/samply/share/client/util/connector/LdmConnectorSamplystoreBiobank.java b/src/main/java/de/samply/share/client/util/connector/LdmConnectorSamplystoreBiobank.java new file mode 100644 index 00000000..87f45044 --- /dev/null +++ b/src/main/java/de/samply/share/client/util/connector/LdmConnectorSamplystoreBiobank.java @@ -0,0 +1,472 @@ +package de.samply.share.client.util.connector; + +import de.samply.common.http.HttpConnector; +import de.samply.common.ldmclient.LdmClientException; +import de.samply.common.ldmclient.centraxx.LdmClientCentraxxException; +import de.samply.common.ldmclient.samplystoreBiobank.LdmClientSamplystoreBiobank; +import de.samply.common.ldmclient.samplystoreBiobank.LdmClientSamplystoreBiobankException; +import de.samply.common.mdrclient.MdrClient; +import de.samply.common.mdrclient.MdrConnectionException; +import de.samply.share.client.control.ApplicationBean; +import de.samply.share.client.model.EnumConfiguration; +import de.samply.share.client.model.EnumConfigurationTimings; +import de.samply.share.client.model.check.CheckResult; +import de.samply.share.client.model.check.Message; +import de.samply.share.client.model.check.ReferenceQueryCheckResult; +import de.samply.share.client.util.MdrUtils; +import de.samply.share.client.util.Utils; +import de.samply.share.client.util.connector.exception.LDMConnectorException; +import de.samply.share.client.util.db.ConfigurationUtil; +import de.samply.share.common.utils.MdrIdDatatype; +import de.samply.share.common.utils.ProjectInfo; +import de.samply.share.common.utils.SamplyShareUtils; +import de.samply.share.model.bbmri.BbmriResult; +import de.samply.share.model.common.*; +import de.samply.share.model.osse.ObjectFactory; +import de.samply.share.model.osse.Patient; +import de.samply.share.utils.QueryConverter; +import org.apache.http.HttpEntity; +import org.apache.http.HttpHost; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.util.EntityUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import java.io.File; +import java.io.IOException; +import java.net.MalformedURLException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; + +import static de.samply.dktk.converter.PatientConverterUtil.convertDate; + +public class LdmConnectorSamplystoreBiobank implements LdmConnector { + + /** + * Implementation of the LdmConnector interface for samply store rest backends + */ + + private static final Logger logger = LogManager.getLogger(de.samply.share.client.util.connector.LdmConnectorSamplystoreBiobank.class); + + private transient HttpConnector httpConnector; + private transient MdrClient mdrClient; + private LdmClientSamplystoreBiobank ldmClient; + private CloseableHttpClient httpClient; + private String samplystoreBaseUrl; + private HttpHost samplystoreHost; + + public LdmConnectorSamplystoreBiobank() { + try { + init(); + this.mdrClient = ApplicationBean.getMdrClient(); + } catch (LDMConnectorException e) { + throw new RuntimeException(e); + } + } + + public LdmConnectorSamplystoreBiobank(boolean useCaching) { + try { + init(useCaching); + this.mdrClient = ApplicationBean.getMdrClient(); + } catch (LDMConnectorException e) { + throw new RuntimeException(e); + } + } + + public LdmConnectorSamplystoreBiobank(boolean useCaching, int maxCacheSize) { + try { + init(useCaching, maxCacheSize); + this.mdrClient = ApplicationBean.getMdrClient(); + } catch (LDMConnectorException e) { + throw new RuntimeException(e); + } + } + + private void init() throws LDMConnectorException { + try { + this.samplystoreBaseUrl = SamplyShareUtils.addTrailingSlash(ConfigurationUtil.getConfigurationElementValue(EnumConfiguration.LDM_URL)); + httpConnector = ApplicationBean.getHttpConnector(); + this.samplystoreHost = SamplyShareUtils.getAsHttpHost(samplystoreBaseUrl); + httpClient = httpConnector.getHttpClient(samplystoreHost); + this.ldmClient = new LdmClientSamplystoreBiobank(httpClient, samplystoreBaseUrl); + } catch (MalformedURLException | LdmClientException e) { + throw new LDMConnectorException(e); + } + } + + private void init(boolean useCaching) throws LDMConnectorException { + try { + this.samplystoreBaseUrl = SamplyShareUtils.addTrailingSlash(ConfigurationUtil.getConfigurationElementValue(EnumConfiguration.LDM_URL)); + httpConnector = ApplicationBean.getHttpConnector(); + this.samplystoreHost = SamplyShareUtils.getAsHttpHost(samplystoreBaseUrl); + httpClient = httpConnector.getHttpClient(samplystoreHost); + this.ldmClient = new LdmClientSamplystoreBiobank(httpClient, samplystoreBaseUrl, useCaching); + } catch (MalformedURLException | LdmClientException e) { + throw new LDMConnectorException(e); + } + } + + private void init(boolean useCaching, int maxCacheSize) throws LDMConnectorException { + try { + this.samplystoreBaseUrl = SamplyShareUtils.addTrailingSlash(ConfigurationUtil.getConfigurationElementValue(EnumConfiguration.LDM_URL)); + httpConnector = ApplicationBean.getHttpConnector(); + this.samplystoreHost = SamplyShareUtils.getAsHttpHost(samplystoreBaseUrl); + httpClient = httpConnector.getHttpClient(samplystoreHost); + this.ldmClient = new LdmClientSamplystoreBiobank(httpClient, samplystoreBaseUrl, useCaching, maxCacheSize); + } catch (MalformedURLException | LdmClientException e) { + throw new LDMConnectorException(e); + } + } + + @Override + public String postQuery(de.samply.share.model.common.Query query, List removeKeysFromView, boolean completeMdsViewFields, boolean statisticsOnly, boolean includeAdditionalViewfields) throws LDMConnectorException { + try { + View view = new View(); + view.setQuery(query); + // TODO: How to get viewfields for samply store to use? + ViewFields viewFields = new ViewFields(); + + view.setViewFields(viewFields); + return ldmClient.postView(view,statisticsOnly); + } catch (LdmClientException e) { + throw new LDMConnectorException(e); + } + } + + /** + * {@inheritDoc} + */ + @Override + public String postViewString(String view, boolean statisticsOnly) throws LDMConnectorException { + try { + return ldmClient.postViewString(view); + } catch (LdmClientException e) { + throw new LDMConnectorException(e); + } + } + + /** + * {@inheritDoc} + */ + @Override + public String postCriteriaString(String criteria, boolean completeMdsViewFields, boolean statisticsOnly, boolean includeAdditionalViewfields) throws LDMConnectorException { + try { + Query query = QueryConverter.xmlToQuery(criteria); + return postQuery(query, null, completeMdsViewFields, statisticsOnly, includeAdditionalViewfields); + } catch (JAXBException e) { + throw new LDMConnectorException(e); + } + } + + /** + * {@inheritDoc} + */ + @Override + public BbmriResult getResults(String location) throws LDMConnectorException { + try { + return ldmClient.getResult(location); + } catch (LdmClientException e) { + throw new LDMConnectorException(e); + } + } + + /** + * {@inheritDoc} + */ + @Override + public BbmriResult getResultsFromPage(String location, int page) throws LDMConnectorException { + try { + return ldmClient.getResultPage(location, page); + } catch (LdmClientSamplystoreBiobankException e) { + throw new LDMConnectorException(e); + } + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isQueryPresent(String location) throws LDMConnectorException { + try { + return ldmClient.isQueryPresent(location); + } catch (LdmClientException e) { + throw new LDMConnectorException(e); + } + } + + /** + * {@inheritDoc} + */ + @Override + public Object getStatsOrError(String location) throws LDMConnectorException { + try { + return ldmClient.getStatsOrError(location); + } catch (LdmClientSamplystoreBiobankException e) { + throw new LDMConnectorException(e); + } + } + + /** + * {@inheritDoc} + */ + @Override + public QueryResultStatistic getQueryResultStatistic(String location) throws LDMConnectorException { + try { + return ldmClient.getQueryResultStatistic(location); + } catch (LdmClientSamplystoreBiobankException e) { + throw new LDMConnectorException(e); + } + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getResultCount(String location) throws LDMConnectorException { + try { + return ldmClient.getResultCount(location); + } catch (LdmClientSamplystoreBiobankException e) { + throw new LDMConnectorException(e); + } + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getPageCount(String location) throws LDMConnectorException { + try { + return ldmClient.getQueryResultStatistic(location).getNumberOfPages(); + } catch (Exception e) { + throw new LDMConnectorException(e); + } + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isFirstResultPageAvailable(String location) throws LDMConnectorException { + if (SamplyShareUtils.isNullOrEmpty(location)) { + throw new LDMConnectorException("Location of query is empty"); + } + + // If the stats are written and the results are empty, return true + Integer resultCount = getResultCount(location); + if (resultCount != null && resultCount == 0) { + return true; + } + + return ldmClient.isResultPageAvailable(location, 0); + } + + @Override + public boolean isResultDone(String location, de.samply.share.model.common.QueryResultStatistic qrs) throws LDMConnectorException { + if (SamplyShareUtils.isNullOrEmpty(location)) { + throw new LDMConnectorException("Location of query is empty"); + } + if (qrs != null) { + if (qrs.getTotalSize() == 0) { + return true; + } + int lastPageIndex = qrs.getNumberOfPages() - 1; + return ldmClient.isResultPageAvailable(location, lastPageIndex); + } else { + throw new LDMConnectorException("QueryResultStatistic is null."); + } + } + + + /** + * {@inheritDoc} + */ + @Override + public void writeQueryResultPageToDisk(BbmriResult queryResult, int index) throws IOException { + try { + File dir = (File) ProjectInfo.INSTANCE.getServletContext().getAttribute(TEMPDIR); + File xmlFile = new File(dir + System.getProperty("file.separator") + queryResult.getQueryId() + "_" + index + "_transformed" + XML_SUFFIX); + final JAXBContext context = JAXBContext.newInstance(BbmriResult.class); + final Marshaller marshaller = context.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); + marshaller.marshal(queryResult, xmlFile); + } catch (JAXBException e) { + throw new IOException(e); + } + } + + /** + * {@inheritDoc} + */ + @Override + public String getUserAgentInfo() throws LDMConnectorException { + try { + return ldmClient.getUserAgentInfo(); + } catch (LdmClientException e) { + throw new LDMConnectorException(e); + } + } + + /** + * {@inheritDoc} + */ + @Override + public CheckResult checkConnection() { + CheckResult result = new CheckResult(); + result.setExecutionDate(new Date()); + HttpGet httpGet = new HttpGet(samplystoreBaseUrl + "rest/info/"); + result.getMessages().add(new Message(httpGet.getRequestLine().toString(), "fa-long-arrow-right")); + + try (CloseableHttpResponse response = httpClient.execute(samplystoreHost, httpGet)) { + HttpEntity entity = response.getEntity(); + EntityUtils.consume(entity); + + result.getMessages().add(new Message(response.getStatusLine().toString(), "fa-long-arrow-left")); + int statusCode = response.getStatusLine().getStatusCode(); + + if (statusCode >= 200 && statusCode < 400) { + result.setSuccess(true); + } else { + result.setSuccess(false); + result.getMessages().add(new Message(EntityUtils.toString(entity), "fa-long-arrow-left")); + } + } catch (IOException ioe) { + result.getMessages().add(new Message("IOException: " + ioe.getMessage(), "fa-bolt")); + result.setSuccess(false); + } + return result; + } + + /** + * {@inheritDoc} + */ + @Override + public int getPatientCount(boolean dktkFlagged) throws LDMConnectorException, InterruptedException { + int maxAttempts = ConfigurationUtil.getConfigurationTimingsElementValue( + EnumConfigurationTimings.JOB_CHECK_INQUIRY_STATUS_RESULTS_RETRY_ATTEMPTS); + int secondsSleep = ConfigurationUtil.getConfigurationTimingsElementValue( + EnumConfigurationTimings.JOB_CHECK_INQUIRY_STATUS_RESULTS_RETRY_INTERVAL_SECONDS); + int retryNr = 0; + + View view = createViewForMonitoring(dktkFlagged); + String resultLocation = null; + try { + resultLocation = ldmClient.postView(view); + } catch (LdmClientException e) { + e.printStackTrace(); + } + do { + try { + Integer resultCount = getResultCount(resultLocation); + if (resultCount != null) { + return resultCount; + } + } catch (LDMConnectorException e) { + // Catch the exception since it might just mean the result is not ready yet + } + TimeUnit.SECONDS.sleep(secondsSleep); + } while (++retryNr < maxAttempts); + return 0; + } + + @Override + public ReferenceQueryCheckResult getReferenceQueryCheckResult(de.samply.share.model.common.Query referenceQuery) throws LDMConnectorException { + return null; + } + + /** + * Create a basic view that is used to get the amount of patients in centraxx + * + * @param dktkFlagged when true, only count those with dktk consent. when false, count ALL (not just those without consent) + * @return the constructed view object that can be posted to centraxx + */ + private View createViewForMonitoring(boolean dktkFlagged) throws LDMConnectorException { + MdrIdDatatype mdrKeyDktkConsent = + new MdrIdDatatype(ConfigurationUtil.getConfigurationElementValue(EnumConfiguration.MDR_KEY_CONSENT_DKTK)); + View view = new View(); + Query query = new Query(); + ObjectFactory objectFactory = new ObjectFactory(); + Where where = new Where(); + And and = new And(); + + if (dktkFlagged) { + Attribute attr_dktkFlag = new Attribute(); + attr_dktkFlag.setMdrKey(mdrKeyDktkConsent.getLatestCentraxx()); + attr_dktkFlag.setValue(objectFactory.createValue("true")); + + Eq equals = new Eq(); + equals.setAttribute(attr_dktkFlag); + and.getAndOrEqOrLike().add(equals); + where.getAndOrEqOrLike().add(and); + } + + query.setWhere(where); + view.setQuery(query); + try { + view.setViewFields(MdrUtils.getViewFields(false)); + } catch (MdrConnectionException | ExecutionException e) { + throw new LDMConnectorException(e); + } + return view; + } + + /** + * Create the reference view that is used to get the amount of patients for that query + * + * @param referenceQuery the reference query, as received from the broker + * @return the constructed view object that can be posted to centraxx + */ + private View createReferenceViewForMonitoring(Query referenceQuery) throws LDMConnectorException { + View view = new View(); + view.setQuery(referenceQuery); + try { + view.setViewFields(MdrUtils.getViewFields(true)); + } catch (MdrConnectionException | ExecutionException e) { + throw new LDMConnectorException(e); + } + return view; + } + + /** + * {@inheritDoc} + */ + @Override + public int getPatientAge(Patient patient) { + String birthdayValueString = null; + + for (de.samply.share.model.osse.Attribute attr : patient.getAttribute()) { + MdrIdDatatype attrMdrId = new MdrIdDatatype(attr.getMdrKey()); + if (BIRTHDAY_MDR_ID.equalsIgnoreVersion(attrMdrId)) { + birthdayValueString = attr.getValue().getValue(); + break; + } + } + + if (birthdayValueString == null) { + return -1; + } + + try { + SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy"); + Date birthDate = convertDate(birthdayValueString, dateFormat); + Date now = new Date(); + return Utils.getDiffYears(birthDate, now); + } catch (Exception e) { + logger.error("error trying to get date: " + e); + return -1; + } + } + + @Override + public de.samply.share.model.ccp.QueryResult getExportQueryResult(de.samply.share.model.ccp.QueryResult queryResult) throws InterruptedException, IOException, LdmClientCentraxxException, JAXBException { + return null; + } +} + diff --git a/src/main/java/de/samply/share/client/util/db/BrokerUtil.java b/src/main/java/de/samply/share/client/util/db/BrokerUtil.java index 6bb89f86..c0df6044 100644 --- a/src/main/java/de/samply/share/client/util/db/BrokerUtil.java +++ b/src/main/java/de/samply/share/client/util/db/BrokerUtil.java @@ -8,7 +8,6 @@ import org.apache.logging.log4j.Logger; import org.jooq.DSLContext; -import java.sql.SQLException; import java.util.List; /** diff --git a/src/main/java/de/samply/share/client/util/db/ConfigurationUtil.java b/src/main/java/de/samply/share/client/util/db/ConfigurationUtil.java index 81835434..e3392eba 100644 --- a/src/main/java/de/samply/share/client/util/db/ConfigurationUtil.java +++ b/src/main/java/de/samply/share/client/util/db/ConfigurationUtil.java @@ -39,7 +39,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import java.sql.SQLException; import java.util.HashMap; import static de.samply.common.http.HttpConnector.*; diff --git a/src/main/java/de/samply/share/client/util/db/ContactUtil.java b/src/main/java/de/samply/share/client/util/db/ContactUtil.java index 69113011..bb520a0f 100644 --- a/src/main/java/de/samply/share/client/util/db/ContactUtil.java +++ b/src/main/java/de/samply/share/client/util/db/ContactUtil.java @@ -36,8 +36,6 @@ import org.apache.logging.log4j.Logger; import org.jooq.DSLContext; -import java.sql.SQLException; - /** * Helper Class for CRUD operations with contact objects */ diff --git a/src/main/java/de/samply/share/client/util/db/DocumentUtil.java b/src/main/java/de/samply/share/client/util/db/DocumentUtil.java index 0bea3fc1..8b058c42 100644 --- a/src/main/java/de/samply/share/client/util/db/DocumentUtil.java +++ b/src/main/java/de/samply/share/client/util/db/DocumentUtil.java @@ -30,21 +30,16 @@ import de.samply.share.client.model.db.Tables; import de.samply.share.client.model.db.tables.daos.DocumentDao; -import de.samply.share.client.model.db.tables.pojos.Inquiry; import de.samply.share.client.model.db.tables.pojos.Document; +import de.samply.share.client.model.db.tables.pojos.Inquiry; import de.samply.share.client.model.db.tables.pojos.User; import de.samply.share.client.model.db.tables.records.DocumentRecord; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.jooq.Configuration; import org.jooq.DSLContext; -import org.jooq.SQLDialect; -import org.jooq.impl.DefaultConfiguration; import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.sql.Connection; -import java.sql.SQLException; import java.util.List; /** diff --git a/src/main/java/de/samply/share/client/util/db/InquiryAnswerUtil.java b/src/main/java/de/samply/share/client/util/db/InquiryAnswerUtil.java index 941506cf..d955a4e9 100644 --- a/src/main/java/de/samply/share/client/util/db/InquiryAnswerUtil.java +++ b/src/main/java/de/samply/share/client/util/db/InquiryAnswerUtil.java @@ -33,8 +33,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import java.sql.SQLException; - /** * Helper Class for CRUD operations with inquiry answer objects */ diff --git a/src/main/java/de/samply/share/client/util/db/InquiryDetailsUtil.java b/src/main/java/de/samply/share/client/util/db/InquiryDetailsUtil.java index e7671f45..c2fdbfaf 100644 --- a/src/main/java/de/samply/share/client/util/db/InquiryDetailsUtil.java +++ b/src/main/java/de/samply/share/client/util/db/InquiryDetailsUtil.java @@ -12,7 +12,6 @@ import org.jooq.DatePart; import org.jooq.impl.DSL; -import java.sql.SQLException; import java.util.List; /** diff --git a/src/main/java/de/samply/share/client/util/db/InquiryHandlingRuleUtil.java b/src/main/java/de/samply/share/client/util/db/InquiryHandlingRuleUtil.java index b4a25f4a..0b920f1d 100644 --- a/src/main/java/de/samply/share/client/util/db/InquiryHandlingRuleUtil.java +++ b/src/main/java/de/samply/share/client/util/db/InquiryHandlingRuleUtil.java @@ -10,7 +10,6 @@ import org.apache.logging.log4j.Logger; import org.jooq.DSLContext; -import java.sql.SQLException; import java.util.List; /** diff --git a/src/main/java/de/samply/share/client/util/db/InquiryResultStatsUtil.java b/src/main/java/de/samply/share/client/util/db/InquiryResultStatsUtil.java index 149a12bd..84f37c65 100644 --- a/src/main/java/de/samply/share/client/util/db/InquiryResultStatsUtil.java +++ b/src/main/java/de/samply/share/client/util/db/InquiryResultStatsUtil.java @@ -35,7 +35,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.jooq.DSLContext; -import org.jooq.impl.DSL; import java.util.List; diff --git a/src/main/java/de/samply/share/client/util/db/InquiryResultUtil.java b/src/main/java/de/samply/share/client/util/db/InquiryResultUtil.java index 55f8d4b0..0219859f 100644 --- a/src/main/java/de/samply/share/client/util/db/InquiryResultUtil.java +++ b/src/main/java/de/samply/share/client/util/db/InquiryResultUtil.java @@ -38,7 +38,6 @@ import org.jooq.DSLContext; import org.jooq.impl.DSL; -import java.sql.SQLException; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/de/samply/share/client/util/db/InquiryUtil.java b/src/main/java/de/samply/share/client/util/db/InquiryUtil.java index a0c647f6..8df92d67 100644 --- a/src/main/java/de/samply/share/client/util/db/InquiryUtil.java +++ b/src/main/java/de/samply/share/client/util/db/InquiryUtil.java @@ -11,7 +11,6 @@ import org.apache.logging.log4j.Logger; import org.jooq.DSLContext; -import java.sql.SQLException; import java.util.List; /** diff --git a/src/main/java/de/samply/share/client/util/db/JobScheduleUtil.java b/src/main/java/de/samply/share/client/util/db/JobScheduleUtil.java index f2898094..516c3aa4 100644 --- a/src/main/java/de/samply/share/client/util/db/JobScheduleUtil.java +++ b/src/main/java/de/samply/share/client/util/db/JobScheduleUtil.java @@ -34,7 +34,6 @@ import org.apache.logging.log4j.Logger; import org.quartz.JobKey; -import java.sql.SQLException; import java.util.List; /** diff --git a/src/main/java/de/samply/share/client/util/db/RequestedEntityUtil.java b/src/main/java/de/samply/share/client/util/db/RequestedEntityUtil.java index 434c1758..505523e7 100644 --- a/src/main/java/de/samply/share/client/util/db/RequestedEntityUtil.java +++ b/src/main/java/de/samply/share/client/util/db/RequestedEntityUtil.java @@ -8,8 +8,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import java.sql.SQLException; - /** * Helper Class for CRUD operations with requested entity objects */ diff --git a/src/main/java/de/samply/share/client/util/db/TokenUtil.java b/src/main/java/de/samply/share/client/util/db/TokenUtil.java index 6bff944f..8cf65b13 100644 --- a/src/main/java/de/samply/share/client/util/db/TokenUtil.java +++ b/src/main/java/de/samply/share/client/util/db/TokenUtil.java @@ -33,8 +33,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import java.sql.SQLException; - /** * Helper Class for CRUD operations with token objects */ diff --git a/src/main/java/de/samply/share/client/util/db/UploadUtil.java b/src/main/java/de/samply/share/client/util/db/UploadUtil.java index d057c1d0..10aa1373 100644 --- a/src/main/java/de/samply/share/client/util/db/UploadUtil.java +++ b/src/main/java/de/samply/share/client/util/db/UploadUtil.java @@ -37,7 +37,6 @@ import org.apache.logging.log4j.Logger; import org.jooq.DSLContext; -import java.sql.SQLException; import java.util.List; /** diff --git a/src/main/java/de/samply/share/client/util/db/UserSeenInquiryUtil.java b/src/main/java/de/samply/share/client/util/db/UserSeenInquiryUtil.java index 953b23db..7168fd38 100644 --- a/src/main/java/de/samply/share/client/util/db/UserSeenInquiryUtil.java +++ b/src/main/java/de/samply/share/client/util/db/UserSeenInquiryUtil.java @@ -29,16 +29,14 @@ package de.samply.share.client.util.db; import de.samply.share.client.model.db.Tables; -import de.samply.share.client.model.db.tables.pojos.UserSeenInquiry; import de.samply.share.client.model.db.tables.daos.UserSeenInquiryDao; import de.samply.share.client.model.db.tables.pojos.Inquiry; import de.samply.share.client.model.db.tables.pojos.User; +import de.samply.share.client.model.db.tables.pojos.UserSeenInquiry; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.jooq.DSLContext; -import java.sql.SQLException; - /** * Helper Class for CRUD operations with user seen inquiry relations */ diff --git a/src/main/java/de/samply/share/client/util/db/UserUtil.java b/src/main/java/de/samply/share/client/util/db/UserUtil.java index 09209f88..90df9848 100644 --- a/src/main/java/de/samply/share/client/util/db/UserUtil.java +++ b/src/main/java/de/samply/share/client/util/db/UserUtil.java @@ -41,7 +41,6 @@ import org.apache.logging.log4j.Logger; import org.jooq.DSLContext; -import java.sql.SQLException; import java.sql.Timestamp; import java.util.Date; import java.util.List; diff --git a/src/main/resources/centraxx.dataelements.txt b/src/main/resources/centraxx.dataelements.txt index be2ae9dc..cc5ee60a 100644 --- a/src/main/resources/centraxx.dataelements.txt +++ b/src/main/resources/centraxx.dataelements.txt @@ -6,8 +6,8 @@ urn:adt:dataelement:103:1 PAT_DATEOFDEATH urn:adt:dataelement:104:1 PAT_TUMOURDEATH urn:adt:dataelement:105:1 DEATH_ICDCODE urn:adt:dataelement:106:1 DEATH_ICDTEXT -urn:dktk:dataelement:108:test20180913 NOT_MAPPED -urn:dktk:dataelement:109:2018-09-13 07:46:02 NOT_MAPPED +urn:dktk:dataelement:108:b2146df914b NOT_MAPPED +urn:dktk:dataelement:109:2018-04-17 14:10:15 NOT_MAPPED urn:adt:dataelement:109:1 DIAG_DIAGNOSISCODE urn:adt:dataelement:110:2 SYSADV_GRADE urn:dktk:dataelement:18:2 TNM_VERSION diff --git a/src/main/resources/centraxx.values.txt b/src/main/resources/centraxx.values.txt index d4be7ba0..79c5dc0d 100644 --- a/src/main/resources/centraxx.values.txt +++ b/src/main/resources/centraxx.values.txt @@ -4,10 +4,9 @@ urn:dktk:dataelement:1:3 S HERMAPHRODIT urn:dktk:dataelement:1:3 U UNKNOWN urn:dktk:dataelement:19:2 R2 R2a urn:dktk:dataelement:19:2 R2 R2b -urn:dktk:dataelement:19:2 RX Rx -urn:dktk:dataelement:20:3 RX Rx urn:dktk:dataelement:20:3 R2 R2a urn:dktk:dataelement:20:3 R2 R2b +urn:dktk:dataelement:24:3 V E urn:dktk:dataelement:24:3 V F urn:dktk:dataelement:24:3 V O urn:dktk:dataelement:33:2 true J @@ -33,16 +32,6 @@ urn:dktk:dataelement:6:2 U X urn:dktk:dataelement:6:2 T S urn:dktk:dataelement:68:3 O R urn:dktk:dataelement:68:3 A P -urn:dktk:dataelement:68:3 N N -urn:dktk:dataelement:68:3 I I -urn:dktk:dataelement:68:3 S S -urn:dktk:dataelement:68:3 O O -urn:dktk:dataelement:68:3 A A -urn:dktk:dataelement:70:3 A A -urn:dktk:dataelement:70:3 O O -urn:dktk:dataelement:70:3 N N -urn:dktk:dataelement:70:3 I I -urn:dktk:dataelement:70:3 S S urn:dktk:dataelement:70:3 A P urn:dktk:dataelement:70:3 O R urn:dktk:dataelement:72:2 T E diff --git a/src/main/resources/db/migration/dktk/V1__create_schema_and_types.sql b/src/main/resources/db/migration/dktk/V1__create_schema_and_types.sql index 34e02b0c..ff7a0013 100644 --- a/src/main/resources/db/migration/dktk/V1__create_schema_and_types.sql +++ b/src/main/resources/db/migration/dktk/V1__create_schema_and_types.sql @@ -1,100 +1,149 @@ CREATE SCHEMA IF NOT EXISTS samply; -SET search_path TO samply,public; +SET +search_path +TO +samply, +public; -CREATE TYPE auth_scheme_type AS ENUM ( - 'AS_APIKEY', - 'AS_BASIC', - 'AS_NTLM', - 'AS_SPNEGO', - 'AS_KERBEROS', - 'AS_DIGEST' +CREATE +TYPE +auth_scheme_type +AS +ENUM +( +'AS_APIKEY', +'AS_BASIC', +'AS_NTLM', +'AS_SPNEGO', +'AS_KERBEROS', +'AS_DIGEST' ); -CREATE TYPE inquiry_status_type AS ENUM ( - 'IS_NEW', - 'IS_PROCESSING', - 'IS_READY', - 'IS_LDM_ERROR', - 'IS_ABANDONED', - 'IS_ARCHIVED' +CREATE +TYPE +inquiry_status_type +AS +ENUM +( +'IS_NEW', +'IS_PROCESSING', +'IS_READY', +'IS_LDM_ERROR', +'IS_ABANDONED', +'IS_ARCHIVED' ); -CREATE TYPE target_type AS ENUM ( - 'TT_CENTRALSEARCH', - 'TT_HTTP_PROXY', - 'TT_HTTPS_PROXY', - 'TT_LDM', - 'TT_BROKER' +CREATE +TYPE +target_type +AS +ENUM +( +'TT_CENTRALSEARCH', +'TT_HTTP_PROXY', +'TT_HTTPS_PROXY', +'TT_LDM', +'TT_BROKER' ); -CREATE TYPE reply_rule_type AS ENUM ( - 'RR_NO_AUTOMATIC_ACTION', - 'RR_TOTAL_COUNT', - 'RR_DATA' +CREATE +TYPE +reply_rule_type +AS +ENUM +( +'RR_NO_AUTOMATIC_ACTION', +'RR_TOTAL_COUNT', +'RR_DATA' ); -CREATE TYPE entity_type AS ENUM ( - 'E_BIOMATERIAL', - 'E_CLINICAL_DATA', - 'E_PATIENT_FOR_STUDY' +CREATE +TYPE +entity_type +AS +ENUM +( +'E_BIOMATERIAL', +'E_CLINICAL_DATA', +'E_PATIENT_FOR_STUDY' ); -CREATE TYPE broker_status_type AS ENUM ( - 'BS_UNREACHABLE', - 'BS_USER_UNKNOWN', - 'BS_AUTHENTICATION_ERROR', - 'BS_ACTIVATION_PENDING', - 'BS_OK' +CREATE +TYPE +broker_status_type +AS +ENUM +( +'BS_UNREACHABLE', +'BS_USER_UNKNOWN', +'BS_AUTHENTICATION_ERROR', +'BS_ACTIVATION_PENDING', +'BS_OK' ); -CREATE TYPE upload_status_type AS ENUM ( - 'US_NEW', - 'US_QUERY_POSTED', - 'US_QUERY_READY', - 'US_UPLOADING', - 'US_COMPLETED', - 'US_COMPLETED_WITH_ERRORS', - 'US_LDM_ERROR', - 'US_CENTRAL_MDSDB_ERROR', - 'US_IDMANAGER_ERROR', - 'US_ABANDONED', - 'US_CANCELED' +CREATE +TYPE +upload_status_type +AS +ENUM +( +'US_NEW', +'US_QUERY_POSTED', +'US_QUERY_READY', +'US_UPLOADING', +'US_COMPLETED', +'US_COMPLETED_WITH_ERRORS', +'US_LDM_ERROR', +'US_CENTRAL_MDSDB_ERROR', +'US_IDMANAGER_ERROR', +'US_ABANDONED', +'US_CANCELED' ); -CREATE TYPE event_message_type AS ENUM ( - 'E_SYSTEM_STARTUP', - 'E_SYSTEM_SHUTDOWN', - 'E_NEW_INQUIRY_RECEIVED', - 'E_NEW_INQUIRY_CREATED_FOR_UPLOAD', - 'E_COULD_NOT_GET_RESULT', - 'E_RESULT_EMPTY', - 'E_START_EXECUTE_INQUIRY_JOB', - 'E_REPEAT_EXECUTE_INQUIRY_JOB_WITHOUT_UNKNOWN_KEYS', - 'E_INQUIRY_RESULT_AT', - 'E_LDM_ERROR', - 'E_STATISTICS_READY', - 'E_INQUIRY_ARCHIVED', - 'E_BROKER_REPLY_ERROR', - 'E_STATUS_CHECK_ABANDONED', - 'E_ARCHIVE_INQUIRY_AFTER_THRESHOLD', - 'E_ARCHIVE_INQUIRY_RESULT_UNAVAILABLE', - 'E_RESULT_NOT_SET_ABORTING', - 'E_FAILED_JAXB_ERROR', - 'E_REPLY_SENT_TO_BROKER', - 'E_DRYRUN_COMPLETE', - 'E_UPLOAD_COMPLETE', - 'E_DELETE_ANONYMIZED_PATIENTS', - 'E_CENTRALSEARCH_COULD_NOT_CONNECT', - 'E_UPLOADSTATS_UNPARSABLE', - 'E_UPLOAD_SET_TIMESTAMP', - 'E_PATIENT_UPLOAD_RESULT', - 'E_UNAUTHORIZED_ATTEMPT_TO_ACCESS_ADMIN_AREA', - 'E_USER_CREATED', - 'E_USER_DELETED', - 'E_NO_CREDENTIALS_CS', - 'E_NO_PREVIOUS_UPLOADS', - 'E_PREVIOUS_UPLOAD_AT', - 'E_CS_ERROR_LASTUPLOADTIMESTAMP' +CREATE +TYPE +event_message_type +AS +ENUM +( +'E_SYSTEM_STARTUP', +'E_SYSTEM_SHUTDOWN', +'E_NEW_INQUIRY_RECEIVED', +'E_NEW_INQUIRY_CREATED_FOR_UPLOAD', +'E_COULD_NOT_GET_RESULT', +'E_RESULT_EMPTY', +'E_START_EXECUTE_INQUIRY_JOB', +'E_REPEAT_EXECUTE_INQUIRY_JOB_WITHOUT_UNKNOWN_KEYS', +'E_INQUIRY_RESULT_AT', +'E_LDM_ERROR', +'E_STATISTICS_READY', +'E_INQUIRY_ARCHIVED', +'E_BROKER_REPLY_ERROR', +'E_STATUS_CHECK_ABANDONED', +'E_ARCHIVE_INQUIRY_AFTER_THRESHOLD', +'E_ARCHIVE_INQUIRY_RESULT_UNAVAILABLE', +'E_RESULT_NOT_SET_ABORTING', +'E_FAILED_JAXB_ERROR', +'E_REPLY_SENT_TO_BROKER', +'E_DRYRUN_COMPLETE', +'E_UPLOAD_COMPLETE', +'E_DELETE_ANONYMIZED_PATIENTS', +'E_CENTRALSEARCH_COULD_NOT_CONNECT', +'E_UPLOADSTATS_UNPARSABLE', +'E_UPLOAD_SET_TIMESTAMP', +'E_PATIENT_UPLOAD_RESULT', +'E_UNAUTHORIZED_ATTEMPT_TO_ACCESS_ADMIN_AREA', +'E_USER_CREATED', +'E_USER_DELETED', +'E_NO_CREDENTIALS_CS', +'E_NO_PREVIOUS_UPLOADS', +'E_PREVIOUS_UPLOAD_AT', +'E_CS_ERROR_LASTUPLOADTIMESTAMP' ); -COMMENT ON SCHEMA samply IS 'schema used for samply share'; \ No newline at end of file +COMMENT +ON +SCHEMA +samply +IS +'schema used for samply share'; \ No newline at end of file diff --git a/src/main/resources/db/migration/dktk/V2__initial_tables.sql b/src/main/resources/db/migration/dktk/V2__initial_tables.sql index 731f74b6..ae2472f5 100644 --- a/src/main/resources/db/migration/dktk/V2__initial_tables.sql +++ b/src/main/resources/db/migration/dktk/V2__initial_tables.sql @@ -1,270 +1,653 @@ -- noinspection SqlNoDataSourceInspectionForFile -CREATE TABLE configuration ( - name text PRIMARY KEY, - setting text , - visible boolean DEFAULT true NOT NULL - ); - -CREATE TABLE configuration_timings ( - name text PRIMARY KEY, - setting integer DEFAULT 0 NOT NULL , - visible boolean DEFAULT true NOT NULL - ); - -CREATE TABLE credentials ( - id SERIAL PRIMARY KEY, - auth_scheme auth_scheme_type , - target target_type NOT NULL, - username text , - passcode text NOT NULL, - workstation text , - "domain" text - ); - -CREATE TABLE requested_entity ( - id SERIAL PRIMARY KEY, - name entity_type UNIQUE NOT NULL - ); - -CREATE TABLE token ( - id SERIAL PRIMARY KEY, - apikey text UNIQUE NOT NULL, - signin_token text , - expires_at timestamp - ); - -CREATE TABLE upload ( - id SERIAL PRIMARY KEY, - status upload_status_type DEFAULT 'US_NEW' NOT NULL, - triggered_at TIMESTAMP DEFAULT current_timestamp NOT NULL, - triggered_by text DEFAULT 'scheduled' NOT NULL, - is_dryrun boolean DEFAULT FALSE, - is_full_upload boolean DEFAULT FALSE, - dktk_flagged boolean, - success_count integer, - failure_count integer, - failed_patients text, - time_to_set TIMESTAMP WITHOUT TIME ZONE - ); - -CREATE TABLE "user" ( - id SERIAL PRIMARY KEY, - token_id integer UNIQUE, - username text UNIQUE NOT NULL, - password_hash text NOT NULL, - real_name text , - email text , - admin_privilege boolean DEFAULT FALSE NOT NULL - ); - -CREATE INDEX idx_user ON "user" ( token_id ); - -CREATE TABLE user_notification ( - user_id integer NOT NULL, - requested_entity_id integer NOT NULL, - PRIMARY KEY ("user_id", "requested_entity_id") - ); - -CREATE TABLE broker ( - id SERIAL PRIMARY KEY, - address text NOT NULL, - name text , - last_checked timestamp , - credentials_id integer , - status broker_status_type - ); - -CREATE INDEX idx_broker ON broker ( credentials_id ); - -CREATE TABLE inquiry_handling_rule ( - id SERIAL PRIMARY KEY, - broker_id integer , - full_result boolean DEFAULT true NOT NULL, - automatic_reply reply_rule_type DEFAULT 'RR_NO_AUTOMATIC_ACTION' NOT NULL - ); - -CREATE INDEX idx_inquiry_handling_rule ON inquiry_handling_rule ( broker_id ); - -CREATE TABLE event_log ( - id SERIAL PRIMARY KEY, - event_type event_message_type, - inquiry_id integer , - upload_id integer , - user_id integer , - quality_report_id integer , - event_time timestamp DEFAULT current_timestamp NOT NULL, - show_in_global boolean DEFAULT true NOT NULL, - entry text - ); - -CREATE INDEX idx_event_log ON event_log ( inquiry_id ); -CREATE INDEX idx_event_log_0 ON event_log ( upload_id ); -CREATE INDEX idx_event_log_1 ON event_log ( user_id ); - -CREATE TABLE inquiry ( - id SERIAL PRIMARY KEY, - upload_id integer , - source_id integer NOT NULL, - label text , - description text , - broker_id integer , - latest_details_id integer , - archived_at timestamp , - deleted_at timestamp - ); - -CREATE INDEX idx_inquiry ON inquiry ( broker_id ); -CREATE INDEX idx_inquiry_0 ON inquiry ( latest_details_id ); - -CREATE TABLE inquiry_answer ( - id SERIAL PRIMARY KEY, - inquiry_details_id integer UNIQUE NOT NULL, - sent_at timestamp DEFAULT current_timestamp NOT NULL, - content text NOT NULL - ); - -CREATE INDEX idx_inquiry_answer ON inquiry_answer ( inquiry_details_id ); - -CREATE TABLE inquiry_details ( - id SERIAL PRIMARY KEY, - inquiry_id integer NOT NULL, - contact_id integer , - revision integer NOT NULL, - received_at timestamp DEFAULT current_timestamp NOT NULL, - status inquiry_status_type NOT NULL, - criteria_original text NOT NULL, - criteria_modified text , - expose_location text - ); - -CREATE INDEX idx_inquiry_details ON inquiry_details ( inquiry_id ); - -CREATE TABLE inquiry_requested_entity ( - inquiry_id integer NOT NULL, - requested_entity_id integer NOT NULL, - PRIMARY KEY ("inquiry_id", "requested_entity_id") - ); - -CREATE TABLE inquiry_result ( - id SERIAL PRIMARY KEY, - inquiry_details_id integer NOT NULL, - is_error boolean DEFAULT false NOT NULL, - "location" text , - "size" integer , - executed_at timestamp DEFAULT current_timestamp NOT NULL, - valid_until timestamp , - statistics_only boolean DEFAULT false NOT NULL, - notification_sent boolean DEFAULT false NOT NULL, - "error_code" text - ); - -CREATE INDEX idx_inquiry_result ON inquiry_result ( inquiry_details_id ); - -CREATE TABLE inquiry_result_stats ( - id SERIAL PRIMARY KEY, - inquiry_result_id INTEGER UNIQUE NOT NULL, - stats_gender TEXT, - stats_age TEXT -); - -CREATE INDEX idx_inquiry_result_stats ON inquiry_result_stats ( inquiry_result_id ); - -CREATE TABLE user_seen_inquiry ( - user_id integer NOT NULL, - inquiry_id integer NOT NULL, - PRIMARY KEY ("user_id", "inquiry_id") - ); - -CREATE TABLE contact ( - id SERIAL PRIMARY KEY, - title text, - first_name text, - last_name text NOT NULL, - phone text, - email text, - organization_name text -); - -CREATE TABLE job_schedule ( - id SERIAL PRIMARY KEY, - job_key text UNIQUE NOT NULL, - cron_expression text NOT NULL, - paused boolean -); - -CREATE TABLE document ( - id SERIAL PRIMARY KEY, - inquiry_id INTEGER NOT NULL, - user_id INTEGER NOT NULL, - uploaded_at date NOT NULL DEFAULT CURRENT_DATE, - filetype TEXT, - filename TEXT, - data BYTEA -); - -CREATE INDEX idx_document ON document ( inquiry_id ); - - -ALTER TABLE broker ADD CONSTRAINT broker_credentials_id_fkey FOREIGN KEY ( credentials_id ) REFERENCES credentials( id ) ON DELETE SET NULL; -ALTER TABLE event_log ADD CONSTRAINT event_log_inquiry_id_fkey FOREIGN KEY ( inquiry_id ) REFERENCES inquiry( id ) ON DELETE CASCADE; -ALTER TABLE event_log ADD CONSTRAINT event_log_upload_id_fkey FOREIGN KEY ( upload_id ) REFERENCES upload( id ) ON DELETE CASCADE; -ALTER TABLE event_log ADD CONSTRAINT event_log_user_id_fkey FOREIGN KEY ( user_id ) REFERENCES "user"( id ) ON DELETE CASCADE; -ALTER TABLE inquiry ADD CONSTRAINT inquiry_upload_id_fkey FOREIGN KEY ( upload_id ) REFERENCES upload( id ) ON DELETE CASCADE; -ALTER TABLE inquiry ADD CONSTRAINT inquiry_broker_id_fkey FOREIGN KEY ( broker_id ) REFERENCES broker( id ) ON DELETE CASCADE; -ALTER TABLE inquiry ADD CONSTRAINT inquiry_broker_xor_upload CHECK ((upload_id IS NULL AND broker_id IS NOT NULL) OR (broker_id IS NULL AND upload_id IS NOT NULL)); -ALTER TABLE inquiry ADD CONSTRAINT inquiry_latest_details_id_fkey FOREIGN KEY ( latest_details_id ) REFERENCES inquiry_details( id ) ON DELETE SET NULL; -ALTER TABLE inquiry_answer ADD CONSTRAINT inquiry_answer_inquiry_details_id_fkey FOREIGN KEY ( inquiry_details_id ) REFERENCES inquiry_details( id ) ON DELETE CASCADE; -ALTER TABLE inquiry_details ADD CONSTRAINT inquiry_details_inquiry_id_fkey FOREIGN KEY ( inquiry_id ) REFERENCES inquiry( id ) ON DELETE CASCADE; -ALTER TABLE inquiry_details ADD CONSTRAINT inquiry_details_contact_id_fkey FOREIGN KEY ( contact_id ) REFERENCES contact( id ) ON DELETE SET NULL; -ALTER TABLE inquiry_handling_rule ADD CONSTRAINT inquiry_handling_rule_broker_id_fkey FOREIGN KEY ( broker_id ) REFERENCES broker( id ) ON DELETE CASCADE; -ALTER TABLE inquiry_requested_entity ADD CONSTRAINT inquiry_requested_entity_inquiry_id_fkey FOREIGN KEY ( inquiry_id ) REFERENCES inquiry( id ) ON DELETE CASCADE; -ALTER TABLE inquiry_requested_entity ADD CONSTRAINT inquiry_requested_entity_requested_entity_id_fkey FOREIGN KEY ( requested_entity_id ) REFERENCES requested_entity( id ) ON DELETE CASCADE; -ALTER TABLE inquiry_result ADD CONSTRAINT inquiry_result_inquiry_details_id_fkey FOREIGN KEY ( inquiry_details_id ) REFERENCES inquiry_details( id ) ON DELETE CASCADE; -ALTER TABLE inquiry_result_stats ADD CONSTRAINT inquiry_result_stats_inquiry_result_id_fkey FOREIGN KEY ( inquiry_result_id ) REFERENCES inquiry_result( id ) ON DELETE CASCADE; -ALTER TABLE "user" ADD CONSTRAINT user_token_id_fkey FOREIGN KEY ( token_id ) REFERENCES token( id ) ON DELETE SET NULL; -ALTER TABLE user_notification ADD CONSTRAINT user_notification_user_id_fkey FOREIGN KEY ( user_id ) REFERENCES "user"( id ) ON DELETE CASCADE; -ALTER TABLE user_notification ADD CONSTRAINT user_notification_requested_entity_id_fkey FOREIGN KEY ( requested_entity_id ) REFERENCES requested_entity( id ) ON DELETE CASCADE; -ALTER TABLE user_seen_inquiry ADD CONSTRAINT user_seen_inquiry_user_id_fkey FOREIGN KEY ( user_id ) REFERENCES "user"( id ) ON DELETE CASCADE; -ALTER TABLE user_seen_inquiry ADD CONSTRAINT user_seen_inquiry_inquiry_id_fkey FOREIGN KEY ( inquiry_id ) REFERENCES inquiry( id ) ON DELETE CASCADE; -ALTER TABLE document ADD CONSTRAINT document_inquiry_id_fkey FOREIGN KEY (inquiry_id) REFERENCES inquiry(id) ON DELETE CASCADE; - - -COMMENT ON COLUMN configuration.visible IS 'Is this visible on the web interface?'; -COMMENT ON TABLE configuration_timings IS 'Use an extra table for timing parameters for the sake of simply using integers'; -COMMENT ON TABLE credentials IS 'Stored credentials for central search, searchbrokers, local datamanagement...'; -COMMENT ON COLUMN credentials.target IS 'proxy? central search? broker? user?'; -COMMENT ON COLUMN credentials.passcode IS 'May be a hashed password for the user login or a plain password for central search or maybe just an apikey'; -COMMENT ON COLUMN credentials.workstation IS 'Currently not used. Might be relevant for other auth schemes'; -COMMENT ON COLUMN credentials."domain" IS 'Currently not used. Might be relevant for other auth schemes'; -COMMENT ON TABLE requested_entity IS 'An inquirer can request different types of entities (biomaterial, clinical data...)'; -COMMENT ON TABLE upload IS 'Uploads to central search.'; -COMMENT ON COLUMN upload.triggered_by IS 'Who triggered the upload? Was it automatically by the scheduler, or did a user do it?'; -COMMENT ON COLUMN upload.success_count IS 'How many upload datasets were acknowledged with a 2xx status code'; -COMMENT ON COLUMN upload.failure_count IS 'How many upload datasets were finally denied'; -COMMENT ON COLUMN upload.failed_patients IS 'A JSON array of DKTK site ids of the failed patients'; -COMMENT ON COLUMN upload.time_to_set IS 'The timestamp that will be set at the central mds db at the end of the upload'; -COMMENT ON COLUMN "user".token_id IS 'The user might have a login token assigned to himself in order to allow logging in from other components (e.g. OSSE.EDC)'; -COMMENT ON COLUMN "user".password_hash IS 'bcrypt encoded password'; -COMMENT ON COLUMN "user".real_name IS 'The real name(s) of the user, may include title(s)'; -COMMENT ON TABLE user_notification IS 'Which user shall receive which notifications?'; -COMMENT ON COLUMN broker.address IS 'The base URL of the searchbroker'; -COMMENT ON COLUMN broker.name IS 'A self-assigned name of the searchbroker (e.g. "Decentral Searchbroker for DKTK")'; -COMMENT ON COLUMN broker.last_checked IS 'When was this searchbroker queries the last time?'; -COMMENT ON TABLE inquiry_handling_rule IS 'Incoming inquiries may be handled differently, depending on several criteria. Allow to define an "if" part which has to be handled in the application, a link to a specific broker (may be null), a link to a certain result type (may also be null) as well as an action to take (e.g. instantly reply a number)'; -COMMENT ON COLUMN inquiry_handling_rule.full_result IS 'Should the full result be generated here?'; -COMMENT ON CONSTRAINT inquiry_handling_rule_broker_id_fkey ON inquiry_handling_rule IS 'May be linked to a certain broker (but does not have to)'; -COMMENT ON TABLE event_log IS 'Log certain events that happen during job execution. E.g. Upload was triggered or inquiry was received/executed'; -COMMENT ON COLUMN event_log.event_time IS 'when did the logged event occur?'; -COMMENT ON COLUMN event_log.entry IS 'Either a message or a set of parameters. As a JSON String'; -COMMENT ON CONSTRAINT inquiry_broker_xor_upload ON inquiry IS 'Uploads can also spawn inquiries. In this case, set the upload id. upload_id XOR broker_id have to be set'; -COMMENT ON COLUMN inquiry.archived_at IS 'if this inquiry was archived...set the timestamp here. if it is not archived, this shall be null'; -COMMENT ON COLUMN inquiry.deleted_at IS 'allow to mark an inquiry as deleted. set to null if it is not deleted'; -COMMENT ON COLUMN inquiry_answer.inquiry_details_id IS 'which revision of the inquiry was answered?'; -COMMENT ON COLUMN inquiry_answer.content IS 'What was sent? This may contain different types of data...use json to keep it generic'; -COMMENT ON COLUMN inquiry_details.criteria_original IS 'the criteria xml snippet as received from source'; -COMMENT ON COLUMN inquiry_details.criteria_modified IS 'if the original criteria had unknown keys which were removed...keep the modified one as well'; -COMMENT ON COLUMN inquiry_result."location" IS 'The URL where the result can be found'; -COMMENT ON COLUMN inquiry_result.notification_sent IS 'has the user been notified about this inquiry?'; -COMMENT ON TABLE job_schedule IS 'For regularly executed tasks, set the cron schedule expression here'; -COMMENT ON TABLE document IS 'Users can upload (modified) export files in order to track what they may have sent to other people' \ No newline at end of file +CREATE TABLE configuration +( + name text PRIMARY KEY, + setting text, + visible boolean DEFAULT true NOT NULL +); + +CREATE TABLE configuration_timings +( + name text PRIMARY KEY, + setting integer DEFAULT 0 NOT NULL, + visible boolean DEFAULT true NOT NULL +); + +CREATE TABLE credentials +( + id SERIAL PRIMARY KEY, + auth_scheme auth_scheme_type, + target target_type NOT NULL, + username text, + passcode text NOT NULL, + workstation text, + "domain" text +); + +CREATE TABLE requested_entity +( + id SERIAL PRIMARY KEY, + name entity_type UNIQUE NOT NULL +); + +CREATE TABLE token +( + id SERIAL PRIMARY KEY, + apikey text UNIQUE NOT NULL, + signin_token text, + expires_at timestamp +); + +CREATE TABLE upload +( + id SERIAL PRIMARY KEY, + status upload_status_type DEFAULT 'US_NEW' NOT NULL, + triggered_at TIMESTAMP DEFAULT current_timestamp NOT NULL, + triggered_by text DEFAULT 'scheduled' NOT NULL, + is_dryrun boolean DEFAULT FALSE, + is_full_upload boolean DEFAULT FALSE, + dktk_flagged boolean, + success_count integer, + failure_count integer, + failed_patients text, + time_to_set TIMESTAMP WITHOUT TIME ZONE +); + +CREATE TABLE "user" +( + id SERIAL PRIMARY KEY, + token_id integer UNIQUE, + username text UNIQUE NOT NULL, + password_hash text NOT NULL, + real_name text, + email text, + admin_privilege boolean DEFAULT FALSE NOT NULL +); + +CREATE +INDEX +idx_user +ON +"user" +( +token_id +); + +CREATE TABLE user_notification +( + user_id integer NOT NULL, + requested_entity_id integer NOT NULL, + PRIMARY KEY ("user_id", "requested_entity_id") +); + +CREATE TABLE broker +( + id SERIAL PRIMARY KEY, + address text NOT NULL, + name text, + last_checked timestamp, + credentials_id integer, + status broker_status_type +); + +CREATE +INDEX +idx_broker +ON +broker +( +credentials_id +); + +CREATE TABLE inquiry_handling_rule +( + id SERIAL PRIMARY KEY, + broker_id integer, + full_result boolean DEFAULT true NOT NULL, + automatic_reply reply_rule_type DEFAULT 'RR_NO_AUTOMATIC_ACTION' NOT NULL +); + +CREATE +INDEX +idx_inquiry_handling_rule +ON +inquiry_handling_rule +( +broker_id +); + +CREATE TABLE event_log +( + id SERIAL PRIMARY KEY, + event_type event_message_type, + inquiry_id integer, + upload_id integer, + user_id integer, + quality_report_id integer, + event_time timestamp DEFAULT current_timestamp NOT NULL, + show_in_global boolean DEFAULT true NOT NULL, + entry text +); + +CREATE +INDEX +idx_event_log +ON +event_log +( +inquiry_id +); +CREATE +INDEX +idx_event_log_0 +ON +event_log +( +upload_id +); +CREATE +INDEX +idx_event_log_1 +ON +event_log +( +user_id +); + +CREATE TABLE inquiry +( + id SERIAL PRIMARY KEY, + upload_id integer, + source_id integer NOT NULL, + label text, + description text, + broker_id integer, + latest_details_id integer, + archived_at timestamp, + deleted_at timestamp +); + +CREATE +INDEX +idx_inquiry +ON +inquiry +( +broker_id +); +CREATE +INDEX +idx_inquiry_0 +ON +inquiry +( +latest_details_id +); + +CREATE TABLE inquiry_answer +( + id SERIAL PRIMARY KEY, + inquiry_details_id integer UNIQUE NOT NULL, + sent_at timestamp DEFAULT current_timestamp NOT NULL, + content text NOT NULL +); + +CREATE +INDEX +idx_inquiry_answer +ON +inquiry_answer +( +inquiry_details_id +); + +CREATE TABLE inquiry_details +( + id SERIAL PRIMARY KEY, + inquiry_id integer NOT NULL, + contact_id integer, + revision integer NOT NULL, + received_at timestamp DEFAULT current_timestamp NOT NULL, + status inquiry_status_type NOT NULL, + criteria_original text NOT NULL, + criteria_modified text, + expose_location text +); + +CREATE +INDEX +idx_inquiry_details +ON +inquiry_details +( +inquiry_id +); + +CREATE TABLE inquiry_requested_entity +( + inquiry_id integer NOT NULL, + requested_entity_id integer NOT NULL, + PRIMARY KEY ("inquiry_id", "requested_entity_id") +); + +CREATE TABLE inquiry_result +( + id SERIAL PRIMARY KEY, + inquiry_details_id integer NOT NULL, + is_error boolean DEFAULT false NOT NULL, + "location" text, + "size" integer, + executed_at timestamp DEFAULT current_timestamp NOT NULL, + valid_until timestamp, + statistics_only boolean DEFAULT false NOT NULL, + notification_sent boolean DEFAULT false NOT NULL, + "error_code" text +); + +CREATE +INDEX +idx_inquiry_result +ON +inquiry_result +( +inquiry_details_id +); + +CREATE TABLE inquiry_result_stats +( + id SERIAL PRIMARY KEY, + inquiry_result_id INTEGER UNIQUE NOT NULL, + stats_gender TEXT, + stats_age TEXT +); + +CREATE +INDEX +idx_inquiry_result_stats +ON +inquiry_result_stats +( +inquiry_result_id +); + +CREATE TABLE user_seen_inquiry +( + user_id integer NOT NULL, + inquiry_id integer NOT NULL, + PRIMARY KEY ("user_id", "inquiry_id") +); + +CREATE TABLE contact +( + id SERIAL PRIMARY KEY, + title text, + first_name text, + last_name text NOT NULL, + phone text, + email text, + organization_name text +); + +CREATE TABLE job_schedule +( + id SERIAL PRIMARY KEY, + job_key text UNIQUE NOT NULL, + cron_expression text NOT NULL, + paused boolean +); + +CREATE TABLE document +( + id SERIAL PRIMARY KEY, + inquiry_id INTEGER NOT NULL, + user_id INTEGER NOT NULL, + uploaded_at date NOT NULL DEFAULT CURRENT_DATE, + filetype TEXT, + filename TEXT, + data BYTEA +); + +CREATE +INDEX +idx_document +ON +document +( +inquiry_id +); + + +ALTER TABLE broker + ADD CONSTRAINT broker_credentials_id_fkey FOREIGN KEY (credentials_id) REFERENCES credentials (id) ON DELETE SET NULL; +ALTER TABLE event_log + ADD CONSTRAINT event_log_inquiry_id_fkey FOREIGN KEY (inquiry_id) REFERENCES inquiry (id) ON DELETE CASCADE; +ALTER TABLE event_log + ADD CONSTRAINT event_log_upload_id_fkey FOREIGN KEY (upload_id) REFERENCES upload (id) ON DELETE CASCADE; +ALTER TABLE event_log + ADD CONSTRAINT event_log_user_id_fkey FOREIGN KEY (user_id) REFERENCES "user" (id) ON DELETE CASCADE; +ALTER TABLE inquiry + ADD CONSTRAINT inquiry_upload_id_fkey FOREIGN KEY (upload_id) REFERENCES upload (id) ON DELETE CASCADE; +ALTER TABLE inquiry + ADD CONSTRAINT inquiry_broker_id_fkey FOREIGN KEY (broker_id) REFERENCES broker (id) ON DELETE CASCADE; +ALTER TABLE inquiry + ADD CONSTRAINT inquiry_broker_xor_upload CHECK ((upload_id IS NULL AND broker_id IS NOT NULL) OR + (broker_id IS NULL AND upload_id IS NOT NULL)); +ALTER TABLE inquiry + ADD CONSTRAINT inquiry_latest_details_id_fkey FOREIGN KEY (latest_details_id) REFERENCES inquiry_details (id) ON DELETE SET NULL; +ALTER TABLE inquiry_answer + ADD CONSTRAINT inquiry_answer_inquiry_details_id_fkey FOREIGN KEY (inquiry_details_id) REFERENCES inquiry_details (id) ON DELETE CASCADE; +ALTER TABLE inquiry_details + ADD CONSTRAINT inquiry_details_inquiry_id_fkey FOREIGN KEY (inquiry_id) REFERENCES inquiry (id) ON DELETE CASCADE; +ALTER TABLE inquiry_details + ADD CONSTRAINT inquiry_details_contact_id_fkey FOREIGN KEY (contact_id) REFERENCES contact (id) ON DELETE SET NULL; +ALTER TABLE inquiry_handling_rule + ADD CONSTRAINT inquiry_handling_rule_broker_id_fkey FOREIGN KEY (broker_id) REFERENCES broker (id) ON DELETE CASCADE; +ALTER TABLE inquiry_requested_entity + ADD CONSTRAINT inquiry_requested_entity_inquiry_id_fkey FOREIGN KEY (inquiry_id) REFERENCES inquiry (id) ON DELETE CASCADE; +ALTER TABLE inquiry_requested_entity + ADD CONSTRAINT inquiry_requested_entity_requested_entity_id_fkey FOREIGN KEY (requested_entity_id) REFERENCES requested_entity (id) ON DELETE CASCADE; +ALTER TABLE inquiry_result + ADD CONSTRAINT inquiry_result_inquiry_details_id_fkey FOREIGN KEY (inquiry_details_id) REFERENCES inquiry_details (id) ON DELETE CASCADE; +ALTER TABLE inquiry_result_stats + ADD CONSTRAINT inquiry_result_stats_inquiry_result_id_fkey FOREIGN KEY (inquiry_result_id) REFERENCES inquiry_result (id) ON DELETE CASCADE; +ALTER TABLE "user" + ADD CONSTRAINT user_token_id_fkey FOREIGN KEY (token_id) REFERENCES token (id) ON DELETE SET NULL; +ALTER TABLE user_notification + ADD CONSTRAINT user_notification_user_id_fkey FOREIGN KEY (user_id) REFERENCES "user" (id) ON DELETE CASCADE; +ALTER TABLE user_notification + ADD CONSTRAINT user_notification_requested_entity_id_fkey FOREIGN KEY (requested_entity_id) REFERENCES requested_entity (id) ON DELETE CASCADE; +ALTER TABLE user_seen_inquiry + ADD CONSTRAINT user_seen_inquiry_user_id_fkey FOREIGN KEY (user_id) REFERENCES "user" (id) ON DELETE CASCADE; +ALTER TABLE user_seen_inquiry + ADD CONSTRAINT user_seen_inquiry_inquiry_id_fkey FOREIGN KEY (inquiry_id) REFERENCES inquiry (id) ON DELETE CASCADE; +ALTER TABLE document + ADD CONSTRAINT document_inquiry_id_fkey FOREIGN KEY (inquiry_id) REFERENCES inquiry (id) ON DELETE CASCADE; + + +COMMENT +ON +COLUMN +configuration +. +visible +IS +'Is this visible on the web interface?'; +COMMENT +ON +TABLE +configuration_timings +IS +'Use an extra table for timing parameters for the sake of simply using integers'; +COMMENT +ON +TABLE +credentials +IS +'Stored credentials for central search, searchbrokers, local datamanagement...'; +COMMENT +ON +COLUMN +credentials +. +target +IS +'proxy? central search? broker? user?'; +COMMENT +ON +COLUMN +credentials +. +passcode +IS +'May be a hashed password for the user login or a plain password for central search or maybe just an apikey'; +COMMENT +ON +COLUMN +credentials +. +workstation +IS +'Currently not used. Might be relevant for other auth schemes'; +COMMENT +ON +COLUMN +credentials +. +"domain" +IS +'Currently not used. Might be relevant for other auth schemes'; +COMMENT +ON +TABLE +requested_entity +IS +'An inquirer can request different types of entities (biomaterial, clinical data...)'; +COMMENT +ON +TABLE +upload +IS +'Uploads to central search.'; +COMMENT +ON +COLUMN +upload +. +triggered_by +IS +'Who triggered the upload? Was it automatically by the scheduler, or did a user do it?'; +COMMENT +ON +COLUMN +upload +. +success_count +IS +'How many upload datasets were acknowledged with a 2xx status code'; +COMMENT +ON +COLUMN +upload +. +failure_count +IS +'How many upload datasets were finally denied'; +COMMENT +ON +COLUMN +upload +. +failed_patients +IS +'A JSON array of DKTK site ids of the failed patients'; +COMMENT +ON +COLUMN +upload +. +time_to_set +IS +'The timestamp that will be set at the central mds db at the end of the upload'; +COMMENT +ON +COLUMN +"user" +. +token_id +IS +'The user might have a login token assigned to himself in order to allow logging in from other components (e.g. OSSE.EDC)'; +COMMENT +ON +COLUMN +"user" +. +password_hash +IS +'bcrypt encoded password'; +COMMENT +ON +COLUMN +"user" +. +real_name +IS +'The real name(s) of the user, may include title(s)'; +COMMENT +ON +TABLE +user_notification +IS +'Which user shall receive which notifications?'; +COMMENT +ON +COLUMN +broker +. +address +IS +'The base URL of the searchbroker'; +COMMENT +ON +COLUMN +broker +. +name +IS +'A self-assigned name of the searchbroker (e.g. "Decentral Searchbroker for DKTK")'; +COMMENT +ON +COLUMN +broker +. +last_checked +IS +'When was this searchbroker queries the last time?'; +COMMENT +ON +TABLE +inquiry_handling_rule +IS +'Incoming inquiries may be handled differently, depending on several criteria. Allow to define an "if" part which has to be handled in the application, a link to a specific broker (may be null), a link to a certain result type (may also be null) as well as an action to take (e.g. instantly reply a number)'; +COMMENT +ON +COLUMN +inquiry_handling_rule +. +full_result +IS +'Should the full result be generated here?'; +COMMENT +ON +CONSTRAINT +inquiry_handling_rule_broker_id_fkey +ON +inquiry_handling_rule +IS +'May be linked to a certain broker (but does not have to)'; +COMMENT +ON +TABLE +event_log +IS +'Log certain events that happen during job execution. E.g. Upload was triggered or inquiry was received/executed'; +COMMENT +ON +COLUMN +event_log +. +event_time +IS +'when did the logged event occur?'; +COMMENT +ON +COLUMN +event_log +. +entry +IS +'Either a message or a set of parameters. As a JSON String'; +COMMENT +ON +CONSTRAINT +inquiry_broker_xor_upload +ON +inquiry +IS +'Uploads can also spawn inquiries. In this case, set the upload id. upload_id XOR broker_id have to be set'; +COMMENT +ON +COLUMN +inquiry +. +archived_at +IS +'if this inquiry was archived...set the timestamp here. if it is not archived, this shall be null'; +COMMENT +ON +COLUMN +inquiry +. +deleted_at +IS +'allow to mark an inquiry as deleted. set to null if it is not deleted'; +COMMENT +ON +COLUMN +inquiry_answer +. +inquiry_details_id +IS +'which revision of the inquiry was answered?'; +COMMENT +ON +COLUMN +inquiry_answer +. +content +IS +'What was sent? This may contain different types of data...use json to keep it generic'; +COMMENT +ON +COLUMN +inquiry_details +. +criteria_original +IS +'the criteria xml snippet as received from source'; +COMMENT +ON +COLUMN +inquiry_details +. +criteria_modified +IS +'if the original criteria had unknown keys which were removed...keep the modified one as well'; +COMMENT +ON +COLUMN +inquiry_result +. +"location" +IS +'The URL where the result can be found'; +COMMENT +ON +COLUMN +inquiry_result +. +notification_sent +IS +'has the user been notified about this inquiry?'; +COMMENT +ON +TABLE +job_schedule +IS +'For regularly executed tasks, set the cron schedule expression here'; +COMMENT +ON +TABLE +document +IS +'Users can upload (modified) export files in order to track what they may have sent to other people' \ No newline at end of file diff --git a/src/main/resources/db/migration/dktk/V3__initial_dml.sql b/src/main/resources/db/migration/dktk/V3__initial_dml.sql index 145914e3..94d25b3e 100644 --- a/src/main/resources/db/migration/dktk/V3__initial_dml.sql +++ b/src/main/resources/db/migration/dktk/V3__initial_dml.sql @@ -1,103 +1,226 @@ -INSERT INTO requested_entity(name) SELECT unnest(enum_range(NULL::entity_type)); +INSERT INTO requested_entity(name) +SELECT unnest(enum_range(NULL ::entity_type)); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_BASE_URL', 'https://centralsearch-test.ccpit.dktk.dkfz.de'); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_PATH', ''); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_AUTOMATIC_UPLOAD', 'false'); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_AUTOMATIC_UPLOAD_AT', '03:00'); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_UPLOAD_PATIENTS_WITH_LOCAL_CONSENT', 'false'); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_UPLOAD_RANDOMIZE_EXPORT_IDS', 'false'); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_DELETE_BEFORE_UPLOAD', 'false'); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_NEXT_UPLOAD_FULL', 'false'); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_SHOW_UPLOAD_PATIENTS_WITH_LOCAL_CONSENT', ''); -INSERT INTO samply.configuration(name, setting) VALUES ('DECENTRAL_SEARCH_MAIL_RECEIVER_ADDRESS', ''); -INSERT INTO samply.configuration(name, setting) VALUES ('DECENTRAL_SEARCH_MAIL_SHARE_URL', ''); -INSERT INTO samply.configuration(name, setting) VALUES ('MDR_URL', 'https://mdr.ccp-it.dktk.dkfz.de/v3/api/mdr'); -INSERT INTO samply.configuration(name, setting) VALUES ('LDM_URL', 'http://localhost:8080/centraxx/'); -INSERT INTO samply.configuration(name, setting) VALUES ('ID_MANAGER_URL', 'http://localhost:8180/ID-Manager'); -INSERT INTO samply.configuration(name, setting) VALUES ('ID_MANAGER_NETWORK_ID', 'DKTK'); -INSERT INTO samply.configuration(name, setting) VALUES ('ID_MANAGER_INSTANCE_ID', ''); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_ANONYMIZED_PATIENTS_PREFIX', 'TESTANO_'); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_GRP_MDSK', 'urn:dktk:dataelementgroup:7:latest', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_GRP_MDSB', 'urn:dktk:dataelementgroup:8:latest', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_KEY_UPLOAD_FROM', 'urn:dktk:dataelement:64:', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_KEY_UPLOAD_TO', 'urn:dktk:dataelement:63:', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_KEY_CONSENT_DKTK', 'urn:dktk:dataelement:62:', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_KEY_DKTK_GLOBAL_ID', 'urn:dktk:dataelement:54:', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_KEY_GENDER', 'urn:dktk:dataelement:1:', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_KEY_AGE_AT_DIAGNOSIS', 'urn:dktk:dataelement:28:', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_KEY_CASE_DATE', 'urn:dktk:dataelement:27:', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_KEY_CENTRAXX_MAPPING_VERSION', 'urn:dktk:dataelement:108:', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_KEY_CENTRAXX_MAPPING_DATE', 'urn:dktk:dataelement:109:', false); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_BASE_URL', 'https://centralsearch-test.ccpit.dktk.dkfz.de'); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_PATH', ''); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_AUTOMATIC_UPLOAD', 'false'); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_AUTOMATIC_UPLOAD_AT', '03:00'); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_UPLOAD_PATIENTS_WITH_LOCAL_CONSENT', 'false'); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_UPLOAD_RANDOMIZE_EXPORT_IDS', 'false'); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_DELETE_BEFORE_UPLOAD', 'false'); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_NEXT_UPLOAD_FULL', 'false'); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_SHOW_UPLOAD_PATIENTS_WITH_LOCAL_CONSENT', ''); +INSERT INTO samply.configuration(name, setting) +VALUES ('DECENTRAL_SEARCH_MAIL_RECEIVER_ADDRESS', ''); +INSERT INTO samply.configuration(name, setting) +VALUES ('DECENTRAL_SEARCH_MAIL_SHARE_URL', ''); +INSERT INTO samply.configuration(name, setting) +VALUES ('MDR_URL', 'https://mdr.ccp-it.dktk.dkfz.de/v3/api/mdr'); +INSERT INTO samply.configuration(name, setting) +VALUES ('LDM_URL', 'http://localhost:8080/centraxx/'); +INSERT INTO samply.configuration(name, setting) +VALUES ('ID_MANAGER_URL', 'http://localhost:8180/ID-Manager'); +INSERT INTO samply.configuration(name, setting) +VALUES ('ID_MANAGER_NETWORK_ID', 'DKTK'); +INSERT INTO samply.configuration(name, setting) +VALUES ('ID_MANAGER_INSTANCE_ID', ''); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_ANONYMIZED_PATIENTS_PREFIX', 'TESTANO_'); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_GRP_MDSK', 'urn:dktk:dataelementgroup:7:latest', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_GRP_MDSB', 'urn:dktk:dataelementgroup:8:latest', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_KEY_UPLOAD_FROM', 'urn:dktk:dataelement:64:', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_KEY_UPLOAD_TO', 'urn:dktk:dataelement:63:', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_KEY_CONSENT_DKTK', 'urn:dktk:dataelement:62:', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_KEY_DKTK_GLOBAL_ID', 'urn:dktk:dataelement:54:', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_KEY_GENDER', 'urn:dktk:dataelement:1:', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_KEY_AGE_AT_DIAGNOSIS', 'urn:dktk:dataelement:28:', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_KEY_CASE_DATE', 'urn:dktk:dataelement:27:', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_KEY_CENTRAXX_MAPPING_VERSION', 'urn:dktk:dataelement:108:', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_KEY_CENTRAXX_MAPPING_DATE', 'urn:dktk:dataelement:109:', false); -- Quality Report Parameters -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_NAMESPACE', 'dktk', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_AUTH_USER_ID', '20', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_AUTH_KEY_ID', '2', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_AUTH_URL', 'https://auth.ccp-it.dktk.dkfz.de', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_AUTH_PRIVATE_KEY_BASE_64', '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', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MAX_ATTEMPTS', '54', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MAX_TIME_TO_WAIT_IN_MILLIS', '300000', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_ONLY_STATISTICS_AVAILABLE', 'true', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MDR_LINK_PREFIX', 'https://mdr.ccp-it.dktk.dkfz.de/detail.xhtml?urn=', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MAX_NUMBER_OF_PATIENT_IDS_TO_BE_SHOWN', '200', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_CENTRAXX_DATAELEMENTS_FILE', 'centraxx.dataelements.txt', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_CENTRAXX_ATTRIBUTES_FILE', 'centraxx.attributes.txt', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_IGNORED_DATAELEMENTS', 'urn:dktk:dataelement:41:3, urn:dktk:dataelement:47:3, urn:dktk:dataelement:71:2, urn:dktk:dataelement:84:2, urn:dktk:dataelement:20:3', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_DIRECTORY', 'C:\ProgramData\dktk\reports', true); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_LOCATION', 'LocalDev', true); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_BASIC_FILENAME', 'quality-report', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_SCHEDULER_FORMAT', 'by-year', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_SCHEDULER_YEARS', '20', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_GROUP_MODUL', '5', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_SCHEDULER_BY_YEAR', '', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_SCHEDULER_BY_MONTH', '', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_STATISTICS_FILENAME', 'quality-report-statistics.txt', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_EXCEL_INFO_FILENAME', 'quality-report-info.xlsx', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_EXCEL_INFO_URL', 'https://deployment.ccp-it.dktk.dkfz.de/static/qualityreport/quality-report-info.xlsx', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_LANGUAGE_CODE', 'de', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_NAMESPACE', 'dktk', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_AUTH_USER_ID', '20', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_AUTH_KEY_ID', '2', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_AUTH_URL', 'https://auth.ccp-it.dktk.dkfz.de', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_AUTH_PRIVATE_KEY_BASE_64', + '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', + false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MAX_ATTEMPTS', '54', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MAX_TIME_TO_WAIT_IN_MILLIS', '300000', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_ONLY_STATISTICS_AVAILABLE', 'true', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MDR_LINK_PREFIX', 'https://mdr.ccp-it.dktk.dkfz.de/detail.xhtml?urn=', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MAX_NUMBER_OF_PATIENT_IDS_TO_BE_SHOWN', '200', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_CENTRAXX_DATAELEMENTS_FILE', 'centraxx.dataelements.txt', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_CENTRAXX_ATTRIBUTES_FILE', 'centraxx.attributes.txt', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_IGNORED_DATAELEMENTS', + 'urn:dktk:dataelement:41:3, urn:dktk:dataelement:47:3, urn:dktk:dataelement:71:2, urn:dktk:dataelement:84:2, urn:dktk:dataelement:20:3', + false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_DIRECTORY', 'C:\ProgramData\dktk\reports', true); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_LOCATION', 'LocalDev', true); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_BASIC_FILENAME', 'quality-report', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_SCHEDULER_FORMAT', 'by-year', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_SCHEDULER_YEARS', '20', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_GROUP_MODUL', '5', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_SCHEDULER_BY_YEAR', '', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_SCHEDULER_BY_MONTH', '', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_STATISTICS_FILENAME', 'quality-report-statistics.txt', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_EXCEL_INFO_FILENAME', 'quality-report-info.xlsx', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_EXCEL_INFO_URL', + 'https://deployment.ccp-it.dktk.dkfz.de/static/qualityreport/quality-report-info.xlsx', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_LANGUAGE_CODE', 'de', false); -- Configuration for Report to Monitoring -INSERT INTO samply.configuration(name, setting, visible) VALUES ('MONITORING_REPORT_COUNT_TOTAL', 'false', true); -INSERT INTO samply.configuration(name, setting, visible) VALUES ('MONITORING_REPORT_COUNT_DKTKFLAG', 'false', true); -INSERT INTO samply.configuration(name, setting, visible) VALUES ('MONITORING_REPORT_COUNT_REFERENCEQUERY', 'false', true); -INSERT INTO samply.configuration(name, setting, visible) VALUES ('MONITORING_REPORT_TIME_REFERENCEQUERY', 'false', true); -INSERT INTO samply.configuration(name, setting, visible) VALUES ('MONITORING_REPORT_CENTRAXX_MAPPING_INFORMATION', 'false', true); +INSERT INTO samply.configuration(name, setting, visible) +VALUES ('MONITORING_REPORT_COUNT_TOTAL', 'false', true); +INSERT INTO samply.configuration(name, setting, visible) +VALUES ('MONITORING_REPORT_COUNT_DKTKFLAG', 'false', true); +INSERT INTO samply.configuration(name, setting, visible) +VALUES ('MONITORING_REPORT_COUNT_REFERENCEQUERY', 'false', true); +INSERT INTO samply.configuration(name, setting, visible) +VALUES ('MONITORING_REPORT_TIME_REFERENCEQUERY', 'false', true); +INSERT INTO samply.configuration(name, setting, visible) +VALUES ('MONITORING_REPORT_CENTRAXX_MAPPING_INFORMATION', 'false', true); -- Configuration for Job Parameters -INSERT INTO samply.configuration_timings(name, setting, visible) VALUES ('JOB_COLLECT_INQUIRIES_INTERVAL_SECONDS', 5, false); -INSERT INTO samply.configuration_timings(name, setting, visible) VALUES ('JOB_CHECK_INQUIRY_STATUS_INITIAL_DELAY_SECONDS', 5, false); -INSERT INTO samply.configuration_timings(name, setting, visible) VALUES ('JOB_CHECK_INQUIRY_STATUS_STATS_RETRY_INTERVAL_SECONDS', 10, false); -INSERT INTO samply.configuration_timings(name, setting, visible) VALUES ('JOB_CHECK_INQUIRY_STATUS_STATS_RETRY_ATTEMPTS', 6, false); -INSERT INTO samply.configuration_timings(name, setting, visible) VALUES ('JOB_CHECK_INQUIRY_STATUS_RESULTS_RETRY_INTERVAL_SECONDS', 60, false); -INSERT INTO samply.configuration_timings(name, setting, visible) VALUES ('JOB_CHECK_INQUIRY_STATUS_RESULTS_RETRY_ATTEMPTS', 10, false); -INSERT INTO samply.configuration_timings(name, setting, visible) VALUES ('JOB_MOVE_INQUIRIES_TO_ARCHIVE_AFTER_DAYS', 28, true); +INSERT INTO samply.configuration_timings(name, setting, visible) +VALUES ('JOB_COLLECT_INQUIRIES_INTERVAL_SECONDS', 5, false); +INSERT INTO samply.configuration_timings(name, setting, visible) +VALUES ('JOB_CHECK_INQUIRY_STATUS_INITIAL_DELAY_SECONDS', 5, false); +INSERT INTO samply.configuration_timings(name, setting, visible) +VALUES ('JOB_CHECK_INQUIRY_STATUS_STATS_RETRY_INTERVAL_SECONDS', 10, false); +INSERT INTO samply.configuration_timings(name, setting, visible) +VALUES ('JOB_CHECK_INQUIRY_STATUS_STATS_RETRY_ATTEMPTS', 6, false); +INSERT INTO samply.configuration_timings(name, setting, visible) +VALUES ('JOB_CHECK_INQUIRY_STATUS_RESULTS_RETRY_INTERVAL_SECONDS', 60, false); +INSERT INTO samply.configuration_timings(name, setting, visible) +VALUES ('JOB_CHECK_INQUIRY_STATUS_RESULTS_RETRY_ATTEMPTS', 10, false); +INSERT INTO samply.configuration_timings(name, setting, visible) +VALUES ('JOB_MOVE_INQUIRIES_TO_ARCHIVE_AFTER_DAYS', 28, true); -- Configuration for Upload -INSERT INTO samply.configuration_timings(name, setting, visible) VALUES ('UPLOAD_RETRY_PATIENT_UPLOAD_ATTEMPTS', 6, true); -INSERT INTO samply.configuration_timings(name, setting, visible) VALUES ('UPLOAD_RETRY_PATIENT_UPLOAD_INTERVAL', 10, true); +INSERT INTO samply.configuration_timings(name, setting, visible) +VALUES ('UPLOAD_RETRY_PATIENT_UPLOAD_ATTEMPTS', 6, true); +INSERT INTO samply.configuration_timings(name, setting, visible) +VALUES ('UPLOAD_RETRY_PATIENT_UPLOAD_INTERVAL', 10, true); -- Configuration for Caching on LDM connection -INSERT INTO samply.configuration(name, setting, visible) VALUES ('LDM_CACHING_ENABLED', 'false', true); -INSERT INTO samply.configuration(name, setting, visible) VALUES ('LDM_CACHING_MAX_SIZE', '1000', true); +INSERT INTO samply.configuration(name, setting, visible) +VALUES ('LDM_CACHING_ENABLED', 'false', true); +INSERT INTO samply.configuration(name, setting, visible) +VALUES ('LDM_CACHING_MAX_SIZE', '1000', true); -- Configuration for misc entries -INSERT INTO samply.configuration(name, setting, visible) VALUES ('DECENTRAL_SEARCH_MAIL_INCLUDE_EMPTY_RESULTS', 'true', true); +INSERT INTO samply.configuration(name, setting, visible) +VALUES ('DECENTRAL_SEARCH_MAIL_INCLUDE_EMPTY_RESULTS', 'true', true); -- Set the cron expressions for some of the jobs -INSERT INTO samply.job_schedule(job_key, cron_expression, paused) VALUES ('DecentralSearchGroup.CollectInquiriesJob', '0/10 * * * * ?', false); -INSERT INTO samply.job_schedule(job_key, cron_expression, paused) VALUES ('DecentralSearchGroup.ExecuteInquiriesJob', '0/5 * * * * ?', false); -INSERT INTO samply.job_schedule(job_key, cron_expression, paused) VALUES ('DecentralSearchGroup.SendNotificationsJob', '0 0 * * * ?', false); -INSERT INTO samply.job_schedule(job_key, cron_expression, paused) VALUES ('CentralSearchGroup.UploadToCentralMdsDbJobDktkFlag', '0 0 23 1/1 * ? *', false); -INSERT INTO samply.job_schedule(job_key, cron_expression, paused) VALUES ('CentralSearchGroup.UploadToCentralMdsDbJobNoDktkFlag', '0 0 2 ? 1/1 SAT#1 *', false); -INSERT INTO samply.job_schedule(job_key, cron_expression, paused) VALUES ('MaintenanceGroup.CheckLocalComponentsJob', '0 0 0/1 1/1 * ?', false); -INSERT INTO samply.job_schedule(job_key, cron_expression, paused) VALUES ('MaintenanceGroup.DbCleanupJob', '0 30 0 1/1 * ?', false); -INSERT INTO samply.job_schedule(job_key, cron_expression, paused) VALUES ('MaintenanceGroup.ReportToMonitoringJob', '0 0 1 1/1 * ? *', true); +INSERT INTO samply.job_schedule(job_key, cron_expression, paused) +VALUES ('DecentralSearchGroup.CollectInquiriesJob', '0/10 * * * * ?', false); +INSERT INTO samply.job_schedule(job_key, cron_expression, paused) +VALUES ('DecentralSearchGroup.ExecuteInquiriesJob', '0/5 * * * * ?', false); +INSERT INTO samply.job_schedule(job_key, cron_expression, paused) +VALUES ('DecentralSearchGroup.SendNotificationsJob', '0 0 * * * ?', false); +INSERT INTO samply.job_schedule(job_key, cron_expression, paused) +VALUES ('CentralSearchGroup.UploadToCentralMdsDbJobDktkFlag', '0 0 23 1/1 * ? *', false); +INSERT INTO samply.job_schedule(job_key, cron_expression, paused) +VALUES ('CentralSearchGroup.UploadToCentralMdsDbJobNoDktkFlag', '0 0 2 ? 1/1 SAT#1 *', false); +INSERT INTO samply.job_schedule(job_key, cron_expression, paused) +VALUES ('MaintenanceGroup.CheckLocalComponentsJob', '0 0 0/1 1/1 * ?', false); +INSERT INTO samply.job_schedule(job_key, cron_expression, paused) +VALUES ('MaintenanceGroup.DbCleanupJob', '0 30 0 1/1 * ?', false); +INSERT INTO samply.job_schedule(job_key, cron_expression, paused) +VALUES ('MaintenanceGroup.ReportToMonitoringJob', '0 0 1 1/1 * ? *', true); -- Add additional keys for the viewfields when posting to local datamanagement -INSERT INTO samply.configuration(name, setting, visible) values('INQUIRY_ADDITIONAL_MDRKEYS', 'urn:adt:dataelement:77:*;urn:adt:dataelement:78:*;urn:adt:dataelement:90:*;urn:adt:dataelement:93:*;urn:adt:dataelement:89:*;urn:adt:dataelement:91:*', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('INQUIRY_ADDITIONAL_MDRKEYS', + 'urn:adt:dataelement:77:*;urn:adt:dataelement:78:*;urn:adt:dataelement:90:*;urn:adt:dataelement:93:*;urn:adt:dataelement:89:*;urn:adt:dataelement:91:*', + false); -with tmp_token as ( - INSERT INTO Token(apikey) VALUES('ZvDKWpgCXSeed23MfbHs') RETURNING id +with +tmp_token +as +( +INSERT +INTO +Token +( +apikey ) -INSERT INTO samply.user(username, password_hash, token_id, admin_privilege) VALUES ('admin','$2a$10$nMAQW9ZUf8evd2KUU4Op.eWHK18hkiBDKYxpWnp6oxxQY8yApK4CS', (SELECT id from tmp_token), true); +VALUES +( +'ZvDKWpgCXSeed23MfbHs' +) +RETURNING +id +) +INSERT +INTO +samply +. +user +( +username, +password_hash, +token_id, +admin_privilege +) +VALUES +( +'admin', +'$2a$10$nMAQW9ZUf8evd2KUU4Op.eWHK18hkiBDKYxpWnp6oxxQY8yApK4CS', +( +SELECT +id +from +tmp_token +), +true +); -- adminpass \ No newline at end of file diff --git a/src/main/resources/db/migration/dktk/V5__tables.sql b/src/main/resources/db/migration/dktk/V5__tables.sql index 356472f3..a3daeab5 100644 --- a/src/main/resources/db/migration/dktk/V5__tables.sql +++ b/src/main/resources/db/migration/dktk/V5__tables.sql @@ -1,24 +1,51 @@ -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MDR_GROUPS', 'urn:dktk:dataelementgroup:7:latest;urn:dktk:dataelementgroup:8:latest', false); - -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_ADDITIONAL_MDR_DATA_ELEMENTS', 'urn:adt:dataelement:77:1, urn:adt:dataelement:78:1, urn:adt:dataelement:89:1, urn:adt:dataelement:90:1, urn:adt:dataelement:91:1, urn:adt:dataelement:93:1', false); - -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MDR_NAMESPACE', 'dktk, adt', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MDR_AUTH_USER_ID', '20', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MDR_AUTH_KEY_ID', '2', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MDR_AUTH_URL', 'https://auth.ccp-it.dktk.dkfz.de', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MDR_AUTH_PRIVATE_KEY_BASE_64', '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', false); - -INSERT INTO samply.configuration(name, setting, visible) values('MDR_SOURCE_GROUPS', 'urn:dktk:dataelementgroup:7:latest;urn:dktk:dataelementgroup:8:latest;urn:adt:dataelementgroup:17:latest', false); -- for versions beyond CentraXX 3.9.0 +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MDR_GROUPS', 'urn:dktk:dataelementgroup:7:latest;urn:dktk:dataelementgroup:8:latest', false); + +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_ADDITIONAL_MDR_DATA_ELEMENTS', + 'urn:adt:dataelement:77:1, urn:adt:dataelement:78:1, urn:adt:dataelement:89:1, urn:adt:dataelement:90:1, urn:adt:dataelement:91:1, urn:adt:dataelement:93:1', + false); + +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MDR_NAMESPACE', 'dktk, adt', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MDR_AUTH_USER_ID', '20', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MDR_AUTH_KEY_ID', '2', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MDR_AUTH_URL', 'https://auth.ccp-it.dktk.dkfz.de', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MDR_AUTH_PRIVATE_KEY_BASE_64', + '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', + false); + +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_SOURCE_GROUPS', + 'urn:dktk:dataelementgroup:7:latest;urn:dktk:dataelementgroup:8:latest;urn:adt:dataelementgroup:17:latest', + false); -- for versions beyond CentraXX 3.9.0 -- INSERT INTO samply.configuration(name, setting, visible) values('MDR_SOURCE_GROUPS', 'urn:dktk:dataelementgroup:7:latest;urn:dktk:dataelementgroup:8:latest', false); -- for versions before CentraXX 3.9.0 -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_CENTRAXX_VALUES_FILE', 'centraxx.values.txt', false); -DELETE FROM samply.configuration WHERE name='QUALITY_REPORT_CENTRAXX_ATTRIBUTES_FILE'; - -DELETE FROM samply.configuration WHERE name='QUALITY_REPORT_NAMESPACE' ; -DELETE FROM samply.configuration WHERE name='QUALITY_REPORT_AUTH_USER_ID'; -DELETE FROM samply.configuration WHERE name='QUALITY_REPORT_AUTH_KEY_ID'; -DELETE FROM samply.configuration WHERE name='QUALITY_REPORT_AUTH_URL'; - -DELETE FROM samply.configuration WHERE name='QUALITY_REPORT_AUTH_PRIVATE_KEY_BASE_64'; +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_CENTRAXX_VALUES_FILE', 'centraxx.values.txt', false); +DELETE +FROM samply.configuration +WHERE name = 'QUALITY_REPORT_CENTRAXX_ATTRIBUTES_FILE'; + +DELETE +FROM samply.configuration +WHERE name = 'QUALITY_REPORT_NAMESPACE'; +DELETE +FROM samply.configuration +WHERE name = 'QUALITY_REPORT_AUTH_USER_ID'; +DELETE +FROM samply.configuration +WHERE name = 'QUALITY_REPORT_AUTH_KEY_ID'; +DELETE +FROM samply.configuration +WHERE name = 'QUALITY_REPORT_AUTH_URL'; + +DELETE +FROM samply.configuration +WHERE name = 'QUALITY_REPORT_AUTH_PRIVATE_KEY_BASE_64'; diff --git a/src/main/resources/db/migration/dktk/V6__tables.sql b/src/main/resources/db/migration/dktk/V6__tables.sql index dc6f234e..c32e984e 100644 --- a/src/main/resources/db/migration/dktk/V6__tables.sql +++ b/src/main/resources/db/migration/dktk/V6__tables.sql @@ -1 +1,3 @@ -UPDATE samply.configuration SET setting='urn:dktk:dataelement:41:3, urn:dktk:dataelement:47:3, urn:dktk:dataelement:71:2, urn:dktk:dataelement:84:2' WHERE name='QUALITY_REPORT_IGNORED_DATAELEMENTS'; \ No newline at end of file +UPDATE samply.configuration +SET setting='urn:dktk:dataelement:41:3, urn:dktk:dataelement:47:3, urn:dktk:dataelement:71:2, urn:dktk:dataelement:84:2' +WHERE name = 'QUALITY_REPORT_IGNORED_DATAELEMENTS'; \ No newline at end of file diff --git a/src/main/resources/db/migration/dktk/V7__entity.sql b/src/main/resources/db/migration/dktk/V7__entity.sql index a2d8091f..e507e6dd 100644 --- a/src/main/resources/db/migration/dktk/V7__entity.sql +++ b/src/main/resources/db/migration/dktk/V7__entity.sql @@ -1 +1,8 @@ -ALTER TYPE samply.entity_type add VALUE 'UNKNOWN'; \ No newline at end of file +ALTER +TYPE +samply +. +entity_type +add +VALUE +'UNKNOWN'; \ No newline at end of file diff --git a/src/main/resources/db/migration/dktk/V8__entity2.sql b/src/main/resources/db/migration/dktk/V8__entity2.sql index 5da7d196..3044721c 100644 --- a/src/main/resources/db/migration/dktk/V8__entity2.sql +++ b/src/main/resources/db/migration/dktk/V8__entity2.sql @@ -1 +1,2 @@ -INSERT INTO requested_entity(name) values('UNKNOWN'); \ No newline at end of file +INSERT INTO requested_entity(name) +values ('UNKNOWN'); \ No newline at end of file diff --git a/src/main/resources/db/migration/samply/V1__create_schema_and_types.sql b/src/main/resources/db/migration/samply/V1__create_schema_and_types.sql index 34e02b0c..ff7a0013 100644 --- a/src/main/resources/db/migration/samply/V1__create_schema_and_types.sql +++ b/src/main/resources/db/migration/samply/V1__create_schema_and_types.sql @@ -1,100 +1,149 @@ CREATE SCHEMA IF NOT EXISTS samply; -SET search_path TO samply,public; +SET +search_path +TO +samply, +public; -CREATE TYPE auth_scheme_type AS ENUM ( - 'AS_APIKEY', - 'AS_BASIC', - 'AS_NTLM', - 'AS_SPNEGO', - 'AS_KERBEROS', - 'AS_DIGEST' +CREATE +TYPE +auth_scheme_type +AS +ENUM +( +'AS_APIKEY', +'AS_BASIC', +'AS_NTLM', +'AS_SPNEGO', +'AS_KERBEROS', +'AS_DIGEST' ); -CREATE TYPE inquiry_status_type AS ENUM ( - 'IS_NEW', - 'IS_PROCESSING', - 'IS_READY', - 'IS_LDM_ERROR', - 'IS_ABANDONED', - 'IS_ARCHIVED' +CREATE +TYPE +inquiry_status_type +AS +ENUM +( +'IS_NEW', +'IS_PROCESSING', +'IS_READY', +'IS_LDM_ERROR', +'IS_ABANDONED', +'IS_ARCHIVED' ); -CREATE TYPE target_type AS ENUM ( - 'TT_CENTRALSEARCH', - 'TT_HTTP_PROXY', - 'TT_HTTPS_PROXY', - 'TT_LDM', - 'TT_BROKER' +CREATE +TYPE +target_type +AS +ENUM +( +'TT_CENTRALSEARCH', +'TT_HTTP_PROXY', +'TT_HTTPS_PROXY', +'TT_LDM', +'TT_BROKER' ); -CREATE TYPE reply_rule_type AS ENUM ( - 'RR_NO_AUTOMATIC_ACTION', - 'RR_TOTAL_COUNT', - 'RR_DATA' +CREATE +TYPE +reply_rule_type +AS +ENUM +( +'RR_NO_AUTOMATIC_ACTION', +'RR_TOTAL_COUNT', +'RR_DATA' ); -CREATE TYPE entity_type AS ENUM ( - 'E_BIOMATERIAL', - 'E_CLINICAL_DATA', - 'E_PATIENT_FOR_STUDY' +CREATE +TYPE +entity_type +AS +ENUM +( +'E_BIOMATERIAL', +'E_CLINICAL_DATA', +'E_PATIENT_FOR_STUDY' ); -CREATE TYPE broker_status_type AS ENUM ( - 'BS_UNREACHABLE', - 'BS_USER_UNKNOWN', - 'BS_AUTHENTICATION_ERROR', - 'BS_ACTIVATION_PENDING', - 'BS_OK' +CREATE +TYPE +broker_status_type +AS +ENUM +( +'BS_UNREACHABLE', +'BS_USER_UNKNOWN', +'BS_AUTHENTICATION_ERROR', +'BS_ACTIVATION_PENDING', +'BS_OK' ); -CREATE TYPE upload_status_type AS ENUM ( - 'US_NEW', - 'US_QUERY_POSTED', - 'US_QUERY_READY', - 'US_UPLOADING', - 'US_COMPLETED', - 'US_COMPLETED_WITH_ERRORS', - 'US_LDM_ERROR', - 'US_CENTRAL_MDSDB_ERROR', - 'US_IDMANAGER_ERROR', - 'US_ABANDONED', - 'US_CANCELED' +CREATE +TYPE +upload_status_type +AS +ENUM +( +'US_NEW', +'US_QUERY_POSTED', +'US_QUERY_READY', +'US_UPLOADING', +'US_COMPLETED', +'US_COMPLETED_WITH_ERRORS', +'US_LDM_ERROR', +'US_CENTRAL_MDSDB_ERROR', +'US_IDMANAGER_ERROR', +'US_ABANDONED', +'US_CANCELED' ); -CREATE TYPE event_message_type AS ENUM ( - 'E_SYSTEM_STARTUP', - 'E_SYSTEM_SHUTDOWN', - 'E_NEW_INQUIRY_RECEIVED', - 'E_NEW_INQUIRY_CREATED_FOR_UPLOAD', - 'E_COULD_NOT_GET_RESULT', - 'E_RESULT_EMPTY', - 'E_START_EXECUTE_INQUIRY_JOB', - 'E_REPEAT_EXECUTE_INQUIRY_JOB_WITHOUT_UNKNOWN_KEYS', - 'E_INQUIRY_RESULT_AT', - 'E_LDM_ERROR', - 'E_STATISTICS_READY', - 'E_INQUIRY_ARCHIVED', - 'E_BROKER_REPLY_ERROR', - 'E_STATUS_CHECK_ABANDONED', - 'E_ARCHIVE_INQUIRY_AFTER_THRESHOLD', - 'E_ARCHIVE_INQUIRY_RESULT_UNAVAILABLE', - 'E_RESULT_NOT_SET_ABORTING', - 'E_FAILED_JAXB_ERROR', - 'E_REPLY_SENT_TO_BROKER', - 'E_DRYRUN_COMPLETE', - 'E_UPLOAD_COMPLETE', - 'E_DELETE_ANONYMIZED_PATIENTS', - 'E_CENTRALSEARCH_COULD_NOT_CONNECT', - 'E_UPLOADSTATS_UNPARSABLE', - 'E_UPLOAD_SET_TIMESTAMP', - 'E_PATIENT_UPLOAD_RESULT', - 'E_UNAUTHORIZED_ATTEMPT_TO_ACCESS_ADMIN_AREA', - 'E_USER_CREATED', - 'E_USER_DELETED', - 'E_NO_CREDENTIALS_CS', - 'E_NO_PREVIOUS_UPLOADS', - 'E_PREVIOUS_UPLOAD_AT', - 'E_CS_ERROR_LASTUPLOADTIMESTAMP' +CREATE +TYPE +event_message_type +AS +ENUM +( +'E_SYSTEM_STARTUP', +'E_SYSTEM_SHUTDOWN', +'E_NEW_INQUIRY_RECEIVED', +'E_NEW_INQUIRY_CREATED_FOR_UPLOAD', +'E_COULD_NOT_GET_RESULT', +'E_RESULT_EMPTY', +'E_START_EXECUTE_INQUIRY_JOB', +'E_REPEAT_EXECUTE_INQUIRY_JOB_WITHOUT_UNKNOWN_KEYS', +'E_INQUIRY_RESULT_AT', +'E_LDM_ERROR', +'E_STATISTICS_READY', +'E_INQUIRY_ARCHIVED', +'E_BROKER_REPLY_ERROR', +'E_STATUS_CHECK_ABANDONED', +'E_ARCHIVE_INQUIRY_AFTER_THRESHOLD', +'E_ARCHIVE_INQUIRY_RESULT_UNAVAILABLE', +'E_RESULT_NOT_SET_ABORTING', +'E_FAILED_JAXB_ERROR', +'E_REPLY_SENT_TO_BROKER', +'E_DRYRUN_COMPLETE', +'E_UPLOAD_COMPLETE', +'E_DELETE_ANONYMIZED_PATIENTS', +'E_CENTRALSEARCH_COULD_NOT_CONNECT', +'E_UPLOADSTATS_UNPARSABLE', +'E_UPLOAD_SET_TIMESTAMP', +'E_PATIENT_UPLOAD_RESULT', +'E_UNAUTHORIZED_ATTEMPT_TO_ACCESS_ADMIN_AREA', +'E_USER_CREATED', +'E_USER_DELETED', +'E_NO_CREDENTIALS_CS', +'E_NO_PREVIOUS_UPLOADS', +'E_PREVIOUS_UPLOAD_AT', +'E_CS_ERROR_LASTUPLOADTIMESTAMP' ); -COMMENT ON SCHEMA samply IS 'schema used for samply share'; \ No newline at end of file +COMMENT +ON +SCHEMA +samply +IS +'schema used for samply share'; \ No newline at end of file diff --git a/src/main/resources/db/migration/samply/V2__initial_tables.sql b/src/main/resources/db/migration/samply/V2__initial_tables.sql index 731f74b6..ae2472f5 100644 --- a/src/main/resources/db/migration/samply/V2__initial_tables.sql +++ b/src/main/resources/db/migration/samply/V2__initial_tables.sql @@ -1,270 +1,653 @@ -- noinspection SqlNoDataSourceInspectionForFile -CREATE TABLE configuration ( - name text PRIMARY KEY, - setting text , - visible boolean DEFAULT true NOT NULL - ); - -CREATE TABLE configuration_timings ( - name text PRIMARY KEY, - setting integer DEFAULT 0 NOT NULL , - visible boolean DEFAULT true NOT NULL - ); - -CREATE TABLE credentials ( - id SERIAL PRIMARY KEY, - auth_scheme auth_scheme_type , - target target_type NOT NULL, - username text , - passcode text NOT NULL, - workstation text , - "domain" text - ); - -CREATE TABLE requested_entity ( - id SERIAL PRIMARY KEY, - name entity_type UNIQUE NOT NULL - ); - -CREATE TABLE token ( - id SERIAL PRIMARY KEY, - apikey text UNIQUE NOT NULL, - signin_token text , - expires_at timestamp - ); - -CREATE TABLE upload ( - id SERIAL PRIMARY KEY, - status upload_status_type DEFAULT 'US_NEW' NOT NULL, - triggered_at TIMESTAMP DEFAULT current_timestamp NOT NULL, - triggered_by text DEFAULT 'scheduled' NOT NULL, - is_dryrun boolean DEFAULT FALSE, - is_full_upload boolean DEFAULT FALSE, - dktk_flagged boolean, - success_count integer, - failure_count integer, - failed_patients text, - time_to_set TIMESTAMP WITHOUT TIME ZONE - ); - -CREATE TABLE "user" ( - id SERIAL PRIMARY KEY, - token_id integer UNIQUE, - username text UNIQUE NOT NULL, - password_hash text NOT NULL, - real_name text , - email text , - admin_privilege boolean DEFAULT FALSE NOT NULL - ); - -CREATE INDEX idx_user ON "user" ( token_id ); - -CREATE TABLE user_notification ( - user_id integer NOT NULL, - requested_entity_id integer NOT NULL, - PRIMARY KEY ("user_id", "requested_entity_id") - ); - -CREATE TABLE broker ( - id SERIAL PRIMARY KEY, - address text NOT NULL, - name text , - last_checked timestamp , - credentials_id integer , - status broker_status_type - ); - -CREATE INDEX idx_broker ON broker ( credentials_id ); - -CREATE TABLE inquiry_handling_rule ( - id SERIAL PRIMARY KEY, - broker_id integer , - full_result boolean DEFAULT true NOT NULL, - automatic_reply reply_rule_type DEFAULT 'RR_NO_AUTOMATIC_ACTION' NOT NULL - ); - -CREATE INDEX idx_inquiry_handling_rule ON inquiry_handling_rule ( broker_id ); - -CREATE TABLE event_log ( - id SERIAL PRIMARY KEY, - event_type event_message_type, - inquiry_id integer , - upload_id integer , - user_id integer , - quality_report_id integer , - event_time timestamp DEFAULT current_timestamp NOT NULL, - show_in_global boolean DEFAULT true NOT NULL, - entry text - ); - -CREATE INDEX idx_event_log ON event_log ( inquiry_id ); -CREATE INDEX idx_event_log_0 ON event_log ( upload_id ); -CREATE INDEX idx_event_log_1 ON event_log ( user_id ); - -CREATE TABLE inquiry ( - id SERIAL PRIMARY KEY, - upload_id integer , - source_id integer NOT NULL, - label text , - description text , - broker_id integer , - latest_details_id integer , - archived_at timestamp , - deleted_at timestamp - ); - -CREATE INDEX idx_inquiry ON inquiry ( broker_id ); -CREATE INDEX idx_inquiry_0 ON inquiry ( latest_details_id ); - -CREATE TABLE inquiry_answer ( - id SERIAL PRIMARY KEY, - inquiry_details_id integer UNIQUE NOT NULL, - sent_at timestamp DEFAULT current_timestamp NOT NULL, - content text NOT NULL - ); - -CREATE INDEX idx_inquiry_answer ON inquiry_answer ( inquiry_details_id ); - -CREATE TABLE inquiry_details ( - id SERIAL PRIMARY KEY, - inquiry_id integer NOT NULL, - contact_id integer , - revision integer NOT NULL, - received_at timestamp DEFAULT current_timestamp NOT NULL, - status inquiry_status_type NOT NULL, - criteria_original text NOT NULL, - criteria_modified text , - expose_location text - ); - -CREATE INDEX idx_inquiry_details ON inquiry_details ( inquiry_id ); - -CREATE TABLE inquiry_requested_entity ( - inquiry_id integer NOT NULL, - requested_entity_id integer NOT NULL, - PRIMARY KEY ("inquiry_id", "requested_entity_id") - ); - -CREATE TABLE inquiry_result ( - id SERIAL PRIMARY KEY, - inquiry_details_id integer NOT NULL, - is_error boolean DEFAULT false NOT NULL, - "location" text , - "size" integer , - executed_at timestamp DEFAULT current_timestamp NOT NULL, - valid_until timestamp , - statistics_only boolean DEFAULT false NOT NULL, - notification_sent boolean DEFAULT false NOT NULL, - "error_code" text - ); - -CREATE INDEX idx_inquiry_result ON inquiry_result ( inquiry_details_id ); - -CREATE TABLE inquiry_result_stats ( - id SERIAL PRIMARY KEY, - inquiry_result_id INTEGER UNIQUE NOT NULL, - stats_gender TEXT, - stats_age TEXT -); - -CREATE INDEX idx_inquiry_result_stats ON inquiry_result_stats ( inquiry_result_id ); - -CREATE TABLE user_seen_inquiry ( - user_id integer NOT NULL, - inquiry_id integer NOT NULL, - PRIMARY KEY ("user_id", "inquiry_id") - ); - -CREATE TABLE contact ( - id SERIAL PRIMARY KEY, - title text, - first_name text, - last_name text NOT NULL, - phone text, - email text, - organization_name text -); - -CREATE TABLE job_schedule ( - id SERIAL PRIMARY KEY, - job_key text UNIQUE NOT NULL, - cron_expression text NOT NULL, - paused boolean -); - -CREATE TABLE document ( - id SERIAL PRIMARY KEY, - inquiry_id INTEGER NOT NULL, - user_id INTEGER NOT NULL, - uploaded_at date NOT NULL DEFAULT CURRENT_DATE, - filetype TEXT, - filename TEXT, - data BYTEA -); - -CREATE INDEX idx_document ON document ( inquiry_id ); - - -ALTER TABLE broker ADD CONSTRAINT broker_credentials_id_fkey FOREIGN KEY ( credentials_id ) REFERENCES credentials( id ) ON DELETE SET NULL; -ALTER TABLE event_log ADD CONSTRAINT event_log_inquiry_id_fkey FOREIGN KEY ( inquiry_id ) REFERENCES inquiry( id ) ON DELETE CASCADE; -ALTER TABLE event_log ADD CONSTRAINT event_log_upload_id_fkey FOREIGN KEY ( upload_id ) REFERENCES upload( id ) ON DELETE CASCADE; -ALTER TABLE event_log ADD CONSTRAINT event_log_user_id_fkey FOREIGN KEY ( user_id ) REFERENCES "user"( id ) ON DELETE CASCADE; -ALTER TABLE inquiry ADD CONSTRAINT inquiry_upload_id_fkey FOREIGN KEY ( upload_id ) REFERENCES upload( id ) ON DELETE CASCADE; -ALTER TABLE inquiry ADD CONSTRAINT inquiry_broker_id_fkey FOREIGN KEY ( broker_id ) REFERENCES broker( id ) ON DELETE CASCADE; -ALTER TABLE inquiry ADD CONSTRAINT inquiry_broker_xor_upload CHECK ((upload_id IS NULL AND broker_id IS NOT NULL) OR (broker_id IS NULL AND upload_id IS NOT NULL)); -ALTER TABLE inquiry ADD CONSTRAINT inquiry_latest_details_id_fkey FOREIGN KEY ( latest_details_id ) REFERENCES inquiry_details( id ) ON DELETE SET NULL; -ALTER TABLE inquiry_answer ADD CONSTRAINT inquiry_answer_inquiry_details_id_fkey FOREIGN KEY ( inquiry_details_id ) REFERENCES inquiry_details( id ) ON DELETE CASCADE; -ALTER TABLE inquiry_details ADD CONSTRAINT inquiry_details_inquiry_id_fkey FOREIGN KEY ( inquiry_id ) REFERENCES inquiry( id ) ON DELETE CASCADE; -ALTER TABLE inquiry_details ADD CONSTRAINT inquiry_details_contact_id_fkey FOREIGN KEY ( contact_id ) REFERENCES contact( id ) ON DELETE SET NULL; -ALTER TABLE inquiry_handling_rule ADD CONSTRAINT inquiry_handling_rule_broker_id_fkey FOREIGN KEY ( broker_id ) REFERENCES broker( id ) ON DELETE CASCADE; -ALTER TABLE inquiry_requested_entity ADD CONSTRAINT inquiry_requested_entity_inquiry_id_fkey FOREIGN KEY ( inquiry_id ) REFERENCES inquiry( id ) ON DELETE CASCADE; -ALTER TABLE inquiry_requested_entity ADD CONSTRAINT inquiry_requested_entity_requested_entity_id_fkey FOREIGN KEY ( requested_entity_id ) REFERENCES requested_entity( id ) ON DELETE CASCADE; -ALTER TABLE inquiry_result ADD CONSTRAINT inquiry_result_inquiry_details_id_fkey FOREIGN KEY ( inquiry_details_id ) REFERENCES inquiry_details( id ) ON DELETE CASCADE; -ALTER TABLE inquiry_result_stats ADD CONSTRAINT inquiry_result_stats_inquiry_result_id_fkey FOREIGN KEY ( inquiry_result_id ) REFERENCES inquiry_result( id ) ON DELETE CASCADE; -ALTER TABLE "user" ADD CONSTRAINT user_token_id_fkey FOREIGN KEY ( token_id ) REFERENCES token( id ) ON DELETE SET NULL; -ALTER TABLE user_notification ADD CONSTRAINT user_notification_user_id_fkey FOREIGN KEY ( user_id ) REFERENCES "user"( id ) ON DELETE CASCADE; -ALTER TABLE user_notification ADD CONSTRAINT user_notification_requested_entity_id_fkey FOREIGN KEY ( requested_entity_id ) REFERENCES requested_entity( id ) ON DELETE CASCADE; -ALTER TABLE user_seen_inquiry ADD CONSTRAINT user_seen_inquiry_user_id_fkey FOREIGN KEY ( user_id ) REFERENCES "user"( id ) ON DELETE CASCADE; -ALTER TABLE user_seen_inquiry ADD CONSTRAINT user_seen_inquiry_inquiry_id_fkey FOREIGN KEY ( inquiry_id ) REFERENCES inquiry( id ) ON DELETE CASCADE; -ALTER TABLE document ADD CONSTRAINT document_inquiry_id_fkey FOREIGN KEY (inquiry_id) REFERENCES inquiry(id) ON DELETE CASCADE; - - -COMMENT ON COLUMN configuration.visible IS 'Is this visible on the web interface?'; -COMMENT ON TABLE configuration_timings IS 'Use an extra table for timing parameters for the sake of simply using integers'; -COMMENT ON TABLE credentials IS 'Stored credentials for central search, searchbrokers, local datamanagement...'; -COMMENT ON COLUMN credentials.target IS 'proxy? central search? broker? user?'; -COMMENT ON COLUMN credentials.passcode IS 'May be a hashed password for the user login or a plain password for central search or maybe just an apikey'; -COMMENT ON COLUMN credentials.workstation IS 'Currently not used. Might be relevant for other auth schemes'; -COMMENT ON COLUMN credentials."domain" IS 'Currently not used. Might be relevant for other auth schemes'; -COMMENT ON TABLE requested_entity IS 'An inquirer can request different types of entities (biomaterial, clinical data...)'; -COMMENT ON TABLE upload IS 'Uploads to central search.'; -COMMENT ON COLUMN upload.triggered_by IS 'Who triggered the upload? Was it automatically by the scheduler, or did a user do it?'; -COMMENT ON COLUMN upload.success_count IS 'How many upload datasets were acknowledged with a 2xx status code'; -COMMENT ON COLUMN upload.failure_count IS 'How many upload datasets were finally denied'; -COMMENT ON COLUMN upload.failed_patients IS 'A JSON array of DKTK site ids of the failed patients'; -COMMENT ON COLUMN upload.time_to_set IS 'The timestamp that will be set at the central mds db at the end of the upload'; -COMMENT ON COLUMN "user".token_id IS 'The user might have a login token assigned to himself in order to allow logging in from other components (e.g. OSSE.EDC)'; -COMMENT ON COLUMN "user".password_hash IS 'bcrypt encoded password'; -COMMENT ON COLUMN "user".real_name IS 'The real name(s) of the user, may include title(s)'; -COMMENT ON TABLE user_notification IS 'Which user shall receive which notifications?'; -COMMENT ON COLUMN broker.address IS 'The base URL of the searchbroker'; -COMMENT ON COLUMN broker.name IS 'A self-assigned name of the searchbroker (e.g. "Decentral Searchbroker for DKTK")'; -COMMENT ON COLUMN broker.last_checked IS 'When was this searchbroker queries the last time?'; -COMMENT ON TABLE inquiry_handling_rule IS 'Incoming inquiries may be handled differently, depending on several criteria. Allow to define an "if" part which has to be handled in the application, a link to a specific broker (may be null), a link to a certain result type (may also be null) as well as an action to take (e.g. instantly reply a number)'; -COMMENT ON COLUMN inquiry_handling_rule.full_result IS 'Should the full result be generated here?'; -COMMENT ON CONSTRAINT inquiry_handling_rule_broker_id_fkey ON inquiry_handling_rule IS 'May be linked to a certain broker (but does not have to)'; -COMMENT ON TABLE event_log IS 'Log certain events that happen during job execution. E.g. Upload was triggered or inquiry was received/executed'; -COMMENT ON COLUMN event_log.event_time IS 'when did the logged event occur?'; -COMMENT ON COLUMN event_log.entry IS 'Either a message or a set of parameters. As a JSON String'; -COMMENT ON CONSTRAINT inquiry_broker_xor_upload ON inquiry IS 'Uploads can also spawn inquiries. In this case, set the upload id. upload_id XOR broker_id have to be set'; -COMMENT ON COLUMN inquiry.archived_at IS 'if this inquiry was archived...set the timestamp here. if it is not archived, this shall be null'; -COMMENT ON COLUMN inquiry.deleted_at IS 'allow to mark an inquiry as deleted. set to null if it is not deleted'; -COMMENT ON COLUMN inquiry_answer.inquiry_details_id IS 'which revision of the inquiry was answered?'; -COMMENT ON COLUMN inquiry_answer.content IS 'What was sent? This may contain different types of data...use json to keep it generic'; -COMMENT ON COLUMN inquiry_details.criteria_original IS 'the criteria xml snippet as received from source'; -COMMENT ON COLUMN inquiry_details.criteria_modified IS 'if the original criteria had unknown keys which were removed...keep the modified one as well'; -COMMENT ON COLUMN inquiry_result."location" IS 'The URL where the result can be found'; -COMMENT ON COLUMN inquiry_result.notification_sent IS 'has the user been notified about this inquiry?'; -COMMENT ON TABLE job_schedule IS 'For regularly executed tasks, set the cron schedule expression here'; -COMMENT ON TABLE document IS 'Users can upload (modified) export files in order to track what they may have sent to other people' \ No newline at end of file +CREATE TABLE configuration +( + name text PRIMARY KEY, + setting text, + visible boolean DEFAULT true NOT NULL +); + +CREATE TABLE configuration_timings +( + name text PRIMARY KEY, + setting integer DEFAULT 0 NOT NULL, + visible boolean DEFAULT true NOT NULL +); + +CREATE TABLE credentials +( + id SERIAL PRIMARY KEY, + auth_scheme auth_scheme_type, + target target_type NOT NULL, + username text, + passcode text NOT NULL, + workstation text, + "domain" text +); + +CREATE TABLE requested_entity +( + id SERIAL PRIMARY KEY, + name entity_type UNIQUE NOT NULL +); + +CREATE TABLE token +( + id SERIAL PRIMARY KEY, + apikey text UNIQUE NOT NULL, + signin_token text, + expires_at timestamp +); + +CREATE TABLE upload +( + id SERIAL PRIMARY KEY, + status upload_status_type DEFAULT 'US_NEW' NOT NULL, + triggered_at TIMESTAMP DEFAULT current_timestamp NOT NULL, + triggered_by text DEFAULT 'scheduled' NOT NULL, + is_dryrun boolean DEFAULT FALSE, + is_full_upload boolean DEFAULT FALSE, + dktk_flagged boolean, + success_count integer, + failure_count integer, + failed_patients text, + time_to_set TIMESTAMP WITHOUT TIME ZONE +); + +CREATE TABLE "user" +( + id SERIAL PRIMARY KEY, + token_id integer UNIQUE, + username text UNIQUE NOT NULL, + password_hash text NOT NULL, + real_name text, + email text, + admin_privilege boolean DEFAULT FALSE NOT NULL +); + +CREATE +INDEX +idx_user +ON +"user" +( +token_id +); + +CREATE TABLE user_notification +( + user_id integer NOT NULL, + requested_entity_id integer NOT NULL, + PRIMARY KEY ("user_id", "requested_entity_id") +); + +CREATE TABLE broker +( + id SERIAL PRIMARY KEY, + address text NOT NULL, + name text, + last_checked timestamp, + credentials_id integer, + status broker_status_type +); + +CREATE +INDEX +idx_broker +ON +broker +( +credentials_id +); + +CREATE TABLE inquiry_handling_rule +( + id SERIAL PRIMARY KEY, + broker_id integer, + full_result boolean DEFAULT true NOT NULL, + automatic_reply reply_rule_type DEFAULT 'RR_NO_AUTOMATIC_ACTION' NOT NULL +); + +CREATE +INDEX +idx_inquiry_handling_rule +ON +inquiry_handling_rule +( +broker_id +); + +CREATE TABLE event_log +( + id SERIAL PRIMARY KEY, + event_type event_message_type, + inquiry_id integer, + upload_id integer, + user_id integer, + quality_report_id integer, + event_time timestamp DEFAULT current_timestamp NOT NULL, + show_in_global boolean DEFAULT true NOT NULL, + entry text +); + +CREATE +INDEX +idx_event_log +ON +event_log +( +inquiry_id +); +CREATE +INDEX +idx_event_log_0 +ON +event_log +( +upload_id +); +CREATE +INDEX +idx_event_log_1 +ON +event_log +( +user_id +); + +CREATE TABLE inquiry +( + id SERIAL PRIMARY KEY, + upload_id integer, + source_id integer NOT NULL, + label text, + description text, + broker_id integer, + latest_details_id integer, + archived_at timestamp, + deleted_at timestamp +); + +CREATE +INDEX +idx_inquiry +ON +inquiry +( +broker_id +); +CREATE +INDEX +idx_inquiry_0 +ON +inquiry +( +latest_details_id +); + +CREATE TABLE inquiry_answer +( + id SERIAL PRIMARY KEY, + inquiry_details_id integer UNIQUE NOT NULL, + sent_at timestamp DEFAULT current_timestamp NOT NULL, + content text NOT NULL +); + +CREATE +INDEX +idx_inquiry_answer +ON +inquiry_answer +( +inquiry_details_id +); + +CREATE TABLE inquiry_details +( + id SERIAL PRIMARY KEY, + inquiry_id integer NOT NULL, + contact_id integer, + revision integer NOT NULL, + received_at timestamp DEFAULT current_timestamp NOT NULL, + status inquiry_status_type NOT NULL, + criteria_original text NOT NULL, + criteria_modified text, + expose_location text +); + +CREATE +INDEX +idx_inquiry_details +ON +inquiry_details +( +inquiry_id +); + +CREATE TABLE inquiry_requested_entity +( + inquiry_id integer NOT NULL, + requested_entity_id integer NOT NULL, + PRIMARY KEY ("inquiry_id", "requested_entity_id") +); + +CREATE TABLE inquiry_result +( + id SERIAL PRIMARY KEY, + inquiry_details_id integer NOT NULL, + is_error boolean DEFAULT false NOT NULL, + "location" text, + "size" integer, + executed_at timestamp DEFAULT current_timestamp NOT NULL, + valid_until timestamp, + statistics_only boolean DEFAULT false NOT NULL, + notification_sent boolean DEFAULT false NOT NULL, + "error_code" text +); + +CREATE +INDEX +idx_inquiry_result +ON +inquiry_result +( +inquiry_details_id +); + +CREATE TABLE inquiry_result_stats +( + id SERIAL PRIMARY KEY, + inquiry_result_id INTEGER UNIQUE NOT NULL, + stats_gender TEXT, + stats_age TEXT +); + +CREATE +INDEX +idx_inquiry_result_stats +ON +inquiry_result_stats +( +inquiry_result_id +); + +CREATE TABLE user_seen_inquiry +( + user_id integer NOT NULL, + inquiry_id integer NOT NULL, + PRIMARY KEY ("user_id", "inquiry_id") +); + +CREATE TABLE contact +( + id SERIAL PRIMARY KEY, + title text, + first_name text, + last_name text NOT NULL, + phone text, + email text, + organization_name text +); + +CREATE TABLE job_schedule +( + id SERIAL PRIMARY KEY, + job_key text UNIQUE NOT NULL, + cron_expression text NOT NULL, + paused boolean +); + +CREATE TABLE document +( + id SERIAL PRIMARY KEY, + inquiry_id INTEGER NOT NULL, + user_id INTEGER NOT NULL, + uploaded_at date NOT NULL DEFAULT CURRENT_DATE, + filetype TEXT, + filename TEXT, + data BYTEA +); + +CREATE +INDEX +idx_document +ON +document +( +inquiry_id +); + + +ALTER TABLE broker + ADD CONSTRAINT broker_credentials_id_fkey FOREIGN KEY (credentials_id) REFERENCES credentials (id) ON DELETE SET NULL; +ALTER TABLE event_log + ADD CONSTRAINT event_log_inquiry_id_fkey FOREIGN KEY (inquiry_id) REFERENCES inquiry (id) ON DELETE CASCADE; +ALTER TABLE event_log + ADD CONSTRAINT event_log_upload_id_fkey FOREIGN KEY (upload_id) REFERENCES upload (id) ON DELETE CASCADE; +ALTER TABLE event_log + ADD CONSTRAINT event_log_user_id_fkey FOREIGN KEY (user_id) REFERENCES "user" (id) ON DELETE CASCADE; +ALTER TABLE inquiry + ADD CONSTRAINT inquiry_upload_id_fkey FOREIGN KEY (upload_id) REFERENCES upload (id) ON DELETE CASCADE; +ALTER TABLE inquiry + ADD CONSTRAINT inquiry_broker_id_fkey FOREIGN KEY (broker_id) REFERENCES broker (id) ON DELETE CASCADE; +ALTER TABLE inquiry + ADD CONSTRAINT inquiry_broker_xor_upload CHECK ((upload_id IS NULL AND broker_id IS NOT NULL) OR + (broker_id IS NULL AND upload_id IS NOT NULL)); +ALTER TABLE inquiry + ADD CONSTRAINT inquiry_latest_details_id_fkey FOREIGN KEY (latest_details_id) REFERENCES inquiry_details (id) ON DELETE SET NULL; +ALTER TABLE inquiry_answer + ADD CONSTRAINT inquiry_answer_inquiry_details_id_fkey FOREIGN KEY (inquiry_details_id) REFERENCES inquiry_details (id) ON DELETE CASCADE; +ALTER TABLE inquiry_details + ADD CONSTRAINT inquiry_details_inquiry_id_fkey FOREIGN KEY (inquiry_id) REFERENCES inquiry (id) ON DELETE CASCADE; +ALTER TABLE inquiry_details + ADD CONSTRAINT inquiry_details_contact_id_fkey FOREIGN KEY (contact_id) REFERENCES contact (id) ON DELETE SET NULL; +ALTER TABLE inquiry_handling_rule + ADD CONSTRAINT inquiry_handling_rule_broker_id_fkey FOREIGN KEY (broker_id) REFERENCES broker (id) ON DELETE CASCADE; +ALTER TABLE inquiry_requested_entity + ADD CONSTRAINT inquiry_requested_entity_inquiry_id_fkey FOREIGN KEY (inquiry_id) REFERENCES inquiry (id) ON DELETE CASCADE; +ALTER TABLE inquiry_requested_entity + ADD CONSTRAINT inquiry_requested_entity_requested_entity_id_fkey FOREIGN KEY (requested_entity_id) REFERENCES requested_entity (id) ON DELETE CASCADE; +ALTER TABLE inquiry_result + ADD CONSTRAINT inquiry_result_inquiry_details_id_fkey FOREIGN KEY (inquiry_details_id) REFERENCES inquiry_details (id) ON DELETE CASCADE; +ALTER TABLE inquiry_result_stats + ADD CONSTRAINT inquiry_result_stats_inquiry_result_id_fkey FOREIGN KEY (inquiry_result_id) REFERENCES inquiry_result (id) ON DELETE CASCADE; +ALTER TABLE "user" + ADD CONSTRAINT user_token_id_fkey FOREIGN KEY (token_id) REFERENCES token (id) ON DELETE SET NULL; +ALTER TABLE user_notification + ADD CONSTRAINT user_notification_user_id_fkey FOREIGN KEY (user_id) REFERENCES "user" (id) ON DELETE CASCADE; +ALTER TABLE user_notification + ADD CONSTRAINT user_notification_requested_entity_id_fkey FOREIGN KEY (requested_entity_id) REFERENCES requested_entity (id) ON DELETE CASCADE; +ALTER TABLE user_seen_inquiry + ADD CONSTRAINT user_seen_inquiry_user_id_fkey FOREIGN KEY (user_id) REFERENCES "user" (id) ON DELETE CASCADE; +ALTER TABLE user_seen_inquiry + ADD CONSTRAINT user_seen_inquiry_inquiry_id_fkey FOREIGN KEY (inquiry_id) REFERENCES inquiry (id) ON DELETE CASCADE; +ALTER TABLE document + ADD CONSTRAINT document_inquiry_id_fkey FOREIGN KEY (inquiry_id) REFERENCES inquiry (id) ON DELETE CASCADE; + + +COMMENT +ON +COLUMN +configuration +. +visible +IS +'Is this visible on the web interface?'; +COMMENT +ON +TABLE +configuration_timings +IS +'Use an extra table for timing parameters for the sake of simply using integers'; +COMMENT +ON +TABLE +credentials +IS +'Stored credentials for central search, searchbrokers, local datamanagement...'; +COMMENT +ON +COLUMN +credentials +. +target +IS +'proxy? central search? broker? user?'; +COMMENT +ON +COLUMN +credentials +. +passcode +IS +'May be a hashed password for the user login or a plain password for central search or maybe just an apikey'; +COMMENT +ON +COLUMN +credentials +. +workstation +IS +'Currently not used. Might be relevant for other auth schemes'; +COMMENT +ON +COLUMN +credentials +. +"domain" +IS +'Currently not used. Might be relevant for other auth schemes'; +COMMENT +ON +TABLE +requested_entity +IS +'An inquirer can request different types of entities (biomaterial, clinical data...)'; +COMMENT +ON +TABLE +upload +IS +'Uploads to central search.'; +COMMENT +ON +COLUMN +upload +. +triggered_by +IS +'Who triggered the upload? Was it automatically by the scheduler, or did a user do it?'; +COMMENT +ON +COLUMN +upload +. +success_count +IS +'How many upload datasets were acknowledged with a 2xx status code'; +COMMENT +ON +COLUMN +upload +. +failure_count +IS +'How many upload datasets were finally denied'; +COMMENT +ON +COLUMN +upload +. +failed_patients +IS +'A JSON array of DKTK site ids of the failed patients'; +COMMENT +ON +COLUMN +upload +. +time_to_set +IS +'The timestamp that will be set at the central mds db at the end of the upload'; +COMMENT +ON +COLUMN +"user" +. +token_id +IS +'The user might have a login token assigned to himself in order to allow logging in from other components (e.g. OSSE.EDC)'; +COMMENT +ON +COLUMN +"user" +. +password_hash +IS +'bcrypt encoded password'; +COMMENT +ON +COLUMN +"user" +. +real_name +IS +'The real name(s) of the user, may include title(s)'; +COMMENT +ON +TABLE +user_notification +IS +'Which user shall receive which notifications?'; +COMMENT +ON +COLUMN +broker +. +address +IS +'The base URL of the searchbroker'; +COMMENT +ON +COLUMN +broker +. +name +IS +'A self-assigned name of the searchbroker (e.g. "Decentral Searchbroker for DKTK")'; +COMMENT +ON +COLUMN +broker +. +last_checked +IS +'When was this searchbroker queries the last time?'; +COMMENT +ON +TABLE +inquiry_handling_rule +IS +'Incoming inquiries may be handled differently, depending on several criteria. Allow to define an "if" part which has to be handled in the application, a link to a specific broker (may be null), a link to a certain result type (may also be null) as well as an action to take (e.g. instantly reply a number)'; +COMMENT +ON +COLUMN +inquiry_handling_rule +. +full_result +IS +'Should the full result be generated here?'; +COMMENT +ON +CONSTRAINT +inquiry_handling_rule_broker_id_fkey +ON +inquiry_handling_rule +IS +'May be linked to a certain broker (but does not have to)'; +COMMENT +ON +TABLE +event_log +IS +'Log certain events that happen during job execution. E.g. Upload was triggered or inquiry was received/executed'; +COMMENT +ON +COLUMN +event_log +. +event_time +IS +'when did the logged event occur?'; +COMMENT +ON +COLUMN +event_log +. +entry +IS +'Either a message or a set of parameters. As a JSON String'; +COMMENT +ON +CONSTRAINT +inquiry_broker_xor_upload +ON +inquiry +IS +'Uploads can also spawn inquiries. In this case, set the upload id. upload_id XOR broker_id have to be set'; +COMMENT +ON +COLUMN +inquiry +. +archived_at +IS +'if this inquiry was archived...set the timestamp here. if it is not archived, this shall be null'; +COMMENT +ON +COLUMN +inquiry +. +deleted_at +IS +'allow to mark an inquiry as deleted. set to null if it is not deleted'; +COMMENT +ON +COLUMN +inquiry_answer +. +inquiry_details_id +IS +'which revision of the inquiry was answered?'; +COMMENT +ON +COLUMN +inquiry_answer +. +content +IS +'What was sent? This may contain different types of data...use json to keep it generic'; +COMMENT +ON +COLUMN +inquiry_details +. +criteria_original +IS +'the criteria xml snippet as received from source'; +COMMENT +ON +COLUMN +inquiry_details +. +criteria_modified +IS +'if the original criteria had unknown keys which were removed...keep the modified one as well'; +COMMENT +ON +COLUMN +inquiry_result +. +"location" +IS +'The URL where the result can be found'; +COMMENT +ON +COLUMN +inquiry_result +. +notification_sent +IS +'has the user been notified about this inquiry?'; +COMMENT +ON +TABLE +job_schedule +IS +'For regularly executed tasks, set the cron schedule expression here'; +COMMENT +ON +TABLE +document +IS +'Users can upload (modified) export files in order to track what they may have sent to other people' \ No newline at end of file diff --git a/src/main/resources/db/migration/samply/V3__initial_dml.sql b/src/main/resources/db/migration/samply/V3__initial_dml.sql index 145914e3..94d25b3e 100644 --- a/src/main/resources/db/migration/samply/V3__initial_dml.sql +++ b/src/main/resources/db/migration/samply/V3__initial_dml.sql @@ -1,103 +1,226 @@ -INSERT INTO requested_entity(name) SELECT unnest(enum_range(NULL::entity_type)); +INSERT INTO requested_entity(name) +SELECT unnest(enum_range(NULL ::entity_type)); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_BASE_URL', 'https://centralsearch-test.ccpit.dktk.dkfz.de'); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_PATH', ''); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_AUTOMATIC_UPLOAD', 'false'); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_AUTOMATIC_UPLOAD_AT', '03:00'); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_UPLOAD_PATIENTS_WITH_LOCAL_CONSENT', 'false'); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_UPLOAD_RANDOMIZE_EXPORT_IDS', 'false'); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_DELETE_BEFORE_UPLOAD', 'false'); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_NEXT_UPLOAD_FULL', 'false'); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_SHOW_UPLOAD_PATIENTS_WITH_LOCAL_CONSENT', ''); -INSERT INTO samply.configuration(name, setting) VALUES ('DECENTRAL_SEARCH_MAIL_RECEIVER_ADDRESS', ''); -INSERT INTO samply.configuration(name, setting) VALUES ('DECENTRAL_SEARCH_MAIL_SHARE_URL', ''); -INSERT INTO samply.configuration(name, setting) VALUES ('MDR_URL', 'https://mdr.ccp-it.dktk.dkfz.de/v3/api/mdr'); -INSERT INTO samply.configuration(name, setting) VALUES ('LDM_URL', 'http://localhost:8080/centraxx/'); -INSERT INTO samply.configuration(name, setting) VALUES ('ID_MANAGER_URL', 'http://localhost:8180/ID-Manager'); -INSERT INTO samply.configuration(name, setting) VALUES ('ID_MANAGER_NETWORK_ID', 'DKTK'); -INSERT INTO samply.configuration(name, setting) VALUES ('ID_MANAGER_INSTANCE_ID', ''); -INSERT INTO samply.configuration(name, setting) VALUES ('CENTRAL_MDS_DATABASE_ANONYMIZED_PATIENTS_PREFIX', 'TESTANO_'); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_GRP_MDSK', 'urn:dktk:dataelementgroup:7:latest', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_GRP_MDSB', 'urn:dktk:dataelementgroup:8:latest', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_KEY_UPLOAD_FROM', 'urn:dktk:dataelement:64:', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_KEY_UPLOAD_TO', 'urn:dktk:dataelement:63:', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_KEY_CONSENT_DKTK', 'urn:dktk:dataelement:62:', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_KEY_DKTK_GLOBAL_ID', 'urn:dktk:dataelement:54:', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_KEY_GENDER', 'urn:dktk:dataelement:1:', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_KEY_AGE_AT_DIAGNOSIS', 'urn:dktk:dataelement:28:', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_KEY_CASE_DATE', 'urn:dktk:dataelement:27:', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_KEY_CENTRAXX_MAPPING_VERSION', 'urn:dktk:dataelement:108:', false); -INSERT INTO samply.configuration(name, setting, visible) values('MDR_KEY_CENTRAXX_MAPPING_DATE', 'urn:dktk:dataelement:109:', false); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_BASE_URL', 'https://centralsearch-test.ccpit.dktk.dkfz.de'); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_PATH', ''); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_AUTOMATIC_UPLOAD', 'false'); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_AUTOMATIC_UPLOAD_AT', '03:00'); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_UPLOAD_PATIENTS_WITH_LOCAL_CONSENT', 'false'); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_UPLOAD_RANDOMIZE_EXPORT_IDS', 'false'); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_DELETE_BEFORE_UPLOAD', 'false'); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_NEXT_UPLOAD_FULL', 'false'); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_SHOW_UPLOAD_PATIENTS_WITH_LOCAL_CONSENT', ''); +INSERT INTO samply.configuration(name, setting) +VALUES ('DECENTRAL_SEARCH_MAIL_RECEIVER_ADDRESS', ''); +INSERT INTO samply.configuration(name, setting) +VALUES ('DECENTRAL_SEARCH_MAIL_SHARE_URL', ''); +INSERT INTO samply.configuration(name, setting) +VALUES ('MDR_URL', 'https://mdr.ccp-it.dktk.dkfz.de/v3/api/mdr'); +INSERT INTO samply.configuration(name, setting) +VALUES ('LDM_URL', 'http://localhost:8080/centraxx/'); +INSERT INTO samply.configuration(name, setting) +VALUES ('ID_MANAGER_URL', 'http://localhost:8180/ID-Manager'); +INSERT INTO samply.configuration(name, setting) +VALUES ('ID_MANAGER_NETWORK_ID', 'DKTK'); +INSERT INTO samply.configuration(name, setting) +VALUES ('ID_MANAGER_INSTANCE_ID', ''); +INSERT INTO samply.configuration(name, setting) +VALUES ('CENTRAL_MDS_DATABASE_ANONYMIZED_PATIENTS_PREFIX', 'TESTANO_'); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_GRP_MDSK', 'urn:dktk:dataelementgroup:7:latest', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_GRP_MDSB', 'urn:dktk:dataelementgroup:8:latest', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_KEY_UPLOAD_FROM', 'urn:dktk:dataelement:64:', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_KEY_UPLOAD_TO', 'urn:dktk:dataelement:63:', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_KEY_CONSENT_DKTK', 'urn:dktk:dataelement:62:', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_KEY_DKTK_GLOBAL_ID', 'urn:dktk:dataelement:54:', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_KEY_GENDER', 'urn:dktk:dataelement:1:', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_KEY_AGE_AT_DIAGNOSIS', 'urn:dktk:dataelement:28:', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_KEY_CASE_DATE', 'urn:dktk:dataelement:27:', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_KEY_CENTRAXX_MAPPING_VERSION', 'urn:dktk:dataelement:108:', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_KEY_CENTRAXX_MAPPING_DATE', 'urn:dktk:dataelement:109:', false); -- Quality Report Parameters -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_NAMESPACE', 'dktk', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_AUTH_USER_ID', '20', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_AUTH_KEY_ID', '2', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_AUTH_URL', 'https://auth.ccp-it.dktk.dkfz.de', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_AUTH_PRIVATE_KEY_BASE_64', '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', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MAX_ATTEMPTS', '54', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MAX_TIME_TO_WAIT_IN_MILLIS', '300000', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_ONLY_STATISTICS_AVAILABLE', 'true', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MDR_LINK_PREFIX', 'https://mdr.ccp-it.dktk.dkfz.de/detail.xhtml?urn=', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MAX_NUMBER_OF_PATIENT_IDS_TO_BE_SHOWN', '200', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_CENTRAXX_DATAELEMENTS_FILE', 'centraxx.dataelements.txt', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_CENTRAXX_ATTRIBUTES_FILE', 'centraxx.attributes.txt', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_IGNORED_DATAELEMENTS', 'urn:dktk:dataelement:41:3, urn:dktk:dataelement:47:3, urn:dktk:dataelement:71:2, urn:dktk:dataelement:84:2, urn:dktk:dataelement:20:3', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_DIRECTORY', 'C:\ProgramData\dktk\reports', true); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_LOCATION', 'LocalDev', true); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_BASIC_FILENAME', 'quality-report', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_SCHEDULER_FORMAT', 'by-year', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_SCHEDULER_YEARS', '20', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_GROUP_MODUL', '5', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_SCHEDULER_BY_YEAR', '', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_SCHEDULER_BY_MONTH', '', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_STATISTICS_FILENAME', 'quality-report-statistics.txt', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_EXCEL_INFO_FILENAME', 'quality-report-info.xlsx', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_EXCEL_INFO_URL', 'https://deployment.ccp-it.dktk.dkfz.de/static/qualityreport/quality-report-info.xlsx', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_LANGUAGE_CODE', 'de', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_NAMESPACE', 'dktk', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_AUTH_USER_ID', '20', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_AUTH_KEY_ID', '2', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_AUTH_URL', 'https://auth.ccp-it.dktk.dkfz.de', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_AUTH_PRIVATE_KEY_BASE_64', + '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', + false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MAX_ATTEMPTS', '54', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MAX_TIME_TO_WAIT_IN_MILLIS', '300000', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_ONLY_STATISTICS_AVAILABLE', 'true', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MDR_LINK_PREFIX', 'https://mdr.ccp-it.dktk.dkfz.de/detail.xhtml?urn=', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MAX_NUMBER_OF_PATIENT_IDS_TO_BE_SHOWN', '200', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_CENTRAXX_DATAELEMENTS_FILE', 'centraxx.dataelements.txt', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_CENTRAXX_ATTRIBUTES_FILE', 'centraxx.attributes.txt', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_IGNORED_DATAELEMENTS', + 'urn:dktk:dataelement:41:3, urn:dktk:dataelement:47:3, urn:dktk:dataelement:71:2, urn:dktk:dataelement:84:2, urn:dktk:dataelement:20:3', + false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_DIRECTORY', 'C:\ProgramData\dktk\reports', true); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_LOCATION', 'LocalDev', true); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_BASIC_FILENAME', 'quality-report', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_SCHEDULER_FORMAT', 'by-year', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_SCHEDULER_YEARS', '20', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_GROUP_MODUL', '5', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_SCHEDULER_BY_YEAR', '', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_SCHEDULER_BY_MONTH', '', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_STATISTICS_FILENAME', 'quality-report-statistics.txt', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_EXCEL_INFO_FILENAME', 'quality-report-info.xlsx', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_EXCEL_INFO_URL', + 'https://deployment.ccp-it.dktk.dkfz.de/static/qualityreport/quality-report-info.xlsx', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_LANGUAGE_CODE', 'de', false); -- Configuration for Report to Monitoring -INSERT INTO samply.configuration(name, setting, visible) VALUES ('MONITORING_REPORT_COUNT_TOTAL', 'false', true); -INSERT INTO samply.configuration(name, setting, visible) VALUES ('MONITORING_REPORT_COUNT_DKTKFLAG', 'false', true); -INSERT INTO samply.configuration(name, setting, visible) VALUES ('MONITORING_REPORT_COUNT_REFERENCEQUERY', 'false', true); -INSERT INTO samply.configuration(name, setting, visible) VALUES ('MONITORING_REPORT_TIME_REFERENCEQUERY', 'false', true); -INSERT INTO samply.configuration(name, setting, visible) VALUES ('MONITORING_REPORT_CENTRAXX_MAPPING_INFORMATION', 'false', true); +INSERT INTO samply.configuration(name, setting, visible) +VALUES ('MONITORING_REPORT_COUNT_TOTAL', 'false', true); +INSERT INTO samply.configuration(name, setting, visible) +VALUES ('MONITORING_REPORT_COUNT_DKTKFLAG', 'false', true); +INSERT INTO samply.configuration(name, setting, visible) +VALUES ('MONITORING_REPORT_COUNT_REFERENCEQUERY', 'false', true); +INSERT INTO samply.configuration(name, setting, visible) +VALUES ('MONITORING_REPORT_TIME_REFERENCEQUERY', 'false', true); +INSERT INTO samply.configuration(name, setting, visible) +VALUES ('MONITORING_REPORT_CENTRAXX_MAPPING_INFORMATION', 'false', true); -- Configuration for Job Parameters -INSERT INTO samply.configuration_timings(name, setting, visible) VALUES ('JOB_COLLECT_INQUIRIES_INTERVAL_SECONDS', 5, false); -INSERT INTO samply.configuration_timings(name, setting, visible) VALUES ('JOB_CHECK_INQUIRY_STATUS_INITIAL_DELAY_SECONDS', 5, false); -INSERT INTO samply.configuration_timings(name, setting, visible) VALUES ('JOB_CHECK_INQUIRY_STATUS_STATS_RETRY_INTERVAL_SECONDS', 10, false); -INSERT INTO samply.configuration_timings(name, setting, visible) VALUES ('JOB_CHECK_INQUIRY_STATUS_STATS_RETRY_ATTEMPTS', 6, false); -INSERT INTO samply.configuration_timings(name, setting, visible) VALUES ('JOB_CHECK_INQUIRY_STATUS_RESULTS_RETRY_INTERVAL_SECONDS', 60, false); -INSERT INTO samply.configuration_timings(name, setting, visible) VALUES ('JOB_CHECK_INQUIRY_STATUS_RESULTS_RETRY_ATTEMPTS', 10, false); -INSERT INTO samply.configuration_timings(name, setting, visible) VALUES ('JOB_MOVE_INQUIRIES_TO_ARCHIVE_AFTER_DAYS', 28, true); +INSERT INTO samply.configuration_timings(name, setting, visible) +VALUES ('JOB_COLLECT_INQUIRIES_INTERVAL_SECONDS', 5, false); +INSERT INTO samply.configuration_timings(name, setting, visible) +VALUES ('JOB_CHECK_INQUIRY_STATUS_INITIAL_DELAY_SECONDS', 5, false); +INSERT INTO samply.configuration_timings(name, setting, visible) +VALUES ('JOB_CHECK_INQUIRY_STATUS_STATS_RETRY_INTERVAL_SECONDS', 10, false); +INSERT INTO samply.configuration_timings(name, setting, visible) +VALUES ('JOB_CHECK_INQUIRY_STATUS_STATS_RETRY_ATTEMPTS', 6, false); +INSERT INTO samply.configuration_timings(name, setting, visible) +VALUES ('JOB_CHECK_INQUIRY_STATUS_RESULTS_RETRY_INTERVAL_SECONDS', 60, false); +INSERT INTO samply.configuration_timings(name, setting, visible) +VALUES ('JOB_CHECK_INQUIRY_STATUS_RESULTS_RETRY_ATTEMPTS', 10, false); +INSERT INTO samply.configuration_timings(name, setting, visible) +VALUES ('JOB_MOVE_INQUIRIES_TO_ARCHIVE_AFTER_DAYS', 28, true); -- Configuration for Upload -INSERT INTO samply.configuration_timings(name, setting, visible) VALUES ('UPLOAD_RETRY_PATIENT_UPLOAD_ATTEMPTS', 6, true); -INSERT INTO samply.configuration_timings(name, setting, visible) VALUES ('UPLOAD_RETRY_PATIENT_UPLOAD_INTERVAL', 10, true); +INSERT INTO samply.configuration_timings(name, setting, visible) +VALUES ('UPLOAD_RETRY_PATIENT_UPLOAD_ATTEMPTS', 6, true); +INSERT INTO samply.configuration_timings(name, setting, visible) +VALUES ('UPLOAD_RETRY_PATIENT_UPLOAD_INTERVAL', 10, true); -- Configuration for Caching on LDM connection -INSERT INTO samply.configuration(name, setting, visible) VALUES ('LDM_CACHING_ENABLED', 'false', true); -INSERT INTO samply.configuration(name, setting, visible) VALUES ('LDM_CACHING_MAX_SIZE', '1000', true); +INSERT INTO samply.configuration(name, setting, visible) +VALUES ('LDM_CACHING_ENABLED', 'false', true); +INSERT INTO samply.configuration(name, setting, visible) +VALUES ('LDM_CACHING_MAX_SIZE', '1000', true); -- Configuration for misc entries -INSERT INTO samply.configuration(name, setting, visible) VALUES ('DECENTRAL_SEARCH_MAIL_INCLUDE_EMPTY_RESULTS', 'true', true); +INSERT INTO samply.configuration(name, setting, visible) +VALUES ('DECENTRAL_SEARCH_MAIL_INCLUDE_EMPTY_RESULTS', 'true', true); -- Set the cron expressions for some of the jobs -INSERT INTO samply.job_schedule(job_key, cron_expression, paused) VALUES ('DecentralSearchGroup.CollectInquiriesJob', '0/10 * * * * ?', false); -INSERT INTO samply.job_schedule(job_key, cron_expression, paused) VALUES ('DecentralSearchGroup.ExecuteInquiriesJob', '0/5 * * * * ?', false); -INSERT INTO samply.job_schedule(job_key, cron_expression, paused) VALUES ('DecentralSearchGroup.SendNotificationsJob', '0 0 * * * ?', false); -INSERT INTO samply.job_schedule(job_key, cron_expression, paused) VALUES ('CentralSearchGroup.UploadToCentralMdsDbJobDktkFlag', '0 0 23 1/1 * ? *', false); -INSERT INTO samply.job_schedule(job_key, cron_expression, paused) VALUES ('CentralSearchGroup.UploadToCentralMdsDbJobNoDktkFlag', '0 0 2 ? 1/1 SAT#1 *', false); -INSERT INTO samply.job_schedule(job_key, cron_expression, paused) VALUES ('MaintenanceGroup.CheckLocalComponentsJob', '0 0 0/1 1/1 * ?', false); -INSERT INTO samply.job_schedule(job_key, cron_expression, paused) VALUES ('MaintenanceGroup.DbCleanupJob', '0 30 0 1/1 * ?', false); -INSERT INTO samply.job_schedule(job_key, cron_expression, paused) VALUES ('MaintenanceGroup.ReportToMonitoringJob', '0 0 1 1/1 * ? *', true); +INSERT INTO samply.job_schedule(job_key, cron_expression, paused) +VALUES ('DecentralSearchGroup.CollectInquiriesJob', '0/10 * * * * ?', false); +INSERT INTO samply.job_schedule(job_key, cron_expression, paused) +VALUES ('DecentralSearchGroup.ExecuteInquiriesJob', '0/5 * * * * ?', false); +INSERT INTO samply.job_schedule(job_key, cron_expression, paused) +VALUES ('DecentralSearchGroup.SendNotificationsJob', '0 0 * * * ?', false); +INSERT INTO samply.job_schedule(job_key, cron_expression, paused) +VALUES ('CentralSearchGroup.UploadToCentralMdsDbJobDktkFlag', '0 0 23 1/1 * ? *', false); +INSERT INTO samply.job_schedule(job_key, cron_expression, paused) +VALUES ('CentralSearchGroup.UploadToCentralMdsDbJobNoDktkFlag', '0 0 2 ? 1/1 SAT#1 *', false); +INSERT INTO samply.job_schedule(job_key, cron_expression, paused) +VALUES ('MaintenanceGroup.CheckLocalComponentsJob', '0 0 0/1 1/1 * ?', false); +INSERT INTO samply.job_schedule(job_key, cron_expression, paused) +VALUES ('MaintenanceGroup.DbCleanupJob', '0 30 0 1/1 * ?', false); +INSERT INTO samply.job_schedule(job_key, cron_expression, paused) +VALUES ('MaintenanceGroup.ReportToMonitoringJob', '0 0 1 1/1 * ? *', true); -- Add additional keys for the viewfields when posting to local datamanagement -INSERT INTO samply.configuration(name, setting, visible) values('INQUIRY_ADDITIONAL_MDRKEYS', 'urn:adt:dataelement:77:*;urn:adt:dataelement:78:*;urn:adt:dataelement:90:*;urn:adt:dataelement:93:*;urn:adt:dataelement:89:*;urn:adt:dataelement:91:*', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('INQUIRY_ADDITIONAL_MDRKEYS', + 'urn:adt:dataelement:77:*;urn:adt:dataelement:78:*;urn:adt:dataelement:90:*;urn:adt:dataelement:93:*;urn:adt:dataelement:89:*;urn:adt:dataelement:91:*', + false); -with tmp_token as ( - INSERT INTO Token(apikey) VALUES('ZvDKWpgCXSeed23MfbHs') RETURNING id +with +tmp_token +as +( +INSERT +INTO +Token +( +apikey ) -INSERT INTO samply.user(username, password_hash, token_id, admin_privilege) VALUES ('admin','$2a$10$nMAQW9ZUf8evd2KUU4Op.eWHK18hkiBDKYxpWnp6oxxQY8yApK4CS', (SELECT id from tmp_token), true); +VALUES +( +'ZvDKWpgCXSeed23MfbHs' +) +RETURNING +id +) +INSERT +INTO +samply +. +user +( +username, +password_hash, +token_id, +admin_privilege +) +VALUES +( +'admin', +'$2a$10$nMAQW9ZUf8evd2KUU4Op.eWHK18hkiBDKYxpWnp6oxxQY8yApK4CS', +( +SELECT +id +from +tmp_token +), +true +); -- adminpass \ No newline at end of file diff --git a/src/main/resources/db/migration/samply/V5__tables.sql b/src/main/resources/db/migration/samply/V5__tables.sql index 356472f3..a3daeab5 100644 --- a/src/main/resources/db/migration/samply/V5__tables.sql +++ b/src/main/resources/db/migration/samply/V5__tables.sql @@ -1,24 +1,51 @@ -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MDR_GROUPS', 'urn:dktk:dataelementgroup:7:latest;urn:dktk:dataelementgroup:8:latest', false); - -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_ADDITIONAL_MDR_DATA_ELEMENTS', 'urn:adt:dataelement:77:1, urn:adt:dataelement:78:1, urn:adt:dataelement:89:1, urn:adt:dataelement:90:1, urn:adt:dataelement:91:1, urn:adt:dataelement:93:1', false); - -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MDR_NAMESPACE', 'dktk, adt', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MDR_AUTH_USER_ID', '20', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MDR_AUTH_KEY_ID', '2', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MDR_AUTH_URL', 'https://auth.ccp-it.dktk.dkfz.de', false); -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_MDR_AUTH_PRIVATE_KEY_BASE_64', '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', false); - -INSERT INTO samply.configuration(name, setting, visible) values('MDR_SOURCE_GROUPS', 'urn:dktk:dataelementgroup:7:latest;urn:dktk:dataelementgroup:8:latest;urn:adt:dataelementgroup:17:latest', false); -- for versions beyond CentraXX 3.9.0 +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MDR_GROUPS', 'urn:dktk:dataelementgroup:7:latest;urn:dktk:dataelementgroup:8:latest', false); + +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_ADDITIONAL_MDR_DATA_ELEMENTS', + 'urn:adt:dataelement:77:1, urn:adt:dataelement:78:1, urn:adt:dataelement:89:1, urn:adt:dataelement:90:1, urn:adt:dataelement:91:1, urn:adt:dataelement:93:1', + false); + +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MDR_NAMESPACE', 'dktk, adt', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MDR_AUTH_USER_ID', '20', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MDR_AUTH_KEY_ID', '2', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MDR_AUTH_URL', 'https://auth.ccp-it.dktk.dkfz.de', false); +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_MDR_AUTH_PRIVATE_KEY_BASE_64', + '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', + false); + +INSERT INTO samply.configuration(name, setting, visible) +values ('MDR_SOURCE_GROUPS', + 'urn:dktk:dataelementgroup:7:latest;urn:dktk:dataelementgroup:8:latest;urn:adt:dataelementgroup:17:latest', + false); -- for versions beyond CentraXX 3.9.0 -- INSERT INTO samply.configuration(name, setting, visible) values('MDR_SOURCE_GROUPS', 'urn:dktk:dataelementgroup:7:latest;urn:dktk:dataelementgroup:8:latest', false); -- for versions before CentraXX 3.9.0 -INSERT INTO samply.configuration(name, setting, visible) values('QUALITY_REPORT_CENTRAXX_VALUES_FILE', 'centraxx.values.txt', false); -DELETE FROM samply.configuration WHERE name='QUALITY_REPORT_CENTRAXX_ATTRIBUTES_FILE'; - -DELETE FROM samply.configuration WHERE name='QUALITY_REPORT_NAMESPACE' ; -DELETE FROM samply.configuration WHERE name='QUALITY_REPORT_AUTH_USER_ID'; -DELETE FROM samply.configuration WHERE name='QUALITY_REPORT_AUTH_KEY_ID'; -DELETE FROM samply.configuration WHERE name='QUALITY_REPORT_AUTH_URL'; - -DELETE FROM samply.configuration WHERE name='QUALITY_REPORT_AUTH_PRIVATE_KEY_BASE_64'; +INSERT INTO samply.configuration(name, setting, visible) +values ('QUALITY_REPORT_CENTRAXX_VALUES_FILE', 'centraxx.values.txt', false); +DELETE +FROM samply.configuration +WHERE name = 'QUALITY_REPORT_CENTRAXX_ATTRIBUTES_FILE'; + +DELETE +FROM samply.configuration +WHERE name = 'QUALITY_REPORT_NAMESPACE'; +DELETE +FROM samply.configuration +WHERE name = 'QUALITY_REPORT_AUTH_USER_ID'; +DELETE +FROM samply.configuration +WHERE name = 'QUALITY_REPORT_AUTH_KEY_ID'; +DELETE +FROM samply.configuration +WHERE name = 'QUALITY_REPORT_AUTH_URL'; + +DELETE +FROM samply.configuration +WHERE name = 'QUALITY_REPORT_AUTH_PRIVATE_KEY_BASE_64'; diff --git a/src/main/resources/db/migration/samply/V6__tables.sql b/src/main/resources/db/migration/samply/V6__tables.sql index dc6f234e..c32e984e 100644 --- a/src/main/resources/db/migration/samply/V6__tables.sql +++ b/src/main/resources/db/migration/samply/V6__tables.sql @@ -1 +1,3 @@ -UPDATE samply.configuration SET setting='urn:dktk:dataelement:41:3, urn:dktk:dataelement:47:3, urn:dktk:dataelement:71:2, urn:dktk:dataelement:84:2' WHERE name='QUALITY_REPORT_IGNORED_DATAELEMENTS'; \ No newline at end of file +UPDATE samply.configuration +SET setting='urn:dktk:dataelement:41:3, urn:dktk:dataelement:47:3, urn:dktk:dataelement:71:2, urn:dktk:dataelement:84:2' +WHERE name = 'QUALITY_REPORT_IGNORED_DATAELEMENTS'; \ No newline at end of file diff --git a/src/main/resources/db/migration/samply/V7__entity.sql b/src/main/resources/db/migration/samply/V7__entity.sql index a2d8091f..e507e6dd 100644 --- a/src/main/resources/db/migration/samply/V7__entity.sql +++ b/src/main/resources/db/migration/samply/V7__entity.sql @@ -1 +1,8 @@ -ALTER TYPE samply.entity_type add VALUE 'UNKNOWN'; \ No newline at end of file +ALTER +TYPE +samply +. +entity_type +add +VALUE +'UNKNOWN'; \ No newline at end of file diff --git a/src/main/resources/db/migration/samply/V8__entity2.sql b/src/main/resources/db/migration/samply/V8__entity2.sql index 5da7d196..3044721c 100644 --- a/src/main/resources/db/migration/samply/V8__entity2.sql +++ b/src/main/resources/db/migration/samply/V8__entity2.sql @@ -1 +1,2 @@ -INSERT INTO requested_entity(name) values('UNKNOWN'); \ No newline at end of file +INSERT INTO requested_entity(name) +values ('UNKNOWN'); \ No newline at end of file diff --git a/src/main/resources/db/migration/samply/V9__gba-mdr-store.sql b/src/main/resources/db/migration/samply/V9__gba-mdr-store.sql index dbb7452e..7bd087f2 100644 --- a/src/main/resources/db/migration/samply/V9__gba-mdr-store.sql +++ b/src/main/resources/db/migration/samply/V9__gba-mdr-store.sql @@ -1,2 +1,6 @@ -UPDATE samply.configuration SET setting='https://mdr.germanbiobanknode.de/v3/api/mdr' WHERE name='MDR_URL'; -UPDATE samply.configuration SET setting='http://localhost:8081' WHERE name='LDM_URL'; \ No newline at end of file +UPDATE samply.configuration +SET setting='https://mdr.germanbiobanknode.de/v3/api/mdr' +WHERE name = 'MDR_URL'; +UPDATE samply.configuration +SET setting='http://localhost:8081' +WHERE name = 'LDM_URL'; \ No newline at end of file diff --git a/src/main/resources/dktk_common_config.xml b/src/main/resources/dktk_common_config.xml new file mode 100644 index 00000000..479d339b --- /dev/null +++ b/src/main/resources/dktk_common_config.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/quartz-jobs.xml b/src/main/resources/quartz-jobs.xml index 15b3ac24..0dcb8435 100644 --- a/src/main/resources/quartz-jobs.xml +++ b/src/main/resources/quartz-jobs.xml @@ -50,7 +50,10 @@ UploadToCentralMdsDbJobDktkFlag CentralSearchGroup - This Job prepares and/or performs an upload to the central mds database, depending on the status. It performs an incremental upload of those patients that gave their explicit consent to be included in the DKTK. + This Job prepares and/or performs an upload to the central mds database, depending on the + status. It performs an incremental upload of those patients that gave their explicit consent to be + included in the DKTK. + de.samply.share.client.job.UploadToCentralMdsDbJob true false @@ -77,7 +80,10 @@ UploadToCentralMdsDbJobNoDktkFlag CentralSearchGroup - This Job prepares and/or performs an upload to the central mds database, depending on the status. It performs an upload of those patients, that have not explicitly given their consent to be included in DKTK, but can be uploaded due to another given consent. + This Job prepares and/or performs an upload to the central mds database, depending on the + status. It performs an upload of those patients, that have not explicitly given their consent to be + included in DKTK, but can be uploaded due to another given consent. + de.samply.share.client.job.UploadToCentralMdsDbJob true false @@ -104,7 +110,9 @@ CheckLocalComponentsJob MaintenanceGroup - This job checks the other local components (id manager, local datamanagement) for their version and status + This job checks the other local components (id manager, local datamanagement) for their version + and status + de.samply.share.client.job.CheckLocalComponentsJob true false @@ -121,7 +129,9 @@ DbCleanupJob MaintenanceGroup - Do some housekeeping in the database (e.g. mark inquiries as archived after a certain amount of time) + Do some housekeeping in the database (e.g. mark inquiries as archived after a certain amount of + time) + de.samply.share.client.job.DbCleanupJob true false @@ -138,7 +148,9 @@ ReportToMonitoringJob MaintenanceGroup - This job performs tests to determine values for an amount of patient data available or how long it takes to execute an inquiry + This job performs tests to determine values for an amount of patient data available or how long + it takes to execute an inquiry + de.samply.share.client.job.ReportToMonitoringJob true false @@ -177,7 +189,9 @@ ExecuteInquiryJob InquiryGroup - This Job posts an inquiry to the local datamanagement, stores the location and spawns a CheckInquiryStatusJob + This Job posts an inquiry to the local datamanagement, stores the location and spawns a + CheckInquiryStatusJob + de.samply.share.client.job.ExecuteInquiryJob true false diff --git a/src/main/resources/quartz.properties b/src/main/resources/quartz.properties index 94d40e41..dbf8d76b 100644 --- a/src/main/resources/quartz.properties +++ b/src/main/resources/quartz.properties @@ -3,17 +3,14 @@ #============================================================================ org.quartz.scheduler.instanceName=SamplyShareScheduler org.quartz.scheduler.interruptJobsOnShutdownWithWait=true - #============================================================================ # Configure ThreadPool #============================================================================ org.quartz.threadPool.threadCount=10 - #============================================================================ # Configure JobStore #============================================================================ -org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore - +org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore org.quartz.plugin.jobInitializer.class=org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin org.quartz.plugin.jobInitializer.fileNames=quartz-jobs.xml org.quartz.plugin.jobInitializer.failOnFileNotFound=true \ No newline at end of file diff --git a/src/main/webapp/META-INF/context.xml b/src/main/webapp/META-INF/context.xml index 50d2a54d..d19e7b71 100644 --- a/src/main/webapp/META-INF/context.xml +++ b/src/main/webapp/META-INF/context.xml @@ -4,6 +4,7 @@ type="javax.sql.DataSource" driverClassName="org.postgresql.Driver" url="jdbc:postgresql://localhost:5432/samply.connector" username="samply" password="samply" maxTotal="100" maxIdle="30" - maxWaitMillis="30000" removeAbandonedOnBorrow="true" removeAbandonedOnMaintenance="true" removeAbandonedTimeout="120" logAbandoned="true" + maxWaitMillis="30000" removeAbandonedOnBorrow="true" removeAbandonedOnMaintenance="true" + removeAbandonedTimeout="120" logAbandoned="true" testOnBorrow="true" validationQuery="select 1"/> diff --git a/src/main/webapp/WEB-INF/errorpages/bug.xhtml b/src/main/webapp/WEB-INF/errorpages/bug.xhtml index 9f71b728..6078b31a 100644 --- a/src/main/webapp/WEB-INF/errorpages/bug.xhtml +++ b/src/main/webapp/WEB-INF/errorpages/bug.xhtml @@ -1,6 +1,6 @@ You got a RuntimeException! There's a BUG somewhere! \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/errorpages/database.xhtml b/src/main/webapp/WEB-INF/errorpages/database.xhtml index cf9cf966..affa7007 100644 --- a/src/main/webapp/WEB-INF/errorpages/database.xhtml +++ b/src/main/webapp/WEB-INF/errorpages/database.xhtml @@ -1,6 +1,6 @@ Oops! DB fail! \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/errorpages/expired.xhtml b/src/main/webapp/WEB-INF/errorpages/expired.xhtml index 8518eb1c..fdd6ebbd 100644 --- a/src/main/webapp/WEB-INF/errorpages/expired.xhtml +++ b/src/main/webapp/WEB-INF/errorpages/expired.xhtml @@ -1,6 +1,6 @@ Sorry... The session has expired! diff --git a/src/main/webapp/WEB-INF/faces-config.xml b/src/main/webapp/WEB-INF/faces-config.xml index 058712fb..aa069598 100644 --- a/src/main/webapp/WEB-INF/faces-config.xml +++ b/src/main/webapp/WEB-INF/faces-config.xml @@ -1,7 +1,7 @@ @@ -18,7 +18,8 @@ - org.omnifaces.exceptionhandler.FullAjaxExceptionHandlerFactory + org.omnifaces.exceptionhandler.FullAjaxExceptionHandlerFactory + @@ -34,5 +35,5 @@ de.samply.common.web.jsf.renderer.BootstrapMessagesRenderer - + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/includes/c_configuration_centralMdsDb.xhtml b/src/main/webapp/WEB-INF/includes/c_configuration_centralMdsDb.xhtml index c12491b5..3af18241 100644 --- a/src/main/webapp/WEB-INF/includes/c_configuration_centralMdsDb.xhtml +++ b/src/main/webapp/WEB-INF/includes/c_configuration_centralMdsDb.xhtml @@ -38,13 +38,14 @@
#{msg.configuration_centralSearch} - + + pass:disabled="disabled"> @@ -59,15 +60,19 @@ - + - #{msg.configuration_manageCredentialsLink} + + #{msg.configuration_manageCredentialsLink} + - - + + - + @@ -54,16 +56,20 @@ - - + + - +
diff --git a/src/main/webapp/WEB-INF/includes/c_configuration_mdr.xhtml b/src/main/webapp/WEB-INF/includes/c_configuration_mdr.xhtml index 37fe5779..dbf3cca4 100644 --- a/src/main/webapp/WEB-INF/includes/c_configuration_mdr.xhtml +++ b/src/main/webapp/WEB-INF/includes/c_configuration_mdr.xhtml @@ -39,19 +39,25 @@ - + - + - + diff --git a/src/main/webapp/WEB-INF/includes/c_configuration_monitoring.xhtml b/src/main/webapp/WEB-INF/includes/c_configuration_monitoring.xhtml index 05991ddb..fec3dc13 100644 --- a/src/main/webapp/WEB-INF/includes/c_configuration_monitoring.xhtml +++ b/src/main/webapp/WEB-INF/includes/c_configuration_monitoring.xhtml @@ -36,12 +36,12 @@
#{msg.configuration_monitoring} - + + value="#{configurationBean.configurationMap[EnumConfiguration.MONITORING_REPORT_COUNT_TOTAL]}"/> @@ -49,31 +49,34 @@ + value="#{configurationBean.configurationMap[EnumConfiguration.MONITORING_REPORT_COUNT_DKTKFLAG]}"/> - + + value="#{configurationBean.configurationMap[EnumConfiguration.MONITORING_REPORT_COUNT_REFERENCEQUERY]}"/> - + + value="#{configurationBean.configurationMap[EnumConfiguration.MONITORING_REPORT_TIME_REFERENCEQUERY]}"/> - + + value="#{configurationBean.configurationMap[EnumConfiguration.MONITORING_REPORT_CENTRAXX_MAPPING_INFORMATION]}"/> diff --git a/src/main/webapp/WEB-INF/includes/c_configuration_proxy.xhtml b/src/main/webapp/WEB-INF/includes/c_configuration_proxy.xhtml index d7c38b20..2747533f 100644 --- a/src/main/webapp/WEB-INF/includes/c_configuration_proxy.xhtml +++ b/src/main/webapp/WEB-INF/includes/c_configuration_proxy.xhtml @@ -38,13 +38,17 @@ - + - +
diff --git a/src/main/webapp/WEB-INF/includes/c_configuration_timings.xhtml b/src/main/webapp/WEB-INF/includes/c_configuration_timings.xhtml index f058b6d3..9f239bda 100644 --- a/src/main/webapp/WEB-INF/includes/c_configuration_timings.xhtml +++ b/src/main/webapp/WEB-INF/includes/c_configuration_timings.xhtml @@ -36,13 +36,14 @@
#{msg.configurationTimings} - +
- +
#{msg.configuration_seconds} @@ -51,13 +52,14 @@ -
- +
#{msg.configuration_seconds} @@ -66,23 +68,25 @@ - - - - + + + -
- +
#{msg.configuration_seconds} @@ -91,12 +95,14 @@ - - - + @@ -105,9 +111,10 @@ labelClasses="col-sm-6 col-md-4" inputClasses="col-sm-6 col-md-8">
- - +
#{msg.configuration_days} diff --git a/src/main/webapp/WEB-INF/includes/c_documents.xhtml b/src/main/webapp/WEB-INF/includes/c_documents.xhtml index 74cf2993..91aa979f 100644 --- a/src/main/webapp/WEB-INF/includes/c_documents.xhtml +++ b/src/main/webapp/WEB-INF/includes/c_documents.xhtml @@ -40,10 +40,10 @@
- +

#{msg.si_documents} #{fn:length(inquiryBean.documents)} -

@@ -51,46 +51,51 @@ - +
- +
- +
- +
- + -
+
- +
- + - + - - + - +
@@ -100,12 +105,17 @@
- + - - + + diff --git a/src/main/webapp/WEB-INF/includes/c_index_centralComponents.xhtml b/src/main/webapp/WEB-INF/includes/c_index_centralComponents.xhtml index a045c515..d26abc76 100644 --- a/src/main/webapp/WEB-INF/includes/c_index_centralComponents.xhtml +++ b/src/main/webapp/WEB-INF/includes/c_index_centralComponents.xhtml @@ -35,9 +35,9 @@ + details="Ein zentrales Biobank - und Patientenregister" + cssClass="col-lg-6 col-md-6 col-sm-6 col-xs-12" + iconClass="fa-database"/> diff --git a/src/main/webapp/WEB-INF/includes/c_index_localComponents.xhtml b/src/main/webapp/WEB-INF/includes/c_index_localComponents.xhtml index d3892d6c..d4cc9940 100644 --- a/src/main/webapp/WEB-INF/includes/c_index_localComponents.xhtml +++ b/src/main/webapp/WEB-INF/includes/c_index_localComponents.xhtml @@ -36,22 +36,22 @@ + cssClass="col-lg-4 col-md-4 col-sm-6 col-xs-6" + iconSizeClass="fa-3x"/> + checkResult="#{applicationBean.ldmAvailability}" + cssClass="col-lg-4 col-md-4 col-sm-6 col-xs-6" + iconSizeClass="fa-3x"/> + cssClass="col-lg-4 col-md-4 col-sm-6 col-xs-6" + iconSizeClass="fa-3x"/> diff --git a/src/main/webapp/WEB-INF/includes/c_index_welcome.xhtml b/src/main/webapp/WEB-INF/includes/c_index_welcome.xhtml index d41eb3bd..5307c532 100644 --- a/src/main/webapp/WEB-INF/includes/c_index_welcome.xhtml +++ b/src/main/webapp/WEB-INF/includes/c_index_welcome.xhtml @@ -35,16 +35,22 @@
-

Willkommen auf Ihrem DKTK Brückenkopf

+

Willkommen + auf Ihrem DKTK Brückenkopf +

-

Sie befinden sich auf der Einstiegsseite des Brückenkopfes am Standort #{applicationBean.infos.name}. +

Sie befinden sich auf der Einstiegsseite des Brückenkopfes am Standort + #{applicationBean.infos.name}. Der Brückenkopf dient dazu, die Daten eines Standorts in ein DKTK-kompatibles Format zu überführen und für die anderen Komponenten nutzbar zu machen. Er ist zwar Software des DKTK, wird jedoch unter lokaler - – also der in #{applicationBean.infos.name} – Hoheit betrieben. Weitere Informationen zum Brückenkopfkonzept + – also der in #{applicationBean.infos.name} – Hoheit betrieben. Weitere Informationen zum + Brückenkopfkonzept finden Sie in den Konzepten der DKTK-Arbeitsgruppe CCP-IT, die Sie unter - https://ccp-it.dktk.dkfz.de/ - frei herunterladen können.

+ https://ccp-it.dktk.dkfz.de/ + + frei herunterladen können. +

Diese Seite zeigt, aus welchen Softwarekomponenten Ihr Brückenkopf besteht. Mit einem Linksklick auf einen Eintrag werden Sie zur entsprechenden Komponente weitergeleitet. Außerdem können Sie Erreichbarkeit und Version jeder Komponente einsehen.

@@ -54,15 +60,15 @@ #{applicationBean.operator.firstName} #{applicationBean.operator.lastName} -
+
- - + +
-
- +
+

diff --git a/src/main/webapp/WEB-INF/includes/c_inquiry_answer.xhtml b/src/main/webapp/WEB-INF/includes/c_inquiry_answer.xhtml index 81c348b1..dd4ccbd1 100644 --- a/src/main/webapp/WEB-INF/includes/c_inquiry_answer.xhtml +++ b/src/main/webapp/WEB-INF/includes/c_inquiry_answer.xhtml @@ -33,7 +33,8 @@ xmlns:wu="http://share.samply.de/webutils" xmlns:sscl="http://xmlns.jcp.org/jsf/composite/samply-share-client"> - +
diff --git a/src/main/webapp/WEB-INF/includes/c_inquiry_contact.xhtml b/src/main/webapp/WEB-INF/includes/c_inquiry_contact.xhtml index 455f6ea8..4e586578 100644 --- a/src/main/webapp/WEB-INF/includes/c_inquiry_contact.xhtml +++ b/src/main/webapp/WEB-INF/includes/c_inquiry_contact.xhtml @@ -35,8 +35,10 @@
Name:
-
#{inquiryBean.selectedInquiryContact.title} #{inquiryBean.selectedInquiryContact.firstName} - #{inquiryBean.selectedInquiryContact.lastName}
+
#{inquiryBean.selectedInquiryContact.title} + #{inquiryBean.selectedInquiryContact.firstName} + #{inquiryBean.selectedInquiryContact.lastName} +
#{msg.si_phone}:
@@ -46,8 +48,8 @@
Email:
- - + +
diff --git a/src/main/webapp/WEB-INF/includes/c_inquiry_events.xhtml b/src/main/webapp/WEB-INF/includes/c_inquiry_events.xhtml index c95989e4..3fb5542e 100644 --- a/src/main/webapp/WEB-INF/includes/c_inquiry_events.xhtml +++ b/src/main/webapp/WEB-INF/includes/c_inquiry_events.xhtml @@ -32,11 +32,12 @@ xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:wu="http://share.samply.de/webutils" xmlns:sscl="http://xmlns.jcp.org/jsf/composite/samply-share-client"> - +
    - +
  • diff --git a/src/main/webapp/WEB-INF/includes/c_inquiry_graphs.xhtml b/src/main/webapp/WEB-INF/includes/c_inquiry_graphs.xhtml index 2eb69f8b..13f3cfab 100644 --- a/src/main/webapp/WEB-INF/includes/c_inquiry_graphs.xhtml +++ b/src/main/webapp/WEB-INF/includes/c_inquiry_graphs.xhtml @@ -33,13 +33,15 @@ xmlns:sscl="http://xmlns.jcp.org/jsf/composite/samply-share-client"> - + - - - - - + + + + + @@ -50,7 +52,8 @@ value="#{inquiryBean.getResultCountByIdGroupedByGender()}"/> - +
    diff --git a/src/main/webapp/WEB-INF/includes/c_inquiry_info.xhtml b/src/main/webapp/WEB-INF/includes/c_inquiry_info.xhtml index d07b52cf..76919c94 100644 --- a/src/main/webapp/WEB-INF/includes/c_inquiry_info.xhtml +++ b/src/main/webapp/WEB-INF/includes/c_inquiry_info.xhtml @@ -4,24 +4,26 @@ xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:sscl="http://xmlns.jcp.org/jsf/composite/samply-share-client"> - +
    - - + +
    -
    +
    - + - +
    diff --git a/src/main/webapp/WEB-INF/includes/c_inquiry_results.xhtml b/src/main/webapp/WEB-INF/includes/c_inquiry_results.xhtml index 5fb5e0b4..87133ca9 100644 --- a/src/main/webapp/WEB-INF/includes/c_inquiry_results.xhtml +++ b/src/main/webapp/WEB-INF/includes/c_inquiry_results.xhtml @@ -5,15 +5,16 @@ xmlns:o="http://omnifaces.org/ui" xmlns:sscl="http://xmlns.jcp.org/jsf/composite/samply-share-client"> - - - - + + + + - + #{msg.si_resultsHiddenDetails} @@ -24,15 +25,16 @@ - +

    - +

    - +

    @@ -43,7 +45,7 @@ - + @@ -51,22 +53,23 @@ - + - + - +

    - +

    @@ -81,24 +84,26 @@

    - +

    -
      +
        - +
        - +
        - +
        -
          +
    diff --git a/src/main/webapp/WEB-INF/includes/c_loginPanel.xhtml b/src/main/webapp/WEB-INF/includes/c_loginPanel.xhtml index af2620c2..d920c41e 100644 --- a/src/main/webapp/WEB-INF/includes/c_loginPanel.xhtml +++ b/src/main/webapp/WEB-INF/includes/c_loginPanel.xhtml @@ -1,14 +1,14 @@ + xmlns:h="http://xmlns.jcp.org/jsf/html" + xmlns:ui="http://xmlns.jcp.org/jsf/facelets" + xmlns:wu="http://share.samply.de/webutils" + xmlns:pass="http://xmlns.jcp.org/jsf/passthrough"> -
    - - +
    \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/includes/c_upload_events.xhtml b/src/main/webapp/WEB-INF/includes/c_upload_events.xhtml index 1f987e2a..b52279ad 100644 --- a/src/main/webapp/WEB-INF/includes/c_upload_events.xhtml +++ b/src/main/webapp/WEB-INF/includes/c_upload_events.xhtml @@ -32,11 +32,12 @@ xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:wu="http://share.samply.de/webutils" xmlns:sscl="http://xmlns.jcp.org/jsf/composite/samply-share-client"> - +
      - +
    • diff --git a/src/main/webapp/WEB-INF/includes/c_upload_info.xhtml b/src/main/webapp/WEB-INF/includes/c_upload_info.xhtml index 04c104bd..4c0ba240 100644 --- a/src/main/webapp/WEB-INF/includes/c_upload_info.xhtml +++ b/src/main/webapp/WEB-INF/includes/c_upload_info.xhtml @@ -33,40 +33,41 @@ xmlns:sscl="http://xmlns.jcp.org/jsf/composite/samply-share-client" xmlns:wu="http://share.samply.de/webutils"> - +
      - +
      - +
      - +
      - +
      - +
      - + - +
      @@ -74,14 +75,14 @@
      - +
      - + - +
      @@ -89,14 +90,14 @@
      - +
      - + - +
      @@ -104,20 +105,20 @@
      - +
      - +
      - +
      - +
      diff --git a/src/main/webapp/WEB-INF/templates/errorpage.xhtml b/src/main/webapp/WEB-INF/templates/errorpage.xhtml index 06284e96..90e6c789 100644 --- a/src/main/webapp/WEB-INF/templates/errorpage.xhtml +++ b/src/main/webapp/WEB-INF/templates/errorpage.xhtml @@ -1,9 +1,9 @@ Error @@ -12,13 +12,18 @@
      • Date/time: #{of:formatDate(now, 'yyyy-MM-dd HH:mm:ss')}
      • User agent: #{header['user-agent']}
      • -
      • User IP: #{empty header['x-forwarded-for'] ? request.remoteAddr : fn:split(header['x-forwarded-for'], ',')[0]}
      • -
      • Request URI: #{requestScope['javax.servlet.error.request_uri']}
      • +
      • User IP: + #{empty header['x-forwarded-for'] ? request.remoteAddr : fn:split(header['x-forwarded-for'], ',')[0]} +
      • +
      • Request URI: #{requestScope['javax.servlet.error.request_uri']} +
      • Ajax request: #{facesContext.partialViewContext.ajaxRequest ? 'Yes' : 'No'}
      • Status code: #{requestScope['javax.servlet.error.status_code']}
      • Exception type: #{requestScope['javax.servlet.error.exception_type']}
      • Exception message: #{requestScope['javax.servlet.error.message']}
      • -
      • Stack trace:
        #{of:printStackTrace(requestScope['javax.servlet.error.exception'])}
      • +
      • Stack trace: +
        #{of:printStackTrace(requestScope['javax.servlet.error.exception'])}
        +
      scrollTo(0, 0); diff --git a/src/main/webapp/WEB-INF/templates/globalTemplate.xhtml b/src/main/webapp/WEB-INF/templates/globalTemplate.xhtml index d82b4aef..214449b5 100644 --- a/src/main/webapp/WEB-INF/templates/globalTemplate.xhtml +++ b/src/main/webapp/WEB-INF/templates/globalTemplate.xhtml @@ -38,70 +38,70 @@ xmlns:ssc="http://xmlns.jcp.org/jsf/composite/samply-share-common" xmlns:sscl="http://xmlns.jcp.org/jsf/composite/samply-share-client"> - - - <h:outputText value="#{applicationBean.getDisplayName()} - "/> - <ui:insert name="title"> - <h:outputText value="??? MISSING PAGE TITLE ???" /> - </ui:insert> - - - - + + + <h:outputText value="#{applicationBean.getDisplayName()} - "/> + <ui:insert name="title"> + <h:outputText value="??? MISSING PAGE TITLE ???"/> + </ui:insert> + + + + - - - - - + + + + + - + - - maxInitValues(#{session.lastAccessedTime}, #{session.maxInactiveInterval} - 30, '#{msg.session_timeout_one}', - '#{msg.session_timeout_two}', '#{msg.session_timeout_two_min}', '#{msg.session_timeout_one_under}'); - + + maxInitValues(#{session.lastAccessedTime}, #{session.maxInactiveInterval} -30, '#{msg.session_timeout_one}', + '#{msg.session_timeout_two}', '#{msg.session_timeout_two_min}', '#{msg.session_timeout_one_under}'); + - - - - + + + + - - - - + + + + - - + + - - - - + + + + -
      - - - - - - - +
      + + + + + + + -
      - - - +
      + + +
      +
      - - - + + + diff --git a/src/main/webapp/WEB-INF/templates/layout.xhtml b/src/main/webapp/WEB-INF/templates/layout.xhtml index c37f7cab..f7f86555 100644 --- a/src/main/webapp/WEB-INF/templates/layout.xhtml +++ b/src/main/webapp/WEB-INF/templates/layout.xhtml @@ -17,38 +17,46 @@ The following application wide constants are available via this template: xmlns:o="http://omnifaces.org/ui" xmlns:of="http://omnifaces.org/functions" xmlns:sw="http://xmlns.jcp.org/jsf/composite/samply-share-client"> - - - - + + + + - + - <ui:insert name="title">#{applicationBean.getDisplayName()} - Error</ui:insert> - + + <ui:insert name="title">#{applicationBean.getDisplayName()} - Error</ui:insert> + + - - - + + + - + - - - + + +
      - + -
      Server (re)started at #{of:formatDateWithTimezone(startup, 'd MMM yyyy HH:mm', 'UTC')} UTC
      +
      Server (re)started at #{of:formatDateWithTimezone(startup, 'd MMM yyyy HH:mm', 'UTC')} UTC +

      #{page.current.title}

      - +
      diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 033c42fe..7f806fdf 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -103,8 +103,8 @@ true - - + + @@ -119,7 +119,7 @@ - org.quartz.ee.servlet.QuartzInitializerListener + org.quartz.ee.servlet.QuartzInitializerListener @@ -154,6 +154,6 @@ The /resources folder. /resources/* - + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/webutils.taglib.xml b/src/main/webapp/WEB-INF/webutils.taglib.xml index a912510c..6cbdf76f 100644 --- a/src/main/webapp/WEB-INF/webutils.taglib.xml +++ b/src/main/webapp/WEB-INF/webutils.taglib.xml @@ -28,60 +28,61 @@ --> - http://share.samply.de/webutils - - - getDesignation - de.samply.share.client.util.WebUtils - java.lang.String getDesignation(java.lang.String, java.lang.String) - + xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"> + http://share.samply.de/webutils + + + getDesignation + de.samply.share.client.util.WebUtils + java.lang.String getDesignation(java.lang.String, java.lang.String) + getValueDesignation de.samply.share.client.util.WebUtils - java.lang.String getValueDesignation(java.lang.String, java.lang.Object, java.lang.String) - - - convertTime - de.samply.share.client.util.WebUtils - java.lang.String convertTime(java.sql.Timestamp) - - - getProjectName - de.samply.share.client.util.WebUtils - java.lang.String getProjectName() - - - getVersionString - de.samply.share.client.util.WebUtils - java.lang.String getVersionString() - - - getBuildDate - de.samply.share.client.util.WebUtils - java.lang.String getBuildDate() - + java.lang.String getValueDesignation(java.lang.String, java.lang.Object, java.lang.String) + + + + convertTime + de.samply.share.client.util.WebUtils + java.lang.String convertTime(java.sql.Timestamp) + + + getProjectName + de.samply.share.client.util.WebUtils + java.lang.String getProjectName() + + + getVersionString + de.samply.share.client.util.WebUtils + java.lang.String getVersionString() + + + getBuildDate + de.samply.share.client.util.WebUtils + java.lang.String getBuildDate() + - - - + + + - - - + + + - - - + + + - - - + + + getParentNodeIndex @@ -94,48 +95,50 @@ java.lang.String getGender(de.samply.share.model.common.Container) - - - + + + - - getBrokerCount - de.samply.share.client.util.WebUtils - long getBrokerCount() - - - getInquiryCount - de.samply.share.client.util.WebUtils - long getInquiryCount(de.samply.share.client.model.EnumInquiryStatus) - - - formatInquiryLogEntry - de.samply.share.client.util.WebUtils - java.lang.String formatInquiryLogEntry(de.samply.share.client.model.db.tables.pojos.EventLog) - - - convertTimestamp - de.samply.share.client.util.WebUtils - java.lang.String convertTimestamp(java.sql.Timestamp) - - - replaceLocalhost - de.samply.share.client.util.WebUtils - java.lang.String replaceLocalhostInUri(java.lang.String) - - - dateToGermanFormatString - de.samply.share.client.util.WebUtils - java.lang.String dateToGermanFormatString(java.util.Date) - - - getUsernameById - de.samply.share.client.util.WebUtils - java.lang.String getUsernameById(int) - - - isCentralSearchPathSet - de.samply.share.client.util.WebUtils - boolean isCentralSearchPathSet() - + + getBrokerCount + de.samply.share.client.util.WebUtils + long getBrokerCount() + + + getInquiryCount + de.samply.share.client.util.WebUtils + long getInquiryCount(de.samply.share.client.model.EnumInquiryStatus) + + + formatInquiryLogEntry + de.samply.share.client.util.WebUtils + java.lang.String + formatInquiryLogEntry(de.samply.share.client.model.db.tables.pojos.EventLog) + + + + convertTimestamp + de.samply.share.client.util.WebUtils + java.lang.String convertTimestamp(java.sql.Timestamp) + + + replaceLocalhost + de.samply.share.client.util.WebUtils + java.lang.String replaceLocalhostInUri(java.lang.String) + + + dateToGermanFormatString + de.samply.share.client.util.WebUtils + java.lang.String dateToGermanFormatString(java.util.Date) + + + getUsernameById + de.samply.share.client.util.WebUtils + java.lang.String getUsernameById(int) + + + isCentralSearchPathSet + de.samply.share.client.util.WebUtils + boolean isCentralSearchPathSet() + \ No newline at end of file diff --git a/src/main/webapp/admin/broker_list.xhtml b/src/main/webapp/admin/broker_list.xhtml index 8bc0d947..c6ba0fde 100644 --- a/src/main/webapp/admin/broker_list.xhtml +++ b/src/main/webapp/admin/broker_list.xhtml @@ -83,7 +83,9 @@ - + + + diff --git a/src/main/webapp/admin/configuration.xhtml b/src/main/webapp/admin/configuration.xhtml index a62eecd9..9a5011ff 100644 --- a/src/main/webapp/admin/configuration.xhtml +++ b/src/main/webapp/admin/configuration.xhtml @@ -37,7 +37,7 @@ xmlns:sscl="http://xmlns.jcp.org/jsf/composite/samply-share-client" xmlns:wu="http://share.samply.de/webutils" > - + #{msg.configuration_title} @@ -49,20 +49,20 @@ - - - + + + - - - + + + - - + + @@ -70,42 +70,42 @@ - -
      + +
      - + -
      +
      - + -
      +
      - + -
      +
      - + -
      +
      - + -
      +
      - + -
      -
      - +
      +
      + -
      +
      - +
      @@ -113,7 +113,7 @@ - + diff --git a/src/main/webapp/admin/credentials_list.xhtml b/src/main/webapp/admin/credentials_list.xhtml index 1dbe7642..dd5677d8 100644 --- a/src/main/webapp/admin/credentials_list.xhtml +++ b/src/main/webapp/admin/credentials_list.xhtml @@ -36,7 +36,7 @@ xmlns:o="http://omnifaces.org/ui" xmlns:sscl="http://xmlns.jcp.org/jsf/composite/samply-share-client" > - + #{msg.cl_title} @@ -47,8 +47,8 @@ - - + + @@ -75,7 +75,8 @@ #{creds.workstation} #{creds.domain} - + @@ -85,46 +86,58 @@ -
      +

      #{msg.cl_addCredentials}

      - + - + - + - + - - - + + - + + id="newCredentialsUsername" size="60" required="true" + requiredMessage="#{msg.cl_newUserNameRequiredMsg}" pass:autocomplete="off"/> - + + id="newCredentialsPassword" size="60" required="true" + requiredMessage="#{msg.cl_newPasswordRequiredMsg}" pass:autocomplete="off"/> - + - + - - + - +
      diff --git a/src/main/webapp/admin/dashboard.xhtml b/src/main/webapp/admin/dashboard.xhtml index 633927f4..ea13774e 100644 --- a/src/main/webapp/admin/dashboard.xhtml +++ b/src/main/webapp/admin/dashboard.xhtml @@ -49,21 +49,21 @@ details="#{msg.dashboard_userListDetails}" action="user_list?faces-redirect=true" iconClass="fa-users"/> -
      +
      -
      +
      -
      +
      -
      +
      -
      +
      -
      +
      - + #{msg.el_title} - + - - - - + + + + - - - - + + + +
      #{msg.el_timestamp}#{msg.el_message}
      #{msg.el_timestamp}#{msg.el_message}
      diff --git a/src/main/webapp/admin/inquiry_handling.xhtml b/src/main/webapp/admin/inquiry_handling.xhtml index b7bbff00..c894e408 100644 --- a/src/main/webapp/admin/inquiry_handling.xhtml +++ b/src/main/webapp/admin/inquiry_handling.xhtml @@ -35,20 +35,20 @@ xmlns:o="http://omnifaces.org/ui" xmlns:f="http://xmlns.jcp.org/jsf/core"> - + #{msg.ih_title} - + - + - + @@ -62,28 +62,32 @@ - - + + - - + + - + - + - + \ No newline at end of file diff --git a/src/main/webapp/admin/job_list.xhtml b/src/main/webapp/admin/job_list.xhtml index 8b3f02c6..880e01f8 100644 --- a/src/main/webapp/admin/job_list.xhtml +++ b/src/main/webapp/admin/job_list.xhtml @@ -35,7 +35,7 @@ xmlns:o="http://omnifaces.org/ui" xmlns:sscl="http://xmlns.jcp.org/jsf/composite/samply-share-client" > - + #{msg.jl_title} @@ -44,10 +44,10 @@

      - +

      - +
      \ No newline at end of file diff --git a/src/main/webapp/admin/qualityreport_list.xhtml b/src/main/webapp/admin/qualityreport_list.xhtml index 341de7b1..10f9e23b 100644 --- a/src/main/webapp/admin/qualityreport_list.xhtml +++ b/src/main/webapp/admin/qualityreport_list.xhtml @@ -36,7 +36,7 @@ xmlns:o="http://omnifaces.org/ui" xmlns:wu="http://share.samply.de/webutils" > - + #{msg.qr_title} @@ -53,17 +53,20 @@ - - + + - - + + - - - + + + @@ -71,7 +74,8 @@
      - +
      #{msg.qr_startTime}: #{qualityReportController.chainStatistics.startTime} @@ -80,12 +84,17 @@ #{msg.qr_consumedTime}: #{qualityReportController.chainStatistics.timeConsumed}
      - #{msg.qr_remainingTime}: #{qualityReportController.chainStatistics.estimatedTimeToBeCompleted} + #{msg.qr_remainingTime}: + #{qualityReportController.chainStatistics.estimatedTimeToBeCompleted}
      - +
      -
      +
      #{qualityReportController.chainStatistics.percentage}%
      @@ -101,8 +110,9 @@
      - + #{msg.common_cancel} @@ -112,13 +122,15 @@ - + - - -