Demand Analytics Algorithm
A detailed overview of the algorithm used to forecast patient kit demand, kit production, and assess supply risks for clinical trials forecasting.
1. Introduction
This document outlines the business rules governing the algorithm used to forecast patient kit demand, kit production, and assess supply risks for clinical trials forecasting. The goal is to ensure a consistent and adequate supply of necessary materials (kits) to clinical sites throughout the trial duration.
2. Demand Forecasting Rules
These rules define how the algorithm predicts the quantity and timing of kits needed based on simulated patient activity.
- Rule 2.1: Patient Enrollment Period:
- Each participating country has a defined start date and end date for patient enrollment.
- Rationale: Establishes the overall timeframe during which new patients can join the trial in a specific country.
- Rule 2.2: Target Patient Numbers:
- A target number of patients to be enrolled is specified for each treatment arm.
- Rationale: Defines the scale of the trial for planning purposes.
- Rule 2.3: Enrollment Recruitment & Real-Time Data Mappings:
- The algorithm forecasts patient enrollment over the defined period.
- NEW: Incorporation of Actual Data: The system can now utilize actual, confirmed patient enrollment data (Real-Time Recruitment Dates) if provided. This data specifies the exact date, country, and treatment arm for confirmed patient starts.
- NEW: Prioritization of Actual Data: When real-time enrollment data is available for a specific day, country, and arm, those confirmed patient numbers take precedence and are locked in for that date. They are subtracted from the total target number of patients for that country treatment arm combination.
- Simulation of Remaining Patients: The algorithm then simulates the enrollment pattern for the remaining, unconfirmed patients (Target Patients - Confirmed Patients) over the original enrollment period using a supported distribution pattern below.
- Supported distribution Patterns: The enrollment for remaining patients uses one of the following patterns (configurable per country, with potential overrides per treatment arm):
- Linear: Assumes a steady, even rate of enrollment for the remaining patients across the available days.
- Bell Curve: Assumes enrollment for remaining patients starts slowly, peaks, and slows down across the available days. We support diffrent variations of bell curves such as fast, slow, and normal.
- Monthly Recruitment: If configured, remaining patients are distributed proportionally across the available days within each scheduled month, based on the original monthly targets.
- NEW: Excluding Confirmed Dates: When distributing remaining patients, the algorithm excludes the specific dates already accounted for by the confirmed real-time enrollment data.
- Rationale Update: Combines actual enrollment data (when available) with sophisticated forecasting models for unconfirmed patients. This provides a more accurate and up-to-date demand projection by locking in known enrollments while still planning for the remaining target population based on expected patterns.
- Rule 2.4: Patient Grouping:
- Patients who start treatment on the same day, in the same country, and on the same treatment arm are grouped together (a 'Group').
- NEW: Clarification: Groups are formed based on either the confirmed real-time start dates or the simulated start dates calculated for the remaining patients.
- Rationale: Simplifies tracking, as all patients within a group will follow the identical visit and kit schedule for forecasting purposes.
- Rule 2.5: Visit Schedules:
- Each treatment arm has a predefined schedule of patient visits (e.g., Day 0, Day 14, Day 28). Visits are defined by the number of days relative to the patient's start date.
- All patients within a Group follow the visit schedule defined for their treatment arm.
- Rationale: Models the planned interactions where kits might be dispensed according to the trial protocol.
- Rule 2.6: Kit Requirements per Visit:
- The specific type and quantity of kits required per patient are defined for each scheduled visit.
- Rationale: Links the visit schedule directly to material needs based on the protocol.
- Rule 2.7: Calculating Base Kit Demand:
- The base demand for a specific kit at a specific visit for a Group is calculated as:
(Number of Patients in Group) * (Kits Per Patient for that Visit)
. - Rationale: Determines the core quantity needed based on patient numbers and protocol requirements.
- The base demand for a specific kit at a specific visit for a Group is calculated as:
- Rule 2.9: Overage Calculation:
- An additional 'overage' quantity is calculated for kits dispensed. This is typically a percentage applied to the base demand.
- The overage percentage is configurable for each country.
- The total quantity planned for dispensation =
Base Kit Demand + Overage Amount
. - Rationale: Builds in a buffer to account for potential kit damage, loss, or minor variations in need, reducing the risk of immediate stock-outs at the site.
- Rule 2.10: Monthly Demand Aggregation:
- The calculated demand (including overage) is summarized monthly for the entire trial duration.
- The summary distinguishes between kits needed for patients who started treatment within that month ('New Patients') and kits needed for patients who started in previous months but have visits in the current month ('Rollover Patients').
- Rationale: Provides a consolidated view of demand over time, essential for production planning and risk assessment.
3. Production Planning Rules
These rules define how the algorithm determines the schedule and quantity of kit manufacturing runs needed to meet the forecasted demand.
- Rule 3.1: Production Frequency:
- Manufacturing runs for kits are planned to occur at a regular, predefined frequency (e.g., every 30 days, every 60 days). This frequency is set in the trial's configuration.
- Rationale: Establishes a predictable rhythm for production activities.
- Rule 3.2: Lead Time Consideration:
- Production planning accounts for two types of lead time:
- Production Lead Time: The time required to manufacture a batch of kits.
- Shipping Lead Time: The time required to ship kits from the manufacturing location to the destination (either a central depot or directly to clinical sites or via local depots). Shipping lead times can vary by country and shipping method (local depot vs. direct-to-site).
- Production must be initiated early enough for kits to be manufactured and shipped to arrive before they are needed according to the demand forecast. Prognosis takes this into account by starting production by working backwards from the day the kits need to be available accounting for lead time and production times.
- Rationale: Ensures materials arrive proactively, preventing delays in patient treatment.
- Production planning accounts for two types of lead time:
- Rule 3.3: Calculating Earliest Production Start:
- The algorithm identifies the longest combined lead time (production + shipping) across all countries and destinations involved in the trial.
- The first production run must start work far enough in advance of the first anticipated patient demand to accommodate this longest lead time.
- Rationale: Ensures even the locations with the longest delivery times receive their initial supplies on time.
- Rule 3.4: Kit Expiry Management:
- Each type of kit has a defined shelf life (expiry date) measured from its production date.
- Production runs are planned such that the kits are expected to be delivered and used by patients before this expiry date is reached.
- Rationale: Ensures patient safety by avoiding the use of expired materials.
- Rule 3.5: Defining the Supply Window for a Production Run:
- Each production run is intended to supply kits for a specific future time period (its 'supply window').
- For a specific country, this window starts on the estimated arrival date of the kits from that run in that country.
- The window ends on the earlier of these two dates:
- The expiry date of the kits from this run.
- The estimated arrival date of kits from the next scheduled production run.
- Rationale: Defines the exact period of demand that a specific manufacturing batch is responsible for covering, considering both shelf life and replenishment cycles.
- Rule 3.6: Calculating Production Quantity (Demand):
- The primary quantity calculated for a production run is based on patient demand.
- For a specific kit, the algorithm sums up all of the forecasted patient kit requirements (base demand + overage) that fall within the supply window (Rule 3.5) for all countries being supplied by that run.
- Rationale: Ensures the run produces enough kits to meet the predicted patient usage during the period it covers.
- Rule 3.7: Country Eligibility for a Production Run:
- A country is only included in the supply plan for a production run if the run's kits are scheduled to arrive before the date of the last anticipated patient visit in that country.
- Rationale: Avoids producing and shipping kits to countries where the trial activity (requiring those kits) that have already concluded.
- Rule 3.8: Initial Site Seeding:
- An initial 'seed stock' of kits can be planned for delivery to clinical sites at the very beginning of the trial.
- The quantity is typically calculated based on a predefined amount applied to the number of participating sites in each country. (kits seeded * number of sites)
- This seed quantity is added to the quantity calculated for the first relevant production run(s).
- Rationale: Ensures sites have a baseline inventory immediately available when the first patients arrive, before relying solely on visit-driven resupply.
- Rule 3.9: Replenishment Site Seeding:
- The algorithm automatically plans for seed stock replenishment to maintain continuous availability at sites.
- If a production run is scheduled to arrive just before the expiry date of the previous seeding batch sent to a country, a new batch of seed stock is added to that production run's quantity.
- The expiry date of the new seed batch is then tracked for future replenishment checks.
- Rationale: Proactively replaces expiring site stock before it becomes unusable, ensuring uninterrupted site readiness without manual intervention.
- Rule 3.10: Total Production Quantity:
- The final quantity planned for a production run =
Calculated Demand Quantity (Rule 3.6) + Calculated Seeding Quantity (Rules 3.8 & 3.9)
. - Rationale: Consolidates all requirements into a single production target for that batch.
- The final quantity planned for a production run =
4. Risk Assessment Rules
These rules define how the algorithm compares the planned production supply against the forecasted monthly demand to identify potential shortages.
- Rule 4.1: Monthly Comparison:
- The core of risk assessment is a month-by-month comparison for each specific kit type.
- It compares:
Total Forecasted Demand in Month
vs.Total Available Supply in Month
. - Rationale: Focuses the analysis on discrete time periods relevant to operational planning.
- Rule 4.2: Defining Available Supply in a Month:
- A production run contributes to the available supply for a specific month if:
- Its latest possible arrival date across all its destination countries is before the end of that month.
- Its expiry date is after the beginning of that month.
- Rationale: Ensures supply is counted only when it is physically present and not yet expired during the relevant period.
- A production run contributes to the available supply for a specific month if:
- Rule 4.3: Prorating Monthly Supply Contribution:
- If a production run arrives or expires part-way through a month, its contribution to that month's supply is prorated based on the number of days it is actually available within the month.
- Example: A run of 100 kits available for 15 days in a 30-day month contributes 50 kits to that month's potential supply.
- Rationale: Accurately reflects the supply available during the specific days of the month, preventing overestimation from runs covering only partial periods.
- Rule 4.4:Risk Identification (Risk Flag):
- A supply risk ('shortfall') is flagged for a specific kit in a specific month if:
Total Available Supply in Month (Rule 4.2 & 4.3)
is less thanTotal Forecasted Demand in Month (Rule 2.10)
. - The quantity of the shortfall (
Risk Quantity
) is recorded. - Rationale: Directly identifies months where the current plan indicates demand will exceed supply.
- A supply risk ('shortfall') is flagged for a specific kit in a specific month if:
- Rule 4.5: Risk Reason Analysis:
- When a shortfall is identified, the algorithm attempts to determine the primary reason(s):
- Timing Risk: Insufficient supply was available solely because runs didn't arrive in time or expired too early within the month. Even with infinite production capacity and no prior usage, the timing of arrivals/expiries made meeting demand impossible.
- Production Constraint Risk: A production run that could have helped meet demand (based on timing and potential quantity) was not fully usable because its planned total quantity violated configured minimum or maximum manufacturing batch size limits. (Note: The algorithm primarily flags this based on initial run parameters, assuming they weren't adjusted).
- Depletion Risk: Sufficient supply could have arrived on time and met constraints, but the specific production runs needed were already partially or fully used up ('depleted') fulfilling demand in previous months.
- Rationale: Provides insight into why a risk is predicted, guiding corrective actions (e.g., adjusting production timing, changing batch sizes, increasing run frequency).
- When a shortfall is identified, the algorithm attempts to determine the primary reason(s):