qpp-measures-data
Advanced tools
Comparing version 1.8.5 to 1.8.6
@@ -54,5 +54,5 @@ // Libraries | ||
*/ | ||
exports.getClinicalClusterData = function() { | ||
exports.getClinicalClusterData = function(performanceYear = 2017) { | ||
return JSON.parse( | ||
fs.readFileSync(path.join(__dirname, 'clinical-clusters', 'clinical-clusters.json'))); | ||
fs.readFileSync(path.join(__dirname, 'clinical-clusters', performanceYear.toString(), 'clinical-clusters.json'))); | ||
}; | ||
@@ -63,4 +63,4 @@ | ||
*/ | ||
exports.getClinicalClusterSchema = function() { | ||
return YAML.load(path.join(__dirname, 'clinical-clusters', 'clinical-clusters-schema.yaml')); | ||
exports.getClinicalClusterSchema = function(performanceYear = 2017) { | ||
return YAML.load(path.join(__dirname, 'clinical-clusters', performanceYear.toString(), 'clinical-clusters-schema.yaml')); | ||
}; |
{ | ||
"name": "qpp-measures-data", | ||
"version": "1.8.5", | ||
"version": "1.8.6", | ||
"description": "Quality Payment Program Measures Data Repository", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -28,44 +28,121 @@ /** | ||
let measuresJson = ''; | ||
const claimsClusterFilePath = process.argv[2]; | ||
const registryClusterFilePath = process.argv[3]; | ||
const performanceYear = parseInt(process.argv[2], 10); | ||
const claimsClusterFilePath = process.argv[3]; | ||
const registryClusterFilePath = process.argv[4]; | ||
const specialSpecialtySetRelations = { | ||
2017: { | ||
claims: [], | ||
registry: [] | ||
}, | ||
2018: { | ||
claims: [{ | ||
name: 'anesthesiology', action: 'replace', measureIds: ['076', '130', '317'] | ||
}, { | ||
name: 'rheumatology', action: 'add', measureIds: ['047', '128', '130', '226', '317'] | ||
}], | ||
registry: [{ | ||
name: 'dentistry', action: 'remove', measureIds: ['378', '379'] | ||
}] | ||
} | ||
}; | ||
const specialClusterRelations = { | ||
registry: [ | ||
{measureId: '047', optionals: []}, | ||
{measureId: '110', optionals: []}, | ||
{measureId: '130', optionals: []}, | ||
{measureId: '134', optionals: []}, | ||
{measureId: '226', optionals: []}, | ||
{measureId: '317', optionals: []}, | ||
{measureId: '424', optionals: []}, | ||
{measureId: '430', optionals: []}, | ||
{measureId: '051', optionals: ['052']}, | ||
{measureId: '052', optionals: ['051']}, | ||
{measureId: '398', optionals: ['444']}, | ||
{measureId: '444', optionals: ['398']}, | ||
{measureId: '024', optionals: ['418']}, | ||
{measureId: '418', optionals: ['024']}, | ||
{measureId: '005', optionals: ['008']}, | ||
{measureId: '006', optionals: ['118', '007']}, | ||
{measureId: '007', optionals: ['118', '006']}, | ||
{measureId: '008', optionals: ['005']}, | ||
{measureId: '118', optionals: ['007', '006']}, | ||
{measureId: '426', optionals: ['427']}, | ||
{measureId: '427', optionals: ['426']}, | ||
{measureId: '112', optionals: ['113']}, | ||
{measureId: '113', optionals: ['112']} | ||
], | ||
claims: [ | ||
{measureId: '130', optionals: []}, | ||
{measureId: '226', optionals: []}, | ||
{measureId: '317', optionals: []}, | ||
{measureId: '117', optionals: []}, | ||
{measureId: '112', optionals: ['113']}, | ||
{measureId: '113', optionals: ['112']} | ||
] | ||
2017: { | ||
claims: [ | ||
{measureId: '130', optionals: []}, | ||
{measureId: '226', optionals: []}, | ||
{measureId: '317', optionals: []}, | ||
{measureId: '117', optionals: []}, | ||
{measureId: '112', optionals: ['113']}, | ||
{measureId: '113', optionals: ['112']} | ||
], | ||
registry: [ | ||
{measureId: '047', optionals: []}, | ||
{measureId: '110', optionals: []}, | ||
{measureId: '130', optionals: []}, | ||
{measureId: '134', optionals: []}, | ||
{measureId: '226', optionals: []}, | ||
{measureId: '317', optionals: []}, | ||
{measureId: '424', optionals: []}, | ||
{measureId: '430', optionals: []}, | ||
{measureId: '051', optionals: ['052']}, | ||
{measureId: '052', optionals: ['051']}, | ||
{measureId: '398', optionals: ['444']}, | ||
{measureId: '444', optionals: ['398']}, | ||
{measureId: '024', optionals: ['418']}, | ||
{measureId: '418', optionals: ['024']}, | ||
{measureId: '005', optionals: ['008']}, | ||
{measureId: '006', optionals: ['118', '007']}, | ||
{measureId: '007', optionals: ['118', '006']}, | ||
{measureId: '008', optionals: ['005']}, | ||
{measureId: '118', optionals: ['007', '006']}, | ||
{measureId: '426', optionals: ['427']}, | ||
{measureId: '427', optionals: ['426']}, | ||
{measureId: '112', optionals: ['113']}, | ||
{measureId: '113', optionals: ['112']} | ||
] | ||
}, | ||
2018: { | ||
claims: [ | ||
{measureId: '130', optionals: []}, | ||
{measureId: '317', optionals: []}, | ||
{measureId: '112', optionals: ['113']}, | ||
{measureId: '113', optionals: ['112']} | ||
], | ||
registry: [ | ||
{measureId: '110', optionals: []}, | ||
{measureId: '130', optionals: []}, | ||
{measureId: '226', optionals: []}, | ||
{measureId: '424', optionals: []}, | ||
{measureId: '430', optionals: []}, | ||
{measureId: '051', optionals: ['052']}, | ||
{measureId: '052', optionals: ['051']}, | ||
{measureId: '398', optionals: ['444']}, | ||
{measureId: '444', optionals: ['398']}, | ||
{measureId: '024', optionals: ['418']}, | ||
{measureId: '418', optionals: ['024']}, | ||
{measureId: '006', optionals: ['118', '007']}, | ||
{measureId: '007', optionals: ['118', '006']}, | ||
{measureId: '118', optionals: ['007', '006']}, | ||
{measureId: '005', optionals: ['008']}, | ||
{measureId: '008', optionals: ['005']}, | ||
{measureId: '426', optionals: ['427']}, | ||
{measureId: '427', optionals: ['426']}, | ||
{measureId: '112', optionals: ['113']}, | ||
{measureId: '113', optionals: ['112']} | ||
] | ||
} | ||
}; | ||
function curate(clusterMap, relations) { | ||
// remove clincalClusters from measures that belongs to multiple cluster | ||
// Handle exceptions to standard populateSpecialtySet logic with manual overrides | ||
function curateSpecialtySet(clusterMap, relations) { | ||
if (relations) { | ||
relations.forEach(r => { | ||
if (r.action === 'remove') { // remove specialty set from output | ||
r.measureIds.forEach(m => { | ||
const specialtySets = clusterMap.get(m).specialtySets; | ||
const specialtySetIndex = specialtySets.findIndex(ss => ss.name === r.name); | ||
specialtySets.splice(specialtySetIndex, 1); | ||
}); | ||
} else if (r.action === 'replace') { // replace an existing specialty set with a new set of measures | ||
r.measureIds.forEach(m => { | ||
const specialtySets = clusterMap.get(m).specialtySets; | ||
const specialtySetIndex = specialtySets.findIndex(ss => ss.name === r.name); | ||
specialtySets.splice(specialtySetIndex, 1); | ||
specialtySets.push({name: r.name, measureIds: r.measureIds}); | ||
}); | ||
} else if (r.action === 'add') { // add a new specialty set to output | ||
r.measureIds.forEach(m => { | ||
const specialtySets = clusterMap.get(m).specialtySets; | ||
specialtySets.push({name: r.name, measureIds: r.measureIds}); | ||
}); | ||
} | ||
}); | ||
} | ||
} | ||
// Handle exceptions to standard populateClinicalClusters logic with manual overrides | ||
function curateClinicalClusters(clusterMap, relations) { | ||
// remove clinicalClusters from measures that belongs to multiple cluster | ||
relations | ||
@@ -75,3 +152,3 @@ .filter(r => r.optionals.length === 0) | ||
// remove measures in clincalClusters that are optional | ||
// remove measures in clinicalClusters that are optional | ||
relations | ||
@@ -103,3 +180,3 @@ .filter(r => r.optionals.length > 0) | ||
// read the grouped measures and populate the cluster name | ||
// read the grouped measures and populate the cluster name | ||
byClusterName.forEach(clinicalCluster => { | ||
@@ -131,3 +208,3 @@ clinicalCluster.measureIds.forEach(measureId => { | ||
// read the grouped measures and populate the specialty set on each | ||
// read the grouped measures and populate the specialty set on each | ||
bySpecialty.forEach(specialty => { | ||
@@ -154,3 +231,3 @@ if (specialty.measureIds.length < MAX_SPECIALITY_SET_SIZE) { | ||
(SUPPORTED_PERFORMANCE_YEARS.indexOf(m.firstPerformanceYear) > -1) && | ||
(m.lastPerformanceYear == null || SUPPORTED_PERFORMANCE_YEARS.indexOf(m.lastPerformanceYear) > -1) | ||
(m.lastPerformanceYear == null || SUPPORTED_PERFORMANCE_YEARS.indexOf(m.lastPerformanceYear) > -1) | ||
); | ||
@@ -165,7 +242,10 @@ | ||
curateSpecialtySet(claimsClusterMap, specialSpecialtySetRelations[performanceYear].claims); | ||
curateSpecialtySet(registryClusterMap, specialSpecialtySetRelations[performanceYear].registry); | ||
populateClinicalClusters(claimsClusterMap, measures, 'claims', claimsClusterFilePath); | ||
populateClinicalClusters(registryClusterMap, measures, 'registry', registryClusterFilePath); | ||
curate(registryClusterMap, specialClusterRelations.registry); | ||
curate(claimsClusterMap, specialClusterRelations.claims); | ||
curateClinicalClusters(claimsClusterMap, specialClusterRelations[performanceYear].claims); | ||
curateClinicalClusters(registryClusterMap, specialClusterRelations[performanceYear].registry); | ||
@@ -172,0 +252,0 @@ const emaClusters = []; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
19647283
166
307708