Electronic Data Interchange
Generating the Implementation Acknowledgment (ASC/X12)

Generating an implementation acknowledgment in Framework EDI (FREDI) requires the following:

  1. An EDI document to verify.
  2. A Standard Exchange Format (SEF) implementation guideline.
  3. Programmatically Generate the Implementation Acknowledgment.

 

A Standard Exchange Format Implementation Guideline

The following implementation guidelines are required to generate an implementation acknowledgment:

  1. An implementation guideline containing the transaction set(s) that defines the syntax of the subject document.  When the subject document is traverse, this implementation guideline is referenced regarding the correct syntax of semantic objects encountered.  An example of an implementation guideline for the subject document is one that contains the Health Care Claim (837) transaction set.
  2. An implementation guideline containing the Implementation Acknowledgment (999) transaction set.  This guideline is used to build the implementation acknowledgment.

Both transaction sets can  be referenced in the standard reference library as long as the EnableStandardReference (in the ediSchemas) is set to TRUE (or 1) .  When the subject document is verifying, the 837 and 997 transaction sets provided in SEF files will be referred to first, if any were provided; otherwise the 837 and 997 transaction sets will be searched in the library and used if found.

If the implementation guidelines were provided in Standard Exchange Format (SEF) files, the transaction sets can be provided as two separate files or both transaction sets can be in the same SEF file.  If the required transaction sets are not found in the SEF files then the standard reference library will be consulted. To exclusively use the SEF files, set the EnableStandardReference to FALSE (or 0).  In this case, an error is generated if the transaction sets are not found.

 

Programmatically Generate the Implementation Acknowledgment

To generate an implementation guideline for EDI documents, enable the option EnableImplementationAcknowledgment in the ediAcknowledgment.  The following example is in Visual Basic, and the following sample files are used:

Create an instance of ediDocument.  The ediDocument object is the top level application instance for Framework EDI (FREDI).  This object is the topmost object in the object model hierarchy of FREDI.  This instance is always created at the start of a program.

Dim oEdiDoc As Fredi.ediDocument

Set oEdiDoc = New Fredi.ediDocument

Enable the Implementation Acknowledgment.  To enable the generation of the implementation acknowledgment, set the option EnableImplementationAcknowledgment (in the ediAcknowledgment) object to TRUE.

Dim oAcknowledgment As Fredi.ediAcknowledgment

' Enable to generate implementation acknowledgment
Set oAcknowledgment = oEdiDoc.GetAcknowledgment
oAcknowledgment.EnableImplementationAcknowledgment = True

Specify implementation guidelines.  Specify the implementation guidelines using the LoadSchema method of the ediDocument object.  In this example, the standard reference library will not be used so we disable its use by setting the EnableStandardReference property to false in the ediSchemas object.

Dim oSchemas As Fredi.ediSchemas
Dim oSchema850 As Fredi.ediSchema
Dim oSchema999 As Fredi.ediSchema

' Disable standard reference library.
Set oSchemas = oEdiDoc.GetSchemas
oSchemas.EnableStandardReference = False

' Load schema for Health Care Claim document.
Set oSchema850 = oEdiDoc.LoadSchema(App.Path & "\837_4010X098.SEF", Schema_Standard_Exchange_Format)
' Load schema for Implementation Acknowledgment.
Set oSchema999 = oEdiDoc.LoadSchema(App.Path & "\999_X12-5010.SEF", Schema_Standard_Exchange_Format)

Load EDI document.  Load the EDI document using the LoadEdi method of the ediDocument object.  This method will read the 837_4010X098.X12 subject document file, and verify its correctness using the 837 transaction set in the 837_4010X098.SEF file previously loaded using the LoadSchema method.  The acknowledgment is automatically created and organized internally in a hierarchical tree.

' Load EDI document normally.
oEdiDoc.LoadEdi App.Path & "\837_4010X098.X12"

Traverse Data Segments of the Acknowledgment.  The implementation acknowledgment is automatically created as the file 837_4010X098.X12 is verified.  The transaction set 999 is used as a guideline to build the implementation acknowledgment document, and because it is also an EDI file, it contains data segments that can be traversed.  To traverse the data segments, access the first data segment in the implementation acknowledgment using the GetFirstDataSegmentByAck of the ediAcknowledgment object, and pass the implementation guideline identifier: "999".  Move down subsequent data segments in the tree using NextDataSegment method.

' Traverse all the data segments in the EDI document and extract the value in the its individual
' data elements.

Set oDataSegment = oAcknowledgment.GetFirst997DataSegmentByAck("999")

While Not oDataSegment Is Nothing

Dim oDataElements As Fredi.ediDataElements
Dim oDataElement As Fredi.ediDataElement

sDisplayString = sDisplayString & "Segment: " & oDataSegment.ID & vbCrLf

' Get the data elements collection of the data segment.
Set oDataElements = oDataSegment.DataElements

' Get the value of the individual data elements
For Each oDataElement In oDataElements
' Only show data elements that have data
If Len(oDataElement.Value) > 0 Then
sDisplayString = sDisplayString & vbTab & "Element: " & oDataElement.ID & " = " & oDataElement.Value & vbCrLf
End If
Next

' Get the next data segment in the document.
Set oDataSegment = oEdiDoc.NextDataSegment
Wend

Save or View the Implementation Acknowledgment.  Alternatively, the implementation acknowledgment can be saved to a file using the Save method, or viewed using the GetEdiString method (in the ediAcknowledgment) object.


' View the functiona acknowledgment
MsgBox oAcknowledgment.GetEdiString()

See Also: