Dan Fitch
:anchor_date_offsets => [-16, -12, -10, -8, -5, 4]
:instrument_data => {
"Tracker: FC-T2" => {
:fields => {
"TRCKFCT2A_058" => "Consent T1-T2",
"TRCKFCT2A_030" => "Consent cord blood",
"TRCKFCT2A_045" => "Consent saliva",
},
},
"Demo FC" => {
:fields => {
"TODO" => "Hospital",
"DEMOGRAPHT1_003" => "DOB_MOM",
},
},
},
EXAMPLE IMAGE REDACTED
tasks = [
{
:label => ["ursi", "name", "group", "WBIC", "cohort", "Preferred method of contact", "Agreed to SO interview?", "SO name", "SO relation to pp", "SO phone", "SO email", "Follow- up SO Interview Communications Log", "T3 date", "T3 status", "Follow up SO int. status", "Follow up SO int. notes", "Intervention status"].to_csv.strip,
:filter => lambda { |row, today_date, piggybank|
# This function must return true or false
group = row['WS_ET_185'].to_i
status_overall = row['WS_ET_187'].to_i #blank will turn into 0
status_enrollment = row['WS_ET_328'].to_i #blank will turn into 0
status_so = row['WS_ET_488'].to_i #blank will turn into 0
...
status_overall == STATUS_ENROLLED and status_enrollment == ENROLLED_YES and status_so == YES and status_int == COMPLETED_INT and status_postint_so == BLANK and status_postT1_so == COMPLETED_SO or (status_T3 == YES and status_postT3_so == BLANK)
},
:output => lambda { |row, today_date, piggybank|
# This function must return a string
ursi = row['queried_ursi'].to_s.strip()
subject = piggybank.get_demographics_by_ursi(ursi)
name = "#{subject.first_name} #{subject.last_name}"
subject_group_int = row['WS_ET_185'].to_i
...
out = [ursi, name, subject_group, wbic, cohort, preferred_contact, status_so, so_name, so_relation, so_phone, so_email, follow_up_so_comm_log, date_T3, status_postT3_so, status_T3, status_int]
out.to_csv.strip
# AND SO ON
Thanks for your time.