Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cdisc_rules_engine/models/sdtm_dataset_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def is_split(self) -> bool:
def is_ap(self) -> bool:
"""
Returns true if APID variable exists in first_record for non-supp datasets,
or if rdomain is exactly 4 characters and starts with AP for supp datasets.
or if the dataset name starts with AP for non-supp datasets,
or if rdomain starts with AP for supp datasets.
"""
if self.is_supp:
return (
Expand All @@ -80,7 +81,10 @@ def is_ap(self) -> bool:
and self.rdomain.startswith("AP")
)
first_record = self.first_record or {}
return "APID" in first_record
if "APID" in first_record:
return True

return self.name.startswith("AP")

@property
def ap_suffix(self) -> str:
Expand Down
Loading