ESI Compatibility

How the Data Exchange API maps to the Express Scripts CDH 1500-byte accumulator format.

View as Markdown

Andel can carry the concepts required by Express Scripts’ (ESI) CDH 1500-byte accumulator protocol, for partners that exchange accumulator data in that format. This page documents the supported event types, accumulator types, the field mapping between the Data Exchange API and the ESI fixed-width record, and a sample file partners can validate against their own parsers.

Monetary fields are proposed and provenance-pending. They ship optional and are not yet a firm contract. Do not build settlement logic on the dollar amounts until Andel confirms their provenance.

Supported event types

A purchase’s event_type maps to an ESI Event Code:

event_typeESI Event CodeMeaning
claim00A normal fill.
reversal11Restores accumulators for a returned or voided fill.
adjustment10A flat or paired accumulator correction.
hra_initial_load01Initial annual HRA load.
hra_rollover04Prior-year HRA rollover.
hra_incentive16Mid-year HRA incentive top-up.

In the ESI CDH protocol, all six event types are the same record, distinguished by the Event Code and by which accumulators move. This API mirrors that: every event type is a /purchases record discriminated by event_type. HRA loads, rollovers, and incentives are records whose populated accumulator is the HRA slot (type_of_benefit_account: hra); they carry origin_code and plan_year, use date_of_service as the effective date, and omit the pharmacy-fill fields (ndc, prescriber_spi, quantity).

Supported accumulator types

Each element of a purchase’s accumulators array carries a type_of_benefit_account that maps to an ESI Type-of-Benefit-Account code:

type_of_benefit_accountESI codeDescription
hra02Health Reimbursement Arrangement balance.
deductible04Plan deductible.
oop05Out-of-pocket.
cap06Benefit cap.
lifetime_cap07Lifetime cap.
drug_cap08Drug-specific cap.
benefit_deductible14Benefit-specific deductible.
benefit_oop15Benefit-specific out-of-pocket.
base_deductible24Base deductible.
base_oop25Base out-of-pocket.
tmoop35True maximum out-of-pocket.

The cr_db_indicator on each accumulator maps to the ESI CR-DB Indicator: debit (+) consumes the accumulator, credit (-) restores it, replace (R) overwrites the running total, and bypass (B) ignores the accumulator for that transaction.

Field mapping

The Andel-source column is the API field; the ESI-source column describes the partner protocol position (1-indexed byte offset and length in the CDH record).

Purchase

API fieldESI field (position, length)
purchase_idSignature (319-344, 26), persisted to a purchase_id mapping
member_idPartner Subscriber Id (756-775, 20)
plan_idGroup Id (489-503, 15) or Partner Group ID (776-790, 15)
purchased_atTransaction Date + Time (261-276, 16)
date_of_serviceDate Of Service (277-284, 8, CCYYMMDD)
ndcProduct / Service Id (1422-1440, 19), qualifier 03
quantityDispensed Quantity (1444-1453, 10, 3-decimal)
days_supplyDays Supply (1441-1443, 3)
prescriber_spiProvider ID (287-301, 15), Provider Type 09
provider_typeProvider Type (285-286, 2)
network_indNetwork Ind (347, 1)
event_typeEvent Code (350-351, 2)
original_purchase_idClaim Xref Id (449-466, 18)
statusResponse Code (243-244) / Reason Code (245-246) on the Data Response
member_purchase_amountCurrent Amount, out-of-pocket slot (05), 2-decimal
oop_amountCurrent Amount, out-of-pocket slot (05), 2-decimal
plan_contributionDerived (total less member responsibility)
deductible_appliedCurrent Amount, deductible slot (04), 2-decimal
subscriber_idSubscriber Id (469-488, 20)
first_nameFirst Name (504-528, 25)
last_nameLast Name (529-563, 35)
date_of_birthDate Of Birth (568-575, 8, CCYYMMDD)
genderGender (576, 1)
relationshipRelationship (567, 1)
origin_codeOrigin Code (430, 1), HRA balance events
plan_yearDerived / partner config, HRA balance events

