Research Workflow
Combine Range Checks with Cross-Field Consistency Rules
Distinguish impossible from unusual
A range check asks whether a value falls inside declared limits. A cross-field check asks whether several values can coexist under the study’s definitions. Both are useful, but neither should automatically label every flagged record as erroneous. Some limits are hard logical constraints; others are review thresholds that require context.
The pandas interval-check documentation makes endpoint inclusion explicit. Match that computational detail to the written rule. A value exactly at the maximum should not alternate between accepted and rejected because different scripts use different inequalities.
Write rules as testable statements
Give each rule an identifier, applicable population, required fields, logical expression and action. For example, an event date cannot precede the eligibility date when the outcome is defined as incident after enrollment. A missing end date may mean ongoing follow-up rather than a contradiction.
Specify what happens when an input is missing. A comparison returning false or unavailable should not be silently interpreted as a passed check. Distinguish passed, failed and not evaluable statuses, and preserve the fields needed for investigation.
Audit a hypothetical count table
Suppose a site reports 100 eligible records, 92 observed outcomes and eight missing outcomes. The partition rule 100 = 92 + 8 passes. A second site reports 80 eligible, 75 observed and ten missing; 75 + 10 = 85, so the rule fails even though each count individually lies between zero and 100.
The discrepancy does not reveal which number is wrong. Perhaps the missing count includes five ineligible people, or the eligible count uses a different cutoff. Send a focused query about the shared population and date rather than subtracting five from a convenient field.
Resolve without destroying evidence
Store the original value, query, evidence, approved correction and rule rerun result. If a value is confirmed as unusual but valid, retain it with a resolution note. Avoid repeatedly flagging a resolved case without distinguishing new data from the previously reviewed value.
Summarize rule failures by site, release and variable to identify systematic problems. A sudden increase may indicate an export change rather than a change in participants. The final quality report should show which checks ran, how many records were not evaluable, and what remains unresolved. Passing checks establishes consistency with the specified rules; it cannot certify that every value is true.
Source verification: 6 November 2026. Examples are hypothetical.