Converting data from arbitrary EHR vendors to the FHIR standard.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Before installing, download and install Python 2.7 and Pip, a Python package manager.
(Recommended) Then install virtualenv.
Clone this repository:
git clone https://github.kcl.ac.uk/consult/fhir-ehr-adapter
Change into the directory:
cd fhir-ehr-adapter/fhir-ehr-adapter
(Optional) Initialise a virtual environment, and activate:
virtualenv .venv
. .venv/bin/activate
Install dependencies:
pip install -r requirements.txt
Rename EHR configuration file, and add appropriate variables:
mv src/main/python/EHR/APIVariables-Template.py src/main/python/EHR/APIVariables.py
vim src/main/python/EHR/APIVariables.py
Clone the FHIR parser repository:
git clone git@github.com:smart-on-fhir/fhir-parser.git src/main/python/fhir-parser
Copy configuration scripts into the directory:
cp src/main/python/mappings.py src/main/python/fhir-parser/
cp src/main/python/settings.py src/main/python/fhir-parser/
Install parser requirements:
cd src/main/python/fhir-parser/
pip install -r requirements.txt
Generate FHIR Python classes:
touch Default/__init__.py
python generate.py
Move generated classes into project:
cd ../
mv models/ models_full/
touch models_full/__init__.py
Automated through fhir-parser.sh.
Clone the FHIR client repository.
git clone git@github.com:smart-on-fhir/client-py.git src/main/python/client-py
Copy FHIR classes into project:
cd src/main/python/
cp -r client-py/fhirclient/models/ models_full/
Run setup tools
cd ../../../
python setup.py sdist bdist_wheel
Given a certain release, either available in dist/ if built, or via Github, install as follows:
python setup.py install
The app runs by default on port 8080.
python setup.py test
Deployment is via Docker, and includes containers for this application and an optional message queue.
Specify the address of the FHIR server and credentials in docker-compose. If a hostname, reference its corresponding certificate. Also specify the address of the hostname if unlikely to be present in the DNS.
Build these containers:
docker-compose build
Run these containers:
docker-compose up
(Optional) Run without queue:
docker-compose up --scale webapp-queue=0 rabbit=0
Different docker-compose files exist to accomodate different service configurations.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
Produced as part of the CONSULT project.
This project is licensed under the MIT License - see the LICENSE.md file for details.
