csrlite 0.3.0__py3-none-any.whl → 0.3.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- csrlite/__init__.py +91 -110
- csrlite/ae/__init__.py +1 -1
- csrlite/ae/ae_listing.py +494 -494
- csrlite/ae/ae_specific.py +483 -483
- csrlite/ae/ae_summary.py +401 -401
- csrlite/ae/ae_utils.py +62 -62
- csrlite/cm/cm_listing.py +497 -497
- csrlite/cm/cm_summary.py +327 -327
- csrlite/common/config.py +34 -34
- csrlite/common/count.py +293 -293
- csrlite/common/parse.py +308 -308
- csrlite/common/plan.py +365 -365
- csrlite/common/rtf.py +166 -137
- csrlite/common/utils.py +33 -33
- csrlite/common/yaml_loader.py +71 -71
- csrlite/disposition/__init__.py +2 -2
- csrlite/disposition/disposition.py +332 -332
- csrlite/ie/{ie_summary.py → ie.py} +405 -292
- csrlite/pd/pd_listing.py +461 -461
- {csrlite-0.3.0.dist-info → csrlite-0.3.2.dist-info}/METADATA +68 -68
- csrlite-0.3.2.dist-info/RECORD +23 -0
- {csrlite-0.3.0.dist-info → csrlite-0.3.2.dist-info}/WHEEL +1 -1
- csrlite/ie/ie_listing.py +0 -109
- csrlite/mh/mh_listing.py +0 -209
- csrlite/mh/mh_summary.py +0 -333
- csrlite-0.3.0.dist-info/RECORD +0 -26
- {csrlite-0.3.0.dist-info → csrlite-0.3.2.dist-info}/top_level.txt +0 -0
csrlite/ae/ae_utils.py
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
from typing import Any
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def get_ae_parameter_title(param: Any, prefix: str = "Participants With") -> str:
|
|
5
|
-
"""
|
|
6
|
-
Extract title from parameter for ae_* title generation.
|
|
7
|
-
|
|
8
|
-
Args:
|
|
9
|
-
param: Parameter object with terms attribute
|
|
10
|
-
prefix: Prefix for the title (e.g. "Participants With", "Listing of Participants With")
|
|
11
|
-
|
|
12
|
-
Returns:
|
|
13
|
-
Title string for the analysis
|
|
14
|
-
"""
|
|
15
|
-
default_suffix = "Adverse Events"
|
|
16
|
-
|
|
17
|
-
if not param:
|
|
18
|
-
return f"{prefix} {default_suffix}"
|
|
19
|
-
|
|
20
|
-
# Check for terms attribute
|
|
21
|
-
if hasattr(param, "terms") and param.terms and isinstance(param.terms, dict):
|
|
22
|
-
terms = param.terms
|
|
23
|
-
|
|
24
|
-
# Preprocess to empty strings (avoiding None)
|
|
25
|
-
before = terms.get("before", "").title()
|
|
26
|
-
after = terms.get("after", "").title()
|
|
27
|
-
|
|
28
|
-
# Build title and clean up extra spaces
|
|
29
|
-
title = f"{prefix} {before} {default_suffix} {after}"
|
|
30
|
-
return " ".join(title.split()) # Remove extra spaces
|
|
31
|
-
|
|
32
|
-
# Fallback to default
|
|
33
|
-
return f"{prefix} {default_suffix}"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def get_ae_parameter_row_labels(param: Any) -> tuple[str, str]:
|
|
37
|
-
"""
|
|
38
|
-
Generate n_with and n_without row labels based on parameter terms.
|
|
39
|
-
|
|
40
|
-
Returns:
|
|
41
|
-
Tuple of (n_with_label, n_without_label)
|
|
42
|
-
"""
|
|
43
|
-
# Default labels
|
|
44
|
-
default_with = " with one or more adverse events"
|
|
45
|
-
default_without = " with no adverse events"
|
|
46
|
-
|
|
47
|
-
if not param or not hasattr(param, "terms") or not param.terms:
|
|
48
|
-
return (default_with, default_without)
|
|
49
|
-
|
|
50
|
-
terms = param.terms
|
|
51
|
-
before = terms.get("before", "").lower()
|
|
52
|
-
after = terms.get("after", "").lower()
|
|
53
|
-
|
|
54
|
-
# Build dynamic labels with leading indentation
|
|
55
|
-
with_label = f"with one or more {before} adverse events {after}"
|
|
56
|
-
without_label = f"with no {before} adverse events {after}"
|
|
57
|
-
|
|
58
|
-
# Clean up extra spaces and add back the 4-space indentation
|
|
59
|
-
with_label = " " + " ".join(with_label.split())
|
|
60
|
-
without_label = " " + " ".join(without_label.split())
|
|
61
|
-
|
|
62
|
-
return (with_label, without_label)
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def get_ae_parameter_title(param: Any, prefix: str = "Participants With") -> str:
|
|
5
|
+
"""
|
|
6
|
+
Extract title from parameter for ae_* title generation.
|
|
7
|
+
|
|
8
|
+
Args:
|
|
9
|
+
param: Parameter object with terms attribute
|
|
10
|
+
prefix: Prefix for the title (e.g. "Participants With", "Listing of Participants With")
|
|
11
|
+
|
|
12
|
+
Returns:
|
|
13
|
+
Title string for the analysis
|
|
14
|
+
"""
|
|
15
|
+
default_suffix = "Adverse Events"
|
|
16
|
+
|
|
17
|
+
if not param:
|
|
18
|
+
return f"{prefix} {default_suffix}"
|
|
19
|
+
|
|
20
|
+
# Check for terms attribute
|
|
21
|
+
if hasattr(param, "terms") and param.terms and isinstance(param.terms, dict):
|
|
22
|
+
terms = param.terms
|
|
23
|
+
|
|
24
|
+
# Preprocess to empty strings (avoiding None)
|
|
25
|
+
before = terms.get("before", "").title()
|
|
26
|
+
after = terms.get("after", "").title()
|
|
27
|
+
|
|
28
|
+
# Build title and clean up extra spaces
|
|
29
|
+
title = f"{prefix} {before} {default_suffix} {after}"
|
|
30
|
+
return " ".join(title.split()) # Remove extra spaces
|
|
31
|
+
|
|
32
|
+
# Fallback to default
|
|
33
|
+
return f"{prefix} {default_suffix}"
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def get_ae_parameter_row_labels(param: Any) -> tuple[str, str]:
|
|
37
|
+
"""
|
|
38
|
+
Generate n_with and n_without row labels based on parameter terms.
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
Tuple of (n_with_label, n_without_label)
|
|
42
|
+
"""
|
|
43
|
+
# Default labels
|
|
44
|
+
default_with = " with one or more adverse events"
|
|
45
|
+
default_without = " with no adverse events"
|
|
46
|
+
|
|
47
|
+
if not param or not hasattr(param, "terms") or not param.terms:
|
|
48
|
+
return (default_with, default_without)
|
|
49
|
+
|
|
50
|
+
terms = param.terms
|
|
51
|
+
before = terms.get("before", "").lower()
|
|
52
|
+
after = terms.get("after", "").lower()
|
|
53
|
+
|
|
54
|
+
# Build dynamic labels with leading indentation
|
|
55
|
+
with_label = f"with one or more {before} adverse events {after}"
|
|
56
|
+
without_label = f"with no {before} adverse events {after}"
|
|
57
|
+
|
|
58
|
+
# Clean up extra spaces and add back the 4-space indentation
|
|
59
|
+
with_label = " " + " ".join(with_label.split())
|
|
60
|
+
without_label = " " + " ".join(without_label.split())
|
|
61
|
+
|
|
62
|
+
return (with_label, without_label)
|