Versions Compared

Key

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

...

Code that can be entered into a Report Template:

<%

// Create a table and heading row using HTML

...

An example of the output from the Report Template code above:

Encounter Date

Encounter Name

10/1/2011

Baseline

11/5/2011

Month 1

12/2/2011

Month 2

...

Code that can be entered into a Report Template:

<%
// declare Declare variables that will track the interval's index number
   var BaselineIndex="";
   var Month1Index="";
   var Month2Index="";

// loop Loop through all encounters to assign the interval's index number

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

// create Create variables for each encounter and assign all the values from that encounter to the variables

var BaselineEncounter = ENCOUNTERS.GetEncounter(BaselineIndex); 
var Month1Encounter = ENCOUNTERS.GetEncounter(Month1Index);
var Month2Encounter = ENCOUNTERS.GetEncounter(Month2Index);

// Create the desired layout

Encounter Name

Encounter Date

Variable 1

Variable 2

Baseline

<%=BaselineEncounter.#EncounterDate%>

<%=BaselineEncounter.#Variable1%>

<%=BaselineEncounter.#Variable2%>

Month 1

<%=Month1Encounter.#EncounterDate%>

<%=Month1Encounter.#Variable1%>

<%=Month1Encounter.#Variable2%>

Month 2

<%=Month2Encounter.#EncounterDate%>

<%=Month2Encounter.#Variable1%>

<%=Month2Encounter.#Variable2%>



An example of the output from the Report Template above:

Encounter Name

Encounter Date

Variable 1

Variable 2

Baseline

10/1/2011

128

75

Month 1

11/5/2011

123

60

Month 2

12/2/2011

118

62