You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write a report to describe impending bill notification failures. Name it impending_bill_notification_failures.
Enumerate every project that had an email notification failure logged by the script warn_owners_of_impending_bill.R. For each such project, provide the email address and message status for each message concerning that project sent by warn_owners_of_impending_bill.R.
Here's some pseudo-code Philip (and maybe Kyle?) wrote on 2023-02-07 to rough in what the data flow probably looks like:
library(redcapcustodian)
library(rcc.billing)
library(RMariaDB)
library(DBI)
library(tidyverse)
library(lubridate)
library(dotenv)
library(fs)
load_dot_env("prod.env")
init_etl("harvest_log_data_for_a_script")
rcc_billing_conn<- connect_to_rcc_billing_db()
log<- tbl(rcc_billing_conn, "rcc_job_log") %>%
filter(script_name=="warn_owners_of_impending_bill") %>%
collect()
# df <- job_summary_data %>%# jsonlite::fromJSON()# Probably need to do map2 passing a vector of log_date and# vector of job_summary_data to return a dataframe of# log_date, recipient, projects, and error_message## Then add value by adding delivered (T/F).# Then separate projects into project_id and pivoting project_id longer.# Then add columns delivered_count and failed_count after grouping by project_ids.# Then add the columns service_instance_id, invoice_number by joining invoice details by project_id# Then summarize the above dataframe into a dataframe with one row per project and all invoice details# These commands might do the trick# group_by(project_id) %>%# distinct(project_id, .keep_all = T) %>%# select(-c("addressee-specific columns")
The text was updated successfully, but these errors were encountered:
@ChemiKyle, I am wondering if I should turn the last 5 lines into a redcapcustodian function. Maybe call it spread_job_summary_data? or decode_job_summary_data? I feel like if I don't make it a function I should add it to the docs as a recipe.
Write a report to describe impending bill notification failures. Name it
impending_bill_notification_failures
.Enumerate every project that had an email notification failure logged by the script
warn_owners_of_impending_bill.R
. For each such project, provide the email address and message status for each message concerning that project sent bywarn_owners_of_impending_bill.R
.Here's some pseudo-code Philip (and maybe Kyle?) wrote on 2023-02-07 to rough in what the data flow probably looks like:
The text was updated successfully, but these errors were encountered: