ibe / s3u

IT infrastructure for clinical trials
1 stars 0 forks source link

fine tune notification mails #23

Open tobias-schleinkofer opened 12 years ago

tobias-schleinkofer commented 12 years ago

right now notification mails are sent, if treated patients are found in the eligibilitycheck DB - no matter if the physician has already seen them at the eligibilitycheck interface or not.

Fine tune these notifications so that they are only sent if the DB has really new patients for the physician (so the timestamp of the physician's last log-in will be relevant)

Problably some SQL statements like these will do the job:

select distinct(p.extDocId) from patients p, medical_cases m, diagnoses d, users u where u.extDocId = p.extDocId and u.current_sign_in_at < '2012-07-11 13:46:00' and (p.created_at = '2012-07-11 13:46:00' or m.created_at = '2012-07-11 13:46:00' or d.created_at = '2012-07-11 13:46:00')
select distinct(p.trial_id) from patients p, medical_cases m, diagnoses d where p.created_at => '2012-07-11 13:46:00' or m.created_at => '2012-07-11 13:46:00' or d.created_at => '2012-07-11 13:46:00'
tobias-schleinkofer commented 12 years ago

also add hit counters to these mails (like at the feasibilitycheck notifications)