Compares a built ADaM dataset - such as one produced by an 'admiral' pipeline

  • against its metadata and emits R4SUB evidence rows about conformance. The checks are computed directly from the dataset and metadata, so they work whether or not the dataset was passed through 'xportr' or 'metatools'.

adam_to_evidence(
  data,
  metadata,
  ctx,
  dataset_name = NULL,
  source_name = "adam",
  source_version = NULL
)

Arguments

data

A data.frame: one ADaM dataset.

metadata

A Metacore object or a data.frame accepted by as_variable_metadata().

ctx

An r4subcore::r4sub_run_context providing run and study identifiers.

dataset_name

Character or NULL. Which dataset in metadata to check data against. May be omitted when the metadata covers a single dataset.

source_name

Character. Label recorded as the evidence source. Default "adam".

source_version

Character or NULL. Optional version label.

Value

A data.frame conforming to the R4SUB evidence schema.

Details

Four indicators are evaluated:

T-ADAM-001

Each variable described in the metadata is present in the dataset (traceability).

T-ADAM-002

Each dataset column is described in the metadata; columns that are not are flagged (traceability).

Q-ADAM-001

Present variables have the data type family the metadata specifies (quality).

Q-ADAM-002

Present variables carry a non-empty label attribute (usability).

Examples

# Check the CDISC pilot ADSL from pharmaverseadam against the ADaM metadata
# shipped in r4subdata.
ctx <- suppressMessages(r4subcore::r4sub_run_context("CDISCPILOT01", "DEV"))
ev  <- suppressMessages(adam_to_evidence(
  pharmaverseadam::adsl,
  r4subdata::adam_metadata,
  ctx,
  dataset_name = "ADSL"
))
table(ev$indicator_id, ev$result)
#>             
#>              fail pass warn
#>   Q-ADAM-001    0   15    0
#>   Q-ADAM-002    0   15    0
#>   T-ADAM-001    1   15    0
#>   T-ADAM-002    0    0   40