InterSystems IRIS® Interoperability makes it easy to keep track of business services and notifies you if important processes fail through customized SMS alert operations. For example, say your IT team monitors the data routing of mission critical hospital administration content. Staff coverage, call code status, and status updates about the location of providers and contents all must work seamlessly in order to ensure that patients get the necessary care at all times.
InterSystems IRIS can monitor the flow of data through these processes and send alerts should something not go as expected, such as an overload of messages to a process queue, a business process not receiving messages for too long, or a business operation receiving a bad response message. Through rulesets for message routing, InterSystems IRIS can send SMS alerts to the only the IT specialist responsible for the failing business service. That way, on-call surgeons or providers can get SMS alerts corresponding to different patient states, while the on-call IT administrator can be notified of systems issues automatically.
In this exercise, we will build the business operation that processes that message and then sends it to the SMS Gateway service.
Below is a simple text message alert processor based on the EnsLib.HTTP.OutboundAdapter, which can send text alerts via an SMS gateway service. Typically, all that is needed to send an HTTP Post to the gateway service is the destination phone number, a source phone number, credentials, and the URL.
The code below is based on the Anveo gateway, which has the following interface:
https://www.anveo.com/api/v1.asp?apikey=YOURAPIKEY&action=sms&from=FROMPHONE&destination=DESTINATIONPHONE&message=MYMESSAGETEXT
Below is ObjectScript code that generates the text message. Credentials such as the API key have been removed from this sample, but you can try a compiled version of this code by using your InterSystems Learning Lab:
Class Hospital.TextMessageAlert Extends Ens.BusinessOperation { Parameter ADAPTER = "EnsLib.HTTP.OutboundAdapter"; // this forces the settings for the adapter to display no matter what Property Adapter As EnsLib.HTTP.OutboundAdapter; Parameter INVOCATION = "Queue"; /// The phone number that receives the text message alert Property ToPhoneNumber As %String; /// The phone number that generates the text message alert Property FromPhoneNumber As %String; Parameter SETTINGS = "ToPhoneNumber:Mobile"; /// The alert notification Method SendAlert(pRequest As Ens.AlertRequest, Output pResponse As Ens.Response) As %Library.Status { set tSC = $$$OK try { set txtmessage = "An alert from course ISC1065 was generated from "_pRequest.SourceConfigName_" at "_pRequest.AlertTime set txtmessage = txtmessage _ ". Please respond to the issue." // _pRequest.AlertText set destination = ..ToPhoneNumber set action="sms" set apikey = "<Your API Key" set from = "<Your Anveo phone number" set tSC = ..Adapter.Get(.httpResponse,"message,destination,action,apikey,from", txtmessage,destination,action,apikey,from) set pResponse = ##class(Ens.Response).%New() } catch ex { set tSC = ex.AsStatus() } return tSC } }
Service Class | EnsLib.File.PassthroughService |
Service Name | FailingHospitalService |
Enable Now | Unchecked |
Operation Class | Hospital.TextMessageAlert |
Operation Name | Ens.Alert |
Enable Now | Unchecked |
Enabled | Checked |
HTTP Server | www.anveo.com |
URL | /api/v1.asp |
Mobile > ToPhoneNumber | Your phone number including country code, no dashes. For example, 19999999999 |
You have now created an SMS business operation. The code behind this implements the code displayed above, but with real credentials. To test it, double-click the FailingHospitalService business service and click Enable. This will trigger an alert that passes a message to your operation. In a few moments, you will receive an SMS on your phone.
To give you the best possible experience, this site uses cookies and by continuing to use the site you agree that we can save them on your device.