Click or drag to resize
StructureElement Reference

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

StructureElement nodes are used exclusively in the structure file to define data structure (relation between input forms, and hence also relation between generated database tables).

StructureElement nodes may NOT be used in defining input forms.

See StructureElement for description of the framework class. Note that only a subset of the fields are settable in the The Structure File, including when Using the Editor.

StructureElement fields

Field

Type

Description

FormFilename

String

Name of the form file in the Forms folder.

File names are relative to the Forms folder. I.e. if the requested form file is located directly in the Forms folder, do not add any path information. If the requested form file is located in a subfolder inside Forms, you should specify the path from the Forms folder. Example: "SubFolder/MyForm.xml".

You may use the SAME form file name on several StructureElement nodes in the same structure file (provided DataName has different values). If a form file is referenced N times, it will result in N individual tables in the database - with different tablename, but same fields (except for the automatically generated fields to establish relation to parent table). If these tables are to be considered as one common table (in reports), it is advised to create a UNION view in the database.

StructureType

String

Type of form/table.

May be used to logically group forms/tables.

The TOPICA framework uses this information only in the "Search patient" function. Here it is possible to display records from tables having selected "structure types" next to the returned patients (in the search result). Example: several tables in the application has StructureType = "Message". Then it is possible to display all messages (but no other records) in the search result.

DataName

String

Name of the generated database table.

TOPICA does not use "escape" characters ([...]) when accessing database tables. Therefore, DataName should not contain spaces, punctuation, special national letters, or any other special characters. Use only letters A-Z and a-z, digits 0-9 and underscore (_) - first character must be a letter.

Caption

String

Text displayed in user interface

As opposed to DataName, Caption may contain any characters, including spaces.

Property Caption is "static", i.e. it has the same value for all records in the given table. The value displayed in the record tree may be overridden by computation "Name" - see Computation Reference.

ImageFile

String

Name of the icon file displayed in the record tree

File names are relative to the Structure/Images folder.

Property ImageFile is "static", i.e. it has the same value for all records in the given table. The value displayed in the record tree may be overridden by computation "ImageFile" - see Computation Reference.

Use only file types that may be displayed in the browser, e.g.: .gif and .png.

Cardinality

Enumeration

XML

Editor

Description

1

1:1

1:1 relation from parent table

2

1:N

1:N relation from parent table

SortByField

String

Name of the field used for sorting - see also propperty SortDescending

SortDescending

Boolean

false: sort records by property SortByField ascending (when sorting on date/time field: oldest first).

true: sort records by property SortByField descending (when sorting on date/time field: newest first).

AccessModeRead

Enumeration

Controls read access to records.

XML

Editor

Description

0

Inherit

AccessModeRead is inherited from parent.

1

All

All users may read data of this type.

2

UsersAssociatedWithAnyPatientDataOwner

User can read data, if patient has at least one record "owned" by one of the organizational units related to user (employing or associated).

3

UsersAssociatedWithDataOwner

User can read data owned by an organizational unit related to user (employing or associated).

4

UsersAssociatedWithDataOwnerOrAncestor

User can read data owned by an organizational unit or descendants of an organizational unit related to user.

5

UsersAssociatedWithAnyPatientDataOwnerOrAncestor

User can read data, if patient has at least one record "owned" by one of the organizational units related to user (employing or associated) or descendants thereof.

AccessModeWrite

Enumeration

Controls write access to records.

XML

Editor

Description

0

Inherit

Value is inherited from parent.

1

All

All users may write (create / update / delete) records of this type.

2

UsersAssociatedWithDataOwner

User may write (create / update / delete) only patient data that is "owned" by an organizational unit related to user (employing or associated)

3

UsersAssociatedWithDataOwnerOrAncestor

User may write (create / update / delete) data owned by an organizational unit or descendants of an organizational unit related to user.

PatientAccessMode

Enumeration

Controls read/write access to records for logged in patients.

XML

Editor

Description

0

None

Logged in patient user has NO access to data.

Used for data that is controlled by employee users (e.g. clinical staff), but must remain invisible for patients.

1

Read

Logged in patient user may read data.

2

Write

Logged in patient user may write (create / update / delete) data.

3

Inherit

Value is inherited from parent.

AccessModeDenied

Enumeration

Controls display of records, that the current user does not have read access to.

XML

Editor

Description

0

Inherit

Value is inherited from parent.

1

Hide

Unreadable records are NOT displayed at all

2

Hint

Unreadable records are shown as "hints" (e.g. as gray, inactive nodes in the Patient Record Tree).

Closable

Boolean

False: records of this type are not "closable" - they do not have open/closed modes.

True: records of this type are "closable" - they have two modes: open and closed.

Refer to Status Closed for details on how this works.

  • If computation "Close" (see Computation Reference). is defined, opening/closing happens automatically when user saves forms.

  • If computation "Close" it not defined, the usercontrols status "closed" by checking a framework generated checkbox.

SingleOpenMode

Enumeration

Controls algorithm for allowing multiple "open" records. Only relevant when Closable = true.

XML

Editor

Description

0

NoCheck

No check - it is always possible to create more than 1 open record.

1

CheckAll

Check for open records of same type within parent record - ignore data owner (OrgUnit). If there exists an open record of the same type under the given parent record, user cannot create new record.

2

CheckDataOwner

Check for open records of same type within parent record with same data owner (OrgUnit). If there exists an open record of the same type under the given parent record with a given data owner, user cannot create new record on that data owner. But it is perfectly legal to create record with different data owner.

DisplayAtTop

Boolean

Misleading name - the name of the property should be "Group"...

Only relevant for 1:N-relations.

false: Records are displayed in the Patient Record Tree together with records of other types, sorted by property SortByField (ascending or descending according to property SortDescending).

true: Records of this type are "grouped" in the Patient Record Tree using a "group" node. Below this "group" node is shown a "create" node and the records of this type in the actual context. Clicking the "group" node displays the same list of records in the right frame.

FlatView

Boolean

Controls generation of so called "flat views".

A "flat view" is a view created in the database, that joins the database table with other relevant tables:

  • The Patient table.

  • Alle "parent" tables

  • The "child" tables that have a 1:1-relation to the current table.

"Flat view" are automatically created/updated, when you update the Data Dictionary.

"Flat views" are useful when you need to get data out of the database using SQL, e.g. when Developing Reports. This is because you often need to get data from several tables in the data structure. Using "flat view" will save you from writing lots of joins in SQL.

Besides performing joins, the flat views also performs some computations (using SQL):

  • The current age of the patient (using the danish national identification "CPR-nummer").

  • For each date/time field, the flat view computes the age of the patient at the point in time given by the content of the date/time field. This is useful when you need to group data according to patients' age.

Computations

A StructureElement node may contain computations. See Computation Reference. These computations define among other things:

  • Automatic computation of data stored in the database.

  • Texts, icons, style, etc. used for display in the "record tree".

External relations
Caution note Caution

TOPICA version 4.23 an newer only!

A StructureElement node may contain zero or more External Relations.

Use External Relations if you need to have anything else that 1 relation to table OrgUnit (so that each record may have 0 to many relations to organisational units).