The Platelet Bump Calculator is a specialized tool designed to analyze the effectiveness of platelet transfusions by calculating the Corrected Count Increment (CCI) for multiple transfusions. This documentation provides detailed technical information for implementing the calculator.
A successful platelet transfusion should result in an appropriate increase in the patient's platelet count. The effectiveness is measured using the CCI, which accounts for the patient's body surface area and the number of platelets transfused.
The Mosteller formula is used to calculate BSA: BSA = square root of ((height × weight) / 3600)
Where:
- height is in centimeters
- weight is in kilograms
- BSA result is in square meters (m²)
CCI = ((post_count - pre_count) × 1000 × BSA) / platelet_units
Where:
- post_count: platelet count after transfusion (K/µL)
- pre_count: platelet count before transfusion (K/µL)
- BSA: body surface area (m²)
- platelet_units: number of platelets transfused (typically 3-4 x 10e11)
- CCI result is in platelets/µL
A CCI ≥ 7500 indicates an adequate response.
Expected format: MM/DD/YY HHMM to HHMM
Example: 02/15/24 0800 to 0900
javascript /(\d{2}/\d{2}/\d{2})\s+\d{4}\s+to\s+(\d{4})/g
Capture groups:
- Date (MM/DD/YY)
- End time (HHMM)
The system accepts platelet counts in two formats:
MM/DD/YY HH:MM PLT: XXX
or
MM/DD/YY HH:MM Platelets: XXX
Example:
02/15/24 07:30 PLT: 12 02/15/24 10:15 Platelets: 35
javascript /(\d{2}/\d{2}/\d{2})\s+(\d{2}):(\d{2})\n(?:PLT:|Platelets:)\s+(\d+)/g
Capture groups:
- Date (MM/DD/YY)
- Hours (HH)
- Minutes (MM)
- Count value
- Time window: 0-36 hours (tunable) before transfusion
- Closest count to transfusion start time is selected
- Must occur before transfusion start
- Time window: 1-120 minutes (tunable) after transfusion end time
- Closest count to the transfusion time is selected
- Must occur after transfusion end
- Input validation: Both parameters must be positive numbers
- Returns: BSA in meters squared
- Input validation: All parameters must be positive numbers
- Returns: CCI value
- targetDateTime: JavaScript Date object
- counts: Array of parsed count objects
- hoursRange: Number of hours to look for matches
- isPreCount: Boolean to determine pre/post count logic
- Returns: Closest matching count object or null
Success Criteria:
- CCI ≥ 7500: Adequate response
- CCI < 7500: Inadequate response
-
Patient metrics
- Weight (kg)
- Height (cm)
-
Default values
- Platelet unit content (default: 3 x 10e11)
- Min lookback time (default: 0 hours)
- Max lookback time (default: 36 hours)
- Min time after transfusion (default: 1 minute)
- Max time after transfusion (default: 120 minutes) (all of these time default values can be overridden by the user, but should be in a dropdown menu or a modal overlay or a separate input slider field)
-
Data entry
- Transfusions textarea
- Platelet counts textarea
-
Results table
- Transfusion date/time
- Pre-transfusion count
- Post-transfusion count
- Calculated CCI
- Color coding: green for adequate, red for inadequate responses
-
Summary text area
- Count of adequate vs inadequate responses
- Detailed list of each transfusion with:
- Date/time
- Pre-count
- Post-count
- Minutes after transfusion
- CCI value
-
Plot
- a scatter plot chart with date/time on the y axis
- Platelet Count on the x axis
- point plotted for each platelet count
- transfusions should have a dashed horizontal line plotted through the date/time of the transfusion
- transfusions with appropriate bumps should be highlighted with a horizontal green rectangle in the background
- transfusions with inappropriate bumps should be highlighted with a horizontal red rectangle in the background
- Numeric inputs must be positive
- Date/time formats must match expected patterns
- Missing data handled gracefully with '-' display
- Results update on input change live
- should work with any standard browser
- client side only, no server side components required
The calculator provides two views of the results:
- Enter patient weight (kg) and height (cm)
- Enter platelet unit content (default 3 × 10¹¹)
- Paste transfusion data in the format specified above
- Paste platelet count data in the format specified above
- Results will update automatically (including if any of the inputs change)
- The calculator is a static browser application with no server-side component.
- All application scripts and styles are loaded from local files in this repository, including the vendored D3 bundle.
- The application code does not intentionally transmit entered data over the network.
- The application code does not intentionally persist entered data in browser storage, cookies, IndexedDB, service workers, cache storage, or files.
- Input fields disable browser autocomplete and spellcheck to reduce unintended browser-managed retention of entered clinical text.
index.htmlincludes a restrictive Content Security Policy, includingconnect-src 'none', to block network connections from the page.