connected medication table population to database retrieval method