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

Verwende Factory, damit OS-API nicht beim Starten Einstellungen abrufen muss

Beim Start kann OS ggf nicht auf die Einstellungen zurückgreifen, da die
Datenbankverbindung noch nicht fertig initialisiert ist.

Aus diesem Grund muss die konkrete Implementierung des TherapieplanService zur Laufzeit
nach dem vollständigen Start von OS ermittelt werden.
This commit is contained in:
2023-03-17 11:16:28 +01:00
parent ed4b56113a
commit 610bc34bd2
6 changed files with 122 additions and 64 deletions

View File

@ -28,15 +28,8 @@ public class PluginConfiguration {
}
@Bean
public TherapieplanService therapieplanService(final IOnkostarApi onkostarApi, final FormService formService) {
if (
null != onkostarApi.getGlobalSetting("mehrere_mtb_in_mtbepisode")
&& onkostarApi.getGlobalSetting("mehrere_mtb_in_mtbepisode").equals("true")
) {
return new MultipleMtbTherapieplanService();
}
return new DefaultTherapieplanService(onkostarApi, formService);
public TherapieplanServiceFactory therapieplanServiceFactory(final IOnkostarApi onkostarApi, final FormService formService) {
return new TherapieplanServiceFactory(onkostarApi, formService);
}
}