Test Based Isolation Release
Find the first day meeting a caller-defined consecutive-negative test policy; not a recommendation to end isolation.
Description
Find the first recorded day satisfying a supplied earliest-day and consecutive-negative test rule, with explicit unmet-criterion outputs.
A test-based isolation rule can combine an earliest eligible time with a required sequence of negative results. Such a rule needs a defined day-zero reference, test interpretation, and eligibility criteria. Infection-control decisions also depend on the pathogen, setting, symptoms, immune status, and the timing of specimens; a sequence of test results alone does not represent all of those conditions.1
In this tool, a negative flag of 1 means the corresponding recorded result is negative; 0 means it does not count as negative. Consecutive means adjacent entries in the submitted series, not consecutive calendar days. An entry before the earliest eligible day or a flag of 0 resets the qualifying run.
Test Based Isolation Release scans a supplied history for the first record meeting your numeric rule. It returns that record’s day and whether the criterion was met. The tool contains no built-in disease policy and does not recommend ending isolation.
When to audit a supplied consecutive-negative rule
Use this tool to reproduce a defined rule over an ordered test log or explore synthetic examples. Establish the eligibility day, negative-result convention, and required count outside the calculator before entering the records.
- Find the first completion of a qualifying run in a historical test series.
- Check whether a nonnegative result interrupts an otherwise qualifying sequence.
- Distinguish an unmet criterion from malformed input.
How to enter a test history and scan for the first qualifying day
- Enter Test days as a nonempty, strictly increasing list of nonnegative elapsed days using one shared day-zero reference.
- Enter an equally long Negative flags list, with 1 for negative and 0 for each result that does not count as negative.
- Enter a nonnegative Earliest eligible day and a positive integer Required consecutive negatives.
- Run the tool. If Criterion met is true, read First eligible release day as the record completing the run; if false, that day output is −1.
The implementation first checks list alignment, increasing test days, binary flags, and eligibility/count bounds. It then starts a run counter at zero and scans the records in order. A negative at or after the eligibility day increments the counter; every other record resets it to zero. The scan stops immediately when the counter reaches the required count.
run = (testDay ≥ earliestEligibleDay AND negativeFlag = 1) ? run + 1 : 0 The returned day is the first record where run reaches requiredConsecutiveNegatives. No future record is needed to produce that first match.
{
"input": {
"testDays": [
2,
4,
6,
8
],
"negativeFlags": [
0,
1,
1,
1
],
"earliestEligibleDay": 4,
"requiredConsecutiveNegatives": 2
},
"output": {
"firstEligibleReleaseDay": 6,
"criterionMet": true
}
} {
"input": {
"testDays": [
2,
4,
6
],
"negativeFlags": [
1,
1,
0
],
"earliestEligibleDay": 4,
"requiredConsecutiveNegatives": 2
},
"output": {
"firstEligibleReleaseDay": -1,
"criterionMet": false
}
} | Boundary or condition | Behavior |
|---|---|
| A negative exactly on the earliest eligible day | Counts toward the run. |
| Negatives before eligibility | Do not count toward the eligible run. |
| Large or fractional gaps between increasing test days | Accepted; no minimum or maximum spacing is enforced. |
| Duplicate days, decreasing days, or unequal list lengths | Input error, rather than criterionMet = false. |
Limitations of a caller-defined isolation rule
- The tool does not choose policy parameters, validate a clinical policy, evaluate symptoms, or determine infectiousness.
- It enforces chronological order but no specimen-spacing interval. Required timing must be checked separately.
- It cannot identify omitted records, test type, specimen quality, or assay accuracy. A flag of 0 may represent any caller-defined nonnegative category.
- Only the earliest qualifying record is returned. A later nonnegative record does not revise that historical first match.
Alternative or Complementary timing and test interpretation
Before applying a real policy, check its applicable setting, symptom conditions, and specimen timing in the current guidance. Those requirements are outside this numeric scan. A separate time-window calculation can audit supplied elapsed-time criteria, and predictive-value calculations can explore test interpretation under specified sensitivity, specificity, and prevalence.
References
-
Infection Control Guidance: SARS-CoV-2, including test-based strategy considerations — Centers for Disease Control and Prevention
Similar or alternative tools
- Exposure Quarantine Window
Calculate a caller-defined post-exposure end day and whether its time window has elapsed; this is a different rule.
- Prevalence Predictive Values
Calculate positive and negative predictive values under supplied test-performance and prevalence assumptions.