State configuration

State required by the engine are mapping files according to FHIR Connect specification and are split to context.yaml files and model.yaml files. Additionally, state required by the engine are also openEHR Operational Templates (.opt), which can either be part of the openFHIR Engine’s state or it can come from an integrated openEHR repository (see more: Integrations).

As an example, for a mapping of a blood pressure template, you’d need the following files (state) configured:

  • Blood Pressure.opt

  • simple-blood-pressure.context.yaml

  • blood-pressure.model.yaml

Bootstrapping

State configuration can be achieved by POSTing OPT and YAML files to the designated /opt and /fc/(context, model) endpoints. Alternatively, these files can be placed in a bootstrapping directory where they are picked from during the engine’s startup. This approach minimizes the need for repetitive API calls, allowing for faster and more efficient configuration of pre-existing mappings.

Bootstrapping location is configured with environment variable BOOTSTRAP_DIR, default being /app/bootstrap/.

For example, setting -e BOOTSTRAP_DIR=/etc/bootstrapping-dir and placing files in this folder (/etc/bootstrapping-dir) will make the engine pick them up at startup and process them.

Files are picked according to their suffixes:

  • model files need to be suffixed with *.model.yaml or *.model.yml, i.e. blood.pressure.model.yaml

  • context files need to be suffixed with *.context.yaml or *.context.yml, i.e. simple-blood-pressure.context.yaml

  • operation template files need to be suffixed with *.opt, i.e. BloodPressure.opt

  • terminology concept maps (read more in Terminology) need to be suffixed with *.json, i.e. contept-map.json

Files are picked up and processed only once. If you want them to be picked up and processed again, you need to remove references of those files from bootstrapEntity collection.

Through REST

State configuration can be achieved by POSTing OPT and YAML files to the designated /opt and /fc/(context, model) endpoints. See RESTful APIs for more information.