4848 wasting ,
4949)
5050
51- class GenerateDataChains (BaseScenario ):
51+ class GenerateEventChains (BaseScenario ):
5252 def __init__ (self ):
5353 super ().__init__ ()
5454 self .seed = 42
@@ -71,101 +71,30 @@ def log_configuration(self):
7171 'tlo.methods.demography.detail' : logging .WARNING ,
7272 'tlo.methods.healthburden' : logging .INFO ,
7373 'tlo.methods.healthsystem.summary' : logging .INFO ,
74+ 'tlo.methods.collect_event_chains' : logging .INFO
7475 }
7576 }
7677
7778 def modules (self ):
78- # MODIFY
79- # Here instead of running full module
80- """
81- return [demography.Demography(resourcefilepath=self.resources),
82- enhanced_lifestyle.Lifestyle(resourcefilepath=self.resources),
83- healthburden.HealthBurden(resourcefilepath=self.resources),
84- symptommanager.SymptomManager(resourcefilepath=self.resources, spurious_symptoms=False),#,
85- #rti.RTI(resourcefilepath=self.resources),
86- pregnancy_supervisor.PregnancySupervisor(resourcefilepath=self.resources),
87- labour.Labour(resourcefilepath=self.resources),
88- care_of_women_during_pregnancy.CareOfWomenDuringPregnancy(resourcefilepath=self.resources),
89- contraception.Contraception(resourcefilepath=self.resources),
90- newborn_outcomes.NewbornOutcomes(resourcefilepath=self.resources),
91- postnatal_supervisor.PostnatalSupervisor(resourcefilepath=self.resources),
92- hiv.Hiv(resourcefilepath=self.resources),
93- tb.Tb(resourcefilepath=self.resources),
94- epi.Epi(resourcefilepath=self.resources),
95- healthseekingbehaviour.HealthSeekingBehaviour(resourcefilepath=self.resources),
96- #simplified_births.SimplifiedBirths(resourcefilepath=resourcefilepath),
97- healthsystem.HealthSystem(resourcefilepath=self.resources,
98- mode_appt_constraints=1,
99- cons_availability='all')]
100- """
10179 return (
102- fullmodel (resourcefilepath = self .resources )
103- + [ImprovedHealthSystemAndCareSeekingScenarioSwitcher (resourcefilepath = self .resources )]
80+ fullmodel ()
10481 )
105- """
106- def draw_parameters(self, draw_number, rng):
107- return mix_scenarios(
108- get_parameters_for_status_quo(),
109- {
110- 'HealthSystem': {
111- 'Service_Availability': list(self._scenarios.values())[draw_number],
112- },
113- }
114- )
115-
116- def _get_scenarios(self) -> Dict[str, list[str]]:
117- Return the Dict with values for the parameter `Service_Availability` keyed by a name for the scenario.
118- The sequences of scenarios systematically omits one of the TREATMENT_ID's that is defined in the model.
11982
120- # Generate list of TREATMENT_IDs and filter to the resolution needed
121- treatments = get_filtered_treatment_ids(depth=2)
122- treatments_RTI = [item for item in treatments if 'Rti' in item]
123-
124- # Return 'Service_Availability' values, with scenarios for everything, nothing, and ones for which each
125- # treatment is omitted
126- service_availability = dict({"Everything": ["*", "Nothing": []})
127- #service_availability.update(
128- # {f"No {t.replace('_*', '*')}": [x for x in treatments if x != t] for t in treatments_RTI}
129- #)
130-
131- return service_availability
132-
133- """
13483 def draw_parameters (self , draw_number , rng ):
13584 if draw_number < self .number_of_draws :
13685 return list (self ._scenarios .values ())[draw_number ]
13786 else :
13887 return
13988
140- # case 1: gfHE = -0.030, factor = 1.01074
141- # case 2: gfHE = -0.020, factor = 1.02116
142- # case 3: gfHE = -0.015, factor = 1.02637
143- # case 4: gfHE = 0.015, factor = 1.05763
144- # case 5: gfHE = 0.020, factor = 1.06284
145- # case 6: gfHE = 0.030, factor = 1.07326
146-
14789 def _get_scenarios (self ) -> Dict [str , Dict ]:
148- #Return the Dict with values for the parameters that are changed, keyed by a name for the scenario.
149-
150- treatments = get_filtered_treatment_ids (depth = 2 )
151- treatments_RTI = [item for item in treatments if 'Rti' in item ]
152-
153- # Return 'Service_Availability' values, with scenarios for everything, nothing, and ones for which each
154- # treatment is omitted
155- service_availability = dict ({"Everything" : ["*" ], "Nothing" : []})
156- service_availability .update (
157- {f"No { t .replace ('_*' , '*' )} " : [x for x in treatments if x != t ] for t in treatments_RTI }
158- )
159- print (service_availability .keys ())
16090
16191 return {
162- # =========== STATUS QUO ============
16392 "Baseline" :
16493 mix_scenarios (
16594 self ._baseline (),
16695 {
167- "HealthSystem " : {
168- "Service_Availability " : service_availability [ "No Rti_ShockTreatment*" ] ,
96+ "CollectEventChains " : {
97+ "generate_event_chains " : True ,
16998 },
17099 }
171100 ),
0 commit comments