PR to record the prevalence of disease/condition, still births, neonatal death, maternal mortality#1455
PR to record the prevalence of disease/condition, still births, neonatal death, maternal mortality#1455RachelMurray-Watson wants to merge 747 commits intomasterfrom
Conversation
src/tlo/methods/healthburden.py
Outdated
| force_cols=self.recognised_modules_names, | ||
| ) | ||
| self._years_written_to_log += [year] | ||
| def write_to_log_prevalence_monthly(self): |
There was a problem hiding this comment.
Monthly prevalence logs seem reasonable, but bear in mind that some conditions, e.g. malaria can develop and resolve within 1 week. In these cases, we could think about using the clinical counter - which counts episodes of disease. It may not make too much difference but perhaps running a daily then monthly logger and checking if the prevalences vary considerably would be useful.
There was a problem hiding this comment.
I have made this change below
src/tlo/methods/tb.py
Outdated
|
|
||
| return health_values.loc[df.is_alive] | ||
|
|
||
| def report_prevalence(self): |
There was a problem hiding this comment.
I think here we should log only active cases, this way we can compare with WHO reports / GBD etc. Also the way that we assign latent cases is not identical to other models, we don't have infections -> latent -> active so we would under-estimate the latent infections. Best to stick to symptomatic active cases only.
There was a problem hiding this comment.
Okay, that's great to know, thank you!
There was a problem hiding this comment.
Thanks for making the change
| assert (df.dtypes == orig.dtypes).all() | ||
|
|
||
|
|
||
| def find_closest_recording(prevalence, target_date, log_value, column_name, multiply_by_pop): |
There was a problem hiding this comment.
I'm not sure of the usefulness of finding the closest reported prevalence value. Would a useful test perhaps be to check all registered modules are logging prevalence every month and the inverse of this (no prevalence reported if module not registered), or set the incidence to 0 for one disease and check logger not reporting anything above 0, assert prevalence values for 2010 within reasonable range, e.g. test for extreme or unlikely values.
There was a problem hiding this comment.
We had a long discussion about the test yesterday on our call Part II. We decided to include a dummy disease with which to compare prevalences (this will be in the new test file), and to see if the prevalence of what it reports matches with what has been reported it its own logging file.
I suppose by doing it the way that I was doing it, I was trying to see if the calculations themselves were working, as well as the general mechanics of logging. But do you think such a test is unnecessary? And that by showing e.g. with a dummy module and/or what you have suggested above, it would suffice?
tbhallett
left a comment
There was a problem hiding this comment.
just adding here the comment made in-person: I like the way this is being done overall.... and we should add this new method to the Module base class so that it's formally part of the definition of a disease module (in the same way that report_dalys is.)
Grand! Have that done |
(Based on conversation yesterday) - changed so that it is no longer in base class (as not all modules are disease modules), but there is an assertion checking to see that if something uses the healthburden module, it must have the report_prevalence function |
… involved in an RTI
…logged as non-infected
…ges the frequency of logging. Way to move this outside of function? Removed print statements
…d in the script. Then, changed the offset days to 0 and have daily logging,
…%. Added function to avoid repetition
…e test. Still logging monthly
…ng special case conditions
get test on dummy module working refactor mechanics unify naming conventions
* use boolean property for RTI
|
Thanks Rachel. Some things to discuss:
None of this affects you using this for your own purposes. I was just reviewing it with a view to it coming into So, I'm pausing here to discuss....
When we're aligned, I can make those last little changes (refactoring in its own class, updating what the prevalence metric actually is TBD), and get it merged (in the New Year). |
Thanks for making all these changes!!
|
…into rmw/log_prevalence_all_disease # Conflicts: # src/tlo/methods/demography.py
… - the number of individuals of each age and sex with a specific disease/condition. NB - no longer has a denominator, just raw numbers. This replaces the "report_prevalence" that was previously in the healthburden module.
Included file with parameters Redid test to not use HealthBurden Module any more
Fixed line formatting
as not called until after the initialisation
|
closing this PR in favour of #1772 |
The point prevalence is recorded for a number of modules and conditions within modules (Alri, BladderCancer, BreastCancer, CardioMetabolicDisorders ( chronic_ischemic_hd, chronic_kidney_disease, chronic_lower_back_pain, diabetes, hypertension), COPD, Depression, Diarrhoea, Epilepsy, Hiv, Labor (Intrapartum stillbirth), Malaria, Measles, NewbornOutcomes, OesophagealCancer, OtherAdultCancer, PostnatalSupervisor, PregnancySupervisor (Antenatal stillbirth), ProstateCancer, RTI, Schisto, TB, Demography (maternal_deaths, newborn_deaths).
Additional questions:
- Okay to calculate the prevalence of diarrhoea? It is a not really a disease in its own right, more of a symptom
- For some modules (RTI), may be more accurately described by calculating incidence, rather than prevalence. Is that useful/okay? Or should it be skipped?
Other notes:
- COPD is defined as ch_lung_function > 3.
- Have not included events in the CardioMetabolic Module (ever_heart_attack and ever_stroke) as would be a cumulative incidence living people who have had such events