CMSgov / hpt-validator-cli

CLI for validating CMS Hospital Price Transparency machine-readable files
Other
4 stars 3 forks source link

Add `v1.1` as a valid `version` choice #18

Closed codycrossley closed 4 weeks ago

codycrossley commented 1 month ago

Problem

The only valid choices for the cms-hpt-validator CLI script are currently v2.0 and v2.0.0. However, there already exists a v1.1 validator for earlier versions, but it is cannot currently be used due to the current choices constraint within the main() method of index.ts:

.addArgument(new Argument("<version>").choices(["v2.0", "v2.0.0"]))

It was removed in this PR.

Solution

Added "v1.1" to the index.ts file, containing valid choices for the cms-hpt-validator script:

.addArgument(new Argument("<version>").choices(["v1.1", "v2.0", "v2.0.0"]))

Result

The script will now successfully run the v1.1 validators from the hpt-validator repo if v1.1 is passed as an argument the version parameter.

Test Plan

CSV

The following command was run:

cms-hpt-validator "/<redacted>/eisenhower_standardcharges-20240628.csv" "v1.1" --format csv --error-limit 1000

And the following output was received:

5 errors found
┌─────────┬──────┬────────────────────────────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ (index) │ path │                 field                  │                                                   message                                                   │
├─────────┼──────┼────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│    0    │ 'V1' │         'financial_aid_policy'         │                   'Header column should be "financial_aid_policy", but it is not present'                   │
│    1    │ 'V3' │            'billing_class'             │                    'Column billing_class is missing, but it is required for tall format'                    │
│    2    │ 'V3' │ 'standard_charge | negotiated_percent' │        'Column standard_charge | negotiated_percent is missing, but it is required for tall format'         │
│    3    │ 'V3' │ 'standard_charge | contracting_method' │        'Column standard_charge | contracting_method is missing, but it is required for tall format'         │
│    4    │ 'A1' │                                        │ 'Errors were found in the headers or values in rows 1 through 3, so the remaining rows were not evaluated.' │
└─────────┴──────┴────────────────────────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
No warnings found

JSON

Similarly, a JSON file was validated using "v1.1": cms-hpt-validator "/<redacted>/472654841_cornerstone-specialty-hospitals-tucson_standardcharges.json" "v1.1" --format json --error-limit 1000

