Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Header Information

 

<table style="width: 800px;">

<tbody>

<tr> <td colspan="3"> <h1 style="text-align: center;">Report Title</h1> </td>

</tr> <tr> <td> <h4 style="text-align: center;">Project ID</h4> </td> <td style="text-align: left;">&lt;%= #ProjectSpecificID %&gt;</td> <td style="text-align: right;">&lt;%= new Date().format('M/D/YYYY') %&gt;</td> </tr>

</tbody>

</table>

<br /><br /> 

 

Data Across Encounters

*** Please note code below is no longer needed.  Use the point-and-click method using the Repeater control Image Modified  ***

Data Across Encounters

Displaying a table with one row per encounter

Code that can be entered into a Report Template:

...

for (var index=0; index < ENCOUNTERS.Count; index++) {
     var encounter = ENCOUNTERS.GetEncounter(index);
         var encounterDate = encounter.#EncounterDate.displayValue.toString();
         var encounterName = encounter.#IntervalName.displayValue.toString();
         var variable1value = encounter.#Variable1.value.value;
         var variable2value = encounter.#Variable2.value.value;

   Output.Write("<tr><td>" + encounterDate + "</td>");
   Output.Write("<td>" + encounterName + "</td>");
   Output.Write("<td>" + variable1value + "</td>");
   Output.Write("<td>" + variable2value + "</td></tr>");

...

Encounter Date

Encounter Name

Variable 1

Variable 2

10/1/2011

Baseline

128

75

11/5/2011

Month 1

123

60

12/2/2011

Month 2

118

62

...


Displaying a table with one row per encounter with the encounters sorted in descending order

Code that can be entered into a Report Template:

...

     var encounter = encountersSorted.GetEncounter(index);
         var encounterDate = encounter.#EncounterDate.displayValue.toString();
         var encounterName = encounter.#IntervalName.displayValue.toString();
         var variable1value = encounter.#Variable1.value.value;
         var variable2value = encounter.#Variable2.value.value;

   Output.Write("<tr><td>" + encounterDate + "</td>");
   Output.Write("<td>" + encounterName + "</td>");
   Output.Write("<td>" + variable1value + "</td>");
   Output.Write("<td>" + variable2value + "</td></tr>");

...

Encounter Date

Encounter Name

Variable 1

Variable 2

12/2/2011

Month 2

118

62

11/5/2011

Month 1

123

60

10/1/2011

Baseline

128

75

...


Outputting the data from latest encounter which meets a condition

Code that can be entered into a Report Template:

...

     var encounter = encountersSorted.GetEncounter(index);
         var encounterDate = encounter.#EncounterDate.displayValue.toString();
         var encounterName = encounter.#IntervalName.displayValue.toString();
         var variable1value = encounter.#Variable1.value.value;
         var variable2value = encounter.#Variable2.value.value;

 if (variable1value >= 150) }

...

Encounter Date

Encounter Name

Variable 1

Variable 2

11/5/2011

Month 1

190

60

...


Displaying data in a custom layout from fixed encounters
 

Code that can be entered into a Report Template:

...

for (var index=0; index < ENCOUNTERS.Count; index++) {
  var encounter = ENCOUNTERS.GetEncounter(index);
  var encounterName = encounter.#IntervalName.displayValue.toString();
      if (encounterName =="Baseline") var BaselineIndex=index;
      else if (encounterName=="Month 1") var Month1Index=index;
      else if (encounterName=="Month 2") var Month2Index=index;
}

...