Customisation of processes in is done by introducing Business Rules that run at various places within the procedures.
Business Rules are a series of SQL commands that will be executed as part of a procedure. These Business Rules can be used to load and transform patient data into the system, create Feeder Keys, which in turn are used to create Products for costing. Users must be technically adept at Microsoft SQL to add or amend Business Rules.
There are three types of Business Rules:
- Procedure Business Rules run as part of a procedure, for example the Inpatient Activity Load Process. These run on particular events that exist within the procedure. You can create multiple Business Rules that run on a single event and they will be run sequentially. Procedure Business Rules are defined with a Procedure (defining the procedure the rule will run in) and an Event (defining at what point in the procedure the rule will be run). These rules are useful when you are needing calculations performed, values defaulted, etc as part of a larger process.
- Global Business Rules run as a step in the overnight load process. They are useful where you have actions that should be performed once all the activity loads have completed.
- Matching Rules run as part of an Activity Load to match activity to episodes without the need to write SQL.
Fields
Order – The order in which a Business Rule will run if there are multiple Business Rules in one procedure. | |
|
ID – A system generated unique ID. |
|
Description – A meaningful description explaining what the Business Rule does. |
|
Rule Type – A meaningful description of the type of Rule. |
|
Last Run Date – The date that the Rule was last run. |
|
Procedure – The stored procedure that will call the Business Rule. |
|
Event – The event in the specified procedure that the Business Rule will run in. e.g. Initialise. |
|
Code – The code for the Business Rule. |
|
Start Date – The first year that the Business Rule will be run |
|
End Date – The last year the Business Rule will be run (optional). This will default to 2070 if no Year End is entered. |
|
Enabled – Allows the user to enable or disable the rule. |
|
Action Type – A user defined field to help classify the Business Rule to assist in searches. |
|
SQL – Allows the user to preview the SQL without opening the editor screen. |
|
Notes – Any notes, reminders, instructions or keeping a record of any adjustments made within the screen. |
Add a New Business Rule
You can add a new Business Rule by selecting one from the drop-down. Below shows the pop-up window for the procedure/global Business Rule.
Matching Rules
Fields
Module – Select the module in which the Business Rule is to be created. This assists in searching for relevant rules. | |
|
Mode – Select Procedure or Global Business Rule. A Procedure Business Rule requires you to select a Procedure and an Event. |
|
Enabled – Checking this box sets the Rule to run. Leaving it unchecked will disable the Rule and it will no longer run. |
|
Procedure – The schema and procedure that the Business Rule will run in. |
|
Event – The event in the specified procedure that the Business Rule will run in e.g. Initialise |
|
Order – There can be multiple Business Rules running in one load procedure and Rule Order dictates the order in which the Rules will run |
|
Return Flag – The ability to return a variable back to the load procedure or other Business Rules. Only used in special instances. |
|
Critical – Checking this box causes the entire procedure to stop and roll back in the event of the Rule failing/erroring. |
|
Code – The code for the Business Rule. |
|
Description – A brief description of the purpose of the Business Rule. |
|
Action Type – An optional grouping of like Rules. For some procedures this is used to find the valid Business Rules to run. |
|
Start Date – The date of the data the Rule will run from. This will default to the start of the current fiscal year. |
|
End Date – The date of the data the Rule will run to. This will default to 01-01-2070. |
|
SQL Editor – The SQL that will be run. |
Edit Existing Business Rules
Update any existing Business Rules by clicking on the to the left of the Business Rule and updating the fields listed above.
Create a Similar Rule to an Existing Rule
You can create a Rule similar to an existing Rule by clicking on the , selecting Save as New (highlighted by the green box below), and saving a copy of the Rule with a new ID.
Then click on the to the left of the new Business Rule and update the fields as required.
The Edit window also shows the details of previous runs of a Business Rule (highlighted by the red box below):
- Run at = run date and time
- Duration = how long the Rule took to run
- Records = how many records the Rule applied to
Post your comment on this topic.