From acde2c234611164ae379a066d1a434f962591895 Mon Sep 17 00:00:00 2001 From: visolve-openemr Date: Fri, 11 May 2012 13:08:06 +0530 Subject: [PATCH] Optimized the Batch communication tool --- interface/batchcom/batchEmail.php | 9 +-- interface/batchcom/batchPhoneList.php | 29 ++++---- interface/batchcom/batchcom.css | 22 +++++- interface/batchcom/batchcom.php | 126 +++++++++++++++++++++------------- 4 files changed, 117 insertions(+), 69 deletions(-) diff --git a/interface/batchcom/batchEmail.php b/interface/batchcom/batchEmail.php index 46d20e603..d76d1bc4d 100644 --- a/interface/batchcom/batchEmail.php +++ b/interface/batchcom/batchEmail.php @@ -16,6 +16,9 @@

+ +

+ Email sent to $pt_name at $pt_email"); - $patient_id=$row['id']; - register_email($patient_id, $sent_by, $msg_type, $email_subject, $email_body ); + echo ("
" . xl('Email sent to') . ": " . text($pt_name) . " , " . text($pt_email) . "
"); } else { $m_error=TRUE; @@ -53,7 +54,7 @@ while ($row=sqlFetchArray($res)) { } if ($m_error) { - echo ("xl('Could not send email due to a server problem, ','','
). $m_error_count . xl(' emails not sent','','','
')"); + echo (xl('Could not send email due to a server problem. ','','
'). $m_error_count . xl(' emails not sent','','')); } ?> diff --git a/interface/batchcom/batchPhoneList.php b/interface/batchcom/batchPhoneList.php index 835c9da9f..2ebefebe9 100644 --- a/interface/batchcom/batchPhoneList.php +++ b/interface/batchcom/batchPhoneList.php @@ -16,29 +16,30 @@

+ +

"); //will do css - -echo ("".xl('Name') .""); -echo ("".xl('DOB') .""); -echo ("".xl('Home').""); -echo ("".xl('Work') .""); -echo ("".xl('Contact') .""); -echo ("".$Cell."\n"); +echo (""); //will do css +echo (""); +echo (""); +echo (""); +echo (""); +echo (""); +echo ("\n"); while ($row=sqlFetchArray($res)) { - echo (""); - echo (""); - echo (""); - echo (""); - echo (""); - echo ("\n"); + echo (""); + echo (""); + echo (""); + echo (""); + echo ("\n"); } echo ("
".xl('Name') ."".xl('DOB') ."".xl('Home')."".xl('Work') ."".xl('Contact') ."".xl('Cell') ."
${row['title']} "); + echo ("
${row['title']} "); echo ("${row['fname']} "); echo ("${row['lname']} ${row['DOB']} ${row['phone_home']} ${row['phone_biz']} ${row['phone_contact']} ${row['phone_cell']}
${row['DOB']} ${row['phone_home']} ${row['phone_biz']} ${row['phone_contact']} ${row['phone_cell']}
"); diff --git a/interface/batchcom/batchcom.css b/interface/batchcom/batchcom.css index a4618a40e..6700da54e 100644 --- a/interface/batchcom/batchcom.css +++ b/interface/batchcom/batchcom.css @@ -2,7 +2,25 @@ margin: 20px; border: thin blue } - +.table { + font-size: 13px; + } +.body_top { + font-size: 0.8em; + } + .help { - } \ No newline at end of file + } + +table.batchcom th { + font-size:0.8em; + } +table.batchcom td { + font-size:0.8em; +} +.pclist { + font-size:0.9em; + font-weight:bold; +} + diff --git a/interface/batchcom/batchcom.php b/interface/batchcom/batchcom.php index 61604206a..ac8dc028c 100644 --- a/interface/batchcom/batchcom.php +++ b/interface/batchcom/batchcom.php @@ -47,13 +47,8 @@ if ($_POST['form_action']=='Process') { //process sql 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 - "; - + + $sql="select patient_data.*, cal_events.pc_eventDate as next_appt,cal_events.pc_startTime as appt_start_time,cal_date.last_appt,forms.last_visit from patient_data left outer join openemr_postcalendar_events as cal_events on patient_data.pid=cal_events.pc_pid and curdate() < cal_events.pc_eventDate left outer join (select pc_pid,max(pc_eventDate) as last_appt from openemr_postcalendar_events where curdate() >= pc_eventDate group by pc_pid ) as cal_date on cal_date.pc_pid=patient_data.pid left outer join (select pid,max(date) as last_visit from forms where curdate() >= date group by pid) as forms on forms.pid=patient_data.pid"; //appointment dates if ($_POST['app_s']!=0 AND $_POST['app_s']!='') { $and=where_or_and ($and); @@ -68,11 +63,11 @@ if ($_POST['form_action']=='Process') { // encounter dates if ($_POST['seen_since']!=0 AND $_POST['seen_since']!='') { $and=where_or_and ($and); - $sql.=" $and forms2.date > '".$_POST['seen_since']."' " ; + $sql.=" $and forms.date > '".$_POST['seen_since']."' " ; } if ($_POST['seen_upto']!=0 AND $_POST['not_seen_since']!='') { $and=where_or_and ($and); - $sql.=" $and forms2.date > '".$_POST['seen_since']."' " ; + $sql.=" $and forms.date > '".$_POST['seen_since']."' " ; } // age @@ -104,21 +99,33 @@ if ($_POST['form_action']=='Process') { break; endswitch; - // add to complete query sintax - $sql.=' GROUP BY patient_data.pid'; - // sort by $sql.=' ORDER BY '.$_POST['sort_by']; - - // echo $sql; + //echo $sql; // send query for results. $res = sqlStatement($sql); // if no results. if (mysql_num_rows($res)==0){ - - echo (xl('No results, please try again.','','
')); - + ?> + + + + + + + + + + + + + +

+
+ ')); + ?>
-
-
-
+
+ + + + + + + + + + + + + + + + + + + + + + + +
$form_err

"); } - - xl('Process','e')?>:
+   
-
:
-
- : : - :, : +
  
+ : : + :, : : +
-
:, : : - - : :, :
: + > -
:, : : :
+ + :, : : + > 
-
:, : : :, :
: -
:
 
+ : -
() -
: -
: -
-
+
  
+ ()   
+ :  
+ :  
+    
+    
-
> - - + >
  
+
+ -- 2.11.4.GIT