Generate CDISC Define-XML from Metacore Objects

Generates CDISC Define-XML documents (versions 2.0 and 2.1) from metacore metadata objects. Maps dataset, variable, codelist, and derivation information into an ODM-based Define-XML structure suitable for further review and regulatory use. Integrates with the pharmaverse metacore ecosystem.


definecore

Generate submission-ready CDISC Define-XML 2.0 / 2.1 documents from metacore objects.

Installation

# Once on CRAN
install.packages("definecore")

# Development version
# remotes::install_github("shekharchalwadigrepo-hub/definecore")

Usage

library(definecore)
library(metacore)

# Load example metacore object
load(metacore_example("pilot_ADaM.rda"))  # loads object named 'metacore'

# Or from define.xml
# meta <- define_to_metacore("path/to/define.xml")

# Generate Define-XML 2.1
write_define_xml(
  metacore,
  file = "define.xml",
  define_version = "2.1",
  study_name = "CDISCPILOT01",
  study_description = "CDISC Pilot Study",
  standard_name = "ADaM-IG",
  standard_version = "1.1"
)

Features

  • Consumes metacore R6 objects (ds_spec, ds_vars, var_spec, value_spec, codelist, derivations)
  • Generates ODM / Define-XML structure
  • Supports Define-XML 2.0 and 2.1 (with def:Standards)
  • Maps datasets to ItemGroupDef, variables to ItemDef + ItemRef
  • Handles codelists, derivations (MethodDef), origins
  • Designed for pharmaverse integration

Limitations (v0.1.0)

This is an initial release focused on core metadata mapping. Full production use for regulatory submissions may require:

  • Complete value-level metadata (WhereClauseDef, ValueListDef)
  • Document leaves / Annotated CRF / Supplemental Docs
  • Analysis Results Metadata (ARM)
  • Full schema validation against CDISC XSDs
  • Custom OID conventions
  • HTML transformation (define.html)

Contributions welcome to expand coverage.

Related Packages

  • metacore: Metadata container
  • metatools: Dataset building & checks
  • defineR: Spreadsheet-driven Define-XML (experimental)

License

MIT

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("definecore")

0.1.1 by Shakhar Eranna Chalwadi, 13 hours ago


https://github.com/shekharchalwadigrepo-hub/definecore


Report a bug at https://github.com/shekharchalwadigrepo-hub/definecore/issues


Browse source code at https://github.com/cran/definecore


Authors: Shakhar Eranna Chalwadi [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports metacore, xml2, dplyr, rlang, cli, glue, magrittr

Suggests testthat, knitr, rmarkdown


See at CRAN