Guiding clinicians through the fever puzzle
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
FebriLogic is a clinical decision support tool that helps healthcare professionals quickly and accurately differentiate between acute febrile illnesses (AFIs). It leverages real-world data and a novel diagnostic algorithm to provide evidence-based insights at the point of care.
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
-
# Debian-based distros sudo apt-get install python3 -
python3.12-venv for Debian-based distros
# Debian-based distros sudo apt-get install python3.12-venv
-
Get free API keys at Resend
-
Clone the repo
git clone https://github.com/muhammadazzazy/febrilogic.git
-
Navigate into the project directory
cd febrilogic
-
Navigate into app/apis
cd app/apis -
Create a .env file
# Required file path for the symptom and disease data. SYMPTOM_WEIGHTS_FILE="" # Required file path for disease biomarker statistics. BIOMARKER_STATS_FILE="" # Optional. Defaults to HS256. ALGORITHM="HS256" # Optional. Defaults to 30 minutes. ACCESS_TOKEN_EXPIRE_MINUTES=30 # Required secret key. SECRET_KEY="" # Required Postgres database URL. POSTGRES_DATABASE_URL="" # Optional. Defaults to 0.0.0.0. FAST_API_HOST="0.0.0.0" # Optional. Defaults to 8000. FAST_API_PORT=8000 # Optional. Defaults to http://localhost:8501 STREAMLIT_BASE_URL="http://localhost:8501" # Required for sending verification emails. RESEND_API_KEY="" # Optional. Defaults to 3. RESEND_MAX_RETRIES=3 # Required file path for the verification email template. VERIFICATION_EMAIL_TEMPLATE="html/verification_email.html" # Required. SUPPORT_REQUEST_TEMPLATE="html/support_email.html" # Required. PASSWORD_RESET_EMAIL_TEMPLATE="html/password_reset_email.html"
-
Create a virtual environment for backend
# Linux python3.12 -m venv .venv # Windows python -m venv .venv
-
Activate the virtual environment
# Linux source .venv/bin/activate # Windows .\.venv\Scripts\activate
-
Install backend dependencies
pip install -r requirements.txt
-
Navigate out of the app/apis directory
cd .. -
Run the FastAPI app
# Linux python3 -m apis.main # Windows python -m apis.main
-
Navigate into ui
cd ui -
Create a
secrets.tomlfile inside app/ui/.streamlitFAST_API_BASE_URL = "http://localhost:8000" FAST_API_CONNECT_TIMEOUT = 10 FAST_API_READ_TIMEOUT = 30
-
Create the virtual environment for frontend
# Linux python3 -m venv .venv # Windows python -m venv .venv
-
Activate the virtual environment
# Linux source .venv/bin/activate # Windows .\.venv\Scripts\activate
-
Install frontend dependencies
pip install -r requirements.txt
-
Run the Streamlit app
streamlit run main.py
-
Implement patient data APIs:
-
POST
/api/patient/{id}- add a patient to thepatientstable in the Postgres database -
GET
/api/patient- fetch patient information from thepatientstable in the Postgres database -
POST
/api/patient/{id}/diseases- add diseases the patient tested negative for to thepatient_negative_diseasestable in the Postgres database -
POST
/api/patient/{id}/symptoms- add patient symptoms to thepatient_symptomstable in the Postgres database -
POST
/api/patient/{id}/biomarkers- add patient biomarkers to thepatient_biomarkerstable in the Postgres database -
POST
/api/patient/{id}/calculate- calculate the probabilities of diseases using the symptoms layer and symptoms+biomarkers layer
-
-
Implement biomarker data APIs:
- GET
/api/biomarkers- fetch metadata of biomarkers from thebiomarkerstable including the name (if any), abbreviation, standard unit, and reference range of each biomarker - GET
/api/biomarkers/units- fetch a mapping between the biomarker abbreviations and their corresponding units based on data in thebiomarkers,units, andbiomarker_unitstables in the Postgres database
- GET
-
Implement utility APIs:
- GET
/api/countries- fetch a listing of all countries (alphabetical) fromcountriestable in the database - GET
/api/diseases- fetch a listing of all possible diseases a patient can test negative for fromdiseasestable in the Postgres database - GET
/api/symptoms/categories-definitions- fetch a mapping between the symptom category, associated symptoms, and their definitions based on the data in thesymptomsandsymptom_categoriestables in the database - POST
/api/contact- send support requests with sender's name and email address, subject, and body to FebriLogic's support email address
- GET
-
Implement authentication APIs:
- POST
/auth/- register a new user by sending verification email - POST
/auth/token- login to the app and obtain JWT token - POST
/auth/request-password-reset- send password reset email - POST
/auth/reset-password- reset the user's password - POST
/auth/change-password- change the password of an already logged-in user
- POST
-
Add Home page
- Cookie consent dialog
- Description of what FebriLogic is
- Note indicating the project’s funding source, academic lead, and university affiliation
- Supported United Nations (UN) Sustainable Development Goals (SDGs)
- Disclaimer on tool usage
-
Add Login/Register page
- Form for user login/registration via email and password
- Option to reset password after entering email
-
Add Reset Password page
- Form for resetting the password when user is locked out of their account via the password reset email and token
- Form for changing password while user is logged in
-
Add Patient Information page
- Selectbox to add a new patient or select an existing patient
- Form to submit patient info with selectboxes (sex, race, and country), optional text field for city, and number field for age
- Reset button to clear all fields
-
Add Disease-Specific Tests page
- Selectbox to choose a patient
- Form containing checkboxes for diseases and submit button to add diseases the patient tested negative for
- Reset button to clear disease checkboxes
-
Add Symptom Checker page
- Selectbox to choose a patient
- Form containing checkboxes for symptoms and submit button
- Reset button to clear symptom checkboxes
-
Add Biomarkers page
- Selectbox to choose a patient
- Checkbox for each biomarker indicating whether it was measured
- Box for each biomarker to capture its value
- Selectbox for each biomarker to choose the unit
- Button to submit patient biomarkers
- Reset button to clear biomarker checkboxes
-
Add Results page
- Selectbox to choose a patient
- Button to calculate the disease probabilities for symptoms layer and symptoms+biomarkers layer
- Ranked diseases with probabilities for symptoms layer and symptoms + biomarkers layer
-
Add Contact Us page – send support emails
-
Add Privacy Policy page – GDPR privacy policy
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Muhammad Azzazy - [email protected]
Project Link: https://github.com/muhammadazzazy/febrilogic
