Lavender: Bridging the Gap Between Sleep Provider and Patient

Problem Description

Shift workers make up 20% of the American workforce. These are people who work unconventional hours, often in the night or early morning. Examples of such workers are transportation workers, nurses and doctors. This results in a circadian rhythm disorder known as shift work disorder or shift work sleep disorder. Patients seek treatment from a sleep psychiatrist, who manually creates a sleep schedule and assigns a sleep diary. The sleep schedule is customized to each individual in order to allow them to spend time with their loved ones and engage in daytime activities without sacrificing sleep to prepare for work. This manual generation of a sleep schedule is often time consuming and difficult to create while deriving insights with the patient’s sleep diary to compare. Often, meticulous analysis of the shift worker’s sleep data is required to design such sleep schedules. 

Our Platform

Lavender is a shift work sleep disorder web platform designed to streamline the treatment process between provider and patient for our stakeholder, a sleep psychologist who regularly treats shift work sleep disorder patients. Our team also includes a technical mentor to help us navigate complex development tasks. The platform includes the following features: 

  • Sleep Diary: track patient sleep data in real time to understand how their sleep schedule functions. 
  • Event Scheduler: shift workers use this feature to enter their work schedule and personal events. 
  • Sleep Statistics: a provider can view relevant statistical summaries of their patients’ sleep data, allowing them to adjust sleep schedules in real time, as fit. 
  • Sleep Scheduler: an algorithm based on sleep disorder treatment principles, generating recommended sleep schedules based on the patient’s work and event schedule. The algorithm aims to reduce the complexity of developing a sleep schedule, the provider has complete freedom to adjust the schedule.

Application Stack

The following describes our planned stack for Lavender. 

Frontend 

  • Framework: React
  • Languages: HTML, CSS, JavaScript

Backend 

  • Framework: Express.js
  • Language: JavaScript
  • Algorithms and Optimization: OR-Tools

Database 

  • DBMS: Google Cloud Firestore

Infrastructure

  • Hosting: Google Firebase 
  • Containerization: Docker

Security

  • Authentication: Google Firebase Authentication

What We Learned 

Our team comes from a varying background, with foundational knowledge in machine learning, front end development, and electrical engineering. Developing a year long Capstone project allowed us to gain both technical and non-technical knowledge on the software development process. The following summarizes the skills we developed: 

Algorithm Development 

Lavender’s sleep scheduling algorithm required the use of Google’s OR-Tools. The inherent difficulty in this task lies in translating our stakeholders’ treatment principles for shift work sleep disorder into code. As any form of healthcare treatment requires years of training and expertise, each diagnosis and treatment plan is tailored to the patient’s unique needs. As such, we focused our development on coding constraints that were more straightforward in the eyes of our stakeholder. Our goal is not to replace the provider, but to make the treatment process more efficient for both patient and provider. 

Front-End Development 

All of our team members have foundational knowledge and experience in web development, but this project provided us with an invaluable opportunity to dive deeper into the various layers of application development. With React, we were able to create a fast, component-based front-end layer, which taught us the importance of reusing code for more efficient development and a better user experience. Through this process, we learned how to build modular and scalable components that can be easily maintained and updated. Additionally, we gained a deeper understanding of state management and how it affects the performance and responsiveness of an application. The experience also allowed us to explore advanced features of React, such as hooks and context, which enhanced our ability to manage complex state and side effects more effectively.

User Interface Design

We worked closely with our stakeholder in order to understand how to best deliver an interface that allowed patients to quickly enter sleep data and best understand their treatment plan. This process began by exploring current sleep-related applications and understanding how their features appealed to our stakeholder. We learned how to consider factors such as accessibility in our design. For example, our technical mentor taught us how to choose color in our design based on role rather than aesthetic. This means that each color is designated a specific role, such as primary, secondary and error in order to maintain consistency in the interface. This reframed our perspective by connecting development and design.