Add Primary Discharge Diagnosis to Encounter Views
Summary
I think it would be useful to include the primary discharge diagnosis on all encounter views for quickly grabbing certain populations. Although "primary" diagnosis is not the full story, it would still be useful as a jumping off point for many projects.
What is the expected behavior?
I think it would be important to include at least two columns:
-
PrimaryDischargeDiagnosisID
: The Epic ID for the primary diagnosis, so that we can link to the diagnosis record for further information, or have a grouper reference these types of encounters. -
PrimaryDischargeDiagnosisCD
: The ICD diagnosis code of the discharge diagnosis for improved identification - makes it easier for humans to pick out certain codes rather than a jumble of random numbers. -
MAYBE
PrimaryDischargeDiagnosisNM
: The description associated with the diagnosis code.
Justification for request
Quick way of identifying the major diagnosis that was made during the encounter. Could be useful
Relevant Code, Supporting Documentation, Etc.
This is how I've pulled primary diagnosis code in the past:
select
pe.PatientEncounterID,
pdxg.DiagnosisID as PrimaryDischargeDiagnosisID,
-- NOTE: DiagnosisCD may be a comma-separated list if the diagnosis is an IMO record
-- NOTE: Prefer ICD10 over ICD9 if available
coalesce(id.CurrentICD10ListTXT, id.CurrentICD9ListTXT) as PrimaryDischargeDiagnosisCD,
id.PrimaryDischargeDiagnosisNM
from Epic.Encounter.PatientEncounter_Enterprise pe
left join Epic.Finance.HospitalAccountAllDiagnosesProcedures_Enterprise pdxg on pe.HospitalAccountID = pdxg.HospitalAccountID
and pdxg.SourceAbbreviatedNM = 'Dx Prim Set'
and pdxg.LineNBR = 1
left join Epic.Reference.ICDDiagnosis id on pdxg.DiagnosisID = id.DiagnosisID