Package 'definecore'

Title: Generate CDISC Define-XML from Metacore Objects
Description: 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.
Authors: Shakhar Eranna Chalwadi [aut, cre]
Maintainer: Shakhar Eranna Chalwadi <[email protected]>
License: MIT + file LICENSE
Version: 0.1.1
Built: 2026-11-05 01:30:15 UTC
Source: https://github.com/cran/definecore

Help Index


Write Define-XML from a metacore object

Description

Generates a CDISC Define-XML (version 2.0 or 2.1) document from a metacore metadata object. The output is an ODM-based XML file containing dataset (ItemGroupDef), variable (ItemDef), codelist, and derivation (MethodDef) metadata suitable as a starting point for regulatory submissions.

Usage

write_define_xml(
  meta,
  file,
  define_version = c("2.1", "2.0"),
  study_oid = NULL,
  study_name = "STUDY",
  study_description = "Study Description",
  protocol_name = study_name,
  standard_name = NULL,
  standard_version = NULL,
  file_oid = NULL,
  origin_default = "Derived",
  quiet = FALSE
)

Arguments

meta

A metacore object (R6 class).

file

Character string. Path to the output define.xml file.

define_version

Character. "2.0" or "2.1". Default "2.1".

study_oid

Character. ODM Study OID. Default generated.

study_name

Character. Study name for GlobalVariables.

study_description

Character. Study description.

protocol_name

Character. Protocol name. Defaults to study_name.

standard_name

Character. Name of the content standard (e.g., "SDTM-IG", "ADaM-IG"). Used for Define-XML 2.1 def:Standard.

standard_version

Character. Version of the content standard.

file_oid

Character. ODM FileOID. Default generated.

origin_default

Character. Default origin if missing (e.g., "Derived").

quiet

Logical. Suppress messages. Default FALSE.

Value

Invisibly returns the path to the written file.

Examples

library(metacore)
load(metacore_example("pilot_ADaM.rda"))  # loads object named 'metacore'
tmp <- tempfile(fileext = ".xml")
write_define_xml(metacore, tmp, study_name = "CDISCPILOT01")
unlink(tmp)