import pointblank as pb
vs = pb.get_sdtm_domain("vs")
print(vs.label, "|", vs.domain_class, "| repeating:", vs.repeating)
print(vs.natural_keys)Vital Signs | Findings | repeating: True
['STUDYID', 'USUBJID', 'VSTESTCD', 'VSDTC', 'VSTPTNUM']
Get the template for an SDTM domain.
Usage
Pointblank has templates for eight domains of the CDISC Study Data Tabulation Model (SDTM), based on the SDTM Implementation Guide (SDTMIG) 3.4. Each template is an SDTMDomainTemplate: the domain’s label and observation class, the variables that form its natural key, and an SDTMVariableSpec for each of its variables, giving the variable’s label, type, role, maximum length, controlled terminology and core designation. The templates are what validate_sdtm(), validate_sdtm_structure() and sdtm_to_metadata() work from.
The templates cover the common variables of each domain rather than every variable in the SDTMIG. Each call returns a new template object, so changing one doesn’t affect later calls.
domain: str"DM", "AE", "LB" or "VS". This is case-insensitive.
SDTMDomainTemplate KeyErrorlist_sdtm_domains().
Let’s get the template for the Vital Signs (VS) domain:
import pointblank as pb
vs = pb.get_sdtm_domain("vs")
print(vs.label, "|", vs.domain_class, "| repeating:", vs.repeating)
print(vs.natural_keys)Vital Signs | Findings | repeating: True
['STUDYID', 'USUBJID', 'VSTESTCD', 'VSDTC', 'VSTPTNUM']
VS is a Findings domain with many records per subject, one for each test at each time point, so its natural key includes the test code, the date-time and the time point number. The template’s properties list the variables by their core designation:
['STUDYID', 'DOMAIN', 'USUBJID', 'VSSEQ', 'VSTESTCD', 'VSTEST']
['VSORRES', 'VSORRESU', 'VSSTRESC', 'VSSTRESN', 'VSSTRESU', 'VSBLFL', 'VISITNUM', 'VSDTC']
The required variables must be in every VS dataset and can’t be null. The expected ones should be in the dataset but may be null, and the domain’s other variables are permissible: they’re included only when there is data for them.
List the domains that have a template.
The template that is returned.
Build a validation plan from an SDTM domain template.
The equivalent for ADaM datasets.