EnsLib.EDI.X12.Util.Validator
abstract class EnsLib.EDI.X12.Util.Validator
Method Inventory
- CleanupValidationData()
- ConstructBatchReply()
- GetSegmentErrors()
- GetTransactionSetErrorCodes()
- PerformSNIPValidation()
- SplitBatch()
- SplitGroup()
- Validate()
- ValidateDateTime()
- ValidateOneDataElem()
Parameters
Methods
If prior validation data exists, it will be used. Otherwise, this method will perform the validation specified in Validation in type:level format, so SNIP 1 validation is 'SNIP:1' and dm Flag validation is 'Flags:dm'
pSC represents any parsing errors in the original document
pBatchReplyType is string indicating what kind of batch reply should we construct for an Interchange batch we have received Note that all the options here that relate to TA1 segments are used to force a TA1 segment to be generated, often as the only body segment of the reply interchange. This is used to represent the presence or absence of errors in the whole inbound Interchange. However if an error is found in the incoming ISA or IEA that can only be reported in a TA1 segment, then a TA1 will be generated even if the configured setting does not force a TA1 to appear.
- All : Generate a reply Interchange containing a reply notification for every TransactionSet in the Interchange we received
- All+ISA14TA1 : Generate a reply Interchange containing a TA1 segment only if either a 1 appears in field ISA:14 of the ISA header segment or if there is an error at the Interchange level. If no error at the Interchange level, then send a reply for each Transaction Set we received.
- Errors : Generate a reply Interchange containing reply notifications only for TransactionSets in which errors are detected, or an empty Interchange if no error is found
- OnlyIfErrors : Only if errors are found, generate a reply Interchange containing reply notifications only for TransactionSets in which errors are detected
- Successes : Generate a reply Interchange containing reply notifications only for TransactionSets in which no errors are detected, or an empty Interchange if only errors are found
pForceTA1 is a boolean indicating whether to include a TA1 segment in the reply even if there are no Interchange-level errors
pBatchErrorAction is a string indicating what to do when detecting a validation error in a batch Interchange document:
- Reject With All Errors : Reject the whole batch if any error is found in any document within it. Enumerate all errors found if BatchReplyType allows for reporting them. This will prevent forwarding any documents in a batch until all have been read and validated.
- Accept With Errors : Accept documents with errors, but do take note of all errors found if BatchReplyType allows for reporting them. This will prevent forwarding any documents in a batch until all have been read and validated.
- Reject On First Error : Reject the whole batch when the first error is found in any document within it. Don't bother checking for more errors or parsing any further contents of the Interchange. This will prevent forwarding any documents in a batch until all have been read and validated.
- Reject Individual Errors : Reject only those documents within the Interchange that have errors. Forward each acceptable child document to the target config item(s) as soon as it has been read and validated.
pLocalApplicationID is colon-separated Local ID:Qualifier codes representing this (receiving) facility and application
These are used in constructing reply document headers.
The '@' symbol represents using the corresponding field from the incoming message.
If your ID must contain a literal @ symbol, escape it with backslash: '\@'
pAddNackErrText is a boolean indicating whether to add error status text as an extra field in the AK5, AK9, and TA1 segments. This is not part of the X12 standard.
"Note" - Accept With Errors : Accept documents with errors, but do take note of all errors found. This will always return OK but will include any errors in the generated reply document.
"First" - Reject On First Error : Reject the whole batch when the first error is found in any document within it. Don't bother checking for more errors or parsing any further contents of the Interchange.
"Indiv" - Reject Individual Errors : Reject only those documents within the Interchange that have errors. Parent documents won't fail validation unless all their children fail. pSC is an optional %Status result of attempting to parse the document stream. pCleanupTempData is an optional boolean indicator of whether this method will cleanup the temporary global used for storing validation data. This defaults to true, but may be set to false in order to enable batch splitting or to avoid having to perform validation again in order to generate a reply document. If this is set to false, the data can be cleaned up later by calling CleanupValidationData()
ValidationLevel is either the SNIP level or the validation flags to use.
If prior validation data exists, it must match the Type and Level specified. If SNIP validation, it must have been batch handling of 'Indiv' and if Flags validation, it must have 'e' in the ValSpec to ensure all errors are recorded. If prior validation data exists and does not match, call CleanupValidationData() first.
pReuseOriginalIfMutable is an optional boolean indicator to modify the pOriginalDoc if its IsMutable property is false rather than creating a new X12 document object for the pGoodBatch. If this is set to true and there are no errors, then the returned pGoodBatch will be pOriginalDoc. If this is set to false and there are no errors, then the returned pGoodBatch will be a clone of the original. The default is false.
pSaveBadBatch is an optional boolean indicator to create the pBadBatch object. If false, no new X12 document object will be created and the parameter will return a NULLOREF. The default is true.
pCleanupTempData is an optional boolean indicator of whether this method will cleanup the temporary global used for storing validation data. This defaults to true, but may be set to false in order to avoid having to perform validation again in order to generate a reply document. If this is set to false, the data can be cleaned up later by calling CleanupValidationData()
ValidationLevel is either the SNIP level or the validation flags to use.
If prior validation data exists, it must match the Type and Level specified. If SNIP validation, it must have been batch handling of 'Indiv' and if Flags validation, it must have 'e' in the ValSpec to ensure all errors are recorded. If prior validation data exists and does not match, call CleanupValidationData() first.
pReuseOriginalIfMutable is an optional boolean indicator to modify the pOriginalDoc if its IsMutable property is false rather than creating a new X12 document object for the pGoodGroup The default is false.
pSaveBadGroup is an optional boolean indicator to create the pBadGroup object. If false, no new X12 document object will be created and the parameter will return a NULLOREF. The default is true.
pCleanupTempData is an optional boolean indicator of whether this method will cleanup the temporary global used for storing validation data. This defaults to true, but may be set to false in order to avoid having to perform validation again in order to generate a reply document. If this is set to false, the data can be cleaned up later by calling CleanupValidationData()
Set to 1 to block documents that don't pass default validation. Default validation requires a DocType and blocks messages with any other error encountered while mapping the document's sequence of segments using the X12 schema structure specified by the document's DocType. This is equivalent to 'dm'.
All flags relating to fields/components apply only if 's'/'c' also specified (eg. if set to 'dmslt' then the length and datatype of fields will be checked, but the length and datatype of components will not be) 'd' - require DocType'm' - don't tolerate BuildMap segment mapping errors
's' - enforce segment structures (number and repetition of fields)
'c' - enforce composite structures (number of components)
'r' - enforce required fields/components being present
'u' - enforce non-use of fields/components marked 'Not Used' - Note this is not available when using a new-style only schema
'l' - enforce field/component length restrictions
't' - enforce correct datatypes used for field/component values
'v' - enforce correct code table values used where specified in the schema - Note this is not available when using a new-style only schema
'x' - enforce relational conditions where specified in the schema - Note this is not available when using a new-style only schema
'n' - perform all validation available to new style schemas. This is equivalent to 'dmscrlt'
'a' - perform all available validation. This is equivalent to 'dmscrultv'
'e' - continue validating after errors are encountered - specify this to scan the entire document and report all errors
pValidateChildren is a boolean indication of whether we should only validate at the current level (false) or validate any nested children (true). The default is true. pSetTempValData is a boolean indication of whether to set the temporary data needed for generating reply documents and performing batch splitting. The default is false. pBatchErrorAction is relevant only if pSetTempValData is true. For batch splitting, this must have a value of 'Indiv'. See the EnsLib.EDI.X12.Service.Standard property 'BatchErrorAction' for other options.