From f0513ae1a7eb3b98aa12ef6f8442b6d6a703d60b Mon Sep 17 00:00:00 2001 From: pdenzler Date: Thu, 14 Nov 2024 12:32:52 +0100 Subject: [PATCH] [26697] filter stock changes (#748) Co-authored-by: pdenzler --- .../src/ch/elexis/core/ui/mediorder/MediorderPart.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bundles/ch.elexis.core.ui.mediorder/src/ch/elexis/core/ui/mediorder/MediorderPart.java b/bundles/ch.elexis.core.ui.mediorder/src/ch/elexis/core/ui/mediorder/MediorderPart.java index 45fb393786..ebfe0b2abf 100644 --- a/bundles/ch.elexis.core.ui.mediorder/src/ch/elexis/core/ui/mediorder/MediorderPart.java +++ b/bundles/ch.elexis.core.ui.mediorder/src/ch/elexis/core/ui/mediorder/MediorderPart.java @@ -711,15 +711,15 @@ private void addMedicationOrderEntryToStock(IStock stock, IArticle article) { } /** - * Retrieves a list of patient stocks that doesn't contain stockEntries with the - * status {@link MediorderEntryState#AWAITING_REQUEST} + * Retrieves a list of patient stocks that do not only have stockEntries with + * the status {@link MediorderEntryState#AWAITING_REQUEST} * * @return */ private List getStocksExcludingAwaitingRequests() { return stockService.getAllPatientStock().stream().filter(stock -> !stock.getStockEntries().isEmpty()) - .filter(stock -> stock.getStockEntries().stream().noneMatch( - entry -> MediorderEntryState.AWAITING_REQUEST.equals(MediorderPartUtil.determineState(entry)))) + .filter(stock -> stock.getStockEntries().stream().anyMatch( + entry -> !MediorderEntryState.AWAITING_REQUEST.equals(MediorderPartUtil.determineState(entry)))) .toList(); }