X12Writer Class

Properties   Methods   Events   Config Settings   Errors  

The X12Writer class generates X12 documents with a clear, straightforward API.

Syntax

class edisdk.X12Writer

Remarks

The class allows you to create an EDI document from scratch, one segment at a time. Here's how a document would normally be created:

  1. Call load_schema to load the necessary schemas for the transactions that will be used.
  2. Specify where to write the output document by setting the output_file, or check the output_data property after writing.
  3. Create a new interchange start segment by setting the fields of the interchange property and call the start_interchange method. Once the interchange is complete, call end_interchange to add the interchange footer.
  4. If you want to create a functional group, set the fields of the functional_group property and then call the start_functional_group. Once all the transactions in the group have been created, call end_functional_group to add a footer for the group.
  5. To start a transaction, call the start_transaction_set method. Once all segments have been added, call end_transaction_set to add a footer to the transaction.
  6. To begin a segment, call the start_segment method and pass in the tag for the segment. Once all the elements in the segment have been added, call end_segment to add the segment terminator.
  7. To write a basic element to the current segment, call the write_element method.
  8. To write a composite element, call the start_composite_element method, then call the write_component method for each component, and finally call end_composite_element to end the element.

Property List


The following is the full list of the properties of the class with short descriptions. Click on the links for further details.

delimiter_componentThe delimiter separating classes.
delimiter_elementThe delimiter separating elements.
delimiter_repetitionThe delimiter separating classes.
delimiter_segmentThe delimiter separating segments.
file_write_modeDetermines how the output file is opened for writing.
f_group_app_receiver_codeThe name or code of the intended receiver of the transaction set group.
f_group_app_sender_codeCode identifying the sender of FunctionalGroup This is an alphanumeric property with a value between 2 and 15 characters long.
f_group_dateThe date that the group of transaction sets was prepared.
f_group_functional_identifier_codeA code identifying the type of transaction sets included in the functional group.
f_group_group_control_numAn identification number assigned by the sender to uniquely identify the group of transaction sets.
f_group_responsible_agency_codeA code identifying the issuer of the standard that the transaction set conforms to.
f_group_timeThe time that the group of transaction sets was prepared.
f_group_versionCode indicating the version of the X12 standard used to construct the transaction set.
interchange_ack_requestCode indicating whether an interchange acknowledgment is requested.
interchange_authorization_infoInformation used for additional identification or authorization of the interchange sender or the data in the interchange.
interchange_authorization_info_qualifierA code indicating the type of data supplied in Authorization Information property.
interchange_dateThe date that the Interchange was prepared.
interchange_interchange_control_numA control number assigned by the sender to uniquely identify the interchange.
interchange_interchange_control_version_numA code specifying the version of the X12 standard used to construct the Interchange.
interchange_receiver_idThe identification code of the receiver of the transaction set.
interchange_receiver_id_qualifierA code that identifies the format of the receiver ID.
interchange_security_infoCoded security information associated with the Interchange.
interchange_security_info_qualifierA code indicating the type of data in the Security Information property.
interchange_sender_idThe identification code of the sender of the transaction set.
interchange_sender_id_qualifierA code that identifies the format of the sender ID.
interchange_timeThe time that the Interchange sets was prepared.
interchange_usage_indicatorCode to indicate whether the interchange is a test or production.
output_dataThe output data that has been written so far.
output_fileThe name of the output file to which the EDI data will be written.
segment_suffixThe suffix that is appended to the end of a segment.
trans_set_imp_convention_referenceReference used to identify the implementation convention.
trans_set_transaction_set_control_numThe unique transaction set control number assigned for a transaction set.
trans_set_transaction_set_id_codeThe identifier code for the transaction set.

Method List


The following is the full list of the methods of the class with short descriptions. Click on the links for further details.

closeCloses the writer.
configSets or retrieves a configuration setting.
end_composite_elementCloses the current composite element.
end_functional_groupCloses the current functional group.
end_interchangeCloses the current interchange.
end_segmentFinish writing the current segment.
end_transaction_setCloses the current transaction set.
resetResets all properties to their default values.
start_composite_elementStarts a composite element within the current segment.
start_functional_groupStarts a new functional group in the EDI document.
start_interchangeStarts a new interchange in the EDI document.
start_segmentStarts a new segment with the specified tag.
start_transaction_setStarts a new transaction set in the EDI document.
write_componentWrites a class element value to the current composite element.
write_elementWrites an element value to the current segment.

