8 Replies Latest reply: Nov 22, 2011 12:52 PM by Miguel Angel Baeyens de Arce RSS

    OR Statement Within Set Analysis

      I’m trying to create a chart that shows (by physician) what % of their patients had a certain test completed.

       

      The fun part is that to qualify as having this test completed, a patient can fall into 1 (or more) of the following buckets:

       

      • TestType1Flag = 1 and TestDate within the last year
      • Test2TypeFlag = 1 and TestDate within the last 5 years
      • Test3TypeFlag = 1 and TestDate within the last 10 years

       

      In addition, the time frame is selected by the end-user (Island_Date).

       

      Currently, my chart has Dimension = Physician and the Expression is below.  The expression works, but if – for example – a patient had Test1 and Test2 in the correct time frames…  this patient is counted twice.  I understand why this is happening – I’m just unsure how to correct it.

       

      ---------------------------------------------------------------------------

       

      Count (

      {<

      TestDate ={"<=$(=DATE(MAX(Island_Date)))>=$(=DATE(MIN(Island_Date)-365))"}

      ,

      TestType1Flag = {1}

      >}

      DISTINCT Patient)

       

      +

      Count (

      {<

      TestDate ={"<=$(=DATE(MAX(Island_Date)))>=$(=DATE(MIN(Island_Date)-5*365))"}

      ,

      Test2TypeFlag = {1}

      >}

      DISTINCT Patient)

       

      +

       

      Count (

      {<

      TestDate ={"<=$(=DATE(MAX(Island_Date)))>=$(=DATE(MIN(Island_Date)-10*365))"}

      ,

      Test3TypeFlag = {1}

      >}

      DISTINCT Patient)