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.
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.