diff --git a/R/mod_common_forms.R b/R/mod_common_forms.R index e41428f..9ca04e0 100644 --- a/R/mod_common_forms.R +++ b/R/mod_common_forms.R @@ -165,8 +165,12 @@ mod_common_forms_server <- function( by = "id" ) |> dplyr::filter(!is.na(reviewed)) |> + dplyr::semi_join( + subset(r$review_data, subject_id == r$subject_id & item_group == form), + by = "id" + ) |> dplyr::anti_join( - subset(r$review_data, item_group == form), + subset(r$review_data, subject_id == r$subject_id & item_group == form), by = c("id", "reviewed") ) |> dplyr::arrange(id) @@ -189,8 +193,12 @@ mod_common_forms_server <- function( by = "id" ) |> dplyr::filter(!is.na(reviewed)) |> + dplyr::semi_join( + subset(r$review_data, subject_id == r$subject_id & item_group == form), + by = "id" + ) |> dplyr::anti_join( - subset(r$review_data, item_group == form), + subset(r$review_data, subject_id == r$subject_id & item_group == form), by = c("id", "reviewed") ) |> dplyr::arrange(id) diff --git a/R/mod_review_forms.R b/R/mod_review_forms.R index b9c5c14..2275a1e 100644 --- a/R/mod_review_forms.R +++ b/R/mod_review_forms.R @@ -125,6 +125,7 @@ mod_review_forms_server <- function( observe({ req(session$userData$review_records[[active_form()]]) + # browser() review_status <- review_data_active()[,c("id", "reviewed")] |> dplyr::rows_update(session$userData$review_records[[active_form()]][,c("id", "reviewed")], by = "id") |> diff --git a/R/mod_study_forms.R b/R/mod_study_forms.R index e1a4133..70105a8 100644 --- a/R/mod_study_forms.R +++ b/R/mod_study_forms.R @@ -209,8 +209,12 @@ mod_study_forms_server <- function( by = "id" ) |> dplyr::filter(!is.na(reviewed)) |> + dplyr::semi_join( + subset(r$review_data, subject_id == r$subject_id & item_group == form), + by = "id" + ) |> dplyr::anti_join( - subset(r$review_data, item_group == form), + subset(r$review_data, subject_id == r$subject_id & item_group == form), by = c("id", "reviewed") ) |> dplyr::arrange(id)