Gabriel/syphilis - #1885
Gabriel/syphilis#1885Gabbie123king wants to merge 5 commits into
Conversation
| return | ||
|
|
||
| df.at[individual_id, 'ps_syphilis_state'] = 'primary' | ||
| df.at[individual_id, 'ps_syphilis_treated'] = False |
There was a problem hiding this comment.
wont this be false already anyway?
There was a problem hiding this comment.
Hi Joe, It will usually already be False, but a woman could have received treatment earlier in the pregnancy before this scheduled incident infection occurs. Resetting it here ensures the new infection is treated as untreated and is not incorrectly prevented from progressing by the earlier treatment flag. Apologies for delays, am addressing some of the comments in the model and updating the write-up for each change, logic and code cleanup. It will be shared soon.
| df.loc[id_or_index, 'ps_premature_rupture_of_membranes'] = False | ||
| df.loc[id_or_index, 'ps_chorioamnionitis'] = False | ||
| df.loc[id_or_index, 'ps_emergency_event'] = False | ||
| self.sim.modules['Syphilis'].reset_pregnancy_syphilis_properties(id_or_index) |
There was a problem hiding this comment.
again, if were having the separate syphilis module i think you can just set the properties within the syphilis module itself (its cleaner)
| self.module.apply_risk_of_premature_rupture_of_membranes_and_chorioamnionitis( | ||
| gestation_of_interest=gestation_of_interest) | ||
|
|
||
| self.sim.modules['Syphilis'].apply_risk_of_congenital_syphilis( |
There was a problem hiding this comment.
is there an epidemiological reason for only applying the risk of congenital infection starting at 22 weeks gestational age?
| logger = logging.getLogger(__name__) | ||
| logger.setLevel(logging.INFO) | ||
|
|
||
| DETECTABLE_STAGES = ['primary', 'secondary', 'early_latent', 'late_latent'] |
There was a problem hiding this comment.
what are the 'non-detectable stages'? or is this just a test
| df.at[person, 'ps_congenital_syphilis'] = True | ||
| pregnancy_helper_functions.store_dalys_in_mni( | ||
| person, mni, 'congenital_syphilis_onset', module.sim.date | ||
| ) |
There was a problem hiding this comment.
why does congenital infection have its own DALY weight attached?
| future_stillbirth_weeks = [ | ||
| week for week in CONGENITAL_SYPHILIS_STILLBIRTH_CHECKPOINTS | ||
| if week >= gestation_of_interest | ||
| ] |
There was a problem hiding this comment.
Can you explain whats happening here?
| df.at[child_id, 'nb_early_preterm'] = False | ||
| df.at[child_id, 'nb_late_preterm'] = False | ||
| df.at[child_id, 'nb_preterm_birth_disab'] = 'none' | ||
| self.sim.modules['Syphilis'].do_newborn_congenital_syphilis_handoff(mother_id, child_id) |
There was a problem hiding this comment.
i would move this until after the properties are set and then add a comment explaining whats happening
There was a problem hiding this comment.
also - currently there are no newborn outcomes (death/disability) associated with congential syphils. is that the case?
|
|
||
| # We assume that treatment is 100% effective at curing infection | ||
| df.at[person_id, 'ps_syphilis'] = False | ||
| self.sim.modules['Syphilis'].treat_maternal_syphilis(person_id) |
There was a problem hiding this comment.
ok if this is the approach thats doing to be taken we need to review the parameters which determine if screening etc are delivered because currently treatment is essentially never delivered
|
|
||
|
|
||
| def test_congenital_syphilis_stillbirth_risk_is_drawn_once_at_transmission(seed): | ||
| """Changing congenital stillbirth risk after infection should not create later repeated draws.""" |
There was a problem hiding this comment.
i dont follow the logic of this test! maybe some more description needed
|
|
||
|
|
||
| def test_assigned_congenital_syphilis_stillbirth_is_applied_at_next_checkpoint(seed): | ||
| """A congenital syphilis stillbirth assigned at infection should be applied at the next stillbirth checkpoint.""" |
There was a problem hiding this comment.
i understand the logic here - is there an epidemiological reason as to why you cant apply risk of congenital infection and stillbirth in the same month?
Summary
This PR introduces a Syphilis module for the TLO model, focusing on maternal infection during pregnancy and its potential consequences for the fetus and newborn.
The current implementation establishes the core disease mechanics required before calibration, intervention analysis, and epidemiological validation.
Changes introduced
The module represents:
Validation
A dedicated
tests/test_syphilis.pytest file has been added to validate the module’s core behaviour, including:Current status
This PR focuses on establishing and reviewing the core disease mechanics. Calibration and full epidemiological validation are outside the scope of this PR.
Further work will include:
PregnancySupervisor,CareOfWomenDuringPregnancy, andNewbornOutcomesProgresses #1884