Inspiration

It all started when morning conversations shifted from “Good Morning” to “How many med recons (short form for medication reconciliation) do you have for today?”

One responsibility of pharmacists is medication reconciliation, where pharmacists look through a patient’s medication records for the past year and compile a list of medications that patients are likely taking. If any discrepancies are found in the medication records (e.g when patients have not been collecting a certain medication for a long period of time), pharmacists will then interview patients regarding adherence. The process of looking through medical records for every newly admitted patient can be a long and arduous process.

Hence, a thought popped up in our heads: Why can’t this process be automated? The amount of time saved can be utilised by pharmacists to review patient’s medications and optimize their medication therapy.

What it does

Our website screens through a patient’s medication records for the past year and compiles a list of medications that patient should be taking. They are grouped according to speciality.

It also highlights any lapses in medication collection and changes in medication doses or frequency in a separate column. We also incorporated a remarks box for each medication with discrepancy. Pharmacists would be able to input any comments relating to adherence or dose changes in this remarks box. This feature is relevant as it enables other pharmacists down the line identify reasons for these medication discrepancies and evaluate whether follow-up actions should be taken.

How we built it

We built this application using Flask for the frontend and FastAPI for the simulation backend. For deployment, our solution only requires a small backend server; given that many optimisations were made to keep it as lightweight as possible. To make our simulation data realistic, we leveraged the open-source Synapxe APIs, which are widely used in medical facilities in Singapore. Our data pipeline was structured around Synapxe’s FHIR Release R4B standards to ensure consistency and interoperability. For processing large amounts of data efficiently, we used Pandas and NumPy for quick manipulation, and accelerated computation with Numba to handle more complex operations.

Challenges

We've faced many challenges along the way, whether with the UI or the algorithm that runs in the background. Firstly, the UI had to be designed for pharmacists in mind, for them to easily be able to understand a patient's medical history at a glance. This was quite an obstacle as we wanted to ensure that they get as much information as possible but had to find a way to package it such that they do not feel overwhelmed. Luckily, we thought of grouping each patient's medical history by visits as well as adding in the medication metadata using coloured tags, making it easily readable as well as organising the history for users.

Additionally, the algorithm consisted of many for loops given that some patient's may have long and complex medical histories. It was taking seconds at first to load, however we managed to get that down to less than a 100 milliseconds after compiling as much as possible using Numba to machine readable code.

Accomplishments

We've managed to create a really lightweight algorithm for the processing of the patient's medical history, thus allowing our solution to be very scalable. We also managed to come up with a specialised MAMBA graph encoder that manages to inject both edge and node information when predicting edges/nodes. This was all for the development of the Drug-to-Drug interaction model as we didn't just want to take the current best model, we wanted to improve on it and increase not just its accuracy but rather also making it more lightweight.

What’s next for Project REConsider

This is definitely just the start for our project due to the time constraints of the project. Moving forward, we intend to include a “New orders Tab”. This tab will include a side-by-side comparison of the medications currently ordered by the doctor inpatient and the medications that patient is taking prior to admission. This makes it easier to identify any omitted medications as well as differences in dosing or frequency of the prescribed medications. We are also underway in developing a ML model to analyse drug interactions, with a custom MAMBA graph encoder architecture. Furthermore it's being developed with two decoder heads where one predicts whether two drugs interact and the other predicts a categorisation label for the pharmacodynamic interactions.

Share this project:

Updates