The mcr_file Module
Module used for converting CMS DAT files to CSV
- exception MedparParseException(msg: str, pos: int)[source]
Exception raised if data in a DAT file cannot be parsed
- class ColumnAttribute(start: int, end: int, conv)[source]
Attribute of a column as described in the FTS file
- class Column(ord: int, long_name: str, short_name: str, type: str, start: int, width, desc: str)[source]
Class representing column metadata required for generating database schema
- class MedicareFile(dir_path: str, name: str, year: Optional[str] = None, dest: Optional[str] = None)[source]
Class to manipulate a single CMS DAT file
- validate(record)[source]
Asserts that the given record is consistent with the file from which it is read.
- Parameters:
record¶ – Record
- Returns:
None
- count_lines_in_source()[source]
Counts number of lines in the original DAT file
- Returns:
number of lines
- count_lines_in_dest()[source]
Counts number of lines in the resulting CSV file
- Returns:
number of lines
- status() str [source]
Checks if a given DAT file has been successfully converted to CSV
- Returns:
Value of the status of the conversion