How to validate HIPAA SNIP levels Last updated: 2026-09-24

How to implement EDI X12 HIPAA SNIP levels validation

HIPAA 5010 expands HIPAA regulation to include electronic transmission of healthcare transactions, including eligibility, claim status, referrals, claims, and remittances. ASC X12 Version 5010 is the adopted standard format for transactions, except those with retail pharmacies.

HIPAA standard is used by physicians, clearinghouses, hospitals, pharmacies, payers, and dentists. Some of the most popular messages are 837P, 270, 271, 278, 276, 834, etc.

View all supported HIPAA templates for 5010 and 4010:

View HIPAA EDI Templates

ediFabric .NET has helped customers to acquire CAQH Certifications and our products are used to boost claims, remittance, eligibility, and claims status processing by several major HIPAA clearinghouses.

ediFabric .NET supports all HIPAA validation level types and additional, partner-specific logic, or product type requirements can be achieved by either amending the EDI C# templates or extending the validation logic.

Note

To validate HIPAA SNIP levels 2-6 for an EDI transaction, call the IsValid() method of its EdiMessage. All existing and custom validation logic will be executed as part of this method.

HIPAA SNIP Level Supported Validated when Configured by 
SNIP Level 1 Yes EDI document is translated using EdiReader ValidationSettings and the structure of the EDI templates. To stop the validation at this level, set ValidationSettings.ValidationLevel = SyntaxOnly_SNIP1
SNIP Level 2 Yes IsValid() is called The validation attributes and custom validation. To stop the validation at this level, set ValidationSettings.ValidationLevel = LimitsAndCodes_SNIP2
SNIP Level 3 Yes IsValid() is called Balancing validation is available for HIPAA 5010 820, 835, 837D, 837I, and 837P, and is implemented in the templates. To stop the validation at this level, set ValidationSettings.ValidationLevel = Balancing_SNIP3
SNIP Level 4 Yes IsValid() is called This validation is a combination of intra-segment validation using conditional attributes and situational validation. To stop the validation at this level, set ValidationSettings.ValidationLevel = InterSegment_SNIP4
SNIP Level 5 Yes IsValid() is called The external codes can be dynamically added using DataElementMaps or by creating a modyfied version of the template.
SNIP Level 6 Yes   This requires customizations of the template and extending the validation using attributes or implementing IEdiValidator.
SNIP Level 7 Yes   This requires customizations of the template to match the external partner requirements.

ediFabric .NET also supports the processing of very large 834 and 835 EDI files by using a unique transaction splitting technology that can be safely used in accordance with EDI document validation and to generate automatic acknowledgments, regardless of the original file size.

HIPAA SNIP Type 1

What is HIPAA SNIP level 1?

EDI Standard Integrity Testing: Validate the basic syntactical integrity of the EDI submission.

How to validate HIPAA SNIP level 1?

EDI Templates define the structure of EDI documents and syntactical integrity is inherently interwoven into the notion of EDI templates. All EDI templates derive from EdiMessage.

ediFabric .NET checks the integrity of EDI documents whilst translating them from EDI files, hence, HIPAA SNIP level 1 is automatically validated when EDI files are being translated. You don't need to do anything to enable this level of validation.

ediFabric .NET supports partial parsing by default, which means that even faulty EDI documents can be translated. To ensure that an EDI transaction is syntactically correct, check that the HasErrors property of EdiMessage is false.

To stop the validation at this level, set ValidationSettings.ValidationLevel = SyntaxOnly_SNIP1

Note

Parsing EDI transactions does not validate if the header and trailer control numbers match or if the count of segments matches that in the trailer. To validate this, set the DiscardValidationAttributes property in ValidationSettings to true, and call IsValid() of EdiMessage.

Additional information

HIPAA SNIP Type 2

What is HIPAA SNIP level 2?

Type 2 HIPAA Implementation Guide Requirement Testing: Validate HIPAA requirement-guide-specific syntax requirement by checking limits on repeat counts, used or not used qualifiers, code, elements, and segments.

How to validate HIPAA SNIP level 2?

EDI templates define both the structure of EDI documents and how the represented EDI transaction is validated, using validation attributes. All EDI templates derive from EdiMessage.

ediFabric .NET provides attributes to validate:

  • Usage (mandatory or optional)
  • Position (segments and loops are in the correct sequence)
  • Repeat count
  • Length of data elements
  • Type of data elements (alphanumeric, numeric, code set, etc.)
  • Code sets defined on data elements
  • Sequence counts on LX and ENT segments
  • Correct HL (hierarchy levels) segments. This includes parent-child relationships, sequential segments, and correct parent references.

To stop the validation at this level, set ValidationSettings.ValidationLevel = LimitsAndCodes_SNIP2

