Inspiration

My mother got liver surgery this winter break. Her surgery was on Dec 26th, 2022 and she was discharged on the same day. Her post-op recovery check-in with her surgeon was on Jan 5th, 2023.

In those 9 days, whenever I had a question about my mother’s medication or called a nurse with a question, I would have to describe my mother’s entire medical condition to the nurse on call to get any medical advice.

It was very archaic to call a nurse at 3 am when my mother was having severe acidity. And it was very redundant to keep explaining my mother’s condition as context to get the nurse on the phone to help me.

This is the story of one of our teammates and his tedious experiences with post-op care. So, we decided to spend this hackathon building a service that could have helped communicate all of his mother’s problems to nurses and doctors using a simple chat interface. This solution also helps doctors and nurses, because they do not have to spend 15 minutes understanding the recovery 10 days after due to our constant updates to the doctor on a patient’s worsening condition.

What it does

AfterAware is building a service in the post-op recovery market for clinics and physicians by building modern SaaS workflows. We believe that post-operative follow-up after surgeries is crucial for better patient recovery. Currently, this part of the patient's journey is done using workflows that are highly manual, inefficient, and time consuming.

In a gist, AfterAware enables patients to communicate and share their post-op recovery condition with their doctors. Users sign up using their phone number, and our platform uses Twilio to send daily messages for them to respond to via SMS, asking about their condition. When a user replies, the platform parses the messages for specific condition keywords using NLP, and these get displayed to the doctor via a web dashboard.

Current traditional methods of communication and follow-up after surgery or an appointment, such as phone calls or in-person visits, are quite timely and inefficient. Doctors and nurses waste a lot of their time just trying to reach their patients, which is why the aftercare process does not do enough for both parties. By offering an automated check-in service via text and using natural language processing (NLP) to alert doctors based on patient responses, the product provides a more efficient and convenient approach to follow-up care.

How we built it

When building, we focused on designing an optimal user flow to target pain points for both patients and doctors. Tech-wise, this became 3 separate components: a patient website to input their number, a chatbox via text, and a doctor dashboard for their patients.

1) For patients to sign up, we created a landing page where they can enter and submit their phone number. This page is built with Vercel and Next.js. Once the phone number is submitted, the frontend triggers a Python endpoint which stores the number to an Airtable database and starts the Twilio-based text conversation.

2) To perform the SMS chat, we used Twilio’s HIPAA compliant SMS service to send and receive messages to patients, while using HTTP POST requests to communicate to the backend. For the backend, we implemented a Flask server and used ngrok to create webhooks that switch the server route from localhost:5000 to an external web url.

We also used an Airtable database to see how the data is updated and changed dynamically. This way, we could easily insert and change data manually to test our back-end. Note: we ideally would switch to a more secure and scalable database in the future (e.g. MongoDB), but for the purpose of our hackathon demo, using an Airtable database allowed us to rapidly iterate our product.

Meanwhile, we used the OpenAI DaVinci engine to implement the AI chatbox. This generation prompts the user and then responds to patient messages to dig deeper into how the user is doing.

3) Finally, we built a web dashboard for the doctor to monitor their patients’ conditions. This was built with a no-code app developer called Retool. This frontend easily integrates with Airtable, extracting the data and deploying it in a graphic-like, intuitive format for doctors.

Each patient’s text findings are interpreted prior to being displayed (done in the Python script). We used Google’s Healthcare NLP API to detect conditions relevant to medical state and produce confidence probabilities for how likely these conditions are. Ultimately, this allows doctors to streamline their interaction process to see only useful info about a patient’s health and make best decisions.

Challenges we ran into

Losing progress with code a couple of times; tireless debugging at night; the common struggles that most developers and hackers face, we faced as well.

Going into more detail, one major challenge that we faced occurred with our Twilio integration. On Friday night, not only did we face a lot of Twilio routing issues–hence forcing us to turn to ngrok as a solution–the Twilio API suddenly shut down as we were making progress, so our team was unable to continue our implementation until Saturday afternoon when it got fixed.

When working with OpenAI DaVinci, the main challenge we encountered was trying to figure out the most optimal prompts to provide it in order to be able to give a solid chatbot experience for the patient. TreeHacks was our first times doing prompt engineering, so it was quite the struggle trying to get OpenAI DaVinci to provide appropriate questions to ask the patient, let alone even prompting it to ask questions in the first place. This made think of some wacky but creative workarounds.

Finally, we spent a long time brainstorming the workflow for the project, keeping in mind to make the experience seamless and efficient for both the doctors and patients. We initially created a script that was running every 30 seconds, but we realized that making a flask server with multiple endpoints was a better and more effective way to send and receive messages.

Accomplishments that we're proud of

Despite the challenges we faced, we were able to overcome all of them and end up with a working, deployed demo of our project that we are all proud of. We realized that this project had many moving technical parts, so looking back at it, we feel that we have come a long way.

What we learned

Although we each had to learn new technical tools to use, whether it be Twilio or Retool, most of our learning was related to the problem statement we were trying to solve. Through our teammate’s story along with some research and intense ideation brainstorming, we learned a lot about the inefficiencies of the modern healthcare system, especially when it comes to post-op care.

What's next for AfterAware

Firstly, for the technical components of AfterAware, we plan to switch to more scalable and secure libraries (e.g. switching Airtable with a database like MongoDB). We also yearn to add a more streamlined authentication process for the doctors and patients when we want to market this to public and private care institutions.

As hinted, we are planning to pursue this project as a startup! Our goal is to apply to YC with 30 active users helping them with physical therapy and Crohn's disease. We are aiming to get 1 clinic to pay us by the end of March for the API call that allows them to track patient health.

Our overarching understanding is that during our lifetime, our age group will change how they interact with the healthcare system. We'll introduce modern workflows instead of archaic ones for our generation to better understand medications and postoperative care for loved ones.

Built With

Share this project:

Updates