MOD FIN 008 INV
Domain specifications / D05-FIN / 5. Detailed Functional Requirements / 5.8 Module Specification: Inventory Item Master and Stock Ledger
5.8 Module Specification: Inventory Item Master and Stock Ledger¶
5.8.1 Module Overview¶
Module ID: MOD-FIN-008 (code INV)
Purpose:
Hold the inventory item master and the single, append-only stock ledger for the enterprise, including pharmacy stock, with lot, batch, expiry and location control and stocktake.
Business Capabilities: - CAP-FIN-008 Inventory and stock ledger
Primary Actors: - Inventory controller / storekeeper (ACT-FIN-008), pharmacy stores staff (ACT-FIN-009), clinical event source (ACT-FIN-015)
Dependencies: - Domain 10 master data (medications, devices, units, locations, organizations) - Domain 3 dispensing, return and ADC events; Domain 4 procedure and implant consumption events - MOD-FIN-009, MOD-FIN-010, MOD-FIN-007, MOD-FIN-011
5.8.2 Functional Areas¶
Functional Area ID: FA-FIN-016 Inventory item master
Description:
Stock items and stock locations as governed master data.
Scope: - Included: item attributes for stock control; stock location hierarchy; item-location settings. - Excluded: the clinical medication catalogue and formulary content (Domain 3, with master data in Domain 10); the item master links to them.
Functional Area ID: FA-FIN-017 Stock ledger and movements
Description:
Append-only movements and derived balances.
Scope: - Included: receipt, issue, transfer, return, adjustment and consumption movements; balance queries. - Excluded: per-unit custody of blood products, implants and reagents, which is held by Domain 4; this domain holds their quantity and value only. Human milk, which has no stock value (BR-FIN-021).
Functional Area ID: FA-FIN-018 Lot, batch and expiry control
Description:
Lot and batch identity, expiry monitoring, quarantine and blocking.
Scope: - Included: lot attributes from GS1 or manual entry; expiry and near-expiry; quarantine (lots On hold), including recall. - Excluded: bedside barcode verification of the dispensed product against the order (Domain 3).
Functional Area ID: FA-FIN-019 Stocktake
Description:
Counting, variance and approved adjustment.
Functional Area ID: FA-FIN-020 Pharmacy and controlled stock reconciliation
Description:
Reconciliation of dispensing, ADC and controlled-substance stock movements with the medication workflow records of Domain 3.
Scope: - Included: movement posting from dispense, return and ADC events; reconciliation and discrepancy reporting; the custody reconciliation report for blood products, implants and reagents. - Excluded: order verification, dispensing decisions, ADC access control and witnessed-wastage capture at the point of care (Domain 3).
5.8.3 Detailed Requirements¶
Requirement FR-FIN-INV-001: Inventory item master and stock locations¶
| Attribute | Description |
|---|---|
| Requirement ID | FR-FIN-INV-001 |
| Requirement Name | Inventory item master and stock locations |
| Requirement Type | Functional |
| Module | Inventory Item Master and Stock Ledger |
| Functional Area | FA-FIN-016 Inventory item master |
| Priority | Must |
| Criticality | High |
| Requirement Status | Draft |
| Source | FIN-005; contributes to DAT-001, ANC-006, ANC-007 |
| Related Business Rule | BR-FIN-015 |
| Related Workflow | WF-FIN-006, WF-FIN-007 |
1. Requirement Statement
The system shall maintain an inventory item master and a stock location structure, with governed ownership, approval and effective dates, sufficient to control stock by item, location and, where applicable, lot or batch and expiry.
2. Business Rationale
FIN-005 requires an inventory item master and location. DAT-001 requires governed master data with owner, approval workflow and effective dates. A single item master is a precondition for a single stock ledger.
3. Actors and Permissions
| Actor | Permission | Conditions |
|---|---|---|
| Inventory controller | Create and update items and item-location settings (draft) | Approval by a different user |
| Pharmacy stores staff | Create and update pharmacy item stock attributes | Linked medication product must exist in master data |
| Inventory approver (supply chain or pharmacy manager, ACT-FIN-019) | Approve item, location and item-location changes, including replenishment parameters, on UI-FIN-011 | Not the author of the change; the pharmacy manager for pharmacy stock attributes |
| All stock users | Read | — |
4. Preconditions - Organizations, facilities and physical locations exist in Domain 10 reference registries.
5. Trigger - New item, change or retirement request; new store or sub-store.
6. Functional Behaviour
- The system records each item with code, description, category, stock unit and purchase/issue unit conversions, lot-control and expiry-control flags, storage requirements, controlled-substance flag, chargeable flag and link to the chargeable service, and active period.
- The system links medication items to the governed medication product in master data and supply or device items to their master-data entries; it does not maintain a separate clinical catalogue.
- The system stores product identifiers used for scanning (for example GTIN) against the item and pack level.
- The system maintains stock locations (main store, pharmacy store, sub-store, ward or department stock, ADC, theatre store) linked to the facility hierarchy, each with an owning unit.
- The system maintains item-location settings, including whether the item may be held at the location and its replenishment parameters.
- The system applies an approval workflow and effective dates to item and location changes and retains history.
- The system prevents retirement of an item or location that holds stock or has open orders.
- The system shows, for a medication item, the controlled-substance flag and product attributes read-only from the linked medication product.
7. Input Requirements
| Input Field | Data Type | Mandatory | Validation | Description |
|---|---|---|---|---|
| Item code and description | Code, text | Yes | Unique code | Identity |
| Master-data link | Reference | Yes for medications and devices | Entry in use in master data | Medication product or device |
| Stock unit and conversions | Code, decimal | Yes | Valid units; conversion greater than zero | Units |
| Lot-controlled / expiry-controlled | Boolean | Yes | Medication items default to both (proposed) | Control level |
| Controlled-substance flag | Boolean | Yes | — | Drives FR-FIN-INV-005 |
| Stock location and owning unit | Reference | Yes for locations | Valid facility and unit | Where stock is held |
8. Processing Rules
| Rule ID | Processing Rule | Expected Result |
|---|---|---|
| PR-INV-001-01 | Unit conversions are effective-dated; movements store the quantity in stock unit and the unit used | Stable history |
| PR-INV-001-02 | An item cannot be changed from lot-controlled to not lot-controlled while lot balances exist | Lot integrity |
9. Output Requirements
| Output | Format | Recipient | Description |
|---|---|---|---|
| Item master and location data | API / event | All FIN stock modules; Domains 3 and 4 | Reference for stock transactions |
| Item change history | Report | Supply chain, auditor | Versions and approvals |
10. Validation and Error Handling
| Scenario | Validation | System Response | User Message / Action |
|---|---|---|---|
| Duplicate item code or product identifier | Uniqueness | Reject | "Item code or product identifier already exists" |
| Retire item with stock | Balance check | Reject | "Item has stock on hand at N locations" |
| Retire item with open orders | Open order check | Reject | "Cannot retire: [n] open orders use this item" |
| Approve own change | Segregation | Reject | "Approval requires a different user" |
| Medication item without product link | Mandatory check | Reject | "Link to medication product is required" |
11. State and Lifecycle Behaviour
Item and location: Draft, In use, Inactive (no new receipts or orders), Retired (section 4.3). A change to an item or location in use is a new version in Draft, In review and Approved; the item keeps its current values until the change is effective.
12. Audit Requirements
The system shall audit creation, change, approval and retirement of items, locations and item-location settings with before and after values.
13. Security and Privacy Requirements
Item master data is Internal and contains no patient data. Changes are segregated between author and approver.
14. Acceptance Criteria
- AC-01: Given an approved new item, when it becomes effective, then it can be received, held and issued at permitted locations only.
- AC-02: Given a medication item, when it is viewed, then it shows its link to the governed medication product and no duplicate catalogue entry exists in this domain.
- AC-03: Given an item with stock on hand, when retirement is attempted, then it is rejected.
- AC-04: Given a change to replenishment parameters made by an inventory controller, when the same user tries to approve it, then it is rejected and the earlier parameters stay in force until another user approves.
15. Dependencies and Integration
- Upstream dependencies: Domain 10 master data and reference registries.
- Downstream dependencies: MOD-FIN-009, MOD-FIN-010, MOD-FIN-002; Domains 3 and 4 (item reference).
- Required events or APIs: IF-FIN-009 item and availability API.
16. Open Questions / Assumptions
- The split of stewardship between Domain 10 (medication and device master data) and this domain (stock-control attributes) is the working position and is recorded as DEC-FIN-001.
Requirement FR-FIN-INV-002: Append-only stock ledger and stock movements¶
| Attribute | Description |
|---|---|
| Requirement ID | FR-FIN-INV-002 |
| Requirement Name | Append-only stock ledger and stock movements |
| Requirement Type | Functional |
| Module | Inventory Item Master and Stock Ledger |
| Functional Area | FA-FIN-017 Stock ledger and movements |
| Priority | Must |
| Criticality | Critical |
| Requirement Status | Draft |
| Source | FIN-005; contributes to MED-005, ANC-006, SAFE-004 |
| Related Business Rule | BR-FIN-003, BR-FIN-014, BR-FIN-015 |
| Related Workflow | WF-FIN-006, WF-FIN-007 |
1. Requirement Statement
The system shall record every receipt, issue, transfer, return, adjustment and consumption of stock as an append-only stock movement, and shall derive stock balances by item, location and lot from those movements such that movements balance by item and location.
2. Business Rationale
FIN-005 acceptance: stock movements are append-only and balance by item and location. REF-002 requires explicit ownership to avoid duplicate stock ledgers across clinical departments.
3. Actors and Permissions
| Actor | Permission | Conditions |
|---|---|---|
| Inventory controller / pharmacy stores staff | Create movements for assigned locations | Reason mandatory for returns and adjustments; a second person confirms every movement of a controlled item |
| Receiving store staff; department requester at a department destination | Confirm receipt of a transfer In transit | Destination location assigned |
| Stock-posting service identities (dispensing, ADC, procedure consumption) | Create consumption and return movements | Scoped to movement types and locations |
| Any user or administrator | No update or delete of movements | Not available through any interface |
| Stock users | Read balances and movement history | Assigned locations or enterprise view by role |
4. Preconditions - Item and location are In use; for lot-controlled items the lot exists or is created at receipt.
5. Trigger - A user stock transaction; a goods receipt; a stock-affecting event from Domain 3 or 4; a stocktake adjustment.
6. Functional Behaviour
- The system records each movement with a unique identifier, type, item, lot where applicable, quantity and unit, source and destination location, event time, recorded time, actor, reason where required, and reference to the originating document or event.
- The system records a transfer as a paired issue from the source and receipt at the destination, with an In transit state where configured, so that total stock is conserved. A transfer In transit is received when the receiving store, or the department requester at a department destination, confirms receipt; a difference in quantity raises a stock exception.
- The system derives balances from movements and exposes on-hand, reserved (where reservation is used), on-hold and available quantities by item, location and lot.
- The system processes event-sourced movements idempotently by source event identifier.
- The system corrects an erroneous movement only by a reversing movement linked to the original.
- The system provides the movement history for any item, location and lot and a balance-as-at query for any past time.
- The system publishes StockIssued and StockReceived events and balance changes for availability consumers.
- The system values movements for finance posting using the valuation method of CFG-FIN-024: moving weighted average cost, recalculated at each goods receipt, for a legal entity reporting under SAK; FIFO by receipt layer for one reporting under SAP; specific identification for items tracked by serial number (GAP-FIN-007, settled 17 Nov 2026). Valuation is independent of the order in which lots are issued, which stays first expired, first out (BR-FIN-016). Expired, damaged and recalled stock and stocktake variances are written off at their carrying value as separate posting types, and stock whose net realisable value falls below cost is written down at period end.
- For a controlled item, every interactive movement (receipt, issue, transfer, return, adjustment, disposal, consumption and reversal) is confirmed by a second person (witness) who authenticates on the same screen, is not the recording user, and is recorded by name with the movement (BR-FIN-018). Movements posted from Domain 3 events carry the witness recorded there.
- For blood products, implants and reagents, the system records the Domain 4 unit or serial identifier on each movement, so that quantity and value in this ledger are keyed by the same identifier as Domain 4 custody (BR-FIN-021).
- The system holds closed historical stock transactions from the legacy system read-only and shows them as "Migrated" (DEC-FIN-012, MIG-FIN-008).
7. Input Requirements
| Input Field | Data Type | Mandatory | Validation | Description |
|---|---|---|---|---|
| Movement type | Code | Yes | Receipt, issue, transfer out/in, return, adjustment, consumption, reversal | Kind |
| Item | Reference | Yes | In use | What |
| Lot | Reference | For lot-controlled items | Exists at source location; issuable for outbound types | Which lot |
| Quantity and unit | Decimal, code | Yes | Greater than zero; valid unit for item | How much |
| Source / destination location | Reference | Per type | In use; item permitted | Where |
| Event time | Timestamp | Yes | Not in the future beyond tolerance | When it happened |
| Second person (witness) | Reference | Yes for interactive movements of controlled items | Authenticated; not the recording user | Accountability |
| Originating reference | Identifier | Yes | Unique for event-sourced movements | Requisition, order, receipt, dispense event, stocktake |
8. Processing Rules
| Rule ID | Processing Rule | Expected Result |
|---|---|---|
| PR-INV-002-01 | Balance equals the sum of movements for item, location and lot | Ledger integrity |
| PR-INV-002-02 | An interactive issue or transfer from a store cannot exceed the available quantity. Consumption for a patient is not refused on this ground (PR-INV-002-03) | No store issue creates negative stock |
| PR-INV-002-03 | A consumption for a patient that has physically happened, recorded by a user or received as an event, is always posted, even when it exceeds the recorded balance. The balance may go negative, and a negative balance raises a stock exception for reconciliation: on UI-FIN-017 for pharmacy locations, on UI-FIN-018 for other locations (ASM-FIN-006) | Physical reality and the charge recorded; discrepancy visible |
| PR-INV-002-04 | The same source event identifier produces one movement set | No duplicate movement |
| PR-INV-002-05 | An interactive movement of a controlled item is not posted without a second person who is not the recording user | Witnessed controlled stock |
| PR-INV-002-06 | Any movement is reversed by the recording user within 24 hours of recording, then only by the inventory controller with a reason, as for consumption (PR-REP-001-03). A reversal of a controlled item needs a witness (PR-INV-002-05). A receipt whose lot has already been issued cannot be reversed | Controlled correction |
| PR-INV-002-07 | A transfer to a store destination is received by the receiving store on UI-FIN-012 ("Confirm transfer received"), and at a department destination by the department requester on UI-FIN-016. A difference between sent and received quantity raises a stock exception | Transfers are closed by the receiver |
9. Output Requirements
| Output | Format | Recipient | Description |
|---|---|---|---|
| Stock movement | Ledger record | Stock users, finance posting | Append-only entry |
| Balance and availability | API / event | Domains 3 and 4; MOD-FIN-010 | Current stock by item, location, lot |
| StockReceived, StockIssued | Domain events | Domain 8; MOD-FIN-007; MOD-FIN-010 | Movement notifications |
10. Validation and Error Handling
| Scenario | Validation | System Response | User Message / Action |
|---|---|---|---|
| Insufficient available stock (interactive issue or transfer) | Balance check | Reject | "Available quantity is N" |
| Consumption for a patient above the recorded balance | Balance check | Post; raise a negative-balance stock exception | "Recorded. Stock balance is below zero and has been sent for reconciliation" |
| Controlled item movement without a second person | Witness check | Reject | "A second person must confirm this movement" |
| Unknown item, location or lot in event | Reference check | Exception item | "Stock event references unknown lot" |
| Update or delete attempt | Interface constraint | Refuse; audit | "Stock movements cannot be edited; post a reversal" |
11. State and Lifecycle Behaviour
A movement is Posted on creation and may become Reversed through a linked reversing movement; its content never changes. A transfer is In transit until receipt is confirmed at the destination, where configured. Migrated legacy transactions are shown as "Migrated" and are read-only.
12. Audit Requirements
The ledger is its own change history. The system shall additionally audit refused edit attempts, reversals with reason, and access to controlled-substance movement history.
13. Security and Privacy Requirements
Movements that originate from patient-specific dispensing carry a reference to the source event, not clinical detail; patient-linked consumption views are restricted to roles that need them. Stock posting by services uses scoped service identities.
14. Acceptance Criteria
- AC-01: Given a sequence of receipt, transfer, issue and return movements, when balances are queried, then each balance by item, location and lot equals the sum of its movements and total stock is conserved across the transfer.
- AC-02: Given a posted movement, when an edit or delete is attempted, then it is refused and a reversing movement is the only available correction.
- AC-03: Given a dispense event delivered twice, when processed, then one consumption movement exists.
- AC-04: Given any past time, when a balance-as-at query is run, then the result equals the sum of movements with event time up to that time.
15. Dependencies and Integration
- Upstream dependencies: FR-FIN-INV-001; MOD-FIN-009; Domain 3 and 4 stock-affecting events.
- Downstream dependencies: MOD-FIN-007, MOD-FIN-010, MOD-FIN-011; Domains 3, 4 and 8.
- Required events or APIs: IF-FIN-009, IF-FIN-010; EVT-FIN-006, EVT-FIN-007.
16. Open Questions / Assumptions
- Reservation of stock for verified medication orders or scheduled procedures appears in REF-004 but not in the PRS; it is not in release 1, and the reserved quantity stays zero where reservation is not used (GAP-FIN-008, closed).
Requirement FR-FIN-INV-003: Lot, batch and expiry management¶
| Attribute | Description |
|---|---|
| Requirement ID | FR-FIN-INV-003 |
| Requirement Name | Lot, batch and expiry management |
| Requirement Type | Functional |
| Module | Inventory Item Master and Stock Ledger |
| Functional Area | FA-FIN-018 Lot, batch and expiry control |
| Priority | Must |
| Criticality | Critical |
| Requirement Status | Draft |
| Source | FIN-005; contributes to ANC-008, SPEC-002 |
| Related Business Rule | BR-FIN-016 |
| Related Workflow | WF-FIN-006, WF-FIN-007 |
1. Requirement Statement
The system shall record lot or batch and expiry for lot-controlled stock at receipt, carry them on every movement, and prevent expired or quarantined lots from being issued for use.
2. Business Rationale
FIN-005 requires lot/batch and expiry. ANC-008 requires product, batch and expiry to be validated and expired product rejected in medication workflows; that check depends on the lot and expiry data held here. Expired stock reaching a patient is a care risk (section 11).
3. Actors and Permissions
| Actor | Permission | Conditions |
|---|---|---|
| Inventory controller / pharmacy stores staff | Create lots at receipt; place lots on hold, at receipt or later; dispose of expired stock | Reason mandatory |
| Inventory controller; pharmacist for pharmacy stock | Release a lot from hold | Reason mandatory; no further approval |
| Stock users | Read lot and expiry information | — |
| Domain 3 dispensing service | Query lot status | Read-only API |
4. Preconditions - The item is lot-controlled or expiry-controlled.
5. Trigger - Goods receipt; a scan of a product identifier; scheduled expiry evaluation; a hold (quarantine) decision, including a recall.
6. Functional Behaviour
- The system captures lot or batch number and expiry date at receipt, by manual entry or by parsing a scanned GS1 DataMatrix carrying GTIN, lot/batch and expiry where available, and rejects a malformed code.
- The system holds lot status: Available, On hold, Expired. On hold is the quarantine state; its reason distinguishes a recall.
- The system sets a lot to expired when its expiry date is reached and excludes it from picking and availability.
- The system rejects an outbound movement for use that names an expired lot or a lot On hold, and returns that status and the hold reason to a caller that queries the lot.
- The system proposes lots for issue by the configured picking rule (first-expiry-first-out is the proposed default).
- The system produces near-expiry and expired stock lists by location and raises exception items for expired stock on hand.
- The system supports placing a lot on hold across all locations with reason, recall being one reason, and its release with reason, and lists all locations holding the lot and all movements of the lot.
- The system records disposal or return to supplier of expired stock or stock on hold as movements with reason.
- At receipt, the system receives a lot On hold when its remaining shelf life is below the minimum and the configured action is hold (CFG-FIN-016), or when the receiver places it on hold with reason.
- The system rejects a scan with the message set shared with Domain 3 and the other scanning screens: "Barcode not readable", "Product expired · [date]", "Lot quarantined", "Lot recalled", "Not a recognized product". In stores screens the rejection is a warning in words; at the point of use for a patient it is a hard stop.
7. Input Requirements
| Input Field | Data Type | Mandatory | Validation | Description |
|---|---|---|---|---|
| Lot / batch number | Text | Yes for lot-controlled items | Not empty | Lot identity |
| Expiry date | Date | Yes for expiry-controlled items | Valid date; compared with minimum shelf life at receipt | Expiry |
| Scanned code | String | No | Parses as a valid GS1 structure where used; GTIN matches item | Source of lot data |
| Hold reason | Code, text | Yes for a hold and for release | Configured list, including recall | Accountability |
8. Processing Rules
| Rule ID | Processing Rule | Expected Result |
|---|---|---|
| PR-INV-003-01 | Expired lots and lots On hold have zero available quantity | Not selectable |
| PR-INV-003-02 | Expiry evaluation uses the facility's local date | Correct cut-over |
| PR-INV-003-03 | A consumption event naming an expired lot is still posted (the consumption has occurred) and raises a high-priority exception | Stock truth and safety signal both preserved (proposed, ASM-FIN-006) |
9. Output Requirements
| Output | Format | Recipient | Description |
|---|---|---|---|
| Lot status | API | Domain 3 dispensing; stock users | Available, On hold (with reason), Expired |
| Near-expiry and expired lists | Worklist / report | Stores, pharmacy | Action lists |
| Lot trace | Report | Stores, pharmacy, quality | Locations and movements of a lot |
10. Validation and Error Handling
| Scenario | Validation | System Response | User Message / Action |
|---|---|---|---|
| Malformed barcode | Parse | Reject scan | "Barcode not readable" |
| Issue of expired lot | Lot status | Reject | "Product expired · [date]" |
| Issue of a lot On hold | Lot status | Reject | "Lot quarantined" |
| Issue of a lot On hold for recall | Lot status and hold reason | Reject | "Lot recalled" |
| Scanned GTIN not in the item master | Lookup | Reject scan | "Not a recognized product" |
| Receipt below minimum shelf life | Date check | Block or place On hold per configuration | "Remaining shelf life below minimum" |
| Scanned GTIN does not match item | Match | Reject | "Product code does not match item" |
11. State and Lifecycle Behaviour
Lot: Available, On hold, Expired (section 4.3). Expired is terminal for issue; stock leaves by disposal or supplier return.
12. Audit Requirements
The system shall audit lot creation, hold, release, expiry transition, disposal and any rejected attempt to issue an expired lot or a lot On hold.
13. Security and Privacy Requirements
Release from hold is a restricted permission. Lot trace that includes patient-linked consumption is limited to authorized quality, pharmacy and safety roles.
14. Acceptance Criteria
- AC-01: Given a receipt scanned from a GS1 DataMatrix, when recorded, then GTIN, lot and expiry are captured and matched to the item.
- AC-02: Given a lot whose expiry date has passed, when an issue or transfer for use is attempted, then it is rejected and the lot does not appear in picking proposals or availability.
- AC-03: Given a lot On hold at three locations, when the lot trace is run, then all three locations and all movements are listed and no location can issue it.
- AC-04: Given a malformed barcode, when scanned at receipt, then it is rejected with a reason.
- AC-05: Given lots with different expiry dates, when an issue is proposed under the default rule, then the earliest-expiring available lot is proposed first.
- AC-06: Given a lot On hold for recall, when it is scanned for issue, then the scan is rejected with "Lot recalled".
15. Dependencies and Integration
- Upstream dependencies: FR-FIN-INV-001, FR-FIN-PRC-002.
- Downstream dependencies: Domain 3 (dispensing checks under ANC-008); Domain 4 (implant and consumable traceability under SPEC-002); MOD-FIN-011.
- Required events or APIs: IF-FIN-009; LotStatusChanged event (EVT-FIN-014, proposed).
16. Open Questions / Assumptions
- Supplier or regulator recall handling is named in REF-004 (design context) but not in the PRS. A recall is a hold with the reason recall, with the lot trace of part 6.7; no separate recall workflow is built in release 1 (GAP-FIN-008, closed).
- Serial-number tracking of implants is held in the theatre record (Domain 4, SPEC-002). Stock movements of blood products, implants and reagents carry the Domain 4 unit or serial identifier (FR-FIN-INV-002 part 6.10; DE-FIN-022).
Requirement FR-FIN-INV-004: Stocktake and stock adjustment¶
| Attribute | Description |
|---|---|
| Requirement ID | FR-FIN-INV-004 |
| Requirement Name | Stocktake and stock adjustment |
| Requirement Type | Functional |
| Module | Inventory Item Master and Stock Ledger |
| Functional Area | FA-FIN-019 Stocktake |
| Priority | Must |
| Criticality | Medium |
| Requirement Status | Draft |
| Source | FIN-005 |
| Related Business Rule | BR-FIN-014, BR-FIN-019 |
| Related Workflow | WF-FIN-008 |
1. Requirement Statement
The system shall support stocktake by location, comparing counted quantities with ledger balances by item and lot, and shall post approved variances as adjustment movements without altering earlier movements.
2. Business Rationale
FIN-005 requires stocktake. Adjustments must respect the append-only ledger.
3. Actors and Permissions
| Actor | Permission | Conditions |
|---|---|---|
| Inventory controller / pharmacy stores staff | Open stocktake; enter counts; finish counting; request recount | Assigned locations |
| Stores manager (ACT-FIN-020); the pharmacy manager for pharmacy stores | Approve variances up to the configured value; request recount; cancel a stocktake with reason | Different user from counter; nothing posted for a cancellation |
| Finance supervisor | Approve variances above the configured value (higher approval); request recount | Different user from counter |
4. Preconditions - The location is In use; no other stocktake is open for the same scope.
5. Trigger - Stocktake schedule; ad hoc request; discrepancy investigation.
6. Functional Behaviour
- The system opens a stocktake for a location and scope (all items, category, or selected items) and snapshots ledger balances.
- The system supports blind counting, as a configurable option. In a blind count the counter sees neither the expected quantity nor the variance value, and printed count sheets omit them.
- The system records counts by item and lot, by scan or manual entry.
- The system calculates variances, accounting for movements posted between snapshot and count.
- When the counter finishes counting, the system routes variances for approval by the stores manager. A stocktake whose variance value is above the configured value (CFG-FIN-014) waits as Awaiting higher approval for the finance supervisor.
- On approval the system posts adjustment movements with reason and stocktake reference and closes the stocktake.
- The system produces a variance report by item, lot, quantity and value.
- The counter or an approver can request a recount of selected lines; the stocktake is Recount requested until those lines are counted again.
- The stores manager can cancel a stocktake with reason before any adjustment is posted.
7. Input Requirements
| Input Field | Data Type | Mandatory | Validation | Description |
|---|---|---|---|---|
| Location and scope | Reference, selection | Yes | No overlapping open stocktake | What is counted |
| Counted quantity | Decimal | Yes per line | Non-negative | Count |
| Lot | Reference / text | For lot-controlled items | Existing lot or flagged as found | Lot counted |
| Variance reason | Code | For non-zero variance | Configured list | Accountability |
8. Processing Rules
| Rule ID | Processing Rule | Expected Result |
|---|---|---|
| PR-INV-004-01 | Adjustment quantity equals counted quantity minus ledger balance at count time | Ledger equals count after posting |
| PR-INV-004-02 | No adjustment is posted before approval | Controlled write-off |
9. Output Requirements
| Output | Format | Recipient | Description |
|---|---|---|---|
| Count sheets / scan list | Screen / print | Counters | Items to count; without expected quantities in a blind count |
| Variance report | Report | Stores, pharmacy, finance | Variances and values |
| Adjustment movements | Ledger records | Stock ledger, finance posting | Approved corrections |
10. Validation and Error Handling
| Scenario | Validation | System Response | User Message / Action |
|---|---|---|---|
| Overlapping stocktake | Scope check | Reject | "A stocktake is already open for this location and scope" |
| Variance above tolerance | Tolerance check | Escalate approval | "Variance requires higher approval" |
| Counter approves own count | Segregation | Reject | "Approval requires a different user" |
11. State and Lifecycle Behaviour
Stocktake: Open, Counted, Recount requested, Awaiting higher approval, Closed; Cancelled before posting (section 4.3).
12. Audit Requirements
The system shall audit stocktake opening, count entry and change, recount requests, approval, cancellation with reason and adjustment posting.
13. Security and Privacy Requirements
Counting and approval are segregated. Controlled-substance stocktakes are restricted to authorized pharmacy roles.
14. Acceptance Criteria
- AC-01: Given a count two units below the ledger for one lot, when the variance is approved, then an adjustment movement of minus two with stocktake reference is posted and the balance equals the count.
- AC-02: Given an issue posted after the snapshot and before the count, when the variance is calculated, then that movement is taken into account.
- AC-03: Given a variance above tolerance, when approval is attempted by the standard approver, then higher approval is required.
- AC-04: Given a blind count, when the counter enters a count, then neither the expected quantity nor the variance value is shown.
15. Dependencies and Integration
- Upstream dependencies: FR-FIN-INV-002.
- Downstream dependencies: MOD-FIN-007 (adjustment postings); Domain 8.
- Required events or APIs: none external.
16. Open Questions / Assumptions
- Stocktake frequency and tolerance are hospital policy (CFG-FIN-014).
Requirement FR-FIN-INV-005: Pharmacy, automated dispensing cabinet and controlled-substance stock reconciliation¶
| Attribute | Description |
|---|---|
| Requirement ID | FR-FIN-INV-005 |
| Requirement Name | Pharmacy, automated dispensing cabinet and controlled-substance stock reconciliation |
| Requirement Type | Functional |
| Module | Inventory Item Master and Stock Ledger |
| Functional Area | FA-FIN-020 Pharmacy and controlled stock reconciliation |
| Priority | Must |
| Criticality | Critical |
| Requirement Status | Draft |
| Source | Contributes to MED-005, ANC-006, ANC-009, ANC-012 (primary owner Domain 3); FIN-005 |
| Related Business Rule | BR-FIN-015, BR-FIN-017, BR-FIN-018, BR-FIN-021 |
| Related Workflow | WF-FIN-007 |
1. Requirement Statement
The system shall post a stock movement in the single stock ledger for every pharmacy dispense, return and automated dispensing cabinet release reported by the medication workflow, and shall reconcile stock records with dispensing, administration, return and wastage records, reporting every unmatched item. It shall also report differences between Domain 4 custody and the stock quantities of blood products, implants and reagents.
2. Business Rationale
MED-005 acceptance: dispensing reconciles against valid order and inventory movement. ANC-006: medication item lifecycle reconciles to CPOE, dispensing and stock ledger. ANC-009: ADC release is reconciled to verified order, user, cabinet, pocket and stock movement. ANC-012: controlled-substance inventory and administration records reconcile. Domain 3 owns those workflows; this domain owns the stock side of each reconciliation.
3. Actors and Permissions
| Actor | Permission | Conditions |
|---|---|---|
| Dispensing / ADC service identity (Domain 3 via Domain 2) | Post consumption and return movements | Scoped to pharmacy and ADC locations |
| Pharmacy stores staff | Review and resolve reconciliation discrepancies | Assigned locations |
| Authorized pharmacist | Review and resolve controlled-substance reconciliation | Restricted role |
| Medication safety officer (Domain 3 actor) | Read controlled-substance reconciliation and discrepancies on UI-FIN-017 | Read-only; access audited |
| Blood bank and perioperative roles (Domain 4) | Read the custody reconciliation report on UI-FIN-017 | Read-only; their own services' units |
4. Preconditions - Pharmacy stores, ward stock and each ADC (to cabinet level, and to pocket level where the interface supplies it) are stock locations. - Domain 3 publishes dispense, return, ADC release and, for controlled substances, administration and wastage events with item, lot where captured, quantity, location and order reference.
5. Trigger - MedicationDispensed, return, ADC release or restock events; scheduled reconciliation.
6. Functional Behaviour
- The system posts a consumption movement for each dispense and ADC release from the reported location and lot, referencing the dispense or release event and the order reference.
- The system posts a return-to-stock movement for each medication return accepted by pharmacy, with lot and condition, and a disposal movement for returns not fit for reuse.
- The system posts ADC restock as a transfer from the pharmacy store to the cabinet location.
- The system compares, for a period and location, Domain 3 dispense and release records with stock movements and lists unmatched records on either side.
- For controlled substances, the system reconciles quantity issued with quantity administered, returned and wasted as reported by Domain 3, and lists differences for authorized review within the configured time limit. A difference is one stock discrepancy per item, location and period, with the states Open, Under review and Resolved with reason; a later difference for the same item, location and period updates it.
- The system does not process blood products or human milk through these dispense transactions. For blood products, implants and reagents it holds quantity and value only, posted from Domain 4 events and keyed by the Domain 4 unit or lot identifier (BR-FIN-021).
- The system continues to accept and queue events when processing is delayed; it never rejects a dispense on the ground that the ledger is unavailable.
- The system provides the custody reconciliation report: a read-only view on UI-FIN-017 that lists only the differences between Domain 4 custody and the Domain 5 quantity of blood products, implants and reagents, by unit or lot identifier, with a link to the unit in Domain 4 (DEC-ANC-005). It is open to blood bank and perioperative roles. Domain 4 follows up the fate of each unit; the report changes neither record.
- The system lists negative-balance stock exceptions at pharmacy locations (FR-FIN-INV-002, PR-INV-002-03) with the reconciliation discrepancies on UI-FIN-017.
- SIPNAP report (set 17 Nov 2026). This domain owns the monthly report of narcotics and psychotropics to SIPNAP under Permenkes 5/2023 (EXT-FIN-011, REP-FIN-023). On the 1st of each month the system builds the report for the previous month, per controlled item and pharmacy: opening balance, receipts with supplier, issues, returns, disposals and closing balance, from the stock ledger. Issue to patients is taken from the Domain 3 controlled-substance transactions (DE-CLI-021), not from ward transfers. Open controlled-substance discrepancies of the month are listed on the report and must be resolved or explained before sign-off. The pharmacist in charge reviews and signs the report by the 7th, and it is sent by the 10th. A correction after sending is a new version of the report with reason.
7. Input Requirements
| Input Field | Data Type | Mandatory | Validation | Description |
|---|---|---|---|---|
| Source event identifier and type | Identifier, code | Yes | Unique; supported type | Dispense, return, ADC release, restock, administration, wastage |
| Item and quantity | Reference, decimal | Yes | Item in use; quantity greater than zero | What moved |
| Lot and expiry | Reference | Where captured by scan | Known lot | Which lot |
| Location (store, ward, cabinet, pocket) | Reference | Yes | Valid stock location | Where from |
| Order / eMAR reference | Identifier | Yes for patient-specific events | Present | Reconciliation key |
| User and, for controlled items, witness | Reference | As supplied by Domain 3 | Witness present for every movement of a controlled item | Accountability |
| Domain 4 unit or lot identifier | Identifier | Yes for blood products, implants and reagents | Known to Domain 4 | Custody reconciliation key |
8. Processing Rules
| Rule ID | Processing Rule | Expected Result |
|---|---|---|
| PR-INV-005-01 | One movement set per source event | No duplicate consumption |
| PR-INV-005-02 | A dispense with no captured lot is posted against the location using the configured picking rule and flagged | Balance correct; lot uncertainty visible |
| PR-INV-005-03 | Controlled-substance difference: issued minus (administered plus returned plus wasted) must be zero per item, location and period | Discrepancy raised when non-zero |
| PR-INV-005-04 | Custody difference: for each blood product, implant or reagent identifier, the Domain 5 quantity on hand must match the Domain 4 custody status (in stock or not) | Listed on the custody reconciliation report when they differ |
9. Output Requirements
| Output | Format | Recipient | Description |
|---|---|---|---|
| Stock movements | Ledger records | Stock ledger | From medication events |
| Dispense-to-stock reconciliation | Report / worklist | Pharmacy stores | Unmatched records |
| Controlled-substance reconciliation | Report / worklist | Authorized pharmacist; medication safety officer (read) | Differences by item and location |
| SIPNAP monthly report | Report in the SIPNAP format; PDF of the signed version | Pharmacist in charge; SIPNAP through Domain 2 | Narcotics and psychotropics per item and pharmacy for the month |
| Custody reconciliation report | Report (read-only view) | Blood bank and perioperative roles; pharmacy stores staff | Differences between Domain 4 custody and Domain 5 quantity, with a link to the unit in Domain 4 |
10. Validation and Error Handling
| Scenario | Validation | System Response | User Message / Action |
|---|---|---|---|
| Event references unknown cabinet or pocket | Reference check | Exception item | "ADC location not mapped" |
| Dispense record with no movement after processing window | Reconciliation | Discrepancy item | "Dispense without stock movement" |
| Controlled-substance difference | Reconciliation | High-priority discrepancy; notify authorized pharmacist | "Controlled stock discrepancy at LOCATION" |
| Domain 4 unit or lot identifier unknown to the ledger | Reference check | Listed on the custody reconciliation report | "Unit not in stock ledger" |
11. State and Lifecycle Behaviour
Stock discrepancy: Open, Under review, Resolved with reason, one item per item, location and period (section 4.3), held in the exception queues of MOD-FIN-011 with their Escalated flag.
12. Audit Requirements
The system shall audit movements posted from medication events with source event, user and witness references as supplied, and all discrepancy reviews and resolutions. Access to controlled-substance reconciliation is audited.
13. Security and Privacy Requirements
Controlled-substance stock data is restricted to authorized pharmacy, medication safety and audit roles. Patient-specific references are held as identifiers; clinical detail remains in Domain 3. The custody reconciliation report shows unit identifiers and quantities, not patient details.
14. Acceptance Criteria
- AC-01: Given a verified order dispensed from the pharmacy store, when the dispense event is processed, then one consumption movement exists for the item, lot and location, referencing the dispense and the order.
- AC-02: Given an ADC release, when processed, then the movement references the cabinet (and pocket where supplied) and the reconciliation shows the release matched.
- AC-03: Given a controlled-substance issue of ten units with eight administered, one returned and none wasted, when reconciliation runs, then a discrepancy of one unit is raised to the authorized pharmacist.
- AC-04: Given the stock ledger is stopped, when dispensing continues in Domain 3, then dispensing is not blocked, and after restart all dispense events have movements and the reconciliation is clean.
- AC-05: Given a blood unit that Domain 4 records as transfused and that still shows a quantity on hand in this domain, when the custody reconciliation runs, then the unit is listed on the custody reconciliation report with a link to the unit in Domain 4.
- AC-06: Given a month with receipts, patient issues recorded by Domain 3 and one open controlled-substance discrepancy, when the SIPNAP report is built on the 1st, then the patient issues match the Domain 3 transactions, the discrepancy is listed, and the report cannot be signed until it is resolved or explained.
15. Dependencies and Integration
- Upstream dependencies: Domain 3 medication workflow events; Domain 2 ADC and device transport; Domain 4 custody and consumption events for blood products, implants and reagents (EVT-ANC-012, EVT-ANC-025).
- Downstream dependencies: MOD-FIN-001 (pharmacy billing), MOD-FIN-010, MOD-FIN-011; Domain 8.
- Required events or APIs: IF-FIN-010 stock-affecting event consumption contract.
16. Open Questions / Assumptions
- This requirement applies the shared working boundary position: Domain 3 owns verification, dispensing and the eMAR; this domain owns the stock ledger and pharmacy billing (DEC-FIN-001).
- Whether dispensing may proceed when stock data is unavailable or shows zero is proposed as "yes, with reconciliation" and needs pharmacy and clinical governance approval (DEC-FIN-004).
- Domain 3 uses the same discrepancy states (Open, Under review, Resolved with reason) and the same scan rejection messages for the controlled-substance and dispensing records it holds (FR-CLI-RXV-003); Domain 4 publishes custody events for blood products, implants and reagents with the unit, serial or lot identifier and provides the unit link used by the custody reconciliation report.
← 5.7 Module Specification: Finance Posting and Reconciliation Interfaces | Contents | Identifier index | 5.9 Module Specification: Requisition, Purchasing and Procurement →