Project: empowerME

Inspiration

This project was inspired by a friend who was undergoing hand surgery. It was his first time having this type of surgery, and he had many questions about how the anesthesia would affect him. Unfortunately, he had no way to contact anyone who had undergone the same procedure at the same hospital. This challenge sparked the idea for empowerME: a platform that allows patients to easily connect with others who have similar medical experiences.

What It Does

empowerME is an application built on a synthetic Electronic Health Records (EHR) database containing 10,000 patient records. A patient can enter their ID, and based on this ID, the app matches them with the 10 most similar patients. The matching is based on various factors such as:

  • Medical history
  • Previous surgeries
  • Visit logs
  • Location
  • Hospitals they have visited

Once matched, the user can send connection requests to these patients. If the request is accepted, the user gains access to the other patient's phone number, allowing them to connect directly.

How I Built It

Backend

  • The backend API was developed using Flask (Python).
  • A Jupyter notebook was used to parse relevant data from a JSON file containing 10,000 patient records.
  • Each patient was assigned a unique ID, which was mapped to a string containing their visit logs, hospital history, and surgeries. This mapping was saved in a new JSON file.
  • A vector database was created using Pinecone, allowing for efficient vector searches based on patient data.
  • The API uses the patient’s ID to perform a vector search, identifying the top 10 most similar patients.
  • Logins are verified using the Pinecone database.
  • PostgreSQL was used to manage current connections, pending requests, and rejected requests for each user.

Frontend

The frontend was built using Next.js and is organized into four main components:

  1. Directory Component: Allows the user to choose whether they are a patient or an admin (currently, only patients have access).
  2. Login Component: Where the user enters their ID.
  3. Connection Requests Component: Displays pending connection requests.
  4. Accepted Connections Component: Displays accepted connections and their associated phone numbers.

Challenges I Faced

One of the biggest challenges was managing session information within the Next.js app. Initially, I used local storage to store session data, but this proved to be insecure. To solve this:

  • I created a context to securely store session information across components. In Next.js, a context is a component that wraps around other components, allowing shared access to certain variables.
  • To ensure session tokens expire after a set period, I used Redis to store session tokens and the Python secrets library to generate them. Tokens automatically expire after their designated lifetime, requiring the user to log in again.

Accomplishments I'm Proud Of

I’m particularly proud of successfully integrating an AI-powered backend with a clean, user-friendly UI built using Next.js. This project allowed me to gain valuable experience with a tech stack that is highly relevant for many companies today, especially those leveraging React or Next.js for frontend development and Python for AI solutions.

What I Learned

During this project, I gained proficiency in the following technologies:

  • Hugging Face Models: Using them in Python to generate vector embeddings.
  • Pinecone: For storing data in a vector database, performing CRUD operations, and conducting vector searches.
  • PostgreSQL: For managing relational data.
  • Redis: For handling session management.
  • Next.js and TypeScript: For building a robust frontend.

What's Next for empowerME

Planned Features

  1. Built-in Messaging System: Enable users to communicate directly within the platform.
  2. Chatbot Patient Search Engine: A search engine that matches patients based on input messages. The UI component is complete, but backend development is still required.
  3. Message Analytics for Admins: Provide insights into common topics discussed among patients. These analytics will protect privacy by summarizing trends rather than exposing specific conversations.

Future Goals

I aim to collaborate with local hospitals or EHR data providers to implement empowerME with real patient data. This would require adding enhanced security measures and deploying the application with production-grade infrastructure.

Built With

Share this project:

Updates