Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
proctors
Creator
Creator

Selecting People Based on Ever having a value

I need to be able to filter patients based on if they ever had a certain type of value in their past, not whether they currently do. Here is some sample data. I would like to have this done in the GUI and not within the script since I need the rest of the data for other analyses.

The result should return all rows for the first two patients and nothing for the last one if they ever had an Evaluation.

  

MRN_IDVisit Type
33423Eval
33423Therapy
33423Therapy
23453Therapy
23453Eval
23453Therapy
23453Therapy
23453Therapy
423Therapy
423Therapy
423Therapy
1 Solution

Accepted Solutions
Gysbert_Wassenaar

See attached example


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Gysbert_Wassenaar

See attached example


talk is cheap, supply exceeds demand
proctors
Creator
Creator
Author

Thanks, can you please explain what this is doing?

sum({<MRN_ID=P({<[Visit Type]={'Eval'}>}MRN_ID)>}1)

Gysbert_Wassenaar

It returns the sum of 1 for every record that involves a patient that ever had a visit of the type Eval.


talk is cheap, supply exceeds demand
proctors
Creator
Creator
Author

Great! How can I put this into a Listbox to select these?

Gysbert_Wassenaar

Use two listboxes. One for Visit Type and one for MRN_ID. Then select Eval in the Visit Type listbox. Next right click the MRN_ID listbox and choose the Select Possible option from the context menu. Finally right click the Visit Type listbox and choose the Clear option from the context menu.


talk is cheap, supply exceeds demand