Create date_onset Property in cardio_metabolic_disorders.py#1849
Create date_onset Property in cardio_metabolic_disorders.py#1849
Conversation
|
I thought it would be better to just capture the date_onset of all conditions. Then I could just access |
|
Hi @mnjowe and @tbhallett, |
|
This is well noted @thewati. I will take a look |
|
Hi @thewati. Looking at the use case of this PR, I think adding a property that captures date_onset of all condition will not be a good idea. The model is already heavy and I think we should exhaust all possible alternatives before we decide on introducing a new property. Also I think adding this date_onset property to all conditions while we are interested only in one condition will accumulate some unnecessary computational costs In this case, how about we create a dictionary that maps diabetes individual Ids to their date of diabetes onset? This should only look into diabetes as we are not interested in any other conditions. That way, if you capture their date of onset in Diabetic Retinopathy you can delete the keys in the diabetes dictionary to make it as smaller as possible. What do you think? @tbhallett any thoughts? |
Thanks for pointing this out. I had coded it this way so that anybody can use it in future if needed and also to maintain consistency... But I agree, this will cause unnecessary overhead. I can change this to a dictionary that only stores the date of onset as you suggested |
|
@mnjowe this is now using a dictionary. I'm done |
Creating date_onset property for conditions in the cardio_metabolic_disorders module. Fixes issue #1845. The nc_diabetes_date_onset property will be used in issue #1595