Skip Headers

Oracle Argus Safety Dossier User's Guide Release 7.0.3 E40576-01 |
| Contents

Previous |

# 3 Writing Template Scripts

Before you can use templates to generate reports, you (or someone with script writing or programming background) must create template scripts. Template scripts define the format for the report. This chapter provides information about writing template scripts and includes discussions of the following:

- Using Microsoft Word to Write Templates

- Using the Template Scripting Language

## About Templates

Templates are tools that an administrator or template writer uses to define the structure of a periodic report and the way this report will be laid out when it prints. Once a template is processed, the resulting report is a Microsoft Word (.doc or .docx). A template:

- Can be scripted for the entire periodic report and/or can be split into sections that can be allocated to different users for processing. Once processed, the resulting report is a Microsoft Word document (.doc/.docx)

- Normally has a one-to-one relationship with a single product (active ingredient) and agency

- Can be used to create a template for another product/agency

Template writers use predefined syntax and elements to script templates. The basic objective of the syntax and elements is to provide tools that enable the template writer to:

- Author predefined textual narratives in the body of the template

- Pre-populate values in the body of the document directly from the database

- Prompt users for values not available in the database

- Process user entered values and insert narratives in the document

- Insert instructional text for the report authors

- Insert referential text with links to non-submission content. (Example - Attached Case Listings, CDAs, CIOMSII reports etc.)

The template automates the report generation process as much as possible. However, report authors have the ability to manually edit the content of a report as necessary.

## Using Microsoft Word to Write Templates

Dossier supports the use of templates written in Microsoft Word 2000 or higher.

Note: If you are using Word 2007, contact your system administrator to verify that Word 2007 is installed on the Report Server.

To begin writing a template

1. Open a new, blank document in Microsoft Word and save it.

2. Save the document in .DOC or .DOCX format before editing it.

   When writing a template, adhere to the following guidelines:

   - Standardize the Microsoft Word template (Normal.dot).

     Standardize the Normal.dot template for all users designated as owners. This reduces amount of formatting required after the build process. Because the output file from the build process automatically uses the Normal.dot template on the owner's desktop, the output document may not retain formatting used in the original template.

   - Avoid using the cut and paste operations.

     The cut/paste operations introduce unknown formatting objects from the source document. Such formatting objects may cause the file to be rejected during the template upload process.

   - Do not define special formatting styles in the templates.

     Avoid defining any special formatting styles in the templates. Maintain the same styles as defined in Normal.dot.

   - Do not cut and paste a table from another document into the template.

     If a table is required in a template, do not cut/paste the table from another document. Instead, create a new table in the RTF template.

   - Do not generate the TOC until the build process is complete.

     Wait to generate the final table of contents until after the build process is complete. The enables you to include merged documents and updated page numbers in the template.

   - The application creates PDF bookmarks only for heading styles created in the Word document.

     The publish process ignores all other styles-even if they appear in the table of contents in the Word document.

   - Put processing instructions in a <% . . . %> block.

     The application processes instructions embedded in a <% . . . %> block. Each block can contain a set of instructions. To enable the application to process the instructions, embed each instruction in a specific tag.

     In other words, make sure the contents of the <% . . . %> block are tags that Dossier supports. The system ignores other tags and will output them as a blank string in the report. Any text outside the <% . . . %> block will be replicated in its actual form in the output document.

   - Apply uniform formatting.

     Apply the same formatting to a single block of instructions (i.e., the contents in the <% . . . %> block) in the template.

   - Make sure scripting tags meet XML standards.

     The scripting tags should comply with XML standards. The contents of the <% . . . %> tag should be well-formatted XML.

   - Use lowercase characters for all tags and variable (implicit/explicit).

     Use lowercase character for all tags and variables (implicit and explicit). Explicit variables are case-sensitive.

   - Do not use scripting tags (i.e., <%, %>, \ . . .\, <, >) in any content that needs to appear in the output document.

## Using the Template Scripting Language

This section provides information about using the template scripting language. It includes a Template Writing Quick Reference and discussions of the following:

- Template Scripting Elements

- Template Writing Quick Reference

### Template Scripting Elements

A template script includes the following elements:

