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

Replace ccs_description with primary_diagnossis, simplify ind_dates loop #146

Closed kai-fukutaki closed 1 year ago

kai-fukutaki commented 1 year ago

Switches from ccs_description not null to primary_diagnosis not null, since that column is universal across APCD and Medicaid at least, while ccs_description was in Medicaid but not APCD (along with other reasons below). Also includes a check for non-NA to go along with this so that NA doesn't end up in top causes.

Also adds a loop simplification for when ind_dates are in use

Comments from Eli on ccs_description change: "Ok, I just dug into the top causes function and the Medicaid data and I think we might want to consider changing this line of code in the top causes function. Here’s my thought process:

  1. I can’t remember if it was Alastair or myself that wrote this particular line of code in the top causes function, but my assumption for sub-setting to claims where the primary ICD-CM code was matched to a CCS category is to get rid of claims that would have a blank plain language “cause”.

  2. Ideally all ICD-CM codes are matched to a CCS category in the ref.dx_lookup table, but this is not the case for one of the following reasons:

a. An ICD-CM code is invalid (i.e. typo on the claim) b. An ICD-CM code is not specific enough to be matched to a CCS code (meaning that the submitter left off some digits) c. An ICD-CM code is not included in the ref.dx_lookup table (which happens because we might be missing new permutations of ICD-CM codes that we haven’t seen in the past, or because we are missing newly added ICD-CM codes)

  1. My recommendation is that we remove the “ccs_description IS NOT NULL" from the top causes function and instead replace it with primary_diagnosis IS NOT NULL. The rationale is that by using the current code, we may remove some claims where the primary diagnosis does not match to a CCS category, but the secondary (or higher) diagnosis code does.

  2. For an example of this, check out Medicaid claim header 402204900019123000. You’ll see that this claim header has 3 diagnosis codes – the first M5459 does not match to a CCS code (because of reason 2c above), whereas the second code (M546) and third code (M542) both match to ccs_final_plain_language “Spine and back disorders”, which incidentally would be the appropriate CCS category for M5459 if this ICD-CM code was included in our ref.dx_loopkup table.

In summary, I don’t think we should subset by ccs_description of the primary diagnosis code. This also points to the fact that we are long overdue for an update to our ref.dx_lookup table (which we are aware of)."