The Intelligent Patient Record is a tool for physicians to search in patient records. iPA aims to mimick physicians' thinking patterns and enhance them using modern search technology.
At its core, the iPA search system is a backend with a RESTful API that performs query expansion and search in an OpenSearch index.
-
Install the virtual environment:
uv sync --project backend
-
Create a
.envfile in backend dir containing all needed environment variables. For reference, check out the example file.Hint: Manually set environment variables take precedence over those set in the
.envfile. -
If you do not have a running Opensearch instance, you can launch one using
docker compose -f backend/docker-compose.yml -f backend/docker-compose-medplum.yml up -d
-
Add patient records to your OpenSearch index. For testing purposes you can index the GraSCCo dataset using the
index_filesapi endpoint. An example for how to use this endpoint can be found in ipa.http. Note that using theindex_filesendpoint requires a running iPA backend (see Quick Start).
Run the iPA backend server:
uv run --project backend --env-file backend/.env fastapi dev --entrypoint ipa_backend.main:appThis repo comes with a makeshift frontend. Install its dependencies via
uv sync --project frontendLaunch it using
uv run --project frontend streamlit run frontend/streamlit_app.py --server.address localhostRead more about the search approaches that are implemented here.
Install all dependencies incl. test dependencies:
uv sync --project backend --extra testRun integration tests via
uv run --project backend --env-file backend/.env pytest -vYou find the iPA API documentation at http://localhost:8000/docs .
Note: The iPA backend server must running in order to show the documentation. (uv run --project backend fastapi dev --entrypoint ipa_backend.main:app)
For questions you can contact Christian Martin: cmartin@uni-leipzig.de