Skip to content

Main content

Community Pharmacy Pack Balance

Reconcile explicit pharmacy pack movements with exact integer arithmetic and a signed closing balance.

Loading tool…

Description

Calculate a supplied community-pharmacy pack balance.

Pharmacy records distinguish prescribed wording, recorded supply, package counts, consultation timing and product identifiers. A partial-fill balance can reveal a recorded overfill without determining lawful supply, and a lot-code comparison does not retrieve a recall. Preserving a dose string does not interpret or recommend the dose.

Calculate a supplied community-pharmacy pack balance.

When to use this tool

Use Community Pharmacy Pack Balance when you already have openingPacks, receivedPacks, dispensedPacks and need to calculate a supplied community-pharmacy pack balance.

How to use the tool and how it works

  1. Enter openingPacks, receivedPacks, dispensedPacks. 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 closingBalance. Use the output convention below.

Require nonnegative safe whole counts; compute opening+received-dispensed with BigInt and export a safe integer.1

Input fieldMeaning and unitsAccepted input
openingPacksOpening PacksRequired. Safe integer; minimum 0.
receivedPacksReceived PacksRequired. Safe integer; minimum 0.
dispensedPacksDispensed PacksRequired. Safe integer; minimum 0.
Output fieldInterpretationReturned shape
closingBalanceExact opening+received-dispensed integer balance; signed safe export required.Required. Safe integer.
json
{
  "input": {
    "openingPacks": 20,
    "receivedPacks": 8,
    "dispensedPacks": 5
  },
  "output": {
    "closingBalance": 23
  }
}

Limitations and assumptions

  • Negative balances are retained and unsafe exports rejected. No inventory, pack equivalence, dispensing, release or medicine suitability is verified.
  • 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.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Review the original prescription, dispensing, consultation and product records within the appropriate professional workflow. Use verified clinical and regulatory information for supply or care decisions; local balances and labels do not establish suitability, authenticity or authorization.

References

  1. Calculation and input contract: community-pharmacy/community-pharmacy-pack-balance — tool.io

Similar or alternative tools