Event List


The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.

on_errorFires when an error occurs during message processing. Normally, the class fails with an error.
on_outputFires when output data is written.

Config Settings


The following is a list of config settings for the class with short descriptions. Click on the links for further details.

delimiter_component property

The delimiter separating classes.

Syntax

def get_delimiter_component() -> str: ...
def set_delimiter_component(value: str) -> None: ...

delimiter_component = property(get_delimiter_component, set_delimiter_component)

Default Value

":"

Remarks

The delimiter separating components.

In X12Reader, this type is used to hold the delimiters found when parsing the component, while in X12Writer the fields can be set to choose the delimiters that will be used when writing

delimiter_element property

The delimiter separating elements.

Syntax

def get_delimiter_element() -> str: ...
def set_delimiter_element(value: str) -> None: ...

delimiter_element = property(get_delimiter_element, set_delimiter_element)

Default Value

"*"

Remarks

The delimiter separating elements.

In X12Reader, this type is used to hold the delimiters found when parsing the element, while in X12Writer the fields can be set to choose the delimiters that will be used when writing

delimiter_repetition property

The delimiter separating classes.

Syntax

def get_delimiter_repetition() -> str: ...
def set_delimiter_repetition(value: str) -> None: ...

delimiter_repetition = property(get_delimiter_repetition, set_delimiter_repetition)

Default Value

"^"

Remarks

The delimiter separating components.

In X12Reader, this type is used to hold the delimiters found when parsing the component, while in X12Writer the fields can be set to choose the delimiters that will be used when writing

delimiter_segment property

The delimiter separating segments.

Syntax

def get_delimiter_segment() -> str: ...
def set_delimiter_segment(value: str) -> None: ...

delimiter_segment = property(get_delimiter_segment, set_delimiter_segment)

Default Value

"~"

Remarks

The delimiter separating segments.

In X12Reader, this type is used to hold the delimiters found when parsing the segment, while in X12Writer the fields can be set to choose the delimiters that will be used when writing

file_write_mode property

Determines how the output file is opened for writing.

Syntax

def get_file_write_mode() -> int: ...
def set_file_write_mode(value: int) -> None: ...

file_write_mode = property(get_file_write_mode, set_file_write_mode)

Possible Values

0   # Create
1 # Overwrite
2 # Append

Default Value

0

Remarks

When output_file is set, this property determines how the file will be opened.

fwmCreate (Default)Creates a new file. If the file already exists, the translation will fail.
fwmOverwriteOpens an existing file and overwrites its contents. If the file does not exist, a new file will be created.
fwmAppendOpens an existing file and appends data to the end of the file. If the file does not exist, a new file will be created.

f_group_app_receiver_code property

The name or code of the intended receiver of the transaction set group.

Syntax

def get_f_group_app_receiver_code() -> str: ...
def set_f_group_app_receiver_code(value: str) -> None: ...

f_group_app_receiver_code = property(get_f_group_app_receiver_code, set_f_group_app_receiver_code)

Default Value

""

Remarks

The name or code of the intended receiver of the transaction set group.

This is an alphanumeric field with a value between 2 and 15 characters.

f_group_app_sender_code property

Code identifying the sender of FunctionalGroup This is an alphanumeric property with a value between 2 and 15 characters long.

Syntax

def get_f_group_app_sender_code() -> str: ...
def set_f_group_app_sender_code(value: str) -> None: ...

f_group_app_sender_code = property(get_f_group_app_sender_code, set_f_group_app_sender_code)

Default Value

""

Remarks

Code identifying the sender of functional_group

This is an alphanumeric field with a value between 2 and 15 characters long.

f_group_date property

The date that the group of transaction sets was prepared.

Syntax

def get_f_group_date() -> str: ...
def set_f_group_date(value: str) -> None: ...

f_group_date = property(get_f_group_date, set_f_group_date)

Default Value

""

Remarks

The date that the group of transaction sets was prepared.

This is a numeric field with a value in the format YYMMDD.

f_group_functional_identifier_code property

A code identifying the type of transaction sets included in the functional group.

Syntax

