app/helpers/equity_helper.rb
#list hcv patients related to the given equity measure
list hcv patients related to the given equity measure
list hcv patients related to the given equity measure
def list_hcv_equity_patients(eq_id)
    @patients = []
    if(eq_id == 'hcv_test')
      @equity = Equity.new(:condition_code => C_HCV_CODE, :measure_code =>M_CODE_HCV_TEST, :measure_name => M_NAME_HCV_TEST)
      Patient.all.each do |patient|
        patient.eqconditions.each do |c|
          if(c.code == C_HCV_CODE)
            if(at_risk_hcv(patient.profile))
              @equity.expected_count += 1
              if c.test_status != TEST_STATUS_UNTESTED
                @equity.actual_count += 1
                patient.eqmeasure_meet_gl = true
              end
              @patients.push(patient)
            end
          end
        end
      end
    elsif(eq_id == 'hcv_monitor')
      @equity = Equity.new(:condition_code => C_HCV_CODE, :measure_code =>M_CODE_HCV_MONITOR, :measure_name => M_NAME_HCV_MONITOR)
      Patient.all.each do |patient|
        patient.eqconditions.each do |c|
          if(c.code == C_HCV_CODE)
            if(c.test_status == TEST_STATUS_INFECTED )  
              @equity.expected_count += 1
              @patients.push(patient)
            end
            if(c.hcv.eqtests.length > 0)  
              @equity.actual_count += 1
              patient.eqmeasure_meet_gl = true
            end
          end
        end
      end
    elsif(eq_id == 'hcv_treatment')
      @equity = Equity.new(:condition_code => C_HCV_CODE, :measure_code =>M_CODE_HCV_TREAT, :measure_name => M_NAME_HCV_TREAT)
      Patient.all.each do |patient|
        patient.eqconditions.each do |c|
          if(c.code == C_HCV_CODE)
            if(c.test_status == TEST_STATUS_INFECTED )  
              @equity.expected_count += 1
              @patients.push(patient)
            end
            if(c.eqtreatments.length > 0)  
              @equity.actual_count += 1
              patient.eqmeasure_meet_gl = true
            end
          end
        end
      end
    else
      @equity = Equity.new
    end
    cal_percentage(@equity)
  end
def list_hcv_equity_patients ( eq_id ) @patients = [ ] if ( eq_id == 'hcv_test' ) @equity = Equity . new ( :condition_code => C_HCV_CODE , :measure_code => M_CODE_HCV_TEST , :measure_name => M_NAME_HCV_TEST ) Patient . all . each do | patient | patient . eqconditions . each do | c | if ( c . code == C_HCV_CODE ) if ( at_risk_hcv ( patient . profile ) ) @equity . expected_count += 1 if c . test_status != TEST_STATUS_UNTESTED @equity . actual_count += 1 patient . eqmeasure_meet_gl = true end @patients . push ( patient ) end end end end elsif ( eq_id == 'hcv_monitor' ) @equity = Equity . new ( :condition_code => C_HCV_CODE , :measure_code => M_CODE_HCV_MONITOR , :measure_name => M_NAME_HCV_MONITOR ) Patient . all . each do | patient | patient . eqconditions . each do | c | if ( c . code == C_HCV_CODE ) if ( c . test_status == TEST_STATUS_INFECTED ) @equity . expected_count += 1 @patients . push ( patient ) end if ( c . hcv . eqtests . length > 0 ) @equity . actual_count += 1 patient . eqmeasure_meet_gl = true end end end end elsif ( eq_id == 'hcv_treatment' ) @equity = Equity . new ( :condition_code => C_HCV_CODE , :measure_code => M_CODE_HCV_TREAT , :measure_name => M_NAME_HCV_TREAT ) Patient . all . each do | patient | patient . eqconditions . each do | c | if ( c . code == C_HCV_CODE ) if ( c . test_status == TEST_STATUS_INFECTED ) @equity . expected_count += 1 @patients . push ( patient ) end if ( c . eqtreatments . length > 0 ) @equity . actual_count += 1 patient . eqmeasure_meet_gl = true end end end end else @equity = Equity . new end cal_percentage ( @equity ) end
list hcv patients related to the given equity measure
list hcv patients related to the given equity measure
#scan for now; should do search later #check rist/test #scan for now; should do search later #check monitoring #need monitoring # has test #scan for now; should do search later #check treatment #need treatment # has treatment
eq_id
<not_specific>