Data Management

Check Research Dates Before Calculating Follow-Up

Define the time variable you need

A date of enrollment, a specimen timestamp, and a reported month of symptom onset have different precision. Write down whether the analysis needs calendar dates, exact elapsed time, or a permitted visit window. Do not invent day-level precision when the source records only a month.

Preserve the original text alongside a parsed value and a status field. That separation lets reviewers distinguish a valid source value from a correction, an unresolved ambiguity, or an explicitly imputed date.

Parse with a stated format

A string such as 03/04/2026 is ambiguous without a format convention. Confirm the source system's format and specify it when parsing rather than guessing from individual rows. Reject impossible dates and report them for review instead of quietly converting every parsing failure to missing.

The official pandas date-conversion documentation documents explicit formats, error handling, and time-zone behavior. Its options illustrate why successful software parsing does not itself establish that a date has the intended meaning.

Test intervals with fictional records

For two date-only records, 1 October 2026 to 31 October 2026 is 30 elapsed days. Counting both endpoint calendar dates gives 31 dates. Decide which convention matches the protocol before using the derived number. Neither convention should be selected afterward to place a visit inside a preferred window.

For timestamps, record their time zones and distinguish a local calendar-day difference from elapsed hours. Across a clock change, one local day need not equal 24 elapsed hours. Avoid converting a date-only field through a time zone in a way that shifts its calendar date.

Build an exception report

Flag impossible orderings, such as a follow-up measurement recorded before the applicable enrollment date, and dates after the extract cutoff. Use study-specific bounds rather than assuming every unusual interval is an error. A transferred record or retrospective measurement may have a valid explanation that should remain documented.

Check partial dates, missing stop dates, repeated timestamps, and records with mixed precision. Ask whether a date identifies the event, entry into the database, specimen collection, or result authorization; these are not interchangeable substitutes.

Retain a short test set with known intervals, leap-day examples, and ambiguous inputs. Re-run it when parsing rules change. Finish with an interval dictionary stating the origin, stop event, units, boundary convention, time-zone policy, and handling of uncertainty. Downstream survival or person-time calculations should use these reviewed fields rather than independently reparsing the raw text.

Source checked on 31 October 2026; fictional date interval independently recalculated.

Related Articles

Data Management

Audit Join Cardinality Before Merging Research Tables

Detect duplicate keys and unintended row multiplication before joining participant, visit, and laboratory data.

10/31/2026•3 min read

Data Management

Harmonize Measurement Units Without Losing Provenance

Create a traceable conversion map and verify units, scale factors, and summary statistics before combining data.

10/31/2026•3 min read