def get_f_group_functional_identifier_code() -> str: ...
def set_f_group_functional_identifier_code(value: str) -> None: ...

f_group_functional_identifier_code = property(get_f_group_functional_identifier_code, set_f_group_functional_identifier_code)

Default Value

""

Remarks

A code identifying the type of transaction sets included in the functional group.

This is an alphanumeric field with a code value between of 2 characters.

f_group_group_control_num property

An identification number assigned by the sender to uniquely identify the group of transaction sets.

Syntax

def get_f_group_group_control_num() -> str: ...
def set_f_group_group_control_num(value: str) -> None: ...

f_group_group_control_num = property(get_f_group_group_control_num, set_f_group_group_control_num)

Default Value

""

Remarks

An identification number assigned by the sender to uniquely identify the group of transaction sets.

This is a numeric field with a value between 1 and 9 digits.

f_group_responsible_agency_code property

A code identifying the issuer of the standard that the transaction set conforms to.

Syntax

def get_f_group_responsible_agency_code() -> str: ...
def set_f_group_responsible_agency_code(value: str) -> None: ...

f_group_responsible_agency_code = property(get_f_group_responsible_agency_code, set_f_group_responsible_agency_code)

Default Value

""

Remarks

A code identifying the issuer of the standard that the transaction set conforms to.

This is an alphanumeric field with a code value of 1 to 2 characters.

f_group_time property

The time that the group of transaction sets was prepared.

Syntax

def get_f_group_time() -> str: ...
def set_f_group_time(value: str) -> None: ...

f_group_time = property(get_f_group_time, set_f_group_time)

Default Value

""

Remarks

The time that the group of transaction sets was prepared.

This is a numeric field with a value between 4 and 8 digits in the format HHMM, HHMMSS, or HHMMSSDD. Time should be in the 24-hour format.

f_group_version property

Code indicating the version of the X12 standard used to construct the transaction set.

Syntax

def get_f_group_version() -> str: ...
def set_f_group_version(value: str) -> None: ...

f_group_version = property(get_f_group_version, set_f_group_version)

Default Value

""

Remarks

Code indicating the version of the X12 standard used to construct the transaction set.

This is an alphanumeric field with a code value between 1 and 12 characters.

interchange_ack_request property

Code indicating whether an interchange acknowledgment is requested.

Syntax

def get_interchange_ack_request() -> str: ...
def set_interchange_ack_request(value: str) -> None: ...

interchange_ack_request = property(get_interchange_ack_request, set_interchange_ack_request)

Default Value

""

Remarks

Code indicating whether an interchange acknowledgment is requested.

This is an alphanumeric field with a code value of 1 character, either "0" (no acknowledgment requested) or "1" (acknowledgment requested).

interchange_authorization_info property

Information used for additional identification or authorization of the interchange sender or the data in the interchange.

Syntax

def get_interchange_authorization_info() -> str: ...
def set_interchange_authorization_info(value: str) -> None: ...

interchange_authorization_info = property(get_interchange_authorization_info, set_interchange_authorization_info)

Default Value

""

Remarks

Information used for additional identification or authorization of the interchange sender or the data in the interchange.

The type of information is set by the AuthorizationInfoQual field.

interchange_authorization_info_qualifier property

A code indicating the type of data supplied in Authorization Information property.

Syntax

def get_interchange_authorization_info_qualifier() -> str: ...
def set_interchange_authorization_info_qualifier(value: str) -> None: ...

interchange_authorization_info_qualifier = property(get_interchange_authorization_info_qualifier, set_interchange_authorization_info_qualifier)

Default Value

""

Remarks

A code indicating the type of data supplied in Authorization Information field.

This is an alphanumeric field with a code value of 2 characters.

interchange_date property

The date that the Interchange was prepared.

Syntax

def get_interchange_date() -> str: ...
def set_interchange_date(value: str) -> None: ...

interchange_date = property(get_interchange_date, set_interchange_date)

Default Value

""

Remarks

The date that the Interchange was prepared.

This is a numeric field with a value of 6 digits in the format YYMMDD.

interchange_interchange_control_num property

A control number assigned by the sender to uniquely identify the interchange.

Syntax

def get_interchange_interchange_control_num() -> str: ...
def set_interchange_interchange_control_num(value: str) -> None: ...

