Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I have a AND-mode selection requirement where I have to implement AND-mode in List Box as in here
Just a little description on this:
If I have patients Sam, John, Antony and Alex as show in the data below.
I need to show a patient who had multiple drugs at a time but not just the one selected.
For example: If I want to see a patient who had Drug2 AND Drug5, I should see John and Antony only
but not Sam or Peter(though they had Drug2 OR Drug5, my requirement is to show only those who had both the drugs)
EPCRID, Patient, Drug
12345, Sam, Drug1
12345, Sam, Drug2
12345, Sam, Drug3
12345, Sam, Drug4
54321, John, Drug2
54321, John, Drug5
98765, Antony, Drug2
98765, Antony, Drug4
98765, Antony, Drug5
22222, Peter, Drug4
22222, Peter, Drug5
99999, Alex, Drug4
To acheive this I have implemented the AND-mode join in the load script. Please find the attached QVW.
However, now my requirement is
1) To show count of patients with selected drug. in this case the count should ignore the NOT(excluded brown color) selections
For example: AndMode Selection = &Drug2, !Drug5 Result = Count of patients who had Drug2
2) To show count of patients with selected drug and considering not having excluded(NOT) drug
For example: AndMode Selection = &Drug2, !Drug5 Result = Count of patients who had Drug2 but did not had Drug5
Can I achieve this? Thanks in advance.
Shyam
Try this
=Count(DISTINCT {<Patient = {"=Count(DISTINCT {<Drug = {$(=Replace(RTrim(Replace(Replace(Replace(SubField(GetFieldSelections(andDrug), '!', 1), ',', Chr(39) & ',' & Chr(39)), '&', Chr(39)), ',' & Chr(39), ' ')), ' ', ','))}, andDrug>} Drug) = GetSelectedCount(andDrug)"}, andDrug>} Patient)
Experts, Can I please get some help here?
stalwar1 one who can help you better with expressions
I guess it's working fine.
Patient (ID) who bought 'Drug2' are - 12345, 54321 and 98765
Patient (ID) who bought 'Drug5' are - , 54321 and 98765 and 22222
Hence who bought 'Drug2' and NOT 'Drug5' is 12345
Hi Tresesco,
Thanks for reply.
My requirement is something like below:
However, now my requirement is
1) To show count of patients with selected drug. in this case the count should ignore the NOT(excluded brown color) selections
For example: AndMode Selection = &Drug2, !Drug5 Result = Count of patients who had Drug2
2) To show count of patients with selected drug and considering not having excluded(NOT) drug
For example: AndMode Selection = &Drug2, !Drug5 Result = Count of patients who had Drug2 but did not had Drug5
What is the expected output against the current selection?
Current Selections = &Drug2, !Drug4
1) To show count of patients with selected drug. in this case the count should ignore the NOT(excluded brown color) selections
For example: AndMode Selection = &Drug2, !Drug5 Result = Count of patients who had Drug2
Result for this based on current selection is 3 (Sam, John, Antony)
2) To show count of patients with selected drug and considering not having excluded(NOT) drug
For example: AndMode Selection = &Drug2, !Drug5 Result = Count of patients who had Drug2 but did not had Drug5
Result for this based on current selection is 1 (John)
Your second requirement :
For first : You mean you want to ignore the 'NOT Selection' ?
For first : You mean you want to ignore the 'NOT Selection' ? Yes
Tresesco,
Sorry. I don't meant to be rude here .
But, how can i get count based on the logic you provided for the second requirement?
Also, a patient could have more than one EPCRID when he visits hospital again.
I need to count the EPCRID rather the patient.
Thanks in advance.