Skip to content

Commit

Permalink
Only review selected subject
Browse files Browse the repository at this point in the history
  • Loading branch information
jthompson-arcus committed Dec 5, 2024
1 parent a36d7cf commit a746b2e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
12 changes: 10 additions & 2 deletions R/mod_common_forms.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions R/mod_review_forms.R
Original file line number Diff line number Diff line change
Expand Up @@ -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") |>
Expand Down
6 changes: 5 additions & 1 deletion R/mod_study_forms.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a746b2e

Please sign in to comment.