Command-line reference
For: operators. Every command and option of the ferroehr binary,
as ferroehr <command> --help prints it. The guides to the commands are
on CLI & production checklist.
ferroehrferroehr serveferroehr configferroehr config checkferroehr healthcheckferroehr dbferroehr db migrateferroehr db verifyferroehr db eraseferroehr db sweep-blobsferroehr usage-reportferroehr definitionsferroehr definitions loadferroehr access-logferroehr access-log checkpointferroehr access-log verifyferroehr access-log exportferroehr access-log importferroehr audit-chainferroehr audit-chain sealferroehr audit-chain verifyferroehr party-bindingferroehr party-binding refillferroehr party-binding checkferroehr party-binding adoptferroehr party-binding grantferroehr pmirferroehr pmir listferroehr pmir retryferroehr pmir settleferroehr report
ferroehr
openEHR-conformant CDR server
Usage: ferroehr [OPTIONS] [COMMAND]
Commands:
serve Serves until the process is asked to stop
config Works on the configuration
healthcheck Asks the server running beside this process whether it is ready, and exits 0 only when it is
db Database schema utilities (apply or verify the migrations, or erase the instance), then exit
usage-report The usage report to `FerroPULSE`: print the report this instance would send, without sending it
definitions The definition store: `load` templates from files before `serve`
access-log The access log: seal a checkpoint, verify, export and import
audit-chain The system chain, the records outside the access log: seal its head and verify it
party-binding The party binding side table: `refill` it after a mapping change
pmir The PMIR feed messages the consumer refused: list, retry or settle them
report Write a redacted report of what this deployment runs (build, features, specification pins, migration level, posture, licence, manufacturer and configuration), the file a complaint or an incident report attaches
help Print this message or the help of the given subcommand(s)
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
-V, --version
Print version
ferroehr serve
Serves until the process is asked to stop
Usage: ferroehr serve [OPTIONS]
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr config
Works on the configuration
Usage: ferroehr config [OPTIONS] <COMMAND>
Commands:
check Reads the configuration, reports every refusal with its key, and prints the running tree with every secret redacted
help Print this message or the help of the given subcommand(s)
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr config check
Reads the configuration, reports every refusal with its key, and prints the running tree with every secret redacted
Usage: ferroehr config check [OPTIONS]
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr healthcheck
Asks the server running beside this process whether it is ready, and exits 0 only when it is
Usage: ferroehr healthcheck [OPTIONS]
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr db
Database schema utilities (apply or verify the migrations, or erase the instance), then exit
Usage: ferroehr db [OPTIONS] <COMMAND>
Commands:
migrate Apply the embedded migrations and exit; the DSN must hold DDL rights
verify Verify, without issuing any DDL, that the database carries exactly this build's migrations; exit 0 when it does, 1 otherwise
erase Permanently erase every piece of data and every setting this instance stores: the multimedia blobs, then every schema the migrations create
sweep-blobs Delete every multimedia blob no stored version references and that is older than `[record.multimedia] orphan_grace`: the blobs commits that failed after their upload left behind
help Print this message or the help of the given subcommand(s)
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr db migrate
Apply the embedded migrations and exit; the DSN must hold DDL rights
Usage: ferroehr db migrate [OPTIONS]
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr db verify
Verify, without issuing any DDL, that the database carries exactly this build's migrations; exit 0 when it does, 1 otherwise
Usage: ferroehr db verify [OPTIONS]
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr db erase
Permanently erase every piece of data and every setting this instance stores: the multimedia blobs, then every schema the migrations create.
Without `--confirm` it erases nothing: it prints what it would erase and the value `--confirm` must carry, and exits 1. Run it with every server stopped; the DSN must own the schemas.
Usage: ferroehr db erase [OPTIONS]
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--confirm <INSTANCE>
The instance to erase, as the run without `--confirm` prints it: the stored instance id, or the clinical database's name when the database stores no instance id
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help (see a summary with '-h')
ferroehr db sweep-blobs
Delete every multimedia blob no stored version references and that is older than `[record.multimedia] orphan_grace`: the blobs commits that failed after their upload left behind.
Without `--apply` it deletes nothing and prints what it would delete. It can run while servers serve: a blob younger than the grace period is always kept.
Usage: ferroehr db sweep-blobs [OPTIONS]
Options:
--apply
Delete the orphans instead of listing them
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help (see a summary with '-h')
ferroehr usage-report
The usage report to `FerroPULSE`: print the report this instance would send, without sending it
Usage: ferroehr usage-report [OPTIONS] --print
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--print
Print the report as the exact JSON body a send would carry, then exit. Required: printing is the only action
--event <EVENT>
Which report to print
Possible values:
- start: The report sent at each process start
- daily: The report sent once a day, with the metrics window
[default: start]
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help (see a summary with '-h')
ferroehr definitions
The definition store: `load` templates from files before `serve`
Usage: ferroehr definitions [OPTIONS] <COMMAND>
Commands:
load Store each file in the definition store, in the order given, with the validation and versioning of the REST upload, then exit. An `.opt` file is an OPT 1.4 template and an `.adls` file an ADL 2 archetype or template, whose parents and slot fillers come before it. A file whose id is stored with the same text is left alone; one stored with other text is refused
help Print this message or the help of the given subcommand(s)
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr definitions load
Store each file in the definition store, in the order given, with the validation and versioning of the REST upload, then exit. An `.opt` file is an OPT 1.4 template and an `.adls` file an ADL 2 archetype or template, whose parents and slot fillers come before it. A file whose id is stored with the same text is left alone; one stored with other text is refused
Usage: ferroehr definitions load [OPTIONS] <PATH>...
Arguments:
<PATH>...
The definition files
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr access-log
The access log: seal a checkpoint, verify, export and import
Usage: ferroehr access-log [OPTIONS] <COMMAND>
Commands:
checkpoint Print the checkpoint of the head of the access log, sealing it with the keyring's key when no append sealed it
verify Verify the access log against its newest checkpoint, or the one in `--checkpoint`, and print every finding. Exits non-zero when the log does not verify
export Export one EHR's access log, with the checkpoint it verifies against, for the EHR's transfer to another system
import Import an EHR's access log another system exported, verified against its checkpoint and `[audit.access_log] trusted_key_files`, and record the import as an entry of this system's log
help Print this message or the help of the given subcommand(s)
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr access-log checkpoint
Print the checkpoint of the head of the access log, sealing it with the keyring's key when no append sealed it
Usage: ferroehr access-log checkpoint [OPTIONS]
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr access-log verify
Verify the access log against its newest checkpoint, or the one in `--checkpoint`, and print every finding. Exits non-zero when the log does not verify
Usage: ferroehr access-log verify [OPTIONS]
Options:
--checkpoint <FILE>
A checkpoint kept outside this system, as the JSON `ferroehr access-log checkpoint` printed
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr access-log export
Export one EHR's access log, with the checkpoint it verifies against, for the EHR's transfer to another system
Usage: ferroehr access-log export [OPTIONS] --ehr-id <EHR_ID>
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--ehr-id <EHR_ID>
The EHR whose log is exported
--output <FILE>
Where to write the export; `-` or unset writes it to stdout
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr access-log import
Import an EHR's access log another system exported, verified against its checkpoint and `[audit.access_log] trusted_key_files`, and record the import as an entry of this system's log
Usage: ferroehr access-log import [OPTIONS] --input <FILE>
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--input <FILE>
The export to import
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr audit-chain
The system chain, the records outside the access log: seal its head and verify it
Usage: ferroehr audit-chain [OPTIONS] <COMMAND>
Commands:
seal Seal every committed system record in windows with the keyring's key, and print the newest window's seal
verify Verify every sealed window of the system records against the newest seal, or the one in `--seal`, and print every finding. Exits non-zero when the records do not verify
help Print this message or the help of the given subcommand(s)
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr audit-chain seal
Seal every committed system record in windows with the keyring's key, and print the newest window's seal
Usage: ferroehr audit-chain seal [OPTIONS]
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr audit-chain verify
Verify every sealed window of the system records against the newest seal, or the one in `--seal`, and print every finding. Exits non-zero when the records do not verify
Usage: ferroehr audit-chain verify [OPTIONS]
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--seal <FILE>
A seal kept outside this system, as the JSON `ferroehr audit-chain seal` printed
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr party-binding
The party binding side table: `refill` it after a mapping change
Usage: ferroehr party-binding [OPTIONS] <COMMAND>
Commands:
refill Rebuild the binding side table, the policy grants included, from the party versions under the configured mapping and store its digest. Run it with every replica stopped: it refuses while a replica's lease is live. A key issuer added or removed needs no refill: the running replicas fill and retire its key space themselves. With no mapping configured it rebuilds the policy grants alone. It then rebuilds the `EHR_ACCESS` projection from every EHR's current `EHR_ACCESS` version
check Report, from the party versions and writing nothing, what binding will make of them: the keys per issuer, duplicates, inactive and abandoned persons, the provisional persons just-in-time creation left incomplete for longer than `[authz.party_binding] provisional_report_after`, key-bearing persons with no professional `ROLE`, the mapped Basic users, and the committer that introduced each key. It exits non-zero on a duplicate, a missing person or a key whose committer fails the provenance rule
adopt Give each listed `PERSON` a professional `ROLE` of the mapping's role template, in one demographic CONTRIBUTION committed by the first administrator named, with one access record per adopted `PERSON`. It refuses, naming them, the `PERSON`s whose key fails the provenance rule of `check`
grant Grant an operation of the `openehr_access` terminology to a client, on the operator's authority: an `AGENT` carrying the client identifier, unless an `ACTOR` names the client already, and a `ROLE` it performs whose capability grants the operation with the scope elements given. It is the first grant of a new deployment, such as the `scim_provision` of the client that provisions the administrators; every later grant is an administrator's write through the Demographic API. A client that holds the operation already gets nothing. With `--basic-user`, the `ROLE` is performed by the `PERSON` the Basic user binds to, such as the `hold_scopes` of a development lane's users
help Print this message or the help of the given subcommand(s)
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr party-binding refill
Rebuild the binding side table, the policy grants included, from the party versions under the configured mapping and store its digest. Run it with every replica stopped: it refuses while a replica's lease is live. A key issuer added or removed needs no refill: the running replicas fill and retire its key space themselves. With no mapping configured it rebuilds the policy grants alone. It then rebuilds the `EHR_ACCESS` projection from every EHR's current `EHR_ACCESS` version
Usage: ferroehr party-binding refill [OPTIONS]
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr party-binding check
Report, from the party versions and writing nothing, what binding will make of them: the keys per issuer, duplicates, inactive and abandoned persons, the provisional persons just-in-time creation left incomplete for longer than `[authz.party_binding] provisional_report_after`, key-bearing persons with no professional `ROLE`, the mapped Basic users, and the committer that introduced each key. It exits non-zero on a duplicate, a missing person or a key whose committer fails the provenance rule
Usage: ferroehr party-binding check [OPTIONS]
Options:
--admin <PARTY_ID>
An administrator, named by the container id of its `PERSON`: a key its commit introduced passes the provenance rule
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--admin-key <ISSUER> <KEY>
An administrator, named by the `identifier_issuer` and value of a binding key its `PERSON` carries
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
--migration <COMMITTER_NAME>
The committer name of a migration the operator declares: a key its commit introduced passes the provenance rule
--expected <FILE>
The identity provider's assigned users, one login identifier per line: every one with no `PERSON` is listed
--expected-issuer <ISSUER>
The `identifier_issuer` the `--expected` logins are keys of; needed when more than one `[auth.issuer.<name>.party]` table is configured
-h, --help
Print help
ferroehr party-binding adopt
Give each listed `PERSON` a professional `ROLE` of the mapping's role template, in one demographic CONTRIBUTION committed by the first administrator named, with one access record per adopted `PERSON`. It refuses, naming them, the `PERSON`s whose key fails the provenance rule of `check`
Usage: ferroehr party-binding adopt [OPTIONS] <PARTY_ID>...
Arguments:
<PARTY_ID>...
The container ids of the `PERSON`s to adopt
Options:
--admin <PARTY_ID>
An administrator, named by the container id of its `PERSON`: a key its commit introduced passes the provenance rule
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--admin-key <ISSUER> <KEY>
An administrator, named by the `identifier_issuer` and value of a binding key its `PERSON` carries
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
--migration <COMMITTER_NAME>
The committer name of a migration the operator declares: a key its commit introduced passes the provenance rule
-h, --help
Print help
ferroehr party-binding grant
Grant an operation of the `openehr_access` terminology to a client, on the operator's authority: an `AGENT` carrying the client identifier, unless an `ACTOR` names the client already, and a `ROLE` it performs whose capability grants the operation with the scope elements given. It is the first grant of a new deployment, such as the `scim_provision` of the client that provisions the administrators; every later grant is an administrator's write through the Demographic API. A client that holds the operation already gets nothing. With `--basic-user`, the `ROLE` is performed by the `PERSON` the Basic user binds to, such as the `hold_scopes` of a development lane's users
Usage: ferroehr party-binding grant [OPTIONS] --operation <CODE>
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--issuer <ISSUER>
The issuer of the client's tokens
--client-id <CLIENT_ID>
The client's OAuth 2.0 `client_id`
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
--basic-user <USER>
The Basic user of `[[auth.basic.users]]` whose `PERSON` is granted the operation, found by the binding key `[[authz.party_binding.basic_user]]` maps it by, in place of a client
--operation <CODE>
The operation's code, such as `scim_provision`
--element <CODE=TEXT>
A scope element of the grant, its code of the draft access terminology and the text it names, such as `binding_issuer=urn:example:login`
--provider-issuer <ISSUER>
The issuer of a `provider` element's `DV_IDENTIFIER`, paired in order with `--provider-id`: a provider whose care relationships and memberships a `write_care_relationship` grant writes
--provider-id <ID>
The id of a `provider` element's `DV_IDENTIFIER`, paired in order with `--provider-issuer`
-h, --help
Print help
ferroehr pmir
The PMIR feed messages the consumer refused: list, retry or settle them
Usage: ferroehr pmir [OPTIONS] <COMMAND>
Commands:
list Print the refused messages still to retry or settle, oldest first, as JSON: each with its refusal code, receipt and refusal time, attempts, the Registry's identities it names and the `PERSON`s it keeps split, as counts. No identifier value is printed
retry Put a refused message back at its arrival position once its cause is fixed, such as a `[[pix.identifier_domain]]` entry or a grant added; a running replica applies it next. Refused when a message received after it that names one of its identities has applied
settle Close a refused message without applying it: `discard` keeps its splits, `lift-splits` removes them so its identifiers and record subjects resolve as before the message. A discarded message may still have its splits lifted
help Print this message or the help of the given subcommand(s)
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr pmir list
Print the refused messages still to retry or settle, oldest first, as JSON: each with its refusal code, receipt and refusal time, attempts, the Registry's identities it names and the `PERSON`s it keeps split, as counts. No identifier value is printed
Usage: ferroehr pmir list [OPTIONS] --operator <NAME>
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--operator <NAME>
The operator the access records name
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr pmir retry
Put a refused message back at its arrival position once its cause is fixed, such as a `[[pix.identifier_domain]]` entry or a grant added; a running replica applies it next. Refused when a message received after it that names one of its identities has applied
Usage: ferroehr pmir retry [OPTIONS] --operator <NAME> <MESSAGE_ID>
Arguments:
<MESSAGE_ID>
The message's `MessageHeader.id`
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--operator <NAME>
The operator the access record names
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help
ferroehr pmir settle
Close a refused message without applying it: `discard` keeps its splits, `lift-splits` removes them so its identifiers and record subjects resolve as before the message. A discarded message may still have its splits lifted
Usage: ferroehr pmir settle [OPTIONS] --decision <DECISION> --reason <TEXT> --operator <NAME> <MESSAGE_ID>
Arguments:
<MESSAGE_ID>
The message's `MessageHeader.id`
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--decision <DECISION>
`discard` or `lift-splits`
--reason <TEXT>
Why, 1 to 1000 characters naming no identifier
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
--operator <NAME>
The operator the row and the access record name
-h, --help
Print help
ferroehr report
Write a redacted report of what this deployment runs (build, features, specification pins, migration level, posture, licence, manufacturer and configuration), the file a complaint or an incident report attaches
Usage: ferroehr report [OPTIONS]
Options:
--config <PATH>
The TOML configuration file; unset, the product's `_CONFIG` variable names it
--output <OUTPUT>
Where to write the report; `-` writes it to stdout. Unset, it is `ferroehr-report-<UTC time>.json` in the working directory
--set <KEY=VALUE>
One configuration key set over the file and the environment, as `key=value`; repeatable
-h, --help
Print help