Class X12Doc
The X12Doc object represents a instance of a given X12 Document which may be a single or any combination of batched 837, 835, 277, 999 or TA1
Inherited Members
Namespace: Bishop.X12
Assembly: Bishop.X12.dll
Syntax
public class X12Doc : X12Disposable, IDisposable
Properties
AckRequested
Returns true if the sender of an X12 document requested a TA1 acknowledgment
Declaration
public bool AckRequested { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if TA1 acknowledgment is requested else false |
ControlNumber
Returns the Interchange Control Number
Declaration
public int ControlNumber { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
ControlVersion
Declaration
public string ControlVersion { get; }
Property Value
Type | Description |
---|---|
System.String |
DateTime
ISA09/ISA10: Returns the X12Document date and time as a DateTime object
Declaration
public DateTime DateTime { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime |
Delimiters
Declaration
public X12Delimiters Delimiters { get; }
Property Value
Type | Description |
---|---|
X12Delimiters |
Production
Returns true if the current document is flagged for production or false as test
Declaration
public bool Production { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if production else false |
ReceiverETIN
Declaration
public string ReceiverETIN { get; }
Property Value
Type | Description |
---|---|
System.String |
ReceiverIdType
Declaration
public string ReceiverIdType { get; }
Property Value
Type | Description |
---|---|
System.String |
SenderETIN
Declaration
public string SenderETIN { get; }
Property Value
Type | Description |
---|---|
System.String |
SenderIdType
Declaration
public string SenderIdType { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
AddGroup(X12FunctionCode, Int32, X12VersionRelease)
Adds a X12Group object to the X12Document
Declaration
public X12Group AddGroup(X12FunctionCode grpFuncCode, int controlNumber, X12VersionRelease version)
Parameters
Type | Name | Description |
---|---|---|
X12FunctionCode | grpFuncCode | GS01: Code identifying a group of application related transaction sets |
System.Int32 | controlNumber | GS06/GE02: Sets the Group interchange control number for this X12Group object |
X12VersionRelease | version | GS08: Gets the Code indicating the version, release, subrelease, and industry identifier of the EDI standard being used |
Returns
Type | Description |
---|---|
X12Group | Created X12Group object |
Create(String, String, Int32, Boolean, Boolean)
Creates a new X12Doc object with the supplied parameters
Declaration
public static X12Doc Create(string receiverIdCode, string receiverId, int controlNumber, bool production = true, bool requestAck = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | receiverIdCode | ISA07: Code indicating the system/method of code structure used to designate the sender or receiver ID element being qualified |
System.String | receiverId | ISA08: Receiver ETIN (Electronic Trader Identification Number) published by the receiver that this X12Doc object will be sent too |
System.Int32 | controlNumber | ISA13: A unique number assigned by the sender. To provide sufficient discrimination for the acknowledgment process to operate reliably and to ensure that audit trails are unambiguous, the combination of interchange sender’s qualifier and ID(ISA05, ISA06), interchange receiver’s qualifier and ID(ISA07, ISA08) and the interchange control number value(ISA13) shall by themselves be unique within a reasonably extended time frame whose boundaries shall be defined by trading partner agreement.Because at some point it may be necessary to reuse a sequence of control numbers, the Interchange Date and Time may serve as an additional discriminant only to differentiate interchange identity over the longest possible time frame. |
System.Boolean | production | ISA15: Code indicating whether data enclosed by this interchange envelope is test or production |
System.Boolean | requestAck | ISA14: Code indicating sender’s request for an interchange (TA1) acknowledgment. |
Returns
Type | Description |
---|---|
X12Doc |
Generate277(Int32)
Generates a 277 in response to the current X12Doc 837 document.
Declaration
public X12Doc Generate277(int controlNumber)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | controlNumber | A control number assigned by the interchange sender |
Returns
Type | Description |
---|---|
X12Doc | Returns a new instance of the 277 document else null on failure |
Generate999(Int32)
Generates a 999 in response to the current X12Doc document.
Declaration
public X12Doc Generate999(int controlNumber)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | controlNumber | A control number assigned by the interchange sender |
Returns
Type | Description |
---|---|
X12Doc | Returns a new instance of the 999 document else null on failure |
GenerateTA1(Int32)
Generates a TA1 document in response to the current X12Doc document.
Declaration
public X12Doc GenerateTA1(int controlNumber)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | controlNumber | A control number assigned by the interchange sender |
Returns
Type | Description |
---|---|
X12Doc | Returns a new instance of the TA1 document else null on failure |
Groups()
Declaration
public IEnumerable<X12Group> Groups()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<X12Group> |
Load(String)
Loads an X12 document from a file. The X12 Document may be an 837, 835, 277, 999 or TA1
Declaration
public static X12Doc Load(string filename)
Parameters
Type | Name | Description |
---|---|---|
System.String | filename | full path and filename of the X12 document to load |
Returns
Type | Description |
---|---|
X12Doc | Returns a new instance of the X12 document else null on failure |
Refresh()
IEA01: Refreshes the group count from actual groups in the X12Document. Use this method after creating a X12Doc to ensure all counters are up to date.
Declaration
public bool Refresh()
Returns
Type | Description |
---|---|
System.Boolean | true on success else false |
Save(String, X12DocOptions)
Saves the current document to disk
Declaration
public bool Save(string filename, X12DocOptions flags)
Parameters
Type | Name | Description |
---|---|---|
System.String | filename | filename to save too |
X12DocOptions | flags | save options |
Returns
Type | Description |
---|---|
System.Boolean |
SetDelimiters(Char, Char, Char, Char)
Sets the delimiters to be used by the current document when saving document to file
Declaration
public bool SetDelimiters(char segment = '~', char element = '*', char repetative = '^', char composite = ':')
Parameters
Type | Name | Description |
---|---|---|
System.Char | segment | |
System.Char | element | |
System.Char | repetative | The repetition separator is a delimiter and not a data element; this field provides the delimiter used to separate repeated occurrences of a simple data element or a composite data structure; this value must be different than the data element separator, component element separator, and the segment terminator. Default:'^' |
System.Char | composite | The component element separator is a delimiter and not a data element; this field provides the delimiter used to separate component data elements within a composite data structure; this value must be different than the data element separator and the segment terminator. Default:':' |
Returns
Type | Description |
---|---|
System.Boolean |
SetReceiver(String, String, X12EntityType, String)
Sets the receiver for the transaction including appropriate loops.
Declaration
public bool SetReceiver(string idQual, string ETIN, X12EntityType entityType, string lastOrOrgName)
Parameters
Type | Name | Description |
---|---|---|
System.String | idQual | ETIN ID Qualifier.
|
System.String | ETIN | Electronic Trader Identification Number. ISA08, GS03 and NM109 where appropriate. |
X12EntityType | entityType | |
System.String | lastOrOrgName |
Returns
Type | Description |
---|---|
System.Boolean |