interchange_interchange_control_num = property(get_interchange_interchange_control_num, set_interchange_interchange_control_num)

Default Value

""

Remarks

A control number assigned by the sender to uniquely identify the interchange.

This is a numeric field with a value of 9 digits.

interchange_interchange_control_version_num property

A code specifying the version of the X12 standard used to construct the Interchange.

Syntax

def get_interchange_interchange_control_version_num() -> str: ...
def set_interchange_interchange_control_version_num(value: str) -> None: ...

interchange_interchange_control_version_num = property(get_interchange_interchange_control_version_num, set_interchange_interchange_control_version_num)

Default Value

""

Remarks

A code specifying the version of the X12 standard used to construct the Interchange.

This is an alphanumeric field with a code value 5 characters.

interchange_receiver_id property

The identification code of the receiver of the transaction set.

Syntax

def get_interchange_receiver_id() -> str: ...
def set_interchange_receiver_id(value: str) -> None: ...

interchange_receiver_id = property(get_interchange_receiver_id, set_interchange_receiver_id)

Default Value

""

Remarks

The identification code of the receiver of the transaction set.

This is an alphanumeric field with a value of 15 characters.

interchange_receiver_id_qualifier property

A code that identifies the format of the receiver ID.

Syntax

def get_interchange_receiver_id_qualifier() -> str: ...
def set_interchange_receiver_id_qualifier(value: str) -> None: ...

interchange_receiver_id_qualifier = property(get_interchange_receiver_id_qualifier, set_interchange_receiver_id_qualifier)

Default Value

""

Remarks

A code that identifies the format of the receiver ID.

This is an alphanumeric field with a code value of 2 characters.

interchange_security_info property

Coded security information associated with the Interchange.

Syntax

def get_interchange_security_info() -> str: ...
def set_interchange_security_info(value: str) -> None: ...

interchange_security_info = property(get_interchange_security_info, set_interchange_security_info)

Default Value

""

Remarks

Coded security information associated with the Interchange.

The type of information is set by the SecurityInfoQualifier.

This is an alphanumeric field with a value between of 10 characters.

interchange_security_info_qualifier property

A code indicating the type of data in the Security Information property.

Syntax

def get_interchange_security_info_qualifier() -> str: ...
def set_interchange_security_info_qualifier(value: str) -> None: ...

interchange_security_info_qualifier = property(get_interchange_security_info_qualifier, set_interchange_security_info_qualifier)

Default Value

""

Remarks

A code indicating the type of data in the Security Information field.

This is an alphanumeric field with a code value of 2 characters.

interchange_sender_id property

The identification code of the sender of the transaction set.

Syntax

def get_interchange_sender_id() -> str: ...
def set_interchange_sender_id(value: str) -> None: ...

interchange_sender_id = property(get_interchange_sender_id, set_interchange_sender_id)

Default Value

""

Remarks

The identification code of the sender of the transaction set.

This is an alphanumeric field with a value of 15 characters.

interchange_sender_id_qualifier property

A code that identifies the format of the sender ID.

Syntax

def get_interchange_sender_id_qualifier() -> str: ...
def set_interchange_sender_id_qualifier(value: str) -> None: ...

interchange_sender_id_qualifier = property(get_interchange_sender_id_qualifier, set_interchange_sender_id_qualifier)

Default Value

""

Remarks

A code that identifies the format of the sender ID.

This is an alphanumeric field with a code value of 2 characters.

interchange_time property

The time that the Interchange sets was prepared.

Syntax

def get_interchange_time() -> str: ...
def set_interchange_time(value: str) -> None: ...

interchange_time = property(get_interchange_time, set_interchange_time)

Default Value

""

Remarks

The time that the Interchange sets was prepared.

This is a numeric field with a value in the format HHMM.

interchange_usage_indicator property

Code to indicate whether the interchange is a test or production.

Syntax

def get_interchange_usage_indicator() -> str: ...
def set_interchange_usage_indicator(value: str) -> None: ...

interchange_usage_indicator = property(get_interchange_usage_indicator, set_interchange_usage_indicator)

Default Value

""

Remarks

Code to indicate whether the interchange is a test or production.

This is an alphanumeric field with a code value of 1 character.

output_data property

The output data that has been written so far.

Syntax

