I am trying to mark the "qualifying visits" in a list of patient visits by putting "Yes" in a particular field.
The qualifying visits are the 1st 10 visits during the time frame.
BUT, only up to 5 of the 1st 10 visits can have a particular CreditDSSID (179).
So visits 11 and 12 could count if visits 4-10 were from CreditDSSID 179 (visits 9 & 10 would not count as qualifying in this example since they are 179 visits 6 and 7).
Or, in a different example, you COULD count visit 11 qualifying if it was FROM CreditDSSID 179 (since it was not part of the 1st 10 visits)
I am very close, but I cannot quite get it to count corectly. I am sure that there is a less convoluted way to do this than some of the things I have tried!
The qualifying visits are the 1st 10 visits during the time frame.
BUT, only up to 5 of the 1st 10 visits can have a particular CreditDSSID (179).
So visits 11 and 12 could count if visits 4-10 were from CreditDSSID 179 (visits 9 & 10 would not count as qualifying in this example since they are 179 visits 6 and 7).
Or, in a different example, you COULD count visit 11 qualifying if it was FROM CreditDSSID 179 (since it was not part of the 1st 10 visits)
I am very close, but I cannot quite get it to count corectly. I am sure that there is a less convoluted way to do this than some of the things I have tried!