import pointblank as pb
import polars as pl
dm = pl.DataFrame({"STUDYID": ["STUDY01"], "USUBJID": ["STUDY01-001"], "SEX": ["F"]})
report = pb.validate_sdtmig({"DM": dm})
report.all_passed()False
Check whether the datasets conform, with nothing failing.
Usage
This gives a single answer for a conformance check, as is needed in a script or a pipeline that should stop when the data don’t conform. What counts as passing depends on the form of the report:
"fail". A failing rule of "Warning" sensitivity counts too. Rules that are not applicable or couldn’t be evaluated don’t. boolTrue if nothing failed, otherwise False.
Let’s check a DM dataset with the built-in rules:
import pointblank as pb
import polars as pl
dm = pl.DataFrame({"STUDYID": ["STUDY01"], "USUBJID": ["STUDY01-001"], "SEX": ["F"]})
report = pb.validate_sdtmig({"DM": dm})
report.all_passed()False
The dataset lacks many of the variables that DM requires, and the TS and TA datasets are missing, so some rules fail. The rules that fail can be listed with rules(), as in report.rules(status="fail").