108 errors found
┌─────────┬─────────────────────────────────────────────┬───────────────────────┬──────────────────────────────────────────────────────────┐
│ (index) │                    path                     │         field         │                         message                          │
├─────────┼─────────────────────────────────────────────┼───────────────────────┼──────────────────────────────────────────────────────────┤
│    0    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│    1    │ '/standard_charges/0/payers_information/0'  │          '0'          │ "must have required property 'standard_charge_percent'"  │
│    2    │ '/standard_charges/0/payers_information/0'  │          '0'          │                'must match "then" schema'                │
│    3    │ '/standard_charges/0/payers_information/0'  │          '0'          │    "must have required property 'contracting_method'"    │
│    4    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│    5    │ '/standard_charges/1/payers_information/0'  │          '0'          │ "must have required property 'standard_charge_percent'"  │
│    6    │ '/standard_charges/1/payers_information/0'  │          '0'          │                'must match "then" schema'                │
│    7    │ '/standard_charges/1/payers_information/0'  │          '0'          │    "must have required property 'contracting_method'"    │
│    8    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│    9    │ '/standard_charges/2/payers_information/0'  │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   10    │ '/standard_charges/2/payers_information/0'  │          '0'          │                'must match "then" schema'                │
│   11    │ '/standard_charges/2/payers_information/0'  │          '0'          │    "must have required property 'contracting_method'"    │
│   12    │ '/standard_charges/2/payers_information/1'  │          '1'          │ "must have required property 'standard_charge_percent'"  │
│   13    │ '/standard_charges/2/payers_information/1'  │          '1'          │                'must match "then" schema'                │
│   14    │ '/standard_charges/2/payers_information/1'  │          '1'          │    "must have required property 'contracting_method'"    │
│   15    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   16    │ '/standard_charges/3/payers_information/0'  │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   17    │ '/standard_charges/3/payers_information/0'  │          '0'          │                'must match "then" schema'                │
│   18    │ '/standard_charges/3/payers_information/0'  │          '0'          │    "must have required property 'contracting_method'"    │
│   19    │ '/standard_charges/3/payers_information/1'  │          '1'          │ "must have required property 'standard_charge_percent'"  │
│   20    │ '/standard_charges/3/payers_information/1'  │          '1'          │                'must match "then" schema'                │
│   21    │ '/standard_charges/3/payers_information/1'  │          '1'          │    "must have required property 'contracting_method'"    │
│   22    │ '/standard_charges/3/payers_information/2'  │          '2'          │ "must have required property 'standard_charge_percent'"  │
│   23    │ '/standard_charges/3/payers_information/2'  │          '2'          │                'must match "then" schema'                │
│   24    │ '/standard_charges/3/payers_information/2'  │          '2'          │    "must have required property 'contracting_method'"    │
│   25    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   26    │ '/standard_charges/4/payers_information/0'  │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   27    │ '/standard_charges/4/payers_information/0'  │          '0'          │                'must match "then" schema'                │
│   28    │ '/standard_charges/4/payers_information/0'  │          '0'          │    "must have required property 'contracting_method'"    │
│   29    │ '/standard_charges/4/payers_information/1'  │          '1'          │ "must have required property 'standard_charge_percent'"  │
│   30    │ '/standard_charges/4/payers_information/1'  │          '1'          │                'must match "then" schema'                │
│   31    │ '/standard_charges/4/payers_information/1'  │          '1'          │    "must have required property 'contracting_method'"    │
│   32    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   33    │ '/standard_charges/5/payers_information/0'  │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   34    │ '/standard_charges/5/payers_information/0'  │          '0'          │                'must match "then" schema'                │
│   35    │ '/standard_charges/5/payers_information/0'  │          '0'          │    "must have required property 'contracting_method'"    │
│   36    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   37    │ '/standard_charges/6/payers_information/0'  │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   38    │ '/standard_charges/6/payers_information/0'  │          '0'          │                'must match "then" schema'                │
│   39    │ '/standard_charges/6/payers_information/0'  │          '0'          │    "must have required property 'contracting_method'"    │
│   40    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   41    │ '/standard_charges/7/payers_information/0'  │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   42    │ '/standard_charges/7/payers_information/0'  │          '0'          │                'must match "then" schema'                │
│   43    │ '/standard_charges/7/payers_information/0'  │          '0'          │    "must have required property 'contracting_method'"    │
│   44    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   45    │ '/standard_charges/8/payers_information/0'  │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   46    │ '/standard_charges/8/payers_information/0'  │          '0'          │                'must match "then" schema'                │
│   47    │ '/standard_charges/8/payers_information/0'  │          '0'          │    "must have required property 'contracting_method'"    │
│   48    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   49    │ '/standard_charges/9/payers_information/0'  │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   50    │ '/standard_charges/9/payers_information/0'  │          '0'          │                'must match "then" schema'                │
│   51    │ '/standard_charges/9/payers_information/0'  │          '0'          │    "must have required property 'contracting_method'"    │
│   52    │ '/standard_charges/9/payers_information/1'  │          '1'          │ "must have required property 'standard_charge_percent'"  │
│   53    │ '/standard_charges/9/payers_information/1'  │          '1'          │                'must match "then" schema'                │
│   54    │ '/standard_charges/9/payers_information/1'  │          '1'          │    "must have required property 'contracting_method'"    │
│   55    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   56    │ '/standard_charges/10/payers_information/0' │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   57    │ '/standard_charges/10/payers_information/0' │          '0'          │                'must match "then" schema'                │
│   58    │ '/standard_charges/10/payers_information/0' │          '0'          │    "must have required property 'contracting_method'"    │
│   59    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   60    │ '/standard_charges/11/payers_information/0' │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   61    │ '/standard_charges/11/payers_information/0' │          '0'          │                'must match "then" schema'                │
│   62    │ '/standard_charges/11/payers_information/0' │          '0'          │    "must have required property 'contracting_method'"    │
│   63    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   64    │ '/standard_charges/12/payers_information/0' │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   65    │ '/standard_charges/12/payers_information/0' │          '0'          │                'must match "then" schema'                │
│   66    │ '/standard_charges/12/payers_information/0' │          '0'          │    "must have required property 'contracting_method'"    │
│   67    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   68    │ '/standard_charges/13/payers_information/0' │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   69    │ '/standard_charges/13/payers_information/0' │          '0'          │                'must match "then" schema'                │
│   70    │ '/standard_charges/13/payers_information/0' │          '0'          │    "must have required property 'contracting_method'"    │
│   71    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   72    │ '/standard_charges/14/payers_information/0' │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   73    │ '/standard_charges/14/payers_information/0' │          '0'          │                'must match "then" schema'                │
│   74    │ '/standard_charges/14/payers_information/0' │          '0'          │    "must have required property 'contracting_method'"    │
│   75    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   76    │ '/standard_charges/15/payers_information/0' │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   77    │ '/standard_charges/15/payers_information/0' │          '0'          │                'must match "then" schema'                │
│   78    │ '/standard_charges/15/payers_information/0' │          '0'          │    "must have required property 'contracting_method'"    │
│   79    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   80    │ '/standard_charges/16/payers_information/0' │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   81    │ '/standard_charges/16/payers_information/0' │          '0'          │                'must match "then" schema'                │
│   82    │ '/standard_charges/16/payers_information/0' │          '0'          │    "must have required property 'contracting_method'"    │
│   83    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   84    │ '/standard_charges/17/payers_information/0' │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   85    │ '/standard_charges/17/payers_information/0' │          '0'          │                'must match "then" schema'                │
│   86    │ '/standard_charges/17/payers_information/0' │          '0'          │    "must have required property 'contracting_method'"    │
│   87    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   88    │ '/standard_charges/18/payers_information/0' │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   89    │ '/standard_charges/18/payers_information/0' │          '0'          │                'must match "then" schema'                │
│   90    │ '/standard_charges/18/payers_information/0' │          '0'          │    "must have required property 'contracting_method'"    │
│   91    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   92    │ '/standard_charges/19/payers_information/0' │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   93    │ '/standard_charges/19/payers_information/0' │          '0'          │                'must match "then" schema'                │
│   94    │ '/standard_charges/19/payers_information/0' │          '0'          │    "must have required property 'contracting_method'"    │
│   95    │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   96    │ '/standard_charges/20/payers_information/0' │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   97    │ '/standard_charges/20/payers_information/0' │          '0'          │                'must match "then" schema'                │
│   98    │ '/standard_charges/20/payers_information/0' │          '0'          │    "must have required property 'contracting_method'"    │
│   99    │ '/standard_charges/20/payers_information/1' │          '1'          │ "must have required property 'standard_charge_percent'"  │
│   100   │ '/standard_charges/20/payers_information/1' │          '1'          │                'must match "then" schema'                │
│   101   │ '/standard_charges/20/payers_information/1' │          '1'          │    "must have required property 'contracting_method'"    │
│   102   │                     ''                      │          ''           │ "must have required property 'billing_code_information'" │
│   103   │ '/standard_charges/21/payers_information/0' │          '0'          │ "must have required property 'standard_charge_percent'"  │
│   104   │ '/standard_charges/21/payers_information/0' │          '0'          │                'must match "then" schema'                │
│   105   │ '/standard_charges/21/payers_information/0' │          '0'          │    "must have required property 'contracting_method'"    │
│   106   │           '/license_information'            │ 'license_information' │                     'must be array'                      │
│   107   │            '/hospital_location'             │  'hospital_location'  │                     'must be string'                     │
└─────────┴─────────────────────────────────────────────┴───────────────────────┴──────────────────────────────────────────────────────────┘
No warnings found
daniel-eckel commented 4 weeks ago

The V1.1 validator is not being supported or maintained because it was based on a set of voluntary instructions that ultimately were not finalized by CMS through rulemaking. Because V1.1 does not meet the current requirements, we will not be adopting this option.

See here for the required JSON schemas or CSV templates and refer to their associated data dictionary.