Click or drag to resize
Computation Reference

[This is preliminary documentation and is subject to change.]

Computation nodes may be placed below any template item. Each template item may have several computations - i.e. there is a 1:N relation between template item and Computation.

Not all computations are meaningful on all types of template items.

Computations are named. Currently the TOPICA configuration editor requires, that the names are typed in. The names must be typed exactly as in the table below (except that case is not significant). NB: Currently the TOPICA configuration editor does NOT check this!

A particular computation name may be used only once on each template item. That is: if a template item has two or more compuations with the same name, it is considered a configuration error, and behavior is unpredictable. NB: Currently the TOPICA configuration editor does NOT check this!

Computation fields

Name

Description

Name

Identifies the computation (what it is used for).

Disabled

false: computation is "enabled" (in use).

true: computation is "disabled" (not in use).

ExpressionString

TOPICA Basic expression that is evaluate by the framework.

NB: The type of the resulting value MUST match the types given in the table below (depending on name).

Computation names

Name

Data type

Used in

Description

CloseLabel

String

Form

The label displayed on the automatically generated checkbox for closing records.

This computation is evaluated when a dynamic form is displayed, when the corresponding table has property Closable = true.

Close

Boolean

StructureElement

Computes whether a record should be closed automatically.

If the corresponding table has property Closable = true, this computation is evaluated when a dynamic form is saved, (both when it is created, and when it is updated) It is also evaluated recursively for all parent records in the record tree, but not child (sub) records!

Create

Boolean

StructureElement

Computes whether the end user should have access to create a new record.

The framework first determine create access right based on user's permissions, user's organizational association, organizational association of the parent record, etc.

Only if user according to this calculation has the right to create a new record, the expression in computation Create is evaluated. If this evaluation results in the value false, the user will NOT be able to create a new reord.

This computation is evaluated when the record tree is displayed.

Name

String

StructureElement

Computes the name displayed in the record tree.

The default value is the Caption property of the table defining the type of the record.

This computation is evaluated when the record tree is displayed.

DateStart

DateTime

Form

Computes the field DATE_START that is stored in all dynamic tables.

This computation is evaluated when a dynamic form is saved, both when it is created, and when it is updated.

DisplayDate

DateTime

StructureElement

Computes the date / datetime valued displayed for records ("open nodes") in the record tree.

This computation is evaluated when the record tree i displayed. Note that this valued is NOT stored in the database (despite the fact that there is a filed DATE_DISPLAY in all dynmic tables - this field is not used!).

ListQuery

String

StructureElement

This computation must return an SQL query. This query is used to construct the list of records displayed for DisplayAtTop tables. The query MUST return a column named ID. This column is used to construct the hyperlinks used to open the individual records in the list.

Default value: empty string (has the effect that the list displays only the DATE_START field).

Expand

Boolean

StructureElement and TemplatePanel.

StructureElement: Controls whether nodes in the record tree are expanded (true) or collapsed (false).

TemplatePanel: Controls whether the panel is initially expanded or collapsed.

Visible

Boolean

All template item types

StructureElement: Controls the visibility of the record (and all subrecords) in the record tree.

All other template items: Controls the visibility of the template item (and all template items below) in the input form. When this computation is defined, it overrides the value of the (static) Hidden property.

Replaces the VisibleComputation property. VisibleComputation is now deprecated, but kept for backward compatibility.

DataOwnerByDefault

Boolean

StructureElement

When new organisation unit is created this computation is run to decide if that organisation unit should be set as dataowner.

Tooltip

String

StructureElement

Controls the tooltip for "open" nodes in the record tree. An "open" node is a node that is a´ssociated with a record in the database. Clicking an "open" node displays the input form with data. User may view, edit or delete the record according to the user's access rights.

Default value: null (no tooltip).

TooltipGroup

String

StructureElement

Controls the tooltip for "group" nodes in the record tree. An "group" node is shown only when property DisplayAtTop is set to true for the form/table in question, and the relation is 1:N. Clicking a "group" node displays a list of records.

Default value: null (no tooltip).

TooltipCreate

String

StructureElement

Controls the tooltip for "create" nodes in the record tree. An "create" node is used to create new records. Clicking a "create" node displays an empty form (some fields may have default values, though).

Default value: null (no tooltip).

ShortcutKey

String

StructureElement

Controls the shortcut key for links in the record tree (Ctrl+Shift is used as default modifier). Only valid for forms directly related to root (patient).

Default value: null (no shortcut).

ImageFile

String

StructureElement

Controls the icons displayed next to nodes in the record tree. Makes it possible to display images (icons) depending on values in the record.

Default value: the value of the (static) property Imagefile. The static property Imagefile is now deprecated, but kept for backward compatibility.

Example:

If(IsNull(Record), "IconDefault.gif", If(Record.Closed, "IconClosed.gif", "IconOpen.gif"))

If this expression is used for a ImageFile computatation, the result in the record tree will be:

  • Nodes in the record tree, that are NOT assciated with a record (i.e. "create", "fillin" or "group" nodes) will show the image from the file IconDefault.gif.

  • "Open" and "hint" nodes for closed records (Record.Closed=true) will show the image from the file IconClosed.gif.

  • "Open" and "hint" nodes for open records (Record.Closed=false) will show the image from the file IconOpen.gif.

ClassName

String

StructureElement

The result of this computation is output as CSS class name on nodes in the record tree. The actual style of the node is determined by stylesheets.

Default value: null (this has the effect, that classes defind in the framework determine the actual style of the node).

Style

String

StructureElement

The result of this computation is output as style information on nodes in the record tree. The actual style of the node is determined by stylesheets modified by the style defined by this computation.

Default value: null (no overriding style).

DateColorName

String

StructureElement

The text in the "open" nodes in the record tree contains both a record name (controlled by computation Name) and a date (controlled by computation DisplayDate). Computations ClassName and Style control the style of the whole text, but the date part has additional style information for background color. Per default the framework sets this background color based on the record's status (there are colors for closed, complete and incomplete status - the actual colors are defined in Configuration Files).

The result of this computation overrides the colors read from the Configuration Files. The result is, that a configurator may control this date background color, based on values that may vary from record to record.

Default value: null (no overriding background color for date).

Tag

String

StructureElement

This computation may be used to compute any value or each each "open" noed in the record tree.

The computed value has no effect in the record tree in the TOPICA web application, except that users with debugging permission is able to see the computed vlue in the tooltip (for checking that the computations works as expected).

In applications, where some other user interface is used to display the record tree, the contents to display in the record tree is typically fetched by a web service call. The information returned by this web service call will contain the computed tag value, and the calling application may use this information for any purpose.

FillInStatus

Integer or String

Any template item descending from DataNameBase (and thus defining the property FillInStatus).

This computation may be used to set the "fill in status" dynamically - i.e. whether the input field should be Optional, Required or NotNull.

This is useful when you need to use same forms for different environments (customers), when the one customer wants a field to be Optional, and another customer wants the same field to Required. This is solved by a FillInStatus computation that reads from the .config files (because the Server.config file is customizable per environment).

This computation must return an Integer or String value. TOPICA Basic defines symbolic constants for the valid values of this computation. The valid values are:

0

FillInStatus_Optional

"Optional"

1

FillInStatus_Required

"Required"

2

FillInStatus_NotNull

"NotNull"