Skip to main content

Demo.X12.SorterDTL.HelperMethods

class Demo.X12.SorterDTL.HelperMethods

This class consists of a number of helper methods which are used in the X12 Interchange and Group Sorting demos. The purpose of these methods is to keep the DTL's in the demos as clean looking as possible so that the important details can be more easily visible.

Method Inventory

Methods

classmethod AddChildToDocsRef(pChild As EnsLib.EDI.X12.Document, pParent As EnsLib.EDI.X12.Document, pDocsRefSeg As %String) as %Status
Adds a child X12 document pChild, (a Transaction Set or a Group) as the child of a Group or Interchange pParent's DocsRef segment. pDocsRefSeg is the segment name for the DocsRef segment ("TransactionSetDocsRef" for a Group or "GroupDocsRef" for an Interchange). Returns a status code.
classmethod CreateNewGroupFromOld(oldGroup As EnsLib.EDI.X12.Document) as EnsLib.EDI.X12.Document
Takes in an X12 Group oldGroup and returns a new Group with an identical GS segment and the same schema category.
classmethod CreateNewInterchangeFromOld(oldInterchange As EnsLib.EDI.X12.Document) as EnsLib.EDI.X12.Document
Takes in an X12 Interchange oldInterchange and returns a new Interchange with an identical ISA segment (and TA1 segment, if relevant) and the same schema category.
classmethod CreateNewParentFromOld(oldParent As EnsLib.EDI.X12.Document, Output newParent As EnsLib.EDI.X12.Document) as %Status
Takes in an X12 Interchange or Group oldParent and creates from it a new Interchange or Group in the Output variable newParent. Returns a status code.
classmethod FindParents(pChild As EnsLib.EDI.X12.Document, pOldParent1 As EnsLib.EDI.X12.Document, Parent1Array As %ArrayOfObjects, Parent2Array As %ArrayOfObjects, key1 As %String = "", key2 As %String = "") as %Status
Adds a child X12 document pChild as the child of the appropriate Group or Interchange document(s). Parent1Array is the array containing X12 documents of the docType that serves as a direct parent to pChild. This means that if pChild is a Transaction Set, then Parent1Array should be an array of Groups, but if pChild is a Group, then Parent1Array should be an array of Interchanges. If relevant, Parent2Array is an array containing X12 documents of the docType that serves as a parent to the parent of pChild. This means that if pChild is a Transaction Set document, the Parent2Array should be an array of Interchangess, but will otherwise be empty. key1 determines which parent document in Parent1Array, pChild should be a child of. If no existing parent document is a match, a new parent document based on pOldParent1 is created. In the demos, pOldParent1 is the parent document to the original (non-transformed) document. If relevant, key2 determines which parent document in Parent2Array, the newly determined parent of pChild should be a child of. This parent of the parent may also be created if no document in Parent2Array already matches key2. Returns status code.
classmethod SaveChanges(pDoc As EnsLib.EDI.X12.Document) as %Status
FeedbackOpens in a new tab