The repository contains the solution for the iAtros AI & Backend Engineer challenge.
The solution contains two parts.
- First a prototyping notebook for function testing and explaining reasoning process.
- A cli tool that queries for a patient and predicts it mesurments returning an alert summary.
The notebook (iatros_challenge.ipynb) contains the step by step implementation of the solution incluiding:
-
Implementation of requests between HAPI-fhir server and app
-
Pagination handeling
-
Filling the Dataframe
-
Running the main query
-
Preprocess and clead the Dataframe
-
Binary classification
- Model setup
- Model definition
-
Running the model
-
Prediction test on a row of dataframe
conda env create -f environment.yml
- Activate the environment:
conda activate iatros
- Verify the environment was installed correctly:
conda env list
In main working directory from terminal run
pip install fhirclient --no-index --find-links client-py-4.0.0.zip
pip install -r requirements.txt
From terminal:
- Args:
- observ: Code for observation defaul to 85354-9 LOINC code
'Blood pressure panel with all children optional' - subject: Subject code in HAPI-FHIR test server
- path to pretained model, default to models/hypertension_model
- observ: Code for observation defaul to 85354-9 LOINC code
python app.py --observ 85354-9 --subject 1598464 --model ./models/hypertension_model.pkl