Questionnaire with chat bot
Details of a given drug
As experienced by our teammate Majka, pharmacies may not always recommend you the best over-the-counter drugs - if you already have a disease, they might sell you drug that is actually supposed to prevent it, not heal it, etc. On the other hand, patients often require their doctors to prescribe them with antibiotics, even when they are completely unnecessary (e.g. viral infections), which leads to drug-resistant superbugs. Our goal was to tackle these issues in an easy and accessible form.
What it does
Artemis is a chat bot that asks you a series of questions regarding your health and transforms them into your symptoms. Once finished, it will send them to the backend where the magic happens - symptoms are mapped to diagnose, diagnose is mapped to active substances and active substances are mapped to medicines. Those are sorted by relevancy and top 3 are then shown to the user as recommended treatment to their issues.
Naturally, shall we detect that symptoms are pointing to a more severe disease, we will immediately endorse seeking professional medical assistance.
How we built it
Our project is divided into 3 large parts - data gathering and analysis, frontend and backend.
The first and most important step was to gather data from various sources and process them to a more suitable form. Translation of symptoms to diseases was provided by Infermedica API. Unfortunately, we failed to obtain an application key in time, so we had to mock their servers. After specifying the disease, we searched through databases of European Medicines Agency and Medical Subject Headings of U.S. National Library of Medicine to determine which active substances are used to treat it. At last, we matched this list of substances with available medicines from ADC database of drugs in Slovakia.
We aimed not only for features, but usability as well. This is where our frontend shined - we have created a simple chat bot that asked you a tree of questions (starting with general one and asking more specific later on) and based on your answers built a list of your symptoms. To make our application more friendly, we also made our chat bot read questions loudly, hopefully making this experience a bit more personal.
Backend was where the magic happened. It glued all databases and services together and provided a list of medicines for given symptoms. One important thing was to make sure we were recommending only the best and most suitable ones. For that purpose, backend also had a scoring function that could tell whether given medicine is more or less suitable for a given person.
Challenges we ran into
Because not all databases provided APIs or developer-accessible formats, we had to write spider bots (web crawlers) to scan pages and transform raw HTML data into small and nice JSONs. This took a lot of effort as nobody on our team had any previous experience from it.
Another big challenge was chat bot. We could have used Google Dialog Flow, but it is not available for slovak language. Therefore, we had to design our simple bot from scratch. We ended up using simple tree structure so that we can ask simply questions first and complex ones later if necessary. As this was config driven, it was extremely easy to modify and add new options.
Accomplishments that we're proud of
Despite being inexperienced in both of the challenges we faced, we have managed to solve them not only in time, but with satisfying results.
What we learned
During the course of hackathon, we have learnt how web crawlers work and what it takes to convert raw HTML to valuable data. We also expanded our knowledge in data analysis and in interconnecting several unrelated sources of data to create a bigger and more powerful one. Last but not least, we have discovered an easy and lightweight way for creating simple decision-based chat bots.
What's next for Artemis
We want to enhance our chat bot with Google Text-To-Speech and Speech-To-Text to enable natural-like conversation and also make it much more easier for elderly and handicapped people to use it.