refactored the patient adherence table to be compatible with latest database structure