Corticon Decision Services can process very large datasets efficiently by using the
Corticon Advanced Data Connector and batch processing capabilities in the Corticon Web
Console. Corticon Studio includes the Batch Processing sample which provides a completed
project demonstrating batch processing. This tutorial dives deeper, providing you
step-by-step instructions for taking an ADC enabled decision service and using it for
batch processing.
Requirements:
Install Corticon Studio, Corticon Server, and Corticon Web Console.
A supported database. This tutorial assumes MS SQL Server. (Several other
databases can be used.)
Use the sample project
To get started, use the ADC Database Connectivity sample included in the Corticon Studio
installation. The Ruleflow in the sample project has three steps:
ADC is used to retrieve the information for one or more patients and procedures
they received from a database.
Rules execute to determine if a procedure is approved.
ADC writes the approval status for each procedure back to the database.
The project's Ruleflow illustrates the steps:
The Ruleflow operates on a set of input patient IDs. This is essential to understanding
batch processing. Corticon Server’s batch processing capability will be used to retrieve
“batches” of patient IDs from the database, and then ADC will efficiently retrieve the
information for these patients, apply rules, and then store the results back into the
database. The efficiency is realized in the minimizing of the number of database
queries: retrieving the information for 1000 patients with one query is much more
efficient than a thousand separate queries.
Scroll to the Advanced section on the
left-side of the screen. Click ADC Database Connectivity, and
then click Open.
Choose the ADC Database Connectivity
option, and then click OK.
The ADC Database Connectivity project is imported, and displayed in the
Project Explorer window.
Set up the database
Create a database named PatientRecords in a
database Corticon can access. You will need write access to this database to complete
the tutorial.
Expand the ADC Database Connectivity project, and then locate the
adc and patient SQL scripts for
the appropriate database product.
Execute the scripts in the database management tool's editor. The
scripts create ADC, Batch, Patient and Treatment tables in the
PatientRecords database, and then update the tables with
data.
Configure ADC for your database
Test your database connection in Studio by opening the project's
Vocabulary, Medical.ecore, and then updating the connectivity tabs
for Query and Patient Data.
In each tab, select the appropriate Database Server, and then enter
its URL, and authentication values.
Click CONNECTION Test to validate the
connection.
On the Vocabulary menu, select Datasource Configuration File > Export. Save the configuration file as
PatientApprovalConfiguration.xml at a location that it will be
accessible to the Corticon Server installation that will be servicing the batch
processing.
Test the
ruleflow
Open the sample's Ruletest, ProcedureApproval.ert.
Execute the No Input Data Testsheet. You
should see the following output:
When you see this output when running the ruletest, your ruleflow is functioning
properly. It is ready to be deployed to Corticon Server and used in batch
processing.
Package the decision service
In the Project Explorer, right-click on the ADC
Database Connectivity project.
Choose Package and Deploy Decision
Services, and then choose Package and save for later
deployment. Click Next.
Select the ProcedureApproval
ruleflow.
Choose a directory that will be accessible by the Server, and then
click Finish.
Your Decision Service is now ready to deploy.
Deploy the Decision Service
Start Corticon Server.
Connect to Corticon Web Console from your browser using the default
credentials Admin/Admin. The typical address for the Web
Console is http://localhost:8850/corticon. The Web
Console opens
Click Manage Decision Services, and then
click Add Decision Service.
Select Add a single Decision Service, and
then click OK.
EDS File: navigate to the ProcedureApproval.eds file you created, and then select it.
Servers: Select the server location; typically, local
server.
The completed Decision Service tab looks like this:
Click the Database tab, and then
choose the Datasource Configuration File you exported
from Corticon Studio.
Click Save and Deploy. The completed Datasource tab
looks like this:
The Web Console displays the Decision Service.
Create a batch configuration
Select Batch Configuration on the left side
of the Web Console.
Click New Batch Configuration.
In the New Batch Configuration dialog,
enter:
Enter MyADC_Batch for the Batch
Configuration Name.
Choose Select Decision Service, and then chooseMyADC_Sample 1.0.
Choose the Datasource Patient
Data.
Choose the Query AllPatients.
The Batch Configuration looks like this: Click Save.
The Batch Configuration panel displays the new configuration.
Run a batch job
On the Batch Configuration: MyADC_Batch
page, click Execute to run the batch process.
After execution, the Process Count shows as 10 on
the Batch Configuration: myADC_Batch page:
To see that the batch processing ran as expected, look in the Treatment table of the PatientRecords
Database for values in the Approved column:
Run a Parameterized Batch Job
You can set your batch configuration with query parameters for more
control. To try it out:
Select the MyADC_Sample 1.0 Decision
Service.
Choose the Patient Data datasource.
Select PatientsByRegion for the query,
which will add fields under Query Parameters.
Enter NE for the region value, and then
click Save.
Execute the MyADC_Batch_regional job. Only
the four patients from the NE region are processed in the Treatment table of the
PatientRecords database.
Run a Large Batch Test
The scripts from the Batch Rule Processing sample can be used to run
large amounts of data through a Decision Service at one time. To test this out, a batch
utility script generates patient records into the database. The example adds a thousand
more records.
In the Corticon Studio's Project Explorer window, locate the
Batch Rule Processing sample's SQL for your database, choose the generate_patients script, and then open it in a database
management tool.
Execute the script in the database. The database table expands to
1000 records.
In the Web Console, choose the Batch Configuration
MyADC_Batch, and then click Execute. While you have 1000 patients,
only 171 of them are in the NE region.
Edit the Batch configuration to set the Query to AllPatients. Save it
and then click Execute. All 1000 records are processed.
When the job is done, open the Decision Service panel in the
Web Console to see the updated counters and charts:
You have successfully completed the Batch Processing tutorial!
You defined the Decision Service and its Datasource Configuration for where you
set up the database.
You ran the Web Console to set up the Decision Service, and then created the
batch configuration.
You executed the batch process and then modified the configuration to filter for
a subset of the records.
You expanded the database to have a much larger number of records such that when
you ran the batch again, it applied to only the filtered records.
You removed the filter so that all records were processed.
You then reviewed the processing statistics.
You can customize the process for your own data to take advantage of Corticon’s
powerful batch processing capability.