View medicare.qc_adm_union

Overview for medicare.qc_adm_union

Union of data from admissions table with the records discarded because of validation issues

Transformed from medicare.admissions

SQL/DDL Statement
CREATE view medicare.qc_adm_union AS SELECT reason,
   year,
   state,
   state_iso,
   admission_year,
   diagnoses,
   zip,
   admission_date,
   discharge_date,
   adm_day_of_week,
   primary_diagnosis,
   bene_id,
   bene,
   pd_hll_hash,
   icd_hll
FROM medicare_audit.admissions
UNION ALL 
SELECT 'OK'::VARCHAR AS reason,
   year,
   state,
   state_iso,
   admission_year,
   diagnoses,
   zip,
   admission_date,
   discharge_date,
   adm_day_of_week,
   primary_diagnosis,
   bene_id,
   bene,
   pd_hll_hash,
   icd_hll 
FROM medicare.admissions
;

COMMENT ON view medicare.qc_adm_union 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.799737';

Columns:

Column Name

Column Type

Datatype

adm_day_of_week

copied

INT

admission_date

copied

DATE

admission_year

generated

INT

bene

generated

HLL_HASHVAL

bene_id

copied

string

diagnoses

copied

string

discharge_date

copied

DATE

icd_hll

generated

HLL

pd_hll_hash

generated

HLL_HASHVAL

primary_diagnosis

copied

string

reason

computed

string

state

copied

string

state_iso

generated

char(5)

year

computed

INT

zip

copied

INT