Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to re-use this expression to limit it to only those MRNs where the initial expression is > 1. What we are looking at is how many completed visits we have had per MRN (patient).
=COUNT(DISTINCT {<[Encounter Type]={"OFFICE VISIT", "APPOINTMENT"}, [Appointment Status]={"COMPLETED"}>} VISIT_KEY)/COUNT(DISTINCT {<[Encounter Type]={"OFFICE VISIT"}, [Appointment Status]={"COMPLETED"}>} MRN)
In Laymans, Count the number of Completed office visits for MRNs that have had at least one completed office visits. Divide that by the number of patients.
May be this
=COUNT(DISTINCT {<[Encounter Type]={"OFFICE VISIT", "APPOINTMENT"}, [Appointment Status]={"COMPLETED"}, MRN = {"=Count(DISTINCT {<[Appointment Status] = {'COMPLETED'}>} VISIT_KEY) > 1"}>} VISIT_KEY)/COUNT(DISTINCT {<[Encounter Type]={"OFFICE VISIT"}, [Appointment Status]={"COMPLETED"}, MRN = {"=Count(DISTINCT {<[Appointment Status] = {'COMPLETED'}>} VISIT_KEY) > 1"}>} MRN)
Would you be able to elaborate a little more on your requirement? and may be support it with a sample?
Sure. So the current expression works. What I need it to do is to only look at those MRNs that have a Count of Completed Office Visits greater than 1.
Thus in this table below, MRN 222 would not be counted because that patient has had a Count of Completed visits that is only 1 (I want it to look at MRN 999 and 333 because they both have had more than one completed office visit.
Encounter Type | Appointment Status | VISIT_KEY | MRN |
OFFICE VISIT | COMPLETED | 1 | 999 |
OFFICE VISIT | COMPLETED | 2 | 999 |
OFFICE VISIT | COMPLETED | 3 | 999 |
APPOINTMENT | NO-SHOW | 4 | 999 |
OFFICE VISIT | COMPLETED | 5 | 999 |
OFFICE VISIT | COMPLETED | 1 | 222 |
OFFICE VISIT | COMPLETED | 1 | 333 |
APPOINTMENT | NO-SHOW | 2 | 333 |
OFFICE VISIT | COMPLETED | 3 | 333 |
May be this
=COUNT(DISTINCT {<[Encounter Type]={"OFFICE VISIT", "APPOINTMENT"}, [Appointment Status]={"COMPLETED"}, MRN = {"=Count(DISTINCT {<[Appointment Status] = {'COMPLETED'}>} VISIT_KEY) > 1"}>} VISIT_KEY)/COUNT(DISTINCT {<[Encounter Type]={"OFFICE VISIT"}, [Appointment Status]={"COMPLETED"}, MRN = {"=Count(DISTINCT {<[Appointment Status] = {'COMPLETED'}>} VISIT_KEY) > 1"}>} MRN)
Great! Works!