SetExternalContext

Sets the external context information that will be used to populate the columns of the RDCI_HISTORY records to be created. This function helps to create a comprehensive tracking record that becomes part of the RDCI history. For example, this function enables you to record when data was originally entered into an external system that later passes data to Oracle Clinical.

Syntax

short int SetExternalContext(ExternalContextInfo *context_info);

Parameters

context_info (in) A structure of type ExternalContextInfo.

Return Value

SUCCESS or FAILURE.

Comments

This function validates the value of the parameter context_info. It validates the trans_type item by checking that it contains a value from the reference codelist EXTERNAL_TRANS_TYPE. If it does not contain a value, the value STANDARD will be used. If the validation succeeds, the value of context_info will immediately take effect as the new external context info and the function returns SUCCESS; otherwise, the function will return FAILURE leaving the existing external context info intact.

The values set through a call to SetExternalContext will be reflected in all the subsequently created RDCI_HISTORY records until the next call of SetExternalContext or the call of DisconnectOCL, whichever comes first. No auditing records will be created if SetExternalContext has never been called since the last call to ConnectOCL.

An RDCI record in the API RDCI buffer will have only one audit record created for it upon the first writing to the database done due to a call of either WriteRdciRdcm or WriteResponses. Successive writing to the database while the same RDCI record is still in the API RDCI buffer will cause more audit records to be created for it only if a call to SetExternalContext has taken place after the last time an audit record was created for it.

In contrast to the API, Oracle Clinical does not maintain the RDCI_HISTORY table in the sense that it does not create or update records of that table.

The RDCI_HISTORY table will not be replicated and there are no reports running against it.

Error Messages

Table 7-30 Error Messages for SetExternalContext

Number Severity Message

284900

ERR

User does not have the privilege to call function in the current mode.

285000

ERR

Function called out of sequence.

285900

ERR

No current OCL database connection open. Use ConnectOCL to connect to OCL database.

286600

ERR

Audit reason required and not provided.

297000

ERR

Null or invalid input pointers provided.

297100

ERR

Changes pending.

304600

ERR

Function does not exist.

304700

ERR

Privilege does not exist.

Related Functions

ConnectOCL, DisconnectOCL