def get_output_data() -> str: ...
def set_output_data(value: str) -> None: ...

output_data = property(get_output_data, set_output_data)

Default Value

""

Remarks

OutputData contains the entire EDI document that has been written so far. If writing to a file or stream, this property will be empty.

output_file property

The name of the output file to which the EDI data will be written.

Syntax

def get_output_file() -> str: ...
def set_output_file(value: str) -> None: ...

output_file = property(get_output_file, set_output_file)

Default Value

""

Remarks

file_write_mode property determines how the file is opened for writing. If OutputFile is empty, no file will be written and the OutputData property will contain the EDI data instead.

segment_suffix property

The suffix that is appended to the end of a segment.

Syntax

def get_segment_suffix() -> int: ...
def set_segment_suffix(value: int) -> None: ...

segment_suffix = property(get_segment_suffix, set_segment_suffix)

Possible Values

0   # None
1 # CR
2 # LF
3 # CRLF

Default Value

0

Remarks

Possible values are:

ssNone (0)No suffix is appended to the segment.
ssCR (1)A carriage return (ASCII 13) is appended to the segment.
ssLF (2)A line feed (ASCII 10) is appended to the segment.
ssCRLF (3)A carriage return followed by a line feed (ASCII 13 and 10) is appended to the segment. This is the default value.

trans_set_imp_convention_reference property

Reference used to identify the implementation convention.

Syntax

def get_trans_set_imp_convention_reference() -> str: ...
def set_trans_set_imp_convention_reference(value: str) -> None: ...

trans_set_imp_convention_reference = property(get_trans_set_imp_convention_reference, set_trans_set_imp_convention_reference)

Default Value

""

Remarks

Reference used to identify the implementation convention.

This is an alphanumeric field with a value up to 35 characters long.

trans_set_transaction_set_control_num property

The unique transaction set control number assigned for a transaction set.

Syntax

def get_trans_set_transaction_set_control_num() -> str: ...
def set_trans_set_transaction_set_control_num(value: str) -> None: ...

trans_set_transaction_set_control_num = property(get_trans_set_transaction_set_control_num, set_trans_set_transaction_set_control_num)

Default Value

""

Remarks

The unique transaction set control number assigned for a transaction set.

This is an alphanumeric field with a value between 4 and 9 characters long.

trans_set_transaction_set_id_code property

The identifier code for the transaction set.

Syntax

def get_trans_set_transaction_set_id_code() -> str: ...
def set_trans_set_transaction_set_id_code(value: str) -> None: ...

trans_set_transaction_set_id_code = property(get_trans_set_transaction_set_id_code, set_trans_set_transaction_set_id_code)

Default Value

""

Remarks

The identifier code for the transaction set.

This is an alphanumeric field with a code value of 3 characters long.

close method

Closes the writer.

Syntax

def close() -> None: ...

Remarks

Calling close will close the writer and release any resources associated with it. After calling close, the writer cannot be used unless it is re-initialized.

config method

Sets or retrieves a configuration setting.

Syntax

def config(configuration_string: str) -> str: ...

Remarks

config is a generic method available in every class. It is used to set and retrieve configuration settings for the class.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the config method.

To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.

end_composite_element method

Closes the current composite element.

Syntax

def end_composite_element() -> None: ...

Remarks

Calling end_composite_element will close the current composite element. If no composite element is open, an error will be raised.

end_functional_group method

Closes the current functional group.

Syntax

def end_functional_group() -> None: ...

Remarks

Calling end_functional_group will close the current functional group. If no functional group is open, an error will be raised. This method will also write the required FunctionalGroup Trailer (GE) segment to the output.

end_interchange method

Closes the current interchange.

Syntax

def end_interchange() -> None: ...

Remarks

Calling end_interchange will close the current interchange. If no interchange is open, an error will be raised. This method will also write the required Interchange Trailer (IEA) segment to the output.

end_segment method

Finish writing the current segment.

Syntax

def end_segment() -> None: ...

Remarks

Calling end_segment will finish writing the current segment. If no segment is open or if a composite element is still open an error will be raised. This method will also write the segment delimiter and segment suffix to the output.

end_transaction_set method

Closes the current transaction set.

Syntax

def end_transaction_set() -> None: ...

Remarks

