You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# upon conversion from using TMSIS tables to using TMSIS views
30
+
# retain TMSIS table column names to preserve downstream processing
29
31
cols02= [
30
-
"tms_run_id",
31
-
"tms_reporting_period",
32
-
"submitting_state",
33
-
"submitting_state as submtg_state_cd",
34
-
"record_number",
32
+
"tmsis_run_id as tms_run_id",
33
+
"tmsis_rptg_prd as tms_reporting_period",
34
+
"submtg_state_cd as submitting_state",
35
+
"submtg_state_cd",
36
+
"rec_num as record_number",
35
37
"%upper_case(state_plan_id_num) as state_plan_id_num",
36
-
"managed_care_main_rec_eff_date",
37
-
"managed_care_main_rec_end_date",
38
-
"%fix_old_dates(managed_care_contract_eff_date)",
39
-
"case when managed_care_contract_eff_date is not null and managed_care_contract_end_date is null then to_date('9999-12-31') when to_date('1600-01-01') > managed_care_contract_end_date then to_date('1599-12-31') else managed_care_contract_end_date end as MC_CNTRCT_END_DT",
40
-
"managed_care_name",
41
-
"managed_care_program",
42
-
"managed_care_plan_type",
43
-
"reimbursement_arrangement",
44
-
"managed_care_profit_status",
45
-
"core_based_statistical_area_code",
46
-
"percent_business",
47
-
"managed_care_service_area",
38
+
"mc_mn_rec_efctv_dt as managed_care_main_rec_eff_date",
39
+
"mc_mn_rec_end_dt as managed_care_main_rec_end_date",
"case when mc_cntrct_efctv_dt is not null and mc_cntrct_end_dt is null then to_date('9999-12-31') when to_date('1600-01-01') > mc_cntrct_end_dt then to_date('1599-12-31') else mc_cntrct_end_dt end as MC_CNTRCT_END_DT",
42
+
"mc_name as managed_care_name",
43
+
"mc_pgm_cd as managed_care_program",
44
+
"mc_plan_type_cd as managed_care_plan_type",
45
+
"reimbrsmt_arngmt_cd as reimbursement_arrangement",
# upon conversion from using TMSIS tables to using TMSIS views
32
+
# retain TMSIS table column names to preserve downstream processing
31
33
cols05= [
32
-
"tms_run_id",
33
-
"tms_reporting_period",
34
-
"record_number",
35
-
"submitting_state",
36
-
"submitting_state as submtg_state_cd",
34
+
"tmsis_run_id as tms_run_id",
35
+
"tmsis_rptg_prd as tms_reporting_period",
36
+
"rec_num as record_number",
37
+
"submtg_state_cd as submitting_state",
38
+
"submtg_state_cd",
37
39
"%upper_case(state_plan_id_num) as state_plan_id_num",
38
40
"""case
39
-
when length(trim(TRAILING FROM operating_authority))<2 and length(trim(TRAILING FROM operating_authority))>0 and operating_authority in ('1','2','3','4','5','6','7','8','9')
40
-
then lpad(trim(TRAILING FROM operating_authority),2,'0')
41
-
when trim(TRAILING FROM operating_authority) in ('01','02','03','04','05','06','07','08','09') or
42
-
trim(TRAILING FROM operating_authority) in ('10','11','12','13','14','15','16','17','18','19','20','21','22','23')
43
-
then trim(TRAILING FROM operating_authority)
41
+
when length(trim(TRAILING FROM oprtg_authrty_cd))<2 and length(trim(TRAILING FROM oprtg_authrty_cd))>0 and oprtg_authrty_cd in ('1','2','3','4','5','6','7','8','9')
42
+
then lpad(trim(TRAILING FROM oprtg_authrty_cd),2,'0')
43
+
when trim(TRAILING FROM oprtg_authrty_cd) in ('01','02','03','04','05','06','07','08','09') or
44
+
trim(TRAILING FROM oprtg_authrty_cd) in ('10','11','12','13','14','15','16','17','18','19','20','21','22','23')
45
+
then trim(TRAILING FROM oprtg_authrty_cd)
44
46
else null
45
47
end as operating_authority""",
46
-
"%upper_case(waiver_id) as waiver_id",
47
-
"managed_care_op_authority_eff_date",
48
-
"managed_care_op_authority_end_date",
48
+
"%upper_case(wvr_id) as waiver_id",
49
+
"mc_op_authrty_efctv_dt as managed_care_op_authority_eff_date",
50
+
"mc_op_authrty_end_dt as managed_care_op_authority_end_date",
49
51
]
50
52
51
-
whr05="(trim(TRAILING FROM operating_authority) in ('1','2','3','4','5','6','7','8','9') or trim(TRAILING FROM operating_authority) in ('01','02','03','04','05','06','07','08','09') or trim(TRAILING FROM operating_authority) in ('10','11','12','13','14','15','16','17','18','19','20','21','22','23')) or (upper(waiver_id) is not null)"
53
+
whr05="(trim(TRAILING FROM oprtg_authrty_cd) in ('1','2','3','4','5','6','7','8','9') or trim(TRAILING FROM oprtg_authrty_cd) in ('01','02','03','04','05','06','07','08','09') or trim(TRAILING FROM oprtg_authrty_cd) in ('10','11','12','13','14','15','16','17','18','19','20','21','22','23')) or (upper(wvr_id) is not null)"
0 commit comments