Skip to content

Main content

Medicine Batch Recall Remaining Count Tool

Match explicit recall lot IDs against current supplied inventory quantities.

Loading tool…

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

  1. Enter lotIds, quantities, recalledIds. Keep parallel arrays aligned. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
lotIdsLot IdsRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
quantitiesQuantitiesRequired. Array of safe integer; maximum items 256.
recalledIdsRecalled IdsRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
Output fieldInterpretationReturned shape
recalledQuantityRecalled QuantityRequired. Safe integer.
unaffectedQuantityUnaffected QuantityRequired. Safe integer.
affectedIndicesAffected IndicesRequired. Array of safe integer; maximum items 256.
json
{
  "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

  1. Calculation and input contract: hospital-pharmacy/medicine-batch-recall-remaining-count — tool.io

Similar or alternative tools