Using the fact
application
The fact-models
packages provides an executable for working with fact files
within the event-data-model
directory.
Building the application
There are two ways to use the application:
-
Run with
cabal run
-
Install via
cabal
Using via cabal run
(recommended)
Instead of installing fact
in your $PATH
,
you can use cabal run
:
cabal run fact-models:exe:fact -- --help
You should then see something like:
Usage: fact COMMAND [--dir ARG]
Available options:
-h,--help Show this help text
Available commands:
build Build facts
check Check that a fact's artifacts are up-to-date
list List available facts
This approach ensures that you’re using the latest version of the app without having to reinstall new updates.
Usage
The application currenlty has three commmands:
-
build
: Build artifacts for fact(s) -
check
: Check that fact artifacts are up-to-date -
list
: List available facts
Commands are invoked at the command-line as in:
cabal run fact-models:exe:fact -- build --help
cabal run fact-models:exe:fact -- check --help
cabal run fact-models:exe:fact -- list --help
Examples
The following command prints a preview of the files
that will be created when the --dry-run
flag is removed.
% cabal run fact-models:exe:fact -- build --fact=ServiceLocation --dry-run
fact-models/src/Facts/ServiceLocation/Fact.dhallType:
-- DO NOT EDIT: this file is auto-generated
{- tag::doc[] -}
< Inpatient | Outpatient >
{- end::doc[] -}
<<rest snipped>>
You can check that a fact’s artifacts are up-to-date with the following:
% cabal run fact-models:exe:fact -- check --fact=Claim
The command should produce no output if the files are up-to-date.