Gilead-BioStats / gsm

Good Statistical Monitoring R Package
https://gilead-biostats.github.io/gsm/
Apache License 2.0
39 stars 9 forks source link

Feature: Adding Screened, Eligible, Ineligble, Active, Completed, and Discontinued to dfGroups #1773

Closed taylorrodgers closed 3 weeks ago

taylorrodgers commented 2 months ago

Summary

We'd like to amend both both the data model for dfGroups and gsm::reportingGroups to include the following params:

Background

These params are reported in gsmApp. We have ParticipantCount, which is reported as Enrolled in the report, but not these other variables.

Example Code

Ideally, these params would appear when running the following code:

gsm::reportingGroups %>% 
filter(GroupLevel == "Site") %>% 
distinct(Param)
samussiah commented 2 months ago

Relevant code in {gsmApp}:

    # ---- demographics
    dfSUBJ <- reactive({
      get_domain(
        snapshot,
        "dfSUBJ",
        "strSiteCol",
        site()
      )
    })

    # ---- study disposition
    dfSTUDCOMP <- reactive({
      get_domain(
        snapshot,
        "dfSTUDCOMP",
        "strIDCol",
        dfSUBJ()$data[[dfSUBJ()$mapping$strIDCol]]
      )
    })

    ### Participant Status Functions
    participant_list <- reactive({
      list(
        screened = list(
          eligible = sum(dfSUBJ()$data$enrollyn == "Y"),
          ineligible = sum(dfSUBJ()$data$enrollyn == "N")
        ),
        enrolled = list(
          completed = sum(dfSTUDCOMP()$data$compyn == "Y"),
          discontinued = sum(dfSTUDCOMP()$data$compyn == "N"),
          active = sum(!c(dfSTUDCOMP()$data$compyn %in% c("Y", "N")))
        ),
        discontinued_reasons = dfSTUDCOMP()$data$compreas
      )
    })
samussiah commented 2 months ago

This functionality should go into a data domain-level module built on dfSTUDCOMP.

jwildfire commented 3 weeks ago

I don't think this belongs in {gsm}. We can revisit as a custom gsmApp Module as mentioned above