Getting Validation Warnings – JS

Index

    Getting Validation Warnings

    Warnings generated during validation can be retrieved using the Warnings property of EDIValidator. Access the Warnings property of the EDIValidator after calling the validate method.

    Example

    validator.validate();
     
    //Get all warnings from the EDI data
    for (let i = 0; i < validator.Warnings.Count; i++) {
        let warning = validator.Warnings.getItem(i);
     
        console.log(
            {
                Type: “Warning”,
                Line: warning.LineNumber,
                Transaction: “”,
                SnipLevel: warning.SnipLevel, //SnipTestLevel Enum
                Message: warning.Message, //EDIValidationMessage Enum
                Loop: warning.Loop,
                Segment: warning.Segment,
                Element: warning.ElementOrdinal,
                Composite: warning.CompositeElementOrdinal,
                Description: warning.Description,
                Ordinal: warning.SegmentOrdinal
            });
    }

    In addition the EDIWarning object also contains the corresponding SNIP level for the warning. This level can be accessed through the SnipLevel enum property.

    The possible SNIP levels are:

    • Integrity-Testing for valid EDI syntax for each type of transaction
    • Requirement– Testing for HIPAA specific syntax. This tests that the transaction sets adhere to the HIPAA implementation guides
    • Balance – Testing of the transaction for balanced field totals, financial balancing of claims or remittance advice and balancing of summary fields.
    • Situational – Testing of specific inter-segment situations as defined in the implementation guide, where if A occurs, then B must be populated
    • CodeSet – Testing correct use of external code sets. Tests that only valid values of external data elements are used
    • DoesNotApply – The warning does not have a corresponding SNIP level.
    in EDI Validator – JS
    Did this article answer your question?