The Case Audit Query Management API

The Case Audit Query Management API is a public API used to run selection queries. To use this API a new Dynamic Selection Query must be created in the systems administration application. The Selection Query should contain the SQL that is required to perform the search. For example, if a new search that simply contains a status is required, a dynamic selection query must be entered that contains the selection criteria page name, along with the following SQL -

SELECT caseID INTO :caseID FROM CaseHeader WHERE statusCode = :statusCode

The Case Audit Query Management API contains one main method of interest runDynamicQueryCaseSearch. This method takes two arguments a selection query identifier and a map of selection criteria (as entered by the audit coordinator). The selection query is retrieved and the selection criteria entered by the audit coordinator are substituted into the SQL. The query is then run against the database and a list of CaseHeader records is returned.

Figure 1. The Case Audit Query Management API
/**
   * Executes a Case Audit dynamic selection query 
   * and returns a list of case header records 
   * that match the criteria specified in the 
   * dynamic query.
   *
   * @param selectionQueryID the unique identifier of the dynamic 
   * 			     selection query
   *
   * @param parameterMap Map of all parameters 
   *        in name value pairs.
   * @return A list of Case Header records that satisfy the 
   *         selection criteria
   * @throws AppException
   * @throws InformationalException
   */
    public List<CaseHeader> runDynamicQueryCaseSearch(
    final long selectionQueryID,
    final HashMap<String, String> parameterMap)
    throws AppException, InformationalException