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

Issue #33: Methoden zum Auffinden von relevanten Follow-Up-Formularen

This commit is contained in:
2023-12-04 12:03:30 +01:00
parent e451b00237
commit 3e0a26485c
5 changed files with 112 additions and 89 deletions

View File

@ -0,0 +1,42 @@
package DNPM.services.therapieplan;
import DNPM.services.FormService;
import de.itc.onkostar.api.IOnkostarApi;
import de.itc.onkostar.api.Procedure;
import java.util.List;
import java.util.stream.Collectors;
public abstract class AbstractTherapieplanService implements TherapieplanService {
protected final IOnkostarApi onkostarApi;
protected final FormService formService;
public AbstractTherapieplanService(final IOnkostarApi onkostarApi, final FormService formService) {
this.onkostarApi = onkostarApi;
this.formService = formService;
}
@Override
public List<Procedure> findReferencedFollowUpsForSubform(Procedure procedure) {
if (null == procedure || !"DNPM UF Einzelempfehlung".equals(procedure.getFormName())) {
return List.of();
}
return procedure.getDiseaseIds().stream()
.flatMap(diseaseId -> onkostarApi.getProceduresForDiseaseByForm(diseaseId, "DNPM FollowUp").stream())
.filter(p -> p.getValue("LinkTherapieempfehlung").getInt() == procedure.getId())
.collect(Collectors.toList());
}
@Override
public List<Procedure> findReferencedFollowUpsForSubform(int procedureId) {
var procedure = this.onkostarApi.getProcedure(procedureId);
if (null == procedure || !"DNPM UF Einzelempfehlung".equals(procedure.getFormName())) {
return List.of();
}
return findReferencedFollowUpsForSubform(procedure);
}
}