Please join your peers on either March 26 (8pm GMT) or March 28 (8am GMT) to watch as user extraordinaire and forum legend @"lindsay.stevens" demonstrates OpenClinica Insight.

See preview and register at

Insight makes it easy to ask questions of ALL of your clinical and operational data and visualize answers via interactive reports and dashboards. The idea is simple, but the results are powerful: ask your questions, choose your visualizations, then return often for updated, interactive results that link you to all of the underlying data.

Creating a rule to input month of diagnosis

I need help with writing a rule. I have a column in my CRF for capturing the month of diagnosis. However my client wants me to incorporate a rule wherein if the month of diagnosis is unknown they must be able to enter Unk for the month. How can I create a rule wherein I restrict the data entry person from only entering 1-12 for the month and as well as enter Unk if month of diagnosis is not available. I plan on keeping the data type as String but I want to incorporate these rules so that the data entry person does not randomly enter any number. Please help


  • ebsebs Posts: 119 ✭✭
    You can do that by adding a regular expression in the validation column of the data item
  • e74813e74813 Posts: 9

    I have a Month/Year of diagnosis column in my CRF. How do I tweak the PDATE datatype so that OpenClinica allows me to input UNK-YYYY (incase the month of diagnosis is unknown)? Can you help me with writing the regular expression. Think i was unclear in my previous post. This is what i am needing.
  • GerbenRienkGerbenRienk Posts: 772 ✭✭✭
    What do you think of:
    regexp: /(UNK|Jan|Feb|etc)-[0-9]{4}/
    Kind regards,
    Gerben Rienk
  • e74813e74813 Posts: 9

    Can we add an expression to the year portion so that it doesn't accept 0000-9999 for the year. I want it to only accept 1900-2029. Just incase the data entry person mistyped. Anything we can add to the above expression to prevent that instance.
  • GerbenRienkGerbenRienk Posts: 772 ✭✭✭
    That would be
    regexp: /(UNK|Jan|Feb|etc)-(19[0-9]{2}|20[0-2][0-9])/
    A great site to test these regular expressions is and if you're old-school like myself you use the "original" one:
Sign In or Register to comment.