cdisc-org / cdisc-rules-engine

Open source offering of the cdisc rules engine
MIT License
46 stars 12 forks source link

updated has_next_corresponding_record #818

Closed SFJohnson24 closed 1 month ago

SFJohnson24 commented 1 month ago

This rule skips for 2 reasons--one: I believe the rule needs to be edited.
Rule_underscores.json "Check": { "all": [ { "name": "SEENDTC", "operator": "does_not_have_next_corresponding_record", "ordering": "SESEQ", "value": "SESTDTC", "within": "USUBJID" } ] we want to order within seq, and not SESTDTC as the rule is currently written. This results in an error that I describe on the jira ticket. (see: https://jira.cdisc.org/browse/CORERULES-179) the second issue is the addition of NON in the old code. because we cannot compare the last row to the next column, we add NaN to match the number of rows. When the code tries to perform the not operator on NAN def does_not_have_next_corresponding_record(self, other_value: dict): return ~self.has_next_corresponding_record(other_value) we get an error. I changed the current operator to add True for the last value as, although we do not have a next row to compare for the last row, we can assume it is true.