siera 0.5.6
CRAN release: 2026-06-17
- Added formatted results to generated ARDs. Each ARD row now carries
res(the raw statistic flattened to numeric),pattern(the ARSresultPatternfor the row’s operation) anddisp(the printable, table-ready formatted value, e.g.(N=86), honouring the pattern’s decimal count and prefix/suffix).cardsproportions (stat_name == "p") are multiplied by 100 before formatting, matching the percentage semantics of result patterns. Rounding follows the clinical-reporting norm of rounding halves away from zero (the SASROUND()convention, e.g.1.369becomes1.4and2.5becomes3) rather than R’s default round-half-to-even, sodispaligns with SAS-generated reference tables; the rawresvalue is left unrounded. Thecards-internalfmt_fun/fmt_fnformat-function list-columns, which previously surfaced as unprintable values, are dropped from the final ARD (#167). - Added support for resolving a method’s code template from an external reference instead of inline ARS metadata. When a method’s
codeTemplatecarries adocumentRef(rather than inlinecode),readARS()now follows the ARSreferenceDocumentschain to load the template - and, where the method declares none inline, its parameters - from either a siera method manifest (a.jsonsuperset ofmethod.jsoncarryingtemplateCode+parameters, with a method selected by apageRefsnamed destination = the methodid) or a bare.R/.txtcode file. Resolution is transparent: adocumentRefARS generates the same script as its inline equivalent. The whole method library now also ships as one referenceable catalog,inst/method-library/method-library.json, and new bundled examples (exampleARS_5_documentref.json/.xlsx+exampleARS_methods.json) demonstrate the mechanism. v1 resolves local paths only (relative to the ARS file, or absolute); remote URLs are rejected. JSON and XLSX inputs are supported with parity (via the XLSXReferenceDocumentsandAnalysisMethodDocumentRefssheets) (#175). - Added
method_library(), an exported accessor that lists the bundled analysis-method templates and resolves a method’s files on disk (parallel toARS_example()). - Added a plain-text, testable analysis-method template library under
inst/method-library/(onemethod.json+template.Rper method, plus a reconciledconstructs.jsonvalueSource registry and a generatedMETHODS.mdcatalog). This becomes the reviewable, diff-able source of truth for the code-template recipes that drive ARD generation; its methodids are intended as stable keys an ARS file can reference. A contract test validates every recipe on each run (templates parse, only supported valueSources are referenced, no orphan tokens, no duplicatedcase_whenmappings, and the human-readable catalog stays in sync). Introduced an internal.supported_value_sources()helper as the declared valueSource contract. The legacyinst/extdata/R_siera_codes.xlsxandcards_constructs.xlsxare left untouched (#173). - Added support for per-category risk differences. A new method template computes one risk difference and 95% confidence interval for each data-driven inner category (e.g. one per preferred term or system organ class) by looping over the second grouping and calling
cardx::ard_stats_prop_test()within each, instead of collapsing the analysis to a single overall risk difference (#157). - Added per-category risk differences for pre-defined (non-data-driven) inner groupings. A new method template,
risk_difference_per_predefined_group, honours the groups declared in the ARS metadata instead of looping observed data values: every defined group is emitted - a group whose condition matches no events yields a risk difference of0with a[0, 0]confidence interval - and data values matching no defined group are excluded. It is driven by a newAG_var2_group_valuesvalueSource that resolves the second grouping’s group condition values, in group order (single-valueEQconditions; other comparators are skipped with a warning). Validated on the eTFL “Overview of Adverse Events” table (one risk difference per action taken and per severity) against an independentstats::prop.test()recomputation; the published reference matches on category shape and empty groups, but its non-zero values were found to be computed from only the first adverse-event record per subject rather than from all qualifying events, so they are not used as the value oracle (#171). - Added per-(category x category) risk differences for analyses with two data-driven inner groupings, such as one risk difference per system organ class and preferred term combination. A new method template,
risk_difference_per_group_pair, loops the distinct combinations of the second and third grouping variables observed in the analysis subset, computes each risk difference withcardx::ard_stats_prop_test(), and stamps both category levels onto the ARD rows. It reuses the existingAG_var3valueSource, so no change toreadARS()was required. Validated on the eTFL “Adverse Events by System Organ Class and Preferred Term” table against an independentstats::prop.test()recomputation over every observed combination (#172). - Fixed zero-event risk-difference analyses returning
NAinstead of0. Methods that compute over the full population (templates referencingdf_poptot, e.g. risk differences) now bypass the empty-data subset guard, so an analysis with no events emits the conventional risk difference of0with a[0, 0]confidence interval (#156). - Accepted SAS transport (
.xpt) ADaM datasets in addition to CSV.readARS()chooses the reader for each ADaM dataset from its file extension (.csvviareadr::read_csv(),.xptviahaven::read_xpt()), with no new argument; the file lookup is case-insensitive so lower-case submission file names (e.g.adsl.xpt) match upper-case ARS dataset names. Reading.xptrequires thehavenpackage. - Fixed
readARS()crash when ARS metadata contains noreferencedAnalysisOperations(continuous-only tables such as shift tables) by ensuring accumulator frames are initialised with their merge key columns. - Normalised Windows backslashes in ADaM file paths to forward slashes so generated scripts run correctly on both Windows and Unix systems.
- Added CDISC ARD-compliant column stamping: generated scripts now write
group[n]_groupingId,group[n]_groupId(for pre-defined groups) andgroup[n]_groupValue(for data-driven groupings) onto each ARD row. - Supported arbitrarily deep nesting in
mainListOfContentsvia a recursive LOPA extraction helper, removing the previous three-level hard limit. - Expanded support for multi-value ARS group conditions (
IN/NOTIN) by unnestingcondition.valuelist columns in the JSON parser. - Coerced
*_levelcolumns to character on each individual ARD frame beforebind_rows, preventing type conflicts between continuous and categorical analyses. - Allowed more than three grouping factors per analysis.
- Updated bundled
cards_constructs.xlsxexample file and extended test coverage across metadata parsing, ADaM loading, and ARD script generation.
siera 0.5.5
CRAN release: 2025-12-01
- Strengthened analysis method validation with clear errors for missing or undefined
MethodIdvalues and warnings when method templates or parameter value sources cannot be resolved. - Added guardrails for analysis set generation that warn on missing or incomplete metadata and fall back to the unfiltered analysis dataset when needed.
- Tightened ARS metadata ingestion by requiring
analysisSetsdefinitions in JSON and the analysis code template sheets in Excel workbooks. - Expanded test coverage for analysis methods, analysis sets, and data subset condition handling to capture more metadata edge cases.
siera 0.5.4
CRAN release: 2025-09-25
- Comprehensive testing added: checking generated ARD result values
- added warning messages with cli()
- cover scenarios for bigN vs table-level subsetting
siera 0.5.3
CRAN release: 2025-08-28
- Cover scenario of multi-value DataSubsets
- Cover scenario of overlapping variables in ADSL merge
