/*
* This file is part of onkostar-plugin-dnpm
*
* Copyright (C) 2023-2026 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
package dev.dnpm.oshelper.analyzer;
import dev.dnpm.oshelper.dto.EcogStatusWithDate;
import dev.dnpm.oshelper.VerweisVon;
import dev.dnpm.oshelper.security.DelegatingDataBasedPermissionEvaluator;
import dev.dnpm.oshelper.security.IllegalSecuredObjectAccessException;
import dev.dnpm.oshelper.security.PermissionType;
import dev.dnpm.oshelper.services.systemtherapie.SystemtherapieService;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import de.itc.onkostar.api.Disease;
import de.itc.onkostar.api.IOnkostarApi;
import de.itc.onkostar.api.Procedure;
import de.itc.onkostar.api.analysis.AnalyzerRequirement;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.transform.Transformers;
import org.hibernate.type.StandardBasicTypes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.context.SecurityContextHolder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class DNPMHelper extends BackendService {
private static final Logger logger = LoggerFactory.getLogger(DNPMHelper.class);
private final IOnkostarApi onkostarApi;
private final SystemtherapieService systemtherapieService;
private final DelegatingDataBasedPermissionEvaluator delegatingDataBasedPermissionEvaluator;
public DNPMHelper(
final IOnkostarApi onkostarApi,
final SystemtherapieService systemtherapieService,
final DelegatingDataBasedPermissionEvaluator permissionEvaluator
) {
this.onkostarApi = onkostarApi;
this.systemtherapieService = systemtherapieService;
this.delegatingDataBasedPermissionEvaluator = permissionEvaluator;
}
@Override
public String getDescription() {
return "Methoden für DNPM-Formulare";
}
@Override
public boolean isRelevantForDeletedProcedure() {
return false;
}
@Override
public boolean isSynchronous() {
return true;
}
@Override
public AnalyzerRequirement getRequirement() {
return AnalyzerRequirement.PROCEDURE;
}
@Override
public boolean isRelevantForAnalyzer(Procedure entry, Disease currentDisease) {
// Plugin enthält nur Methoden für Formulare und soll nicht ausgeführt werden
return false;
}
@SuppressWarnings("unchecked")
public List