Description
Calculate a ward-stock issue/return balance.
Pharmacy records connect requests, lots, release references, stock movements, receipt states and storage observations. A ward-perspective issue balance differs from a central-store balance, while a time gap does not assess a temperature excursion. Recorded labels and flags do not authorize dispensing or establish safe medication supply.
Calculate a ward-stock issue/return balance.
When to use this tool
Use Ward Stock Issue Return Balance when you already have openingStock, issuedToWard, returnedFromWard and need to calculate a ward-stock issue/return balance.
How to use the tool and how it works
- Enter openingStock, issuedToWard, returnedFromWard. 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 openingStock+issuedToWard-returnedFromWard with BigInt and export a safe integer.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| openingStock | Opening Stock | Required. Safe integer; minimum 0. |
| issuedToWard | Issued To Ward | Required. Safe integer; minimum 0. |
| returnedFromWard | Returned From Ward | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| closingBalance | Opening+issuedToWard-returnedFromWard, from the ward's stock perspective; may be negative. | Required. Safe integer. |
{
"input": {
"openingStock": 20,
"issuedToWard": 8,
"returnedFromWard": 5
},
"output": {
"closingBalance": 23
}
} Limitations and assumptions
- This uses the stated ward-perspective sign convention. Negative balances are retained and unsafe outputs rejected; no stock, dispensing, product quality or medication use 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 complete stock, traceability, release and storage records when actual supply or product status matters. Use the controlled workflow and verified evidence; local issue/return signs and receipt flags do not establish readiness or clinical suitability.
References
Similar or alternative tools
- Cabinet Pocket Capacity Margin
Compare recorded cabinet occupancy with a supplied pocket capacity.
- Blood Product Unit Split Balance
Calculate allocated and unallocated blood-product split volumes.