CMSgov / hpt-validator-cli

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

Results between web validator and CLI validator do not match #16

Closed dvillaveces-tq closed 1 week ago

dvillaveces-tq commented 1 month ago

Issue Report

Some files are marked as 100% valid by the online validator, but not the CLI validator

Expected behavior

I would expect the same file to give the same result on the CLI and web validator.

Actual behavior

This file passes the online validator (see screenshot). Screenshot 2024-08-07 at 4 28 52 PM

But the same file throws errors when using the CLI validator:

Screenshot 2024-08-07 at 4 30 03 PM

Incidentally, this file actually does not seem compliant because it has gross_charges instead of gross_charge, but that does not seem to be the error the CLI gives.

Steps to reproduce the behavior

  1. Download the linked file
  2. Unzip it
  3. Run it through the CLI validator using cms-hpt-validator Lenox_Hill_Hospital_StandardCharges.json v2.0.0
  4. Run the same file through the online validator at https://cmsgov.github.io/hpt-tool/online-validator/

(Note, this time I made sure I'm using the latest version (1.0.12) of the CLI validator)

daniel-eckel commented 1 week ago

Thank you for raising this issue. The reason for the mismatch in results between the online validator and the CLI validator is due to the presence of a byte-order mark (BOM) at the beginning of the Lenox Hill Hospital MRF. The online validator parser automatically removes the BOM but the CLI validator parser does not, resulting in the parser error in the above screenshot. A fix to the validator core has been coded and merged on August 19, 2024 to remove BOM from all MRFs. Reinstalling the CLI validator and rerunning the Lenox Hill Hospital File will result in matching results between the online validator and CLI validator.

Additionally, the hospital price transparency regulations allow for additional hospital defined attributes in JSON MRFs. The validator is operating as expected and treats ‘gross_charges’ as an additional hospital defined attribute. Leveraging the Validator helps ensure adherence to CMS form and manner requirements (45 CFR 180.50(c)(2)), but it does not certify that the MRF fully complies with all HPT requirements at 45 CFR 180.50.