interventions.syphilis_interventions
interventions.syphilis_interventions
Define syphilis interventions for STIsim
Classes
| Name | Description |
|---|---|
| ANCSyphTest | Antenatal care syphilis screening for pregnant women. |
| NewbornSyphTest | Syphilis test for newborns of mothers diagnosed during pregnancy. |
| NewbornTreatment | Treatment for congenital syphilis in newborns. |
| SyphDx | Syphilis diagnostic product. |
| SyphTest | Base class for syphilis screening and testing interventions. |
| SyphTx | Syphilis treatment intervention. |
ANCSyphTest
interventions.syphilis_interventions.ANCSyphTest(
test_prob_data=None,
years=None,
start=None,
stop=None,
pars=None,
product=None,
eligibility=None,
name=None,
label=None,
newborn_test=None,
**kwargs,
)Antenatal care syphilis screening for pregnant women.
Schedules a syphilis test at a random gestational timepoint for each newly pregnant woman. Unlike the base :class:SyphTest, testing probability is not dt-scaled since tests are scheduled once per pregnancy rather than applied each timestep.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| test_prob_data | Testing probability (see :class:SyphTest). |
None |
|
| years | list | Calendar years for test_prob_data. |
None |
| start | float | Calendar year when ANC testing begins. | None |
| stop | float | Calendar year when ANC testing ends. | None |
| pars | dict | Parameter overrides. | None |
| product | Diagnostic product. | None |
|
| eligibility | func |
Override default (pregnant women). | None |
| name | str | Intervention name. | None |
| label | str | Label for plotting. | None |
| newborn_test | Optional :class:NewbornSyphTest for positive mothers. |
None |
|
| **kwargs | Additional parameter overrides. | {} |
Methods
| Name | Description |
|---|---|
| schedule_tests | Schedule a test for newly pregnant women |
schedule_tests
interventions.syphilis_interventions.ANCSyphTest.schedule_tests()Schedule a test for newly pregnant women
NewbornSyphTest
interventions.syphilis_interventions.NewbornSyphTest(
test_prob_data=None,
years=None,
start=None,
stop=None,
pars=None,
product=None,
eligibility=None,
name=None,
label=None,
newborn_test=None,
**kwargs,
)Syphilis test for newborns of mothers diagnosed during pregnancy.
Administers scheduled tests to newborns whose mothers tested positive for syphilis at any point during pregnancy. Tests are only given at the scheduled timestep, filtered by acceptance probability.
NewbornTreatment
interventions.syphilis_interventions.NewbornTreatment(
pars=None,
eligibility=None,
max_capacity=None,
years=None,
name=None,
*args,
**kwargs,
)Treatment for congenital syphilis in newborns.
Extends :class:SyphTx to treat newborns diagnosed with congenital syphilis. Successful treatment clears the congenital state and resets the birth outcome to normal.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| pars | dict | Parameter overrides. | None |
| eligibility | func |
Function returning eligible newborn UIDs. | None |
| max_capacity | int | Maximum treatments per timestep. | None |
| years | list | Calendar years during which the intervention is active. | None |
| name | str | Intervention name. | None |
| **kwargs | Additional parameter overrides. | {} |
Methods
| Name | Description |
|---|---|
| administer | Administer treatment to newborns |
| change_states | Change states of congenital cases |
administer
interventions.syphilis_interventions.NewbornTreatment.administer(
sim,
uids,
disease,
return_format='dict',
)Administer treatment to newborns
change_states
interventions.syphilis_interventions.NewbornTreatment.change_states(
disease,
treat_succ,
)Change states of congenital cases
SyphDx
interventions.syphilis_interventions.SyphDx(df, *args, **kwargs)Syphilis diagnostic product.
Wraps :class:STIDx with the disease key set to 'syph'. Used as the default product for syphilis testing interventions.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| df | Diagnostic performance data (sensitivity/specificity by stage). | required | |
| *args | Positional arguments forwarded to :class:STIDx. |
() |
|
| **kwargs | Keyword arguments forwarded to :class:STIDx. |
{} |
SyphTest
interventions.syphilis_interventions.SyphTest(
test_prob_data=None,
years=None,
start=None,
stop=None,
pars=None,
product=None,
eligibility=None,
name=None,
label=None,
newborn_test=None,
**kwargs,
)Base class for syphilis screening and testing interventions.
Provides shared logic for processing test probability data (which can be stratified by risk group, sex, and sex-work status) and scheduling tests. Subclasses like :class:ANCSyphTest and :class:NewbornSyphTest customize eligibility and scheduling.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| test_prob_data | Testing probability; scalar, array, TimeSeries, or DataFrame stratified by risk group/sex/sex-work status. | None |
|
| years | list | Calendar years corresponding to test_prob_data values. |
None |
| start | float | Calendar year when testing begins. | None |
| stop | float | Calendar year when testing ends. | None |
| pars | dict | Parameter overrides. | None |
| product | Diagnostic product (default: SyphDx). |
None |
|
| eligibility | func |
Function returning eligible UIDs. | None |
| name | str | Intervention name. | None |
| label | str | Label for plotting. | None |
| newborn_test | Optional :class:NewbornSyphTest to schedule for positive mothers. |
None |
|
| **kwargs | Additional parameter overrides. | {} |
Methods
| Name | Description |
|---|---|
| make_test_prob_fn | Process symptomatic testing probabilites over time by sex and risk group |
| process_data | Turn dataframe into a dictionary |
make_test_prob_fn
interventions.syphilis_interventions.SyphTest.make_test_prob_fn(sim, uids)Process symptomatic testing probabilites over time by sex and risk group
process_data
interventions.syphilis_interventions.SyphTest.process_data(sim)Turn dataframe into a dictionary
SyphTx
interventions.syphilis_interventions.SyphTx(
pars=None,
max_capacity=None,
years=None,
eligibility=None,
name=None,
**kwargs,
)Syphilis treatment intervention.
Treats diagnosed syphilis cases each timestep, clearing all disease stages (primary, secondary, latent, tertiary) on successful treatment. Also treats fetuses of pregnant mothers, with reduced efficacy in the last trimester.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| pars | dict | Parameter overrides (e.g. treat_eff, fetus_treat_eff). |
None |
| max_capacity | int | Maximum number of treatments per timestep. | None |
| years | list | Calendar years during which the intervention is active. | None |
| eligibility | func |
Function returning eligible UIDs. | None |
| name | str | Intervention name. | None |
| **kwargs | Additional parameter overrides. | {} |
Methods
| Name | Description |
|---|---|
| change_states | Change the states of people who are treated |
| step | Apply treatment |
| treat_fetus | Treat fetuses of successfully treated mothers. |
change_states
interventions.syphilis_interventions.SyphTx.change_states(disease, treat_succ)Change the states of people who are treated
step
interventions.syphilis_interventions.SyphTx.step()Apply treatment
treat_fetus
interventions.syphilis_interventions.SyphTx.treat_fetus(sim, mother_uids)Treat fetuses of successfully treated mothers. Birth outcomes of successfully treated fetuses will be updated. If fetus is not yet infected, the treatment doesn’t do anything. Treatment success depends on when in the pregnancy the mother gets treated with reduced treatment efficacy above the cut off age