Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

qpp-measures-data

Package Overview
Dependencies
Maintainers
1
Versions
271
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qpp-measures-data - npm Package Compare versions

Comparing version 1.0.0-alpha.7 to 1.0.0-alpha.8

scripts/measures/archived/scripts/add-cahps-measures.js

4

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc