Exemplo n.º 1
0
 /** Retrieves message to be send from database and passes to SMSManager instance */
 public void run() {
   String message = "";
   if (this.SMS_TYPE == ALERT_TYPE) {
     message = getMessageContent(patient.getMsgId());
     updateAlertCount();
     logger.debug("Sending \n message:" + message + "\n Phone Number:" + patient.getPhoneNumber());
     new SMSManager(patient).sendSMS(message);
   } else if (this.SMS_TYPE == FOLLOWUP_TYPE) {
     // TODO: Get actual phonenumbers
     String pnumber = "9160741100";
     message = followupQstn.getQstn();
     int count = 0;
     for (FollowupChoice followupChoice : getFollowupChoices(followupQstn.getFid())) {
       count++;
       message += "\n" + count + ". " + followupChoice.getChoice();
     }
     int followupCacheId = getCacheId(followupQstn.getFid());
     message +=
         "\n"
             + "Type "
             + FOLLOWUP_KEYWORD
             + " "
             + followupCacheId
             + " (your option)to send your option.";
     new SMSManager(followupQstn).sendSMS(pnumber, message);
   }
 }