Commit 7746f57d authored by Thomas Huster's avatar Thomas Huster

[20738] fixed diagnose change and transient copy for billing correction

parent 8744b88f
Pipeline #16173 passed with stages
in 6 minutes and 18 seconds
......@@ -618,8 +618,10 @@ public class BillingUtil {
private void removeDiagnose(Object base, Object item){
konsultation = Konsultation.load(((KonsultationDTO) base).getId());
diagnosesDTO = (DiagnosesDTO) item;
NoPoUtil.loadAsIdentifiable(konsultation, IEncounter.class).get()
.removeDiagnosis(diagnosesDTO.getiDiagnose());
IEncounter encounter =
NoPoUtil.loadAsIdentifiable(konsultation, IEncounter.class).get();
encounter.removeDiagnosis(diagnosesDTO.getiDiagnose());
CoreModelServiceHolder.get().save(encounter);
log.debug("invoice correction: removed diagnose id [{}] from kons id [{}]",
diagnosesDTO.getId(), konsultation.getId());
}
......@@ -627,8 +629,10 @@ public class BillingUtil {
private void addDiagnose(Object base, Object item){
konsultation = Konsultation.load(((KonsultationDTO) base).getId());
diagnosesDTO = (DiagnosesDTO) item;
NoPoUtil.loadAsIdentifiable(konsultation, IEncounter.class).get()
.addDiagnosis(diagnosesDTO.getiDiagnose());
IEncounter encounter =
NoPoUtil.loadAsIdentifiable(konsultation, IEncounter.class).get();
encounter.addDiagnosis(diagnosesDTO.getiDiagnose());
CoreModelServiceHolder.get().save(encounter);
log.debug("invoice correction: added diagnose id [{}] to kons id [{}]",
diagnosesDTO.getId(), konsultation.getId());
}
......
......@@ -49,6 +49,8 @@ public class KonsultationDTO {
IEncounter copy = CoreModelServiceHolder.get().create(IEncounter.class);
copy.setDate(new TimeTool(date).toLocalDate());
copy.setMandator(NoPoUtil.loadAsIdentifiable(mandant, IMandator.class).get());
copy.setCoverage(
CoreModelServiceHolder.get().load(id, IEncounter.class).get().getCoverage());
return copy;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment