SMS Notifications - Out of Box Problem

manxmen wrote on Tuesday, July 28, 2015:

Hi,

We have a fresh install of OpenEMR 4.2 and are trying to use the SMS Notification system. We had problems getting it to work and eventually did with hard coding, but not sure if what we did is correct or how we should fix the problem for all to use.

We have a Clickatell account. We entered the user/pw/APid with 1hr checking in Administration/Globals/Notifications, then allowed SMS messages on patient demographics, and made an appointment but nothing happened.

We came accross an article by Dr. Arnab Naha http://www.open-emr.org/wiki/index.php/Sms_and_Email_Notification_Howtos with information about messages/crons.

To get it to work:

NOTE: # = *

1: As they did not appear to be passed from “cron_sms_notification.php” to “sms_clickatell.php” we hard coded the following into “sms_clickatell.php”.
var $api_id = “APid”;
var $user = “user”;
var $password = “pw”;

2: In table “automatic_notification” record 1 the sms record, we entered the following:
Change “provider name” to “Provider”
Change “email subject” to “Reminder Notification”
Change “email sender” to “Sender”
Change “message” to "Good Day ###NAME###, confirming your appointment on ###DATE### for ###STARTTIME### - ###ENDTIME### with ###PROVIDER### "

3: Then created a cron:
$ sudo crontab -e
Add the following line:
“# #/1 # # # /home/supervisor/vhosts/emr/htdocs/modules/sms_email_reminder/cron_sms_notification.php”

4: Then created a appointment and tested the link with https://ipaddress/modules/sms_email_reminder/cron_sms_notification.php.

5: The result was:
Total 1 Records Found DEBUG :: sms was sent to= 9999999999 sender= Sender sbj= Reminder Notification msg= Good Day patient name, confirming your appointment on Tuesday July 28, 2015 for 11:00 AM - 11:15:00 with ###PROVIDER### Cannot open file (/cronlog_20150728.html)

Message was received on my phone but there is a problem with:
###PROVIDER### annotation
Cannot open file (/cronlog_20150728.html)

Many thanks,
Terry Wild

fsgl wrote on Tuesday, July 28, 2015:

I cannot recall any other successful implementation except with Twilio.

kanoberson wrote on Tuesday, August 04, 2015:

I live in the Pacific Islands. I am implementing OpenEMR to be used by the community health centers here in Micronesia. We do not have companies providing sms gateway service here. After doing research I found a hardware device with api code samples. This device is SMSEagle.
I wonder if there is a way to modify a PHP file in OpenEMR that sends sms to a gateway to work with this device. Our telecommunication company is willing to give us unlimited texting account for this project.
code sample is:

<?php $base_url = 'http://url-of-smseagle/index.php/http_api/send_sms'; $params = array( 'login' => 'john', 'pass' => 'doe', 'to' => '1234567', 'message' => "my message", ); $data = '?'.http_build_query($params); $ret = fopen($base_url.$data,'r'); $result = fread($ret,1024); fclose($ret); if (substr($result,0,2) == "OK") { echo "Message has been sent successfully!"; } else { echo "Send message failed!"; } ?>

Thank you

penguin8r wrote on Tuesday, March 08, 2016:

Note for anyone who might be interested in SMS notifications, as of 3/8/2016, none of these functions are working. Will update when progress is made, currently testing/troubleshooting with Clickatell as the SMS gateway.

UPDATE: 3/17/2016 , turns out this is bug riddled code from 2008, there is a fair amount of work to be done, but the basic concept of transmitting SMS via Clickatell (at least for US based practices) is viable. The existing PHP functions in /modules/sms_email_reminder are quite outdated and were broken to begin with, but it is fixable.