-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add page that shows transformation configuration
- Loading branch information
Showing
5 changed files
with
117 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/main/kotlin/dev/dnpm/etl/processor/web/TransformationController.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* This file is part of ETL-Processor | ||
* | ||
* Copyright (c) 2023 Comprehensive Cancer Center Mainfranken, Datenintegrationszentrum Philipps-Universität Marburg and Contributors | ||
* | ||
* 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 Affero 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 <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package dev.dnpm.etl.processor.web | ||
|
||
import dev.dnpm.etl.processor.services.TransformationService | ||
import org.springframework.stereotype.Controller | ||
import org.springframework.ui.Model | ||
import org.springframework.web.bind.annotation.GetMapping | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
|
||
@Controller | ||
@RequestMapping(path = ["transformations"]) | ||
class TransformationController( | ||
private val transformationService: TransformationService | ||
) { | ||
|
||
@GetMapping | ||
fun index(model: Model): String { | ||
model.addAttribute("transformations", transformationService.getTransformations()) | ||
|
||
return "transformations" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!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>Transformationen</h1> | ||
|
||
<h2>Syntax</h2> | ||
Hier einige Beispiele zum Syntax des JSON-Path | ||
<ul> | ||
<li style="padding: 0.6rem 0;"><span class="bg-path">diagnoses[*].icdO3T.version</span>: Ersetze die ICD-O3T-Version in allen Diagnosen, z.B. zur Version der deutschen Übersetzung</li> | ||
<li style="padding: 0.6rem 0;"><span class="bg-path">patient.gender</span>: Ersetze das Geschlecht des Patienten, z.B. in das von bwHC verlangte Format</li> | ||
</ul> | ||
|
||
<h2>Konfigurierte Transformationen</h2> | ||
<p> | ||
Hier sehen Sie eine Übersicht der konfigurierten Transformationen. | ||
</p> | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th>JSON-Path</th> | ||
<th>Transformation von ⇒ nach</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr th:each="transformation : ${transformations}"> | ||
<td> | ||
<span class="bg-path" title="Ersetze Wert(e) an dieser Stelle im MTB-File">[[ ${transformation.path} ]]</span> | ||
</td> | ||
<td> | ||
<span class="bg-from" title="Ersetze immer dann, wenn dieser Wert enthalten ist">[[ ${transformation.existingValue} ]]</span> | ||
<strong>⇒</strong> | ||
<span class="bg-to" title="Ersetze durch diesen Wert">[[ ${transformation.newValue} ]]</span> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</main> | ||
</body> | ||
</html> |