1
0
mirror of https://github.com/pcvolkmer/onkostar-plugin-dnpm.git synced 2025-07-02 01:02:55 +00:00

Verschiebe Implementierungen für Therapiepläne in eigenes Paket

This commit is contained in:
2023-05-08 11:56:35 +02:00
parent 13ba0f902f
commit 06b5381e88
12 changed files with 230 additions and 70 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;