Welcome to Tabsched
Tablsched is application that helps you to take right medication, right dosage at the right time. The medication. Users can define the medications, their dosage and when they need to take the medication. The system then send them reminders to take the medicaiton via email’s and/or SMS. The users can then update the database to indicate if they have taken or skipped the medication. This allows to see their historical medication history. The medication stock is also updated which will enable the user to ensure they re-order the medication before they run out of the medication.
Models
-
Journal - All the events are logged in journal table. Example of an event is when a tablet is due to be taken, when a message has been sent to the user, and whether the user has taken or skipped the tablet.
-
Medication - All the medication details.
-
MedicationType - This is a prepopulate table the describes the type of medicaiton - tablets, Liquid, Injection etc.
-
Roster - This table stores the frequency and timing of the when the medication has to be taken.
-
Schedule - This table stores the information regarding the recurring cycle information and when the next medication is due.
-
Timeperiodname - This table is pre-populated to enable users to group their tablets i.e. breakfast,lunch,dinner etc.
-
Timeperiod - The table stores the time specific for the user for each of the periods i.e.
-
User - The table stores user information including the email and telephone number for reminders.
Main functionality
Users
-
can enter the medication details, dosage and frequency on when to take the medication.
-
maintain their profile
-
profile includes - phone number, email address
-
can update the records to indicate if they have taken the medication or skipped it. If they have taken the medication then the stock quantity of the medication is reduced accordingly.
-
can see the history of a particular medication - whether dosage was taken regularly or skipped too many times.
Batch Jobs
-
A batch job called clockwork runs every 2 mins to see if any medication is due. If medication is due it writes a record out for delayed job to process.
Delay Job
-
This job runs all the time and waiting for a record to be written to the delay_job table. It then calls the function that sends out the email and sms to the user to remind them what medication needs to be taken. This function also update the schedule to indicate when the next dosage is due.
Gems used
-ICE Cube - this allowed for a very flexible recurring schedule rules e.g. A tablet could be taken 3 times a week on Mon,Wed and Fri or a monthly on a particular day of the month etc.
-
Delayed Job - A batch job gem that works with postgresql.
-
Clockwork - A job that can be scheduled to run on a timer.