assign_acns()
divides unassigned cases among REDcap investigators
scheduled to work on date
. It distributes cases randomly and evenly across
investigators until either all are assigned or there are too few cases for
another round of even distribution. Any remaining cases are assigned randomly
with at most one additional case given to an investigator.
assign_acns( .data = translate_acns(), date = attr(.data, "date"), api_token = Sys.getenv("redcap_NCA_token") )
.data | Data frame of cases to assign, passed from
|
---|---|
date | The date to use when checking whether investigators are scheduled |
api_token | The API token for the Case Assignment REDcap project. The
default pulls this from the environment variable |
A tibble
containing the input data with columns investigator
,
team
, and assign_date
added
Pull school age investigators from team lead sheet
Re-factor expressions to be self-documenting (helpers)
Add documentation to helpers
Create unit tests for all functions in file