qpp-measures-data
Advanced tools
Comparing version 8.8.0 to 8.9.0-beta.1
@@ -9,3 +9,2 @@ import { ProgramNames, ProgramNamesEnum } from './util/interfaces/program-names'; | ||
export declare function getValidPerformanceYears(): number[]; | ||
export declare function updateProgramNames(performanceYear: number): void; | ||
export declare function getProgramNames(): ProgramNames; | ||
@@ -12,0 +11,0 @@ export declare function getProgramNamesEnum(): typeof ProgramNamesEnum; |
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getMVPDataSlim = exports.getMVPSchema = exports.getMVPData = exports.getClinicalClusterSchema = exports.getClinicalClusterData = exports.getMeasuresSchema = exports.getMeasuresData = exports.getBenchmarksNationalAveragesSchema = exports.getBenchmarksNationalAverages = exports.getBenchmarksExclusionReasons = exports.getBenchmarksSchema = exports.getBenchmarksYears = exports.getBenchmarksData = exports.getProgramNamesEnum = exports.getProgramNames = exports.updateProgramNames = exports.getValidPerformanceYears = void 0; | ||
exports.getMVPDataSlim = exports.getMVPSchema = exports.getMVPData = exports.getClinicalClusterSchema = exports.getClinicalClusterData = exports.getMeasuresSchema = exports.getMeasuresData = exports.getBenchmarksNationalAveragesSchema = exports.getBenchmarksNationalAverages = exports.getBenchmarksExclusionReasons = exports.getBenchmarksSchema = exports.getBenchmarksYears = exports.getBenchmarksData = exports.getProgramNamesEnum = exports.getProgramNames = exports.getValidPerformanceYears = void 0; | ||
const fse = __importStar(require("fs-extra")); | ||
@@ -42,22 +42,2 @@ const path = __importStar(require("path")); | ||
exports.getValidPerformanceYears = getValidPerformanceYears; | ||
function updateProgramNames(performanceYear) { | ||
let programNames; | ||
const programNamesFilePath = path.join(__dirname, 'util/program-names', 'program-names.json'); | ||
const mvpFilePath = path.join(__dirname, 'mvp', performanceYear.toString(), 'mvp.json'); | ||
let mvpData = []; | ||
try { | ||
programNames = JSON.parse(fse.readFileSync(programNamesFilePath, 'utf8')); | ||
mvpData = JSON.parse(fse.readFileSync(mvpFilePath, 'utf8')); | ||
mvpData.forEach(mvp => { | ||
if (!programNames[mvp.mvpId]) { | ||
programNames[mvp.mvpId] = mvp.mvpId; | ||
} | ||
}); | ||
fse.writeFileSync(programNamesFilePath, JSON.stringify(programNames, null, 2)); | ||
} | ||
catch (e) { | ||
console.log('Error parsing the program-names.json or mvp.json file: ' + ' --> ' + e); | ||
} | ||
} | ||
exports.updateProgramNames = updateProgramNames; | ||
function getProgramNames() { | ||
@@ -64,0 +44,0 @@ const programNamesFilePath = path.join(__dirname, 'util/program-names', 'program-names.json'); |
@@ -335,2 +335,4 @@ export declare const BASE_CSV_COLUMN_NAMES: { | ||
measureSets: never[]; | ||
isSevenPointCapRemoved: boolean; | ||
sevenPointCapRemoved: never[]; | ||
}; |
@@ -364,2 +364,4 @@ "use strict"; | ||
measureSets: [], | ||
isSevenPointCapRemoved: false, | ||
sevenPointCapRemoved: [] | ||
}; |
@@ -208,3 +208,3 @@ "use strict"; | ||
isClinicalGuidelineChanged: change.clinicalGuidelineChanged ? !!change.clinicalGuidelineChanged.length : false, | ||
isSevenPointCapRemoved: change.sevenPointCapRemoved ? !!change.sevenPointCapRemoved.length : false, | ||
isSevenPointCapRemoved: Array.isArray(change.sevenPointCapRemoved) && change.sevenPointCapRemoved.length > 0 | ||
}; | ||
@@ -211,0 +211,0 @@ } |
@@ -8,3 +8,3 @@ "use strict"; | ||
const fs_1 = __importDefault(require("fs")); | ||
const index_1 = require("../../../index"); | ||
const update_program_names_1 = require("../../../util/update-program-names"); | ||
const mvp_data_utils_1 = require("../../../util/mvp-data-utils"); | ||
@@ -27,3 +27,3 @@ const logger_1 = require("../../logger"); | ||
(0, mvp_data_utils_1.createMVPDataFile)(Number(performanceYear)); | ||
(0, index_1.updateProgramNames)(Number(performanceYear)); | ||
(0, update_program_names_1.updateProgramNames)(Number(performanceYear)); | ||
} | ||
@@ -30,0 +30,0 @@ exports.updateMvps = updateMvps; |
@@ -10,3 +10,3 @@ "use strict"; | ||
const mvp_data_utils_1 = require("../../../util/mvp-data-utils"); | ||
const index_1 = require("../../../index"); | ||
const update_program_names_1 = require("../../../util/update-program-names"); | ||
function updateMvps(performanceYear) { | ||
@@ -27,3 +27,3 @@ const filePath = `mvp/${performanceYear}/mvp-enriched.json`; | ||
(0, mvp_data_utils_1.createMVPDataFile)(Number(performanceYear)); | ||
(0, index_1.updateProgramNames)(Number(performanceYear)); | ||
(0, update_program_names_1.updateProgramNames)(Number(performanceYear)); | ||
} | ||
@@ -30,0 +30,0 @@ exports.updateMvps = updateMvps; |
@@ -10,3 +10,3 @@ "use strict"; | ||
const mvp_data_utils_1 = require("../../../util/mvp-data-utils"); | ||
const index_1 = require("../../../index"); | ||
const update_program_names_1 = require("../../../util/update-program-names"); | ||
function updateMvps(performanceYear) { | ||
@@ -27,3 +27,3 @@ const filePath = `mvp/${performanceYear}/mvp-enriched.json`; | ||
(0, mvp_data_utils_1.createMVPDataFile)(Number(performanceYear)); | ||
(0, index_1.updateProgramNames)(Number(performanceYear)); | ||
(0, update_program_names_1.updateProgramNames)(Number(performanceYear)); | ||
} | ||
@@ -30,0 +30,0 @@ exports.updateMvps = updateMvps; |
@@ -13,3 +13,3 @@ import fs from 'fs'; | ||
const mvpJson = [ | ||
export const mockMvpJson = [ | ||
{ | ||
@@ -61,56 +61,2 @@ mvpId: 'G0053', | ||
describe('updateProgramNames', () => { | ||
it('updates the program-names json with any newly-found programs.', () => { | ||
const writeSpy = jest.spyOn(fse, 'writeFileSync').mockImplementation(jest.fn()); | ||
vol.fromNestedJSON({ | ||
'util/program-names': { | ||
'program-names.json': JSON.stringify({ | ||
mips: 'mips', | ||
cpcPlus: 'cpcPlus', | ||
pcf: 'pcf', | ||
app1: 'app1', | ||
DEFAULT: 'mips', | ||
G0053: 'G0053' | ||
}), | ||
}, | ||
'mvp/2024': { | ||
'mvp.json': JSON.stringify(mvpJson), | ||
} | ||
}); | ||
index.updateProgramNames(2024); | ||
expect(writeSpy).toBeCalledWith( | ||
expect.any(String), | ||
JSON.stringify({ | ||
mips: 'mips', | ||
cpcPlus: 'cpcPlus', | ||
pcf: 'pcf', | ||
app1: 'app1', | ||
DEFAULT: 'mips', | ||
G0053: 'G0053', | ||
G0054: 'G0054' | ||
}, null, 2), | ||
); | ||
}); | ||
it('gracefully logs an error if json parsing fails.', () => { | ||
const writeSpy = jest.spyOn(fs, 'writeFileSync').mockImplementation(jest.fn()); | ||
const logSpy = jest.spyOn(console, 'log').mockImplementationOnce(jest.fn()); | ||
vol.fromNestedJSON({ | ||
'util/program-names': { | ||
'program-names.json': '{\'badformat\':: \'mips\',\'cpcPlus\': \'cpcPlus\'}', | ||
}, | ||
'mvp/2024': { | ||
'mvp.json': JSON.stringify(mvpJson), | ||
} | ||
}); | ||
index.updateProgramNames(2024); | ||
expect(writeSpy).not.toBeCalled(); | ||
expect(logSpy).toBeCalled(); | ||
}); | ||
}); | ||
describe('getProgramNames', () => { | ||
@@ -413,3 +359,3 @@ it('gets the program-names json.', () => { | ||
beforeEach(() => { | ||
createMvpFileSpy = jest.spyOn(mvpDataUtils, 'createMVPDataFile').mockImplementation(() => mvpJson); | ||
createMvpFileSpy = jest.spyOn(mvpDataUtils, 'createMVPDataFile').mockImplementation(() => mockMvpJson); | ||
}); | ||
@@ -625,3 +571,3 @@ | ||
'mvp/2024': { | ||
'mvp.json': JSON.stringify(mvpJson), | ||
'mvp.json': JSON.stringify(mockMvpJson), | ||
}, | ||
@@ -632,4 +578,4 @@ }); | ||
it('successfully populates the mvp', () => { | ||
const testMvp = { ...mvpJson[0], qualityMeasureIds: ['001', '321'], qualityMeasures: [] }; | ||
mvpDataUtils.populateMeasuresforMVPs(testMvp, mvpJson, testMeasuresData, 'qualityMeasureIds', 'qualityMeasures'); | ||
const testMvp = { ...mockMvpJson[0], qualityMeasureIds: ['001', '321'], qualityMeasures: [] }; | ||
mvpDataUtils.populateMeasuresforMVPs(testMvp, mockMvpJson, testMeasuresData, 'qualityMeasureIds', 'qualityMeasures'); | ||
@@ -689,3 +635,3 @@ expect(testMvp).toStrictEqual({ | ||
'mvp/2024': { | ||
'mvp.json': JSON.stringify(mvpJson), | ||
'mvp.json': JSON.stringify(mockMvpJson), | ||
}, | ||
@@ -696,7 +642,7 @@ }); | ||
{ | ||
...mvpJson[0], | ||
...mockMvpJson[0], | ||
measureIds: ['001', '002', '003', '004', '005', '006', '007', '008', '009'], | ||
}, | ||
{ | ||
...mvpJson[1], | ||
...mockMvpJson[1], | ||
measureIds: ['001', '002', '003', '004', '005'], | ||
@@ -703,0 +649,0 @@ }, |
28
index.ts
@@ -32,30 +32,2 @@ // Libraries | ||
* | ||
* @return {void} | ||
* Adds any new program name fields from the mvp.json file for the given performance year | ||
*/ | ||
export function updateProgramNames(performanceYear: number): void { | ||
let programNames: any; | ||
const programNamesFilePath = path.join(__dirname, 'util/program-names', 'program-names.json'); | ||
const mvpFilePath = path.join(__dirname, 'mvp', performanceYear.toString(), 'mvp.json'); | ||
let mvpData: any[] = []; | ||
try { | ||
programNames = JSON.parse(fse.readFileSync(programNamesFilePath, 'utf8')); | ||
mvpData = JSON.parse(fse.readFileSync(mvpFilePath, 'utf8')); | ||
mvpData.forEach(mvp => { | ||
if (!programNames[mvp.mvpId]) { | ||
programNames[mvp.mvpId] = mvp.mvpId; | ||
} | ||
}); | ||
fse.writeFileSync(programNamesFilePath, JSON.stringify(programNames, null, 2)); | ||
} catch (e) { | ||
console.log('Error parsing the program-names.json or mvp.json file: ' + ' --> ' + e); | ||
} | ||
} | ||
/** | ||
* | ||
* @return {ProgramNames} - program names - | ||
@@ -62,0 +34,0 @@ * An object keyed by program name containing the current program names |
{ | ||
"name": "qpp-measures-data", | ||
"version": "v8.8.0", | ||
"version": "8.9.0-beta.1", | ||
"description": "Quality Payment Program Measures Data Repository", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -392,2 +392,4 @@ //These are only needed if the csv column names do not match the measures-data field names. | ||
measureSets: [], | ||
isSevenPointCapRemoved: false, | ||
sevenPointCapRemoved: [] | ||
}; |
@@ -694,2 +694,4 @@ import fs from 'fs'; | ||
measureSets: [ 'nephrology', 'preventiveMedicine' ], | ||
sevenPointCapRemoved: [], | ||
isSevenPointCapRemoved: false, | ||
}); | ||
@@ -726,5 +728,7 @@ }); | ||
allowedVendors: [ '123456', '654321'], | ||
sevenPointCapRemoved: [], | ||
isSevenPointCapRemoved: false, | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
@@ -324,2 +324,4 @@ import fs from 'fs'; | ||
measureSets: ['nephrology', 'preventiveMedicine'], | ||
sevenPointCapRemoved: [], | ||
isSevenPointCapRemoved: false, | ||
}); | ||
@@ -356,2 +358,4 @@ }); | ||
allowedVendors: ['123456', '654321'], | ||
sevenPointCapRemoved: [], | ||
isSevenPointCapRemoved: false, | ||
}); | ||
@@ -358,0 +362,0 @@ }); |
@@ -306,5 +306,4 @@ /** | ||
isClinicalGuidelineChanged: change.clinicalGuidelineChanged ? !!change.clinicalGuidelineChanged.length : false, | ||
isSevenPointCapRemoved: change.sevenPointCapRemoved ? !!change.sevenPointCapRemoved.length : false, | ||
isSevenPointCapRemoved: Array.isArray(change.sevenPointCapRemoved) && change.sevenPointCapRemoved.length > 0 | ||
}; | ||
} | ||
@@ -311,0 +310,0 @@ |
import fs from 'fs'; | ||
import { updateProgramNames } from '../../../index'; | ||
import { updateProgramNames } from '../../../util/update-program-names'; | ||
import { createMVPDataFile } from '../../../util/mvp-data-utils'; | ||
@@ -5,0 +5,0 @@ import { |
@@ -8,3 +8,3 @@ import fs from 'fs'; | ||
import { createMVPDataFile } from '../../../util/mvp-data-utils'; | ||
import { updateProgramNames } from '../../../index'; | ||
import { updateProgramNames } from '../../../util/update-program-names'; | ||
@@ -11,0 +11,0 @@ export function updateMvps(performanceYear: string) { |
@@ -8,3 +8,3 @@ import fs from 'fs'; | ||
import { createMVPDataFile } from '../../../util/mvp-data-utils'; | ||
import { updateProgramNames } from '../../../index'; | ||
import { updateProgramNames } from '../../../util/update-program-names'; | ||
@@ -11,0 +11,0 @@ export function updateMvps(performanceYear: string) { |
@@ -17,3 +17,5 @@ [ | ||
"Quality_PY25_CR_20241224-1.csv", | ||
"Quality_QCDR_PY25_CR_20250103.csv" | ||
"Quality_QCDR_PY25_CR_20250103.csv", | ||
"Quality_PY2025_MedicareCQMs_CR_01092025.csv", | ||
"Quality_QCDR_PY25_CR_20250110.csv" | ||
] |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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 too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
94721391
814
1500611
0
2
89