Skip to content

samply/focus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Focus

Focus is a Samply component ran on the sites, which distributes tasks from Beam.Proxy to the applications on the site and re-transmits the results through Samply.Beam.

It is possible to specify Blaze queries whose results are to be cached to speed up retrieval. The cached results expire after 24 hours.

Installation

Samply/Bridgehead Integration

Focus is already included in the Samply.Bridgehead deployment, a turnkey solution for deploying, maintaining, and monitoring applications in a medical IT environment.

Standalone Installation

To run a standalone Focus, you need at least one running Samply.Beam.Proxy and one running Samply.Blaze FHIR store. You can compile and run this application via Cargo, however, we encourage the usage of the pre-compiled docker images:

docker run --rm -e BEAM_PROXY_URL=http://localhost:8081 -e ENDPOINT_URL=http://localhost:8089/fhir -e PROXY_ID=proxy1.broker -e API_KEY=App1Secret -e BEAM_APP_ID_LONG=app1.broker.example.com samply/focus:latest

Configuration

The following environment variables are mandatory for the usage of Focus. If compiling and running Focus yourself, they are provided as command line options as well. See focus --help for details.

BEAM_PROXY_URL = "http://localhost:8081" 
ENDPOINT_URL = "http://localhost:8089/fhir"
PROXY_ID = "proxy1.broker"
API_KEY = "App1Secret"
BEAM_APP_ID_LONG = "app1.broker.example.com"

Optional variables

RETRY_COUNT = "32" # The maximum number of retries for beam and blaze healthchecks; default value: 32
ENDPOINT_TYPE = "blaze" # Type of the endpoint, allowed values: "blaze", "omop", "sql", "blaze-and-sql"; default value: "blaze"
EXPORTER_URL = " https://exporter.site/"  # The exporter URL
OBFUSCATE = "yes" # Should the results be obfuscated - the "master switch", allowed values: "yes", "no"; default value: "yes"
OBFUSCATE_BELOW_10_MODE = "1" # The mode of obfuscating values below 10: 0 - return zero, 1 - return ten, 2 - obfuscate using Laplace distribution and rounding, has no effect if OBFUSCATE = "no"; default value: 1
DELTA_PATIENT = "1." # Sensitivity parameter for obfuscating the counts in the Patient stratifier, has no effect if OBFUSCATE = "no"; default value: 1
DELTA_SPECIMEN = "20." # Sensitivity parameter for obfuscating the counts in the Specimen stratifier, has no effect if OBFUSCATE = "no"; default value: 20
DELTA_DIAGNOSIS = "3." # Sensitivity parameter for obfuscating the counts in the Diagnosis stratifier, has no effect if OBFUSCATE = "no"; default value: 3
DELTA_PROCEDURES = "1.7" # Sensitivity parameter for obfuscating the counts in the Procedures stratifier, has no effect if OBFUSCATE = "no"; default value: 1.7
DELTA_MEDICATION_STATEMENTS = "2.1" # Sensitivity parameter for obfuscating the counts in the Medication Statements stratifier, has no effect if OBFUSCATE = "no"; default value: 2.1
DELTA_HISTO = "20." # Sensitivity parameter for obfuscating the counts in the Histo stratifier, has no effect if OBFUSCATE = "no"; default value: 20
EPSILON = "0.1" # Privacy budget parameter for obfuscating the counts in the stratifiers, has no effect if OBFUSCATE = "no"; default value: 0.1
ROUNDING_STEP = "10" # The granularity of the rounding of the obfuscated values, has no effect if OBFUSCATE = "no"; default value: 10
PROJECTS_NO_OBFUSCATION = "exliquid;dktk_supervisors;exporter;ehds2" # Projects for which the results are not to be obfuscated, separated by ";" ; default value: "exliquid;dktk_supervisors;exporter;ehds2"
QUERIES_TO_CACHE = "queries_to_cache.conf" # The path to a file containing base64 encoded queries whose results are to be cached. If not set, no results are cached
PROVIDER = "name" #EUCAIM provider name
PROVIDER_ICON = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=" # Base64 encoded EUCAIM provider icon
AUTH_HEADER = "ApiKey XXXX" #Authorization header; if the endpoint type is Blaze or BlazeAndSql, this header is used for the Exporter target application, and the syntax is AUTH_HEADER = "XXXX" where "XXXX" is the API key

In order to use Postgres querying, a Docker image built with the feature "dktk" needs to be used and this optional variable set:

POSTGRES_CONNECTION_STRING = "postgresql://postgres:Test.123@localhost:5432/postgres" # Postgres connection string

Additionally when using Postgres this optional variable can be set:

MAX_DB_ATTEMPTS = "8" # Max number of attempts to connect to the database; default value: 8

Obfuscating zero counts is by default switched off. To enable obfuscating zero counts, set the env. variable OBFUSCATE_ZERO.

