Skip to content

feat: add Associated Persons (AP) domain support#133

Open
ankonyeni wants to merge 3 commits intopharmaverse:mainfrom
ankonyeni:feature/combine_supp-ap-support
Open

feat: add Associated Persons (AP) domain support#133
ankonyeni wants to merge 3 commits intopharmaverse:mainfrom
ankonyeni:feature/combine_supp-ap-support

Conversation

@ankonyeni
Copy link

Summary

Adds Associated Persons (AP) domain support to combine_supp and build_qnam

Changes

combine_supp

  • Detects whether the supp dataset uses APID or USUBJID and resolves id_var dynamically
  • Errors if both APID and USUBJID are present in the supp dataset
  • Errors if neither APID nor USUBJID are present in the supp dataset
  • Errors if both APID and USUBJID are present in the parent dataset
  • Validates that STUDYID, DOMAIN, and the resolved id_var are present in the parent dataset

combine_supp_join

  • Updated by key resolution to include APID alongside USUBJID

build_qnam

  • Detects whether the dataset uses APID or USUBJID and resolves id_var dynamically
  • Errors if both APID and USUBJID are present in the dataset
  • Errors if neither APID nor USUBJID are present in the dataset
  • Updated select, distinct, and output column to use resolved id_var
  • Updated ambiguity error message to reference the resolved id_var

Tests

New tests added for both combine_supp and build_qnam covering:

  • Happy path for both USUBJID and APID domains
  • Error cases for both/neither ID column scenarios
  • Required parent column validation
  • IDVAR column existence validation
  • Correct output structure, column names, and values for AP domains
  • Blank and NA IDVAR handling for subject-level records
  • Ambiguity error message referencing the correct ID column
  • Multiple subjects in AP datasets

@codecov-commenter
Copy link

codecov-commenter commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.99%. Comparing base (111fd3b) to head (3dd4a95).
⚠️ Report is 104 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #133      +/-   ##
==========================================
+ Coverage   82.19%   83.99%   +1.79%     
==========================================
  Files           7        7              
  Lines         691      831     +140     
==========================================
+ Hits          568      698     +130     
- Misses        123      133      +10     
Files with missing lines Coverage Δ
R/supp.R 79.16% <100.00%> (+8.44%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants