CMSgov / hpt-validator

Validation library for CMS Hospital Price Transparency machine-readable files
Other
4 stars 5 forks source link

Non-required column header duplicate bug. #37

Closed shaselton-usds closed 5 months ago

shaselton-usds commented 5 months ago

One line description of your change (less than 72 characters)

Detects for duplicates of non-required columns and allows for non-required columns not to trigger duplicate errors when there are none.

Problem

Subtle bug that will trigger duplicate column error when comparing two values that are not duplicates. In addition, duplicates could not be triggered if the column headers were not part of the original expected set and there were actually duplicate column headers in the file.

Solution

Added functionality to detect duplicates when column headers are not part of the initially calculated required headers for CSV wide

Result

Duplicate non-required column headers will trigger an error. And false-positive duplicate errors will no longer be thrown.

Test Plan

Extended the test suite to cover for this situation.