TOPICA Basic Class Record |
[This is preliminary documentation and is subject to change.]
The Record class models one instance of a configured form (the data in one saved form) of patient record data. One form instance is stored in one database row, so there is a 1:1-relation between a Record object in TOPICA Basic and a row in one of the dynamically generated database tables.
Property | Type | Description | ||
---|---|---|---|---|
TableName | String | The table name specified in DataName in The Structure File - this is also the name of the dynamically generated database table. Equivalent to Table.TableName | ||
Id | Integer | Internal ID of the record. Guarateed to be unique in each table. I.e. the key of a record is TableName and Id. | ||
Caption | String | The caption specified in property Caption in The Structure File and hence saved in the Data Dictionary. | ||
DateCreate | DateTime | The system date/time when the record was created. | ||
DateUpdate | DateTime | The system date/time when the record was LAST updated. | ||
DateStart | DateTime | The value of the DATE_START column in the database table. The value of this field is set whenever a record (form instance) is created or updated according to this algorithm:
| ||
DateStop | DateTime | The value of the DATE_STOP column in the database table. This value is automatically set to the current system date/time when a record is closed. | ||
Closed | Boolean | The value of the STATUS_CLOSED column in the database table. Closed status. | ||
Completed | Boolean | The value of the STATUS_COMPLETE column in the database table. Completed status. Value true means, that all fields with FillInStatus not equal to "Optional" have been filled in (i.e. no fields are empty), AND that no errors or warnings were generated by any validation rule. | ||
Table | The table the curent record belongs to. | |||
Type | String | The StructureType defined in The Structure File The TOPICA framework does not use this value for anything when generating Data Dictionary, i.e. the value does not have any influence on the dynamically generated database tables. The value is used in the "Search Patient" dialog to group tables in logical groups. The user may optionaly display records belonging to tables having specified structure types. For example: the Data Dictionary may contain several tables, that all describe "encounters". Equivalent to Table.Type | ||
CreatedByEmployee Obsolete alias: CreatedBy | The employee user that created this record - will be null if it was a logged in patient, that created the record. | |||
UpdatedByEmployee Obsolete alias: UpdatedBy | The employee user that last updated this record - will be null if the record has not been updated since it was created, or it was a logged in patient, that last updated the record. | |||
EmployeeUser Obsolete alias: User | If the record was last touched by a logged in employee, this property contains the employee user that last touched this record - i.e. equal to UpdatedByEmployee if the record has been updated, otherwise equal to CreatedByEmployee record.EmployeeUser = if(IsNotNull(record.UpdatedByEmployee), record.UpdatedByEmployee, record.CreatedByEmployee) | |||
CreatedByPatient | The patient user that created this record will be null if it was a logged in patient, that created the record. | |||
UpdatedByPatient | The patient user that last updated this record - will be null if the record has not been updated since it was created, or it was a logged in employee, that last updated the record. | |||
PatientUser | If the record was last touched by a logged in patient, this property contains the patient user that last touched this record - i.e. equal to UpdatedByPatient if the record has been updated, otherwise equal to CreatedByPatient record.PatientUser = If(IsNotNull(record.UpdatedByPatient), record.UpdatedByPatient, record.CreatedByPatient) | |||
OrgUnit |
| |||
ParentRecord | The "parent" record in the Patient Record Tree Will be null if the record is directory below the root (= patient). | |||
SubRecords | All subrecords below this record. | |||
RelationsFrom | All relations from this record to any other records.
| |||
RelationsTo | All relations to this record from any other records.
| |||
XXX (whatever) | Any | If the record contains a field with field name XXX (specified by DataName in the form) the value of this field is returned. Type of the result obvioiusly depends on the type of field. Note that since a configured field with DataName="XXX" is accessed with the syntax Record.XXX, you should not use any of the "fixed" property names for your configured fields. If, for example, you configured a field with DataName = "OrgUnit", you would not be able to get the value of that field in TOPICA Basic, as Record.OrgUnit would return the data owner of the record, not the value of your field "OrgUnit". |
The Record class supports indexing by strings. The index value (i.e. the string) must be the name of a table, to which there is a 1:1-relation from the table of the current record (specified in The Structure File and saved in the Data Dictionary).
If Record.TableName = "TableX", and there is a 1:1-relation between TableX and TableY where TableX is the "parent" and TableY is the "child" - then the expression Record["TableY"] will return the record (form instance) of type TableY. The result is an object of type Record, if the child form has been filled in, and null if the child form has NOT been filled in.
Example:
if(IsNull(Record["TableY"], "Form Y has not been filled in", "Value of form Y, field Z: " + Record["TableY"].Z)