FetchRdci

Use this function to fetch an existing header RDCI record from the database. FetchRdci pulls an RDCI record, along with all its underlying RDCM records, from the database into the API RDCIRDCM buffer. It returns the API RDCI record and an array of RECEIVED_DCM_IDs of all the API RDCM records.

Syntax

short int FetchRdci(double received_dci_id,
    DCIAPIFlag lock_flag,
    int rdcirdcm_mode,
    RdciRecord *rdci_rec,
    RdcmArr *rdcm_arr);

Parameters

received_dci_id (in) The received_dci_id of the RDCI record to be fetched. Use the stable interface to retrieve the correct ID. See the Oracle Clinical Stable Interface Technical Reference Manual for the documented data model.

lock_flag (in) A flag indicating whether the specified RDCI record should be locked or not. Values are true for a locked record or false for an unlocked record.

rdcirdcm_mode (in) The mode to be used for executing this function. It also stays in effect as the RDCIRDCM mode up to the next call of either CreateRdci or FetchRdci. Values are initial_log-in, first_pass_entry, key_changes, update or browse.

rdci_rec (out) A structure of type RdciRecord that the function fills in with the content of the just-populated API RDCI record.

rdcm_arr (out) A structure of type RdcmArr consisting of an array of the RECEIVED_DCM_IDs of all underlying RDCM records fetched along with the specified RDCI record, and the number of elements in that array that the function fills in.

Return Value

SUCCESS or FAILURE or WARNING.

Comments

FetchRdci flushes the RDCIRDCM buffer, then searches the database for an RDCI record whose received_dci_id equals the parameter received_dci_id. If FetchRdci finds a record, the function:

  1. fetches the record, in the specified locking mode, into the API RDCI buffer.
  2. fetches all the underlying RDCM records into the API RDCM buffer.
  3. returns the contents of the populated API RDCI record in the parameter rdci_rec.
  4. returns the RECEIVED_DCM_IDs of all the populated API RDCM records in the array component of the parameter rdcm_arr.

However, if FetchRdci does not find an appropriate record, it fails. It also fails if it finds the record but cannot get the lock required by the parameter lock_flag. A FAILURE happening at any point during the steps above causes the function to stop with FAILURE without reversing the effect of the flush.

Error Messages

Table 7-10 Error Messages for FetchRdci

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.

286300

ERR

Locking mode incompatible with data entry mode.

286600

ERR

Audit reason required and not provided.

293800

WRN

You are working with a data locked record and have privileged update.

294600

ERR

Document found in different study. Change study to access.

296600

ERR

Cannot preserve lock when performing a rollback.

296700

ERR

Unable to lock RDCI.

297000

ERR

Null or invalid input pointers provided.

297100

ERR

Changes pending.

299000

ERR

Only browse mode can be performed from a frozen study.

299200

ERR

RDCI status is incompatible with querying the record in first-pass data entry mode.

299300

ERR

RDCI is accessible. You can query only inaccessible documents in first-pass data entry mode.

299400

ERR

Operator comment in browse is disabled. You cannot fetch the document in locking mode.

299500

ERR

RDCI is inaccessible. You can query only accessible documents in browse mode.

299600

ERR

Owning location of the patient is different from that of the database.

300700

WRN

Patient is frozen. The RDCI record will behave as if it were fetched in non-locking mode.

300800

WRN

Data on this RDCI is locked. The RDCI record will behave as if it were fetched in non-locking mode.

304600

ERR

Function does not exist.

304700

ERR

Privilege does not exist.

306300

ERR

Received DCI is inactive or invalid.

306500

ERR

Unable to release lock.