diff --git a/src/main/kotlin/dev/dnpm/etl/processor/services/TransformationService.kt b/src/main/kotlin/dev/dnpm/etl/processor/services/TransformationService.kt index 26de550..2a9dc5b 100644 --- a/src/main/kotlin/dev/dnpm/etl/processor/services/TransformationService.kt +++ b/src/main/kotlin/dev/dnpm/etl/processor/services/TransformationService.kt @@ -51,9 +51,13 @@ class TransformationService(private val objectMapper: ObjectMapper, private val return objectMapper.readValue(json, MtbFile::class.java) } + fun getTransformations(): List { + return this.transformations + } + } -class Transformation private constructor(internal val path: String) { +class Transformation private constructor(val path: String) { lateinit var existingValue: Any private set diff --git a/src/main/kotlin/dev/dnpm/etl/processor/web/TransformationController.kt b/src/main/kotlin/dev/dnpm/etl/processor/web/TransformationController.kt new file mode 100644 index 0000000..f811e9e --- /dev/null +++ b/src/main/kotlin/dev/dnpm/etl/processor/web/TransformationController.kt @@ -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 . + */ + +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" + } + +} \ No newline at end of file diff --git a/src/main/resources/static/style.css b/src/main/resources/static/style.css index 5a70c2d..203ac56 100644 --- a/src/main/resources/static/style.css +++ b/src/main/resources/static/style.css @@ -86,6 +86,10 @@ nav > ul > li:first-of-type { text-decoration: none; } +.centered { + text-align: center; +} + main { margin: 0 auto; max-width: 1140px; @@ -209,6 +213,25 @@ td.bg-gray, th.bg-gray { color: white; } +.bg-path { + background: var(--bg-gray-op); +} + +.bg-from { + background: var(--bg-red-op); +} + +.bg-to { + background: var(--bg-green-op); +} + +.bg-path, .bg-from, .bg-to { + padding: 0.25rem 0.5rem; + border-radius: 3px; + + font-family: monospace; +} + td.bg-shaded, th.bg-shaded { background: repeating-linear-gradient(140deg, white, #e5e5f5 4px, white 8px); } diff --git a/src/main/resources/templates/fragments.html b/src/main/resources/templates/fragments.html index 369add3..ea0fe1d 100644 --- a/src/main/resources/templates/fragments.html +++ b/src/main/resources/templates/fragments.html @@ -10,6 +10,7 @@ diff --git a/src/main/resources/templates/transformations.html b/src/main/resources/templates/transformations.html new file mode 100644 index 0000000..b8e2f37 --- /dev/null +++ b/src/main/resources/templates/transformations.html @@ -0,0 +1,47 @@ + + + + + ETL-Prozessor + + + +
+
+

Transformationen

+ +

Syntax

+ Hier einige Beispiele zum Syntax des JSON-Path +
    +
  • diagnoses[*].icdO3T.version: Ersetze die ICD-O3T-Version in allen Diagnosen, z.B. zur Version der deutschen Übersetzung
  • +
  • patient.gender: Ersetze das Geschlecht des Patienten, z.B. in das von bwHC verlangte Format
  • +
+ +

Konfigurierte Transformationen

+

+ Hier sehen Sie eine Übersicht der konfigurierten Transformationen. +

+ + + + + + + + + + + + + + +
JSON-PathTransformation von ⇒ nach
+ [[ ${transformation.path} ]] + + [[ ${transformation.existingValue} ]] + + [[ ${transformation.newValue} ]] +
+
+ + \ No newline at end of file