Skip to content

Commit

Permalink
Merge pull request #814 from CMSgov/QPPA-9026
Browse files Browse the repository at this point in the history
QPPA-9026: Convert validation scripts to TS
  • Loading branch information
ckawell-sb authored Jul 17, 2024
2 parents bca99ba + e4550b8 commit 25c1899
Show file tree
Hide file tree
Showing 20 changed files with 162 additions and 278 deletions.
2 changes: 1 addition & 1 deletion benchmarks/2023/benchmarks-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ definitions:
enum: [claims, registry, cmsWebInterface, administrativeClaims, electronicHealthRecord, certifiedSurveyVendor]
averagePerformanceRate:
description: The Average Performance Rate for the Measure and CollectionType.
type: [number, string, 'null']
type: [number, 'null']
required: [measureId, performanceYear, benchmarkYear, submissionMethod, percentiles]
63 changes: 0 additions & 63 deletions mvp/2024/mvp-raw.json
Original file line number Diff line number Diff line change
Expand Up @@ -5426,42 +5426,6 @@
"MVP Reporting Category": "Quality",
"Measure Id": "503"
},
{
"MVP Title": "Optimal Care for Patients with Episodic Neurological Conditions",
"MVP ID": "M0003",
"MVP Description": "The Optimal Care for Patients with Episodic Neurological Conditions MVP focuses on the clinical theme of promoting quality care for patients suffering from episodic neurological conditions.",
"Most Applicable Medical Specialties": "Neurology",
"Clinical Topic": "Episodic neurological conditions",
"MVP Reporting Category": "Quality",
"Measure Id": "AAN22"
},
{
"MVP Title": "Optimal Care for Patients with Episodic Neurological Conditions",
"MVP ID": "M0003",
"MVP Description": "The Optimal Care for Patients with Episodic Neurological Conditions MVP focuses on the clinical theme of promoting quality care for patients suffering from episodic neurological conditions.",
"Most Applicable Medical Specialties": "Neurology",
"Clinical Topic": "Episodic neurological conditions",
"MVP Reporting Category": "Quality",
"Measure Id": "AAN31"
},
{
"MVP Title": "Optimal Care for Patients with Episodic Neurological Conditions",
"MVP ID": "M0003",
"MVP Description": "The Optimal Care for Patients with Episodic Neurological Conditions MVP focuses on the clinical theme of promoting quality care for patients suffering from episodic neurological conditions.",
"Most Applicable Medical Specialties": "Neurology",
"Clinical Topic": "Episodic neurological conditions",
"MVP Reporting Category": "Quality",
"Measure Id": "AAN32"
},
{
"MVP Title": "Optimal Care for Patients with Episodic Neurological Conditions",
"MVP ID": "M0003",
"MVP Description": "The Optimal Care for Patients with Episodic Neurological Conditions MVP focuses on the clinical theme of promoting quality care for patients suffering from episodic neurological conditions.",
"Most Applicable Medical Specialties": "Neurology",
"Clinical Topic": "Episodic neurological conditions",
"MVP Reporting Category": "Quality",
"Measure Id": "AAN5"
},
{
"MVP Title": "Supportive Care for Neurodegenerative Conditions",
"MVP ID": "M0004",
Expand Down Expand Up @@ -6074,33 +6038,6 @@
"MVP Reporting Category": "Quality",
"Measure Id": "487"
},
{
"MVP Title": "Supportive Care for Neurodegenerative Conditions",
"MVP ID": "M0004",
"MVP Description": "The Supportive Care for Neurodegenerative Conditions MVP focuses on the clinical theme of promoting quality care for patients with cognitive-based neurological disorders such as dementia, Parkinson’s Disease (PD), and Amyotrophic Lateral Sclerosis (ALS).",
"Most Applicable Medical Specialties": "Neurology",
"Clinical Topic": "Cognitive-based neurological disorders",
"MVP Reporting Category": "Quality",
"Measure Id": "AAN22"
},
{
"MVP Title": "Supportive Care for Neurodegenerative Conditions",
"MVP ID": "M0004",
"MVP Description": "The Supportive Care for Neurodegenerative Conditions MVP focuses on the clinical theme of promoting quality care for patients with cognitive-based neurological disorders such as dementia, Parkinson’s Disease (PD), and Amyotrophic Lateral Sclerosis (ALS).",
"Most Applicable Medical Specialties": "Neurology",
"Clinical Topic": "Cognitive-based neurological disorders",
"MVP Reporting Category": "Quality",
"Measure Id": "AAN34"
},
{
"MVP Title": "Supportive Care for Neurodegenerative Conditions",
"MVP ID": "M0004",
"MVP Description": "The Supportive Care for Neurodegenerative Conditions MVP focuses on the clinical theme of promoting quality care for patients with cognitive-based neurological disorders such as dementia, Parkinson’s Disease (PD), and Amyotrophic Lateral Sclerosis (ALS).",
"Most Applicable Medical Specialties": "Neurology",
"Clinical Topic": "Cognitive-based neurological disorders",
"MVP Reporting Category": "Quality",
"Measure Id": "AAN9"
},
{
"MVP Title": "Value in Primary Care",
"MVP ID": "M0005",
Expand Down
7 changes: 0 additions & 7 deletions mvp/2024/mvp.csv
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,6 @@ Optimal Care for Patients with Episodic Neurological Conditions ,M0003,The Optim
Optimal Care for Patients with Episodic Neurological Conditions ,M0003,The Optimal Care for Patients with Episodic Neurological Conditions MVP focuses on the clinical theme of promoting quality care for patients suffering from episodic neurological conditions. ,Neurology,Episodic neurological conditions,Quality,419
Optimal Care for Patients with Episodic Neurological Conditions ,M0003,The Optimal Care for Patients with Episodic Neurological Conditions MVP focuses on the clinical theme of promoting quality care for patients suffering from episodic neurological conditions. ,Neurology,Episodic neurological conditions,Quality,487
Optimal Care for Patients with Episodic Neurological Conditions ,M0003,The Optimal Care for Patients with Episodic Neurological Conditions MVP focuses on the clinical theme of promoting quality care for patients suffering from episodic neurological conditions. ,Neurology,Episodic neurological conditions,Quality,503
Optimal Care for Patients with Episodic Neurological Conditions ,M0003,The Optimal Care for Patients with Episodic Neurological Conditions MVP focuses on the clinical theme of promoting quality care for patients suffering from episodic neurological conditions. ,Neurology,Episodic neurological conditions,Quality,AAN22
Optimal Care for Patients with Episodic Neurological Conditions ,M0003,The Optimal Care for Patients with Episodic Neurological Conditions MVP focuses on the clinical theme of promoting quality care for patients suffering from episodic neurological conditions. ,Neurology,Episodic neurological conditions,Quality,AAN31
Optimal Care for Patients with Episodic Neurological Conditions ,M0003,The Optimal Care for Patients with Episodic Neurological Conditions MVP focuses on the clinical theme of promoting quality care for patients suffering from episodic neurological conditions. ,Neurology,Episodic neurological conditions,Quality,AAN32
Optimal Care for Patients with Episodic Neurological Conditions ,M0003,The Optimal Care for Patients with Episodic Neurological Conditions MVP focuses on the clinical theme of promoting quality care for patients suffering from episodic neurological conditions. ,Neurology,Episodic neurological conditions,Quality,AAN5
Supportive Care for Neurodegenerative Conditions ,M0004,"The Supportive Care for Neurodegenerative Conditions MVP focuses on the clinical theme of promoting quality care for patients with cognitive-based neurological disorders such as dementia, Parkinson’s Disease (PD), and Amyotrophic Lateral Sclerosis (ALS).",Neurology,Cognitive-based neurological disorders,Cost,MSPB_1
Supportive Care for Neurodegenerative Conditions ,M0004,"The Supportive Care for Neurodegenerative Conditions MVP focuses on the clinical theme of promoting quality care for patients with cognitive-based neurological disorders such as dementia, Parkinson’s Disease (PD), and Amyotrophic Lateral Sclerosis (ALS).",Neurology,Cognitive-based neurological disorders,Foundational,479
Supportive Care for Neurodegenerative Conditions ,M0004,"The Supportive Care for Neurodegenerative Conditions MVP focuses on the clinical theme of promoting quality care for patients with cognitive-based neurological disorders such as dementia, Parkinson’s Disease (PD), and Amyotrophic Lateral Sclerosis (ALS).",Neurology,Cognitive-based neurological disorders,Foundational,484
Expand Down Expand Up @@ -674,9 +670,6 @@ Supportive Care for Neurodegenerative Conditions ,M0004,"The Supportive Care fo
Supportive Care for Neurodegenerative Conditions ,M0004,"The Supportive Care for Neurodegenerative Conditions MVP focuses on the clinical theme of promoting quality care for patients with cognitive-based neurological disorders such as dementia, Parkinson’s Disease (PD), and Amyotrophic Lateral Sclerosis (ALS).",Neurology,Cognitive-based neurological disorders,Quality,293
Supportive Care for Neurodegenerative Conditions ,M0004,"The Supportive Care for Neurodegenerative Conditions MVP focuses on the clinical theme of promoting quality care for patients with cognitive-based neurological disorders such as dementia, Parkinson’s Disease (PD), and Amyotrophic Lateral Sclerosis (ALS).",Neurology,Cognitive-based neurological disorders,Quality,386
Supportive Care for Neurodegenerative Conditions ,M0004,"The Supportive Care for Neurodegenerative Conditions MVP focuses on the clinical theme of promoting quality care for patients with cognitive-based neurological disorders such as dementia, Parkinson’s Disease (PD), and Amyotrophic Lateral Sclerosis (ALS).",Neurology,Cognitive-based neurological disorders,Quality,487
Supportive Care for Neurodegenerative Conditions ,M0004,"The Supportive Care for Neurodegenerative Conditions MVP focuses on the clinical theme of promoting quality care for patients with cognitive-based neurological disorders such as dementia, Parkinson’s Disease (PD), and Amyotrophic Lateral Sclerosis (ALS).",Neurology,Cognitive-based neurological disorders,Quality,AAN22
Supportive Care for Neurodegenerative Conditions ,M0004,"The Supportive Care for Neurodegenerative Conditions MVP focuses on the clinical theme of promoting quality care for patients with cognitive-based neurological disorders such as dementia, Parkinson’s Disease (PD), and Amyotrophic Lateral Sclerosis (ALS).",Neurology,Cognitive-based neurological disorders,Quality,AAN34
Supportive Care for Neurodegenerative Conditions ,M0004,"The Supportive Care for Neurodegenerative Conditions MVP focuses on the clinical theme of promoting quality care for patients with cognitive-based neurological disorders such as dementia, Parkinson’s Disease (PD), and Amyotrophic Lateral Sclerosis (ALS).",Neurology,Cognitive-based neurological disorders,Quality,AAN9
Value in Primary Care,M0005,"The Value in Primary Care MVP focuses on the clinical theme of promoting quality care for patients in order to reduce the risk of diseases, disabilities, and death. ",Preventive Medicine; Internal Medicine; Family Medicine; Geriatrics,Preventive Care,Cost,COST_ACOPD_1
Value in Primary Care,M0005,"The Value in Primary Care MVP focuses on the clinical theme of promoting quality care for patients in order to reduce the risk of diseases, disabilities, and death. ",Preventive Medicine; Internal Medicine; Family Medicine; Geriatrics,Preventive Care,Cost,COST_D_1
Value in Primary Care,M0005,"The Value in Primary Care MVP focuses on the clinical theme of promoting quality care for patients in order to reduce the risk of diseases, disabilities, and death. ",Preventive Medicine; Internal Medicine; Family Medicine; Geriatrics,Preventive Care,Cost,COST_DEP_1
Expand Down
37 changes: 27 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@eslint/js": "^9.4.0",
"@types/eslint__js": "^8.42.3",
"@types/jest": "^29.0.3",
"@types/json-merge-patch": "^0.0.10",
"@types/lodash": "^4.14.184",
"@types/node": "^18.7.16",
"adm-zip": "0.4.13",
Expand All @@ -51,6 +52,7 @@
"nyc": "^15.0.0",
"officeparser": "^4.0.8",
"rimraf": "2.6.1",
"toad-uri-js": "^5.0.1",
"ts-jest": "^29.1.2",
"typescript": "^4.9.5",
"typescript-eslint": "^7.13.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/benchmarks/archive/build-benchmarks
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ else

# validate benchmarks
echo 'Validating new benchmarks JSON.'
cat $benchmarkFilename | node scripts/validate-data.js benchmarks $performanceYear
node dist/validate-data.js benchmarks $performanceYear $benchmarkFilename
fi
4 changes: 2 additions & 2 deletions scripts/benchmarks/build-benchmarks
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if (( $currentPerformanceYear >= 2023 )) && (( $currentPerformanceYear <= $maxPe

# validate the JSON files
echo -e "Validating new $FILE.json"
cat benchmarks/$currentPerformanceYear/${BASH_REMATCH[2]}.json | node scripts/validate-data.js ${BASH_REMATCH[2]} $currentPerformanceYear benchmarks
node dist/validate-data.js ${BASH_REMATCH[2]} $currentPerformanceYear benchmarks/$currentPerformanceYear/${BASH_REMATCH[2]}.json benchmarks

exitOnFailure
fi
Expand All @@ -64,7 +64,7 @@ if (( $currentPerformanceYear >= 2023 )) && (( $currentPerformanceYear <= $maxPe

# Validate benchmarks.
echo -e "Validating new benchmarks JSON."
cat benchmarks/$currentPerformanceYear.json | node scripts/validate-data.js benchmarks $currentPerformanceYear
node dist/validate-data.js benchmarks $currentPerformanceYear benchmarks/$currentPerformanceYear.json
exitOnFailure

echo -e "${Green}\n${bold}Update complete."
Expand Down
2 changes: 1 addition & 1 deletion scripts/clinical-clusters/build-clinical-clusters
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ node dist/clinical-clusters/ema-clinical-cluster-builder.js $currentPerformanceY
# validate EMA clusters
echo ""
echo "Validating clinical-clusters.json produced: "
cat clinical-clusters/$currentPerformanceYear/clinical-clusters.json | node scripts/validate-data.js clinical-clusters $currentPerformanceYear
node dist/validate-data.js clinical-clusters $currentPerformanceYear clinical-clusters/$currentPerformanceYear/clinical-clusters.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,4 @@ node scripts/measures/$currentPerformanceYear/import-qcdr-measures.js \

# 10. Validate the resulting measures-data.json file:
echo "validating new measures-data.json"
cat measures/$currentPerformanceYear/measures-data.json | \
node scripts/validate-data.js measures $currentPerformanceYear
node dist/validate-data.js measures $currentPerformanceYear measures/$currentPerformanceYear/measures-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ node scripts/measures/$currentPerformanceYear/import-qcdr-measures.js \

# 2. Validate the resulting measures-data.json file:
echo "validating new measures-data.json against schema"
cat measures/$currentPerformanceYear/measures-data.json | \
node scripts/validate-data.js measures $currentPerformanceYear
node dist/validate-data.js measures $currentPerformanceYear measures/$currentPerformanceYear/measures-data.json

# 3. Validate that measures actually existed in their listed firstPerformanceYear and the years after
echo "validating that measures actually existed in their listed firstPerformanceYear and the years after"
cat measures/$currentPerformanceYear/measures-data.json | \
node scripts/measures/archive/validate-measures-past-existence.js $currentPerformanceYear
node scripts/measures/archive/2018/validate-measures-past-existence.js $currentPerformanceYear
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const _ = require('lodash');
const QppMeasuresData = require('../../../index.js');
const Constants = require('../../../constants.js');
const QppMeasuresData = require('../../../../index.js');
const Constants = require('../../../../constants.js');

const currentYear = Number(process.argv[2]);
if (!Constants.validPerformanceYears.includes(currentYear)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,4 @@ node scripts/measures/$currentPerformanceYear/import-qcdr-measures.js \

# 8. Validate the resulting measures-data.json file:
echo "validating new measures-data.json"
cat measures/$currentPerformanceYear/measures-data.json | \
node scripts/validate-data.js measures $currentPerformanceYear
node dist/validate-data.js measures $currentPerformanceYear measures/$currentPerformanceYear/measures-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,4 @@ node scripts/measures/$currentPerformanceYear/import-qcdr-measures.js \

# 9. Validate the resulting measures-data.json file:
echo "validating new measures-data.json"
cat measures/$currentPerformanceYear/measures-data.json | \
node scripts/validate-data.js measures $currentPerformanceYear
node dist/validate-data.js measures $currentPerformanceYear measures/$currentPerformanceYear/measures-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,4 @@ node scripts/measures/$currentPerformanceYear/import-qcdr-measures.js \

# 9. Validate the resulting measures-data.json file:
echo "validating new measures-data.json"
cat measures/$currentPerformanceYear/measures-data.json | \
node scripts/validate-data.js measures $currentPerformanceYear
node dist/validate-data.js measures $currentPerformanceYear measures/$currentPerformanceYear/measures-data.json
3 changes: 1 addition & 2 deletions scripts/measures/update-measures
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ if (( $currentPerformanceYear >= 2022 )) && (( $currentPerformanceYear <= $maxPe
exitOnFailure

echo -e "Validating new measures-data.json..."
cat measures/$currentPerformanceYear/measures-data.json | \
node scripts/validate-data.js measures $currentPerformanceYear
node dist/validate-data.js measures $currentPerformanceYear measures/$currentPerformanceYear/measures-data.json
exitOnFailure

# mvps don't exist prior to PY2023.
Expand Down
Loading

0 comments on commit 25c1899

Please sign in to comment.