function processStats(row, drg, index) {
  var col = {
    8: 'totDischg',
    9: 'avgCovChg',
    10: 'avgTotPay',
    11: 'diffChgPay',
    12: 'perPay'
  };
  var state = row[5];
  var groups = [drg];
  
  // Get some extra values.  There are cases where the amount
  // paid out is more than the amount charged
  row[11] = parseFloat(row[9]) - parseFloat(row[10]);
  row[12] = parseFloat(row[10]) / parseFloat(row[9]);
    
  // Only handle filtered state to get DRG stats
  if (stateStatsFilter.indexOf(state) !== -1) {
    groups = [drg, state + '-' + drg];
  }
  
  // Collect stats by DRG and state-DRG groups
  _.each(groups, function(stat) {
    _.each(col, function(field, colNum) {
      stats[stat] = stats[stat] || {};
      stats[stat][field] = stats[stat][field] || {};
      stats[stat][field].values = stats[stat][field].values || [];
      stats[stat][field].values.push(parseFloat(row[colNum]));
    });
  });
}
// Process stats data to be used at the end
Process stats data to be used at the end
Process stats data to be used at the end
function processStats(row, drg, index) {
  var col = {
    8: 'totDischg',
    9: 'avgCovChg',
    10: 'avgTotPay',
    11: 'diffChgPay',
    12: 'perPay'
  };
  var state = row[5];
  var groups = [drg];
  row[11] = parseFloat(row[9]) - parseFloat(row[10]);
  row[12] = parseFloat(row[10]) / parseFloat(row[9]);
  if (stateStatsFilter.indexOf(state) !== -1) {
    groups = [drg, state + '-' + drg];
  }
  _.each(groups, function(stat) {
    _.each(col, function(field, colNum) {
      stats[stat] = stats[stat] || {};
      stats[stat][field] = stats[stat][field] || {};
      stats[stat][field].values = stats[stat][field].values || [];
      stats[stat][field].values.push(parseFloat(row[colNum]));
    });
  });
}
function processStats ( row , drg , index ) { var col = { 8 : 'totDischg' , 9 : 'avgCovChg' , 10 : 'avgTotPay' , 11 : 'diffChgPay' , 12 : 'perPay' } ; var state = row [ 5 ] ; var groups = [ drg ] ; row [ 11 ] = parseFloat ( row [ 9 ] ) - parseFloat ( row [ 10 ] ) ; row [ 12 ] = parseFloat ( row [ 10 ] ) / parseFloat ( row [ 9 ] ) ; if ( stateStatsFilter . indexOf ( state ) !== - 1 ) { groups = [ drg , state + '-' + drg ] ; } _ . each ( groups , function ( stat ) { _ . each ( col , function ( field , colNum ) { stats [ stat ] = stats [ stat ] || { } ; stats [ stat ] [ field ] = stats [ stat ] [ field ] || { } ; stats [ stat ] [ field ] . values = stats [ stat ] [ field ] . values || [ ] ; stats [ stat ] [ field ] . values . push ( parseFloat ( row [ colNum ] ) ) ; } ) ; } ) ; }
Process stats data to be used at the end
Process stats data to be used at the end
// Get some extra values.  There are cases where the amount // paid out is more than the amount charged // Only handle filtered state to get DRG stats // Collect stats by DRG and state-DRG groups