summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul-Christian Volkmer2023-05-08 11:56:35 +0200
committerPaul-Christian Volkmer2023-05-08 11:59:59 +0200
commit06b5381e885cf5cf4cb008e22e7cb2dff88f40b5 (patch)
tree79bfb5d302a699c697d60662123dc4dd47257b24 /src
parent13ba0f902fc51bb74f905332287650c407c2823d (diff)
Verschiebe Implementierungen für Therapiepläne in eigenes Paket
Diffstat (limited to 'src')
-rw-r--r--src/main/java/DNPM/analyzer/TherapieplanAnalyzer.java2
-rw-r--r--src/main/java/DNPM/config/PluginConfiguration.java1
-rw-r--r--src/main/java/DNPM/services/TherapieplanService.java33
-rw-r--r--src/main/java/DNPM/services/TherapieplanServiceFactory.java31
-rw-r--r--src/main/java/DNPM/services/therapieplan/DefaultTherapieplanService.java (renamed from src/main/java/DNPM/services/DefaultTherapieplanService.java)29
-rw-r--r--src/main/java/DNPM/services/therapieplan/MultipleMtbTherapieplanService.java (renamed from src/main/java/DNPM/services/MultipleMtbTherapieplanService.java)29
-rw-r--r--src/main/java/DNPM/services/therapieplan/TherapieplanService.java57
-rw-r--r--src/main/java/DNPM/services/therapieplan/TherapieplanServiceFactory.java57
-rw-r--r--src/test/java/DNPM/analyzer/TherapieplanAnalyzerTest.java3
-rw-r--r--src/test/java/DNPM/config/PluginConfigurationTest.java2
-rw-r--r--src/test/java/DNPM/services/therapieplan/DefaultTherapieplanServiceTest.java (renamed from src/test/java/DNPM/services/DefaultTherapieplanServiceTest.java)31
-rw-r--r--src/test/java/DNPM/services/therapieplan/TherapieplanServiceFactoryTest.java (renamed from src/test/java/DNPM/services/TherapieplanServiceFactoryTest.java)31
12 files changed, 233 insertions, 73 deletions
diff --git a/src/main/java/DNPM/analyzer/TherapieplanAnalyzer.java b/src/main/java/DNPM/analyzer/TherapieplanAnalyzer.java
index 6ad18b0..3024125 100644
--- a/src/main/java/DNPM/analyzer/TherapieplanAnalyzer.java
+++ b/src/main/java/DNPM/analyzer/TherapieplanAnalyzer.java
@@ -4,7 +4,7 @@ import DNPM.security.DelegatingDataBasedPermissionEvaluator;
import DNPM.security.PermissionType;
import DNPM.services.Studie;
import DNPM.services.StudienService;
-import DNPM.services.TherapieplanServiceFactory;
+import DNPM.services.therapieplan.TherapieplanServiceFactory;
import DNPM.services.mtb.MtbService;
import de.itc.onkostar.api.Disease;
import de.itc.onkostar.api.Procedure;
diff --git a/src/main/java/DNPM/config/PluginConfiguration.java b/src/main/java/DNPM/config/PluginConfiguration.java
index 0042fe4..28abbda 100644
--- a/src/main/java/DNPM/config/PluginConfiguration.java
+++ b/src/main/java/DNPM/config/PluginConfiguration.java
@@ -7,6 +7,7 @@ import DNPM.services.mtb.DefaultMtbService;
import DNPM.services.mtb.MtbService;
import DNPM.services.systemtherapie.DefaultSystemtherapieService;
import DNPM.services.systemtherapie.SystemtherapieService;
+import DNPM.services.therapieplan.TherapieplanServiceFactory;
import de.itc.onkostar.api.IOnkostarApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
diff --git a/src/main/java/DNPM/services/TherapieplanService.java b/src/main/java/DNPM/services/TherapieplanService.java
deleted file mode 100644
index 7a725fc..0000000
--- a/src/main/java/DNPM/services/TherapieplanService.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package DNPM.services;
-
-import de.itc.onkostar.api.Procedure;
-
-import java.util.List;
-
-public interface TherapieplanService {
-
- /**
- * Verlinke MTB und Übernahme Datum aus Hauptformular in weiteren Bereichen
- * "Humangenetische Beratung" und "Reevaluation" und Unterformularen, wenn erforderlich.
- *
- * @param procedure Die Prozedur mit Hauptformular
- */
- void updateRequiredMtbEntries(Procedure procedure);
-
- /**
- * Finde verlinkte MTBs in Hauptformular und Unterformularen
- *
- * @param procedure Die Prozedur mit Hauptformular
- * @return Liste mit verlinkten MTBs
- */
- List<Procedure> findReferencedMtbs(Procedure procedure);
-
- /**
- * Finde verlinkte MTBs in Hauptformular und Unterformularen
- *
- * @param procedureId ID der Prozedur mit Hauptformular
- * @return Liste mit verlinkten MTBs
- */
- List<Procedure> findReferencedMtbs(int procedureId);
-
-}
diff --git a/src/main/java/DNPM/services/TherapieplanServiceFactory.java b/src/main/java/DNPM/services/TherapieplanServiceFactory.java
deleted file mode 100644
index 3e05fb4..0000000
--- a/src/main/java/DNPM/services/TherapieplanServiceFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package DNPM.services;
-
-import de.itc.onkostar.api.IOnkostarApi;
-
-public class TherapieplanServiceFactory {
-
- private final IOnkostarApi onkostarApi;
-
- private final SettingsService settingsService;
-
- private final FormService formService;
-
- public TherapieplanServiceFactory(
- final IOnkostarApi onkostarApi,
- final SettingsService settingsService,
- final FormService formService
- ) {
- this.onkostarApi = onkostarApi;
- this.settingsService = settingsService;
- this.formService = formService;
- }
-
- public TherapieplanService currentUsableInstance() {
- if (settingsService.multipleMtbsInMtbEpisode()) {
- return new MultipleMtbTherapieplanService(onkostarApi, formService);
- }
-
- return new DefaultTherapieplanService(onkostarApi, formService);
- }
-
-}
diff --git a/src/main/java/DNPM/services/DefaultTherapieplanService.java b/src/main/java/DNPM/services/therapieplan/DefaultTherapieplanService.java
index eee2041..8fe3780 100644
--- a/src/main/java/DNPM/services/DefaultTherapieplanService.java
+++ b/src/main/java/DNPM/services/therapieplan/DefaultTherapieplanService.java
@@ -1,5 +1,30 @@
-package DNPM.services;
-
+/*
+ * MIT License
+ *
+ * 2023 Comprehensive Cancer Center Mainfranken
+ *
+ * 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 DNPM.services.therapieplan;
+
+import DNPM.services.FormService;
import de.itc.onkostar.api.IOnkostarApi;
import de.itc.onkostar.api.Item;
import de.itc.onkostar.api.Procedure;
diff --git a/src/main/java/DNPM/services/MultipleMtbTherapieplanService.java b/src/main/java/DNPM/services/therapieplan/MultipleMtbTherapieplanService.java
index faded4b..11ce876 100644
--- a/src/main/java/DNPM/services/MultipleMtbTherapieplanService.java
+++ b/src/main/java/DNPM/services/therapieplan/MultipleMtbTherapieplanService.java
@@ -1,5 +1,30 @@
-package DNPM.services;
-
+/*
+ * MIT License
+ *
+ * 2023 Comprehensive Cancer Center Mainfranken
+ *
+ * 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 DNPM.services.therapieplan;
+
+import DNPM.services.FormService;
import de.itc.onkostar.api.IOnkostarApi;
import de.itc.onkostar.api.Procedure;
diff --git a/src/main/java/DNPM/services/therapieplan/TherapieplanService.java b/src/main/java/DNPM/services/therapieplan/TherapieplanService.java
new file mode 100644
index 0000000..3699bb0
--- /dev/null
+++ b/src/main/java/DNPM/services/therapieplan/TherapieplanService.java
@@ -0,0 +1,57 @@
+/*
+ * MIT License
+ *
+ * 2023 Comprehensive Cancer Center Mainfranken
+ *
+ * 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 DNPM.services.therapieplan;
+
+import de.itc.onkostar.api.Procedure;
+
+import java.util.List;
+
+public interface TherapieplanService {
+
+ /**
+ * Verlinke MTB und Übernahme Datum aus Hauptformular in weiteren Bereichen
+ * "Humangenetische Beratung" und "Reevaluation" und Unterformularen, wenn erforderlich.
+ *
+ * @param procedure Die Prozedur mit Hauptformular
+ */
+ void updateRequiredMtbEntries(Procedure procedure);
+
+ /**
+ * Finde verlinkte MTBs in Hauptformular und Unterformularen
+ *
+ * @param procedure Die Prozedur mit Hauptformular
+ * @return Liste mit verlinkten MTBs
+ */
+ List<Procedure> findReferencedMtbs(Procedure procedure);
+
+ /**
+ * Finde verlinkte MTBs in Hauptformular und Unterformularen
+ *
+ * @param procedureId ID der Prozedur mit Hauptformular
+ * @return Liste mit verlinkten MTBs
+ */
+ List<Procedure> findReferencedMtbs(int procedureId);
+
+}
diff --git a/src/main/java/DNPM/services/therapieplan/TherapieplanServiceFactory.java b/src/main/java/DNPM/services/therapieplan/TherapieplanServiceFactory.java
new file mode 100644
index 0000000..041a3cc
--- /dev/null
+++ b/src/main/java/DNPM/services/therapieplan/TherapieplanServiceFactory.java
@@ -0,0 +1,57 @@
+/*
+ * MIT License
+ *
+ * 2023 Comprehensive Cancer Center Mainfranken
+ *
+ * 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 DNPM.services.therapieplan;
+
+import DNPM.services.FormService;
+import DNPM.services.SettingsService;
+import de.itc.onkostar.api.IOnkostarApi;
+
+public class TherapieplanServiceFactory {
+
+ private final IOnkostarApi onkostarApi;
+
+ private final SettingsService settingsService;
+
+ private final FormService formService;
+
+ public TherapieplanServiceFactory(
+ final IOnkostarApi onkostarApi,
+ final SettingsService settingsService,
+ final FormService formService
+ ) {
+ this.onkostarApi = onkostarApi;
+ this.settingsService = settingsService;
+ this.formService = formService;
+ }
+
+ public TherapieplanService currentUsableInstance() {
+ if (settingsService.multipleMtbsInMtbEpisode()) {
+ return new MultipleMtbTherapieplanService(onkostarApi, formService);
+ }
+
+ return new DefaultTherapieplanService(onkostarApi, formService);
+ }
+
+}
diff --git a/src/test/java/DNPM/analyzer/TherapieplanAnalyzerTest.java b/src/test/java/DNPM/analyzer/TherapieplanAnalyzerTest.java
index c2c17f1..ffd886b 100644
--- a/src/test/java/DNPM/analyzer/TherapieplanAnalyzerTest.java
+++ b/src/test/java/DNPM/analyzer/TherapieplanAnalyzerTest.java
@@ -4,6 +4,9 @@ import DNPM.security.DelegatingDataBasedPermissionEvaluator;
import DNPM.security.PermissionType;
import DNPM.services.*;
import DNPM.services.mtb.MtbService;
+import DNPM.services.therapieplan.MultipleMtbTherapieplanService;
+import DNPM.services.therapieplan.TherapieplanService;
+import DNPM.services.therapieplan.TherapieplanServiceFactory;
import de.itc.onkostar.api.IOnkostarApi;
import de.itc.onkostar.api.Item;
import de.itc.onkostar.api.Procedure;
diff --git a/src/test/java/DNPM/config/PluginConfigurationTest.java b/src/test/java/DNPM/config/PluginConfigurationTest.java
index 606817b..87a4e19 100644
--- a/src/test/java/DNPM/config/PluginConfigurationTest.java
+++ b/src/test/java/DNPM/config/PluginConfigurationTest.java
@@ -2,7 +2,7 @@ package DNPM.config;
import DNPM.services.FormService;
import DNPM.services.SettingsService;
-import DNPM.services.TherapieplanServiceFactory;
+import DNPM.services.therapieplan.TherapieplanServiceFactory;
import DNPM.services.consent.ConsentManagerServiceFactory;
import de.itc.onkostar.api.IOnkostarApi;
import org.junit.jupiter.api.BeforeEach;
diff --git a/src/test/java/DNPM/services/DefaultTherapieplanServiceTest.java b/src/test/java/DNPM/services/therapieplan/DefaultTherapieplanServiceTest.java
index 0e9369f..527e428 100644
--- a/src/test/java/DNPM/services/DefaultTherapieplanServiceTest.java
+++ b/src/test/java/DNPM/services/therapieplan/DefaultTherapieplanServiceTest.java
@@ -1,5 +1,32 @@
-package DNPM.services;
-
+/*
+ * MIT License
+ *
+ * 2023 Comprehensive Cancer Center Mainfranken
+ *
+ * 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 DNPM.services.therapieplan;
+
+import DNPM.services.FormService;
+import DNPM.services.therapieplan.DefaultTherapieplanService;
+import DNPM.services.therapieplan.TherapieplanService;
import de.itc.onkostar.api.IOnkostarApi;
import de.itc.onkostar.api.Item;
import de.itc.onkostar.api.Procedure;
diff --git a/src/test/java/DNPM/services/TherapieplanServiceFactoryTest.java b/src/test/java/DNPM/services/therapieplan/TherapieplanServiceFactoryTest.java
index 9ba543f..746d711 100644
--- a/src/test/java/DNPM/services/TherapieplanServiceFactoryTest.java
+++ b/src/test/java/DNPM/services/therapieplan/TherapieplanServiceFactoryTest.java
@@ -1,5 +1,34 @@
-package DNPM.services;
+/*
+ * MIT License
+ *
+ * 2023 Comprehensive Cancer Center Mainfranken
+ *
+ * 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 DNPM.services.therapieplan;
+
+import DNPM.services.FormService;
+import DNPM.services.SettingsService;
+import DNPM.services.therapieplan.DefaultTherapieplanService;
+import DNPM.services.therapieplan.MultipleMtbTherapieplanService;
+import DNPM.services.therapieplan.TherapieplanServiceFactory;
import de.itc.onkostar.api.IOnkostarApi;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;