This section will show you how to build Google Whistle (GW) mapping engine (C shared library) for GameBus FHIR layer.
Step 1, install the following dependencies
- Golang (>=1.7)
- Java JDK (>= 8)
- Protobuf Compiler protoc (>= 3.11.4)
- Clang (>= 11.0.1-2)
- Step 2, download adapted Google Whistle codebase.
See :ref:`subsection below<dev2_build_gw_engine:google whistle codebase>` 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.shThis script will generate C shared library
libgoogle_whistle.so
(for Linux) orlibgoogle_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.
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.