MyOscar Integration with Cron like Syncronization Design

Since working on this project requires pulling data from a medical device and pushing that data to MyOscar. One barrier to overcome is the how many clients will be making concurrent request to MyOscar Personal Health Record System.
Could this pose a problem for the application developer that will maintain this system in the future?
As one of the research assistant in charge of designing this mobile integration software, I have to look far into the future. Some problems like size of data can cause a problem when storing heart beat data which comes in every second. I’ve implemented a solution to address that problem by persist the data in JSON format and storing it in sqlite. Here is an example:
{ 'Reading' : '[0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]' ,
'theshold' : '[{'reading' : '0', 'over' : '20.0' },{'reading' : '1', 'over' : '20.0' },
{'reading' : '2', 'over' : '20.0' },{'reading' : '3', 'over' : '20.0' },
{'reading' : '4', 'over' : '20.0' },{'reading' : '5', 'over' : '20.0' },
{'reading' : '6', 'over' : '20.0' },{'reading' : '7', 'over' : '20.0' },
{'reading' : '8', 'over' : '20.0' },{'reading' : '9', 'over' : '20.0' }]'

Concurrent Request All Day on Client Phone

The next problem was concurrent request being sent from multiple phones multiple times a day will cause problems for the application and the user may incur expenses when heavy network usage is done all day. In light of that I’ve designed a system to synchronize MyOscar data at a 24 hour interval like a cron job in Linux. After doing some research on either implementing it from scratch or working on top of an already existing open source solution. I came across CWAC-Wakeful Service library. I’ve implemented an error message notification that will appear at the top when an error occurs on the clients phone when synchronization with MyOscar fails for the following reason:
  • No Network available
  • Web Service Error
  • Not Authenticated to MyOscar
  • Any Unknown error
I am still in the process of implementing this solution but from what I gathered. When the phone is rebooted android will not remember unless I set a broadcast receiver to remember this service.Here is the XML required to make this happen.
<action android:name="android.intent.action.BOOT_COMPLETED" />

Here is a link if someone is trying to implement a similar solution:

In conclusion, data synchronized at a specific interval will be a solution for this project and the users using this software.
Till next time

Zak Hassan
/ Software Developer & Research Assistant – NexJExpress Team


Seneca Centre for Development of Open Technology, Research Department – Seneca College

Office: 416-4915050 ext. 3548

70 The Pond Road
Toronto, Ontario
M3J 3M6

“Time is the coin of life. Only you can determine how it will be spent.”

— Carl Sandburg


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s