Lex Jansen's public Github repository for CDISC 360i Proof of Concepts.
This project consists of example programs to try out steps in the 360i pipeline.
Here's the official CDISC 360i repository
Note: The Windows commands provided in this README are written for PowerShell. While most commands are compatible with both PowerShell and Command Prompt, some adjustments may be necessary when using Command Prompt. If you encounter any issues running these commands in Command Prompt, try using PowerShell or consult the Command Prompt documentation for equivalent commands.
These programs are designed to function as command-line applications that can run as standalone applications or can be chained together to function as a pipeline of sorts. Everything in this repo should be considered sandbox development work in support of the 360i program.
bc_dss2crf:
- cdash_poc_odm20.py: script to create ODM XML v2.0 XML, CRFs in HTML, and annotated CRFs in HTML.
- cdash_poc_odm132.py: script to create ODM XML v1.3.2 XML, CRFs in HTML, and annotated CRFs in HTML.
The scripts use the odmlib Python library. A good introduction to this library can be found in Sam Hume's "Using odmlib to Create ODM and Define-XML Tools in Python" paper and presentation.
config:
- config.py loads the configuration settings
- config.ini: configuration settings withy relative paths (copy of config-relative-paths.ini)
- config-relative-paths.ini, config-absolute-paths.ini: templates for configuration settings. Either copy config-relative-paths.ini to config.ini, or copy config-absolute-paths.ini to config.ini, and edit the paths to match your environment.
crf: Output folder for generated CRF files. Every form will get it's own subfolder.
crf/examples: ZIP files with output examples
metadata: Metadata used by the scripts.
- cdisc_collection_dataset_specializations_draft.xlsx: Collection Dataset Specialization metadata. Generated from the draft CDISC Collection Dataset Specializations (see: https://github.com/cdisc-org/COSMoS/tree/main/curation/draft).
- cdisc_collection_forms.xlsx: Forms metadata.
odmlib:
- Updates to the odmlib library to support the final ODM v2.0 schema. These updates are intended to be merged with the odmlib library at https://github.com/swhume/odmlib.
schema:
- XML Schema files to validate ODM XML v1.3.2 and v2.0 files.
stylesheet:
- XSLT stylesheets to convert ODM XML CRF files to HTML CRFs and annotated CRFs.
utilities:
- Utilities used by scripts to create directories, validate XML, convert XML to HTML.
-
Clone the repository:
git clone https://github.com/lexjansen/cdisc360i-pocs.git
-
Create a virtual environment:
python -m venv <virtual_environment_name>
NOTE: if you have multiple versions of python on your machine, you can call python 3.12 for the virtual environment's creation instead of the above command:
python3.12 -m venv <virtual_environment_name>
-
Activate the environment:
Linux:source <virtual_environment_name>/bin/activate
Windows:<virtual_environment_name>/Scripts/Activate
-
Install requirements:
python -m pip install -r requirements.txt
Parameters for the cdash_poc_odm20.py
and cdash_poc_odm132.py
scripts:
--help Show the parameters
-f, --form TEXT The ID of the collection form to process
-p, --prefix TEXT The lowercase prefix to use for the output filenames.
When not specified, the collection lowercase form ID will be used.
The following command-line example uses Collection Dataset Specializations and Forms metadata (VS1) to generate an ODM v2.0 XML CRF, and HTML renditions of the CRF and annotated CRF in the crf/VS1 folder.:
python ./bc_dss2crf/cdash_poc_odm20.py -f VS1 -p vital_signs
The following command-line example does the same, but then for ODM v 1.3.2:
python ./bc_dss2crf/cdash_poc_odm132.py -f VS1 -p vital_signs
This project uses the MIT
license (see
LICENSE
) for code and scripts.