b Brian
on

 

We recently ran across an issue where a date was incorrectly generated like this: 2012-10-10T12:-- (Note the trailing dashes) It was caught on manual review, but I am surprised that check SD0003 did not fire, as this is not a valid ISO date.

Forums: SDTM

m Michael
on January 3, 2013

Which SDTM variable contained this value and how is it's datatype defined in the OpenCDISC config.xml file ?

b Brian
on January 3, 2013

Hi, It was AESTDTC, and I believe the dataType = DATETIME in the config.xml
s Sergiy
on January 3, 2013

Hi Brian, 

I cannot reproduce your issue. When using your value "2012-10-10T12:--", the validator generates the expected SD0003 Error message.

Could you provide more details about your process?

As Mike suggested, it could be a case when you use define.xml file, where a data type for your variable is not "datetime". However it might happened only in v1.2.

What is a variable name you validated?

Thank you, 

Sergiy

b Brian
on January 3, 2013

Hi, Thanks for the response. I did some additional testing, and it turns out that our date had only a single trailing dash, like: 2012-09-07T09:- If I add a second dash, I do get the SD0003 Error. We interpreted the ISO 8601 "appropriate right truncations" as there would be no trailing dash. Thanks, Brian
s Sergiy
on January 3, 2013

Yes, I confirm your finding now. It does not catch a value with a single trailing dash character.

Thank you!

We will check what's wrong.

Kind Regards, 

Sergiy

m Michael
on January 3, 2013

Good to hear.   When in doubt, copy and paste the regular expression into your favorite site or expression engine and test the value.  I used this for simplicity.

http://www.nvcc.edu/home/drodgers/ceu/resources/test_regexp.asp

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])?)?)?)?)?)?$

 

Test String

2012-10-10T12:-    pass

2012-10-10T12:--   fail

 

b Brian
on January 3, 2013

That was my first thought - I looked in the config xml file and did not see the regex there. Just because I am curious, where is the regex you have above? Thanks, Brian
m Michael
on January 3, 2013

Funny i did the same.  The config yields 

val:Regex ID="SD0003" Variable="%Variables[*DTC]%" Test="%Variable.Type.Regex%"

Whereas other types of Regex rules actually contain the literal regular expression in the config.   

The regular expression for DateTime can be found in the actual code, which is opensource and available at  http://svn.opencdisc.org/.   You can probably just do a search for XmlConfigurationParser.java and look in there.  

b Brian
on January 3, 2013

Thanks, I found it now. I appreciate the help- Thanks, Brian
s Sergiy
on January 3, 2013

^(-|[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])?)?)?)?)?)?(?<!\-)$

 

I added simple condition "and not ending with hyphen character". It looks like current Regex expression can handle our case as well. However we need to make more detailed testing.

Sergiy 

a Anthony
on January 4, 2013

I think these strings also return wrong results:

2013-00-00
2013-12-00
2013-01-01T24:59:59
- (note: just a single dash, just like you mentioned as it ends with a dash)
2013-- (note: just like you mentioned as it ends with a dash)

BTW, does it support the P durations, such as YYYY-MM-DDThh:mm:ss/PnYnMnDTnHnMnS and PnYnMnDTnHnMnS/YYYY-MM-DDThh:mm:ss?

s Sergiy
on January 4, 2013

There is a separate SD1011 check for durations.

s Sergiy
on January 8, 2013

Hi Anthony, 

Actually your examples are correct ISO 8601 format, but invalid date values.

It may be a separate check for invalid date. E.g.,"2012-00-00" or "2010-02-29".

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.