# SD1011

**URL:** <https://forum.certara.com/t/sd1011/165>\
**Category:** Validation Rule Suggestions\
**Created:** [October 25, 2010, 12:34pm UTC](https://forum.certara.com/t/sd1011/165 "2010-10-25T12:34:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkanevsky](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@mkanevsky](https://forum.certara.com/u/mkanevsky)\
**Post date:** [October 26, 2010, 6:45pm UTC](https://forum.certara.com/t/sd1011/165/1 "2010-10-26T18:45:09Z")

</div>

Hi Staffan,

You are correct, rule SD1011 does not currently support intervals. I have updated the regular expression to support the following scenarios:

- PnYnMnDTnHnMnS or PnW
- YYYY-MM-DDThh:mm:ss/YYYY-MM-DDThh:mm:ss
- YYYY-MM-DDThh:mm:ss/PnYnMnDTnHnMnS
- PnYnMnDTnHnMnS/YYYY-MM-DDThh:mm:ss

I’m just not sure whether intervals could be used in all --DUR, --ELTM, and --EVLINT variables, or just --EVLINT. I’ll try to clarify this with someone from the SDTM team next week at the CDISC Interchange.

Here is the revised rule:

\<val:Regex ID=“SD1011” Variable=“%Variables[\*DUR,\*ELTM,\*EVLINT]%” Test=“(-?P((([0-9]+(.[0-9]+)?Y)?([0-9]+(.[0-9]+)?M)?([0-9]+(.[0-9]+)?D)?(T([0-9]+(.[0-9]+)?H)?([0-9]+(.[0-9]+)?M)?([0-9]+S)?)?)|[0-9]+(.[0-9]+)?W))|((((([0-9][0-9][0-9][0-9])((-(([0][1-9])|([1][0-2])))((-(([0][1-9])|([1-2][0-9])|([3][0-1])))(T((([0-1][0-9])|([2][0-3]))((:([0-5][0-9]))(((:([0-5][0-9]))((.[0-9]+)?))?)?)?((((+|-)(([0-1][0-9])|([2][0-3])):[0-5][0-9])|(Z)))?))?)?)?))/((([0-9][0-9][0-9][0-9])((-(([0][1-9])|([1][0-2])))((-(([0][1-9])|([1-2][0-9])|([3][0-1])))(T((([0-1][0-9])|([2][0-3]))((:([0-5][0-9]))(((:([0-5][0-9]))((.[0-9]+)?))?)?)?((((+|-)(([0-1][0-9])|([2][0-3])):[0-5][0-9])|(Z)))?))?)?)?)))|(((([0-9][0-9][0-9][0-9])((-(([0][1-9])|([1][0-2])))((-(([0][1-9])|([1-2][0-9])|([3][0-1])))(T((([0-1][0-9])|([2][0-3]))((:([0-5][0-9]))(((:([0-5][0-9]))((.[0-9]+)?))?)?)?((((+|-)(([0-1][0-9])|([2][0-3])):[0-5][0-9])|(Z)))?))?)?)?))/(((+|-)?P((((0-9?)Y)?((0-9?)M)?((0-9?)D)?)(T(((0-9?)H)?((0-9?)M)?((0-9?)((.[0-9]+)?)S)?)?)?|(((0-9?)W))))))|((((+|-)?P((((0-9?)Y)?((0-9?)M)?((0-9?)D)?)(T(((0-9?)H)?((0-9?)M)?((0-9?)((.[0-9]+)?)S)?)?)?|(((0-9?)W)))))/((([0-9][0-9][0-9][0-9])((-(([0][1-9])|([1][0-2])))((-(([0][1-9])|([1-2][0-9])|([3][0-1])))(T((([0-1][0-9])|([2][0-3]))((:([0-5][0-9]))(((:([0-5][0-9]))((.[0-9]+)?))?)?)?((((+|-)(([0-1][0-9])|([2][0-3])):[0-5][0-9])|(Z)))?))?)?)?))))” Message=“Invalid ISO 8601 value” Description=“Duration, Elapsed Time, and Interval values must conform to the ISO 8601 international standard.” Category=“Format” Type=“Error” Severity=“High”/\>

Let me know how this works out.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![Anthony\_Chow](https://avatars.discourse-cdn.com/v4/letter/a/b77776/32.png) [@Anthony\_Chow](https://forum.certara.com/u/Anthony_Chow)\
**Post date:** [November 3, 2010, 4:51pm UTC](https://forum.certara.com/t/sd1011/165/2 "2010-11-03T16:51:33Z")

</div>

If I am reading the regular expression above correctly, it appears to allow negative duration for --DUR variable. Unlike --ELTM and --EVLINT, --DUR answers “how long did something last?”. Therefore, I would imagine only positive measurements would be logical.

Also, SDTMIG v3.1.2 section 4.1.4.3.1 addresses the validity of this notation for duration: YYYY-MM-DDThh:mm:ss/YYYY-MM-DDThh:mm:ss. Of which, I interpret as not permitted in SDTM (Note: That’s not to say we can’t use it in --\*DTC variables to express uncertainty).

Thoughts?

---

<div class="post-metadata">

**Author:** ![Staffan\_Palerius](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@Staffan\_Palerius](https://forum.certara.com/u/Staffan_Palerius)\
**Post date:** [October 25, 2010, 12:34pm UTC](https://forum.certara.com/t/sd1011/165/3 "2010-10-25T12:34:04Z")

</div>

I believe this rule is wrong:

\<val:Regex ID=“SD1011” Variable=“%Variables[\*DUR,\*ELTM,\*EVLINT]%” Test=“-?P((([0-9]+Y)?([0-9]+M)?([0-9]+D)?(T([0-9]+H)?([0-9]+M)?([0-9]+S)?)?)|[0-9]+W)” Message=“Invalid ISO 8601 value” Description=“Duration, Elapsed Time, and Interval values must conform to the ISO 8601 international standard.” Category=“Format” Type=“Error” Severity=“High”/\>

Why?

I have

CEEVLINT = ‘2010-06-03T08:41:58/2010-06-03T13:00:21’  
and  
ZBEVLINT = ‘2010-06-03T08:56:00/2010-06-03T12:56:00’

I get an ERROR for ZBEVLINT but not for CEEVLINT. CEEVLINT passes this rule:

but ZBEVLINT is not predefined as CEEVLINT, so it get stuck in the first rule above that demands a date format (ISO 8601).

The same rule expect a duration to be in ISO 8601?