Optionally, you can provide the TLS_CA_CERTIFICATES_DIR environment variable to add additional trusted certificates, e.g., if you have a TLS-terminating proxy server in place. The application respects the HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY, and their respective lowercase equivalents.

Log level can be set using the RUST_LOG environment variable.

Usage

Creating a sample focus healthcheck task using curl (body can be any string and is ignored):

curl -v -X POST -H "Content-Type: application/json" --data '{"id":"7fffefff-ffef-fcff-feef-feffffffffff","from":"app1.proxy1.broker","to":["app1.proxy1.broker"],"ttl":"10s","failure_strategy":{"retry":{"backoff_millisecs":1000,"max_tries":5}},"metadata":{"project":"focus-healthcheck"},"body":"wie geht es"}' -H "Authorization: ApiKey app1.proxy1.broker App1Secret" http://localhost:8081/v1/tasks

Creating a sample task containing a Blaze query using curl:

curl -v -X POST -H "Content-Type: application/json" --data '{"id":"7fffefff-ffef-fcff-feef-fefbffffeeff","from":"app1.proxy1.broker","to":["app1.proxy1.broker"],"ttl":"10s","failure_strategy":{"retry":{"backoff_millisecs":1000,"max_tries":5}},"metadata":{"project":"exliquid"},"body":"ewoJImxhbmciOiAiY3FsIiwKCSJsaWIiOiB7CgkJImNvbnRlbnQiOiBbCgkJCXsKCQkJCSJjb250ZW50VHlwZSI6ICJ0ZXh0L2NxbCIsCgkJCQkiZGF0YSI6ICJiR2xpY21GeWVTQlNaWFJ5YVdWMlpRcDFjMmx1WnlCR1NFbFNJSFpsY25OcGIyNGdKelF1TUM0d0p3cHBibU5zZFdSbElFWklTVkpJWld4d1pYSnpJSFpsY25OcGIyNGdKelF1TUM0d0p3b0tZMjlrWlhONWMzUmxiU0JzYjJsdVl6b2dKMmgwZEhBNkx5OXNiMmx1WXk1dmNtY25DbU52WkdWemVYTjBaVzBnYVdOa01UQTZJQ2RvZEhSd09pOHZhR3czTG05eVp5OW1hR2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sZVR5cGUiLAoJCQkJCQkJImxhbmd1YWdlIjogInRleHQvY3FsIgoJCQkJCQl9CgkJCQkJfQoJCQkJXQoJCQl9CgkJXSwKCQkibGlicmFyeSI6ICJ1cm46dXVpZDo3ZmY1MzJhZC02OWU0LTQ4ZWQtYTJkMy05ZWZhZmI2MDlmNjIiLAoJCSJyZXNvdXJjZVR5cGUiOiAiTWVhc3VyZSIsCgkJInNjb3JpbmciOiB7CgkJCSJjb2RpbmciOiBbCgkJCQl7CgkJCQkJImNvZGUiOiAiY29ob3J0IiwKCQkJCQkic3lzdGVtIjogImh0dHA6Ly90ZXJtaW5vbG9neS5obDcub3JnL0NvZGVTeXN0ZW0vbWVhc3VyZS1zY29yaW5nIgoJCQkJfQoJCQldCgkJfSwKCQkic3RhdHVzIjogImFjdGl2ZSIsCgkJInN1YmplY3RDb2RlYWJsZUNvbmNlcHQiOiB7CgkJCSJjb2RpbmciOiBbCgkJCQl7CgkJCQkJImNvZGUiOiAiUGF0aWVudCIsCgkJCQkJInN5c3RlbSI6ICJodHRwOi8vaGw3Lm9yZy9maGlyL3Jlc291cmNlLXR5cGVzIgoJCQkJfQoJCQldCgkJfSwKCQkidXJsIjogInVybjp1dWlkOjVlZThkZTczLTM0N2UtNDdjYS1hMDE0LWYyZTcxNzY3YWRmYyIKCX0KfQ=="}' -H "Authorization: ApiKey app1.proxy1.broker App1Secret" http://localhost:8081/v1/tasks

Creating a sample task containing an abstract syntax tree (AST) query using curl:

