qpp-measures-data
Advanced tools
Comparing version 1.0.0-alpha.7 to 1.0.0-alpha.8
{ | ||
"name": "qpp-measures-data", | ||
"version": "1.0.0-alpha.7", | ||
"version": "1.0.0-alpha.8", | ||
"description": "Quality Payment Program Measures Data Repository", | ||
@@ -34,3 +34,3 @@ "repository": { | ||
"rimraf": "^2.6.1", | ||
"xml2js": "~0.4.17" | ||
"xml2js": "0.4.17" | ||
}, | ||
@@ -37,0 +37,0 @@ "dependencies": { |
const chai = require('chai'); | ||
const assert = chai.assert; | ||
const _ = require('lodash'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const parse = require('csv-parse/lib/sync'); | ||
@@ -8,2 +11,4 @@ const mipsDataFormat = require('../../index.js'); | ||
const actualAciRelation = require('../../util/measures/aci-measure-relations.json'); | ||
const actualCpcPlusGroups = require('../../util/measures/cpc+-measure-groups.json'); | ||
const actualMeasureSpecificationData = parse(fs.readFileSync(path.join(__dirname, '../../util/measures/measurePDF-Specification.csv'), 'utf8')); | ||
@@ -106,3 +111,51 @@ describe('measures data json', function() { | ||
}); | ||
describe('Some quality measures belong to CPC+ groups', () => { | ||
it('MeasureId 309 should be in CPC+ group "C"', () => { | ||
const measure = measuresData.find(m => m.measureId === '309'); | ||
assert.equal(measure.cpcPlusGroup, 'C'); | ||
}); | ||
it('contains proper metadata on all measures', () => { | ||
const generated = {}; | ||
measuresData | ||
.filter(m => m.category === 'quality') | ||
.filter(m => m.cpcPlusGroup !== undefined) | ||
.forEach(m => { | ||
if (generated[m.cpcPlusGroup] === undefined) { | ||
generated[m.cpcPlusGroup] = []; | ||
} | ||
generated[m.cpcPlusGroup].push(m.eMeasureId); | ||
generated[m.cpcPlusGroup].sort(); | ||
}); | ||
assert.deepEqual(generated, actualCpcPlusGroups); | ||
}); | ||
}); | ||
describe('Some measures have measureSpecification property', () => { | ||
it('contains proper metadata on measures', () => { | ||
const validMeasureIds = measuresData | ||
.filter(m => m.measureSpecification !== undefined) | ||
.map(m => m.measureId); | ||
const actual = actualMeasureSpecificationData.reduce(function(acc, [submissionMethod, measureId, link]) { | ||
if (validMeasureIds.includes(measureId)) { | ||
acc[measureId] = acc[measureId] || {}; | ||
acc[measureId][submissionMethod] = link; | ||
} | ||
return acc; | ||
}, {}); | ||
const generated = {}; | ||
measuresData | ||
.filter(m => m.measureSpecification !== undefined) | ||
.forEach(m => { | ||
generated[m.measureId] = generated[m.measureId] || {}; | ||
const submissionMethods = Object.keys(m.measureSpecification); | ||
submissionMethods.forEach((method) => { | ||
generated[m.measureId][method] = m.measureSpecification[method]; | ||
}); | ||
}); | ||
assert.deepEqual(generated, actual); | ||
}); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3271133
69
37336
13