Skip to content

Commit

Permalink
[26015] add option to bill tarmed service without law check
Browse files Browse the repository at this point in the history
  • Loading branch information
huthomas committed Dec 14, 2023
1 parent efdf827 commit e4055ed
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="ch.elexis.base.ch.arzttarife.adjuster.TarmedVerrechnebarAdjuster">
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.3.0" name="ch.elexis.base.ch.arzttarife.adjuster.TarmedVerrechnebarAdjuster">
<service>
<provide interface="ch.elexis.core.services.IBillableAdjuster"/>
</service>
<reference cardinality="1..1" field="contextService" interface="ch.elexis.core.services.IContextService" name="contextService"/>
<implementation class="ch.elexis.base.ch.arzttarife.adjuster.TarmedVerrechnebarAdjuster"/>
</scr:component>
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();

Expand All @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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() {

Expand Down Expand Up @@ -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),
Expand All @@ -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() {
Expand Down

0 comments on commit e4055ed

Please sign in to comment.