edisegment

package
v0.0.0-...-c407d37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

AffiliationToAgency is a map from our affiliation to the FA1 segment's AgencyQualifierCode field

Functions

func FloatToNx

func FloatToNx(n float64, x int) string

FloatToNx converts float64 to the Nx string format

func NxToFloat

func NxToFloat(s string, x int) (float64, error)

NxToFloat converts strings with the "numeric" EDI attribute type to float64. This is a type with an implied decimal. N1 (x = 1): 123 --> 12.3 N2 (x = 2): 123 --> 1.23

Types

type AK1

type AK1 struct {
	FunctionalIdentifierCode string `validate:"eq=SI"`
	GroupControlNumber       int64  `validate:"min=1,max=999999999"`
}

AK1 represents the AK1 EDI segment

func (*AK1) Parse

func (s *AK1) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the AK1 struct

func (*AK1) StringArray

func (s *AK1) StringArray() []string

StringArray converts AK1 to an array of strings

type AK2

type AK2 struct {
	TransactionSetIdentifierCode string `validate:"eq=858"`
	TransactionSetControlNumber  string `validate:"min=4,max=9"`
}

AK2 represents the AK2 EDI segment

func (*AK2) Parse

func (s *AK2) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the AK2 struct

func (*AK2) StringArray

func (s *AK2) StringArray() []string

StringArray converts AK2 to an array of strings

type AK3

type AK3 struct {
	SegmentIDCode                   string `validate:"min=2,max=3"`
	SegmentPositionInTransactionSet int    `validate:"min=1,max=999999"`
	LoopIdentifierCode              string `validate:"omitempty,min=1,max=6"`
	SegmentSyntaxErrorCode          string `validate:"omitempty,min=1,max=3"`
}

AK3 represents the AK3 EDI segment

func (*AK3) Parse

func (s *AK3) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the AK3 struct

func (*AK3) StringArray

func (s *AK3) StringArray() []string

StringArray converts AK3 to an array of strings

type AK4

type AK4 struct {
	PositionInSegment                       int    `validate:"min=1,max=99"`
	ElementPositionInSegment                int    `validate:"min=1,max=99"`
	ComponentDataElementPositionInComposite int    `validate:"omitempty,min=1,max=99"`
	DataElementReferenceNumber              int    `validate:"omitempty,min=1,max=9999"`
	DataElementSyntaxErrorCode              string `validate:"min=1,max=3"`
	CopyOfBadDataElement                    string `validate:"omitempty,max=99"`
}

AK4 represents the AK4 EDI segment

func (*AK4) Parse

func (s *AK4) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the AK4 struct

func (*AK4) StringArray

func (s *AK4) StringArray() []string

StringArray converts AK4 to an array of strings

type AK5

type AK5 struct {
	TransactionSetAcknowledgmentCode   string `validate:"len=1"`           // only expect to use this field
	TransactionSetSyntaxErrorCodeAK502 string `validate:"omitempty,max=3"` // not expecting these fields to be set
	TransactionSetSyntaxErrorCodeAK503 string `validate:"omitempty,max=3"` // not expecting these fields to be set
	TransactionSetSyntaxErrorCodeAK504 string `validate:"omitempty,max=3"` // not expecting these fields to be set
	TransactionSetSyntaxErrorCodeAK505 string `validate:"omitempty,max=3"` // not expecting these fields to be set
	TransactionSetSyntaxErrorCodeAK506 string `validate:"omitempty,max=3"` // not expecting these fields to be set
}

