Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Update Excel Rake task to accept harp ids as input
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotanchik-SB committed Mar 20, 2024
1 parent bc30b17 commit 510ebce
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/tasks/bonnie_run_once.rake
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ namespace :bonnie do
desc %(Download excel exports for all measures specified in ACCOUNTS
$ rake bonnie:patients:super_user_excel)
task :super_user_excel => :environment do
# To run, put a space dilimeted list of emails from which you would like to download the excel exports from
# To run, put a space delimited list of harp ids from which you would like to download the excel exports from.
# It will use the Group the user last interacted with
ACCOUNTS = %w().freeze
ACCOUNTS.each do |account|
user_measures = CQM::Measure.by_user(User.find_by(email: account))
user_measures = CQM::Measure.by_user(User.find_by(harp_id: account))
user_measures.each do |measure|
begin
# If needed, forcibly limit output to specific measures
# next if measure.cms_id != "CMS#v0"
user = User.find(measure.user_id)
hqmf_set_id = measure.hqmf_set_id
@api_v1_patients = CQM::Patient.by_user_and_hqmf_set_id(user, measure.hqmf_set_id)
Expand Down

0 comments on commit 510ebce

Please sign in to comment.