     'awc_num_open, ' ||
     'wer_weighed, ' ||
     'wer_eligible, ' ||
-    'thr_eligible_child, ' ||
-    'thr_rations_21_plus_distributed_child, ' ||
-    'thr_eligible_ccs, ' ||
-    'thr_rations_21_plus_distributed_ccs, ' ||
-    'thr_score, ' ||
     'awc_score, ' ||
     'num_awc_rank_functional, ' ||
     'num_awc_rank_semi, ' ||

    'WHERE pregnant = 1 OR lactating = 1 ' ||
    'GROUP BY awc_id) ut ' ||
  'WHERE ut.awc_id = agg_awc.awc_id';

  -- Pass to combine THR information from ccs record and child health table
  EXECUTE 'UPDATE ' || quote_ident(_tablename5) || ' SET thr_score = ' ||
  'CASE WHEN ((thr_rations_21_plus_distributed_ccs + thr_rations_21_plus_distributed_child)::numeric / ' ||
    '(CASE WHEN (thr_eligible_child + thr_eligible_ccs) = 0 THEN 1 ELSE (thr_eligible_child + thr_eligible_ccs) END)) >= 0.7 THEN 20 ' ||
    'WHEN ((thr_rations_21_plus_distributed_ccs + thr_rations_21_plus_distributed_child)::numeric / ' ||
    '(CASE WHEN (thr_eligible_child + thr_eligible_ccs) = 0 THEN 1 ELSE (thr_eligible_child + thr_eligible_ccs) END)) >= 0.5 THEN 10 ' ||
    'ELSE 1 END';

  -- Aggregate data from usage table
  EXECUTE 'UPDATE ' || quote_ident(_tablename5) || ' agg_awc SET ' ||

    'awc_num_open, ' ||
    'wer_weighed, ' ||
    'wer_eligible, ' ||
    'awc_score, ' ||
    'num_awc_rank_functional, ' ||
    'num_awc_rank_semi, ' ||