AK5 represents the AK5 EDI segment Purpose: To acknowledge acceptance or rejection and report errors in a transaction set (direct language from the 997 spec, though we don't expect to process any errors in the 997, only expect to get acks here)

func (*AK5) Parse

func (s *AK5) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the AK5 struct

func (*AK5) StringArray

func (s *AK5) StringArray() []string

StringArray converts AK5 to an array of strings

type AK9

type AK9 struct {
	FunctionalGroupAcknowledgeCode      string `validate:"oneof=A E P R"`
	NumberOfTransactionSetsIncluded     int    `validate:"min=1,max=999999"`
	NumberOfReceivedTransactionSets     int    `validate:"min=1,max=999999"`
	NumberOfAcceptedTransactionSets     int    `validate:"min=0,max=999999"`
	FunctionalGroupSyntaxErrorCodeAK905 string `validate:"omitempty,max=3"`
	FunctionalGroupSyntaxErrorCodeAK906 string `validate:"omitempty,max=3"`
	FunctionalGroupSyntaxErrorCodeAK907 string `validate:"omitempty,max=3"`
	FunctionalGroupSyntaxErrorCodeAK908 string `validate:"omitempty,max=3"`
	FunctionalGroupSyntaxErrorCodeAK909 string `validate:"omitempty,max=3"`
}

AK9 represents the AK9 EDI segment

func (*AK9) Parse

func (s *AK9) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the AK9 struct

func (*AK9) StringArray

func (s *AK9) StringArray() []string

StringArray converts AK9 to an array of strings

type BGN

type BGN struct {
	TransactionSetPurposeCode string `validate:"eq=11"`
	ReferenceIdentification   string `validate:"min=1,max=30"`
	Date                      string `validate:"datetime=20060102"`
}

BGN represents the BGN EDI segment

func (*BGN) Parse

func (s *BGN) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the BGN struct

func (*BGN) StringArray

func (s *BGN) StringArray() []string

StringArray converts BGN to an array of strings

type BX

type BX struct {
	TransactionSetPurposeCode    string `validate:"eq=00"`
	TransactionMethodTypeCode    string `validate:"eq=J"`
	ShipmentMethodOfPayment      string `validate:"eq=PP"`
	ShipmentIdentificationNumber string `validate:"min=1,max=30"`
	StandardCarrierAlphaCode     string `validate:"alpha,min=2,max=4"`
	WeightUnitCode               string `validate:"isdefault"` // not used
	ShipmentQualifier            string `validate:"eq=4"`
}

BX represents the BX EDI segment

func (*BX) Parse

func (s *BX) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the BX struct

func (*BX) StringArray

func (s *BX) StringArray() []string

StringArray converts BX to an array of strings

type C3

type C3 struct {
	// http://www.iso.org/iso/en/prods-services/popstds/currencycodeslist.html is the URL
	// referenced in the 858 standard, but that URL is not valid
	// https://en.wikipedia.org/wiki/ISO_4217 seems to be a good list to reference
	CurrencyCodeC301 string `validate:"omitempty,max=3"`
	ExchangeRate     string `validate:"omitempty"`
	CurrencyCodeC303 string `validate:"omitempty,max=3"`
	CurrencyCodeC304 string `validate:"omitempty,max=3"`
}

C3 represents the C3 EDI segment (Currency)

func (*C3) Parse

func (s *C3) Parse(elements []string) error

Parse parses an C3 string that's split into an array into the C3 struct

func (*C3) StringArray

func (s *C3) StringArray() []string

StringArray converts C3 to an array of strings

type FA1

type FA1 struct {
	AgencyQualifierCode string `validate:"oneof=DN DX DY DZ DF HS"`
}

FA1 represents the FA1 EDI segment

func (*FA1) Parse

func (s *FA1) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the FA1 struct

func (*FA1) StringArray

func (s *FA1) StringArray() []string

StringArray converts FA1 to an array of strings

type FA2

type FA2 struct {
	BreakdownStructureDetailCode FA2DetailCode `validate:"oneof=TA ZZ A1 A2 A3 A4 A5 A6 B1 B2 B3 C1 C2 D1 D4 D6 D7 E1 E2 E3 F1 F3 G2 I1 J1 K6 L1 M1 N1 P5"`
	FinancialInformationCode     string        `validate:"min=1,max=80"`
}

FA2 represents the FA2 EDI segment

func (*FA2) Parse

func (s *FA2) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the FA2 struct

func (*FA2) StringArray

func (s *FA2) StringArray() []string

StringArray converts FA2 to an array of strings

type FA2DetailCode

type FA2DetailCode string
const (
	// FA2DetailCodeTA is Transportation Account Code (TAC)
	FA2DetailCodeTA FA2DetailCode = "TA"
	// FA2DetailCodeZZ is Mutually Defined
	FA2DetailCodeZZ FA2DetailCode = "ZZ"
	// FA2DetailCodeA1 is Department Indicator
	FA2DetailCodeA1 FA2DetailCode = "A1"
	// FA2DetailCodeA2 is Transfer from Department
	FA2DetailCodeA2 FA2DetailCode = "A2"
	// FA2DetailCodeA3 is Fiscal Year Indicator
	FA2DetailCodeA3 FA2DetailCode = "A3"
	// FA2DetailCodeA4 is Basic Symbol Number
	FA2DetailCodeA4 FA2DetailCode = "A4"
	// FA2DetailCodeA5 is Sub-class
	FA2DetailCodeA5 FA2DetailCode = "A5"
	// FA2DetailCodeA6 is Sub-Account Symbol
	FA2DetailCodeA6 FA2DetailCode = "A6"
	// FA2DetailCodeB1 is Budget Activity Number
	FA2DetailCodeB1 FA2DetailCode = "B1"
	// FA2DetailCodeB2 is Budget Sub-activity Number
	FA2DetailCodeB2 FA2DetailCode = "B2"
	// FA2DetailCodeB3 is Budget Program Activity
	FA2DetailCodeB3 FA2DetailCode = "B3"
	// FA2DetailCodeC1 is Program Element
	FA2DetailCodeC1 FA2DetailCode = "C1"
	// FA2DetailCodeC2 is Project Task or Budget Subline
	FA2DetailCodeC2 FA2DetailCode = "C2"
	// FA2DetailCodeD1 is Defense Agency Allocation Recipient
	FA2DetailCodeD1 FA2DetailCode = "D1"
	// FA2DetailCodeD4 is Component Sub-allocation Recipient
	FA2DetailCodeD4 FA2DetailCode = "D4"
	// FA2DetailCodeD6 is Sub-allotment Recipient
	FA2DetailCodeD6 FA2DetailCode = "D6"
	// FA2DetailCodeD7 is Work Center Recipient
	FA2DetailCodeD7 FA2DetailCode = "D7"
	// FA2DetailCodeE1 is Major Reimbursement Source Code
	FA2DetailCodeE1 FA2DetailCode = "E1"
	// FA2DetailCodeE2 is Detail Reimbursement Source Code
	FA2DetailCodeE2 FA2DetailCode = "E2"
	// FA2DetailCodeE3 is Customer Indicator
	FA2DetailCodeE3 FA2DetailCode = "E3"
	// FA2DetailCodeF1 is Object Class
	FA2DetailCodeF1 FA2DetailCode = "F1"
	// FA2DetailCodeF3 is Government or Public Sector Identifier
	FA2DetailCodeF3 FA2DetailCode = "F3"
	// FA2DetailCodeG2 is Special Interest Code or Special Program Cost Code
	FA2DetailCodeG2 FA2DetailCode = "G2"
	// FA2DetailCodeI1 is Abbreviated Department of Defense (DoD) Budget and Accounting Classification Code (BACC)
	FA2DetailCodeI1 FA2DetailCode = "I1"
	// FA2DetailCodeJ1 is Document or Record Reference Number
	FA2DetailCodeJ1 FA2DetailCode = "J1"
	// FA2DetailCodeK6 is Accounting Classification Reference Code
	FA2DetailCodeK6 FA2DetailCode = "K6"
	// FA2DetailCodeL1 is Accounting Installation Number
	FA2DetailCodeL1 FA2DetailCode = "L1"
	// FA2DetailCodeM1 is Local Installation Data
	FA2DetailCodeM1 FA2DetailCode = "M1"
	// FA2DetailCodeN1 is Transaction Type
	FA2DetailCodeN1 FA2DetailCode = "N1"
	// FA2DetailCodeP5 is Security Cooperation Case Line Item Identifier
	FA2DetailCodeP5 FA2DetailCode = "P5"
)

func (FA2DetailCode) String

func (d FA2DetailCode) String() string

type G62

type G62 struct {
	DateQualifier int    `validate:"oneof=10 76 86"`
	Date          string `validate:"datetime=20060102"`
	TimeQualifier int    `validate:"omitempty,oneof=5 8"`
	Time          string `validate:"omitempty,required_with=TimeQualifier,datetime=1504"`
}

G62 represents the G62 EDI segment Requested Pickup Date 68, Requested Pickup Time 5 Actual Pickup Date 86, Actual Pickup Time 8

func (*G62) Parse

func (s *G62) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the G62 struct

func (*G62) StringArray

func (s *G62) StringArray() []string

StringArray converts G62 to an array of strings

type GE

type GE struct {
	NumberOfTransactionSetsIncluded int   `validate:"eq=1"`
	GroupControlNumber              int64 `validate:"min=1,max=999999999"`
}

GE represents the GE EDI segment

func (*GE) Parse

func (s *GE) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the GE struct

func (*GE) StringArray

func (s *GE) StringArray() []string

StringArray converts GE to an array of strings

type GS

type GS struct {
	FunctionalIdentifierCode string `validate:"oneof=SI AG FA"`
	ApplicationSendersCode   string `validate:"oneof=MILMOVE 8004171844"`
	ApplicationReceiversCode string `validate:"oneof=MILMOVE 8004171844"`
	Date                     string `validate:"datetime=20060102"`
	Time                     string `validate:"datetime=1504|datetime=150405"`
	GroupControlNumber       int64  `validate:"min=1,max=999999999"`
	ResponsibleAgencyCode    string `validate:"eq=X"`
	Version                  string `validate:"eq=004010"`
}

GS represents the GS EDI segment

func (*GS) Parse

func (s *GS) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the GS struct

func (*GS) StringArray

func (s *GS) StringArray() []string

StringArray converts GS to an array of strings

type HL

type HL struct {
	HierarchicalIDNumber       string `validate:"alphanum,min=1,max=12"`
	HierarchicalParentIDNumber string `validate:"isdefault"` // not used
	HierarchicalLevelCode      string `validate:"oneof=SS I 9"`
}

HL represents the HL EDI segment

func (*HL) Parse

func (s *HL) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the HL struct

func (*HL) StringArray

func (s *HL) StringArray() []string

StringArray converts HL to an array of strings

type IEA

type IEA struct {
	NumberOfIncludedFunctionalGroups int   `validate:"eq=1"`
	InterchangeControlNumber         int64 `validate:"min=1,max=999999999"`
}

IEA represents the IEA EDI segment

func (*IEA) Parse

func (s *IEA) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the IEA struct

func (*IEA) StringArray

func (s *IEA) StringArray() []string

StringArray converts IEA to an array of strings

type ISA

type ISA struct {
	AuthorizationInformationQualifier string `validate:"eq=00"`
	AuthorizationInformation          string `validate:"omitempty,eq=0084182369"`
	SecurityInformationQualifier      string `validate:"eq=00"`
	SecurityInformation               string `validate:"omitempty,eq=0000000000"`
	InterchangeSenderIDQualifier      string `validate:"oneof=12 ZZ"`
	InterchangeSenderID               string `validate:"len=15"`
	InterchangeReceiverIDQualifier    string `validate:"oneof=12 ZZ"`
	InterchangeReceiverID             string `validate:"len=15"`
	InterchangeDate                   string `validate:"datetime=060102"`
	InterchangeTime                   string `validate:"datetime=1504"`
	InterchangeControlStandards       string `validate:"eq=U"`
	InterchangeControlVersionNumber   string `validate:"eq=00401"`
	InterchangeControlNumber          int64  `validate:"min=1,max=999999999"`
	AcknowledgementRequested          int    `validate:"oneof=0 1"`
	UsageIndicator                    string `validate:"oneof=P T"`
	ComponentElementSeparator         string `validate:"oneof=0x7C :"` // Have to escape pipe symbol
}

ISA represents the ISA EDI segment

func (*ISA) Parse

func (s *ISA) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the ISA struct

func (*ISA) StringArray

func (s *ISA) StringArray() []string

StringArray converts ISA to an array of strings

type L0

type L0 struct {
	LadingLineItemNumber   int     `validate:"min=1,max=999"`                                               // L001
	BilledRatedAsQuantity  float64 `validate:"required_with=BilledRatedAsQualifier"`                        // L002
	BilledRatedAsQualifier string  `validate:"required_with=BilledRatedAsQuantity,omitempty,len=2"`         // L003
	Weight                 float64 `validate:"required_with=WeightQualifier WeightUnitCode"`                // L004
	WeightQualifier        string  `validate:"required_with=Weight WeightUnitCode,omitempty,eq=B"`          // L005
	Volume                 float64 `validate:"required_with=VolumeUnitQualifier"`                           // L006
	VolumeUnitQualifier    string  `validate:"required_with=Volume,omitempty,eq=E"`                         // L007
	LadingQuantity         int     `validate:"required_with=PackagingFormCode,omitempty,min=1,max=9999999"` // L008
	PackagingFormCode      string  `validate:"required_with=LadingQuantity,omitempty,len=3"`                // L009
	WeightUnitCode         string  `validate:"required_with=Weight WeightQualifier,omitempty,eq=L"`         // L011
}

L0 represents the L0 EDI segment

func (*L0) Parse

func (s *L0) Parse(parts []string) error

Parse parses an X12 string that's split into an array into the L0 struct

func (*L0) StringArray

func (s *L0) StringArray() []string

StringArray converts L0 to an array of strings

type L1

type L1 struct {
	LadingLineItemNumber int      `validate:"required,min=1,max=999"`
	FreightRate          *float64 `validate:"omitempty,min=0"`
	RateValueQualifier   string   `validate:"required_with=FreightRate,omitempty,oneof=LB PF"`
	Charge               int64    `validate:"required,min=-999999999999,max=999999999999"` // Supports negative values
}

L1 represents the L1 EDI segment

func (*L1) Parse

func (s *L1) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the L1 struct

func (*L1) StringArray

func (s *L1) StringArray() []string

StringArray converts L1 to an array of strings

type L10

type L10 struct {
	Weight          float64 `validate:"required"`
	WeightQualifier string  `validate:"eq=B"`
	WeightUnitCode  string  `validate:"eq=L"`
}

L10 represents the B3 EDI segment

func (*L10) Parse

func (s *L10) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the L10 struct

func (*L10) StringArray

func (s *L10) StringArray() []string

StringArray converts L10 to an array of strings

type L3

type L3 struct {
	Weight          float64 `validate:"required_with=WeightQualifier,min=0,max=9999999999"`
	WeightQualifier string  `validate:"required_with=Weight,omitempty,eq=B"`
	PriceCents      int64   `validate:"min=-999999999999,max=999999999999"` // Supports negative values for FSC price
}

L3 represents the L3 EDI segment

func (*L3) Parse

func (s *L3) Parse(parts []string) error

Parse parses an X12 string that's split into an array into the L3 struct

func (*L3) StringArray

func (s *L3) StringArray() []string

StringArray converts L3 to an array of strings

type L5

type L5 struct {
	LadingLineItemNumber   int    `validate:"min=1,max=999"`
	LadingDescription      string `validate:"required"`
	CommodityCode          string `validate:"required_with=CommodityCodeQualifier,omitempty,gt=0,lt=11"`
	CommodityCodeQualifier string `validate:"required_with=CommodityCode,omitempty,eq=D"`
}

L5 represents the L5 EDI segment

func (*L5) Parse

func (s *L5) Parse(parts []string) error

Parse parses an X12 string that's split into an array into the L5 struct

func (*L5) StringArray

func (s *L5) StringArray() []string

StringArray converts L5 to an array of strings

type L7

type L7 struct {
	LadingLineItemNumber int    `validate:"omitempty,min=1,max=999"`
	TariffNumber         string `validate:"omitempty,min=1,max=7"`
	TariffItemNumber     string `validate:"omitempty,min=1,max=16"`
	TariffDistance       int    `validate:"omitempty,min=1,max=99999"`
}

L7 represents the B3 EDI segment

func (*L7) Parse

func (s *L7) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the L7 struct

func (*L7) StringArray

func (s *L7) StringArray() []string

StringArray converts L7 to an array of strings

type LX

type LX struct {
	AssignedNumber int `validate:"min=1,max=999999"`
}

LX represents the LX EDI segment

func (*LX) Parse

func (s *LX) Parse(parts []string) error

Parse parses an X12 string that's split into an array into the LX struct

func (*LX) StringArray

func (s *LX) StringArray() []string

StringArray converts LX to an array of strings

type MEA

type MEA struct {
	MeasurementReferenceIDCode string  `validate:"omitempty,len=2"`
	MeasurementQualifier       string  `validate:"omitempty,oneof=HT LN WD"`
	MeasurementValue           float64 `validate:"required"`
}

MEA represents the MEA EDI segment

func (*MEA) Parse

func (s *MEA) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the MEA struct

func (*MEA) StringArray

func (s *MEA) StringArray() []string

StringArray converts MEA to an array of strings

type N1

type N1 struct {
	EntityIdentifierCode        string `validate:"oneof=BY SE ST SF RG RH"`
	Name                        string `validate:"min=1,max=60"`
	IdentificationCodeQualifier string `validate:"required_with=IdentificationCode,omitempty,oneof=2 10 27 92"`
	IdentificationCode          string `validate:"required_with=IdentificationCodeQualifier,omitempty,min=2,max=80"`
}

N1 represents the N1 EDI segment

func (*N1) Parse

func (s *N1) Parse(parts []string) error

Parse parses an X12 string that's split into an array into the N1 struct

func (*N1) StringArray

func (s *N1) StringArray() []string

StringArray converts N1 to an array of strings

type N3

type N3 struct {
	AddressInformation1 string `validate:"min=1,max=55"`
	AddressInformation2 string `validate:"omitempty,min=1,max=55"`
}

N3 represents the N3 EDI segment

func (*N3) Parse

func (s *N3) Parse(parts []string) error

Parse parses an X12 string that's split into an array into the N3 struct

func (*N3) StringArray

func (s *N3) StringArray() []string

StringArray converts N3 to an array of strings

type N4

type N4 struct {
	CityName            string `validate:"min=2,max=30"`
	StateOrProvinceCode string `validate:"len=2"`
	PostalCode          string `validate:"min=3,max=15"`
	CountryCode         string `validate:"omitempty,min=2,max=3"`
	LocationQualifier   string `validate:"isdefault"` // not used
	LocationIdentifier  string `validate:"isdefault"` // not used
}

N4 represents the N4 EDI segment

func (*N4) Parse

func (s *N4) Parse(parts []string) error

Parse parses an X12 string that's split into an array into the N4 struct

func (*N4) StringArray

func (s *N4) StringArray() []string

StringArray converts N4 to an array of strings

type N9

type N9 struct {
	ReferenceIdentificationQualifier string `validate:"oneof=DY CN CT PQ OQ 1W ML 3L PO CMN 4A"`
	ReferenceIdentification          string `validate:"min=1,max=30"`
	FreeFormDescription              string `validate:"omitempty,min=1,max=45"`
	Date                             string `validate:"omitempty,datetime=20060102"`
}

N9 represents the N9 EDI segment

func (*N9) Parse

func (s *N9) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the N9 struct

func (*N9) StringArray

func (s *N9) StringArray() []string

StringArray converts N9 to an array of strings

type NTE

type NTE struct {
	NoteReferenceCode string `validate:"omitempty,len=3"`
	Description       string `validate:"min=1,max=80"`
}

NTE represents the NTE EDI segment

func (*NTE) Parse

func (s *NTE) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the NTE struct

func (*NTE) StringArray

func (s *NTE) StringArray() []string

StringArray converts NTE to an array of strings

type OTI

type OTI struct {
	ApplicationAcknowledgementCode   string `validate:"oneof=TA TE TR"`
	ReferenceIdentificationQualifier string `validate:"oneof=BM CN"`
	ReferenceIdentification          string `validate:"min=1,max=30"`
	ApplicationSendersCode           string `validate:"omitempty,min=2,max=15"`
	ApplicationReceiversCode         string `validate:"omitempty,min=2,max=15"`
	Date                             string `validate:"omitempty,datetime=20060102"`
	Time                             string `validate:"omitempty,datetime=1504"`
	GroupControlNumber               int64  `validate:"required_with=TransactionSetControlNumber,omitempty,min=1,max=999999999"`
	TransactionSetControlNumber      string `validate:"omitempty,min=4,max=9"`
}

OTI represents the OTI EDI segment

func (*OTI) Parse

func (s *OTI) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the OTI struct

func (*OTI) StringArray

func (s *OTI) StringArray() []string

StringArray converts OTI to an array of strings

type PER

type PER struct {
	ContactFunctionCode          string `validate:"required,oneof=CN IC EM"`
	Name                         string `validate:"omitempty,min=1,max=60"`
	CommunicationNumberQualifier string `validate:"omitempty,eq=TE"`
	CommunicationNumber          string `validate:"omitempty,min=1,max=80"`
}

PER represents the PER EDI segment

func (*PER) Parse

func (s *PER) Parse(parts []string) error

Parse parses an X12 string that's split into an array into the PER struct

func (*PER) StringArray

func (s *PER) StringArray() []string

StringArray converts PER to an array of strings

type SE

type SE struct {
	NumberOfIncludedSegments    int    `validate:"min=1,max=9999999999"`
	TransactionSetControlNumber string `validate:"min=4,max=9"`
}

SE represents the SE EDI segment

func (*SE) Parse

func (s *SE) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the SE struct

func (*SE) StringArray

func (s *SE) StringArray() []string

StringArray converts SE to an array of strings

type ST

type ST struct {
	TransactionSetIdentifierCode string `validate:"oneof=858 997 824 810"`
	TransactionSetControlNumber  string `validate:"min=4,max=9"`
}

ST represents the ST EDI segment

func (*ST) Parse

func (s *ST) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the ST struct

func (*ST) StringArray

func (s *ST) StringArray() []string

StringArray converts ST to an array of strings

type Segment

type Segment interface {
	StringArray() []string
	Parse(parts []string) error
}

Segment represents an EDI segment

type TED

type TED struct {
	ApplicationErrorConditionCode string `validate:"oneof=007 812 832 DUP IID INC K MJ PPD T ZZZ"`
	FreeFormMessage               string `validate:"omitempty,max=60"`
}

TED represents the TED EDI segment

func (*TED) Parse

func (s *TED) Parse(elements []string) error

Parse parses an X12 string that's split into an array into the TED struct

func (*TED) StringArray

func (s *TED) StringArray() []string

StringArray converts TED to an array of strings

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL