summaryrefslogtreecommitdiff
path: root/src/main/resources
diff options
context:
space:
mode:
authorPaul-Christian Volkmer2023-07-25 18:37:33 +0200
committerPaul-Christian Volkmer2023-07-25 18:37:33 +0200
commit94846deb98ccb892a39795a9e8626f7303efd395 (patch)
tree7a1c23bbdc189d3b74f4ec4a958321ee14946304 /src/main/resources
parentcd46fa7e0904d3de182d947dc1820a9e833673e6 (diff)
Added Link to request report
Diffstat (limited to 'src/main/resources')
-rw-r--r--src/main/resources/db/migration/mariadb/V0_1_0__Init.sql16
-rw-r--r--src/main/resources/db/migration/postgresql/V0_1_0__Init.sql16
-rw-r--r--src/main/resources/templates/errors/404.html15
-rw-r--r--src/main/resources/templates/index.html5
-rw-r--r--src/main/resources/templates/report.html42
5 files changed, 79 insertions, 15 deletions
diff --git a/src/main/resources/db/migration/mariadb/V0_1_0__Init.sql b/src/main/resources/db/migration/mariadb/V0_1_0__Init.sql
index 38a3d5f..fa83f8d 100644
--- a/src/main/resources/db/migration/mariadb/V0_1_0__Init.sql
+++ b/src/main/resources/db/migration/mariadb/V0_1_0__Init.sql
@@ -1,10 +1,12 @@
CREATE TABLE IF NOT EXISTS request
(
- id int auto_increment primary key,
- uuid varchar(255) not null unique,
- patient_id varchar(255) not null,
- pid varchar(255) not null,
- fingerprint varchar(255) not null,
- status varchar(16) not null,
- processed_at datetime default utc_timestamp() not null
+ id int auto_increment primary key,
+ uuid varchar(255) not null unique,
+ patient_id varchar(255) not null,
+ pid varchar(255) not null,
+ fingerprint varchar(255) not null,
+ status varchar(16) not null,
+ processed_at datetime default utc_timestamp() not null,
+ description varchar(255) default '',
+ data_quality_report mediumtext default ''
); \ No newline at end of file
diff --git a/src/main/resources/db/migration/postgresql/V0_1_0__Init.sql b/src/main/resources/db/migration/postgresql/V0_1_0__Init.sql
index 483479d..930064c 100644
--- a/src/main/resources/db/migration/postgresql/V0_1_0__Init.sql
+++ b/src/main/resources/db/migration/postgresql/V0_1_0__Init.sql
@@ -1,11 +1,13 @@
CREATE TABLE IF NOT EXISTS request
(
- id serial,
- uuid varchar(255) not null unique,
- patient_id varchar(255) not null,
- pid varchar(255) not null,
- fingerprint varchar(255) not null,
- status varchar(16) not null,
- processed_at timestamp with time zone default now() not null,
+ id serial,
+ uuid varchar(255) not null unique,
+ patient_id varchar(255) not null,
+ pid varchar(255) not null,
+ fingerprint varchar(255) not null,
+ status varchar(16) not null,
+ processed_at timestamp with time zone default now() not null,
+ description varchar(255) default '',
+ data_quality_report text default '',
PRIMARY KEY (id)
); \ No newline at end of file
diff --git a/src/main/resources/templates/errors/404.html b/src/main/resources/templates/errors/404.html
new file mode 100644
index 0000000..8900433
--- /dev/null
+++ b/src/main/resources/templates/errors/404.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html lang="de" xmlns:th="http://www.thymeleaf.org">
+<head>
+ <meta charset="UTF-8">
+ <title>ETL-Prozessor</title>
+ <link rel="stylesheet" th:href="@{/style.css}" />
+</head>
+<body>
+ <div th:replace="~{fragments.html :: nav}"></div>
+ <main>
+ <h1>Nichts gefunden</h1>
+ </main>
+
+</body>
+</html> \ No newline at end of file
diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html
index 8aa60d1..b8a4fb0 100644
--- a/src/main/resources/templates/index.html
+++ b/src/main/resources/templates/index.html
@@ -27,7 +27,10 @@
<td th:if="${request.status.value == 'error'}" class="bg-red"><small>[[ ${request.status} ]]</small></td>
<td th:if="${request.status.value == 'unknown'}" class="bg-gray"><small>[[ ${request.status} ]]</small></td>
<td th:if="${request.status.value == 'duplication'}" class="bg-gray"><small>[[ ${request.status} ]]</small></td>
- <td>[[ ${request.uuid} ]]</td>
+ <td th:if="not ${request.report}">[[ ${request.uuid} ]]</td>
+ <td th:if="${request.report}">
+ <a th:href="@{/report/{id}(id=${request.uuid})}">[[ ${request.uuid} ]]</a>
+ </td>
<td><time th:datetime="${request.processedAt}">[[ ${request.processedAt} ]]</time></td>
<td>[[ ${request.patientId} ]]</td>
</tr>
diff --git a/src/main/resources/templates/report.html b/src/main/resources/templates/report.html
new file mode 100644
index 0000000..5a08e44
--- /dev/null
+++ b/src/main/resources/templates/report.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html lang="de" xmlns:th="http://www.thymeleaf.org">
+<head>
+ <meta charset="UTF-8">
+ <title>ETL-Prozessor</title>
+ <link rel="stylesheet" th:href="@{/style.css}" />
+</head>
+<body>
+ <div th:replace="~{fragments.html :: nav}"></div>
+ <main>
+
+ <h1>Anfrage <span class="monospace">[[ ${request.uuid} ]]</span></h1>
+
+ <table>
+ <thead>
+ <tr>
+ <th>Status</th>
+ <th>ID</th>
+ <th>Datum</th>
+ <th>Patienten-ID</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td th:if="${request.status.value == 'success'}" class="bg-green"><small>[[ ${request.status} ]]</small></td>
+ <td th:if="${request.status.value == 'warning'}" class="bg-yellow"><small>[[ ${request.status} ]]</small></td>
+ <td th:if="${request.status.value == 'error'}" class="bg-red"><small>[[ ${request.status} ]]</small></td>
+ <td th:if="${request.status.value == 'unknown'}" class="bg-gray"><small>[[ ${request.status} ]]</small></td>
+ <td th:if="${request.status.value == 'duplication'}" class="bg-gray"><small>[[ ${request.status} ]]</small></td>
+ <td>[[ ${request.uuid} ]]</td>
+ <td><time th:datetime="${request.processedAt}">[[ ${request.processedAt} ]]</time></td>
+ <td>[[ ${request.patientId} ]]</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <h2 th:text="${request.report.description}"></h2>
+ <div class="chart monospace" th:text="${request.report.dataQualityReport}"></div>
+ </main>
+ <script th:src="@{/scripts.js}"></script>
+</body>
+</html> \ No newline at end of file