Configuration Options¶
The recruIT modules are configured through environment variables. This page lists every setting of the screening list
(list) and the query module (query-sql-on-fhir).
How you set them depends on how recruIT is deployed:
- Docker Compose:
compose.yamlpasses the most important settings from variables in your.envfile, see below. To set any other setting on this page, add it to the service'senvironmentin acompose.override.yaml, see Mail server and port for an example. - Helm: the chart sets these from its values, which are documented in the
chart's README. For a setting
the chart doesn't expose, use
list.extraEnvorquerySqlOnFhir.extraEnv.
Docker Compose¶
These are the variables compose.yaml reads from your .env file, and the module settings they set:
.env variable |
Required | Screening list setting | Query module setting |
|---|---|---|---|
FHIR_SERVER_BASE_URL |
yes | FhirServer__BaseUrl |
FHIR_SERVER_BASE_URL |
LIST_CONNECTIONSTRINGS_APPDB |
yes | ConnectionStrings__AppDb |
|
PGPASSWORD |
yes | PGPASSWORD |
|
AUTH_ENABLED |
no | Auth__Enabled |
|
AUTH_OIDC_AUTHORITY |
yes¹ | Auth__Oidc__Authority |
|
AUTH_OIDC_CLIENT_ID |
yes¹ | Auth__Oidc__ClientId |
|
AUTH_OIDC_CLIENT_SECRET |
yes¹ | Auth__Oidc__ClientSecret |
|
AUTH_OIDC_ROLE_CLAIM_TYPE |
no | Auth__Oidc__RoleClaimType |
|
TRINO_JDBC_URL |
yes | SPRING_DATASOURCE_URL |
|
TRINO_USERNAME |
yes | SPRING_DATASOURCE_USERNAME |
|
TRINO_PASSWORD |
yes² | SPRING_DATASOURCE_PASSWORD |
|
SQL_ON_FHIR_URL |
no | SQL_ON_FHIR_URL |
|
QUERY_SQL_ON_FHIR_SCHEDULE_CRON |
no | QUERY_SQL_ON_FHIR_SCHEDULE_CRON |
¹ Required when AUTH_ENABLED=true.
² May be empty: Trino only accepts passwords over TLS, so a Trino without authentication needs an empty password.
Two more variables select the images: RECRUIT_IMAGE_BASE_NAME (default ghcr.io/open-recruit/recruit) and
RECRUIT_IMAGE_TAG (default: the release the Compose files belong to).
The create-search-parameters job only uses FHIR_SERVER_BASE_URL.
Screening list¶
The screening list is an ASP.NET Core app. Nested settings use __ as the separator in environment variable names,
e.g. Auth__Oidc__Authority sets Oidc.Authority inside the Auth section.
FHIR server¶
FhirServer__BaseUrl(required): base URL of the FHIR server, e.g.https://fhir.example.com/fhir.
Database¶
The screening list stores user permissions, notification subscriptions and its job queue in PostgreSQL.
ConnectionStrings__AppDb(required): an Npgsql connection string, e.g.Host=postgres;Port=5432;Database=recruit;Username=recruit.PGUSER,PGPASSWORD: database user and password, used if the connection string doesn't contain them.
Authentication¶
Auth__Enabled(defaultfalse): whether users sign in via OpenID Connect. Whenfalse, anyone who can reach the screening list is treated as a signed-in admin and can see every study and patient. Always set it totruein production.Auth__AdminRoles(defaultadmin): the roles that can see every study and manage eligibility criteria and access permissions. Holding any one of them is enough. Set one variable per role, numbered from0, e.g.Auth__AdminRoles__0=adminandAuth__AdminRoles__1=recruit-admin. Setting roles replaces theadmindefault. Users with none of the roles only see the studies they've been given access to.Auth__AdminRole(deprecated): the single-role predecessor ofAuth__AdminRoles. It still works and is treated as the first admin role, but the screening list logs a warning at startup. Move it toAuth__AdminRoles__0instead.Auth__RequireVerifiedEmail(defaulttrue): study access that was given to an email address, before that person had ever signed in, only applies once the identity provider reports the address as verified (theemail_verifiedclaim). Without this, anyone who can register at the identity provider with someone else's address would get that person's access. A user whose address isn't verified can still use access given to them by their account, and can't subscribe to email notifications. Set it tofalseonly for an identity provider that doesn't sendemail_verifiedand doesn't let users choose unverified addresses. It takes effect at the next sign-in, so people already signed in lose email-based access until they sign in again.Auth__Oidc__Authority: issuer URL of the OpenID Connect provider, e.g.https://auth.example.com/realms/recruit.Auth__Oidc__ClientId,Auth__Oidc__ClientSecret: the screening list's client credentials.Auth__Oidc__RoleClaimType(defaultrole): the ID token claim holding the user's roles. It must be a top-level claim: a path into a nested claim, such asrealm_access.rolesorresource_access.recruit.roles, matches nothing. Don't point it at a claim that holds the groups or roles of every app your identity provider serves, such asgroups: anadminthere may belong to a different app, and would make its holder an admin here as well.Auth__Oidc__GroupClaimType(defaultgroups) andAuth__Oidc__GroupRoleMappings: grant a role to the members of an identity provider group.GroupRoleMappingsmaps group names to roles, e.g.{ "/recruit-admins": "admin" }in theAuth:Oidcsection of the app's configuration. Only map groups that are specific to the screening list, not a name other apps use too, such as a bareadmin.
Register the screening list as a confidential client with the OpenID Connect provider, with the redirect URI
https://<screening list host>/signin-oidc. The screening list requests the openid, profile, email and
offline_access scopes.
Keycloak¶
Keycloak sends a client's own roles in the nested resource_access.<client ID>.roles claim, and by default only in
the access token, so the screening list can't read them. Add a mapper that also puts them in a top-level claim of the
ID token: in the screening list's client, open Client scopes → <client ID>-dedicated → Add mapper →
By configuration → User Client Role and set
- Client ID: the screening list's client
- Token Claim Name:
role, or whateverAuth__Oidc__RoleClaimTypeis set to - Multivalued and Add to ID token: on
Then create the roles from Auth__AdminRoles as roles of that client and assign them to your admins. To check the
result, pick a user under the client's Client scopes → Evaluate and open Generated ID token: it should
contain e.g. "role": ["admin"], holding only the screening list's own roles.
Notifications¶
See Notifications for how notifications work. They are sent by email:
Notifications__Email__SmtpHost,Notifications__Email__SmtpPort(default25): the SMTP server. TLS is negotiated automatically based on the port.Notifications__Email__SmtpUsername,Notifications__Email__SmtpPassword: SMTP credentials, if the server needs them.Notifications__Email__From: the sender address.Notifications__Email__SubjectTemplate: the subject line.{0}is replaced with the study's acronym.-
Notifications__Email__PublicBaseUrl: the URL users open the screening list at, e.g.https://recruit.example.com/. Every link in the emails is built from it, so it must be reachable from where your users read their email. -
Notifications__ScanSchedule(default* * * * *, every minute): when the screening list checks for new candidates, as a cron expression in UTC. It has five fields (minute, hour, day of month, month, day of week), or six with seconds first. For example*/5 * * * *checks every 5 minutes and0 6-18 * * *on the hour from 06:00 to 18:00. A value that isn't a valid cron expression stops the screening list from starting.
Due emails are sent every 5 minutes, which isn't configurable.
Notifications__Testing__Enabled(defaultfalse): adds buttons to the admin-only Notification Test page to simulate a new recommendation and to send due emails straight away, see Trying it out in the demo. Simulating a recommendation notifies everyone subscribed to the trial for real and changes its screening list on the FHIR server, so only turn this on for development, demo and test installations.
Ports and observability¶
HTTP_PORT(default8080): port of the web app.METRICS_PORT(default8081): port serving Prometheus metrics at/metrics.Tracing__Enabled(defaultfalse): export OpenTelemetry traces, configured via the standard variables likeOTEL_EXPORTER_OTLP_ENDPOINT.
Query module¶
The query module is a Spring Boot app. Its settings can be set as environment variables using Spring Boot's
relaxed binding,
e.g. QUERY_SQL_ON_FHIR_SCHEDULE_CRON for query-sql-on-fhir.schedule.cron.
FHIR server access¶
FHIR_SERVER_BASE_URL(required): base URL of the FHIR server.FHIR_SERVER_TIMEOUT_IN_SECONDS(default300): timeout of requests to the FHIR server.FHIR_USE_UPDATE_AS_CREATE(defaultfalse): write screening list entries usingPUTwith a deterministic id instead of conditional creates, for FHIR servers that don't support conditional creates.
Criteria database¶
The database the eligibility criteria's SQL is run against.
SPRING_DATASOURCE_URL(required): JDBC URL, e.g.jdbc:trino://trino.example.com:443/fhir/default?SSL=true. For Trino, it must include the catalog and schema holding the FHIR tables.SPRING_DATASOURCE_USERNAME,SPRING_DATASOURCE_PASSWORD: database credentials.QUERY_SQL_ON_FHIR_SQL_DIALECT(defaulttrino): the database's SQL dialect,trinoorduckdb. A criterion is run directly if its Library hasapplication/sql;dialect=<dialect>content. For DuckDB, also setSPRING_DATASOURCE_DRIVERCLASSNAME=org.duckdb.DuckDBDriver, see Querying FHIR resources with DuckDB.SQL_ON_FHIR_URL: base URL of a SQL on FHIR server such as Pathling. Criteria that depend on ViewDefinitions or have no content in the configured dialect are sent to its$sqlquery-runoperation.
Schedule¶
QUERY_SQL_ON_FHIR_RUN_MODE(defaultscheduled):scheduledruns forever on the schedule below.one-shotruns once and exits, with a non-zero exit code if any study failed, e.g. for running it as a Kubernetes Job.QUERY_SQL_ON_FHIR_SCHEDULE_CRON(default@hourly): when to update the screening lists, as a Spring cron expression with six fields (seconds first) or a macro like@hourly.MANAGEMENT_PROMETHEUS_METRICS_EXPORT_PUSHGATEWAY_ENABLED(defaultfalse): push the metrics to a Prometheus Pushgateway atMANAGEMENT_PROMETHEUS_METRICS_EXPORT_PUSHGATEWAY_ADDRESS(host:port), for one-shot runs that exit before Prometheus would scrape them.MANAGEMENT_PROMETHEUS_METRICS_EXPORT_PUSHGATEWAY_GROUPINGKEY_<NAME>adds a label to every pushed metric. See Metrics for one-shot runs.
Screening behavior¶
QUERY_SQL_ON_FHIR_REQUIRE_ALL_CRITERIA_MET(defaultfalse): by default, patients for whom a criterion can't be evaluated because of missing data are also recommended, for manual review. Whentrue, only patients who meet every criterion are recommended.QUERY_SQL_ON_FHIR_MAX_RESEARCH_SUBJECTS(default-1, unlimited): skip a study if it would recommend more patients than this.QUERY_SQL_ON_FHIR_DRY_RUN(defaultfalse): run the criteria and log how many patients would be recommended, without writing anything to the FHIR server.QUERY_SQL_ON_FHIR_TRANSACTION_BUNDLE_CHUNK_SIZE(default500): the maximum number of patients written to the FHIR server per transaction.QUERY_SQL_ON_FHIR_FUNNEL_ENABLED(defaultfalse): also compute each study's attrition funnel, i.e. how many patients remain after applying each criterion, shown in the screening list. It's a considerably more expensive query.QUERY_SQL_ON_FHIR_FUNNEL_TOTAL_POPULATION_SQL(defaultSELECT COUNT(*) FROM Patient): the query counting the funnel's total population, e.g.SELECT COUNT(*) FROM fhir.default.patient.
Observability¶
OTEL_SDK_DISABLED(defaulttrue): set tofalseto export OpenTelemetry traces, configured via the standard variables likeOTEL_EXPORTER_OTLP_ENDPOINT.- Health checks are served at
/actuator/healthand Prometheus metrics at/actuator/prometheuson port8080.