EHRsuction downloads all Compositions from an openEHR platform and exports them into an organized structure:
EHR_UID/composition-name.json
It also supports FLAT format using the view provided in the resources directory for Better.
⚠️ You need to upload the view first. Contact Better support for guidance.
For EHRbase, only CANONICAL export is currently supported.
- A running openEHR server
- Python 3
-
Install dependencies:
pip install -r requirements.txt
-
Modify
config.yamlto your desired settings. -
Run EHRsuction:
python3 ehrsuction.py
EHRsuction can also be run inside a Docker container.
The Docker image uses /export/ as the default export base directory via the EHRSUCTION_OUTPUT_FOLDER environment variable. This means the output_folder value in config.yaml does not need to be changed for Docker usage.
docker build -t ehrsuction:local .docker run --rm \
-v "$PWD/config.yaml:/app/config.yaml:ro" \
-v "$PWD/export:/export" \
ehrsuction:localThe exported Compositions will be written to the local export directory.
Inside the container, the export path is:
/export/EHR_export/
On the host system, this maps to:
./export/EHR_export/
The BETTER setting for CANONICAL format also works with other openEHR platforms that correctly implement the REST API.
However, EHRBASE currently returns a non-standardized response body using rows, which has already been reported.