DF_ICqcs

DF_ICqcs — Check queries for consistency with data records

Synopsis

DF_ICqcs {study} [ [-r] ]

Description

DF_ICqcs checks the Query database for free-floating queries (i.e. having key fields that do not match an existing data record), duplicate queries (i.e. more than one query attached to the same data field), and unresolved queries bound to final database records.

DF_ICqcs only checks field level queries. It does not check code 21 (missing plate) or code 22 (overdue visit) queries created by DF_QCupdate or code 23 (missing plate) queries created by edit check function dfaddqc. Code 21 and 22 queries are removed when the missing plate is entered into the database, or by DF_QCupdate if the plate or visit is no longer missing or overdue, or by the database server when it shuts down, if the subject ID to which the query refers is no longer present in the database. Code 23 queries are only removed when the missing plate is entered into the database. These queries are not touched by DF_QCupdate or by database server shutdown. It would be legal for example, for an edit check to create a code 23 query for a subject that did not exist in the database but should exist according to the study protocol (e.g. when subject IDs must be used in sequence and a gap is found in the subject IDs).

In addition to reporting the number of query inconsistencies found, DF_ICqcs creates a separate output file, containing the problem queries, for each type of query inconsistency found. Each of these files has the current date and time as a common suffix and a prefix matching the type of inconsistency:

  • qcfree for free-floating queries

  • qcdup for duplicate queries

  • qcinc for unresolved queries on final records

The -r option can be used to repair 2 of these inconsistencies. When this option is used free-floating queries are deleted and unresolved queries on final records are changed to "resolved, corrected" with the current user and timestamp inserted into the query's resolution field. No attempt is made to resolve duplicate queries.

Duplicate queries can be resolved by using the qcdup output file, changing the status field to the value 7 (delete) on the queries you wish to delete, removing the queries that you wish to keep, and then importing the records to be deleted using DFimport.rpc.

Options

-r

Repair inconsistencies that are found. The repairs are made by deleting free-floating queries and marking as resolved any unresolved queries found on final records.

Limitations

This report only checks field-level queries (code 21-23 are ignored), and the repair option is not able to correct duplicate queries.