Message syntax

Segments and optional fields can happen in any order. To support this random order in NCPDP Telecom messages, the BNF (Backus Naur Form) message definition syntax includes a notation called Set.

A set is represented by an opening and closing pair of parentheses. A segment set indicates that any segment can display in any order and only displays at most once.

For example:

07
        (
                02
                03
)
09

In this example, both segment sequences of 07 02 03 09 and 07 03 02 09 are valid. A segment sequence of 07 02 02 09 is invalid.

Because a segment in a set can only display one time, you can simplify the GRM addressing to not increase the group count. The GRM addresses for each segment in the above message definition, is:

07                -- 0(0).07
(
        02        -- 0(0).02
        03        -- 0(0).03
)
09                -- 0(0).09

If the set definition changes as a repeating group, then the GRM address for the above message definition is:

07                -- 0(0).07
{
        02        -- 1(0).02
        03        -- 1(0).03
}
09                -- 2(0).09

This is an example of Set notation that represents an NCPDP Telecom message type including all segments and all fields in segment 05.

00
[01]
[04]
{[
      07
      (
              02
              03
              [  -  to start the 05 (COB) group
                      AM - segment identifier
                      4C - COB count
                      {
                              5C - other payer coverage type
                              (
                      6C - other payer ID qualifier
                      7C - other payer ID
                                      E8 - other payer date
                                      [
                                              HB - other payer amount paid count
                                              {
                                                    HC - other payer amount paid qualifier
                                                    [DV] - other payer amount paid
                                              }
                                      ]
                                      [
                                              5E - other payer reject count
                                              {6E} - other payer reject code
                                      ]
                              )
                      }
               ]

               06
               08
               11
      09
      10
      12
      13
)
]}