Skip to main content

get_adam_dataset()

Get the template for a type of ADaM dataset.

Usage

Source

get_adam_dataset(name)

Pointblank has templates for four types of CDISC Analysis Data Model (ADaM) dataset: ADSL (the subject-level analysis dataset), BDS (the Basic Data Structure, used by datasets such as ADVS and ADLB), ADAE (adverse events) and ADTTE (time to event). Each template is an ADaMDatasetTemplate: the dataset’s label and class, the variables that form its natural key, and an ADaMVariableSpec for each of its variables. The templates are what validate_adam(), validate_adam_structure() and adam_to_metadata() work from.

The templates cover the common variables of each type of dataset rather than every variable that the ADaM Implementation Guide describes. Each call returns a new template object, so changing one doesn’t affect later calls.

Parameters

name: str
The template name: "ADSL", "BDS", "ADAE" or "ADTTE". This is case-insensitive.

Returns

ADaMDatasetTemplate
The template for the dataset.

Raises

KeyError
If there is no template with that name. The error message lists the templates, as does list_adam_datasets().

Examples

Let’s get the template for the subject-level analysis dataset:

import pointblank as pb

adsl = pb.get_adam_dataset("adsl")

print(adsl.label)
print(adsl.natural_keys)
print(adsl.required_variables)
Subject Level Analysis Dataset
['STUDYID', 'USUBJID']
['STUDYID', 'USUBJID', 'SUBJID', 'SITEID', 'TRT01P']

ADSL has one record per subject, so the study and subject identifiers are its natural key. Besides the identifiers, the planned treatment TRT01P is required. The template also lists the population flags:

adsl.population_flags
['SAFFL', 'ITTFL', 'EFFFL', 'RANDFL', 'ENRLFL', 'PPROTFL', 'COMPLFL']

These flags (safety, intent-to-treat, efficacy and so on) are conditionally required or permissible, and validate_adam() checks that the ones in a dataset hold only "Y" and "N".

See Also

list_adam_datasets()

List the dataset templates.

ADaMDatasetTemplate

The template that is returned.

validate_adam()

Build a validation plan from an ADaM dataset template.

get_sdtm_domain()

The equivalent for SDTM domains.