Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I would like to get the number of patients who visited FCM clinics (4 patients) and had a1c tested this year, no matter whether it is done (it should be 4). I can only get 2 by using the script below.
=count(distinct {
<FCMVisit={1},
A1cThisYear={1}
>} PAT_ID)
How to get the correct number? Sample attached. Thanks
VisitID | PAT_ID | FCMVisit | A1C | A1cThisYear |
1 | 1 | 1 | 10 | 1 |
2 | 1 | 1 | 5 | 0 |
3 | 2 | 0 | 9 | 1 |
4 | 2 | 0 | 8 | 1 |
5 | 3 | 0 | 6 | 0 |
6 | 3 | 0 | 8 | 1 |
7 | 3 | 1 | 5 | 0 |
8 | 4 | 1 | 5 | 0 |
9 | 4 | 1 | 5 | 1 |
10 | 5 | 0 | 8 | 1 |
11 | 5 | 1 | 10 | 0 |
Maybe
=count(distinct {
<
PAT_ID = p({<FCMVisit={1}>})*p({<A1cThisYear={1}>})
>} PAT_ID)
Maybe
=count(distinct {
<
PAT_ID = p({<FCMVisit={1}>})*p({<A1cThisYear={1}>})
>} PAT_ID)
When I apply your logic to my project, it did not work. The first one returns 2613. The second one returns only 859. I thought these two are the same. Please advise. Thanks
=count(distinct {
<
YearMonth,
FCMVISIT={1},
VISITTYPE={'Office visit'},
APPT_STATUS_C={2},
CONTACT_DATE2 = {"$(='>=' & Date(V_selectedDate_3YearAgo) & '<=' & Date(V_selectedDate))"},
FLAG_DM={1},
ENCOUNTERAGE ={"$(='>=18<=75)"},
PAT_ID = {"=Age(Num(V_selectedDate), Only({<YearMonth>}BIRTH_DATE)) >= 18 and
Age(Num(V_selectedDate), Only({<YearMonth>}BIRTH_DATE)) <= 75"}
>
} PAT_ID)
---------------------------------------------------------------------------------------------------------------------------------------------------
=count(distinct
{<
PAT_ID=p({<
YearMonth,
FCMVISIT={1},
VISITTYPE={'Office visit'},
APPT_STATUS_C={2},
CONTACT_DATE2 = {"$(='>=' & Date(V_selectedDate_3YearAgo) & '<=' & Date(V_selectedDate))"},
FLAG_DM={1},
ENCOUNTERAGE ={"$(='>=18<=75)"},
PAT_ID = {"=Age(Num(V_selectedDate), Only({<YearMonth>}BIRTH_DATE)) >= 18 and
Age(Num(V_selectedDate), Only({<YearMonth>}BIRTH_DATE)) <= 75"}
>})
>}
PAT_ID
)