import sys
from pathlib import Path
import polars as pl
sys.path.insert(0, 'src')
from rtflite import LibreOfficeConverter
try:
converter = LibreOfficeConverter()
except Exception:
converter = None
print("WARNING: LibreOffice not found. PDF conversion will be skipped.")8 IE Listing
Objectives
This guide demonstrates Inclusion/Exclusion (IE) listing showing detailed protocol deviations.
8.1 Setup
from csrlite import load_plan, study_plan_to_ie_listing
from csrlite.ie.ie_listing import ie_listing_df, ie_listing_rtf8.2 IE Listing Analysis
The IE listing details individual subject deviations.
8.3 StudyPlan-Driven Workflow
study_plan = load_plan("studies/xyz123/yaml/plan_xyz123.yaml")
study_plan.get_plan_df().filter(pl.col("analysis") == "ie_listing")2026-02-03 15:26:58,784 - csrlite.common.plan - INFO - Successfully loaded dataset 'adsl' from 'studies/xyz123/yaml/../../../data/adsl.parquet'
2026-02-03 15:26:58,787 - csrlite.common.plan - INFO - Successfully loaded dataset 'adae' from 'studies/xyz123/yaml/../../../data/adae.parquet'
2026-02-03 15:26:58,789 - csrlite.common.plan - INFO - Successfully loaded dataset 'adie' from 'studies/xyz123/yaml/../../../data/adie.parquet'
2026-02-03 15:26:58,790 - csrlite.common.plan - INFO - Successfully loaded dataset 'adpd' from 'studies/xyz123/yaml/../../../data/adpd.parquet'
shape: (1, 5)
| analysis | population | observation | parameter | group |
|---|---|---|---|---|
| str | str | str | str | str |
| "ie_listing" | "discon" | null | null | null |
output_files = study_plan_to_ie_listing(study_plan)studies/xyz123/rtf/ie_listing_discon.rtf
8.3.1 ie_listing_scrfail
8.4 Complete Pipeline
adsl = pl.read_parquet("data/adsl.parquet")
# adie = pl.read_parquet("data/adie.parquet") # Not used in current simple listing
# Process for listing (simpler pipeline than summary)
df = ie_listing_df(adsl)
ie_listing_rtf(
df,
"studies/xyz123/rtf/ie_listing_manual.rtf",
title=[
"Listing of Protocol Deviations",
"(Inclusion/Exclusion)"
]
)studies/xyz123/rtf/ie_listing_manual.rtf