Description
Sum units exactly as decimal strings for total and records with all flags true, then return their numeric ratio or zero with defined false.
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.
Sum units exactly as decimal strings for total and records with all flags true, then return their numeric ratio or zero with defined false.
When to use this tool
Use Ward Stock Support Share when you need one explicit pharmacy stock-accounting component.
How to use the tool and how it works
- Enter stockUnits, countVerified, locationVerified, statusKnown. 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 totalUnitsDecimal, supportedUnitsDecimal, share, defined. Inspect defined before interpreting the associated values.
Require aligned nonnegative integer stockUnits and three verification flag arrays. Sum units exactly as decimal strings for total and records with all flags true, then return their numeric ratio or zero with defined false.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| stockUnits | Stock Units | Required. Array of safe integer; minimum 0; maximum items 256. |
| countVerified | Count Verified | Required. Array of boolean; maximum items 256. |
| locationVerified | Location Verified | Required. Array of boolean; maximum items 256. |
| statusKnown | Status Known | Required. Array of boolean; maximum items 256. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| totalUnitsDecimal | Exact whole-unit total exported as a decimal string. | Required. Text; maximum UTF-16 length 8192. |
| supportedUnitsDecimal | Exact decimal-string total for rows satisfying all three support flags. | Required. Text; maximum UTF-16 length 8192. |
| share | Dimensionless share under the stated denominator and exclusion convention. | Required. Finite number. |
| defined | Whether the associated ratio has its required denominator; inspect before using a zero placeholder. | Required. Boolean. |
{
"input": {
"stockUnits": [
2,
3,
5
],
"countVerified": [
true,
true,
true
],
"locationVerified": [
true,
true,
false
],
"statusKnown": [
true,
false,
true
]
},
"output": {
"totalUnitsDecimal": "10",
"supportedUnitsDecimal": "2",
"share": 0.2,
"defined": true
}
} Limitations and assumptions
- Support is unit-weighted rather than row-weighted; flags are supplied and exact count strings should be preserved. This does not establish medication quality, availability, or safe dispensing.
- 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
- Ward Stock Count Gap
Subtract nonnegative integer expected from observed for gap.
- Pharmacy Supply Lead Time Day Cover
Subtract reserved within onHand for usable stock, divide by positive dailyUse for daysCover, and multiply dailyUse by leadDays+safetyDays for leadDemand and any positive deficit.