Validate Field has no leading 0s

This tutorial explains how to build a Segment/Field rule validating that leading 0s were removed from field.

In this example. let’s validate that PID.3.1 (Patient Identifier) has no leading zeros. 

  1. In the inbound HL7 task, select the Validation tab
  2. Select the Segment/Field Validation tab
  3. Add the rule: PID.3.1 is matching regex ^[1-9]d*$

     

     

    This rule means that:

    • The first character must be between 1 and 9 (not 0) (^[1-9])
    • The other characters must be digits (between 0 and 9) (d*$)

 

Download the rules file (Field has no leading 0s.cxf)

Learn more about how to import validation rules into an inbound HL7 task.