Description
Subtract safe numeric day indexes with exact integer arithmetic, return decimal day gap and integer quotient, and aligned when the remainder is zero.
Epidemiological windows encode observation and classification rules on a timeline. Endpoint inclusion, late entry and supplied washout periods change counts, but a local timing flag does not establish infection, clinical risk or a validated case definition.
Subtract safe numeric day indexes with exact integer arithmetic, return decimal day gap and integer quotient, and aligned when the remainder is zero.
When to use this tool
Use Surveillance Week Origin Gap when you need a supplied surveillance-time or risk-window calculation.
How to use the tool and how it works
- Enter weekStartDay, referenceStartDay, daysPerWeek. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read dayGapDecimal, wholeWeeksDecimal, aligned. Inspect aligned before interpreting the associated values.
Require positive integer daysPerWeek. Subtract safe numeric day indexes with exact integer arithmetic, return decimal day gap and integer quotient, and aligned when the remainder is zero.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| weekStartDay | Week Start Day | Required. Safe integer. |
| referenceStartDay | Reference Start Day | Required. Safe integer. |
| daysPerWeek | Days Per Week | Required. Safe integer; minimum 1. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| dayGapDecimal | Day Gap Decimal | Required. Text; maximum UTF-16 length 8192. |
| wholeWeeksDecimal | Exact integer quotient truncated toward zero, not floor for negative gaps. | Required. Text; maximum UTF-16 length 8192. |
| aligned | Aligned | Required. Boolean. |
{
"input": {
"weekStartDay": 21,
"referenceStartDay": 7,
"daysPerWeek": 7
},
"output": {
"dayGapDecimal": "14",
"wholeWeeksDecimal": "2",
"aligned": true
}
} Limitations and assumptions
- BigInt division truncates toward zero for negative nonmultiples, not floor. Numeric day coordinates and week length are supplied, without ISO-week or calendar interpretation.
- 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
Apply the appropriate study protocol or public-health definition to verified records. Resolve calendar, clock, follow-up and censoring conventions before interpreting timing as epidemiological evidence.
References
Similar or alternative tools
- Surveillance Reporting Delay One Case
Return report-minus-onset seconds minus timezoneOffsetDifferenceSeconds, then divide by 86400 for delayDays.
- Sentinel Report Missing Week Mask
Return missing expected and unexpected reported tokens, and complete when no expected week is missing.