Skip to content

Main content

Ward Stock Support Share Tool

Calculate ward stock support share from explicit caller-supplied inputs.

Loading tool…

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

  1. Enter stockUnits, countVerified, locationVerified, statusKnown. 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 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 fieldMeaning and unitsAccepted input
stockUnitsStock UnitsRequired. Array of safe integer; minimum 0; maximum items 256.
countVerifiedCount VerifiedRequired. Array of boolean; maximum items 256.
locationVerifiedLocation VerifiedRequired. Array of boolean; maximum items 256.
statusKnownStatus KnownRequired. Array of boolean; maximum items 256.
Output fieldInterpretationReturned shape
totalUnitsDecimalExact whole-unit total exported as a decimal string.Required. Text; maximum UTF-16 length 8192.
supportedUnitsDecimalExact decimal-string total for rows satisfying all three support flags.Required. Text; maximum UTF-16 length 8192.
shareDimensionless share under the stated denominator and exclusion convention.Required. Finite number.
definedWhether the associated ratio has its required denominator; inspect before using a zero placeholder.Required. Boolean.
json
{
  "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

  1. Calculation and input contract: hospital-pharmacy/ward-stock-support-share — tool.io

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.