Build mapping engine

This section will show you how to build Google Whistle (GW) mapping engine (C shared library) for GameBus FHIR layer.

Build mapping engine shared library

Step 1, install the following dependencies

  1. Golang (>=1.7)

  2. Java JDK (>= 8)

  3. Protobuf Compiler protoc (>= 3.11.4)

  4. Clang (>= 11.0.1-2)

Step 2, download adapted Google Whistle codebase.

See subsection below for more info about the codebase.

git clone https://github.com/nwo-strap/healthcare-data-harmonization
cd healthcare-data-harmonization/mapping_engine

Step 3, build C shared library

./build_exports.sh

This script will generate C shared library libgoogle_whistle.so (for Linux) or libgoogle_whistle.dylib (for macOS) and create a corresponding symbolic link in the path /usr/local/lib. The GameBus FHIR layer will seek the mapping engine library in this path.

Google Whistle codebase

Compared with original Google Whistle codebase, the codebase used above is a forked codebase and updated with three new scripts:

  • mapping_engine/build_exports.sh

    It’s a helper BASH script to generate Go code from protobuf files and then compile Go code (e.g. export functions) to C shared library.

  • mapping_engine/main/exports.go

    The export function RunMapping is defined in this Go file, which converts JSON string of one structure to another.

    This Go file can be updated to add other export functions.

  • Dockerfile The dockerfile to build a docker image of the mapping engine.