Can regex be used in an operation to generate the first second of the day (or last second) from a pure date? #124
JozefAerts
started this conversation in
General
Replies: 1 comment 1 reply
|
With SDTM data, we cannot make assumptions. Only collected values can be used. If no time is collected, we cannot assume/impute a time value for the observation. If the time was supposed to be collected at the time of observation, the EDC should enforce the rule and an edit check should catch this before preparation of the SDTM domains. The regex will not add a value to the DTC value but will filter: If you wish to add assumed values to your collected observation dates, you should do this in you own code and prior to evaluation with the CDISC Open Rules. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
For checking whether a collected data point (e.g. variable LBDTC), e.g. 2026-08-25T08:24 is between a start date and an end date like usually provided in SVSTDTC and SVENDTC (like 2026-08-23 and 2026-08-24) we need to transform the start date to 2026-08-23T00:00:00 (begin of day) and 2026-08-24T23:59:59.
As I understand it, this could e.g. be done using a regex:
$T00:00:00
or $T23:59:59
In https://cdisc-org.github.io/cdisc-open-rules/#/operations?id=record_count we find an example where something like that is used with "group", but it is not clear whether the "regex" can also be used without group, like in:
id: $xxx
regex: $T00:00:00
Otherwise I think I am going to write a function in Python taking care that "00"-s are added until it is a complete datetime, and anoth that takes care that a date (without time part) is transformed to the last second of the day by adding "T23:59:59".
Man thanks in advance!
Jozef
All reactions