From 9cb14c11488fd822b41cdd0a8a9895f7aaaa2a98 Mon Sep 17 00:00:00 2001 From: thuster Date: Wed, 13 Dec 2023 16:51:00 +0100 Subject: [PATCH] [26015] add option to bill tarmed service without law check --- ...fe.adjuster.TarmedVerrechnebarAdjuster.xml | 3 +- .../adjuster/TarmedVerrechnebarAdjuster.java | 15 ++++++++- .../views/TarmedCodeSelectorFactory.java | 33 +++++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/bundles/ch.elexis.base.ch.arzttarife/OSGI-INF/ch.elexis.base.ch.arzttarife.adjuster.TarmedVerrechnebarAdjuster.xml b/bundles/ch.elexis.base.ch.arzttarife/OSGI-INF/ch.elexis.base.ch.arzttarife.adjuster.TarmedVerrechnebarAdjuster.xml index a94a961666..5c7011621d 100644 --- a/bundles/ch.elexis.base.ch.arzttarife/OSGI-INF/ch.elexis.base.ch.arzttarife.adjuster.TarmedVerrechnebarAdjuster.xml +++ b/bundles/ch.elexis.base.ch.arzttarife/OSGI-INF/ch.elexis.base.ch.arzttarife.adjuster.TarmedVerrechnebarAdjuster.xml @@ -1,7 +1,8 @@ - + + \ No newline at end of file diff --git a/bundles/ch.elexis.base.ch.arzttarife/src/ch/elexis/base/ch/arzttarife/adjuster/TarmedVerrechnebarAdjuster.java b/bundles/ch.elexis.base.ch.arzttarife/src/ch/elexis/base/ch/arzttarife/adjuster/TarmedVerrechnebarAdjuster.java index d11339a6c0..bc2ac8f5da 100644 --- a/bundles/ch.elexis.base.ch.arzttarife/src/ch/elexis/base/ch/arzttarife/adjuster/TarmedVerrechnebarAdjuster.java +++ b/bundles/ch.elexis.base.ch.arzttarife/src/ch/elexis/base/ch/arzttarife/adjuster/TarmedVerrechnebarAdjuster.java @@ -4,6 +4,7 @@ import org.apache.commons.lang3.StringUtils; import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; import ch.elexis.base.ch.arzttarife.tarmed.ITarmedLeistung; import ch.elexis.core.model.IBillable; @@ -12,18 +13,22 @@ import ch.elexis.core.services.IBillableAdjuster; import ch.elexis.core.services.ICodeElementService.CodeElementTyp; import ch.elexis.core.services.ICodeElementServiceContribution; +import ch.elexis.core.services.IContextService; import ch.elexis.core.services.holder.CodeElementServiceHolder; @Component public class TarmedVerrechnebarAdjuster implements IBillableAdjuster { + @Reference + private IContextService contextService; + @Override public IBillable adjust(IBillable billable, IEncounter encounter) { if (billable instanceof ITarmedLeistung) { ITarmedLeistung leistung = (ITarmedLeistung) billable; String leistungLaw = leistung.getLaw(); // check if a law for a leistung is specified - if (StringUtils.isNotEmpty(leistungLaw)) { + if (StringUtils.isNotEmpty(leistungLaw) && isPerformLawCheck()) { ICoverage coverage = encounter.getCoverage(); String law = coverage.getBillingSystem().getLaw().name(); @@ -39,4 +44,12 @@ public IBillable adjust(IBillable billable, IEncounter encounter) { } return billable; } + + private boolean isPerformLawCheck() { + if (contextService.getNamed("tarmed.nolawcheck").isPresent()) { + contextService.getRootContext().setNamed("tarmed.nolawcheck", null); + return false; + } + return true; + } } diff --git a/bundles/ch.elexis.base.ch.arzttarife/src/ch/elexis/views/TarmedCodeSelectorFactory.java b/bundles/ch.elexis.base.ch.arzttarife/src/ch/elexis/views/TarmedCodeSelectorFactory.java index 455f18b9ca..05d4d94cb2 100644 --- a/bundles/ch.elexis.base.ch.arzttarife/src/ch/elexis/views/TarmedCodeSelectorFactory.java +++ b/bundles/ch.elexis.base.ch.arzttarife/src/ch/elexis/views/TarmedCodeSelectorFactory.java @@ -26,6 +26,8 @@ import ch.elexis.base.ch.arzttarife.tarmed.ITarmedLeistung; import ch.elexis.core.services.holder.ContextServiceHolder; +import ch.elexis.core.ui.actions.CodeSelectorHandler; +import ch.elexis.core.ui.actions.ICodeSelectorTarget; import ch.elexis.core.ui.actions.ToggleVerrechenbarFavoriteAction; import ch.elexis.core.ui.icons.Images; import ch.elexis.core.ui.util.viewers.CommonViewer; @@ -40,6 +42,7 @@ public class TarmedCodeSelectorFactory extends CodeSelectorFactory { CommonViewer cv; int eventType = SWT.KeyDown; + private NoLawCheckBillingAction noLawCeckBillingAction = new NoLawCheckBillingAction(); private ToggleVerrechenbarFavoriteAction tvfa = new ToggleVerrechenbarFavoriteAction(); private ISelectionChangedListener selChangeListener = new ISelectionChangedListener() { @@ -83,6 +86,7 @@ public void handleEvent(Event event) { MenuManager menu = new MenuManager(); menu.add(tvfa); + menu.add(noLawCeckBillingAction); cv.setContextMenu(menu); ViewerConfigurer vc = new ViewerConfigurer(new TarmedCodeSelectorContentProvider(cv), @@ -106,6 +110,35 @@ public String getCodeSystemName() { return "Tarmed"; //$NON-NLS-1$ } + private class NoLawCheckBillingAction extends Action { + + @Override + public ImageDescriptor getImageDescriptor() { + return Images.IMG_ACHTUNG.getImageDescriptor(); + } + + @Override + public String getText() { + return "Verrechnen ohne Gesetz-Prüfung"; + } + + @Override + public void run() { + Object[] selection = cv.getSelection(); + if (selection != null && selection.length > 0) { + for (Object object : selection) { + if (object instanceof ITarmedLeistung) { + ContextServiceHolder.get().getRootContext().setNamed("tarmed.nolawcheck", Boolean.TRUE); + ICodeSelectorTarget target = CodeSelectorHandler.getInstance().getCodeSelectorTarget(); + if (target != null) { + target.codeSelected(object); + } + } + } + } + } + } + private class ToggleFiltersAction extends Action { public ToggleFiltersAction() {