Summary

This article defines the instruction toISO8601. 


Table of Contents


Instruction toISO8601

Overview

This instruction converts date question values or constant to a date in ISO8601 format. The result date can be composed from multiple date questions. For example there might be a date question and a time question for one point in time. These can be combined to a single ISO8601 date. However, it is not allowed to specify multiple questions that ask for the same date fields. There can be only one question that asks for the year, for the month, the day and so on.
As input you can specify a date or partial date question, otherwise the input value is used. Additionally questions and constants can be stored in variables.
Questions can be stored in variables:

  • atQst
  • atQstDate
  • atQstTime

Each variable is handled the same internally. Use the variables at your own choice.
Constants can be defined with these variables:

  • atConst
  • atConstDate
  • atConstTime

Usually only one constant variable is used, if any constant is specified at all. A constant needs to be specified in internal partial date format. Each internal partial date string consists of 23 characters. Separator char (-) needs to exist at fixed positions between the fields. The fields need to be specified in the order: years (4 digits), months (2 digits), day (2 digits), hour (2 digits), minute (2 digits), second (2 digits), milliseconds (3 digits). Unsupported or unspecified fields have to be filed with tilde characters.
Here are some examples:

  • 1931-03-20-~~-~~-~~-~~~
  • ~~~~-~~-~~-23-59-00-~~~

Question Id

Optional. Specify a question, when it should participate in the ISO8601 conversion.

Value

Optional, but deprecated. Specify a list of variables that contain path expressions for participating questions. Please use the “at” variables as specified above instead.

Input value

This value is used, when no question is specified. It is allowed to be empty. This can be a pitfall. Please see the first example and compare to instruction iso8601Date.

Example

Question IdInstructionValue
aeStartDate
$>aeStartTime
$>
$>
setVarQst
$>setVarQst
$>const
$>toISO8601
atQstDate
$>atQstTime
$>
$>

In this example the variables atQstDate and atQstTime are filled with questions. These are used in the calculation. There is one problem with this instruction as it also uses input values and the setVarQst also returns the value of the question as result. Here the instruction might use both the variable and the input value. For this reason the example uses a “const” instruction to clear the date result from the previous value. Please be aware that there is instruction iso8601Date that does not support input values and does not show this behavior. Use that instruction, when you want to convert a date solely from variable values.

Question IdInstructionValue
aeStartDatetoISO8601 

Here only the date of the question is converted to the ISO8601.

Question IdInstructionValue
mhterm
$>
invAnswerTime
$>toISO8601
 

Here the investigator answer time is passed as input parameter to the instruction.

Form Type IdQuestion IdInstructionValueColumn NumberColumn TitleData Type
aestdtc
$>&&start
rememberQstId
$>toISO8601
start
$>
23AESTDTC



Need more help?

Please visit the Fountayn Contact Information page.