View Categories

Pre-Processing scripts

2 min read

What is a pre-processing script? #

A pre-processing script is a ccl script that runs when an order is placed. It adjusts or sets values in the order details when the order is signed for the first time. You can use a pre-processing script to make the ordering process a little easier because it sets values for fields that can be calculated automatically avoiding the end-user having to set these fields manually.

A use case for a pre-processing script is adjusting the Future Order field based on the value of the Order Priority field.

When not to use a pre-processing script #

Please remember that you can use Order Entry Format flexing to set default values for orders when being placed. Order Entry Format flexing can be done on several conditions like the patient’s location, the ordering location, the encounter type or the user’s position. Its is best to create a pre-processing script only after determining that Order Entry Format flexing won’t be helpful for what you are trying to accomplish.

It’s important to realize that pre-processing scripts might not always be the best solution – especially when managing clinical data. As an example, let’s say you are working to implement the order catalog for the Radiology department. The department might ask for a pre-processing script to automatically fill in a field that specifies if the patient is allergic to Oidium. The pre-processing script could evaluate the allergies documented for the patient and fill this field in automatically. However, by avoiding this step for the user placing the order, the end user might not think to ask the patient about this allergy and as a consequence, not realizing that the allergy is not documented in the Allergy profile. The user might also add the allergy to Oidium after signing the order, not realizing that the pre-processing script only runs once for an order and never thereafter. As you can see, it’s best to only use pre-processing scripts for fields that contain non-clinical details.

Lastly, for a long time now, Cerner has been against using pre-processing scripts. Getting support is hard as pre-processing scripts are based on client customization which, as such, is not supported.

An example of a Pre-processing script #

Attached to this guide, you will find a pre-processing script you can use as a example or a template for creating your own pre-processing script.

The pre-processing script attached adjusts a lab order’s Requested START DT TM field to not fall on weekends or a public holiday. The script only makes this adjustment when the collection priority is not STAT and when the order is placed as a future order. You will notice that the pre-processing script uses a subroutine to determine if a date is a public holiday or not.

When the adjustment is required, the pre-processing script searches for the first work day after the date specified in the Requested Start DT TM field of the order.

Creating a pre-processing script #

A pre-processing script is just a CCL script. What makes a CCL script a pre-processing script is the request and reply records it manages.

The request record it receives is the following:

record request (
1 encntrid              = f8
1 personid              = f8
1 synonymid             = f8
1 catalogcd             = f8
1 orderid               = f8
1 detaillist[*]
    2 oefieldid           = f8
    2 oefieldvalue        = f8
    2 oefielddisplayvalue = vc
    2 oefielddttmvalue    = dq8
    2 oefieldmeaningid    = f8
    2 valuerequiredind    = i2
)

The reply record that the script must fill in is the following:

record reply( 
    1 orderchangeflag       = i2 
    1 orderid               = f8 
    1 detaillist[*] 
        2 oefieldid           = f8 
        2 oefieldvalue        = f8 
        2 oefielddisplayvalue = vc 
        2 oefielddttmvalue    = dq8 
        2 oefieldmeaningid    = f8 
        2 valuerequiredind    = i2 
%i cclsource:status_block.inc 
)

Settings up a pre-processing script #

Once you have the pre-processing script, you need to add the Pre-processing script field to the order’s Order Entry Format. The default value of this field must contain the object name of the script.

As you can see, the pre-processing script is associated with a Order Entry Format and will run for all orders of that Order Entry Format.

Powered by BetterDocs

This site uses cookies to function and analyze usage. By accepting, you consent to their use and data processing.    Know More
Privacidad