j Jörg Martin
on

 

The rule SD0003, which checks for correct ISO8601 date strings is based on a regular expression, which is incomplete and does not cover all valid ISO8601 strings.

 

ISO8601 allows for a timezone expression, which indicates the difference between local time an UTC. This is indicated by "+/-hhmm" or "+/-hh:mm". Reference: ISO 8601 2004 standard at paragraph 4.2.5 (page 17-18). An example: "2009-09-23T00:00:00+01:00" .

 

The OpenCDISC validation does NOT cover this. Rule SD0003 is based on this regular expression:
"^(-|[0-9]{4})(-(-|0[0-9]|1[0-2])(-(-|[0-2][0-9]|3[0-1])(T(-|[0-1][0-9]|2[0-4])(:(-|[0-5][0-9])(:[0-5][0-9])?)?)?)?)?(/(-|[0-9]{4})(-(-|0[0-9]|1[0-2])(-(-|[0-2][0-9]|3[0-1])(T(-|[0-1][0-9]|2[0-4])(:(-|[0-5][0-9])(:[0-5][0-9])?)?)?)?)?)?$"
This regex does not include such a timezone expression.

 

An improvement for this would be:
"^(-|[0-9]{4})(-(-|0[0-9]|1[0-2])(-(-|[0-2][0-9]|3[0-1])(T(-|[0-1][0-9]|2[0-4])(:(-|[0-5][0-9])(:[0-5][0-9])?)?)?)?)?(/(-|[0-9]{4})(-(-|0[0-9]|1[0-2])(-(-|[0-2][0-9]|3[0-1])(T(-|[0-1][0-9]|2[0-4])(:(-|[0-5][0-9])(:[0-5][0-9])?)?)?)?)?)?((\\+|-)([0-9]{2})(:?([0-9]{2}))?)?$"
This would at least cover this issue, but it is far from a complete implementation of ISO8601.

Forums: SDTM

m Max
on April 20, 2010

Hi Jörg,

You are correct, the Validator ISO8601 check does not currently allow for timezone expressions. The timezone is a valid part of ISO 8601, but for some reason it's not mentioned as a valid expression in the SDTMIG. I have just posted a question on the CDISC forum to clarify the use of timezone in SDTM. If CDISC confirms that timezones are ok, we will update the regex in the Validator to allow such date/time values.

Thanks for your feedback,
Max

s Steve
on August 31, 2012

Thanks Joerg for your suggestion adding the timezone portion. However I can't find in the .xml file where the original regular expression is.  The only thing I see in the <val:ValidationRules> section for SD0003 is Test="%Variable.Type.Regex%"

Want a demo?

Let’s Talk.

We're eager to share and ready to listen.

Cookie Policy

Pinnacle 21 uses cookies to make our site easier for you to use. By continuing to use this website, you agree to our use of cookies. For more info visit our Privacy Policy.