data-definition-engine

pipeline — stages A-G from the study design to define.xml and the annotated CRF

cd src
python -m pipeline --study ../data/protocols/NCT01797120/pipeline.yaml [--from A] [--to G] [--strict] [--dry-run]
Stage Program (run in) Reads Writes
A create_define_json.py (define-xml/) USDM, CDISC Library, define-patch.yaml DDS1 (dds_define), define-patch-stageA.yaml
B loaders.crf.crf_loader (src/) DDS1, USDM, CRF specializations dds-crf.json, crf-refinement.yaml
C crf_generator.py (generators/crf/) dds-crf.json crf-2.0.xml
D crfutils crfvalidate, crfpdf crf-2.0.xml acrf.pdf (named by the DDS annotated CRF), acrf.pagerefs.json
E loaders.pagerefs (src/) dds-crf.json, pagerefs, CRF dds-origin.json, origin-review.yaml
F loaders.defaults (src/) dds-origin.json, the defaults dictionaries, define-patch.yaml dds-defaults.json, define-patch.yaml, defaults-report.yaml
G define_generator.py (generators/define/), then defineutils.validate dds-defaults.json define.xml

Stages A and B need a CDISC Library API key (CDISC_API_KEY, or a .env).

Tests

cd src/pipeline && pytest

10 tests with the stages stubbed: order, working folders, absolute paths, review files applied when present, stage A’s and stage F’s define patch paths, the defaults dictionaries, a failing stage stops the run, a failed validation is an open item, --from/--to, --strict, --dry-run.