File: postscreen.cc

package info (click to toggle)
simrisc 16.05.00-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,568 kB
  • sloc: cpp: 6,877; fortran: 665; makefile: 112; ansic: 112; sh: 107
file content (71 lines) | stat: -rw-r--r-- 2,535 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#define XERR
#include "loop.ih"

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

    g_log << "\nLoop::postScreen\n";

    // C1
    if (not d_tumor.at(END_AGE))        // no tumor beyond the last screening 
    {                                   // round
        left(NATURAL_POST, d_naturalDeathAge);
        return;
    }
            // tumor beyond the last screening age: determine its
            // characteristics 
    // C2
    d_tumor.characteristicsAt(d_tumor.selfDetectAge());
    d_tumor.setDeathAge();

    if (d_tumor.selfDetectBefore(d_naturalDeathAge))
        d_caseCost += treatmentCosts(d_tumor.selfDetectAge());

    d_deathAge = min(d_naturalDeathAge, d_tumor.deathAge());

    left(
        d_tumor.selfDetectBefore(d_naturalDeathAge) ? 
            SELF_POST  : 
            d_naturalDeathAge < d_tumor.onset() ? 
                NATURAL_POST :
                UNDETECTED_POST,
        d_deathAge);
         // d_tumor.selfDetectAge());
}


////////////////////////////////////////////////////////////////////
    
//
//
//
//    // main consequence block when self-detecting a tumor after the screenings
//    // vvvvvvvvvvvvvvvvv            // there may be a tumor, detected before
//    if (                            // the woman's natural death
//        d_tumor.selfDetectable()
//        and d_tumor.selfDetectAge() < d_naturalDeathAge
//    )
//    {
//                                // this results in a tumor caused death.
//                                // (the condition check in the original
//                                //  sources is superfluous)
//        g_log << "  *** case died because of a tumor detected at age " <<
//                 d_tumor.selfDetectAge() << '\n';
//
//        d_roundDetected = d_screening.nRounds();
//        characteristics(NATURAL_POST, SELF_POST);
//    }
//    else                        // or a naturally caused death
//    {
//        //if (g_caseIdx >= g_err)xerr(g_caseIdx << " setStatus");
//        setStatus(NATURAL_POST, d_naturalDeathAge);
//        g_log << "  *** case died at natural death age " <<
//                                                d_naturalDeathAge << '\n';
//
//                                    // although the woman has died, still
//                                    // determine the tumor's characteristics
//        if (d_tumor.selfDetectable())
//            d_tumor.characteristicsAt(d_deathAge);
//    }