-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: derive_var_dthcaus does not work as expected when DEATH stored in AE and DS #2154
Comments
Also, I think if info about death coming from both AE and DS, we should look at AE, regardless of dates. |
agree @millerg23 AE always has more granular info of the cause of death than DS |
I wonder if we could have more control over the options, I think always ordering within domain makes sense, but maybe we can have an option of selecting first based on domain (order of source list), and also have option to take earliest across domains, it should then cater for most scenarios?
The new option wouls be to swtich these to order by source list then dates:
|
Anyone want to go bug hunting? @pharmaverse/admiral |
I agree that we should implement this option but I would not implement it in |
What happened?
User reported they had DEATH recorded both in AE and DS with same date. admiral was selecting DS, but according to documentation the AE source was passed in first so should have been selected.
I reviewed the unit tests for this function, and it is not well tested for this, no tests had death recorded in both AE and DS and AE death was earliest, or dates matched.
Session Information
No response
Reproducible Example
Test code as follows:
For PAT01 the DS record is erroneously selected.
When reviewing function on line 187 -188 we have the following:
This is inside the loop
When the lines are moved to just before the loop, the code works as expected:
We don't want a new temp var created for each loop, as then only the last source object has anything populated for the last temporary vars. This is why if DEATH in both AE and DS, only the last source object passed in is used for a subject, regardless of dates.
The text was updated successfully, but these errors were encountered: