Example 3: Adding and Comparing Numeric Values

In the 835 Health Care Payment Advice, the CLP03 is the amount submitted for a claim, and the CLP04 is the amount paid. If they are different, the differences must be specified in the CAS. The amounts in the CAS03, 06, 09, 12, 15, and 18 must equal the difference between the CLP03 and CLP04.

In other words:

CLP03 - CLP04 = (CAS03+CAS06+CAS09+CAS012+CAS015+CAS018)

A strategy:

  1. Initialize CASTOT, CLP03, and CLP04 variables by setting them equal to 0 on the CLP segment, which is mandatory:

  2. On the CLP03, put its value into variable CLP03:

  3. Add up amounts in CAS03, 06, 09, 12, 15, and 18 by putting this AddVar on each one:

  4. On the CLP04, put its value into variable CLP04:

  5. On the Patient Name NM1 (the next mandatory segment), see if
    CLP03 - CLP04 = CASTOT; if not, display an error message: