Skip to content

Commit

Permalink
[26697] filter stock changes (#748)
Browse files Browse the repository at this point in the history
Co-authored-by: pdenzler <[email protected]>
  • Loading branch information
PatrickDenzler and pdenzler authored Nov 14, 2024
1 parent dd4d91d commit f0513ae
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<IStock> 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();
}

Expand Down

0 comments on commit f0513ae

Please sign in to comment.