void DiagnosticTreatNeg::Update( float dt )
    {
        //bool wasDistributed = false;
        if ( expired )
        {
            return; // don't give expired intervention.  should be cleaned up elsewhere anyways, though.
        }

        // You have already been chosen to not default, count down the time until your intervention
        days_to_diagnosis -= dt;
        LOG_DEBUG_F( "Individual %d will not default and has a diagnosis but has %f more days until the intervention is distributed.\n", parent->GetSuid().data, float(days_to_diagnosis) );

        // Give the intervention if the test has come back
        if( days_to_diagnosis <= 0 )
        {
            LOG_DEBUG_F("Individual %d finished counting down days_to_diagnosis, my treatment outcome flag is %d \n", parent->GetSuid().data, m_gets_positive_test_intervention);

            if (m_gets_positive_test_intervention)
            {
                positiveTestDistribute();
            }
            else
            {
                negativeTestDistribute();
            }
        }
    }
 void HIVSimpleDiagnostic::ActOnResultsIfTime()
 {
     // This can happen immediately if days_to_diagnosis is initialized to zero.
     if ( days_to_diagnosis <= 0 )
     {
         if( result_of_positive_test )
         {
             LOG_DEBUG_F( "Individual %d tested positive.\n", parent->GetSuid().data );
             if( SMART_DRAW( treatment_fraction ) )
             {
                 positiveTestDistribute();
             }
             else
             {
                 // this person doesn't get the positive test result
                 // because they defaulted / don't want treatment
                 onPatientDefault();
                 expired = true;
             }
         }
         else
         {
             LOG_DEBUG_F( "Individual %d tested negative.\n", parent->GetSuid().data );
             onNegativeTestResult();
         }
     }
 }
Beispiel #3
0
    void DiagnosticTreatNeg::onDiagnosisComplete( float dt )
    {
        // Give the intervention if the test has come back
        LOG_DEBUG_F("Individual %d finished counting down days_to_diagnosis, my treatment outcome flag is %d \n", parent->GetSuid().data, m_gets_positive_test_intervention);

        if (m_gets_positive_test_intervention)
        {
            positiveTestDistribute();
        }
        else
        {
            negativeTestDistribute();
        }
    }