cdisc-org / cdisc-rules-engine

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

Can we have a function "invalid_duration"? #166

Closed JozefAerts closed 2 days ago

JozefAerts commented 1 year ago

In analogy with the function "invalid_date", can we have a function "invalid_duration", checking whether the value is a valid ISO-8601 duration (the "P-format")? We can probably do this by regular expressions, but I think this can better be implemented at the Python level, for reason of consistency (different people may use different regular expressions), and the regular expressions for "duration" are rather complex.

nickdedonder commented 2 months ago

@JozefAerts would there only be one rule that is using this? In that case it's better to create a regular expression. In case that there are multiple rules that would using this, a function can be created Can you give an example of an invalid duration because there are a lot of possibilities of correct durations? Negative durations for --DUR is already checked

ASL-rmarshall commented 1 month ago

@nickdedonder This operator would be helpful for several DDF/USDM rules too.