diff --git a/src/hiv.c b/src/hiv.c index 945cd6e..52a7e04 100644 --- a/src/hiv.c +++ b/src/hiv.c @@ -2270,9 +2270,8 @@ void draw_hiv_tests(parameters *param, age_list_struct *age_list, int year, for(aa = 0; aa < MAX_AGE - AGE_ADULT; aa++){ // For each individual in that annual age group, schedule their first HIV test for(k = 0; k < age_list->age_list_by_gender[g]->number_per_age_group[aa]; k++){ - - // Only schedule tests for people who are not "HIV+ and aware of serostatus" - if(age_list->age_list_by_gender[g]->age_group[aa][k]->ART_status == ARTNEG){ + // Only schedule tests for people who are not "HIV+ and aware of serostatus" or, after UTT implemented, for everyone including dropouts + if(age_list->age_list_by_gender[g]->age_group[aa][k]->ART_status == ARTNEG || (year<= param->COUNTRY_IMMEDIATE_ART_START && age_list->age_list_by_gender[g]->age_group[aa][k]->ART_status == ARTDROPOUT)){ schedule_hiv_test_fixedtime(age_list->age_list_by_gender[g]->age_group[aa][k], param, year, cascade_events, n_cascade_events, size_cascade_events, @@ -2508,17 +2507,12 @@ void probability_get_hiv_test_in_next_window(double *p_test, double *t_gap, int printf("probability_get_hiv_test_in_next_window() "); printf("called before start of HIV testing.\n"); } - - if(year == COUNTRY_HIV_TEST_START){ - /* This refers to the period [COUNTRY_HIV_TEST_START, 2006]. */ - p_test[MALE] = param->p_HIV_background_testing_female_pre2006 * param->RR_HIV_background_testing_male; - p_test[FEMALE] = param->p_HIV_background_testing_female_pre2006; - *t_gap = 2006 - COUNTRY_HIV_TEST_START; - }else{ - p_test[MALE] = param->p_HIV_background_testing_female_current*param->RR_HIV_background_testing_male; - p_test[FEMALE] = param->p_HIV_background_testing_female_current; - *t_gap = 1; - } + //Assume that testing follows a simple exponential curve with saturation (DHS Zambia) + p_test[FEMALE] = param -> endpoint_background_testing_rate* (1-exp(-param ->shape_background_testing_rate*(year+1-COUNTRY_HIV_TEST_START))); + p_test[MALE] = p_test[FEMALE]*param->RR_HIV_background_testing_male; + //ßprintf("this is p_test[Female] = %f\n", p_test[FEMALE]); + *t_gap=1; + } diff --git a/src/input.c b/src/input.c index 0e3c8d0..c2c64f9 100644 --- a/src/input.c +++ b/src/input.c @@ -1054,11 +1054,11 @@ void read_cascade_params(char *patch_tag, parameters *allrunparameters, int n_ru check_if_cannot_read_param(checkreadok,"param_local->time_to_background_HIVtest_midpoint"); /* Input probabilities for the cascade events: */ - checkreadok = fscanf(param_file,"%lg",&(param_local->p_HIV_background_testing_female_pre2006)); - check_if_cannot_read_param(checkreadok,"param_local->p_HIV_background_testing_female_pre2006"); + checkreadok = fscanf(param_file,"%lg",&(param_local->shape_background_testing_rate)); + check_if_cannot_read_param(checkreadok,"param_local->shape_background_testing_rate"); - checkreadok = fscanf(param_file,"%lg",&(param_local->p_HIV_background_testing_female_current)); - check_if_cannot_read_param(checkreadok,"param_local->p_HIV_background_testing_female_current"); + checkreadok = fscanf(param_file,"%lg",&(param_local->endpoint_background_testing_rate)); + check_if_cannot_read_param(checkreadok,"param_local->endpoint_background_testing_rate"); checkreadok = fscanf(param_file,"%lg",&(param_local->RR_HIV_background_testing_male)); check_if_cannot_read_param(checkreadok,"param_local->RR_HIV_background_testing_male"); diff --git a/src/structures.h b/src/structures.h index 82dc454..7c68b6a 100644 --- a/src/structures.h +++ b/src/structures.h @@ -349,8 +349,8 @@ typedef struct { /* Cascade probabilities: */ - double p_HIV_background_testing_female_pre2006; /* Baseline probability of a women having an HIV test in the background cascade from start of HIV testing until 2006. */ - double p_HIV_background_testing_female_current; /* Baseline annual probability of a women having an annual test in the background cascade. */ + double endpoint_background_testing_rate; /* ending testing rate for background cascade */ + double shape_background_testing_rate; /* shape of rate pacing in the cascade. */ double RR_HIV_background_testing_male; /* Decrease in annual probability of an HIV test for men (cp to women) so we can fit VS in PC24. */ double HIV_rapid_test_sensitivity_CHIPS; /* Represents the sensitivity of the rapid HIV test used by CHiPs. We might want this to be time-varying (to reflect better training/test kits used later in trial). */