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

Issue #22: Verwende Angabe des Systemtherapie-Formulars in den Einstellungen

Standardwert, wenn die Einstellung nicht vorhanden ist, ist "OS.Systemische Therapie".

closes #22
This commit is contained in:
2023-04-06 09:38:58 +02:00
parent 367f46ccea
commit 425e8067b6
4 changed files with 46 additions and 36 deletions

View File

@ -3,8 +3,6 @@ package DNPM.services.systemtherapie;
import DNPM.services.SettingsService;
import de.itc.onkostar.api.IOnkostarApi;
import de.itc.onkostar.api.Procedure;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
@ -17,8 +15,6 @@ import java.util.Map;
*/
public class DefaultSystemtherapieService implements SystemtherapieService {
private static final Logger logger = LoggerFactory.getLogger(DefaultSystemtherapieService.class);
private final IOnkostarApi onkostarApi;
private final SettingsService settingsService;
@ -36,13 +32,8 @@ public class DefaultSystemtherapieService implements SystemtherapieService {
*/
@Override
public List<Map<String, String>> getSystemischeTherapienFromDiagnose(int diseaseId) {
var sid = this.settingsService.getSID();
if (sid.isEmpty()) {
logger.error("Kann SID nicht ermitteln um Formularnamen zu erhalten. Gebe 'null' zurück.");
return null;
}
List<Map<String, String>> result = new ArrayList<>();
for (Procedure prozedur : onkostarApi.getProceduresForDiseaseByForm(diseaseId, selectFormNameBySID(sid.get()))) {
for (Procedure prozedur : onkostarApi.getProceduresForDiseaseByForm(diseaseId, getFormName())) {
prozedurToProzedurwerteMapper(prozedur).apply(prozedur).ifPresent(result::add);
}
return result;
@ -60,14 +51,9 @@ public class DefaultSystemtherapieService implements SystemtherapieService {
return new OsSystemischeTherapieToProzedurwerteMapper();
}
@Override
public String selectFormNameBySID(String sid) {
switch (sid) {
case "2011":
case "20119":
return "OS.Systemische Therapie.VarianteUKW";
default:
return "OS.Systemische Therapie";
}
private String getFormName() {
return settingsService
.getSetting("systemtherapieform")
.orElse("OS.Systemische Therapie");
}
}