WriteRdciRdcm
This function reviews the header information in the API RDCM and RDCI buffers and validates that each of the API RDCM records is a unit that includes all necessary data. In addition, it verifies that there are no duplicate RDCMs in either buffer or in the database. If there are duplicate RDCMs in the buffer:
- the RDCM ID of the RDCM being tested is returned in the double *received_dcm_id parameter
- the ID of the duplicate RDCM is returned in the double *received_dcm_id_dup parameter
If there are duplicate pre-existing RDCMs in the database, an error is returned and the document number of the duplicate record is returned as part of the error message text. Once the API RDCM records are validated as a unit and all duplicates are resolved, this function writes the contents of the API RDCIRDCM buffers to the database and commits. If someone has created a duplicate RDCI between the time you called ProcessRdci and the time you called WriteRdciRdcm, the duplicate will be trapped at the time of the commit and the function will fail. Then it either preserves the lock on the API RDCI record or releases it based on the value of the parameter preserve_lock.
Syntax
short int WriteRdciRdcm (DCIAPIFlag
preserve_lock,
double
*received_dcm_id
,
double
*received_dcm_id_dup
);
Parameters
preserve_lock
(in) A flag indicating whether the lock on the API RDCI record should be preserved or released. If the value is TRUE, the lock will be kept and if it is FALSE, it will be released.
received_dcm_id
(out) The RECEIVED_DCM_ID of either the first API RDCM record to fail validation in steps 1 or 2 below or the first API RDCM record in a pair of duplicate API RDCM records found in step 3 below.
received_dcm_id_dup
(out) The RECEIVED_DCM_ID of the second API RDCM record in a pair of duplicate API RDCM records. This parameter will contain null if there are no duplicate API RDCM records encountered.
Return Value
SUCCESS
or FAILURE
or WARNING
.
Comments
To validate each API RDCM record as a unit, this function takes these steps for each API RDCM record:
- The function checks that all the mandatory items in the API RDCM record are populated.
- WriteRdciRdcm performs cross-item validation. If either the previous step or this step fails, the function stops with FAILURE returning in the output parameter received_dcm_id the RECEIVED_DCM_ID of the API RDCM record and null in the parameter received_dcm_id_dup.
- The function performs uniqueness validation for the API RDCM record. If it finds a duplicate within the other API RDCM records it returns the following values:
- In the output parameter received_dcm_id, the function returns the RECEIVED_DCM_ID of the API RDCM record currently being validated.
- In the output parameter received_dcm_id_dup, the function returns the RECEIVED_DCM_ID of the duplicate API RDCM record found, in addition to an error message.
If, on the other hand, WriteRdciRdcm finds a duplicate under another RDCI in the database, the function just returns an error message.
As part of the validation it carries out, this function will change the value of the blank flag of the API RDCI record to bring it in sync with the set of blank flag values of all the API RDCM records, if this change is necessary.
This function also assigns values to the time stamp items of both the API RDCI record and the API RDCM records.
To see the effects of this function on the API RDCIRDCM buffer, the front end has to call GetRdci and GetRdcm.
To validate a single API RDCM record, see ProcessRdcm.
Error Messages
Table 7-39 Error Messages for WriteRdciRdcm
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. |
290100 |
ERR |
Duplicate Received DCM found within this Received DCI. |
290200 |
ERR |
Duplicate Received DCM found within document number: \0. |
290300 |
ERR |
Current record is not complete: Operation was not successful. |
291500 |
WRN |
Subevent not found: actual event will be created once you save. |
292000 |
ERR |
Blank flag must be entered. |
292100 |
ERR |
Clinical planned event name must be entered. |
293000 |
ERR |
Subevent number must be entered. |
293300 |
ERR |
DCM time must be entered. |
293400 |
ERR |
Qualifying value must be entered. |
293600 |
ERR |
Too many actual events correspond to this subevent #. |
293700 |
ERR |
DCM date must be entered. |
293800 |
WRN |
You are working with a data locked record and have privileged update. |
294200 |
ERR |
An error occurred while processing the Received DCI structure and updating the PATIENT_DM_TRACKING table. |
294300 |
ERR |
An error occurred while processing the Received DCM structure and updating the received DCI. |
294700 |
ERR |
Received DCI is protected because at least one of its received DCMs is locked. |
294800 |
ERR |
An error occurred while in the Rxc_Login_Pack. SoftDeleteAll received DCMs function. |
295200 |
ERR |
Too many rows found in NON_EXPECTED_DCMS table. |
295800 |
ERR |
Problem retrieving from the actual event sequence. |
296700 |
ERR |
Unable to lock RDCI. |
297000 |
ERR |
Null or invalid input pointers provided. |
300700 |
WRN |
Patient is frozen. The RDCI record will behave as if it were fetched in non-locking mode. |
301200 |
WRN |
No changes to save. |
304600 |
ERR |
Function does not exist. |
304700 |
ERR |
Privilege does not exist. |
306100 |
ERR |
Changes pending that have not been processed. |
306400 |
ERR |
Too many current actual events. |
306500 |
ERR |
Unable to release lock. |
307000 |
ERR |
Cannot call this function if you have not locked the record. |
307400 |
ERR |
Please use the patient enrollment form to specify which DCI Book to use to maintain the page tracking information. |
315500 |
WRN |
RDCI is not protected because at least one of its RDCMs is locked and you have privileged update. |
Related Functions
Parent topic: Data Capture API Functions