I do not believe it is configured to allow that. And I believe it is best to keep it that way, since it is so easy to click-copy an email address and then paste it into your individual email program.
YES I believe it could be one of the many unknown benefits for provider client relationship improvements.
But you might be right about just an easy note. But if more complicated issues with many different form input en historic results, it would involve quite a few copy paste efforts. OR what to do if I want to inform all clients with allowed e-mail contact to tell them what doctor is on call every day for emergency interventions? Do I have to copy paste all who had given permission or should I use just an extra database to keep track of yes no features ;-(((
Suppose my client is abroad, not on the beautiful Island of Curacao, but in the Internet Cafe Brazil. He needs to have a copy of his recent prescriptions and his allergies. Also that his test results of recent lab test and his cardio gram. It would be easy if I it could be done with MAKE REPORT => PRESS E_MAIL TO CLIENT = => client happy and received all relevant information. Why else do we want to put into demographics a send e-mails allowed…
Or I want to send 20 clients an e-mail to remind them to have their paptest renewed, or even worse, the 1200 clients who need to get their AH1N1 Mexican/Swineflu vaccination…
So YES I can see many favorable thing to do with an e-mail toward clients. Like the TRANSACTION where the referral can be sent to a collegue.
Hope this can convinse someone to show the way for this e-mail question and client.
I understand your desires, and I do not disagree that a mass mailing has merits. But I don’t see how OpenEMR as currently configured, even through version 3.1.0, can do that. Do you?
OpenEMR is Encounter-centric for billing, and individual patient-centric for almost everything else. While we can SEARCH for patients from a variety of criterion as of 3.1.0, we must still select from that list for any further activity, by keying on that individual in the listing, which basically tosses all the rest of the list away.
Whether it COULD be possible to make a batch emailer, or any other activity on the searched group results, would seem to be a Developer thread, would it not?
now I found a place where the e-mails of clients can be addressed.
It can be found under:
Miscellaneous => Batch Com
For this time I used a PC installation of Windows Xampp Version Demo 3.1.0, and I get the following error message:
ERROR: query failed: SELECT DISTINCT patient_data.* , MAX( cal_events.pc_endDate ) AS last_ap, MAX( forms.date) AS last_visit, (DATEDIFF(CURDATE(),patient_data.DOB)/365.25) AS pat_age FROM patient_data, forms LEFT JOIN openemr_postcalendar_events AS cal_events ON patient_data.pid=cal_events.pc_pid LEFT JOIN forms AS forms2 ON patient_data.pid=forms2.pid WHERE cal_events.pc_eventDate > ‘2009-09-01’ AND cal_events.pc_endDate < ‘2009-09-30’ AND forms2.date > ‘2008-09-01’ GROUP BY patient_data.pid ORDER BY patient_data.lname
Error: Unknown column ‘patient_data.pid’ in ‘on clause’
What went wrong, or what should I do to be able to use this feature?
I have current CVS on my test box and both the CSV and Phone call list work. The email function comes back with the following error.
Email sent to Mr. Juan Delpueblo at info@netmedicpr.comINSERT INTO batchcom SET patient_id=‘1’, sent_by=‘2’, msg_type=‘Email from Batchcom’, msg_subject=‘From your clinic’, msg_text=‘Dear Mr. Juan Delpueblo’, msg_date_sent=NOW() xl(‘Could not send email due to a server problem, ‘,’’,’
). 6 . xl(’ emails not sent’,’’,’’,’
')
Looking into the Apache log files I found the following entry:
sendmail: fatal: www-data(33): No recipient addresses found in message header
I removed postfix (email server) and installed sendmail. The emails are now in the sendmail queue. Now I just need to finetune sendmail and the firewall to make sure they get out.
Pimm,
I think the SQL statement is poorly framed. My SQL is only a little better than my php, so try this with caution – I think the SQL should be:
SELECT DISTINCT patient_data.* , MAX( cal_events.pc_endDate
) AS last_ap, MAX( forms2.date) AS last_visit,
(DATEDIFF(CURDATE(),patient_data.DOB)/365.25) AS pat_age FROM patient_data
LEFT JOIN openemr_postcalendar_events AS cal_events ON patient_data.pid=cal_events.pc_pid
LEFT JOIN forms AS forms2 ON patient_data.pid=forms2.pid
WHERE cal_events.pc_eventDate > ‘2009-09-01’
AND cal_events.pc_endDate < ‘2009-09-30’ AND forms2.date > ‘2008-09-01’
GROUP BY patient_data.pid ORDER BY patient_data.lname;
At least this is properly formed SQL., Let me know if it gives you the results you’re looking for.
Pimm,
If that works, then the offending SQL skeleton is in \interface\batchcom\batchcom.php, and the lines
if (!$form_err) {
$sql="
SELECT DISTINCT patient_data.* , MAX( cal_events.pc_endDate ) AS last_ap, MAX( forms.date) AS last_visit, (DATEDIFF(CURDATE(),patient_data.DOB)/365.25) AS pat_age
FROM patient_data, forms
LEFT JOIN openemr_postcalendar_events AS cal_events ON patient_data.pid=cal_events.pc_pid
LEFT JOIN forms AS forms2 ON patient_data.pid=forms2.pid
";
need to be changed to
if (!$form_err) {
$sql="
SELECT DISTINCT patient_data.* , MAX( cal_events.pc_endDate ) AS last_ap, MAX( forms2.date) AS last_visit, (DATEDIFF(CURDATE(),patient_data.DOB)/365.25) AS pat_age
FROM patient_data
LEFT JOIN openemr_postcalendar_events AS cal_events ON patient_data.pid=cal_events.pc_pid
LEFT JOIN forms AS forms2 ON patient_data.pid=forms2.pid
";
One more consideration re email - look at the batchcom selection criterion and you will see a convoluted at best selector even if the sendmail functionality is made right. It would make at least as much sense to me for us to simply be able to send an email from the left frame select choice listing, although I certainly understand the desire to email a time range for appointments for 'Provider will not be available" messages and such. So I think we need both the batchcom functional and the ability to email to a search results listing.
Brady - do we make this a feature request in the Tracker?
Can you please detail exactly what you did to "sendmail" to make the batchcom function work? If possible, I would like to propose putting the search/sort capabilities as found in 310 patch 2 just posted by Brady as a selectable choice in the batchcom function so it is all in that one spot. But I need to get my arms around what occurs with the choices available. By default, entering nothing in the fields should find ALL, correct? But most people don’t think by the exclusion approach (reverse-polish sortation? preferring instead the inclusion approach, ie what MATCHES. That suggests need for a NOR selection as currently configured to exclude those selection criteria, but the addition of the "All" search from left frame with user checkoff of field and parameter definition.
Brady - since you implemented the frame and the batchcom syntax fix per above (I don’t think I have seen a working copy yet for real data) are you the point man? Should it not get a feature tracker?