OHDSI / Era-Constructor

This is a repo that contains standardized code for hte construction of Drug Eras, Dose Eras and Condition Eras
2 stars 8 forks source link

Era end_date logic should consider a person's death #6

Open mananp414 opened 6 years ago

mananp414 commented 6 years ago

When drug_exposure_end_date is null, the era table logic will try to calculate it. It does this by adding day_supply to the start_date. Problem is it doesn't take into consideration that the person may be deceased. I think we should check the death table when making this calculation so that the resulting drug_era_end_date is not past the person's death_date.

This can apply to other era tables as well.