The internal circuitry related to DC leads off check (except the resistor Rpatient , which is external) is shown in the figure below.
A DC Leads off condition is detected when the outputs of Comparators Comp1 and Comp2 go High, i.e. the Rpatient value is large enough that ECGP > VTHH , and ECGN < VTHL.
The Rpatient value above which a DC Leads OFF condtion is detected can be calculated as :
Rpatient = ( VTHH - VTHL ) / ( IMAG - 0.5*(VTHH - VTHL)/RBIAS )
The values for VTHH, VTHL, IMAG and RBIAS can be selected through configuration registers described in the datasheet.