#define XERR
#include "loop.ih"

void Loop::postScreen()
{
//xerr("status: " << d_status);

    if (d_status != PRESENT)          // the woman has died: no further actions
        return;

//xerr("treatment cost entry: " << d_caseCost);

                                    // there may be a tumor, detected before 
                                    // the woman's natural death
    if (d_tumor.selfDetectable() and d_tumor.selfDetectAge() < d_naturalDeathAge) 
{
//xerr("treatmentDeath");
        treatmentDeath();           // this results in a tumor caused death.
                                    // (the condition check in the original
                                    //  sources is superfluous)
}
    else                            // or a naturally caused death
    {
//xerr("setStatus");
        setStatus(LEFT_POST, d_naturalDeathAge);
        
                                    // although the woman has died, still
        if (d_tumor.selfDetectable())        // determine the tumor's characteristics
            d_tumor.characteristics(d_deathAge);
    }
}




