Skip to content

drug

add_scheduled_antimalarial_drug(campaign, start_day=1, demographic_coverage=1.0, target_num_individuals=None, node_ids=None, repetitions=1, timesteps_between_repetitions=365, ind_property_restrictions=None, target_age_min=0, target_age_max=MAX_AGE_YEARS, target_gender='All', drug_type=None, cost_to_consumer=0, intervention_name=None)

Add an antimalarial drug intervention to your campaign. This is equivalent to :doc:emod/parameter-campaign-individual-antimalarialdrug.

Parameters:

Name Type Description Default
campaign EMODCampaign

The object to which the intervention will be added.

required
start_day int

The day the intervention is given out.

1
demographic_coverage float

This value is the probability that each individual in the target population will receive the intervention. It does not guarantee that the exact fraction of the target population set by Demographic_Coverage receives the intervention.

1.0
target_num_individuals int

The exact number of people to select out of the targeted group. If this value is set, demographic_coverage parameter is ignored

None
node_ids list

List of nodes to which to distribute the intervention. [] or None, indicates all nodes will get the intervention

None
repetitions int

The number of times an intervention is given, used with timesteps_between_repetitions. -1 means the intervention repeats forever. Sets Number_Repetitions

1
timesteps_between_repetitions int

The interval, in timesteps, between repetitions. Ignored if repetitions = 1. Sets Timesteps_Between_Repetitions

365
ind_property_restrictions list

A list of dictionaries of IndividualProperties, which are needed for the individual to receive the intervention. Sets the Property_Restrictions_Within_Node

None
target_age_min int

The lower end of ages targeted for an intervention, in years. Sets Target_Age_Min

0
target_age_max int

The upper end of ages targeted for an intervention, in years. Sets Target_Age_Max

MAX_AGE_YEARS
target_gender str

The gender targeted for an intervention: All, Male, or Female.

'All'
drug_type str

The name of the drug to distribute in a drug intervention. Possible values are contained in Malaria_Drug_Params in :doc:emod/parameter-configuration-drugs. Use 🇵🇾meth:~emodpy_malaria.config.set_team_drug_params to set those values

None
cost_to_consumer float

Per-unit cost when drug is distributed

0
intervention_name str

The optional name used to refer to this intervention as a means to differentiate it from others that use the same class. Default is AntimalarialDrug_.

None
Source code in emodpy_malaria/interventions/drug.py
def add_scheduled_antimalarial_drug(
        campaign,
        start_day: int = 1,
        demographic_coverage: float = 1.0,
        target_num_individuals: int = None,
        node_ids: list = None,
        repetitions: int = 1,
        timesteps_between_repetitions: int = 365,
        ind_property_restrictions: list = None,
        target_age_min: int = 0,
        target_age_max: int = MAX_AGE_YEARS,
        target_gender: str = "All",
        drug_type: str = None,
        cost_to_consumer: float = 0,
        intervention_name: str = None
):
    """
    Add an antimalarial drug intervention to your campaign. This is equivalent to
    :doc:`emod/parameter-campaign-individual-antimalarialdrug`.

    Args:
        campaign (emodpy.campaign.emod_campaign.EMODCampaign): The object to which the intervention will be added.
        start_day: The day the intervention is given out.
        demographic_coverage: This value is the probability that each individual in the target population will
            receive the intervention. It does not guarantee that the exact fraction of the target population set by
            Demographic_Coverage receives the intervention.
        target_num_individuals: The exact number of people to select out of the targeted group. If this value is set,
            demographic_coverage parameter is ignored
        node_ids: List of nodes to which to distribute the intervention. [] or None, indicates all nodes
            will get the intervention
        repetitions: The number of times an intervention is given, used with timesteps_between_repetitions. -1 means
            the intervention repeats forever. Sets **Number_Repetitions**
        timesteps_between_repetitions: The interval, in timesteps, between repetitions. Ignored if repetitions = 1.
            Sets **Timesteps_Between_Repetitions**
        ind_property_restrictions: A list of dictionaries of IndividualProperties, which are needed for the individual
            to receive the intervention. Sets the **Property_Restrictions_Within_Node**
        target_age_min: The lower end of ages targeted for an intervention, in years. Sets **Target_Age_Min**
        target_age_max: The upper end of ages targeted for an intervention, in years. Sets **Target_Age_Max**
        target_gender: The gender targeted for an intervention: All, Male, or Female.
        drug_type: The name of the drug to distribute in a drug intervention. Possible values are
            contained in **Malaria_Drug_Params** in :doc:`emod/parameter-configuration-drugs`.
            Use :py:meth:`~emodpy_malaria.config.set_team_drug_params` to set those values
        cost_to_consumer: Per-unit cost when drug is distributed
        intervention_name: The optional name used to refer to this intervention as a means to differentiate it from
            others that use the same class.  Default is AntimalarialDrug_<drug_type>.
    """
    antimalarial_drug = _antimalarial_drug(campaign=campaign,
                                           drug_type=drug_type,
                                           cost_to_consumer=cost_to_consumer,
                                           intervention_name=intervention_name)
    add_campaign_event(campaign=campaign,
                       start_day=start_day, demographic_coverage=demographic_coverage,
                       target_num_individuals=target_num_individuals, node_ids=node_ids,
                       repetitions=repetitions, timesteps_between_repetitions=timesteps_between_repetitions,
                       ind_property_restrictions=ind_property_restrictions,
                       target_age_max=target_age_max, target_age_min=target_age_min,
                       target_gender=target_gender, individual_intervention=antimalarial_drug)

new_intervention_as_file(campaign, start_day, drug_type='Chloroquine', filename='AntimalarialDrug.json')

Take an :doc:emod/parameter-campaign-individual-antimalarialdrug intervention from a JSON file and add it to your campaign.

Parameters:

Name Type Description Default
campaign EMODCampaign

The object to which the intervention will be added.

required
start_day float

The day of the simulation on which the drug is distributed. We recommend aligning this with the start of the simulation.

required
drug_type str

The name of the drug to distribute in a drug intervention. Possible values are contained in Malaria_Drug_Params in :doc:emod/parameter-configuration-drugs.

'Chloroquine'
filename str

The JSON file that contains the intervention.

'AntimalarialDrug.json'

Returns:

Type Description
str

The filename.

Source code in emodpy_malaria/interventions/drug.py
def new_intervention_as_file(campaign, start_day, drug_type="Chloroquine", filename="AntimalarialDrug.json"):
    """
    Take an :doc:`emod/parameter-campaign-individual-antimalarialdrug`
    intervention from a JSON file and add it to your campaign.

    Args:
        campaign (emodpy.campaign.emod_campaign.EMODCampaign): The object to which the intervention will be added.
        start_day (float): The day of the simulation on which the drug is distributed. We recommend
            aligning this with the start of the simulation.
        drug_type (str): The name of the drug to distribute in a drug intervention. Possible values are
            contained in **Malaria_Drug_Params** in :doc:`emod/parameter-configuration-drugs`.
        filename (str): The JSON file that contains the intervention.

    Returns:
        (str): The filename.
    """
    add_scheduled_antimalarial_drug(campaign=campaign, start_day=start_day, drug_type=drug_type)
    campaign.save(filename)
    return filename