Testing and Activating Procedures

After you define a Procedure, you must generate it and set its status to Active before you can execute it. Oracle Clinical does not enforce Procedure testing, but provides for it (see Testing a Procedure).

For more information, see:

Generating and Compiling a Procedure

When you invoke generation, Oracle Clinical takes the definitions you have specified and converts them to the PL/SQL code that will perform the Procedure.

  1. In the Procedure Definitions window, highlight the Procedure you want to generate and compile.
  2. Select Generate Proc from the Special menu. Oracle Clinical generates the PL/SQL code to execute the Procedure in the background and updates the Last Generated field with the current date, or displays an error message. A message confirms when the generation is complete.
  3. To view error messages resulting from a failed generation, choose View Parse Errors from the Special menu.

    Note:

    If you receive an error on generation that refers to a naming conflict with the Question QGalias.LAB, you have a study Question named Lab that conflicts with the standard procedures lab Question named Lab. To resolve the problem, you can change the standard lab Question alias in the OCL_STATE local reference codelist (under Admin).

Editing Generated PL/SQL Code

If you have the required security privileges, you can edit the actual generated PL/SQL code. However, you should take extreme care and use custom code whenever possible (see Adding Custom Code).

Note:

Changes that you make directly to the generated code (not through the Custom Code window) will be lost the next time the Procedure is generated.

You can also use the editing window to view the generated code and better understand what effect your Procedure definitions and settings have on the generated code.

If you have a navigation path choice called Procedures w Edit after either Validation or Derivation Procedures, you have the required privileges to edit generated Procedure code.

  1. In the Procedure Definitions window, highlight the Procedure with the generated PL/SQL code you want to edit.
  2. From the Special menu, select Edit Gen Proc to display the generated PL/SQL text.
  3. Modify the text.
  4. Save. Oracle Clinical returns to the Procedure Definitions window, sets the value in the Edited? field to selected, and re-parses the code.
  5. Enter a comment about why you edited the text.
  6. Click Back to return to the original window.
  7. From the Special menu, select View Parse Errors.

Testing a Procedure

Before making a Provisional Procedure active and running it against production data, you should test it (see Test Mode for information on Oracle Clinical's Test mode). You can then modify the Procedure components as necessary while the Procedure is still Provisional.

You can test the Procedure from either Procedure definition or study testing. You can view the results of testing Validation Procedures in the Test Discrepancy Database; from the Definition menu, select Test a Study, then choose Discrepancy Database. Unlike Production mode, in Test mode each time you run a test, the previous discrepancy data for that test is erased.

For more information, see:

Testing a Procedure from Definition

To test a Procedure from Definition, do the following:

  1. In the Procedure Definition window, highlight the Procedure and select Execute in Test from the Special menu. A dialog box appears.
  2. If you want to run the Procedure in Debug mode, which lets you view the individual values as they are validated in the .out file, choose Yes. A message appears, giving you the batch job ID number.
  3. To check on the job's progress and see the .out and .log file names, select Batch Jobs from the Action menu.
  4. View the results:
    • See the .log and .out files in the procedure output files on the server.

    • See the discrepancies created by the Procedure in the Discrepancy Database by selecting Show Test Discrep from the Special menu in the Procedure Definition window. Alternatively, from the Conduct menu, select Data Validation, then Discrepancy Database.

Testing a Procedure from Test a Study

To test a Procedure from Test a Study, from the Definition menu, select Test a Study, then Execute Single Procedure, and follow standard procedure for submitting batch jobs. To view the results:

  • See the .log and .out files in the procedure output files on the server.

  • See the discrepancies created by the Procedure in the Discrepancy Database by selecting Show Test Discrep from the Special menu in the Procedure Definition window. Alternatively, from the Conduct menu, select Data Validation, then Discrepancy Database.

Assigning Procedure Status

Oracle Clinical automatically assigns a status of Provisional (P) to new or copied procedures. You can delete, modify, and test only Provisional Procedures. You can copy and run only Active (A) Procedures. Procedures you no longer want to run during batch validation should be set to Retired (R).

If you have the appropriate security privileges, you can:

  • Change a Provisional Procedure to Active.

  • Change a Retired Procedure back to Active.

  • Change an Active Procedure to Provisional (although this action deletes all discrepancies associated with the Procedure).

Note:

When a Procedure's status is changed from Active to Provisional, all discrepancies associated with it are deleted during the next batch validation run. To avoid this, create a new version of the Procedure from the Special menu."

To change the status, enter the appropriate letter (P, A, or R) in the Status field in the Procedure Definitions window.

Oracle Clinical runs all Active Procedures during each batch validation.

Assigning Standards Affiliation

After you have defined a Procedure in a study, generated and tested it, work with the Global Librarian to copy it into the Global Library so that you can use it in other studies. In the Global Library you can also assign it one or more standards affiliation types to identify its purpose, to mark the Procedure as Required (or not) in a study with a particular standards affiliation, and to make the Procedure easier to find for future reference. You cannot define Procedures in the Global Library. (See the Oracle Clinical Getting Started manual for information on the Global Library.)