- Implicit Variables

- Explicit Variables

- Operands

- Nested Questions

#### Using Implicit Variables

Implicit variables are pre-defined, named elements that correspond to implicit variables defined by the system and are available to the author of the template without declaring them.

#### Rules for Using Implicit Variable

When using implicit variables, be aware of the following:

- Begin periodic report variables with pound (#) sign (e.g., #TRADE_NAME)

- Values to these variables are always used in the context of the periodic report configuration. For example, if you configure a periodic report for Product A (ICH PSUR - Subject Tab), this variable only appears as the Product A trade name.

  Consider the following usage example:

  "There were no cases related to {#TRADE_NAME}."

  where:

  #TRADE_NAME maps to a defined value known by the parser.

- You can map these variables to a formula or to the result of a specific SQL statement that is pre-encoded in the parser.

- These variables may return a single or multiple values (separated by "/")/

- You can use these variables in any template.

- Some implicit variables are considered to be multiple instances of values. Variables of this type require you to use indexes to indicate a particular position in the list. For example, a list of SOC terms sorted by occurrence where the most frequently used term is listed first. For example, this variable is included as #SOC_COUNT_TOP(x), where x indicates the "x" highest occurrence based on the count where the SOC term with the highest occurrence is listed first.

#### Creating and Using Custom Variables

Dossier enables you to create and use custom variables. Ideally, you should define custom variables after Argus has been completely configured to allow for correct and complete SQL statements. Before attempting to create and use custom variables, please seek help from IT personnel.

To define custom variables:

1. Open the CFG_PSUR_TEMPLATE_VARIABLES table

2. Enter values in the following fields.

   Field | Field Value
   --- | ---
   ID | Enter a unique number in this field. This number must be the next number in the number sequence. For example, if ID number for the last row is 100, the new row must have an ID number of 101
   VARIABLE_NAME | Enter the name of the variable to be used in the template. Use lowercase characters when entering this value. Do not use the # sign in the name.
   SQL_QUERY | Enter the actual SQL statement to be executed when the template parser processes the variable name.
   REPORT_RELATED | Enter a 1. The application ignores any other value.
   DELETE | This must be a NULL value. If you place any other value in this field, the application considers the variable deleted.

#### Pre-defined Periodic Report Variables

Dossier provides a number of pre-defined periodic report variables. When using these variables in your template scripts, be aware of the following:

- The system only considers encoded events for SOC-based variables; it ignores all unencoded events.

- For all variables that return a count, return a 0 when the result is NULL.

- When a variable returns multiple values, those values are separated with a forward slash ( / ) character.

- For all variables that return a frequency value, print the value with a % sign and round it to two (2) decimal places.

- All SQL statements for pregnancy cases consider any populated neonate.

The following table lists and describes the pre-defined periodic report variables available for your use.

Variable | Description
--- | ---
#REPORT_NUMBER | The Report Number entered in the report header configuration in the Subject Tab.
#TRADE_NAME | The Trade Name entered in the report header configuration. By default, Argus pre-populates the configured Trade Name for the ingredients. You may change these defaults by editing the name.
#GENERIC_NAME | The ingredients that the report has been configured to run against.
#REPORT_START_DATE | The inclusion period start date for the report (Scheduling Tab).
#REPORT_END_DATE | The inclusion period end date for the report (Scheduling Tab).
#IBD | The earliest birth date for the product licenses included in the report. If configured to do so, Argus pre-populates this value. This value can be changed if necessary.
#COUNTRY_IBD | The name of the country with the earliest license date based on the products in the report configuration.
#TOTAL_COUNTRIES_MARKET | The total number of countries where both of the following are true: The selected products have a marketed license. The selected products do not have a withdrawn date.
#TOTAL_CASES | The total number of adverse events being reported on. This value is based on the cases selected for the report.
#TOTAL_CASES_SERIOUS | The total number of serious cases included in the generated report. A case is considered serious if any event in the case has a seriousness check box checked.
#TOTAL_CASES_NON_SERIOUS | The total number of non-serious cases included in the generated report. A case is considered non-serious if all of the events do not have the Seriousness check box checked.
#TOTAL_CASES_SP | The total number of spontaneous cases included in the generated report. A case is considered spontaneous when the Report Type is not marked as Include in Clinical Trial in List Maintenance.
#TOTAL_CASES_SP_LIT | The total number of spontaneous literature cases included in the generated report. A case is considered spontaneous literature when both of the following are true: The Report Type is not marked as Include in Clinical Trial Include as Literature is checked in List Maintenance.
#TOTAL_CASES_SOC_PRIMARY("soc_name") | The total number of cases where the primary event has been encoded using the same System Organ Class as specified in soc_name.
#TOTAL_CASES_SOC("soc_name") | The total number of cases where any event has been encoded using the same System Organ Class as specified in soc_name.
#TOTAL_CASES_SOC_SERIOUS("soc_name") | The total number of serious cases where both of the following are true: Any event has been encoded using the same System Organ Class as specified. The same event is serious.
#TOTAL_CASES_SOC_NON_SERIOUS ("soc_name") | The total number of non-serious cases where both of the following are true: Any event has been encoded using the same System Organ Class as specified. The same event is non-serious.
#TOTAL_CASES_SOC_UNLISTED ("soc_name") | The total number of cases where both of the following are true: The event assessment for the product is Unlisted. Any event has been encoded with the specified System Organ Class.
#TOTAL_CASES_SOC_SERIOUS_UNLISTED ("soc_name") | The total numbers of cases where both of the following are true: The event assessment for the product is Unlisted. Any serious event has been encoded with the specified System Organ Class.
#LISTOFTERMS_SOC_SERIOUS_UNLISTED ("soc_name") | The Event name as coded for cases where both of the following are true: The event assessment for the product is Unlisted. Any serious event has been encoded with the specified System Organ Class. Multiple Terms must be separated with a forward slash ( / ).
#SUBMISSION_DATE | The date the report is due. The system calculates this date based on the values in the Scheduling tab for the report configuration.
#SOC_NAME_TOP(x) | The System Organ Class with the highest count based on the cases within report and the specified level. SOC term name with the xth highest occurrence in the case series. For example; #SOC_NAME_TOP(2) returns the name of the SOC with the second highest occurrence in the line listings. If there is more than one SOC at this level, the application uses a forward slash ( / ) to separate them when it prints the report.
#SOC_COUNT_TOP(x) | The total count of the System Organ Class that has the highest count based on the cases within the PSUR Report and the level as specified. SOC term count that has the xth highest occurrence in the case series. For example, #SOC_COUNT_TOP(2) returns the total number of occurrences for the SOC with the second highest occurrence in the line listings".
#SOC_FREQUENCY_TOP(x) | The frequency of occurrence (across all cases in the report) of the System Organ Class that has the xth highest count based on the cases in the report. Frequency of occurrence of events in the SOC that has the xth highest occurrence. For example, #SOC_FREQUENCY_TOP(2) = #SOC_COUNT_TOP(2) / #TOTAL_CASES
#SOC_PT_NAME_TOP(x,y) | The PT term name with the yth highest occurrence in the xth highest SOC occurrence. For example; #SOC_PT_NAME_TOP(2,3) returns the third most frequent Preferred Term name of the second most frequent SOC for the cases in the PSUR.
#SOC_PT_COUNT_TOP(x,y) | The number of occurrences of the PT name with the yth highest occurrence in the xth highest SOC occurrence. For example; #SOC_PT_COUNT_TOP(2,3) returns the number of the third most frequent Preferred Term of the second most frequent SOC for the line listings.
#TOTAL_COUNTRIES_COUNT__REPORT | The total number of countries from the Country of Incidence field (in the Case Form) based on the cases in the report.
#TOTAL_CASES_COUNT_DRUGINTERACTIONS | The total number of cases where any product on the Case Form (Product tab) has Yes specified for Interactions
#TOTAL_CASES_COUNT_DRUGABUSE | The total number of cases where any product on the Case Form (Product Tab) has True specified for Abuse
#TOTAL_CASES_COUNT_PROSPECTPREGNANCY | The total number of cases where both of the following are true: The patient is Pregnant. The pregnancy type is Prospective. (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_RETROPREGNANCY | The total number of cases where the following are true: The patient is Pregnant. The pregnancy type is Retrospective. (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_PENDINGDELIVERY_PROSPECT | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type Prospective. The delivery date is greater than the current date. (Case Form | Patient Tab | Pregnancy Details). If you do not enter a delivery date, the application ignores the case.
#TOTAL_CASES_COUNT_ELECTIVETERMINATIONS__PROSPECT | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Prospective. The birth type is Elective Termination (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_SPONTANEOUSABORTIONS__PROSPECT | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Prospective. The birth type is Spontaneous Abortions (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_FREQUENCY_SPONTANEOUSABORTIONS__PROSPECT | The frequency of occurrence of cases where all of the following are true: The patient is Pregnant The pregnancy type is Prospective The birth type is Spontaneous Abortions and the pregnancy type is either Prospective or Retrospective. Computed as: ('= #TOTAL_CASES_COUNT_SPONTANEOUSABORTIONS / (#TOTAL_CASES_PROSPECT_PREGNANCY+#TOTAL_CASES_RETRO_PREGNANCY)"
#TOTAL_CASES_COUNT_NORMALOUTCOME__PROSPECT | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Prospective. The fetal outcome is Normal. (Case Form | Patient Tab | Pregnancy Details)
#TOTAL_CASES_COUNT_FOLLOWUPLOST_PROSPECT | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Prospective. The birth type is Lost to F/U (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_FOLLOWUPDONE_PROSPECT | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Prospective. The birth type is not Lost to F/U (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_ABNORMALOUTCOME_PROSPECT | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type Prospective. The fetal outcome is not Normal. (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_CAMAJOR_PROSPECT | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Prospective. The fetal outcome is CA Major (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_FREQUENCY_CAMAJOR_PROSPECT | The frequency of occurrence of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Prospective. The fetal outcome is CA Major and is not Normal (Case Form | Patient Tab | Pregnancy Details)
#TOTAL_CASES_COUNT_CAMINOR_PROSPECT | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Prospective. The fetal outcome is CA Minor (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_FREQUENCY_CAMINOR_PROSPECT | The frequency of occurrence of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Prospective. The fetal outcome is CA Minor and is not Normal (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_PREMATURE_PROSPECT | Total # of Cases w/ProsPregnancy with premature birth type.
#TOTAL_CASES_FREQUENCY_PREMATURE_PROSPECT | The frequency of occurrence of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Prospective. The birth type is Premature and the pregnancy type is Prospective (Case Form | Patient Tab | Pregnancy Details)
#TOTAL_CASES_COUNT_STILLBIRTH_PROSPECT | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Prospective. The birth type is Still Birth (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_FREQUENCY_STILLBIRTH_PROSPECT | The frequency of occurrence of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Prospective. The birth type is Still Birth and the pregnancy type is Prospective (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_PENDINGDELIVERY_RETRO | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Retrospective. The delivery date is greater than the current date. (Case Form | Patient Tab | Pregnancy Details) If delivery date is not entered, the application ignores the case.
#TOTAL_CASES_COUNT_ELECTIVETERMINATIONS_RETRO | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Retrospective. The birth type is Elective Termination (Case Form | Patient Tab | Pregnancy Details)".
#TOTAL_CASES_COUNT_SPONTANEOUSABORTIONS_RETRO | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Retrospective. The birth type is Spontaneous Abortion (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_FREQUENCY_SPONTANEOUSABORTIONS_RETRO | The frequency of occurrence in cases where all of the following are true: The patient is Pregnant. The pregnancy type is Retrospective. The birth type is Spontaneous and the pregnancy type is either Prospective or Retrospective. Computed as: ('= #TOTAL_CASES_COUNT_SPONTANEOUSABORTIONS_RETRO / (#TOTAL_CASES_PROSPECT_PREGNANCY+#TOTAL_CASES_RETRO_PREGNANCY)".
#TOTAL_CASES_COUNT_NORMALOUTCOME_RETRO | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Retrospective. The fetal outcome is Normal (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_FOLLOWUPLOST_RETRO | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Retrospective. The birth type is Lost to F/U (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_FOLLOWUPDONE_RETRO | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Retrospective. The birth type is not Lost to F/U (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_ABNORMALOUTCOME_RETRO | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Retrospective. The fetal outcome is not Normal (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_CAMAJOR_RETRO | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Retrospective. The fetal outcome is CA Major (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_FREQUENCY_CAMAJOR_RETRO | The frequency of occurrence of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Retrospective. The fetal outcome is CA Major and is not Normal (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_CAMINOR_RETRO | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Retrospective. The fetal outcome is CA Minor (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_FREQUENCY_CAMINOR_RETRO | The frequency of occurrence of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Retrospective. The fetal outcome is CA Minor and is not Normal (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_PREMATURE_RETRO | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Retrospective. The birth type is Premature (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_FREQUENCY_PREMATURE_RETRO | The frequency of occurrence of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Retrospective. The birth type is Premature and the pregnancy type is Prospective (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_STILLBIRTH_RETRO | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Retrospective. The birth type is Still Birth (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_FREQUENCY_STILLBIRTH_RETRO | The frequency of occurrence of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Retrospective. The birth type is Still Birth and the pregnancy type is Prospective (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_CA_ALL | The total number of cases where both of the following are true: The patient is Pregnant. The fetal outcome is either CA Major OR CA Minor (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_PERINATAL_PROSPECT | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Prospective. The fetal outcome is Perinatal complication (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_PERINATAL_RETRO | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Retrospective. The fetal outcome is Perinatal complication (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_POSTNATAL_PROSPECT | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Prospective. The fetal outcome is Post-perinatal complication (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_POSTNATAL_RETRO | The total number of cases where all of the following are true: The patient is Pregnant. The pregnancy type is Retrospective. The fetal outcome is Post-perinatal complication (Case Form | Patient Tab | Pregnancy Details).
#TOTAL_CASES_COUNT_PEDIATRICS | The total number of cases where both of the following are true: The patient's age group has been selected The group has been configured with the E2B codes of either 1,2 or 3 in list maintenance.
#SOC_NAME_TOP_PEDIATRICS(x) | The SOC with the largest number based on the level specified where the patient's age group is with the E2B code value of 1,2 or 3 in list maintenance.
#SOC_COUNT_TOP_PEDIATRICS(x) | The largest number of SOC based on the level specified where the patient's age group is with the E2B code value of 1,2 or 3 in list maintenance.
#SOC_FREQUENCY_TOP_PEDIATRICS(x) | The frequency of occurrence of events in the SOC that has the xth highest occurrence in pediatrics (E2B code of 1, 2 or 3 in list maintenance).
#TOTAL_CASES_COUNT_ELDERLY | The total number of cases where both of the following are true: The patient's age group has been selected The group has been configured with the E2B codes of 6 in list maintenance.
#SOC_NAME_TOP_ELDERLY(x) | The SOC with the largest number based on the level specified where the patient's age group is with the E2B code value of 6 in list maintenance.
#SOC_COUNT_TOP_ELDERLY(x) | The largest number of SOC based on the level specified where the patient's age group is with the of 6 in list maintenance.
#SOC_FREQUENCY_TOP_ELDERLY(x) | The frequency of occurrence of events in the SOC that has the xth highest occurrence in pediatrics (E2B code of 6 in list maintenance).
#DEV_INTERNATIONAL_BIRTHDATE | The DIBD date of the product.

#### Using Explicit Variables

Explicit variables are not available in the Argus database and require the script author to populate them manually using such methods as free text entry, yes/no options, multiple options, etc. There are two kinds of explicit variables:

- Declared Variables <var>

- Author Questions <q>

#### Using Declared Variables <var>

The VAR (variable element) enables the template author to define logical storage for variables that are defined and used in the template. When using declared variables, be aware of the following:

- A declared variable is valid only for the template in which it is declared.

- Unless a new value is specifically assigned to the variable, the parser uses the declared value of the variable as VAR1 throughout the template.

- Names can be a maximum of 50 characters.

- Values can be a maximum of 10,000 characters.

- All declared variables are case-sensitive.

- All variables must be enclosed in curly braces ( { . . . } ) in the script.

- The application does not process the VAR value but replaces it in its place holder. Consider the following example:

  <var name = "var1">nn</var>

  where:

  var1 is the name of the variable

  nn is the value if the variable

#### Using Author Questions <q>

Use the QUESTION ( <q> ) element to capture information from the author of the report. When using the QUESTION element, be aware of the following:

- All question elements must begin with <q name=" "> and end with </q>.

- The application uses the name element as a variable to hold the value of the answer provided by the author of the report.

- When using the DISPLAY node, be aware of the following:

  - The system uses the DISPLAY node containing the text to display as the question to the author.

  - All DISPLAY elements must with <display> and end with </display>.

- When using the OPTIONS node, be aware of the following:

  - The application uses the OPTIONS node to:

    Present pre-defined multiple answers to the author. All OPTIONS elements must start with <options> and end with </options>.

    Represent a single pre-defined answer.

  - The total character limit is 1,000 characters across all options.

  - All OPTION elements must start with <option> and end with </option>.

  - All OPTION values display in drop-down lists. The application truncates the option value after 160 characters.

  - If no OPTIONS are used, with the <q> operand, the application will present a free text field to the author to enter any value. The character limit for free text entries is 10,000.

- You cannot use variables as a part of DISPLAY or OPTION.

- All declared variables are case-sensitive.

Consider the following usage example:

<q name="q1"> <display>What is your favorite color?</display> <options> <option>Some Value 1</option> <option>Some Value 2</option> </options>

#### Using Operands

Operands enable you to define logical template processing using the following statement types:

<if>, <then>, <else>

<narrative>

<include>

<comment>

<write>

#### Using the <if> <then> <else> Statement

The basic syntax for the <if> <then> <else> statement is as follows:

<if> . . . </if> <cond> . . . </cond> <then> . . . </then> <else> . . . </else>

The following general rules govern the use of the <if> <then> <else> statement:

The application ignores any statements inside <if>…</if> but not inside either <then>…</then> or <else>…</else>.

All <if> statements must be followed by a <then> statement.

Usage of the <else> statement is optional.

You must enclose pre-defined values in double-quotes.

The <then> and <else> nodes assign values to VAR or NARRATIVE.

Do not use operator symbols (>, <, >=, or <=) in text within the conditional statements. Instead, use HTML encoded formats as follows:

For this operator | Use this HTML encoded format
--- | ---
< | &lt;
> | &gt;
<= | &lt;=
>= | &gt;=

In the following example, the statement checks the value of Q1. If Q1 is equal to 3, then the application assigns the a value of 4 to VAR1. Otherwise, it assigns the string value for the narrative NAR1.

<if> <cond>Q1="3"</cond> <then><let>VAR1="4"</let></then> <else><let>{NAR1}="There were no cases related to {#TRADE_NAME}"</let></else> </if>

The following table lists and describes how to use each of the elements in the template script.

Element Name | Syntax | Usage Rules
--- | --- | ---
IF | <if> . . . </if> | Use the IF element or condition to logically direct template processing flow. IF elements must begin with <if> and end with </if>.
COND | <cond> . . . </cond> | Use the COND node to evaluate a logical Boolean based on the following operations: Equals To: = Not Equal To: != Greater Than: > Greater Than or Equal To: >= Less Than: < Less Than or Equal to: <= Logical AND: AND Logical OR: OR Each operator in a condition can be: Declared in the template A constant placed within quotation marks ( " ") An implicit variable Use the AND or OR logical operators to combine multiple conditions and to evaluate a combined result. Enclose each condition in parentheses [ ( . . . ) ] to separate them The application evaluates the combined conditions from left to right All COND elements must start with <cond> and end with </cond>.
THEN | <then> . . . </then> | If the specified condition is TRUE, the application executes the THEN block. This block can have single or multiple instruction tags including <if> . . . </if>. All THEN elements must start with <then> and end with </then>.
ELSE | <else> . . . </else> | If the specified condition is FALSE, the application executes the ELSE block. The ELSE block can have single or multiple instruction tags including <if> . . . </if>. All ELSE elements must start with <else> and end with </else>.
LET | <let> . . . </let> | Use the LET element to assign a value to a variable or a narrative. The value you assign must be enclosed in double quotes ( "VAR1" ) and can be one of the following: A string with variables Another variable Use the <var> or <narrative> tag to declare the variable before assigning it.
NARRATIVE | <narrative> . . . </narrative | Use the NARRATIVE element to assign pre-defined paragraphs. NARRATIVE values can be a maximum of 10,000 characters. All NARRATIVE elements must start with <narrative> and end with </narrative>. You can include variables or other elements in the NARRATIVE. During processing, the application replaces these variables or other elements with their current values. Use one of these tags to declare all user-defined narrative variables used in the template. Use one of the following methods to assign a value when declaring the variable: <narrative name ="nar1"> This is a paragraph for patient history . . . . </narrative> <narrative name = "nar1"> </narrative> Let {nar1}= "This is a paragraph for patient history . . . . " </let>
INCLUDE | <include name-" "/> | Use the INCLUDE element to include the contents of an existing RTF document in a report during the template build process. All INCLUDE elements must be written in the following manner: <include name " "/>. The source files can be Argus reports or user-created custom reports that have been created off line and uploaded to the server in the Other Content section of the View ePSUR screen. Periodic reports support the page layouts for the source documents. For example, the application retains a landscape layout in the resulting document. The name of the files must exactly match the name specified in the report configuration (View ePSUR Template screen). You can include files in one of the following sections of the output document: Line Listing Summary Tabulation UD Summary Other Content If the file you are including is from the Other Contents section, the file name must have an RTF extension. You must use Microsoft Word or another tool to convert document files to RTF format. For example, <include name = "CDA-PSUR1.rtf"/> All files in the Other Contents section must have unique names. Do not use the same filename in the <include> tag more than once in a single configuration. This can cause processing error. If you need to include the same content more than once, add multiple files with the same content and different filenames and <include> tags. Argus-generated include files (Line Listing, Summary Tabulation, and reports in UD Summary) must not have and extension and must be exactly as displayed on the View ePSUR screen. For example: <include name = "List Listing"/>
COMMENT | <comment> . . . </comment> | Use the COMMENT element to provide the report author with instructions for editing the report. All COMMENT elements must start with <comment> and end with </comment>. The comment text: Remains in the report until the report is published. When the report is published, the application removes the comment. Will not be used to replace any variables, if used. Usage Example <comment>Please review the document and verified top 5 BODY systems affected.</comment>
WRITE | <write> . . . </write> | The WRITE elements output content to the RTF document. All WRITE elements must start with <write> and end with </write>. The application applies formatting defined in the <write> . . . </write> tags to the content of the output document. Usage Example <write>example text to be written</write> OR <write> The following paragraph has {VAR1} cases</write> OR <write>{NAR1}</write> where: NAR 1 is a previously declared narrative and the content of NAR 1 is written to the document

#### Using Nested Questions

When using nested questions, be aware of the following:

- You can up to five (5) levels of nested questions.

- You can include questions in the ELSE (<else>..</else>) statement.

- If a question is to be nested, it must include a condition. The condition:

  - Cannot include a logical operator (AND/OR)

  - Must have a question variable (<q>) as one of the operands.

  - Must include both a question variable and a constant (e.g., <cond>{q1}="Yes"</cond>)

### Template Writing Quick Reference

Element Type | Usage Rules | Usage Examples
--- | --- | ---
Explicit Variables | Must be declared in the document using <var>, <narrative> or <q> tags Must be enclosed in curly braces ( { . . . } ) when used in the script | Correct usage: <var name="var1">10</var> <write>{var1}</write> <cond>{var1}="4"</cond> <let>{var1} Incorrect Usage {var1 + var2} <write>{var1, var2}</write>
Implicit Variables | These variables are available in Argus and are always based on the cases in a specific periodic report, as configured Must start with a pound ( # ) sign (e.g., #total_cases_soc) Must be enclosed in curly braces ( { . . . } ) when used in the script | Correct Usage: <write>{#report_number}</write> <write>Total Cases for Cardiac disorders are {#total_cases_soc("Cardiac disorders")}</write> <write>{#soc_pt_count_top(3,1) }</write> Incorrect Usage: <let>{#report_number}="10"</let>