Description
Return daysFromStart and daysToEnd as UTC day differences, and sourceCoversDate with an inclusive start and end controlled by endInclusive.
Drug-utilization research often reconstructs exposure from dispensing dates, supplied coverage windows, coding systems, and eligibility records. Day counts depend on endpoint and stockpiling policies. Observed records, assumed exposure, and actual medication consumption are different quantities.
Return daysFromStart and daysToEnd as UTC day differences, and sourceCoversDate with an inclusive start and end controlled by endInclusive.
When to use this tool
Use Dispensing Source Period Gap when you need this explicit exposure-record, date-window, reporting-base, or evidence-support calculation.
How to use the tool and how it works
- Enter dispensingDate, sourceStartDate, sourceEndDate, endInclusive. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read daysFromStart, daysToEnd, sourceCoversDate. Inspect sourceCoversDate before interpreting the associated values.
Parse dispensingDate, sourceStartDate, and sourceEndDate as real YYYY-MM-DD calendar dates and require an ordered source interval. Return daysFromStart and daysToEnd as UTC day differences, and sourceCoversDate with an inclusive start and end controlled by endInclusive.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| dispensingDate | Dispensing Date | Required. Text; maximum UTF-16 length 8192. |
| sourceStartDate | Source Start Date | Required. Text; maximum UTF-16 length 8192. |
| sourceEndDate | Source End Date | Required. Text; maximum UTF-16 length 8192. |
| endInclusive | Include sourceEndDate when true; start is always included. | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| daysFromStart | Days From Start | Required. Safe integer. |
| daysToEnd | Days To End | Required. Safe integer. |
| sourceCoversDate | Source Covers Date | Required. Boolean. |
{
"input": {
"dispensingDate": "2024-01-05",
"sourceStartDate": "2024-01-01",
"sourceEndDate": "2024-01-10",
"endInclusive": false
},
"output": {
"daysFromStart": 4,
"daysToEnd": 5,
"sourceCoversDate": true
}
} Limitations and assumptions
- Dates have day precision without time zones or times of day. Coverage only concerns the supplied date range and does not authenticate the source or a dispensing event.
- 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.
Alternative or Complementary methods
Choose a documented exposure and eligibility definition for the study before combining records. Verify the coding version, observation windows, endpoint convention, and the evidence for assumptions about carried supply.
References
Similar or alternative tools
- Refill Gap Day Closure Policy
Count supplied administrative refill-gap day endpoints without inferring medication use or adherence.
- Observation Window Stockpile Offset
Apply a supplied stockpile-day scenario and observation censor boundary without inferring adherence or prescribing.