@@ -123,7 +123,7 @@ transform_resc_occupcy_tb <- function (resc_occupcy_tb, resources_tb)
123123# ' @return Input data (a list)
124124# ' @rdname transform_to_clone_nat_dmd
125125# ' @export
126- # ' @importFrom purrr map2_dfr map_dfr
126+ # ' @importFrom purrr map2_dfr map_chr map_dfr
127127# ' @importFrom dplyr filter mutate bind_rows select distinct
128128# ' @importFrom ready4fun get_from_lup_obj
129129# ' @keywords internal
@@ -140,10 +140,11 @@ transform_to_clone_nat_dmd <- function (input_data_ls, clone_ls = list(AUS_SNR_F
140140 ~ {
141141 template_1L_chr <- .y
142142 template_tb <- alt_inp_data_ls $ resource_use_tb %> %
143- dplyr :: filter(Recipient_UID_chr == .y ) %> % dplyr :: mutate(Discipline_UID_chr = ready4fun :: get_from_lup_obj(alt_inp_data_ls $ resources_tb ,
144- match_var_nm_1L_chr = " Resource_UID_chr" , match_value_xx = Resource_UID_chr ,
145- target_var_nm_1L_chr = " Discipline_UID_chr" ,
146- evaluate_lgl = F ))
143+ dplyr :: filter(Recipient_UID_chr == .y ) %> % dplyr :: mutate(Discipline_UID_chr = Resource_UID_chr %> %
144+ purrr :: map_chr(~ ready4fun :: get_from_lup_obj(alt_inp_data_ls $ resources_tb ,
145+ match_var_nm_1L_chr = " Resource_UID_chr" , match_value_xx = .x ,
146+ target_var_nm_1L_chr = " Discipline_UID_chr" ,
147+ evaluate_lgl = F )))
147148 recipients_chr <- .x
148149 new_tb <- purrr :: map_dfr(recipients_chr , ~ {
149150 state_1L_chr <- ready4fun :: get_from_lup_obj(alt_inp_data_ls $ recipients_tb ,
@@ -155,7 +156,7 @@ transform_to_clone_nat_dmd <- function (input_data_ls, clone_ls = list(AUS_SNR_F
155156 match_var_nm_1L_chr = " Location_UID_chr" ,
156157 match_value_xx = state_1L_chr , target_var_nm_1L_chr = " STE_chr" ,
157158 evaluate_lgl = F ) %> % ready4fun :: get_from_lup_obj(data_lookup_tb = alt_inp_data_ls $ resources_tb %> %
158- dplyr :: filter(Discipline_UID_chr == template_tb $ Discipline_UID_chr ,
159+ dplyr :: filter(Discipline_UID_chr %in% unique( template_tb $ Discipline_UID_chr ) ,
159160 Recipient_Sex_chr == ready4fun :: get_from_lup_obj(alt_inp_data_ls $ recipients_tb ,
160161 match_var_nm_1L_chr = " Recipient_UID_chr" ,
161162 match_value_xx = template_1L_chr , target_var_nm_1L_chr = " Sex_chr" ,
0 commit comments