Table medicare.beneficiaries

Overview for medicare.beneficiaries

Cleaned up and unified Medicare beneficiaries table, indexed and optimized for efficient queries

Transformed from medicare._beneficiaries

Primary Key: bene_id

SQL/DDL Statement
CREATE table medicare.beneficiaries AS SELECT * 
FROM medicare._beneficiaries
;
ALTER table medicare.beneficiaries ADD COLUMN number_of_gap_years INT GENERATED ALWAYS AS (last_enrollment_year - first_enrollment_year + 1 - CARDINALITY(all_enrollment_years)) STORED;
ALTER table medicare.beneficiaries ADD COLUMN bene HLL_HASHVAL GENERATED ALWAYS AS (hll_hash_text(bene_id)) STORED;
ALTER table medicare.beneficiaries ADD PRIMARY KEY (bene_id);

COMMENT ON table medicare.beneficiaries IS 'CREATED BY Dorieh: {"version": "0.2.3", "url": "https://github.com/NSAPH-Data-Platform/dorieh", "commit": "bf4644403297aaf478f6a42717508dde55da409a"}. Created at 2024-08-12 13:31:09.767420';

Columns:

Column Name

Column Type

Datatype

all_enrollment_years

copied

INT[]

bene

generated

HLL_HASHVAL

bene_id

copied

string

discrepancies

copied

string

dob

copied

string

dob_latest

copied

string

dod

copied

string

dod_earliest

copied

string

first_enrollment_year

copied

string

last_enrollment_year

copied

string

number_of_gap_years

generated

INT

orec

copied

string

race

copied

string

race_rti

copied

string

sex

copied

string

yob

copied

string

yob_latest

copied

string