Having configured the Extraction Rules activities, we can add business rules to validate and normalize the field values.Documentation Index
Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
Use this file to discover all available pages before exploring further.
Adjusting the doctor’s ID
Adjust the Doctor ID field properties to clean up OCR errors and unwanted characters from the pre-recognition results. After the field region is found, a regular expression in the field properties re-extracts the data and removes OCR noise.Open the Doctor ID field settings
- Click the skill name and go to the Fields tab.
- Expand the “Doctor” group and open the “Doctor ID” field settings by clicking the settings icon next to it.
Add a regular expression
- In the Value section of the field properties, click the add icon next to the Regular expression option.
-
Paste the following expression into the Regular Expression Editor:
This editor uses common notation that differs from the notation used in the Extraction Rules Activity Editor. For more information, click Syntax help in the Regular Expression Editor.
Checking if the sick note is valid
A patient must receive a sick note within 3 days of the sickness start date. In field terms: the issue date must be no more than 3 days after the start date. Use a script rule to enforce this constraint.Open the New Rule dialog
Click the add icon under the data form. The New Rule dialog opens.
If you don’t see the add icon, switch to the Reference section above the document image.
Configure the rule type and fields
- Select Advanced Script Rule and click Next.
- Rename the rule to “Check validity”.
- Select the “Date”, “Start Date”, and “End Date” fields in the list of fields.
- Click Next.
Add the validity script
Paste the following script in the script editor:Click Save and examine how the rule works on different documents in the set. To check how the rule handles errors, enter test values in the fields on the data form manually — the rule re-applies each time you change the field value.
Checking the sick leave duration
Calculate the sick leave duration from the start and end dates. If the document already specifies a duration, the rule verifies it matches; if not, the rule fills the duration field with the calculated value.Configure the rule type and fields
- Select Advanced Script Rule and click Next.
- Rename the rule to “Check duration”.
- Select the “Start Date”, “End Date”, and “Duration” fields in the list of fields. Select the fields in both columns — the rule both reads field values and corrects them if necessary.
- Click Next.
Add the duration script
Paste the following script in the script editor:Click Save and examine how the rule works on different documents in the set. To check how the rule handles errors, enter test values in the fields on the data form manually — the rule re-applies each time you change the field value.
What’s next
Step 10. Test and publish the skill
Test the configured skill and publish it to the Vantage server.
Tutorial overview
Back to the tutorial introduction.
