Batch Communication on the works,

andres_paglayan wrote on Wednesday, October 19, 2005:

Hi,
I am writing a little module that will do the folowing,
can send email or generate cvs labels from the patient database,
It displays a menu with several options to filter, age range, gender, insurance,  next appointment range.

andres_paglayan wrote on Friday, October 21, 2005:

I just commited the batchcom module,
As of today it generates a csv for download according to the user choices.
I will add the email sender engine tomorrow,
and the authomatic phone calls for next week, as well as a table that registers the communications in the patient’s chart.
Files touched are,
/interface/usergroup/usergroup_navigation.php for the menu item
/acl_setup.php for adding the privilege to admin
/interface/batchcom for the module

johnjackson wrote on Wednesday, November 16, 2005:

Andre,
I think you have a reference to your local hard drive in your batch com module- Specifically in batchcom.php line 147 your code seems to reference the following-
<script type="text/javascript" src="http://192.168.1.7/e/openemr/library/overlib_mini.js"></script>
<script type="text/javascript" src="http://192.168.1.7/e/openemr/library/calendar.js"></script>

I think the reference should be the following-
<script type="text/javascript" src="http:…/…/openemr/library/overlib_mini.js"></script>
<script type="text/javascript" src="http:…/…/openemr/library/calendar.js"></script>

Thanks
JohnJ
PS- I have checked out the latest version in CVS so I think the problem may still exist…I really like this addition (batchcom) to Openemr and appreciate you efforts in addition to all of the other developer inititives!

andres_paglayan wrote on Wednesday, November 16, 2005:

yep, you were right, thank you for pointing that,
I alrdeady fixed it in the CVS

andres_paglayan wrote on Wednesday, December 07, 2005:

Hi,

Although it looks technically correct, this query in the batchcom module can take several minutes in a 3ghz cpu with 1g ram when run against 2k
patients and 5 months appointment history.

It mostly spends the time building the temp tables.

Any advise is more than welcome.

Thank you,

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
GROUP BY patient_data.pid’

ajperezcrespo wrote on Friday, December 09, 2005:

Shouldn’t this be available to a non authorized users?  Otherwise only the provider can send appointment reminders via email.

andres_paglayan wrote on Friday, December 09, 2005:

I’ll say that depends on the place’s policy,
but yes, a front desk person might need to generate that,
I will put relocating that in my to do list.

sunsetsystems wrote on Monday, January 02, 2006:

Andres, BatchCom as it exists in CVS seems to be broken.  Doing the default query produces this:

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 GROUP BY patient_data.pid ORDER BY patient_data.postal_code ()

The ending parentheses seem odd.

Could you look into this?  Thanks!

– Rod
www.sunsetsystems.com

andres_paglayan wrote on Tuesday, January 03, 2006:

hmm… weird, I had the same files as in the cvs and could not reproduce those parenthesis.
I added the " in the option value= but that shouldn’t have been the problem either.
can you send me a copy of your batchcom.php file to check if there’s something there generating parenthesis?

sunsetsystems wrote on Tuesday, January 03, 2006:

It appears the problem is that DATEDIFF() is not valid prior to MySQL 4.1.1.  We need to support 4.0.x because many current Linux distributions ship with that.

– Rod
www.sunsetsystems.com

andres_paglayan wrote on Wednesday, January 04, 2006:

good catch, I’ll rewrite the query