The mcr_combine_tables Module

This utility combines Medicare Patient Summary or Inpatient Admissions data, that is originally in the form of one table per year into a single view.

It takes care of different types and format of the most common columns, such as: year, state, DO[B/D], zip codes, state and county codes.

The actual schema is defined in ../models/medicare.yaml

This utility uses extended syntax compared with the general data modelling

class MedicareCombinedView(context: Optional[DBTableConfig] = None)[source]
ps = 'ps'
ip = 'ip'
supported_tables = ['ps', 'ip', 'mbsf_d']
print_sql()[source]
execute()[source]
execute_sql(cursor, sql: str)[source]
generate_sql()[source]
get_tables(cursor)[source]
table_sql(cursor, qtable: Tuple) str[source]
get_columns(cursor, table: str) List[Tuple][source]
classmethod get_column(cursor, table: str, candidates: List[str], ctype: Tuple, macros: Dict) Optional[str][source]
classmethod get_simple_column(cursor, table: str, candidates: List[str], ctype: Tuple)[source]
classmethod find_column2arr(cursor, table: str, candidate: str, macros: Dict)[source]