# waitER

One of the biggest causes of crowding and wait times in emergency departments is “boarding,” a term for holding an admitted patient in the ER for hours or even days until an inpatient bed becomes available. Long wait times can affect patient outcomes in various ways: patients may get tired of waiting and leave without receiving medical treatment, especially when resources of the emergency department are overwhelmed. In order to alleviate some of the anxiety and stress associated with the process, we created a web application that aims to bring transparency to patient wait times in the emergency room.

---

### Features

1. **Homepage**: Upon arrival at the ER, the patient recieves a unique user ID used to access their personal homepage, mainly featuring the placement they are currently in the queue along with other supplementary educational information that may be of interest.
2. **Triage page**: (only accessible to admin) Features a series of triage questions used to determine the ESI of that particular patient.
3. **Admin dashboard**: (only accessible to admin) Features a scrollable queue of all patients in line, along with their ID, arrival time, and ESI. The admin is able to add users to the queue using the triage page and to remove users when it is their turn for care. This then alerts the patient through the homepage.

*Note*: When any update occurs, all pages are updated to reflect the latest changes.

---

### Running this program

1. Make sure node and npm are installed on the system.
2. Install all node modules with `npm install`.
3. Build the application with `npm run build`.
4. Run the application with `npm run start`.
5. Access the triage page at `localhost:8080/triage` and add a patient to the queue.
6. After adding the patient to the queue, the page will display a link to the patient's individual page along with a link to the dashboard.
## Inspiration

Lots of applications require you to visit their website or application for initial tasks such as signing up on a waitlist to be seen. What if these initial tasks could be performed at the convenience of the user on whatever platform they want to use (text, slack, facebook messenger, twitter, webapp)?

## What it does

In a medical setting, allows patients to sign up using platforms such as SMS or Slack to be enrolled on the waitlist. The medical advisor can go through this list one by one and have a video conference with the patient. When the medical advisor is ready to chat, a notification is sent out to the respective platform the patient signed up on.

## How I built it

I set up this whole app by running microservices on StdLib. There are multiple microservices responsible for different activities such as sms interaction, database interaction, and slack interaction. The two frontend Vue websites also run as microservices on StdLib. The endpoints on the database microservice connect to a MongoDB instance running on mLab. The endpoints on the sms microservice connect to the MessageBird microservice. The video chat was implemented using TokBox. Each microservice was developed one by one and then also connected one by one like building blocks.

## Challenges I ran into

Initially, getting the microservices to connect to each other, and then debugging microservices remotely.

## Accomplishments that I'm proud of

Connecting multiple endpoints to create a complex system more easily using microservice architecture.

## What's next for Please Health Me

Developing more features such as position in the queue and integrating with more communication channels such as Facebook Messenger. This idea can also be expanded into different scenarios, such as business partners signing up for advice from a busy advisor, or fans being able to sign up and be able to connect with a social media influencer based on their message.
## Why Raven?

*Why did the raven become a style guru? Because it always knows how to "feather" the nest!*

But jokes apart, navigating the maze of beard styles can be as tricky as finding a feather in a bird's nest(pun intended). Raven simplifies the grooming journey, ensuring your facial game is always on point.

## What it does

Raven employs advanced image manipulation techniques and algorithms for facial parameter detection, identifying key structural areas, and analyzing curves. Leveraging mathematical concepts like polynomial approximation and Gaussian distribution, the algorithm extensively explores its database to provide personalized suggestions for the ideal beard style.

Raven's interactive UI allows the user to upload a picture, generate the best style and subsequently save the image, giving a seamless user experience.

Or, for those who speak better emoji than code: 👨 👉 📸 👉 🧔‍♂️ 👉 👍

## How we built it

We used Java/JavaCV to code the backend, making use of existing public algorithms such as Kazumi's algorithm and CascadeClassifier. We curated a database of different beard types and styles from Adobe. For the frontend, we used JavaFX to code the UI, allowing the user to upload, generate and save images with just a click of a button.

## Challenges we ran into

We ran into a plethora of different challenges when coding Raven. For starters, we faced a high image processing time initially, after which we used a multi-thread system to allow the UI to run on a single thread and the backend on another to allow a swift and seamless image processing time.

Secondly, whilst implementing the facial hair overlay step, we faced errors with proper alignment and sizing. We had to adjust and implement stricter manipulation techniques such as coordinate mapping and structure cropping to ensure the facial hair aligns with the curves of the face all within 24H which surely will a memory we never forget.

## Accomplishments that we're proud of

We are proud of every step that we accomplished through the journey of Raven. Our notable achievements include the implementation of a multi-thread system which has significantly reduced our image processing time.

We are particularly proud of browsing mathematical models such as Gaussian Distribution and coordinate systems and using their knowledge to alleviate our implementation of Raven's image processing capability.

## What we learned

We gained a deep insight into computer image processing and analysis. We learnt some important techniques to manipulate pictures, extract required areas of the face and use certain key facial parameters to add any overlays on the face.

All in all, since most of us were first time hackers, we learnt how to carry out such a task within 24 hours while keeping ourselves cool and open to learning something new every 30 minutes.

## Sustainability

The idea of making Raven sustainable was key to us. We believe that by implementing a more optimized and efficient algorithm, we bring a more cost-effective and less computational-costing solution to the table. Furthermore, this shift from on-paper facial hair suggestions to digital suggestions reduces the need for paper in general.

## What's next for Raven

We could definitely extend this idea to add any overlays on the face in the future. This could include suggestions for the most suitable nose/lip accessories, head hair, face tattoos etc. Conclusively, Raven has the potential to be a one-stop-shop for any style suggester.

## Credentials

1) Kazumis Algorithm: “Face Alignment with Part-Based Modeling” - Vahid Kazemi [link](vahidk@nada.kth.se)
2) Haar Cascades Frontal Algorithm: [link](https://github.com/opencv/opencv/blob/master/data/haarcascades/haarcascade_frontalface_alt2.xml)