Skip to content

Commit

Permalink
Allow AC measures to be at 4 decimals. Everything else 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Apfel committed May 12, 2022
1 parent 2ea3def commit 4fa145d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 20 deletions.
38 changes: 20 additions & 18 deletions benchmarks/2021.json
Original file line number Diff line number Diff line change
Expand Up @@ -4548,15 +4548,16 @@
"benchmarkYear": 2021,
"submissionMethod": "administrativeClaims",
"deciles": [
0.17,
0.16,
0.16,
0.15,
0.15,
0.15,
0.15,
0.14,
0.14
0.1852,
0.1668,
0.161,
0.1571,
0.1539,
0.1517,
0.1496,
0.1468,
0.143,
0.1373
],
"isToppedOut": false,
"isToppedOutByProgram": false
Expand All @@ -4567,15 +4568,16 @@
"benchmarkYear": 2021,
"submissionMethod": "administrativeClaims",
"deciles": [
0.03,
0.03,
0.02,
0.02,
0.02,
0.02,
0.02,
0.02,
0.02
0.0378,
0.0287,
0.0263,
0.0247,
0.0234,
0.023,
0.0225,
0.0219,
0.0209,
0.0194
],
"isToppedOut": false,
"isToppedOutByProgram": false
Expand Down
16 changes: 14 additions & 2 deletions scripts/benchmarks/helpers/merge-benchmark-data-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,27 @@ const processPerformanceBenchmark = (benchmark) => {
// TODO: Kyle - This was a one-off for 2021 performance benchmarks. If you run this for 2022 performance benchmarks you're in trouble.
// Fix the underlining data where proportional measures to produce 9 deciles only by default.
const nonPropMeasures2021 = ['ACRAD18', 'ACEP50', 'ACEP51', 'ACRAD17', 'ACRAD25', 'ACRAD19', 'ACRAD16', 'ACRAD15'];
const acMeasures2021 = ['479', '480'];
const trimmedDeciles = () => {
if (nonPropMeasures2021.includes(benchmark.measureId) || benchmark.performanceYear !== 2021) {
if (nonPropMeasures2021.includes(benchmark.measureId) || acMeasures2021.includes(benchmark.measureId) || benchmark.performanceYear !== 2021) {
return benchmark.deciles;
} else {
return benchmark.deciles.slice(1);
}
};
// Determines how to round Performance Benchmarks should be rounded per circumstance and business rules. Should mostly be 2.
const decimalPlaces = () => {
if (acMeasures2021.includes(benchmark.measureId) && benchmark.performanceYear >= 2021) {
return 4;
} else if (benchmark.performanceYear >= 2019 && benchmark.performanceYear < 2021) {
return 4;
} else {
return 2;
}
};

const averageDeciles = trimmedDeciles().map(d => _.round(d, (benchmark.performanceYear >= 2019 && benchmark.performanceYear < 2021 ? 4 : 2)));
const averageDeciles = trimmedDeciles()
.map(d => _.round(d, decimalPlaces()));

return {
measureId: benchmark.measureId,
Expand Down

0 comments on commit 4fa145d

Please sign in to comment.