Skip to content
This repository has been archived by the owner on Oct 17, 2019. It is now read-only.

Commit

Permalink
Added cimpl 5 export
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhijay authored and cmoesel committed Jan 25, 2019
1 parent 9fda52c commit 3df6f69
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ program
.option('-c, --config <config>', 'the name of the config file (default: config.json)', 'config.json')
.option('-d, --duplicate', 'show duplicate error messages (default: false)')
.option('-i, --import-cimcore', 'import CIMCORE files instead of CIMPL (default: false)')
.option('--export-cimpl-5', 'export CIMPL 5 files generated from input (default: false)')
.arguments('<path-to-shr-defs>')
.action(function (pathToShrDefs) {
input = pathToShrDefs;
Expand All @@ -62,6 +63,10 @@ const doCIMCORE = program.skip.every(a => a.toLowerCase() != 'cimcore' && a.toLo
// Process the ADL flag
const doADL = program.adl;

// Process the CIMPL 5 export flag

const doCIMPL5 = program.exportCimpl5;

// Process the de-duplicate error flag

const showDuplicateErrors = program.duplicate;
Expand Down Expand Up @@ -273,6 +278,18 @@ if (doJSON) {
logger.info('Skipping JSON export');
}

if (doCIMPL5) {
logger.info('Exporting CIMPL 5');
try {
const cimpl5Path = path.join(program.out, 'cimpl5');
expSpecifications.toCIMPL5(cimpl5Path);
logger.info('Exported %s namespaces to CIMPL 5.', expSpecifications.namespaces.all.length);
} catch (error) {
logger.fatal('Failure in CIMPL 5 export. Aborting with error message: %s', error);
failedExports.push('cimpl-5-export');
}
} // the CIMPL 5 export is opt-in, so we are omitting the 'skip' info log.

let fhirResults = null;
if (doES6 || doFHIR){
fhirResults = shrFE.exportToFHIR(expSpecifications, configSpecifications);
Expand Down

0 comments on commit 3df6f69

Please sign in to comment.