To validate an EDI document for HIPAA SNIP level 2, execute the IsValid() method of its EdiMessage. Head on to the How to validate EDI with templates article to learn how to interpret the validation results.

By default, IsValid() does not validate alpha and alphanumeric data elements for allowed symbols. This type of validation needs to be explicitly enabled, see the additional information below.

Additional information

HIPAA SNIP Type 3

What is HIPAA SNIP level 3?

Type 3 HIPAA Balance Testing: Validate that claim line item amounts are equal to the total claim amount.

How to validate HIPAA SNIP level 3?

Balancing validation is available as custom implemetation of IEdiValidator in the templates for the following transactions and rules:

Transaction Set Balancing Formula
820 BPR02 = SUM of 2300A_RMR04 + SUM of 2300B_RMR04
820 RMR04 = RMR05 + ADX01
835 SVC02 - Sum 2110 CAS (CAS03 + CAS06 + CAS09 + CAS12 + CAS15 + CAS18) = SVC03
835 CLP03 - (Sum 2100 CAS (CAS03 + CAS06 + CAS09 + CAS12 + CAS15 + CAS18) + Sum 2110 CAS (CAS03 + CAS06 + CAS09 + CAS12 + CAS15 + CAS18)) = CLP04
835 Sum 2100 CLP04 - Sum PLB (PLB04 + PLB06 + PLB08 + PLB10 + PLB12 + PLB14) = BPR02
837D 2300_CLM02 = SUM of 2400_SV302
837I 2300_CLM02 = SUM of 2400_SV202
837P 2300_CLM02 = SUM of 2400_SV102

To stop the validation at this level, set ValidationSettings.ValidationLevel = Balancing_SNIP3

Additional information

HIPAA SNIP Type 4

What is HIPAA SNIP level 4?

Type 4 HIPAA Inter-Segment Situation Testing: Validate inter-segment relationship. For example, if element A exists, then element B must be populated.

How to validate HIPAA SNIP level 4?

EDI templates define both the structure of EDI documents and how the represented EDI transaction is validated, using validation attributes and conditional validation attributes. All EDI templates derive from EdiMessage.

The conditional validation attributes cover all HIPAA syntax notes rules.

ediFabric .NET provides attributes to conditionally validate:

  • Conditional - if the annotated EDI data element is not null then all elements at the specified positions must also be not null.
  • ConditionalAny - If the annotated EDI data element is not null then at least one of the EDI data elements at the specified positions must also be not null. The attribute is applied to only one of the EDI data elements included in the condition.
  • Exclusion - Only one of the EDI data elements at the specified positions and the annotated data element altogether must be not null.
  • Paired - If any of the elements at the specified positions or the annotated element is not null, then all the elements at the specified positions and the annotated element must be not null. It is applied to only one of all the paired items.
  • RequiredAny - At least one of the elements at the specified positions or the annotated element must be not null.

To stop the validation at this level, set ValidationSettings.ValidationLevel = InterSegment_SNIP4

To validate an EDI document for HIPAA SNIP level 4, execute the IsValid() method of its EdiMessage. Head on to the How to validate EDI with templates article to learn how to interpret the validation results.

Note

By default, ediFabric .NET validates syntax notes only and does not validate situational rules. How to implement HIPAA situational rules validation covers a custom attribute, IEdiValidator, and the rules shipped for 270, 271, 276, and 277.

Additional information

How to implement HIPAA situational rules validation

HIPAA situational validation is part of HIPAA SNIP Level 4 and is considered cross-segment type validation, where if a data element in a certain position exists or is of a certain value, then another data element in that segment needs to conform to certain rules.

HIPAA Situational Usage is defined as: Use of this loop/segment/element varies, depending on data content and business context as described in the defining rule. The defining rule is documented in a Situational Rule attached to the item. 

There are two forms of Situational Rules. 

  • The first form is “Required when <explicit condition statement>.  If not required by this implementation guide, may be provided at the sender’s discretion, but cannot be required by the receiver.” The data qualified by such a situational rule cannot be required or requested by the receiver, transmission of this data is solely at the sender’s discretion. 
  • The alternative form is “Required when <explicit condition statement>. If not required by this implementation guide, do not send.” The data qualified by such a situational rule cannot be sent except as described in the explicit condition statement. 

Note

ediFabric .NET does not validate situational rules but provides several options to implement these manually.

