NCPDP Telecom message structure

An NCPDP Telecom message consists of a group of segments that are composed of a group of fields. The first segment of every transmission, request or response, is the header segment. This does not have a segment identification, because it is a fixed field and a fixed-length segment.

Caution: 
Avoid changing transaction headers, as this can cause engine and Translation Tool problems.

After the header segment, other segments are included, according to the particular transaction type.

Every other segment has an identifier to denote the particular segment for parsing. Segments may display in any order after the header segment, according to whether the segment happens at the transmission or transaction level. Segments cannot repeat within a transaction. In a multi-transaction transmission, a segment may happen only once.

All fields are required positionally and filled to their maximum designation in the header segment. This is a fixed segment. If a required field is not used, then it must be filled with spaces or zeros. The fields within the header segment do not use field separators.

Other segments may have both required and optional fields. Optional fields in a segment are submitted after the required fields. Both types of fields must be preceded by a field separator and the field’s identifier. Optional fields may display in any order except for those designated with a qualifier or in a repeating group. The required and optional fields may be truncated to the actual size that is used.

Parsing is accomplished with the use of separators:

  • Segment Separator: Hex 1E
  • Group Separator: Hex 1D
  • Field Separator: Hex 1C

The general structure of a request is:

Header Segment (00)
Patient Segment (01)
Insurance Segment (04)
Transactions (up to four per transmission)
Claim Segment (07)
Pharmacy Provider Segment (02)
Prescriber Segment (03)
Coordination of Benefits/Other Payments Segment (05)
Workers' Compensation Segment (06)
DUR/PPS Segment (08)
Pricing Segment (11)
Coupon Segment (09)
Compound Segment (10)
Prior Authorization Segment (12)
Clinical Segment (13)

The number within the parentheses represents unique segment numbers for transaction.

This is an example of an NCPDP Telecom B1 message. In this example, after segment 07, both segment 02 or segment 03 can display in any order.

00665OB112345678901O74563663bbbbbbbb1997O91598765bbbbb<1E><1C>AM01<1C>CX01<1C>CY123456789<1C>C419620615<1C>C51<1C>CAJOSEPH<1C>
CBSMITH<1C>CM123 MAIN STREET<1C>CNMY TOWN<1C>COCO<1C>CP34567<1C>CQ2014658923<1C>C70<1C>CX50Z123<1C>1C2<1E><1C>AM04<1C>
C2987654321<1D><1E><1C>AM07<1C>EN1<1C>D21234567<1C>E103<1C>D700006094228<1C>E730000<1C>D30<1C>D530<1C>D61<1C>
D80<1C>DE19970920<1C>DF05<1C>DJ1<1C>DK0<1C>ET30000<1C>C82<1C>DT1<1C>28EA<1E><1C>AM02<1C>E939359<1E><1C>AN03<1C>EZ8<1C>
DB00G234<1C>1E10<1C>DRJONES<1C>PM2013639572<1C>2E1<1C>DL123456<1C>H5101<1C>4EWRIGHT<1E><1C>AM11<1C>D9557
{<1C>DC100{<1C>DX100{<1C>H71<1C>H81<1C>H9150{<1C>DQ807{<1C>DU807{<1C>DN3        

For example, both are valid:

<1E><1C>AM07..<1E><1C>AM02..<1E><1C>AM03..
<1E><1C>AM07..<1E><1C>AM03..<1E><1C>AM02..

The same rule applies to the optional fields within segment.

Java UPoC Class

NcpdpM class is a sub-class for GRM class in Java UPOC.

public class NcpdpM extends Grm {
NcpdpM (CloverEnv x);
public static void bulkcopy (NcpdpM src, NcpdpM dest);
}