Skip to content

Main content

Dispensing Source Period Gap Tool

Calculate dispensing source period gap from explicit caller-supplied inputs.

Loading tool…

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

  1. Enter dispensingDate, sourceStartDate, sourceEndDate, endInclusive. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
dispensingDateDispensing DateRequired. Text; maximum UTF-16 length 8192.
sourceStartDateSource Start DateRequired. Text; maximum UTF-16 length 8192.
sourceEndDateSource End DateRequired. Text; maximum UTF-16 length 8192.
endInclusiveInclude sourceEndDate when true; start is always included.Required. Boolean.
Output fieldInterpretationReturned shape
daysFromStartDays From StartRequired. Safe integer.
daysToEndDays To EndRequired. Safe integer.
sourceCoversDateSource Covers DateRequired. Boolean.
json
{
  "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

  1. Calculation and input contract: pharmacoepidemiology/dispensing-source-period-gap — tool.io

Similar or alternative tools