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: DBTableConfig = None)[source]
- ps = 'ps'
- ip = 'ip'
- supported_tables = ['ps', 'ip', 'mbsf_d']
- ensure_schema()[source]
Creates the target schema in its own transaction, tolerating a concurrent workflow branch creating it at the same time: CREATE SCHEMA IF NOT EXISTS is not concurrency-safe in PostgreSQL and can fail with a unique constraint violation on pg_namespace.