
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Count of Distinct When Two Conditions met
I need help with an expression under the following condition:
Give me the count of patients (MRN) who have zero Office Visits ([OFFICE VISIT]) and at least one Care Coordination [CARE COORDINATION])
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be this:
Count(DISTINCT {<MRN = {"=Count({<[OFFICE VISIT] = {'Office Visit'}>}MRN) = 0 and Count({<[OFFICE VISIT] = {'Care Coordination'}>}MRN) >= 1"}>} MRN)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Share some sample data and expected output

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be like this
Count(DISTINCT {<[OFFICE VISIT] = {0}, [CARE COORDINATION] = {'>= 1'}>}MRN)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is close...but is there a way for it to do a count of all of the Office Visits for that patient and return the count of MRN when that Office Visit Count is 0 and the count of care coordination is >1?
This basically needs to collapse across the following:
Patient A 3/2/17 Office Visit
Patient A 3/4/17 Care Coordination
Patient B 3/1/17 Care Coordination
Patient C 2/4/17 Care Coordination
The output would be that we have MRN = 2 because only two patients have only Care coordination visits (A does not qualify because Office Visit = 1 for them).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be this:
Count(DISTINCT {<MRN = {"=Count({<[OFFICE VISIT] = {'Office Visit'}>}MRN) = 0 and Count({<[OFFICE VISIT] = {'Care Coordination'}>}MRN) >= 1"}>} MRN)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Definitely it! I'll have to look into that method you used where you defined MRN, I haven't seen that before in set analysis

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Check this out here (Under Search String):
