mirror of
https://github.com/pcvolkmer/onkostar-plugin-dnpm.git
synced 2025-07-03 01:32:55 +00:00
Methode getProzedurenFromDiagnose() vereinfacht
This commit is contained in:
@ -6,7 +6,6 @@ import com.fasterxml.jackson.core.JsonProcessingException;
|
|||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import de.itc.onkostar.api.Disease;
|
import de.itc.onkostar.api.Disease;
|
||||||
import de.itc.onkostar.api.IOnkostarApi;
|
import de.itc.onkostar.api.IOnkostarApi;
|
||||||
import de.itc.onkostar.api.Item;
|
|
||||||
import de.itc.onkostar.api.Procedure;
|
import de.itc.onkostar.api.Procedure;
|
||||||
import de.itc.onkostar.api.analysis.AnalyzerRequirement;
|
import de.itc.onkostar.api.analysis.AnalyzerRequirement;
|
||||||
import de.itc.onkostar.api.analysis.IProcedureAnalyzer;
|
import de.itc.onkostar.api.analysis.IProcedureAnalyzer;
|
||||||
@ -165,33 +164,26 @@ public class DNPMHelper implements IProcedureAnalyzer {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Object> Formulare = new ArrayList<Object>();
|
var formulare = new ArrayList<Map<String, Object>>();
|
||||||
String jsonStr = "";
|
List<Procedure> prozeduren = onkostarApi.getProceduresByPatientId(patientId.get());
|
||||||
List<Procedure> Prozeduren = onkostarApi.getProceduresByPatientId(patientId.get());
|
for (Procedure Prozedur : prozeduren) {
|
||||||
for (Procedure Prozedur : Prozeduren) {
|
|
||||||
// Formular gehört zur aktuellen Diagnose und hat den angegebenen Namen
|
// Formular gehört zur aktuellen Diagnose und hat den angegebenen Namen
|
||||||
if (Prozedur.getDiseaseIds().contains(diagnoseId.get()) && Prozedur.getFormName().contains(dataForm.get())) {
|
if (Prozedur.getDiseaseIds().contains(diagnoseId.get()) && Prozedur.getFormName().contains(dataForm.get())) {
|
||||||
// alle Werte auslesen
|
// alle Werte auslesen
|
||||||
Map<String, Item> Werte = Prozedur.getAllValues();
|
// System.out.println(WerteListe.getKey() + ": " + WerteListe.getValue());
|
||||||
Map<String, Object> Values = new HashMap<>();
|
formulare.add(Map.of(
|
||||||
for (Map.Entry<String, Item> WerteListe : Werte.entrySet()) {
|
"Formular", Prozedur.getFormName(),
|
||||||
Values.put(WerteListe.getKey(), WerteListe.getValue());
|
"Felder", new HashMap<>(Prozedur.getAllValues())
|
||||||
// System.out.println(WerteListe.getKey() + ": " + WerteListe.getValue());
|
));
|
||||||
}
|
|
||||||
Map<String, Object> Formular = new HashMap<>();
|
|
||||||
Formular.put("Formular", Prozedur.getFormName());
|
|
||||||
Formular.put("Felder", Values);
|
|
||||||
Formulare.add(Formular);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ObjectMapper Obj = new ObjectMapper();
|
|
||||||
try {
|
try {
|
||||||
jsonStr = Obj.writeValueAsString(Formulare);
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
return objectMapper.writeValueAsString(formulare);
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
// TODO Auto-generated catch block
|
logger.error("Kann Formulare nicht in JSON mappen", e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
return jsonStr;
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getEmpfehlung(final Map<String, Object> input) {
|
public Object getEmpfehlung(final Map<String, Object> input) {
|
||||||
|
Reference in New Issue
Block a user