Brief Description of Modules

IVR and 2 way SMS(https://github.com/atul2512/Raxa_Voice_SMS)

 

Properties files are the heart of the project and should be handle with care

pid-patient uuid

pnumber-patient phone number

alertType-ivr or sms

 

AlertRegistration:Register or UnRegister patient for Raxa Alert.Once a patient register(provide pid,pnumber,preferLanguage and alert(ivr or sms)) it register the patient for the alert.Technically it put patient pid(uuid) and alertType in pAlert and patient table.And at midnight(when there is a change of Date) the pateitn alers are populated.

 

Imp:If for testing purpose (manually) be sure that the patient id is present in both pAlert and patient.

 

RestCall Properties is how the app make rest call.It contains all urls and commands to make a restCall.

 

Dependency:Jackson for jSon parsing

 

Database:Hibernate maps table schema to classes.

 

Dependency:Hibernate

 

hibernate.cfg.xml should reflect the location username and password of database.

 

Any change in table schema should be reflected in corresponding *.hbm.xml

 

AlertMessage:Most important module as far as patients are concerned.MessageTemplate.java controls the content of sms and call.For audo text should be wisely chosen so that translation are proper.

 

Mode:wether to play using tts or prerecorded voice are set through english.properties.1 means via tts and 2 means via pre-recorded audio files.

 

It makes the raxaalert rest Call.

 

 

Scheduler:It uses scheduler and schedule thread every two minutes to check if a patient needs to be called.If yes it calls the patient and handle control to AudioPlayer or it place a message to SMSSender. As it keeps on pinging every 2 mins , it also update the alert table for the next day at midnight.It also updates the alert table for number of tries (i.e retryCount)

 

Note IMP:To save resource I have integrated updating the alert via scheduler.If scheduler is running Updater module should not be run.

 

Tts.properties matches a language to its tts Notation.eg English to en

 

SMSSender:Sends SMS

 

Updater:Checks every 4 hours if there is a change in date.If there is it updates the alert table.

If Scheduler is running there is no need of Updater.


AudioPlayer:It handles both incoming and outgoing call.

 

Incoming Call:Given a message Id it searches for the content and check if the sound to be played should be in voice or using tts.It then updates the database making isExecuted='Y'.

 

If its using prerecorded voice the location of the recorded voice should be located in “preferLangauge.properties” i.e hindi.properties (see AudioFIle/resources) for more details

 

Outgoing Call:When a patient calls in it first checks the database for prefered patietn language.If there are many paitent associate with a number with different prefer Language it just picks the first one.If not found it uses default language.It then ask the patient if he is ok with the language.If not it list out the option to choose a language.

Menu Flow for Outgoing Call(https://docs.google.com/file/d/0B9EiLgV9ewa9NkV3RnZrbG96blE/edit?usp=sharing)

 

Welcome song is played(using TTS.The one that plays use pre recorded are in comment.)

 

The menu is converted to voice using TTS.The menu is listed in english.properties.

 

Imp:The sequence in which options are listed in mainmenu in english.properties should match with mainmenu.properties(which maps patietn option to a keyword).

eg. 1-> register,2->calling a doctor

 

Menu can also be played using pre recorded voice(marked as comment in the code)

 

All Options are played twice if patietn doesnot answer.

 

Dependency:asterisk-java jar file

 

 

Features:

Registration:Register the patient for the service if patietn not registered.

Unsuccessful Registration if patient doesnot exist in the system,

Conveys either successful registration or unsuccessful registration

 

Medicine Reminder:List out the patient medicine Reminder for the whole day.Can be modified easily to get information between a duration.List out the time to take medicine.

eg.Take 3 of acetamide at 6.25 PM

eg.Take 4 of crocin at 8:30 PM

 

UnRegisteration:Unregister the patient from a service if patient exist.

 

Call:Call a doctor or any number.Right now only support calling to a SIP user.

 

ReplySMSHandler:

 

Dependency:Caching using Google Guava.

 

Gives user a sesssion Id when user queries and user has to send it back while making further request on that query.

 

Session time of two hours.If a user don't reply within two hour once he made a query it will expire.

 

The abstract class options is extensively coded.Thus addidng a new feature is matter of 5 minutes job.

 

This are some of typical errors which user may make and reply to it by the system

 

WRONGFORMAT("Sorry your message was of wrong format.")

NULL("Sorry you have sent a blank message.Don't do that Again")

 

Typical error while processing the message:

KEYWORDNOTFOUND("You have entered an invalid Keyword.Use GET MENU to fetch Menu"),

NUMBERNOTRECOGNISED("Sorry your Phone number is not recognised by the system.You may want to register yourself first"),

NOTHINGTOREPLY("Sorry The system has no answer to your query.Start Again or try later"),

INVALIDSESSION("Sorry your session has expired or not created yet.Use GET MENU to fetch Menu"),

INVALIDOPTION("You have entered an invalid Input.Try Again"),

DIFFERNETSESSIONID("You have entered a sesion ID not belong to you.Please check the previous message again and retry");

 

Features:

 

Main-Menu:List Out all the features supported.

 

Get Reminder Now:Fetch Reminder info (between) (currenttime-offset,currenttime+offset).

 

Get Reminder Today:Complete reminder of what patietn is suppose to take today

 

Get Remider Nowon:medicine patietn will have to tak from nowon,

 

Register:Register the patietn to the service if exist.If not,convey the same to the patient.

 

UnRegister:Unregister the patient from the Service if exist.

 

 

Complete description(documentation): 50.112.143.27:8080/docs

 

jar dependency for each module:https://github.com/atul2512/Raxa_Voice_SMS/blob/master/jarDependency