What are my options for defining a subject's number format?

If you allow site users to enter subject numbers, you must define the subject number format. This ensures consistency for all subject numbers assigned in a study. When defining this format, you have several options.

The subject number format settings are defined using a textural description of the allowed characters in the subject number (also known as a regular expression). You can specify the characters allowed at each position of the subject number, moving from left to right. For example, you can use the expression [0-9] to indicate that this position allows a single digit between 0 and 9. In this way, you can specify the format for a multi-digit subject number as [0-9] [0-9] [0-9], which means the subject number must be specified as a 3-digit number ranging from 000 to 999. For example, subject numbers such as 123, 001, and 998 are all valid for this format.

In addition to this simple example, the subject number format also allows alphabetic characters and the dash (-) character. This allows you to create more complex subject number formats. Let’s build on our previous example, [0-9] [0-9] [0-9]. For this example, let’s assume you want to allow subject numbers that are prefixed with an alphabetic character and a dash. The alphabetic characters can be any English letter and can be either upper- or lowercase. The alphabetic character is followed by a dash (-) and then a 3-digit number. The expression for this example is [a-z, A-Z]-[0-9][0-9][0-9]. Subject numbers such as A-123, C-459, and b-031 all conform to this formatting expression.

In both of our previous examples, we allowed a continuous range of numbers or letters at each position in the subject number, as well as the dash character. More complex numbering schemes are allowed. Additional options include the following:
  • You can limit the available characters for any position by specifying a comma-separated list of allowed characters in place of a range. For example, the expression [A,B,C, a,b,c]-[1,5][0-9][0-9] requires all numbers to begin with only the characters A, B, or C (in either upper- or lowercase) followed by either the number 1 or the number 5, followed by two additional digits of 0-9. In this case, allowed subject numbers include A-124, b-599, and C-130 but A-734 would not be allowed as the first numeric character following the dash must be either a 1 or a 5.
  • You can require a mandatory character by omitting the brackets in your expression ([]). For example, to always require the subject number to begin with A, you can specify something like A[0-9][0-9] which allows a subject number from A00 to A99. Numbers such as A13, A89, and A01 are all valid.
  • Finally, you can also specify how many times a character can be repeated in a subject number. For example, to allow a subject number that contains a repeated digit, you can specify an expression such as [0-9]{1,3}[A-Z]. This expression allows subject numbers such as 123Z or 12A.

Note:

No matter which format you choose, the subject number will always be prefixed with the Site Number.

Commonly Used Subject Number Formats

Numeric Digits Only:

  • Subject numbers with up to 3 numeric digits: [0-9]{1,3}
  • Subject numbers with up to 4 numeric digits: [0-9]{1,4}
  • Subject numbers with up to 5 numeric digits: [0-9]{1,5}
  • Subject numbers with up to 6 numeric digits: [0-9]{1,6}

Numeric Digits terminated by a single alphabetical character

  • Subject numbers with up to 3 numeric digits followed by the letters ‘a’ through ‘z’: [0-9]{1,3}[a-z]
  • Subject numbers with up to 3 numeric digits followed by the letters ‘a’ or ‘c’: [0-9]{1,3}[a,c]
  • Subject numbers with up to 6 numeric digits followed by the letters ‘a’ through ‘z’: [0-9]{1,6}[a-z]
  • Subject numbers with up to 6 numeric digits followed by the letters ‘a’ through ‘z’ OR ‘A’ through Z’: [0-9]{1,6}[a-z, A-Z]

Starting with an alphabetical character followed by numeric Digits

  • Subject numbers with ‘a’ or ‘c’ as the first character followed by up to 3 numeric digits: [a,c] [0-9]{1,3}

A dash in the middle

  • Subject numbers with up to 3 numeric digits, followed by a dash ‘-‘, and finally followed by 3 numeric digits: [0-9]{1,3}-[0-9]{1,3]
  • Subject numbers with up to 3 numeric digits, followed by a dash ‘-‘, followed by 3 numeric digits, finally the letter ‘a’ through ‘z’: [0-9]{1,3}-[0-9]{1,3][a-z]