Skip to content

observation cannot be extracted when population and observation names are the same #180

Description

@fukuhiro2023

collect_adam_mapping() searches keywords in the following order: population > observation > parameter > analysis. Therefore, when population and observation are defined with the same name, population is prioritized in variable lookup. As a result, if variables specified in var of population do not exist in data_observation, an error occurs.

This may cause an error in collect_observation_record(). For example:

meta <- meta_adam(population = adsl, observation = adae) |>
  define_plan(plan = plan(analysis = "ae_forest_plot",
                          population = "apat",
                          observation = "apat",
                          parameter = "any-AE"           
  )) |>
  define_population(name = "apat",
                    group = "TRTA",
                    subset = SAFFL == "Y" ,
                    label = "All Participants as Treated Population",
                    var = c("USUBJID", "TRTA", "RACE", "SEX", "AGE", "AGEU")) |>
  define_observation(name = "apat",
                     group = "TRTA",
                     subset = SAFFL == "Y" ,
                     label = "All Participants as Treated Population") |>
  define_analysis(name = "ae_forest_plot",
                  label = "Interactive AE Forest Plot") |>
  define_parameter(name = "any-AE",
                   subset = SAFFL == "Y",
                   label = "Any AEs",
                   var = "AEDECOD", soc = "AEBODSYS", term1 = "", term2 = "") |>
  meta_build()

collect_observation_record(meta, "apat", "apat", "any-AE")

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions