Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

In terms of functionality, anything that is available in the JavaScript programming language is available for use in Subject Reports. Thus, there is considerable power that can be leveraged by Subject Reports (e.g., automated clinic note generator).

How It's Done

Referencing Variables
To reference a variable value use: <%= #VariableCode %>

If the variable is categorical (e.g., picklist), adding .Name will insert the label associated with the numeric value: <%=#VariableCode.Name %>

If Statement

The if statement is helpful when you only want text to appear under specific conditions

...

<% if (#VariableCode == 0) { %> <% =#VariableCode2 %> <% }else { %>Text if false <% }%>

Example Basic Report

...

Patient Name: <%= #FirstName %> <%=#LastName %>
MRN: <%= #ReferenceId %>
Sex: <%= #sex.Name %>
Dob: <%= #birth %>
Age: <%= ageAsOf(#birth, #EncounterDate) %>
Race: <%= #race.Name %>

...

Test 1
Section A subscore <%= #section_a_subscore %>
Section B subscore <%= #section_b_subscore %>
Section C subscore <%= #section_c_subscore %>

...

Where To Place The Code

Typically code blocks (begin and end with <% and %>, respectively) are best placed at the top of the report like this:

...

Patient Name: <%= #FirstName %> <%= #LastName %>
<% Tcog1 %>

...

Referencing More Than One Encounter

You can display data values from more than one variable by using the ENCOUNTERS method as in the example below which generates a table with values from multiple encounters

...