Calling this method will close the current transaction set. If no transaction set is open, an error will be raised. This method will also write the required Transaction Set Trailer (SE) segment to the output.

reset method

Resets all properties to their default values.

Syntax

def reset() -> None: ...

Remarks

This method resets all properties of the component to their default values as specified in the property definitions.

start_composite_element method

Starts a composite element within the current segment.

Syntax

def start_composite_element() -> None: ...

Remarks

This method starts a composite element within the current segment. The composite element can contain multiple component elements. The composite element is ended by calling the end_composite_element method. Component elements within the composite are added by calling the write_component method.

start_functional_group method

Starts a new functional group in the EDI document.

Syntax

def start_functional_group() -> None: ...

Remarks

This method starts a new functional group in the EDI document. The functional group fields must be set using the appropriate properties before calling this method. The functional group is ended by calling the end_functional_group method. The functional group header segment (GS) is written to the output when this method is called.

start_interchange method

Starts a new interchange in the EDI document.

Syntax

def start_interchange() -> None: ...

Remarks

This method starts a new interchange in the EDI document. The interchange fields must be set using the appropriate properties before calling this method. The interchange is ended by calling the end_interchange method. The interchange header segment (ISA) is written to the output when this method is called. If opening a new interchange would result in an invalid structure (for example, starting a new interchange before ending the previous one), an error will be raised.

start_segment method

Starts a new segment with the specified tag.

Syntax

def start_segment(tag: str) -> None: ...

Remarks

This method starts a new segment with the specified tag. The segment is ended by calling the end_segment method. Element values within the segment are added by calling the write_element method. Composite elements can be added to the segment by calling the start_composite_element method. If starting a new segment would result in an invalid structure (for example, starting a new segment before ending the previous one), an error will be raised.

start_transaction_set method

Starts a new transaction set in the EDI document.

Syntax

def start_transaction_set() -> None: ...

Remarks

This method starts a new transaction set in the EDI document. The transaction set fields must be set using the appropriate properties before calling this method. The transaction set is ended by calling the end_transaction_set method. The transaction set header segment (ST) is written to the output when this method is called. If opening a new transaction set would result in an invalid structure (for example, starting a new transaction set before ending the previous one), an error will be raised.

write_component method

Writes a class element value to the current composite element.

Syntax

def write_component(val: str) -> None: ...

Remarks

This method writes a component element value to the current composite element. The composite element must be started by calling the start_composite_element method before calling this method. The composite element is ended by calling the end_composite_element method. If this method is called when not within a composite element, an error will be raised.

write_element method

Writes an element value to the current segment.

Syntax

def write_element(val: str) -> None: ...

Remarks

This method writes an element value to the current segment. The segment must be started by calling the start_segment method before calling this method. The segment is ended by calling the end_segment method. If this method is called when not within a segment, an error will be raised.

on_error event

Fires when an error occurs during message processing. Normally, the class fails with an error.

Syntax

class X12WriterErrorEventParams(object):
  @property
  def error_code() -> int: ...

  @property
  def description() -> str: ...

# In class X12Writer:
@property
def on_error() -> Callable[[X12WriterErrorEventParams], None]: ...
@on_error.setter
def on_error(event_hook: Callable[[X12WriterErrorEventParams], None]) -> None: ...

Remarks

The on_error event is fired in case of exceptional conditions during message processing. Normally, the class fails with an error.

ConnectionId is the associated client Id, ErrorCode contains an error code, and Description contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.

on_output event

Fires when output data is written.

Syntax

class X12WriterOutputEventParams(object):
  @property
  def data() -> bytes: ...

# In class X12Writer:
@property
def on_output() -> Callable[[X12WriterOutputEventParams], None]: ...
@on_output.setter
def on_output(event_hook: Callable[[X12WriterOutputEventParams], None]) -> None: ...

Remarks

This event is fired when output data is written. The Data parameter contains the segment that was written.

X12Writer Config Settings

The class accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the config method.

X12Writer Errors

X12Writer Errors

202   Invalid argument.
304   Cannot write to file.
1099   Encountered an unexpected segment tag.
1100   Attempted to perform an action while the component was busy, or close an incomplete interchange.
1205   Tried to perform an operation in a bad state (such as ending an interchange before starting one).
1206   Tried to end an interchange with no contents.