Skip to content

SMS Appointment Reminder Demo using Twilio, Flask, Redis, and Celery for Queens VA Project in the Equalithon by Essteem

License

Notifications You must be signed in to change notification settings

datascisteven/SMS-Appointment-Reminder-Webapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SMS Medical Appointment Reminders WebApp
by Steven Yan

https://youtu.be/tSKfUlj_sYA

Setup Instructions:

  1. Clone repository and cd into the created directory
git clone 
cd sms-reminder-flask

  1. Create a virtual environment with a directory name venv:
python -m venv [directory name]

  1. Activate virtual environment:
source venv/bin/activate

  1. Change into the app directory of the repo, and install prerequisite packages to run Flask webapp:
cd app
pip install -r requirements.txt

  1. Copy env.example file to .env and fill in the listed values:
export SECRET_KEY = 'your_secret_key'
export CELERY_BROKER_URL = redis://localhost:6379
export CELERY_RESULT_BACKEND = redis://localhost:6379

export TWILIO_ACCOUNT_SID = 'your_twilio_account_sid'
export TWILIO_AUTH_TOKEN = 'your_twilio_auth_token'
export TWILIO_NUMBER = '+1XXXXXXXXXX'

  1. Create Flask application variables:
export FLASK_APP = reminders.py
export FLASK_ENV = development

  1. Run the migrations:
flask db upgrade

  1. Install Docker Desktop and start a Redis server to serve as a broker for Celery tasks:
docker run -d -p 6379:6379 redis:latest

  1. Start development server:
flask run

  1. Create another virtual environment to send reminders with a separate Celery worker process:
cd ..
python3 -m venv env

  1. Install dependencies:
pip install -r requirements.txt

  1. Activate Flask development environment:
export FLASK_ENV = development

  1. Start the Celery worker:
celery -A tasks.celery worker -l info

Project Description:

Here are the challenges presented from client:

  • Easily lose track of postcard reminders
  • Manual entry of appointments into calendar
  • Different levels of computer literacy for veterans

Here are our proposed solutions:

  • Needs calendar integration (ICS universal for all phones)
  • Develop webapp for provider
  • Develop mobile app for patient
  • Automated SMS reminder system for non-tech savvy veterans

Provider End:

  • Develop web application to interact with hospital server to send and receive relevant informatio through APIs
  • Without technical details from VA, we created an interfacce for manual entry of patient appointmnets using a SQLAlchemy database within Flask microframework
  • Customize SMS reminders according to the following actions:
    • confirmed
    • rescheduled
    • modified
    • canceled
    • no showed

Patient End:

  • Use Twilio platform to send and receive SMS messages
  • Patients will receive an initial text after booking their appointment
  • They will have capability to respond to SMS to receive ICS file for easy integration
    • Currently iPhone have capability to create calendar events from any SMS with time details, but Android requires additional software
  • At a default of 48 hours prior, patient will receive second SMS reminder to confirm or cancel appointmnet
    • reminder time adjustable to different intervals

Screenshots:

Index Page:

New Appointment Page:

Sample SMS Reminders:

Presentation:

Folder Structure:

├── README.md					<- top-level document for explaining project
├── _app							<- folder of Flask application
│   ├── _config					<- notebook for displaying augmentations
│   ├── _forms					<- folder of forms scripts
│   ├── _migrations			<- notebook for pretrained models
│   ├── _models					<- folder of models script
│   ├── _static					<- folder of CSS, Javascript, and image files
│   ├── _templates				<- folder of HTML files
│   ├── _views					<- folder of views script
│   ├── application.py		<- script for defining routes and application
│   ├── database.py			<- script for SQLAlchemy database
│   ├── dev.sqlite				<- database file
│   ├── Procfile				<- file for Heroku deployment
│   ├── reminders.py			<- script for initiating application
│   ├── requirements.txt		<- file for Heroku deployment
│   └── tasks.py				<- script for running Celery tasks
├── _docs							<- folder of project documentation
└── _images						<- folder of jpeg and png files

Contact Information:

Email Badge

Github Badge

LinkedIn Badge

Medium Badge

Portfolio Badge

About

SMS Appointment Reminder Demo using Twilio, Flask, Redis, and Celery for Queens VA Project in the Equalithon by Essteem

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published