Generate Realtime Export Schema
The generate-rte-schema
command generates a minimal Realtime Export (RTE) json ruleset and an SQL schema creation script based on a package-spec.json
which identifies a source Implementation Guide (IG) which has been saved to the classpath where smileutil
is running.
See Realtime Export for information on RTE and and Packages and Implementation Guides for information on IGs and package-spec.json.
Example using FHIR Version R4 and POSTGRES database engine.
bin/smileutil generate-rte-schema
-i "./path/to/package-spec.json"
-o "./output/files/path"
-v "R4"
-s "POSTGRES_9_4"
-c "/path/to/child/tables/file.txt"
and the package-spec.json
file should look like:
{
"name": "hl7.fhir.r4.core",
"version": "4.0.1",
"packageUrl": "classpath:hl7.fhir.r4.core-4.0.1.tgz",
...
}
The packageUrl
parameter MUST be specified and be pointing at a valid IG NPM package in either the classes
or customerlib
folders.
The following output files will be saved in the specified directory (./outputfiles/path
):
output.json
the RTE schemaoutput.sql
the SQL scripts for the specified engine to create the desired tablesunmapped_columns.csv
a CSV file containing a list of columns that could not be mapped and the reasons why-i [implementation-guide]
– The input package-spec.json defining the IG to use.-o [output]
– Path where output json and sql files should be saved.-v [version]
– The FHIR version that is to be used. Currently, only supported value is R4
-s [sql-engine]
– The SQL engine to target for table creation scripts. Currently, only supported values are [MSSQL_2012
, MYSQL_5_7
, ORACLE_12C
, POSTGRES_9_4
]-p [table-name-prefix]
– (optional) Tables are named after the resource type with some prefix. The default prefix is rte_
; but another can be specified with this parameter.-c [child-tables]
– (optional) An input text file containing a list of FHIR paths (one path per line) defining child tables to create. For example, specifying Patient.name
would generate a child patient name table (provided Patient.name is a FHIR path utilized by a SearchParameter in the given IG). If not provided, no child tables will be created.You are about to leave the Smile Digital Health documentation and navigate to the Open Source HAPI-FHIR Documentation.