PHSKC-APDE / claims_data

Process and analyze WA State Medicaid, Medicare, and All-Payer Claims Database eligibility and claims data
21 stars 4 forks source link

a few bugs in claims_elig function #82

Closed elikern-kc closed 4 years ago

elikern-kc commented 4 years ago

I tried earlier today to run the claims_elig function with the apcd data and noticed a few bugs in the code. I began to attempt a fix but figured it would be easier for Alastair to fix as he wrote the script:

I fixed the above errors but still couldn't get the function to run on apcd data because the age_min and age_max parameters were attempting to apply to the apcd.elig_demo table, but "age" is created on the fly and thus doesn't exist yet.

alastairmatheson commented 4 years ago

Fixed things in https://github.com/PHSKC-APDE/claims_data/pull/84. I didn't see the issue with dual_sql. If the source is not "mcaid", "mcare", "mcaid_mcare", "mcaid_mcare_pha" (i.e., it's APCD) then dual_sql and associated code should be blank (lines 978-80). I believe the dual field exists in all the names sources so should run ok. Mcaid- and mcare-only tables don't have a apde_dual field so I updated line 955 (previously it only covered mcare).