Description
Partition quantity sums by literal recalledIds membership and return zero-based affectedIndices.
Pharmacy inventory distinguishes physical stock, reservations, holds, lots, package units, and expiry records. A stock calculation describes supplied records and cannot establish that a medicine is suitable or authorized for use.
Partition quantity sums by literal recalledIds membership and return zero-based affectedIndices.
When to use this tool
Use Medicine Batch Recall Remaining Count when you need one explicit pharmacy stock-accounting component.
How to use the tool and how it works
- Enter lotIds, quantities, recalledIds. Keep parallel arrays aligned. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read recalledQuantity, unaffectedQuantity, affectedIndices. Use the output convention below.
Require aligned lotIds and nonnegative quantities. Partition quantity sums by literal recalledIds membership and return zero-based affectedIndices.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| lotIds | Lot Ids | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| quantities | Quantities | Required. Array of safe integer; maximum items 256. |
| recalledIds | Recalled Ids | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| recalledQuantity | Recalled Quantity | Required. Safe integer. |
| unaffectedQuantity | Unaffected Quantity | Required. Safe integer. |
| affectedIndices | Affected Indices | Required. Array of safe integer; maximum items 256. |
{
"input": {
"lotIds": [
"L1",
"L2",
"L1"
],
"quantities": [
10,
20,
5
],
"recalledIds": [
"L1"
]
},
"output": {
"recalledQuantity": 15,
"unaffectedQuantity": 20,
"affectedIndices": [
0,
2
]
}
} Limitations and assumptions
- Repeated lot rows contribute repeatedly; the recall list is supplied rather than retrieved, and unaffectedQuantity does not establish a product is safe or outside an actual recall.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Reconcile verified inventory and product records within the pharmacy's controlled workflow before purchasing, releasing, or dispensing stock.
References
Similar or alternative tools
- Hospital Pharmacy Quarantined Available Balance
Validate quarantine and hold within physical units and their supplied overlap within both.
- Medicine Lot Expiry Tie Token
Find the minimum supplied expiry coordinate, retain every matching lot ID in input order, and set tie when more than one record matches.