Accumulator

API fieldESI field
type_of_benefit_accountType of Benefit Account N (2)
participation_typeParticipation Type N (1)
amountCurrent Amount N (10, 2-decimal)
cr_db_indicatorCR-DB Indicator N (1)
accumulated_amountAccumulated Amount N (10, 2-decimal)
remaining_amountRemaining Amount N (10, 2-decimal)
met_this_transactionDerived (Remaining Amount equals zero)

HRA balance events

HRA loads, rollovers, and incentives are /purchases records with event_type set to hra_initial_load, hra_rollover, or hra_incentive. They reuse the purchase fields above: the dollar amount is the accumulators entry with type_of_benefit_account: hra, date_of_service is the effective date, and origin_code + plan_year carry the load metadata.

ESI protocol identity

The esi object on a purchase carries the wire-protocol identifiers, populated only when a purchase is exchanged via the ESI CDH format:

API fieldESI field (position, length)
esi.sender_idSender Id (205-228, 24)
esi.receiver_idReceiver Id (229-238, 10)
esi.signatureSignature (319-344, 26)
esi.claim_idClaim Id (431-448, 18)
esi.claim_xref_idClaim Xref Id (449-466, 18)
esi.transmission_typeTransmission Type (201-202, 2)
esi.request_codeRequest Code (203-204, 2)
esi.response_codeResponse Code (243-244, 2)
esi.reason_codeReason Code (245-246, 2)

Fields not populated

  • Monetary fields (member_purchase_amount, oop_amount, plan_contribution, deductible_applied, accumulator amounts, HRA amounts) are proposed and provenance-pending; they may be omitted until provenance is confirmed.
  • Demographics and ESI protocol identity are populated only when a purchase is exchanged via the ESI CDH format; they are otherwise omitted.
  • The deprecated ESI Situational Segment and ESI-internal or reserved fields are not used.

Transport options

TransportNotes
Batch SFTPDefault. File drop on a schedule; lowest infrastructure requirement.
IBM MQReal-time, transactional; both sides exchange responses for every request.
XML over HTTPSReal-time request/response with the same semantics as MQ.

Sample file

A synthetic batch in the ESI CDH layout: a batch header, three detail records (a claim, a reversal, and an HRA load), and a batch trailer. All values are synthetic and the file uses test status (T). Fields are shown space-delimited for readability; the wire format is fixed-width.

ANDEL_TO_ESI_20260520.txt
00 ANDEL HEALTH CDH T M 20260520 090500 00000001
DQ 01 ANDEL-TPO-0001 MHS 0000 00 ... DOS=20260513 PT=09 SIG=20260513182401512A1B2C3D EVT=00 SUB=SUB-4471902 GRP=PLN-0001 FN=MARIA LN=LOPEZ DOB=19840702 G=2 REL=1 ACC=[04 1 0000003250 + | 05 1 0000001000 + | 02 1 0000003250 +] NDC=00093005301 DS=030 QTY=0000030000
DQ 02 ANDEL-TPO-0001 MHS 0000 00 ... DOS=20260513 PT=09 SIG=20260520090214733B2C3D4E EVT=11 XREF=CLM-0009912837 SUB=SUB-4471902 GRP=PLN-0001 FN=MARIA LN=LOPEZ DOB=19840702 G=2 REL=1 ACC=[04 1 0000003250 - | 05 1 0000001000 - | 02 1 0000003250 -] NDC=00093005301 DS=030 QTY=0000030000
DQ 01 ANDEL-TPO-0001 MHS 0000 00 ... DOS=20260101 SIG=20260101000000001C3D4E5F EVT=01 ORIG=E SUB=SUB-4471902 GRP=PLN-0001 FN=MARIA LN=LOPEZ DOB=19840702 G=2 REL=1 ACC=[02 1 0000050000 R]
99 000000005