Given that you need to validate HIPAA SNIP Level 4, the following options are available:

  • Add the situational validation logic in a custom attribute that derives from ValidationAttribute. This ensures that the logic will be executed as part of both IsValid() and AckMan. Set the IsSituational property of DataElementErrorContext to true - this will ensure that a CTX segment will be automatically generated by AckMan for 999 implementation acknowledgments.

    X12

    [AttributeUsage(AttributeTargets.Property)]
    public class N4PostCodeValidationAttribute : ValidationAttribute
    {
        public N4PostCodeValidationAttribute() : base(10)
        {
        }
    
        public override SegmentErrorContext ValidateEdi(ValidationContext validationContext)
        {
    	var n4 = validationContext.InstanceContext.Parent.Instance as N4;
    	if (n4 != null)
    	{
    	    if(!string.IsNullOrEmpty(n4.CityName_01) &&
    		string.IsNullOrEmpty(n4.PostalCode_03))
    	    {
    		var result = new SegmentErrorContext("N4", validationContext.SegmentIndex + 1, null, GetType().GetTypeInfo());
    		var errorContext = new DataElementErrorContext("116", validationContext.InSegmentIndex,
    		DataElementErrorCode.ConditionalRequiredDataElementMissing, validationContext.InCompositeIndex,
    		validationContext.RepetitionIndex, null);
    
    		errorContext.IsSituational = true;
    
    		result.Add(errorContext);
    
    		return result;
    	    }
    	}
    
    	return null;
        }
    }
    [StringLength(3, 15)]
    [N4PostCodeValidation]
    [DataElement("116", typeof(X12_AN))]
    [Pos(3)]
    public string PostalCode_03 { get; set; }

    EDIFACT

    [AttributeUsage(AttributeTargets.Property)]
    public class LinLoopValidationAttribute : ValidationAttribute
    {
    	public LinLoopValidationAttribute() : base(10)
    	{
    	}
    
    	public override SegmentErrorContext ValidateEdi(ValidationContext validationContext)
    	{
    		var position = validationContext.SegmentIndex + 1;
    
    		var linLoops = validationContext.InstanceContext.Instance as IList<Loop_LIN_ORDERS>;
    		if (linLoops != null)
    		{
    			foreach (var linLoop in linLoops)
    			{
    				//  Count all existing segments before the one that is validated to apply the correct index
    				if (linLoop.PIA != null)
    					position += linLoop.PIA.Count;
    				if (linLoop.IMD != null)
    					position += linLoop.IMD.Count;
    				if (linLoop.MEA != null)
    					position += linLoop.MEA.Count;
    				if (linLoop.QTY != null)
    					position += linLoop.QTY.Count;
    				if (linLoop.PCD != null)
    					position += linLoop.PCD.Count;
    				if (linLoop.ALI != null)
    					position += linLoop.ALI.Count;
    
    				//  Check if QTY exists and DTM also exist
    				if (linLoop.QTY != null && linLoop.DTM == null)
    					return new SegmentErrorContext("DTM", position + 1, null,  GetType().GetTypeInfo(), SegmentErrorCode.RequiredSegmentMissing,
    						"DTM segment is missing.");
    			}
    		}
    
    		return null;
    	}
    }
  • Implement IEdiValidator for any EDI loop, EDI segment, or EDI complex element, and add the situational validation logic in the ValidateEdi() method. This ensures that the logic will be executed as part of both IsValid() and AckMan. 

     public partial class Loop_2000A : IEdiValidator
     {
        public List<SegmentErrorContext> ValidateEdi(ValidationContext validationContext)
        {
            // Custom validation goes here, example below
            var result = new List<SegmentErrorContext>();
    
            if (N1 != null && N2 == null)
                result.Add(new SegmentErrorContext("N2",
                    validationContext.SegmentIndex + 2, GetType().GetTypeInfo(),
                    SegmentErrorCode.RequiredSegmentMissing,
                    "N2 segment is missing."));
    
            return result;
        }
     }
  • Use ediFabric .NET attributes RequiredIf and ExclusionIf. Go to the Conditional EDI validation article for more details.

Note

Several HIPAA situational rules are available for HIPAA 5010 transactions 270, 271, 276, and 277. The EDI templates with the implementation are in a separate folder named SituationalSegments_270_271_276_277.

The tables below list all available rules in the following column order:

  1. The HIPAA Loop ID
  2. The HIPAA Segment ID and Name
  3. The page in the TR3 X12 implementation guideline where the situational rule is defined
  4. The name of the EDI template class implementing that rule
  5. The actual code that implements the rule

HIPAA situational rules for 270

Loop Segment Page EDI template Implementation
2100A NM1 - INFORMATION SOURCE NAME 69 NM1_InformationSourceName
[RequiredIf(2, ",1,")]
2100B NM1 - INFORMATION RECEIVER NAME 75 NM1_InformationReceiverName
[RequiredIf(2, ",1,")]

HIPAA situational rules for 271

Loop Segment Page EDI template Implementation
2100B REF - INFORMATION RECEIVER ADDITIONAL IDENTIFICATION 236

REF_InformationReceiver

AdditionalIdentification

