Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel6
outlinefalse
typelist
printablefalse
separatorbrackets

...

Info

Note

  • We do not recommend storing any calculated field values since it is duplicate information.

  • You can configure the code in JSON workflow within the 'Dictionary' section.

Example 1: Display participant concatenated first name and last name

...

Example 18: Calculating the months remaining after counting the completed years

Expand
Code Block
{
  "name": "calcCpr.birthDate",
  "displayExpr": "(fns.dateDiffInDays(cpr.participant.birthDate, fns.now()) / 365 * 12 -fns.ageInYears(cpr.participant.birthDate, fns.now()) * 12).toFixed(0) + ' months'",
  "caption": "Age",
  "type": "span"
},

...

Expand
Code Block
{
      "name" : "calcSpecimen.numberField",
      "displayExpr" : "fns.ifNotNull(specimen.extensionDetail.attrsMap.number1,((+specimen.extensionDetail.attrsMap.number1)/100), 'Not Specified')",
      "caption" : "Divided Cal Field",
      "type" : "span"
    },

image-20240306-044650.png

Example 21: Calculating Age of Dead participants and alive participants.

Expand
Code Block
{
      "name" : "calcCpr.age",
      "displayExpr" : "fns.ifNotNull(cpr.participant.deathDate,  fns.dateDiffInYears(cpr.participant.birthDate, cpr.participant.deathDate) + ' years', fns.dateDiffInYears(cpr.participant.birthDate, fns.now()) + ' years')",
      "caption" : "Age",
      "type" : "span"
}

#1. If Participant is dead, then it calculates the Age from DOB to Date of death.

image-20240409-055204.pngImage Added

#2. If participant is alive then it calculates the Age from DOB to Current Date.

image-20240409-055450.pngImage Added

Inbuilt Functions

...