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
- Enter openingPacks, receivedPacks, dispensedPacks. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| openingPacks | Opening Packs | Required. Safe integer; minimum 0. |
| receivedPacks | Received Packs | Required. Safe integer; minimum 0. |
| dispensedPacks | Dispensed Packs | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| closingBalance | Exact opening+received-dispensed integer balance; signed safe export required. | Required. Safe integer. |
{
"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
Similar or alternative tools
- Prescription Partial Fill Remainder
Calculate a supplied prescription partial-fill remainder and overfill flag.
- Community Drug Recall Lot Compare
Compare supplied recorded and recalled lot strings under a case policy.