input) {
- var procedureId = AnalyzerUtils.getRequiredId(input, "id");
-
- if (procedureId.isEmpty()) {
- return "";
- }
-
- if (
- permissionEvaluator.hasPermission(
- SecurityContextHolder.getContext().getAuthentication(),
- procedureId.get(),
- Procedure.class.getSimpleName(),
- PermissionType.READ
- )
- ) {
- return mtbService.getProtocol(
- therapieplanServiceFactory
- .currentUsableInstance()
- .findReferencedMtbs(procedureId.get())
- );
- }
-
- return "";
- }
-
-}
diff --git a/src/main/java/dev/dnpm/config/PluginConfiguration.java b/src/main/java/dev/dnpm/config/PluginConfiguration.java
deleted file mode 100644
index 4787528..0000000
--- a/src/main/java/dev/dnpm/config/PluginConfiguration.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * This file is part of onkostar-plugin-dnpm
- *
- * Copyright (c) 2025 the original author or authors.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package dev.dnpm.config;
-
-import dev.dnpm.database.SettingsRepository;
-import dev.dnpm.services.*;
-import dev.dnpm.services.consent.ConsentManagerServiceFactory;
-import dev.dnpm.services.molekulargenetik.MolekulargenetikFormService;
-import dev.dnpm.services.molekulargenetik.OsMolekulargenetikFormService;
-import dev.dnpm.services.mtb.DefaultMtbService;
-import dev.dnpm.services.mtb.MtbService;
-import dev.dnpm.services.strahlentherapie.DefaultStrahlentherapieService;
-import dev.dnpm.services.strahlentherapie.StrahlentherapieService;
-import dev.dnpm.services.systemtherapie.DefaultSystemtherapieService;
-import dev.dnpm.services.systemtherapie.SystemtherapieService;
-import dev.dnpm.services.therapieplan.TherapieplanServiceFactory;
-import de.itc.onkostar.api.IOnkostarApi;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
-
-import javax.sql.DataSource;
-
-/**
- * Dynamische Konfiguration des Plugins basierend auf Onkostar-Einstellungen
- *
- * @since 0.0.2
- */
-@Configuration
-@ComponentScan(basePackages = { "dev.dnpm.analyzer", "dev.dnpm.security" })
-@EnableJpaRepositories(basePackages = "dev.dnpm.database")
-public class PluginConfiguration {
-
- @Bean
- public FormService formService(final DataSource dataSource) {
- return new DefaultFormService(dataSource);
- }
-
- @Bean
- public StudienService studienService(final DataSource dataSource) {
- return new DefaultStudienService(dataSource);
- }
-
- @Bean
- public SettingsService settingsService(final SettingsRepository settingsRepository) {
- return new SettingsService(settingsRepository);
- }
-
- @Bean
- public MtbService mtbService(final IOnkostarApi onkostarApi) {
- return new DefaultMtbService(onkostarApi);
- }
-
- @Bean
- public SystemtherapieService systemtherapieService(
- final IOnkostarApi onkostarApi,
- final SettingsService settingsService
- ) {
- return new DefaultSystemtherapieService(onkostarApi, settingsService);
- }
-
- @Bean
- public StrahlentherapieService strahlentherapieService(
- final IOnkostarApi onkostarApi,
- final SettingsService settingsService
- ) {
- return new DefaultStrahlentherapieService(onkostarApi, settingsService);
- }
-
- @Bean
- public ConsentManagerServiceFactory consentManagerServiceFactory(final IOnkostarApi onkostarApi) {
- return new ConsentManagerServiceFactory(onkostarApi);
- }
-
- @Bean
- public TherapieplanServiceFactory therapieplanServiceFactory(
- final IOnkostarApi onkostarApi,
- final SettingsService settingsService,
- final FormService formService
- ) {
- return new TherapieplanServiceFactory(onkostarApi, settingsService, formService);
- }
-
- @Bean
- public MolekulargenetikFormService molekulargenetikFormService() {
- return new OsMolekulargenetikFormService();
- }
-
-}
diff --git a/src/main/java/dev/dnpm/database/ReadOnlyRepository.java b/src/main/java/dev/dnpm/database/ReadOnlyRepository.java
deleted file mode 100644
index aa7ce31..0000000
--- a/src/main/java/dev/dnpm/database/ReadOnlyRepository.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * This file is part of onkostar-plugin-dnpm
- *
- * Copyright (c) 2025 the original author or authors.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package dev.dnpm.database;
-
-import org.springframework.data.repository.NoRepositoryBean;
-import org.springframework.data.repository.Repository;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * Basis-Repository for ReadOnly Spring-Data-JPA Repositories
- * Entity-Klassen müssen in Package de.itc.db.dnpm liegen
- * @param Typ des Entities
- * @param Typ der ID
- */
-@NoRepositoryBean
-public interface ReadOnlyRepository extends Repository {
-
- T findById(ID id);
-
- List findAll();
-
-}
diff --git a/src/main/java/dev/dnpm/database/SettingsRepository.java b/src/main/java/dev/dnpm/database/SettingsRepository.java
deleted file mode 100644
index 90e33bd..0000000
--- a/src/main/java/dev/dnpm/database/SettingsRepository.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * This file is part of onkostar-plugin-dnpm
- *
- * Copyright (c) 2025 the original author or authors.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package dev.dnpm.database;
-
-import de.itc.db.dnpm.Setting;
-import org.springframework.stereotype.Repository;
-
-/**
- * Spring Data JPA Repository zum Lesen von Einstellungen
- */
-@Repository("dnpmSettingRepository")
-public interface SettingsRepository extends ReadOnlyRepository {
-
- Setting findByName(String name);
-
-}
diff --git a/src/main/java/dev/dnpm/dto/EcogStatusWithDate.java b/src/main/java/dev/dnpm/dto/EcogStatusWithDate.java
deleted file mode 100644
index a562940..0000000
--- a/src/main/java/dev/dnpm/dto/EcogStatusWithDate.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * This file is part of onkostar-plugin-dnpm
- *
- * Copyright (c) 2025 the original author or authors.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package dev.dnpm.dto;
-
-import org.springframework.util.Assert;
-
-import java.util.Date;
-
-/**
- * Datenklasse zum Abbilden des ECOG-Status und Datum
- */
-public class EcogStatusWithDate {
- private final Date date;
- private final String status;
-
- public EcogStatusWithDate(Date date, String status) {
- Assert.notNull(date, "Date cannot be null");
- Assert.hasText(status, "Status cannot be empty String");
- Assert.isTrue(isValidEcogCode(status), "Not a valid ADT.LeistungszustandECOG code");
- this.date = date;
- this.status = status;
- }
-
- private boolean isValidEcogCode(String status) {
- switch (status) {
- case "0":
- case "1":
- case "2":
- case "3":
- case "4":
- case "5":
- case "U":
- return true;
- default:
- return false;
- }
- }
-
- public Date getDate() {
- return date;
- }
-
- public String getStatus() {
- return status;
- }
-}
diff --git a/src/main/java/dev/dnpm/dto/Studie.java b/src/main/java/dev/dnpm/dto/Studie.java
deleted file mode 100644
index 300dd22..0000000
--- a/src/main/java/dev/dnpm/dto/Studie.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * This file is part of onkostar-plugin-dnpm
- *
- * Copyright (c) 2025 the original author or authors.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package dev.dnpm.dto;
-
-public class Studie {
- private final String kategorieName;
- private final String code;
- private final String studiennummer;
- private final String shortDesc;
- private final String description;
- private final int version;
-
- private final boolean active;
-
- public Studie(final String kategorieName, final int version, final String code, final String studiennummer, final String shortDesc, final String description, final boolean active) {
- this.kategorieName = kategorieName;
- this.version = version;
- this.code = code;
- this.studiennummer = studiennummer;
- this.shortDesc = shortDesc;
- this.description = description;
- this.active = active;
- }
-
- public String getKategorieName() {
- return kategorieName;
- }
-
- public int getVersion() {
- return version;
- }
-
- public String getCode() {
- return code;
- }
-
- public String getStudiennummer() {
- return studiennummer;
- }
-
- public String getShortDesc() {
- return shortDesc;
- }
-
- public String getDescription() {
- return description;
- }
-
- public boolean isActive() {
- return active;
- }
-
- public Type getType() {
- if (this.hasNctNumber()) {
- return Type.NCT;
- } else if (this.hasEudraCtNumber()) {
- return Type.EUDRA_CT;
- } else {
- return Type.UNKNOWN;
- }
- }
-
- private boolean hasNctNumber() {
- return null != studiennummer && studiennummer.toLowerCase().startsWith("nct");
- }
-
- private boolean hasEudraCtNumber() {
- return null != studiennummer && studiennummer.matches("\\d{4}-\\d{6}-\\d{2}");
- }
-
- public enum Type {
- NCT,
- EUDRA_CT,
- UNKNOWN
- }
-}
diff --git a/src/main/java/dev/dnpm/dto/Variant.java b/src/main/java/dev/dnpm/dto/Variant.java
deleted file mode 100644
index 6fd646b..0000000
--- a/src/main/java/dev/dnpm/dto/Variant.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * This file is part of onkostar-plugin-dnpm
- *
- * Copyright (c) 2025 the original author or authors.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package dev.dnpm.dto;
-
-import de.itc.onkostar.api.Procedure;
-
-import java.util.Optional;
-
-/**
- * Ein Auszug der Variante aus dem NGS-Bericht zur Übertragung an das Frontend zur Auswahl der stützenden molekularen Alteration
- *
- * @since 0.2.0
- */
-public class Variant {
- private final Integer id;
-
- private final String ergebnis;
-
- private final String gen;
-
- private final String exon;
-
- private final String pathogenitaetsklasse;
-
- private Variant(
- final int id,
- final String ergebnis,
- final String gen,
- final String exon,
- final String pathogenitaetsklasse
- ) {
- this.id = id;
- this.ergebnis = ergebnis;
- this.gen = gen;
- this.exon = exon;
- this.pathogenitaetsklasse = pathogenitaetsklasse;
- }
-
- public Integer getId() {
- return id;
- }
-
- public String getErgebnis() {
- return ergebnis;
- }
-
- public String getGen() {
- return gen;
- }
-
- public String getExon() {
- return exon;
- }
-
- public String getPathogenitaetsklasse() {
- return pathogenitaetsklasse;
- }
-
- /**
- * Erstellt ein Optional einer Variante aus einer Prozedur
- * @param procedure Die zu verwendende Prozedur
- * @return Das Optional, wenn die Prozedur verwendet werden kann, ansonsten ein leeres Optional
- */
- public static Optional fromProcedure(Procedure procedure) {
- if (!"OS.Molekulargenetische Untersuchung".equals(procedure.getFormName())) {
- return Optional.empty();
- }
-
- var ergebnis = procedure.getValue("Ergebnis");
- var gene = procedure.getValue("Untersucht");
- var exon = procedure.getValue("ExonInt");
- var pathogenitaetsklasse = procedure.getValue("Pathogenitaetsklasse");
-
- if (null == gene) {
- return Optional.empty();
- }
-
- if (ergebnis.getString().equals("P")) {
- return Optional.of(
- new Variant(
- procedure.getId(),
- "Einfache Variante (Mutation)",
- gene.getString().isBlank() ? "-" : gene.getString(),
- null == exon || exon.getString().isBlank() ? "-" : exon.getString(),
- null == pathogenitaetsklasse || pathogenitaetsklasse.getString().isBlank() ? "-" : pathogenitaetsklasse.getString()
- )
- );
- } else if (ergebnis.getString().equals("CNV")) {
- return Optional.of(
- new Variant(
- procedure.getId(),
- "Copy Number Variation (CNV)",
- gene.getString().isBlank() ? "-" : gene.getString(),
- null == exon || exon.getString().isBlank() ? "-" : exon.getString(),
- null == pathogenitaetsklasse || pathogenitaetsklasse.getString().isBlank() ? "-" : pathogenitaetsklasse.getString()
- )
- );
- } else if (ergebnis.getString().equals("F")) {
- return Optional.of(
- new Variant(
- procedure.getId(),
- "Fusion (Translokation Inversion Insertion)",
- gene.getString().isBlank() ? "-" : gene.getString(),
- null == exon || exon.getString().isBlank() ? "-" : exon.getString(),
- null == pathogenitaetsklasse || pathogenitaetsklasse.getString().isBlank() ? "-" : pathogenitaetsklasse.getString()
- )
- );
- } else {
- return Optional.empty();
- }
- }
-}
diff --git a/src/main/java/dev/dnpm/exceptions/FormException.java b/src/main/java/dev/dnpm/exceptions/FormException.java
deleted file mode 100644
index 49adf4a..0000000
--- a/src/main/java/dev/dnpm/exceptions/FormException.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * This file is part of onkostar-plugin-dnpm
- *
- * Copyright (c) 2025 the original author or authors.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package dev.dnpm.exceptions;
-
-public class FormException extends RuntimeException {
-
- public FormException(String message) {
- super(message);
- }
-
-}
diff --git a/src/main/java/dev/dnpm/oshelper/VerweisVon.java b/src/main/java/dev/dnpm/oshelper/VerweisVon.java
new file mode 100644
index 0000000..76b65ba
--- /dev/null
+++ b/src/main/java/dev/dnpm/oshelper/VerweisVon.java
@@ -0,0 +1,78 @@
+/*
+ * This file is part of onkostar-plugin-dnpm
+ *
+ * Copyright (c) 2025 the original author or authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package dev.dnpm.oshelper;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+public class VerweisVon {
+ private int procedure_id;
+ private int data_form_id;
+ private String data_catalogue;
+ private String data_catalogue_entry;
+ private String formname;
+ private Date datum;
+
+ public VerweisVon() {
+ }
+
+ @SuppressWarnings("unused")
+ public int getProcedure_id() { return this.procedure_id; }
+ public int getData_form_id() { return this.data_form_id; }
+ public String getData_catalogue_name() { return this.data_catalogue; }
+ public String getData_catalogue_entry_name() { return this.data_catalogue_entry; }
+ public String getFormname() { return this.formname; }
+ public Date getDate() { return this.datum; }
+ public String getTable() {
+ return "dk_" + this.data_catalogue.toLowerCase().replaceAll("[^a-zA-Z0-9]", "_");
+ }
+ public String getField() {
+ return this.data_catalogue_entry.toLowerCase();
+ }
+ public String getSQL() {
+ return "SELECT " + this.getField() + " AS value FROM " + this.getTable() + " WHERE id = " + this.getProcedure_id();
+ }
+ private String getDatumAsString() {
+ SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd.MM.yyyy");
+ String Datum = null;
+ if (this.getDate() != null) {
+ Datum = DATE_FORMAT.format(this.getDate());
+ }
+ return Datum;
+ }
+ public String getVerbundenesFormular() {
+ String FName = "Formular " + this.getFormname();
+ if (this.getDatumAsString() != null ) { FName += " vom " + this.getDatumAsString(); }
+ return FName;
+ }
+
+ @SuppressWarnings("unused")
+ public void setProcedure_id(int procedure_id) {this.procedure_id = procedure_id; }
+ public void setData_form_id(int data_form_id) {this.data_form_id = data_form_id; }
+ public void setData_catalogue_name(String data_catalogue_name) {this.data_catalogue = data_catalogue_name; }
+ public void setData_catalogue_entry_name(String data_catalogue_entry) {this.data_catalogue_entry = data_catalogue_entry; }
+ public void setDate(Date datum) { this.datum = datum; }
+ public void setFormname(String formname) { this.formname = formname; }
+}
diff --git a/src/main/java/dev/dnpm/oshelper/analyzer/Analyzer.java b/src/main/java/dev/dnpm/oshelper/analyzer/Analyzer.java
new file mode 100644
index 0000000..62d1369
--- /dev/null
+++ b/src/main/java/dev/dnpm/oshelper/analyzer/Analyzer.java
@@ -0,0 +1,36 @@
+/*
+ * This file is part of onkostar-plugin-dnpm
+ *
+ * Copyright (c) 2025 the original author or authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package dev.dnpm.oshelper.analyzer;
+
+import de.itc.onkostar.api.analysis.OnkostarPluginType;
+
+public abstract class Analyzer implements IPluginPart {
+
+ @Override
+ public final OnkostarPluginType getType() {
+ return OnkostarPluginType.ANALYZER;
+ }
+
+}
diff --git a/src/main/java/dev/dnpm/oshelper/analyzer/AnalyzerUtils.java b/src/main/java/dev/dnpm/oshelper/analyzer/AnalyzerUtils.java
new file mode 100644
index 0000000..59a3f56
--- /dev/null
+++ b/src/main/java/dev/dnpm/oshelper/analyzer/AnalyzerUtils.java
@@ -0,0 +1,169 @@
+/*
+ * This file is part of onkostar-plugin-dnpm
+ *
+ * Copyright (c) 2025 the original author or authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package dev.dnpm.oshelper.analyzer;
+
+import java.util.Map;
+import java.util.Optional;
+
+/**
+ * Klasse mit Hilfsfunktionen für Analyzer
+ *
+ * @since 0.1.0
+ */
+public class AnalyzerUtils {
+
+ private AnalyzerUtils() {}
+
+ /**
+ * Prüft, ob in InputMap einen Eintrag mit key key und Typ type
+ * gefunden wurde.
+ *
+ * @param input InputMap
+ * @param key Key des Werts
+ * @param type Typ des Werts
+ * @return true>, wenn ein Wert von dem Typ gefunden wurde
+ */
+ public static boolean requiredValuePresent(final Map input, final String key, final Class> type) {
+ var value = input.get(key);
+
+ if (null == value) {
+ return false;
+ }
+
+ return type.isInstance(value);
+ }
+
+ /**
+ * Übergibt ein Optional mit Wert, wenn in InputMap ein Eintrag mit key key und Typ type
+ * gefunden wurde. Anderenfalls ein leeres Optional
+ *
+ * Beispiel
+ *
+ * var id = AnalyzerUtils.getRequiredValue(input, "id", Integer.class);
+ * if (id.isEmpty()) {
+ * logger.error("Keine ID angegeben!");
+ * return false;
+ * }
+ *
+ * var idNummer = id.get();
+ * ...
+ *
+ *
+ * @param input InputMap
+ * @param key Key des Werts
+ * @param type Typ des Werts
+ * @return Optional mit entsprechendem Wert oder leeres Optional
+ */
+ public static Optional getRequiredValue(final Map input, final String key, final Class type) {
+ if (! requiredValuePresent(input, key, type)) {
+ return Optional.empty();
+ }
+
+ @SuppressWarnings("unchecked")
+ var result = Optional.of((T)input.get(key));
+
+ return result;
+ }
+
+ /**
+ * Prüft, ob ein Wert in der InputMap als Zeichenkette dem angegebenen RegExp entspricht
+ *
+ * @param input InputMap
+ * @param key Key des Werts
+ * @param regexp Der zu prüfende reguläre Ausdruck
+ * @return true>, wenn ein Wert gefunden wurde, der dem RegExp entspricht
+ */
+ public static boolean requiredValueMatches(final Map input, final String key, final String regexp) {
+ var value = input.get(key);
+
+ if (null == value) {
+ return false;
+ }
+
+ return value.toString().matches(regexp);
+ }
+
+ /**
+ * Übergibt ein Optional mit dem Wert als Zeichenkette, wenn er dem angegebenen RegExp entspricht.
+ * Hierzu wird die Methode toString() auf den Wert angewendet.
+ *
+ * @param input InputMap
+ * @param key Key des Werts
+ * @param regexp Der zu prüfende reguläre Ausdruck
+ * @return Optional mit entsprechendem Wert als Zeichenkette oder leeres Optional
+ */
+ public static Optional getRequiredValueMatching(final Map input, final String key, final String regexp) {
+ if (! requiredValueMatches(input, key, regexp)) {
+ return Optional.empty();
+ }
+
+ return Optional.of(input.get(key).toString());
+ }
+
+ /**
+ * Prüft, ob ein Wert in der InputMap eine ID ist und damit eine Zahl größer Null ist.
+ *
+ * @param input InputMap
+ * @param key Key des Werts
+ * @return true>, wenn ein Wert gefunden wurde, der dem RegExp entspricht
+ */
+ public static boolean requiredValueIsId(final Map input, final String key) {
+ return requiredValuePresent(input, key, Integer.class) && Integer.parseInt(input.get(key).toString()) > 0;
+ }
+
+ /**
+ * Übergibt ein Optional, wenn der Wert eine ID ist und damit eine Zahl größer Null ist.
+ * Beispiel
+ *
+ * var id = AnalyzerUtils.getRequiredId(input, "id");
+ * if (id.isEmpty()) {
+ * logger.error("Keine gültige ID angegeben!");
+ * return false;
+ * }
+ *
+ * // Ist hier immer größer als Null
+ * var idNummer = id.get();
+ * ...
+ *
+ *
+ * @param input InputMap
+ * @param key Key des Werts
+ * @return Optional mit entsprechendem Wert oder leeres Optional
+ */
+ public static Optional getRequiredId(final Map input, final String key) {
+ if (! requiredValuePresent(input, key, Integer.class)) {
+ return Optional.empty();
+ }
+
+ var id = (int)input.get(key);
+
+ if (id > 0) {
+ return Optional.of(id);
+ }
+
+ return Optional.empty();
+ }
+
+}
diff --git a/src/main/java/dev/dnpm/oshelper/analyzer/BackendService.java b/src/main/java/dev/dnpm/oshelper/analyzer/BackendService.java
new file mode 100644
index 0000000..3781eae
--- /dev/null
+++ b/src/main/java/dev/dnpm/oshelper/analyzer/BackendService.java
@@ -0,0 +1,49 @@
+/*
+ * This file is part of onkostar-plugin-dnpm
+ *
+ * Copyright (c) 2025 the original author or authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package dev.dnpm.oshelper.analyzer;
+
+import de.itc.onkostar.api.Disease;
+import de.itc.onkostar.api.Procedure;
+import de.itc.onkostar.api.analysis.OnkostarPluginType;
+
+public abstract class BackendService implements IPluginPart {
+
+ @Override
+ public final OnkostarPluginType getType() {
+ return OnkostarPluginType.BACKEND_SERVICE;
+ }
+
+ /**
+ * Ein Backend-Service verwendet die Methode nicht, daher wird hier eine final Stub-Implementierung
+ * verwendet, die ein Überschreiben verhindert.
+ * @param procedure
+ * @param disease
+ */
+ @Override
+ public final void analyze(Procedure procedure, Disease disease) {
+ // No op
+ }
+
+}
diff --git a/src/main/java/dev/dnpm/oshelper/analyzer/ConsentManager.java b/src/main/java/dev/dnpm/oshelper/analyzer/ConsentManager.java
new file mode 100644
index 0000000..1fa47a1
--- /dev/null
+++ b/src/main/java/dev/dnpm/oshelper/analyzer/ConsentManager.java
@@ -0,0 +1,87 @@
+/*
+ * This file is part of onkostar-plugin-dnpm
+ *
+ * Copyright (c) 2025 the original author or authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package dev.dnpm.oshelper.analyzer;
+
+import dev.dnpm.oshelper.services.consent.ConsentManagerServiceFactory;
+import de.itc.onkostar.api.Disease;
+import de.itc.onkostar.api.IOnkostarApi;
+import de.itc.onkostar.api.Procedure;
+import de.itc.onkostar.api.analysis.AnalyzerRequirement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ConsentManager extends Analyzer {
+
+ private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+ private final IOnkostarApi onkostarApi;
+
+ private final ConsentManagerServiceFactory consentManagerServiceFactory;
+
+ public ConsentManager(
+ final IOnkostarApi onkostarApi,
+ final ConsentManagerServiceFactory consentManagerServiceFactory
+ ) {
+ this.onkostarApi = onkostarApi;
+ this.consentManagerServiceFactory = consentManagerServiceFactory;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Aktualisiert Consent Daten in verknüpften Formularen";
+ }
+
+ @Override
+ public AnalyzerRequirement getRequirement() {
+ return AnalyzerRequirement.PROCEDURE;
+ }
+
+ @Override
+ public boolean isRelevantForAnalyzer(Procedure prozedur, Disease erkrankung) {
+ return prozedur.getFormName().equals(onkostarApi.getGlobalSetting("consentform"));
+ }
+
+ @Override
+ public boolean isRelevantForDeletedProcedure() {
+ // TODO is relevant for deleted procedure = true
+ return false;
+ }
+
+ @Override
+ public boolean isSynchronous() {
+ return true;
+ }
+
+ @Override
+ public void analyze(Procedure prozedur, Disease erkrankung) {
+ var consentManagerService = consentManagerServiceFactory.currentUsableInstance();
+ if (! consentManagerService.canApply(prozedur)) {
+ logger.error("Fehler im ConsentManagement: Kann Prozedur mit Formularnamen '{}' nicht anwenden", prozedur.getFormName());
+ return;
+ }
+ consentManagerService.applyConsent(prozedur);
+ }
+
+}
diff --git a/src/main/java/dev/dnpm/oshelper/analyzer/DNPMHelper.java b/src/main/java/dev/dnpm/oshelper/analyzer/DNPMHelper.java
new file mode 100644
index 0000000..e779691
--- /dev/null
+++ b/src/main/java/dev/dnpm/oshelper/analyzer/DNPMHelper.java
@@ -0,0 +1,284 @@
+/*
+ * This file is part of onkostar-plugin-dnpm
+ *
+ * Copyright (c) 2025 the original author or authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package dev.dnpm.oshelper.analyzer;
+
+import dev.dnpm.oshelper.dto.EcogStatusWithDate;
+import dev.dnpm.oshelper.VerweisVon;
+import dev.dnpm.oshelper.security.DelegatingDataBasedPermissionEvaluator;
+import dev.dnpm.oshelper.security.IllegalSecuredObjectAccessException;
+import dev.dnpm.oshelper.security.PermissionType;
+import dev.dnpm.oshelper.services.systemtherapie.SystemtherapieService;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import de.itc.onkostar.api.Disease;
+import de.itc.onkostar.api.IOnkostarApi;
+import de.itc.onkostar.api.Procedure;
+import de.itc.onkostar.api.analysis.AnalyzerRequirement;
+import org.hibernate.SQLQuery;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.transform.Transformers;
+import org.hibernate.type.StandardBasicTypes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.security.core.context.SecurityContextHolder;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class DNPMHelper extends BackendService {
+
+ private static final Logger logger = LoggerFactory.getLogger(DNPMHelper.class);
+
+ private final IOnkostarApi onkostarApi;
+
+ private final SystemtherapieService systemtherapieService;
+
+ private final DelegatingDataBasedPermissionEvaluator delegatingDataBasedPermissionEvaluator;
+
+ public DNPMHelper(
+ final IOnkostarApi onkostarApi,
+ final SystemtherapieService systemtherapieService,
+ final DelegatingDataBasedPermissionEvaluator permissionEvaluator
+ ) {
+ this.onkostarApi = onkostarApi;
+ this.systemtherapieService = systemtherapieService;
+ this.delegatingDataBasedPermissionEvaluator = permissionEvaluator;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Methoden für DNPM-Formulare";
+ }
+
+ @Override
+ public boolean isRelevantForDeletedProcedure() {
+ return false;
+ }
+
+ @Override
+ public boolean isSynchronous() {
+ return true;
+ }
+
+ @Override
+ public AnalyzerRequirement getRequirement() {
+ return AnalyzerRequirement.PROCEDURE;
+ }
+
+ @Override
+ public boolean isRelevantForAnalyzer(Procedure entry, Disease currentDisease) {
+ // Plugin enthält nur Methoden für Formulare und soll nicht ausgeführt werden
+ return false;
+ }
+
+ @SuppressWarnings("unchecked")
+ public List