Interface: Build837EnvelopeSpec
Interchange + group + transaction identity for the built 837. The builder
fixes GS-01 to "HC" and the ST-03 / GS-08 version to the variant's TR3
(005010X222A2 / X223A3 / X224A2) so the caller never hand-codes them.
Example
import type { Build837EnvelopeSpec } from "@cosyte/x12";
const env: Build837EnvelopeSpec = {
senderId: "SUBMITTER", receiverId: "RECEIVER",
interchangeDate: "260601", interchangeTime: "1200",
interchangeControlNumber: "000000001",
groupControlNumber: "1", transactionSetControlNumber: "0001",
};
Properties
applicationReceiverCode?
readonlyoptionalapplicationReceiverCode?:string
GS-03 - application receiver code. Default: the interchange receiver id.
applicationSenderCode?
readonlyoptionalapplicationSenderCode?:string
GS-02 - application sender code. Default: the interchange sender id.
claimOrEncounterIndicator?
readonlyoptionalclaimOrEncounterIndicator?:string
BHT-06 - claim/encounter indicator (CH chargeable, RP reporting). Default "CH".
componentSeparator?
readonlyoptionalcomponentSeparator?:string
Component (sub-element) separator (ISA-16). Default ":".
elementSeparator?
readonlyoptionalelementSeparator?:string
Element separator (ISA byte 4). Default "*".
groupControlNumber
readonlygroupControlNumber:string
GS-06 / GE-02 - group control number.
groupDate?
readonlyoptionalgroupDate?:string
GS-04 - group date CCYYMMDD. Default: century-expanded ISA-09.
groupTime?
readonlyoptionalgroupTime?:string
GS-05 - group time HHMM. Default: the interchange time.
interchangeControlNumber
readonlyinterchangeControlNumber:string
ISA-13 / IEA-02 - interchange control number (zero-padded to 9 on emit).
interchangeDate
readonlyinterchangeDate:string
ISA-09 - interchange date YYMMDD.
interchangeTime
readonlyinterchangeTime:string
ISA-10 - interchange time HHMM.
receiverId
readonlyreceiverId:string
ISA-08 - interchange receiver id (padded to 15 on emit).
receiverQualifier?
readonlyoptionalreceiverQualifier?:string
ISA-07 - interchange receiver qualifier. Default "ZZ".
repetitionSeparator?
readonlyoptionalrepetitionSeparator?:string
Repetition separator (ISA-11). Default "^".
segmentTerminator?
readonlyoptionalsegmentTerminator?:string
Segment terminator (ISA byte 106). Default "~".
senderId
readonlysenderId:string
ISA-06 - interchange sender id (padded to 15 on emit).
senderQualifier?
readonlyoptionalsenderQualifier?:string
ISA-05 - interchange sender qualifier. Default "ZZ".
transactionDate?
readonlyoptionaltransactionDate?:string
BHT-04 - transaction creation date CCYYMMDD. Default: the group date.
transactionReferenceId?
readonlyoptionaltransactionReferenceId?:string
BHT-03 - originator application reference id. Default: the transaction set control number.
transactionSetControlNumber
readonlytransactionSetControlNumber:string
ST-02 / SE-02 - transaction set control number.
transactionTime?
readonlyoptionaltransactionTime?:string
BHT-05 - transaction creation time HHMM. Default: the group time.
usageIndicator?
readonlyoptionalusageIndicator?:string
ISA-15 - usage indicator (P production, T test). Default "P".