[RequiredIf(1, ",0B,")]
2100C REF - SUBSCRIBER ADDITIONAL IDENTIFICATION 254

REF_Subscriber

AdditionalIdentification_3

[RequiredIf(1, ",18,6P,N6,")]
2110C REF - SUBSCRIBER ADDITIONAL IDENTIFICATION 314

REF_Subscriber

AdditionalIdentification

[RequiredIf(1, ",18,6P,N6,")]
2100D REF - DEPENDENT ADDITIONAL IDENTIFICATION 358

REF_Dependent

AdditionalIdentification_3

[RequiredIf(1, ",18,6P,N6,")]
2110D REF - DEPENDENT ADDITIONAL IDENTIFICATION 417

Loop:REF_Dependent

AdditionalIdentification

[RequiredIf(1, ",18,6P,N6,")]
2110C EB 290

EB_SubscriberEligibility

orBenefitInformation

[ExclusionIf(1, ",A,")]
[RequiredIf(1, ",B,C,G,J,Y,")]

[ExclusionIf(1, ",B,C,G,J,Y,")]
[RequiredIf(1, ",A,")]
2110D EB 394

EB_DependentEligibility

orBenefitInformation

[ExclusionIf(1, ",A,")]
[RequiredIf(1, ",B,C,G,J,Y,")]

[ExclusionIf(1, ",B,C,G,J,Y,")]
[RequiredIf(1, ",A,")]
2100A NM1 - INFORMATION SOURCE NAME 218

NM1_Information

SourceName

[RequiredIf(2, ",1,")]
2120C NM1 - SUBSCRIBER BENEFIT RELATED ENTITY NAME 329

NM1_DependentBenefit

RelatedEntityName

[RequiredIf(2, ",1,")]
2120D NM1 - DEPENDENT BENEFIT RELATED ENTITY NAME 432

NM1_DependentBenefit

RelatedEntityName

[RequiredIf(2, ",1,")]

HIPAA situational rules for 276

Loop Segment Page EDI template Implementation
2100B NM1 - INFORMATION RECEIVER NAME 45 NM1_InformationReceiverName_3
[RequiredIf(2, ",1,")]
2100C NM1 - PROVIDER NAME 49 NM1_ProviderName
[RequiredIf(2, ",1,")]
2100D NM1 - SUBSCRIBER NAME 56 NM1_SubscriberName_2
[RequiredIf(2, ",1,")]

HIPAA situational rules for 277

Loop Segment Page EDI template Implementation
2100B NM1 - INFORMATION RECEIVER NAME 118 NM1_InformationReceiverName_3
[RequiredIf(2, ",1,")]
2100C NM1 - PROVIDER NAME 126 NM1_ProviderName
[RequiredIf(2, ",1,")]
2100D NM1 - SUBSCRIBER NAME 135 NM1_SubscriberName_2
[RequiredIf(2, ",1,")]

Additional information

HIPAA SNIP Type 5

What is HIPAA SNIP level 5?

Type 5 HIPAA External Code Set Testing: Validate specific code set values for HIPAA standards.

How to validate HIPAA SNIP level 5?

There are three ways to validate partner-specific EDI codes:

The first option is to create a dedicated copy of the full EDI template for each partner, which includes the EDI codes, at design time. The second option is to only create a dedicated copy of the EDI codes for each partner, also at design time. The last option is to dynamically load the EDI codes and can be used to read them from configuration or file at runtime.

To validate an EDI document for HIPAA SNIP level 5, execute the IsValid() method of its EdiMessage. Head on to the How to validate EDI with templates article to learn how to interpret the validation results.

Failed EDI codes are reported as "Invalid code value" with error code 7.

Additional information

HIPAA SNIP Type 6

What is HIPAA SNIP level 6?

Type 6 Product Type/Type of Service Testing: Validate that segments that differ based on certain Health-care services are properly created and processed.

How to validate HIPAA SNIP level 6?

EDI Templates define the structure of EDI documents, therefore, to configure this type of validation, the appropriate segments must be positioned correctly in the hierarchy of the EDI template. All EDI templates derive from EdiMessage.

Should any additional validation take place, either conditionally or not, the available validation attributes and validation extension (see validating SNIP levels 2 and 3) can be utilized to cover every SNIP level 6 requirement.

Additional information

HIPAA SNIP Type 7

What is HIPAA SNIP level 7?

Type 7 Trading Partner-Specific Testing: Compliance with the payer-specific requirement.

How to validate HIPAA SNIP level 7?

EDI Templates define the structure of EDI documents, therefore, to configure this type of validation, a custom EDI template can be created for each partner. All EDI templates derive from EdiMessage.

Our EDI templates allow you to quickly configure every EDI transaction to conform to your trading partner requirements. ISA and GS headers can also be customized to match any custom requirement.

Additional information