Closed aneiderhiser closed 1 year ago
Encounter
Create an "emergency department" encounter_type and ED encounter grouper in claims preprocessing, similar to the acute inpatient encounter grouper.
Use institutional claims as the base. An ED encounter should not be made up of only professional claims. An ED encounter could be made up of only institutional claims, but in theory this shouldn't be possible.
Assume multiple ED visits per day cannot occur at the same facility i.e. group by patient_id, facility_npi, date. We can improve this over time by adding primary diagnosis code criteria.
Start and end dates should be 1 day apart at most.
Primary dx should come from the institutional claim, not professional.
Paid, allowed, and charges should be the sum across institutional and professional
ED Classification Summary Table
The grain of this table should be changed to encounter - it's currently claim. The left most column should be encounter_id.
Here are the key fields - remove other fields:
A lot of this stuff is in the summary table today. Main thing is changing the grain to encounter.
@aneiderhiser - I have a couple issues to run by you.
Adding CCSRs to the ED Classification summary table means that a user can't disable the CCSR mart and still run ED Classification. If they do disable CCSR and keep ED enabled, dbt throws an error. We have a few options:
Changing ED Classification to run-off encounters requires me to know the code type for the primary diagnosis. There are 46 diagnosis codes that overlap in the two systems. So the options here:
I feel like the error is fine (if the run ED class w/o CCSR). We just note it in the docs e.g. readme. Is this the simplest thing to implement? Seems like it is.
I think primary dx should only be billable - not problem or admitting. Does that work?
@aneiderhiser - For primary dx I'm talking about the field that tells someone if it's icd 9 or icd 10. In ed classification, there's an icd 9 and icd 10 value set. I need to know the code type of the primary dx to know which seed file to use.
Ahh got it. So we need to add primary_diagnosis_code_type like you mentioned above. That makes sense.
I'm not sure what you mean by 46 collisions. Can you elaborate?
By collisions I mean there are 46 diagnosis codes that are shared between icd 9 and icd 10. I ran this analysis to see if having the code type even mattered because if the two data sets were mutually exclusive we wouldn't need the code type.
These are the improvements I think we need to make for ED visit analytics.