Description
Return adjacent gaps, indexes whose gap strictly exceeds the maximum, and longestGap or zero for one record.
Pharmacy traceability and monitoring records contain versions, time gaps, release flags, and ledger entries. Consistent metadata is useful evidence but does not establish product stability, correct preparation, or authorized release.
Return adjacent gaps, indexes whose gap strictly exceeds the maximum, and longestGap or zero for one record.
When to use this tool
Use Hospital Pharmacy Cold Chain Record Gap when you need a narrow pharmacy-record consistency check.
How to use the tool and how it works
- Enter times, maximumGap. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read gaps, exceededIndices, longestGap. Use the output convention below.
Require a nonempty strictly increasing times array and nonnegative maximumGap. Return adjacent gaps, indexes whose gap strictly exceeds the maximum, and longestGap or zero for one record.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| times | Times | Required. Array of finite number; maximum items 256. |
| maximumGap | Maximum Gap | Required. Finite number. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| gaps | Gaps | Required. Array of finite number; maximum items 256. |
| exceededIndices | Zero-based indexes of left endpoints whose next-record gap exceeds maximumGap. | Required. Array of safe integer; maximum items 256. |
| longestGap | Longest Gap | Required. Finite number. |
{
"input": {
"times": [
0,
5,
20,
25
],
"maximumGap": 10
},
"output": {
"gaps": [
5,
15,
5
],
"exceededIndices": [
1
],
"longestGap": 15
}
} Limitations and assumptions
- Indexes refer to the left endpoint of each gap; time units match the supplied limit. Sampling continuity does not establish temperatures stayed acceptable or products retained stability.
- 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.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Review the complete quality and traceability record through the responsible pharmacy process before acting on a discrepancy.
References
Similar or alternative tools
- Cold Chain Time Window Share
Return their ratio with defined true for positive recordedDuration, otherwise share zero with defined false.
- Expiry Reference Day Offset
Parse real Gregorian expiryDate and referenceDate and return expiry minus reference in calendar days.