Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[QPPA-1607] Add 2018 PI (Promoting Operability, formerly ACI) measures (
#124) This PR: - adds the 2018 PI file provided by CMS; it's the same as the 2017 ACI json but with ACI renamed to PI and a few content tweaks. - adds an simple merge script to combine any number of staging json files into one final measures-data.json (right now it just combines quality and PI) - updates the build script to use the merge script Tests: new 2018 scripts have relevant tests Jira: https://jira.cms.gov/browse/QPPA-1607 Reviewer(s): @samskeller
- Loading branch information
1 parent
b8448e2
commit 0eae3e7
Showing
19 changed files
with
3,280 additions
and
478 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const outputPath = process.argv[4]; | ||
|
||
function mergeMeasures() { | ||
const allJson = []; | ||
// Iterate through each measures file provided as a command-line argument | ||
// and add it to the allJson array as an array of measure (json) objects. | ||
// The first command-line argument starts at position 2, last argument | ||
// is the output path. everything in between is an input measures file | ||
for (let i = 2; i < process.argv.length - 1; i++) { | ||
const measureStagingPath = path.join(__dirname, process.argv[i]); | ||
const measureJson = JSON.parse(fs.readFileSync(measureStagingPath, 'utf8')); | ||
allJson.push(measureJson); | ||
} | ||
|
||
// Merge the nested-array-per-measures-file into a single array of measures | ||
const combinedMeasures = [].concat(...allJson); | ||
const combinedJson = JSON.stringify(combinedMeasures, null, 2); | ||
fs.writeFileSync(path.join(__dirname, outputPath), combinedJson); | ||
} | ||
|
||
mergeMeasures(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.