curl -v -X POST -H "Content-Type: application/json" --data '{"id":"7fffefff-ffef-fcff-feef-feffffffffff","from":"app1.proxy1.broker","to":["app1.proxy1.broker"],"ttl":"10s","failure_strategy":{"retry":{"backoff_millisecs":1000,"max_tries":5}},"metadata":{"project":"bbmri"},"body":"eyJsYW5nIjoiYXN0IiwicGF5bG9hZCI6ImV5SmhjM1FpT25zaWIzQmxjbUZ1WkNJNklrOVNJaXdpWTJocGJHUnlaVzRpT2x0N0ltOXdaWEpoYm1RaU9pSkJUa1FpTENKamFHbHNaSEpsYmlJNlczc2liM0JsY21GdVpDSTZJazlTSWl3aVkyaHBiR1J5Wlc0aU9sdDdJbXRsZVNJNkltZGxibVJsY2lJc0luUjVjR1VpT2lKRlVWVkJURk1pTENKemVYTjBaVzBpT2lJaUxDSjJZV3gxWlNJNkltMWhiR1VpZlN4N0ltdGxlU0k2SW1kbGJtUmxjaUlzSW5SNWNHVWlPaUpGVVZWQlRGTWlMQ0p6ZVhOMFpXMGlPaUlpTENKMllXeDFaU0k2SW1abGJXRnNaU0o5WFgxZGZWMTlMQ0pwWkNJNkltRTJaakZqWTJZekxXVmlaakV0TkRJMFppMDVaRFk1TFRSbE5XUXhNelZtTWpNME1DSjkifQ=="}' -H "Authorization: ApiKey app1.proxy1.broker App1Secret" http://localhost:8081/v1/tasks

Creating a sample SQL task for a SELECT_TEST query using curl:

 curl -v -X POST -H "Content-Type: application/json" --data '{"id":"7fffefff-ffef-fcff-feef-feffffffffff","from":"app1.proxy1.broker","to":["app1.proxy1.broker"],"ttl":"10s","failure_strategy":{"retry":{"backoff_millisecs":1000,"max_tries":5}},"metadata":{"project":"exliquid"},"body":"eyJwYXlsb2FkIjoiU0VMRUNUX1RFU1QifQ=="}' -H "Authorization: ApiKey app1.proxy1.broker App1Secret" http://localhost:8081/v1/tasks

Creating a sample Exporter "execute" task containing an Exporter query using curl:

curl -v -X POST -H "Content-Type: application/json" --data '{"body":"ew0KICAicXVlcnktY29udGV4dCIgOiAiVUZKUFNrVkRWQzFKUkQxa01qaGhZVEl5Wm1Wa01USTBNemM0T0RWallnPT0iLA0KICAicXVlcnktbGFiZWwiIDogIlRlc3QgMyIsDQogICJxdWVyeS1leGVjdXRpb24tY29udGFjdC1pZCIgOiAiYmstYWRtaW5AdGVzdC5kZmt6LmRlIiwNCiAgInF1ZXJ5LWRlc2NyaXB0aW9uIiA6ICJUaGlzIGlzIHRoZSB0ZXN0IDMiLA0KICAicXVlcnktZXhwaXJhdGlvbi1kYXRlIiA6ICIyMDI0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3aVkzSnBkR1Z5YVdFaU9uc2liR0Z1WjNWaFoyVWlPaUowWlhoMEwyTnhiQzFwWkdWdWRHbG1hV1Z5SWl3aVpYaHdjbVZ6YzJsdmJpSTZJazFsWkdsallYUnBiMjVUZEdGMFpXMWxiblFpZlgxZExDSnpkSEpoZEdsbWFXVnlJanBiZXlKamIyUmxJanA3SW5SbGVIUWlPaUpOWldScFkyRjBhVzl1Vkhsd1pTSjlMQ0pqY21sMFpYSnBZU0k2ZXlKc1lXNW5kV0ZuWlNJNkluUmxlSFF2WTNGc0lpd2laWGh3Y21WemMybHZiaUk2SWxCeWIyTmxaSFZ5WlZSNWNHVWlmWDFkZlYxOWZRPT0iLA0KICAicXVlcnktY29udGFjdC1pZCIgOiAicmVzZWFyY2hlckB0ZXN0LmRrZnouZGUiLA0KICAicXVlcnktZm9ybWF0IiA6ICJDUUxfREFUQSIsDQogICJ0ZW1wbGF0ZS1pZCIgOiAiY2NwIg0KfQ==","failure_strategy":{"retry":{"backoff_millisecs":1000,"max_tries":5}},"from":"app1.proxy1.broker","id":"22e1ea3a-07f3-4592-a888-82f2226a44a2","metadata":{"project":"exporter","task_type":"EXECUTE"},"to":["app1.proxy1.broker"],"ttl":"10s","status":null,"task":null}' -H "Authorization: ApiKey app1.proxy1.broker App1Secret" http://localhost:8081/v1/tasks

Creating a sample Exporter "status" task using curl:

curl -v -X POST -H "Content-Type: application/json" --data '{"body":"ew0KICAicXVlcnktZXhlY3V0aW9uLWlkIiA6ICIxOSINCn0=","failure_strategy":{"retry":{"backoff_millisecs":1000,"max_tries":5}},"from":"app1.proxy1.broker","id":"22e1ea3a-07f3-4592-a888-82f2226a44a2","metadata":{"project":"exporter","task_type":"STATUS"},"to":["app1.proxy1.broker"],"ttl":"10s","status":null,"task":null}' -H "Authorization: ApiKey app1.proxy1.broker App1Secret" http://localhost:8081/v1/tasks

License

This code is licensed under the Apache License 2.0. For details, please see LICENSE