Skip to content

Commit

Permalink
[26253] add transfer coverage to other billing system
Browse files Browse the repository at this point in the history
  • Loading branch information
huthomas committed Apr 2, 2024
1 parent c411696 commit 8fdd8e8
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1831,6 +1831,7 @@ public class Messages extends NLS {
public static String FallDetailBlatt2_BillingMethod;
public static String FallDetailBlatt2_CantChangeBillingSystemBody;
public static String FallDetailBlatt2_ChangeBillingSystemNotAllowedBody;
public static String FallDetailBlatt2_Change_Invoice_System;
public static String FallDetailBlatt2_CopyToPatient;
public static String FallDetailBlatt2_DaysOrAfter;
public static String FallDetailBlatt2_DaysOrAfterNeg;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3671,6 +3671,8 @@ FallDetailBlatt2_CantChangeBillingSystemBody = you don't have sufficient rights
FallDetailBlatt2_ChangeBillingSystemNotAllowedBody = This billing system must not be used
FallDetailBlatt2_Change_Invoice_System = Do you really want to transfer coverage billing system from {0} to {1}?
FallDetailBlatt2_CopyToPatient = copy to patient
FallDetailBlatt2_DaysOrAfter = \ days or after
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3655,6 +3655,8 @@ FallDetailBlatt2_CantChangeBillingSystemBody = Sie haben keine ausreichenden Rec

FallDetailBlatt2_ChangeBillingSystemNotAllowedBody = Dieses Abrechnungssystem darf nicht verwendet werden

FallDetailBlatt2_Change_Invoice_System = Wollen Sie den Fall inkl. Konsultationen wirklich von Abrechnungssystem {0} zu {1} transferieren?

FallDetailBlatt2_CopyToPatient = Kopie an Patienten

FallDetailBlatt2_DaysOrAfter = \ Tagen bzw. ab dem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,35 +64,43 @@

import ch.elexis.core.ac.EvACE;
import ch.elexis.core.ac.Right;
import ch.elexis.core.common.ElexisEventTopics;
import ch.elexis.core.constants.Preferences;
import ch.elexis.core.constants.StringConstants;
import ch.elexis.core.data.events.ElexisEventDispatcher;
import ch.elexis.core.data.interfaces.IFall;
import ch.elexis.core.data.service.LocalLockServiceHolder;
import ch.elexis.core.data.util.NoPoUtil;
import ch.elexis.core.l10n.Messages;
import ch.elexis.core.model.FallConstants;
import ch.elexis.core.model.ICoverage;
import ch.elexis.core.model.IEncounter;
import ch.elexis.core.model.OrganizationConstants;
import ch.elexis.core.model.ch.BillingLaw;
import ch.elexis.core.services.holder.AccessControlServiceHolder;
import ch.elexis.core.services.holder.BillingSystemServiceHolder;
import ch.elexis.core.services.holder.ConfigServiceHolder;
import ch.elexis.core.services.holder.ContextServiceHolder;
import ch.elexis.core.services.holder.CoreModelServiceHolder;
import ch.elexis.core.ui.UiDesk;
import ch.elexis.core.ui.dialogs.KontaktSelektor;
import ch.elexis.core.ui.locks.IUnlockable;
import ch.elexis.core.ui.preferences.UserCasePreferences;
import ch.elexis.core.ui.services.EncounterServiceHolder;
import ch.elexis.core.ui.text.ITextPlugin.ICallback;
import ch.elexis.core.ui.text.TextContainer;
import ch.elexis.core.ui.util.DayDateCombo;
import ch.elexis.core.ui.util.SWTHelper;
import ch.elexis.data.BillingSystem;
import ch.elexis.data.Fall;
import ch.elexis.data.Fall.Tiers;
import ch.elexis.data.Konsultation;
import ch.elexis.data.Kontakt;
import ch.elexis.data.PersistentObject;
import ch.elexis.data.Query;
import ch.elexis.data.Rechnung;
import ch.elexis.data.dto.FallDTO;
import ch.rgw.tools.Result;
import ch.rgw.tools.StringTool;
import ch.rgw.tools.TimeTool;

Expand Down Expand Up @@ -259,9 +267,23 @@ public void widgetSelected(final SelectionEvent e) {
if (fall != null) {
if (fall.getBehandlungen(false).length > 0) {
if (AccessControlServiceHolder.get().evaluate(EvACE.of(ICoverage.class, Right.UPDATE))) {
if (SWTHelper.askYesNo(Messages.FallDetailBlatt2_DontChangeBillingSystemCaption, // $NON-NLS-1$
Messages.FallDetailBlatt2_DontChangeBillingSystemBody)) { // $NON-NLS-1$
if (SWTHelper.askYesNo(Messages.Invoice_System, // $NON-NLS-1$
MessageFormat.format(Messages.FallDetailBlatt2_Change_Invoice_System,
new Object[] { fall.getAbrechnungsSystem(),
cAbrechnung.getItem(i) }))) { // $NON-NLS-1$
fall.setAbrechnungsSystem(cAbrechnung.getItem(i));
for (Konsultation behandlung : fall.getBehandlungen(false)) {
IEncounter encounter = NoPoUtil.loadAsIdentifiable(behandlung, IEncounter.class)
.get();
// make sure to work with updated data
CoreModelServiceHolder.get().refresh(encounter.getCoverage(), true);
Result<IEncounter> result = EncounterServiceHolder.get().reBillEncounter(
NoPoUtil.loadAsIdentifiable(behandlung, IEncounter.class).get());
if (!result.isOK()) {
SWTHelper.alert(behandlung.getLabel(), result.toString());
}
ContextServiceHolder.get().postEvent(ElexisEventTopics.EVENT_UPDATE, encounter);
}
setFall(fall);
return;
}
Expand Down

0 comments on commit 8fdd8e8

Please sign in to comment.