TOPICA Basic Global Variables |
[This is preliminary documentation and is subject to change.]
Global variables are used to access information about the current context of the application. See also TOPICA Basic and Context.
Some global parameters will always have same value - e.g. DataDictionary.
Global variables EmployeeUser and PatientUser are defined by the logged in user, and will have the same value for the duratino of the session.
Some global variables (e.g. Patient) will reflect the context seelcted by the user.
Some global variables will have same value during rendering of a page in the application. This is always true for Patient. It is also true for Record when rendering the page showing the record set in context. But during rendering of e.g. the patient record tree page, the record in context is varied (e.g. Record refers to each record being rendered in turn). This makes it possible to use TOPICA Basic to compute access to the record (i.e. to control security on the record level).
Name | Type (class) | Description | ||
---|---|---|---|---|
DataDictionary | Metadata on the dynamic data model - i.e. data describing tables, fields, etc. | |||
OrgUnit | The organizational unit in context. Set (e.g. not null) when an org.unit has been set in context. | |||
Employee | The employee in context (for employee administration). Set (e.g. not null) when no employee has be set in context.
| |||
EmployeeUser Obsolete alias: User | The logged-in employee user. Set (e.g. not null) when an employee is logged in. If a patient is logged in, EmployeeUser will be null (and PatientUser will be different from null). | |||
Patient | The patient in context. Set (e.g. not null) when a patient has been selected (e.g. during view / updating patient properties in the Patient Property Form, or during Entering Patient Data), Not set (e.g. null) in all other situations. | |||
PatientUser | The logged-in patient user. Set (e.g. not null) when a patient is logged in. If an employee is logged in, PatientUser will be null (and EmployeeUser will be different from null). | |||
Record | The dynamic patient data record in context. The global variable Record is set (i.e. not null) in the following situations:
The global variable Record is null in the following situations:
| |||
ParentRecord | The "parent" dynamic patient data record in context. The global variable ParentRecord is set (i.e. not null) in the following situations:
The global variable ParentRecord is null in the following situations:
| |||
Form | The (dynamic) input form. This variable holds value different from null only when the user has a dynamic form displayed in the user interface. Use the Form global variable to access the values entered by the user in the input fields of a form. This is used only in validation rules. There is no way to set the Form global variable in the "TOPICA Basic Test" tool, so you cannot test TOPICA Basic expressions involving Form in the "TOPICA Basic Test" tool.
Example: The current form as an integer field X. We want to implement a validation rule, that this value must initially be set to 1, and can optionally be incremented by 1 at every update. If(IsNull(Record), Form.X=1, (Record.X<=Form.X) And (Form.X<=Record.X+1)) |
![]() |
---|
It is vital NOT to dereference null objects. As in most programming languages, dereferencing a null object causes an exception. Examples:
|
![]() |
---|
This topic describes only the built-in TOPICA-specfific global constants. As described elsewhere, TOPICA Basic is an extension of the generic expression language defined in the "rule engine" (documentend separately). Therefor, all constants defined in the "rule engine" also exist in TOPICA Basic. All parameters defined in the config files are accessible from TOPICA Basic as constants (type: String). This mechanism is obsolete (the preferred way to access these values is using the ConfigString function) - but this is kept for backward compatibility. |