Commit
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -945,6 +945,29 @@ | |
'', // default | ||
xl('API key for SMS Gateway.') | ||
), | ||
|
||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
'TWILIO_ACCOUNT_SID' => array( | ||
This comment has been minimized.
Sorry, something went wrong. |
||
xl('Twilio Account Sid'), | ||
'text', // data type | ||
'', // default | ||
xl('Account Sid for Twilio.') | ||
), | ||
'TWILIO_AUTHTOKEN' => array( | ||
This comment has been minimized.
Sorry, something went wrong. |
||
xl('Twilio Auth Token'), | ||
'text', // data type | ||
'', // default | ||
xl('Auth Token for Twilio.') | ||
), | ||
|
||
'TWILIO_FROM' => array( | ||
This comment has been minimized.
Sorry, something went wrong. |
||
xl('Twilio From name'), | ||
'text', // data type | ||
'', // default | ||
xl('Twilio From name') | ||
), | ||
|
||
|
||
|
||
'phone_notification_hour' => array( | ||
xl('Phone Notification Hour'), | ||
|
@@ -1049,32 +1072,6 @@ | |
'1', // default | ||
xl('Enable Reporting of Tracking Date For Automated Measure Calculations (AMC)') | ||
), | ||
|
||
'cdr_report_nice' => array( | ||
xl('CDR Reports Processing Priority'), | ||
array( | ||
'' => xl('Default Priority'), | ||
'5' => xl('Moderate Priority'), | ||
'10' => xl('Moderate/Low Priority'), | ||
'15' => xl('Low Priority'), | ||
'20' => xl('Lowest Priority') | ||
), | ||
'', // default | ||
xl('Set processing priority for CDR engine based reports.') | ||
), | ||
|
||
'pat_rem_clin_nice' => array( | ||
xl('Patient Reminder Creation Processing Priority'), | ||
array( | ||
'' => xl('Default Priority'), | ||
'5' => xl('Moderate Priority'), | ||
'10' => xl('Moderate/Low Priority'), | ||
'15' => xl('Low Priority'), | ||
'20' => xl('Lowest Priority') | ||
), | ||
'', // default | ||
xl('Set processing priority for creation of Patient Reminders (in full clinic mode).') | ||
), | ||
This comment has been minimized.
Sorry, something went wrong.
bradymiller
Author
Owner
|
||
|
||
), | ||
|
||
|
@@ -1138,13 +1135,6 @@ | |
xl('Enable logging of all SQL SELECT queries.').' ('.xl('Note that Audit Logging needs to be enabled above').')' | ||
), | ||
|
||
'audit_events_cdr' => array( | ||
xl('Audit CDR Engine Queries'), | ||
'bool', // data type | ||
'0', // default | ||
xl('Enable logging of CDR Engine Queries.').' ('.xl('Note that Audit Logging needs to be enabled above').')' | ||
), | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
bradymiller
Author
Owner
|
||
'enable_atna_audit' => array( | ||
xl('Enable ATNA Auditing'), | ||
'bool', // data type | ||
|
@@ -1375,13 +1365,6 @@ | |
xl('Enable Offsite Patient Portal.') | ||
), | ||
|
||
'portal_offsite_providerid' => array( | ||
xl('Offsite Patient Portal Provider ID'), | ||
'text', // data type | ||
'', | ||
xl('Offsite Patient Portal Provider ID(Put Blank If not Registered).') | ||
), | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
bradymiller
Author
Owner
|
||
'portal_offsite_username' => array( | ||
xl('Offsite Patient Portal Username'), | ||
'text', // data type | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,9 @@ | |
|
||
// email notification | ||
$ignoreAuth=1; | ||
include_once("../../interface/globals.php"); | ||
include_once("cron_functions.php"); | ||
//print_r($_SERVER); | ||
This comment has been minimized.
Sorry, something went wrong. |
||
include_once("/var/www/openemr/interface/globals.php"); | ||
include_once("/var/www/openemr/modules/sms_email_reminder/cron_functions.php"); | ||
This comment has been minimized.
Sorry, something went wrong.
bradymiller
Author
Owner
|
||
|
||
// check command line for quite option | ||
$bTestRun = 0; | ||
|
@@ -36,13 +37,51 @@ | |
|
||
// object for sms | ||
global $mysms; | ||
$sql="select * from globals where gl_name in ('TWILIO_ACCOUNT_SID','TWILIO_AUTHTOKEN','TWILIO_FROM')"; | ||
$q=mysql_query($sql); | ||
while($r=mysql_fetch_assoc($q)){ | ||
if($r['gl_name']=='TWILIO_ACCOUNT_SID') | ||
$AccountSid=$r['gl_value']; | ||
if($r['gl_name']=='TWILIO_AUTHTOKEN') | ||
$AuthToken=$r['gl_value']; | ||
if($r['gl_name']=='TWILIO_FROM') | ||
$from=$r['gl_value']; | ||
} | ||
This comment has been minimized.
Sorry, something went wrong.
bradymiller
Author
Owner
|
||
if($AccountSid) | ||
This comment has been minimized.
Sorry, something went wrong.
bradymiller
Author
Owner
|
||
{ | ||
include_once("/var/www/openemr/modules/sms_email_reminder/sendnotifications.php"); | ||
This comment has been minimized.
Sorry, something went wrong.
bradymiller
Author
Owner
|
||
}else | ||
if( $db_email_msg['sms_gateway_type']=='CLICKATELL' ) | ||
{ | ||
include_once("sms_clickatell.php"); | ||
include_once("/var/www/openemr/modules/sms_email_reminder/sms_clickatell.php"); | ||
This comment has been minimized.
Sorry, something went wrong.
bradymiller
Author
Owner
|
||
|
||
}else if($db_email_msg['sms_gateway_type']=='TMB4') | ||
{ | ||
include_once("sms_tmb4.php"); | ||
include_once("/var/www/openemr/modules/sms_email_reminder/sms_tmb4.php"); | ||
This comment has been minimized.
Sorry, something went wrong.
bradymiller
Author
Owner
|
||
} | ||
|
||
function mysql2dmy($input) { | ||
|
||
$output = false; | ||
|
||
$input1 = $input; | ||
|
||
$input = substr($input, 0, 10); | ||
|
||
$d = explode('-', $input); | ||
|
||
if (is_array($d) && count($d) >= 3) { | ||
|
||
if (checkdate($d[1], $d[2], $d[0]) || ($d[2] == "00" && $d[1] == "00")) { | ||
|
||
$output = "$d[2]/$d[1]/$d[0]"; | ||
} | ||
|
||
if (substr($input1, 11)) | ||
$output.=" " . substr($input1, 11); | ||
} | ||
|
||
return $output; | ||
} | ||
|
||
// get notification settings | ||
|
@@ -56,6 +95,7 @@ | |
//echo "\nDEBUG :: user=".$vectNotificationSettings['SMS_gateway_username']."\n"; | ||
|
||
// create sms object | ||
if($AccountSid=='') | ||
$mysms = new sms( $SMS_GATEWAY_USENAME, $SMS_GATEWAY_PASSWORD, $SMS_GATEWAY_APIKEY ); | ||
|
||
$db_patient = cron_getAlertpatientData($TYPE); | ||
|
@@ -69,14 +109,13 @@ | |
//echo "\n-----\nDEBUG :cron_sms: found patient = ".$prow['fname']." ".$prow['lname']."\n"; | ||
|
||
// my_print_r($prow); | ||
/* | ||
This comment has been minimized.
Sorry, something went wrong.
bradymiller
Author
Owner
|
||
|
||
if($prow['pc_eventDate'] < $check_date) | ||
{ | ||
$app_date = date("Y-m-d")." ".$prow['pc_startTime']; | ||
}else{ | ||
$app_date = $prow['pc_eventDate']." ".$prow['pc_startTime']; | ||
} | ||
*/ | ||
$app_date = $prow['pc_eventDate']." ".$prow['pc_startTime']; | ||
$app_time = strtotime($app_date); | ||
|
||
|
@@ -85,7 +124,6 @@ | |
|
||
$remaining_app_hour = round($app_time_hour - $curr_total_hour); | ||
$remain_hour = round($remaining_app_hour - $SMS_NOTIFICATION_HOUR); | ||
|
||
// larry :: debug | ||
//echo "\nDEBUG :: checkdate=$check_date, app_date=$app_date, apptime=$app_time remain_hour=$remain_hour -- CRON_TIME=$CRON_TIME\n"; | ||
|
||
|
@@ -100,10 +138,18 @@ | |
cron_InsertNotificationLogEntry($TYPE,$prow,$db_email_msg); | ||
|
||
//set message | ||
$db_email_msg['message'] = cron_setmessage($prow,$db_email_msg); | ||
$db_email_msg['message'] = "This is a reminder of your appointment with Vijay Optica on ".mysql2dmy($app_date).". Thank you.";//cron_setmessage($prow,$db_email_msg); | ||
This comment has been minimized.
Sorry, something went wrong.
bradymiller
Author
Owner
|
||
|
||
// send sms to patinet - if not in test mode | ||
if( $bTestRun == 0 ) | ||
//echo $AccountSid; | ||
This comment has been minimized.
Sorry, something went wrong. |
||
if($AccountSid){ | ||
This comment has been minimized.
Sorry, something went wrong.
bradymiller
Author
Owner
|
||
$people=array( | ||
$prow['phone_cell']=>"Patient" | ||
); | ||
$body=$db_email_msg['message']; | ||
sendtsms($AccountSid, $AuthToken, $from, $people, $body); | ||
} | ||
elseif( $bTestRun == 0 ) | ||
{ | ||
cron_SendSMS( $prow['phone_cell'], $db_email_msg['email_subject'], | ||
$db_email_msg['message'], $db_email_msg['email_sender'] ); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
/* Send an SMS using Twilio. You can run this file 3 different ways: | ||
* | ||
* - Save it as sendnotifications.php and at the command line, run | ||
* php sendnotifications.php | ||
* | ||
* - Upload it to a web host and load mywebhost.com/sendnotifications.php | ||
* in a web browser. | ||
* - Download a local server like WAMP, MAMP or XAMPP. Point the web root | ||
* directory to the folder containing this file, and load | ||
* localhost:8888/sendnotifications.php in a web browser. | ||
*/ | ||
This comment has been minimized.
Sorry, something went wrong.
bradymiller
Author
Owner
|
||
// Include the PHP Twilio library. You need to download the library from | ||
// twilio.com/docs/libraries, and move it into the folder containing this | ||
// file. | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
|
||
require "twilio/Services/Twilio.php"; | ||
function sendtsms($AccountSid,$AuthToken,$from,$people,$body){ | ||
// Set our AccountSid and AuthToken from twilio.com/user/account | ||
//$AccountSid = "AC32fb0536abf15c7e01025c4e82ac5d5a"; | ||
//$AuthToken = "98f097691adf92aab71888233aa3bd0a"; | ||
|
||
// Instantiate a new Twilio Rest Client | ||
$client = new Services_Twilio($AccountSid, $AuthToken); | ||
|
||
/* Your Twilio Number or Outgoing Caller ID */ | ||
//$from = '+919924927267'; | ||
|
||
// make an associative array of server admins. Feel free to change/add your | ||
// own phone number and name here. | ||
/*$people = array( | ||
"9924927267" => "Johnny", | ||
"4158675310" => "Helen", | ||
"4158675311" => "Virgil", | ||
);*/ | ||
|
||
// Iterate over all admins in the $people array. $to is the phone number, | ||
// $name is the user's name | ||
foreach ($people as $to => $name) { | ||
// Send a new outgoing SMS */ | ||
//$body = "Bad news $name, the server is down and it needs your help"; | ||
$client->account->sms_messages->create($from, $to, $body); | ||
echo "Sent message to $name"; | ||
} | ||
} | ||
?> | ||
This comment has been minimized.
Sorry, something went wrong.
bradymiller
Author
Owner
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
docs/_build/ | ||
vendor/* | ||
composer.lock | ||
composer.phar | ||
coverage | ||
package.xml | ||
*.tgz |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
language: php | ||
php: | ||
- 5.3 | ||
- 5.4 | ||
script: "make test" | ||
before_install: "composer install --dev" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
A huge thanks to all of the contributors to this library. | ||
|
||
In alphabetical order: | ||
|
||
Manuel Amador (Rudd-O) | ||
Adam Ballai (minddog) | ||
Chris Barr (chrisbarr) | ||
John Britton (johndbritton) | ||
Kevin Burke (kevinburke) | ||
Keith Casey (caseysoftware) | ||
Alex Chan (alexcchan) | ||
Kyle Conroy (derferman) | ||
Aaron Foss (aaronfoss) | ||
Trenton McManus (TMcManus) | ||
Shawn Parker (Gipetto) | ||
Bulat Shakirzyanov (avalanche123) | ||
Asher Snyder (noloh) | ||
Neuman Vong (luciferous) | ||
|
2 comments
on commit eb676a4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The modules/sms_email_reminder/twilio package needs to be moved to library/twilio directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review is complete. Look very forward to the next revision.
-brady
Create an additional global here called enable_twilio.