Merck / Merck/metalite

`observation` cannot be extracted when `population` and `observation` names are the same

Open
#180 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
18
Forks
8
PR merge metrics
No merged PRs in 30d

Description

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")

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading collect_adam_mapping() and collect_observation_record(), then reproduce the supplied meta_adam() example with matching population and observation names. Done means the observation is resolved correctly without attempting to use population variables that are absent from data_observation.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.