cascade_of_care
CascadeState
String constants for the IndividualProperty values that track each person's position in the HIV care cascade.
These values are assigned to the CascadeState individual property. Campaign events use them via
PropertyRestrictions (to target individuals in a specific state) and PropertyValueChanger (to move
individuals from one state to another). Use these constants rather than raw strings so that typos
produce an AttributeError rather than a silently misconfigured simulation.
Example
from emodpy_hiv.campaign.cascade_of_care import CascadeState from emodpy_hiv.campaign.common import PropertyRestrictions
Target only individuals currently on ART
restrictions = PropertyRestrictions(restrictions=[[{"CascadeState": CascadeState.ON_ART}]])
Source code in emodpy_hiv/campaign/cascade_of_care.py
CustomEvent
User-defined individual event names for the HIV care cascade.
In EMOD, individual events are acknowledgements that something has happened to an agent —
they are broadcast by interventions or the model itself and listened to by other interventions
and reports. This class defines the user-defined individual event names used by the cascade
of care; built-in individual event names are listed in the event list parameter reference
(docs/emod/parameter-campaign-event-list.md).
The cascade of care is implemented as a chain of broadcaster/listener pairs: each intervention broadcasts one of these events when complete, triggering the next intervention in the chain. Use these constants instead of raw strings to avoid silent misconfiguration from typos.
Example
from emodpy_hiv.campaign.cascade_of_care import CustomEvent add_intervention_triggered(campaign, trigger_condition_list=[CustomEvent.ART_STAGING], ...)
Source code in emodpy_hiv/campaign/cascade_of_care.py
add_ART_cascade(campaign, art_cascade_node_ids=None, art_cascade_start_year=1990, art_cascade_pre_staging_retention=0.85, art_cascade_cd4_retention_rate=1, art_cascade_pre_art_retention=0.75, art_cascade_immediate_art_rate=0.1, art_cascade_art_reenrollment_willingness=0.9, tvmap_increased_symptomatic_presentation=all_negative_time_value_map, tvmap_immediate_ART_restart=all_negative_time_value_map, tvmap_reconsider_lost_forever=all_negative_time_value_map)
Manages the addition of Antiretroviral Therapy (ART) cascade in the campaign.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign to which the ART cascade is to be added. |
required |
art_cascade_node_ids
|
List[int]
|
A list of node IDs where the ART cascade is to be applied. If None, the ART cascade applies to all nodes. Defaults to None. |
None
|
art_cascade_start_year
|
float
|
The start year for the ART cascade. Defaults to 1990. |
1990
|
art_cascade_pre_staging_retention
|
float
|
The retention rate before ART staging. Defaults to 0.85. |
0.85
|
art_cascade_cd4_retention_rate
|
float
|
The retention rate for CD4 count. Defaults to 1. |
1
|
art_cascade_pre_art_retention
|
float
|
The retention rate before ART. Defaults to 0.75. |
0.75
|
art_cascade_immediate_art_rate
|
float
|
The rate for immediate ART. Defaults to 0.1. |
0.1
|
art_cascade_art_reenrollment_willingness
|
float
|
The willingness rate for ART reenrollment. Defaults to 0.9. |
0.9
|
tvmap_increased_symptomatic_presentation
|
dict
|
A dictionary containing time-value map for increased symptomatic presentation in TestingOnSymptomatic state. Defaults to all_negative_time_value_map. |
all_negative_time_value_map
|
tvmap_immediate_ART_restart
|
dict
|
A dictionary containing time-value map for immediate ART restart in OnART state. Defaults to all_negative_time_value_map. |
all_negative_time_value_map
|
tvmap_reconsider_lost_forever
|
dict
|
A dictionary containing time-value map for reconsidering lost forever in LostForever state. Defaults to all_negative_time_value_map. |
all_negative_time_value_map
|
Returns:
Example
add_ART_cascade(campaign, art_cascade_node_ids=[1, 2, 3], art_cascade_start_year=1995, art_cascade_pre_staging_retention=0.8, art_cascade_cd4_retention_rate=0.9, art_cascade_pre_art_retention=0.7, art_cascade_immediate_art_rate=0.15, art_cascade_art_reenrollment_willingness=0.85)
Source code in emodpy_hiv/campaign/cascade_of_care.py
805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 | |
add_csw(campaign, node_ids=None, male_uptake_coverage=0.03, female_uptake_coverage=0.03)
Manages commercial sex worker (CSW) uptake and dropout (with delays) for men and women.
Setting a few women to Risk=HIGH and significantly more men to Risk=HIGH makes the women the sex workers and the men the sex clients. Supply and demand cause the females to have lots of relationships with the men that are also Risk=HIGH. The women have lots of relationships because so many men want them, but the scarcity of the women allow the men to have only a few.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign to which the CSW management is to be added. |
required |
node_ids
|
List[int]
|
A list of node IDs where the CSW management is to be applied. Defaults to None, which applies to all nodes. |
None
|
male_uptake_coverage
|
float
|
The coverage of CSW uptake among males. Defaults to 0.03. |
0.03
|
female_uptake_coverage
|
float
|
The coverage of CSW uptake among females. Defaults to 0.03. |
0.03
|
Returns:
Example
add_csw(campaign, node_ids=[1, 2, 3], male_uptake_coverage=0.05, female_uptake_coverage=0.04)
Source code in emodpy_hiv/campaign/cascade_of_care.py
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | |
add_health_care_testing(campaign, hct_node_ids=None, hct_start_year=1990, hct_reentry_rate=1, hct_retention_rate=0.95, hct_delay_to_next_test=None, hct_delay_to_next_test_node_ids=None, hct_delay_to_next_test_node_names=None, tvmap_test_for_enter_HCT_testing_loop=all_negative_time_value_map, tvmap_consider_immediate_ART=all_negative_time_value_map)
Manages the addition of health care testing in the campaign.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign to which the health care testing is to be added. |
required |
hct_node_ids
|
List[int]
|
A list of node IDs where the health care testing is to be applied. Defaults to None, which applies to all nodes. |
None
|
hct_start_year
|
float
|
The start year for health care testing. Defaults to 1990. |
1990
|
hct_reentry_rate
|
float
|
The reentry rate for health care testing. Defaults to 1. |
1
|
hct_retention_rate
|
float
|
The retention rate for health care testing. Defaults to 0.95. |
0.95
|
hct_delay_to_next_test
|
Union[int, List[int]]
|
The delay to the next test in days. If it's a list, it will add different delays(using HIVMuxer) for different node sets which are defined in hct_delay_to_next_test_node_ids. If it's a single value, it will apply the same delay to all nodes in hct_node_ids. Defaults to None, which will apply the Zambia model default values: [730, 365, 1100]. |
None
|
hct_delay_to_next_test_node_ids
|
List[int]
|
A list of node sets where the different delays will be applied. It's used when hct_delay_to_next_test is a list. Defaults to None, which will apply the Zambia model default values: [[1, 2, 3, 4, 6, 7], [5, 9, 10], [8]]. |
None
|
hct_delay_to_next_test_node_names
|
List[str]
|
A list of node set names where the different delays will be applied. It's used when hct_delay_to_next_test is a list. Defaults to None, which will apply the Zambia model default values: ['Default', 'Lusaka, Southern, Western', 'Northern']. |
None
|
tvmap_test_for_enter_HCT_testing_loop
|
dict
|
A dictionary containing time-value map for testing for entering HCT testing loop in HCTUptakePostDebut state. Defaults to all_negative_time_value_map. |
all_negative_time_value_map
|
tvmap_consider_immediate_ART
|
dict
|
A dictionary containing time-value map for considering immediate ART in HCTTestingLoop state. Defaults to all_negative_time_value_map. |
all_negative_time_value_map
|
Returns:
Example
add_health_care_testing( campaign, hct_node_ids=[1, 2, 3], hct_start_year=1995, hct_reentry_rate=0.9, hct_retention_rate=0.85, hct_delay_to_next_test=365 )
Source code in emodpy_hiv/campaign/cascade_of_care.py
718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 | |
add_historical_vmmc_nchooser(campaign, historical_vmmc_distributions_by_time, historical_vmmc_reduced_acquire=0.6, historical_vmmc_property_restrictions=None, historical_vmmc_node_ids=None, has_intervention_name_exclusion=ANY_MC, event_name='nchooser of VMMC')
Adds voluntary male medical circumcision (VMMC) with NChooser coordinator to the campaign. This is used to add historical VMMC events to the campaign.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign to which the historical VMMC management is to be added. |
required |
historical_vmmc_distributions_by_time
|
DataFrame
|
A DataFrame containing the distributions of historical VMMC by time. |
required |
historical_vmmc_reduced_acquire
|
float
|
The reduced acquire rate for historical VMMC. Defaults to 0.6. |
0.6
|
historical_vmmc_property_restrictions
|
List[str]
|
A list of property restrictions for historical VMMC. Defaults to None. |
None
|
historical_vmmc_node_ids
|
List[int]
|
A list of node IDs where the historical VMMC management is to be applied. Defaults to None, which applies to all nodes. |
None
|
has_intervention_name_exclusion
|
str
|
The name of the intervention to look for in an individual when targeting specific disease states. It's also the Intervention_Name of the MaleCircumcision intervention. Defaults to ANY_MC, to match the intervention name in add_traditional_vmmc() and add_vmmc_reference_tracking(). |
ANY_MC
|
event_name
|
str
|
The name of the event. Defaults to 'nchooser of VMMC'. |
'nchooser of VMMC'
|
Returns:
Example
data = {'year': [2010, 2010, 2011, 2011], 'min_age': [1, 15, 1, 15], 'max_age': [14.999, 49.999, 14.999, 49.999], 'n_circumcisions': [200, 1300, 290, 1490]} historical_vmmc_distributions_by_time = pd.DataFrame.from_dict(data) add_historical_vmmc_nchooser(campaign, historical_vmmc_distributions_by_time=historical_vmmc_distributions_by_time, historical_vmmc_reduced_acquire=0.5, historical_vmmc_property_restrictions=None, historical_vmmc_node_ids=[1, 2, 3], has_intervention_name_exclusion=ANY_MC)
Source code in emodpy_hiv/campaign/cascade_of_care.py
add_pmtct(campaign, child_testing_time_value_map, child_testing_start_year=2004, node_ids=None, coverage=1.0, start_year=1990, sigmoid_min=0, sigmoid_max=0.975, sigmoid_midyear=2005.87, sigmoid_rate=0.7136, link_to_ART_rate=0.8, treatment_a_efficacy=0.9, treatment_b_efficacy=0.96667, sdNVP_efficacy=0.66)
Manages the addition of prevention of mother-to-child transmission (PMTCT) in the campaign.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign to which the PMTCT management is to be added. |
required |
child_testing_time_value_map
|
dict
|
A dictionary containing time-value map for child testing. |
required |
child_testing_start_year
|
float
|
The start year for child testing. Defaults to 2004. |
2004
|
node_ids
|
List[int]
|
A list of node IDs where the PMTCT management is to be applied. Defaults to None, which applies to all nodes. |
None
|
coverage
|
float
|
The coverage of PMTCT among the population. Defaults to 1.0. |
1.0
|
start_year
|
float
|
The start year for PMTCT. Defaults to 1990. |
1990
|
sigmoid_min
|
float
|
The minimum value for the sigmoid ramp. Defaults to 0. |
0
|
sigmoid_max
|
float
|
The maximum value for the sigmoid ramp. Defaults to 0.975. |
0.975
|
sigmoid_midyear
|
float
|
The midyear for the sigmoid ramp. Defaults to 2005.87. |
2005.87
|
sigmoid_rate
|
float
|
The rate for the sigmoid ramp. Defaults to 0.7136. |
0.7136
|
link_to_ART_rate
|
float
|
The rate for linking to ART. Defaults to 0.8. |
0.8
|
treatment_a_efficacy
|
float
|
The efficacy of treatment A. Defaults to 0.9. |
0.9
|
treatment_b_efficacy
|
float
|
The efficacy of treatment B. Defaults to 0.96667. |
0.96667
|
sdNVP_efficacy
|
float
|
The efficacy of Single-Dose Nevirapine (sdNVP). Defaults to 0.66. |
0.66
|
Returns:
Example
add_pmtct(campaign, child_testing_time_value_map={"Times": [2002, 2010.5, 2013.95], "Values": [200, 350, 500]}, node_ids=[1, 2, 3], coverage=0.8, start_year=1995, sigmoid_min=0.1, sigmoid_max=0.9, sigmoid_midyear=2005, sigmoid_rate=0.7, link_to_ART_rate=0.85, treatment_a_efficacy=0.92, treatment_b_efficacy=0.96, sdNVP_efficacy=0.7)
Source code in emodpy_hiv/campaign/cascade_of_care.py
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 | |
add_post_debut_coinfection(campaign, coinfection_node_ids=None, coinfection_coverage=0.3, coinfection_gender=TargetGender.ALL, coinfection_IP='Risk:HIGH')
Manages the addition of co-infections post sexual debut in the campaign.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign to which the co-infection management is to be added. |
required |
coinfection_node_ids
|
List[int]
|
A list of node IDs where the co-infection management is to be applied. Defaults to None, which applies to all nodes. |
None
|
coinfection_coverage
|
float
|
The coverage of co-infection among the population. Defaults to 0.3. |
0.3
|
coinfection_gender
|
str
|
A TargetGender object which define the gender to which the co-infection management is to be applied. Please see emodpy.campaign.common.TargetGender for details. Default to TargetGender.ALL. |
ALL
|
coinfection_IP
|
Union[List[str], str]
|
The individual properties to which the co-infection management is to be applied. Defaults to "Risk:HIGH". |
'Risk:HIGH'
|
Returns:
Example
add_post_debut_coinfection(campaign, coinfection_node_ids=[1, 2, 3], coinfection_coverage=0.4, coinfection_gender='Male', coinfection_IP="Risk:MEDIUM")
Source code in emodpy_hiv/campaign/cascade_of_care.py
add_state_ARTStaging(campaign, cd4_retention_rate, pre_staging_retention, node_ids, disqualifying_properties, start_year)
This function manages the addition of the ART Staging state in the campaign.
This state is initially triggered by the ART_STAGING_TRIGGER_1 and ART_STAGING_TRIGGER_2 events. Upon activation, it conducts a series of interventions and diagnostics, including blood draw, ART eligibility check, and CD4 count check. Depending on the results of these checks, the function can trigger transitions to several different states.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign to which the state is added. |
required |
cd4_retention_rate
|
float
|
The retention rate for CD4. |
required |
pre_staging_retention
|
float
|
The retention rate before staging. |
required |
node_ids
|
Union[List[int], None]
|
A list of node IDs where the state is to be applied. If None, the state is applied to all nodes. |
required |
disqualifying_properties
|
List[str]
|
A list of properties that disqualify an individual from the state. |
required |
start_year
|
float
|
The start year for the state. |
required |
Returns:
| Type | Description |
|---|---|
(str, str, str, str)
|
The triggers for the LinkingToART, LinkingToPreART, HCTUptakePostDebut states for individuals who are not eligible for ART from the randomchoice, and HCTUptakePostDebut state for individuals who are lost to follow-up (LTFU). |
Source code in emodpy_hiv/campaign/cascade_of_care.py
1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 | |
add_state_ARTStagingDiagnosticTest(campaign, node_ids, disqualifying_properties, start_year)
This function manages the addition of ART Staging Diagnostic Test in the campaign.
This state is triggered by the ART_STAGING_DIAGNOSTIC_TEST_TRIGGER event. Upon activation, it conducts an HIV rapid diagnostic test on individuals who present with symptoms. If the test result is positive, it triggers the transition to the ARTStaging state using the ART_STAGING_TRIGGER_1 event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign to which the state is added. |
required |
node_ids
|
Union[List[int], None]
|
A list of node IDs where the state is to be applied. If None, the state is applied to all nodes. |
required |
disqualifying_properties
|
List[str]
|
A list of properties that disqualify an individual from the state. |
required |
start_year
|
float
|
The start year for the state. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The trigger for the ARTStaging state. |
Source code in emodpy_hiv/campaign/cascade_of_care.py
add_state_HCTTestingLoop(campaign, disqualifying_properties, node_ids, hct_retention_rate, start_year, hct_delay_to_next_test, hct_delay_to_next_test_node_ids=None, hct_delay_to_next_test_node_names=None, tvmap_consider_immediate_ART=all_negative_time_value_map)
This function manages the addition of Health Care Testing (HCT) testing loop in the campaign.
This state is triggered by the HCT_TESTING_LOOP_TRIGGER event. Initially, it goes through a hivmuxer intervention with an exponential delay, the mean of which equals hct_delay_to_next_test. Subsequently, a rapid HIV test is conducted. If the test result is positive, a 'consider_immediate_ART' test is triggered. If the test result is negative, a random choice intervention is triggered to decide whether the individual should remain in the loop (with rate = hct_retention_rate) or drop out and transition to the HCTUptakePostDebut state using the HCT_UPTAKE_POST_DEBUT_TRIGGER_1 event. If the 'consider_immediate_ART' test is positive, it triggers the transition to the OnART state using the ON_ART_TRIGGER_2 event. If the 'consider_immediate_ART' test is negative, it triggers the transition to the ARTStaging state using the ART_STAGING_TRIGGER_1 event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign to which the state is added. |
required |
disqualifying_properties
|
List[str]
|
A list of properties that disqualify an individual from the state. |
required |
node_ids
|
Union[List[int], None]
|
A list of node IDs where the state is to be applied. If None, the state is applied to all nodes. |
required |
hct_retention_rate
|
float
|
The rate at which individuals remain in the HCT testing loop in the random choice intervention. |
required |
start_year
|
float
|
The start year for the state. |
required |
hct_delay_to_next_test
|
Union[float, List[float]]
|
The mean delay for the hivmuxer intervention in the HCT testing loop. Can be a single value or a list of values for different nodes. |
required |
hct_delay_to_next_test_node_ids
|
Union[List[List[int]], None]
|
A 2D list specifying the node IDs for each delay period in the hivmuxer intervention. This argument must be provided if hct_delay_to_next_test is a list and should have the same length as hct_delay_to_next_test. If None, the node IDs will be the same as the previous node_ids argument. Defaults to None. |
None
|
hct_delay_to_next_test_node_names
|
Union[List[str], None]
|
A list of node names for each delay period in the hivmuxer intervention. This argument must be provided if hct_delay_to_next_test is a list and should have the same length as hct_delay_to_next_test. If None, the node names will be 'Default'. Defaults to None. |
None
|
tvmap_consider_immediate_ART
|
dict
|
Time value map for considering immediate ART. Defaults to all_negative_time_value_map which will always trigger the Negative event and transition to ARTStaging state. |
all_negative_time_value_map
|
Returns:
| Type | Description |
|---|---|
(str, str, str)
|
Tuple[str, str, str]: The triggers for the HCTUptakePostDebut, OnART, and ARTStaging states. |
Examples:
This example demonstrates how to add the HCTTestingLoop state to the campaign with different delay periods for each region/node
>>> disqualifying_properties = [CascadeState.LOST_FOREVER,
>>> CascadeState.ON_ART,
>>> CascadeState.LINKING_TO_ART,
>>> CascadeState.ON_PRE_ART,
>>> CascadeState.LINKING_TO_PRE_ART,
>>> CascadeState.ART_STAGING]
>>> hct_retention_rate = 0.95
>>> hct_delay_to_next_test = [730, 365, 1100]
>>> hct_delay_to_next_test_node_ids = [[1, 2, 3, 4, 6, 7], [5, 9, 10], [8]]
>>> hct_delay_to_next_test_node_names = ['Default', 'Lusaka, Southern, Western', 'Northern']
>>> art_cascade_start_year = 1995
>>> add_state_HCTTestingLoop(campaign=camp,
>>> disqualifying_properties=disqualifying_properties,
>>> hct_delay_to_next_test=hct_delay_to_next_test,
>>> node_ids=None,
>>> hct_retention_rate=hct_retention_rate,
>>> start_year=art_cascade_start_year,
>>> tvmap_consider_immediate_ART=all_negative_time_value_map,
>>> hct_delay_to_next_test_node_ids=hct_delay_to_next_test_node_ids,
>>> hct_delay_to_next_test_node_names=hct_delay_to_next_test_node_names))
This example demonstrates how to add the HCTTestingLoop state to the campaign with a single delay period for all regions/nodes.
>>> disqualifying_properties = [CascadeState.LOST_FOREVER,
>>> CascadeState.ON_ART,
>>> CascadeState.LINKING_TO_ART,
>>> CascadeState.ON_PRE_ART,
>>> CascadeState.LINKING_TO_PRE_ART,
>>> CascadeState.ART_STAGING]
>>> hct_retention_rate = 0.95
>>> hct_delay_to_next_test = 365
>>> art_cascade_start_year = 1995
>>> add_state_HCTTestingLoop(campaign=camp,
>>> disqualifying_properties=disqualifying_properties,
>>> hct_delay_to_next_test=hct_delay_to_next_test,
>>> node_ids=None,
>>> hct_retention_rate=hct_retention_rate,
>>> start_year=art_cascade_start_year,
>>> tvmap_consider_immediate_ART=all_negative_time_value_map)
Source code in emodpy_hiv/campaign/cascade_of_care.py
1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 | |
add_state_HCTUptakeAtDebut(campaign, disqualifying_properties, node_ids, start_year, female_multiplier=1)
This function manages the addition of Health Care Testing (HCT) uptake at sexual debut in the campaign.
When an individual receives the 'STIDebut' event, this state is activated. If the test result is positive, it triggers the HCTTestingLoop state using the event identified as HCT_TESTING_LOOP_TRIGGER. If the test result is negative, it immediately triggers the HCTUpdatePostDebut state using the event identified as HCT_UPTAKE_POST_DEBUT_TRIGGER_1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign to which the state is added. |
required |
disqualifying_properties
|
List[str]
|
A list of properties that disqualify an individual from the state. |
required |
node_ids
|
Union[List[int], None]
|
A list of node IDs where the state is to be applied. If None, the state is applied to all nodes. |
required |
start_year
|
float
|
The start year for the state. |
required |
female_multiplier
|
float
|
The multiplier for female individuals in the HIVSigmoidByYearAndSexDiagnostic intervention. Defaults to 1. |
1
|
Returns:
| Type | Description |
|---|---|
Tuple[str, str]
|
Tuple[str, str]: The trigger events for the HCTTestingLoop and HCTUpdatePostDebut states. |
Source code in emodpy_hiv/campaign/cascade_of_care.py
add_state_HCTUptakePostDebut(campaign, disqualifying_properties, node_ids, hct_reentry_rate, start_year, tvmap_test_for_enter_HCT_testing_loop=all_negative_time_value_map)
This function manages the addition of Health Care Testing (HCT) uptake post sexual debut in the campaign.
This state is activated by the events HCT_UPTAKE_POST_DEBUT_TRIGGER_1, HCT_UPTAKE_POST_DEBUT_TRIGGER_2, and HCT_UPTAKE_POST_DEBUT_TRIGGER_3. If the test result is positive, it triggers the HCTTestingLoop state using the event identified as HCT_TESTING_LOOP_TRIGGER. If the test result is negative, it reverts back to this state using the event identified as HCT_UPTAKE_POST_DEBUT_TRIGGER_1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign to which the state is added. |
required |
disqualifying_properties
|
List[str]
|
A list of properties that disqualify an individual from the state. |
required |
node_ids
|
Union[List[int], None]
|
A list of node IDs where the state is to be applied. If None, the state is applied to all nodes. |
required |
hct_reentry_rate
|
float
|
The rate at which individuals reenter the HCT uptake post sexual debut state. |
required |
start_year
|
float
|
The start year for the state. |
required |
tvmap_test_for_enter_HCT_testing_loop
|
dict
|
Time value map for HIVPiecewiseByYearAndSexDiagnostic intervention. Defaults to all_negative_time_value_map which will always trigger the Negative event. |
all_negative_time_value_map
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The trigger for the HCTTestingLoop state. |
Source code in emodpy_hiv/campaign/cascade_of_care.py
1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 | |
add_state_LinkingToART(campaign, node_ids, disqualifying_properties, start_year, sigmoid_min=0.0, sigmoid_max=0.8507390283, sigmoid_midyear=1997.4462231708, sigmoid_rate=1.0)
This function manages the addition of the LinkingToART state in the campaign.
The function is initially triggered by the LINKING_TO_ART_TRIGGER event. Upon activation, it conducts a sigmoid HIVSigmoidByYearAndSexDiagnostic test. Depending on the result of this test, the function can transit to two different states. It could trigger the OnART state if the sigmoid diagnostic test result is positive with ON_ART_TRIGGER_1 event. It could also trigger the HCTUptakePostDebut state if the sigmoid diagnostic test result is negative with HCT_UPTAKE_POST_DEBUT_TRIGGER_2 event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign object to which the state is added. |
required |
node_ids
|
Union[List[int], None]
|
A list of node IDs for which the state is applicable. If None, the state is applicable to all nodes. |
required |
disqualifying_properties
|
List[str]
|
A list of properties that disqualify an individual from being in this state. |
required |
start_year
|
float
|
The year on which the state starts. |
required |
sigmoid_min
|
float
|
The left asymptote for the sigmoid trend over time for the HIVSigmoidByYearAndSexDiagnostic intervention. |
0.0
|
sigmoid_max
|
float
|
The right asymptote for the sigmoid trend over time for the HIVSigmoidByYearAndSexDiagnostic intervention. |
0.8507390283
|
sigmoid_midyear
|
float
|
The time of the infection point in the sigmoid trend over time for the HIVSigmoidByYearAndSexDiagnostic intervention. |
1997.4462231708
|
sigmoid_rate
|
float
|
The slope of the inflection point in the sigmoid trend over time for the HIVSigmoidByYearAndSexDiagnostic intervention. A Rate of 1 sets the slope to a 25% change in probability per year. |
1.0
|
Returns:
| Type | Description |
|---|---|
(str, str)
|
The triggers for the OnART and 'HCTUptakePostDebut' states. |
Source code in emodpy_hiv/campaign/cascade_of_care.py
add_state_LinkingToPreART(campaign, node_ids, disqualifying_properties, start_year, sigmoid_min=0.7572242198, sigmoid_max=0.9591484679, sigmoid_midyear=2006.8336631523, sigmoid_rate=1.0)
This function manages the addition of the LinkingToPreART state in the campaign.
The function is initially triggered by the LINKING_TO_PRE_ART_TRIGGER event. Upon activation, it conducts a HIVSigmoidByYearAndSexDiagnostic test. If the test result is positive, it triggers ON_PRE_ART_TRIGGER which will transition to the OnPreART state. If the test result is negative, it triggers HCT_UPTAKE_POST_DEBUT_TRIGGER_3 which will transition to the HCTUptakePostDebut state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign object to which the state is added. |
required |
node_ids
|
Union[List[int], None]
|
A list of node IDs for which the state is applicable. If None, the state is applicable to all nodes. |
required |
disqualifying_properties
|
List[str]
|
A list of properties that disqualify an individual from being in this state. |
required |
start_year
|
float
|
The year on which the state starts. |
required |
sigmoid_min
|
float
|
The left asymptote for the sigmoid trend over time for the HIVSigmoidByYearAndSexDiagnostic intervention. |
0.7572242198
|
sigmoid_max
|
float
|
The right asymptote for the sigmoid trend over time for the HIVSigmoidByYearAndSexDiagnostic intervention. |
0.9591484679
|
sigmoid_midyear
|
float
|
The time of the infection point in the sigmoid trend over time for the HIVSigmoidByYearAndSexDiagnostic intervention. |
2006.8336631523
|
sigmoid_rate
|
float
|
The slope of the inflection point in the sigmoid trend over time for the HIVSigmoidByYearAndSexDiagnostic intervention. A Rate of 1 sets the slope to a 25% change in probability per year. |
1.0
|
Returns:
| Type | Description |
|---|---|
Tuple[str, str]
|
Tuple[str, str]: The triggers for the OnPreART and HCTUptakePostDebut states. |
Source code in emodpy_hiv/campaign/cascade_of_care.py
add_state_LostForever(campaign, node_ids, start_year)
Transition individuals to the 'LostForever' state in the campaign.
This function is triggered by the LOST_FOREVER_TRIGGER event. Upon activation, it changes the target property key to 'CascadeState' and the target property value to 'LostForever', effectively moving individuals to the LostForever state in the campaign.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign object to which the state transition is to be added. |
required |
node_ids
|
List[int]
|
A list of node IDs where this transition is applicable. |
required |
start_year
|
float
|
The starting year of the campaign when this transition becomes active. |
required |
Source code in emodpy_hiv/campaign/cascade_of_care.py
add_state_OnART(campaign, art_reenrollment_willingness, immediate_art_rate, node_ids, disqualifying_properties, start_year, tvmap_immediate_ART_restart=all_negative_time_value_map, tvmap_reconsider_lost_forever=all_negative_time_value_map)
This function manages the addition of the OnART state in the campaign.
The function is initially triggered by the ON_ART_TRIGGER_1 and ON_ART_TRIGGER_2 events. Upon activation, it conducts a series of interventions and diagnostics, including a decision(with HIVRandomChoice) on whether to initiate ART immediately or delay(with HIVMuxer), initiation of ART, a delay(with HIVMuxer) to dropping off of ART, and a decision(with HIVRandomChoice) on willingness to test the eligibility of re-enroll in ART or transit to other states.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign object to which the state is added. |
required |
art_reenrollment_willingness
|
float
|
The willingness of an individual to re-enroll in ART after dropout. |
required |
immediate_art_rate
|
float
|
The rate at which ART is initiated immediately, without HIVMuxer delay. |
required |
node_ids
|
Union[List[int], None]
|
A list of node IDs for which the state is applicable. If None, the state is applicable to all nodes. |
required |
disqualifying_properties
|
List[str]
|
A list of properties that disqualify an individual from being in this state. |
required |
start_year
|
float
|
The year on which the state starts. |
required |
tvmap_immediate_ART_restart
|
dict
|
A time value map for HIVPiecewiseByYearAndSexDiagnostic intervention to consider restarting ART immediately after HIVMuxer delay. Defaults to all_negative_time_value_map which will always trigger the Negative event(HCT_UPTAKE_POST_DEBUT_TRIGGER_2) and transit to HCTUptakePostDebut state. |
all_negative_time_value_map
|
tvmap_reconsider_lost_forever
|
dict
|
A time value map for the second HIVPiecewiseByYearAndSexDiagnostic intervention to reconsider being lost forever to ART care. Defaults to all_negative_time_value_map which will always trigger the Negative event(LostForever) and transit to LostForever state. |
all_negative_time_value_map
|
Returns:
| Type | Description |
|---|---|
(str, str)
|
The triggers for the HCTUptakePostDebut and LostForever states. |
Source code in emodpy_hiv/campaign/cascade_of_care.py
2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 | |
add_state_OnPreART(campaign, node_ids, pre_art_retention, disqualifying_properties, start_year)
This function manages the addition of the OnPreART state in the campaign.
The function is initially triggered by the ON_PRE_ART_TRIGGER event. Upon activation, it conducts a series of interventions and diagnostics, including a HIVMuxer with a delay period, a random choice for pre-ART retention or lost to follow-up, a CD4 agnostic pre-ART eligibility check, a blood draw, and a determination of ART eligibility given CD4 counts. Depending on the results of these checks, the function can transit to two different states. It could trigger the OnART state if the individual is eligible for ART with ON_ART_TRIGGER_1 event. It could also trigger the HCTUptakePostDebut state if the individual is not retained in the pre-ART state with HCT_UPTAKE_POST_DEBUT_TRIGGER_3 event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign object to which the state is added. |
required |
node_ids
|
Union[List[int], None]
|
A list of node IDs for which the state is applicable. If None, the state is applicable to all nodes. |
required |
pre_art_retention
|
float
|
The retention rate in the pre-ART state. |
required |
disqualifying_properties
|
List[str]
|
A list of properties that disqualify an individual from being in this state. |
required |
start_year
|
float
|
The float on which the state starts. |
required |
Returns:
| Type | Description |
|---|---|
Tuple[str, str]
|
Tuple[str, str]: The triggers for the OnART and HCTUptakePostDebut states. |
Source code in emodpy_hiv/campaign/cascade_of_care.py
1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 | |
add_state_TestingOnANC(campaign, disqualifying_properties, coverage, link_to_ART_rate, node_ids, sigmoid_min, sigmoid_max, sigmoid_midyear, sigmoid_rate, treatment_a_efficacy, treatment_b_efficacy, sdNVP_efficacy, start_year, property_restrictions='Accessibility:Yes')
Manages the addition of Testing on Antenatal Care (ANC) in the campaign.
This state is triggered when an individual reaches 'TwelveWeeksPregnant'. At some point in this state, it initiates the ARTStaging state. The transition to the ARTStaging state is governed by an event, identified as ART_STAGING_TRIGGER_1. The occurrence of this event is determined by a random choice mechanism with a rate equal to link_to_ART_rate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign object to which the Testing on ANC state is to be added. |
required |
disqualifying_properties
|
List[str]
|
A list of disqualifying properties for the Testing on ANC state. |
required |
coverage
|
float
|
The coverage of Testing on ANC among the population. |
required |
link_to_ART_rate
|
float
|
The rate for linking to ART. This is used to determine the transition to the ARTStaging state. |
required |
node_ids
|
Union[List[int], None]
|
A list of node IDs where the Testing on ANC state is to be applied. If None, the Testing on ANC state applies to all nodes. |
required |
sigmoid_min
|
float
|
The left asymptote for the sigmoid trend over time for the HIVSigmoidByYearAndSexDiagnostic intervention. |
required |
sigmoid_max
|
float
|
The right asymptote for the sigmoid trend over time for the HIVSigmoidByYearAndSexDiagnostic intervention. |
required |
sigmoid_midyear
|
float
|
The time of the infection point in the sigmoid trend over time for the HIVSigmoidByYearAndSexDiagnostic intervention. |
required |
sigmoid_rate
|
float
|
The slope of the inflection point in the sigmoid trend over time for the HIVSigmoidByYearAndSexDiagnostic intervention. A Rate of 1 sets the slope to a 25% change in probability per year. |
required |
treatment_a_efficacy
|
float
|
The efficacy of treatment A. |
required |
treatment_b_efficacy
|
float
|
The efficacy of treatment B. |
required |
sdNVP_efficacy
|
float
|
The efficacy of Single-Dose Nevirapine (sdNVP). |
required |
start_year
|
float
|
The start year for the Testing on ANC state. |
required |
property_restrictions
|
Union[List[str], str]
|
The property restrictions for the Testing on ANC state. Defaults to 'Accessibility:Yes'. |
'Accessibility:Yes'
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The trigger event name for the ARTStaging state. |
Source code in emodpy_hiv/campaign/cascade_of_care.py
940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 | |
add_state_TestingOnChild6w(campaign, start_year, disqualifying_properties, time_value_map, node_ids, property_restrictions='Accessibility:Yes')
This function adds a state for testing on children at 6 weeks old in the campaign.
When an individual broadcast the 'SixWeeksOld' event, this state is triggered. If the test result is positive, it will then trigger the ARTStagingDiagnosticTest state using the event identified as ART_STAGING_DIAGNOSTIC_TEST_TRIGGER.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign to which the state is added. |
required |
start_year
|
float
|
The start year for the state. |
required |
disqualifying_properties
|
List[str]
|
A list of properties that disqualify an individual from the state. |
required |
time_value_map
|
Union[Dict[float, float], Dict[str, List[float]]]
|
A map of times to values for the HIVPiecewiseByYearAndSexDiagnostic intervention. |
required |
node_ids
|
Union[List[int], None]
|
A list of node IDs where the state is to be applied. If None, the state is applied to all nodes. |
required |
property_restrictions
|
Union[List[str], str]
|
The property restrictions for the state. Defaults to 'Accessibility:Yes'. |
'Accessibility:Yes'
|
Returns:
| Type | Description |
|---|---|
str
|
The trigger event name for the ARTStagingDiagnosticTest state. |
Source code in emodpy_hiv/campaign/cascade_of_care.py
add_state_TestingOnSymptomatic(campaign, node_ids, disqualifying_properties, start_year, tvmap_increased_symptomatic_presentation=all_negative_time_value_map)
This function manages the addition of Testing on Symptomatic individuals in the campaign.
This state is triggered when an individual becomes 'NewlySymptomatic'. A HIVSigmoidByYearAndSexDiagnostic intervention is then applied. If the test result is positive, it triggers the ARTStagingDiagnosticTest state using the ART_STAGING_DIAGNOSTIC_TEST_TRIGGER event. If the test is negative, it triggers a HIVPiecewiseByYearAndSexDiagnostic test. If the result of this test is positive, it initiates the ARTStaging state through the ART_STAGING_TRIGGER_2 event. If the test result is negative, it does not trigger any further events.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign to which the state is added. |
required |
node_ids
|
Union[List[int], None]
|
A list of node IDs where the state is to be applied. If None, the state is applied to all nodes. |
required |
disqualifying_properties
|
List[str]
|
A list of properties that disqualify an individual from the state. |
required |
start_year
|
float
|
The start year for the state. |
required |
tvmap_increased_symptomatic_presentation
|
dict
|
Time value map for increased symptomatic presentation which is used in the HIVPiecewiseByYearAndSexDiagnostic intervention. Defaults to all_negative_time_value_map which will always trigger the Negative event('None'). |
all_negative_time_value_map
|
Returns:
| Type | Description |
|---|---|
Tuple[str, str]
|
Tuple[str, str]: The triggers for the ARTStagingDiagnosticTest and ARTStaging states. |
Source code in emodpy_hiv/campaign/cascade_of_care.py
1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 | |
add_traditional_male_circumcision(campaign, traditional_male_circumcision_start_year=1961, randomchoice_start_year=1975, traditional_male_circumcision_coverage=0.054978651, traditional_male_circumcision_reduced_acquire=0.6, traditional_male_circumcision_node_ids=None)
Manages the addition of traditional male circumcision in the campaign.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign to which the traditional male_circumcision management is to be added. |
required |
traditional_male_circumcision_start_year
|
float
|
The start year for traditional male_circumcision interventions. Defaults to 1961. |
1961
|
randomchoice_start_year
|
float
|
The start year for randomchoice_start_year interventions. Defaults to 1975. |
1975
|
traditional_male_circumcision_coverage
|
float
|
The coverage of traditional male_circumcision among the male population. Defaults to 0.054978651. |
0.054978651
|
traditional_male_circumcision_reduced_acquire
|
float
|
The reduced acquire rate for traditional male_circumcision. Defaults to 0.6. |
0.6
|
traditional_male_circumcision_node_ids
|
List[int]
|
A list of node IDs where the traditional male_circumcision management is to be applied. Defaults to None, which applies to all nodes. |
None
|
Returns:
Example
add_traditional_male_circumcision(campaign, traditional_male_circumcision_coverage=0.06, traditional_male_circumcision_reduced_acquire=0.5, traditional_male_circumcision_node_ids=[1, 2, 3])
Source code in emodpy_hiv/campaign/cascade_of_care.py
522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 | |
add_vmmc_reference_tracking(campaign, vmmc_time_value_map, vmmc_reduced_acquire=0.6, vmmc_target_min_age=15, vmmc_target_max_age=29.999999, vmmc_start_year=2015, vmmc_node_ids=None, update_period=30.4166666666667, distributed_event_trigger=PROGRAM_VMMC)
Manages the addition of voluntary male medical circumcision (VMMC) reference tracking in the campaign.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
campaign
|
The campaign to which the VMMC reference tracking is to be added. |
required |
vmmc_time_value_map
|
dict
|
A dictionary containing time-value map for VMMC. |
required |
vmmc_reduced_acquire
|
float
|
The reduced acquire rate for VMMC. Defaults to 0.6. |
0.6
|
vmmc_target_min_age
|
float
|
The minimum age for VMMC target. Defaults to 15. |
15
|
vmmc_target_max_age
|
float
|
The maximum age for VMMC target. Defaults to 29.999999. |
29.999999
|
vmmc_start_year
|
float
|
The start year for VMMC. Defaults to 2015. |
2015
|
vmmc_node_ids
|
List[int]
|
A list of node IDs where the VMMC reference tracking is to be applied. Defaults to None, which applies to all nodes. |
None
|
update_period
|
float
|
The update period for VMMC reference tracking. Defaults to 30.4166666666667. |
30.4166666666667
|
distributed_event_trigger
|
str
|
The trigger for distributed event. Defaults to PROGRAM_VMMC. |
PROGRAM_VMMC
|
Returns:
| Type | Description |
|---|---|
str
|
The intervention name for male circumcision. |
Example
add_vmmc_reference_tracking(campaign, vmmc_time_value_map={"Times": [2002, 2010.5, 2013.95], "Values": [200, 350, 500]}, vmmc_node_ids=[1, 2, 3], vmmc_reduced_acquire=0.5, vmmc_target_min_age=10, vmmc_target_max_age=30, vmmc_start_year=2010, update_period=30, distributed_event_trigger=PROGRAM_VMMC, target_disease_state=HIV_NEGATIVE)
Source code in emodpy_hiv/campaign/cascade_of_care.py
convert_time_value_map(time_value_map)
Converts a time-value map into a dictionary where each time is a key and its corresponding value is the value. This is the expected format for the TVMap in the current emodpy-hiv interventions code, ex. yearandsexdiag.new_diagnostic function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time_value_map
|
dict
|
A dictionary containing two lists, "Times" and "Values". "Times" is a list of times (years) and "Values" is a list of corresponding values. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary where each time from "Times" is a key and its corresponding value from "Values" is the value. |
Example
time_value_map = {"Times": [2002, 2010.5, 2013.95], "Values": [200, 350, 500]} convert_time_value_map(time_value_map)
Source code in emodpy_hiv/campaign/cascade_of_care.py
seed_infections(campaign, seeding_node_ids=None, seeding_start_year=1982, seeding_coverage=0.075, seeding_target_min_age=0, seeding_target_max_age=200, seeding_target_gender=TargetGender.ALL, seeding_target_property_restrictions=None)
Add a OutbreakIndividual intervention with StandardEventCoordinator to the campaign object. Args: campaign: emod_api.campaign object seeding_node_ids: List of node IDs to seed infections in. Defaults to None, which seeds infections in all nodes. seeding_start_year: The year to start seeding infections. Defaults to 1982. seeding_coverage: The coverage of the seeding infections. Defaults to 0.075. seeding_target_min_age: The minimum age of the target population. Defaults to 0. seeding_target_max_age: The maximum age of the target population. Defaults to 200. seeding_target_gender: The TargetGender object which defines the gender of the target population. Defaults to TargetGender.ALL. Options are TargetGender.MALE, TargetGender.FEMALE, TargetGender.ALL. seeding_target_property_restrictions: List of property restrictions. Defaults to None.
Returns:
Source code in emodpy_hiv/campaign/cascade_of_care.py
timestep_from_year(year, base_year)
Converts a year into a timestep based on a base year.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
year
|
Union[float, int]
|
The year to be converted. |
required |
base_year
|
Union[float, int]
|
The base year for the conversion. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The timestep corresponding to the given year. |