4 Replies Latest reply: May 6, 2009 12:14 AM by Sally Hurley RSS

Disregarding current selections in AGGR function

Sally Hurley

Greetings.

I'm not even sure where to begin. I am trying to get a list of patient IDs and a total count of these IDs for patients that have visited the office between a range of dates (vDOSStart and vDOSEnd). I am trying to compare the count of visits to another variable, set to a minimum number of visits (vVisitMin). I need this count regardless of other current selections.

I have a variable, VisitSetList set to the following expression:

=CONCAT(DISTINCT AGGR( if(COUNT({1 <EncounterDate={">=$(vDOSStart)<=$(vDOSEnd)"} >} EncounterDate) >= $(vVisitMin), PatientID ), PatientID), ', ')

The resulting list of PatientID looks great, until I select a fields that disqualifies PatientID. I then loose that PatientID from my list in VisitSetList. I have tried a variety of set expressions, in an effort to include all PatientIDs, but my attempts result in either a null (I'm guessing a bad expression) or it has no effect.

If I'm AGGR on PatientID, is there any way to make it for all PatientID? Am I doing something stupid? Or is this a limitation of AGGR? Or is it because I am not using this function within a chart?

 

Thanks.