Skip to content

Commit

Permalink
[26755] add filter to exclude medication history entries (#750)
Browse files Browse the repository at this point in the history
Co-authored-by: pdenzler <pdenzler@DESKTOP-1LRDH28>
  • Loading branch information
PatrickDenzler and pdenzler authored Nov 19, 2024
1 parent 91fd4a1 commit 42e2d49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
import ch.elexis.core.model.IPrescription;
import ch.elexis.core.model.IStock;
import ch.elexis.core.model.IStockEntry;
import ch.elexis.core.model.prescription.EntryType;
import ch.elexis.core.services.IContextService;
import ch.elexis.core.services.IMedicationService;
import ch.elexis.core.services.IModelService;
Expand Down Expand Up @@ -440,7 +441,8 @@ public void widgetSelected(SelectionEvent e) {
tvcMedicationDosage.setLabelProvider(ColumnLabelProvider.createTextProvider(element -> {
IStockEntry entry = (IStockEntry) element;
IPatient patient = entry.getStock().getOwner().asIPatient();
List<IPrescription> lMedication = patient.getMedication(null);
List<IPrescription> lMedication = patient.getMedication(Arrays.asList(EntryType.FIXED_MEDICATION,
EntryType.RESERVE_MEDICATION, EntryType.SYMPTOMATIC_MEDICATION));
for (IPrescription prescription : lMedication) {
if (prescription.getArticle().equals(entry.getArticle())) {
return prescription.getDosageInstruction();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ch.elexis.core.ui.mediorder;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -10,6 +11,7 @@
import ch.elexis.core.model.IPrescription;
import ch.elexis.core.model.IStock;
import ch.elexis.core.model.IStockEntry;
import ch.elexis.core.model.prescription.EntryType;
import ch.elexis.core.services.IModelService;
import ch.elexis.core.services.holder.MedicationServiceHolder;
import ch.elexis.core.services.holder.OrderServiceHolder;
Expand All @@ -21,7 +23,8 @@ public static String createMediorderEntryOutreachLabel(Object object) {
if (object instanceof IStockEntry stockEntry) {
Double resultDays = null;
IPatient patient = stockEntry.getStock().getOwner().asIPatient();
List<IPrescription> lMedication = patient.getMedication(null);
List<IPrescription> lMedication = patient.getMedication(Arrays.asList(EntryType.FIXED_MEDICATION,
EntryType.RESERVE_MEDICATION, EntryType.SYMPTOMATIC_MEDICATION));
for (IPrescription prescription : lMedication) {
if (prescription.getArticle().equals(stockEntry.getArticle())) {
float dailyDosageAsFloat = MedicationServiceHolder.get().getDailyDosageAsFloat(prescription);
Expand Down

0 comments on commit 42e2d49

Please sign in to comment.