HL7Validator Class

Properties   Methods   Events   Configuration Settings   Errors  

HL7Validator is a lightweight EDI validation class designed for simple document validation.

Syntax

HL7Validator

Remarks

This component provides a simple way to validate an EDI document and obtain details about any validation errors.

EDI Validation

Before calling Validate set SchemaFormat and call LoadSchema to load the schema for the document to be validated. The schema defines many validation rules such as minimum and maximum lengths, minimum and maximum occurrences, and more. The validation performed by the class depends largely on the schema's definition.

When the Validate method is called the class will attempt to validate the document. If errors are found during validation the ValidationError event will fire with details about each error as it is encountered. After the document has been validated the ValidationErrors property will be populated with details of each error.

Inspect the ValidationErrors property for information on any errors that were encountered.

Validation Example

validator.InputFile = "files/EDIDocuments/MyEDIDoc.txt";
validator.LoadSchema("my_schemas/00501/RSSBus_005010X222A1_837.json");

validator.Validate();

foreach (ValidationErrorDetail error in validator.ValidationErrors) {
  Console.WriteLine(error.ErrorCode + ": " + error.Message);
}

Property List


The following is the full list of the properties of the class with short descriptions. Click on the links for further details.

EDIStandardVersionThe version of the EDI specification.
InputDataThe data to parse.
InputFileThe file to parse.
SchemaFormatThe format of the schema file.
ValidationErrorCountThe number of records in the ValidationError arrays.
ValidationErrorColumnThe column number in the EDI document where the error occurred.
ValidationErrorElementErrorCodeThe error code which may be used in the IK403 property of a 999.
ValidationErrorElementPositionThis property holds the position of the element where the error occurred.
ValidationErrorErrorCodeThe ErrorCode property contains the type of error encountered.
ValidationErrorLineThe line number in the EDI document where the error occurred.
ValidationErrorMessageMessage is a textual description of the error.
ValidationErrorSegmentErrorCodeThe error code which may be used in the IK304 property of a 999.
ValidationErrorSegmentNumberThis property is the index of the segment where the error occurred.
ValidationErrorSegmentTagThis property specifies the tag name of the segment where the error occurred.
ValidationErrorTechnicalErrorCodeThis property holds a technical error code that helps identify structural issues with the document.

Method List


The following is the full list of the methods of the class with short descriptions. Click on the links for further details.

CompileSchemaCompiles an existing XSD schema into an optimized binary representation.
ConfigSets or retrieves a configuration setting.
DisplaySchemaInfoReturns a string showing the structure of the schema defining the document.
DisplayXMLInfoReturns a string showing the structure of the parsed document as XML.
FlushFlushes the parser and checks its end state.
LoadSchemaLoads a schema file describing a Transaction Set.
ResetResets the parser.
ValidateValidates the specified EDI document.

Event List


The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.

EndFunctionalGroupFires whenever a control segment is read that marks the end of an interchange.
EndInterchangeFires whenever a control segment is read that marks the end of an interchange.
EndLoopFires when the end of a loop is detected in a transaction set.
EndTransactionFires whenever a control segment is read that marks the end of a transaction.
ErrorInformation about errors during data delivery.
ResolveSchemaFires whenever a new transaction set is encountered and no schema is found for it.
SegmentFires whenever a data segment in a transaction set is read.
StartFunctionalGroupFires whenever a control segment is read that marks the start of a functional group.
StartInterchangeFires whenever a control segment is read that marks the start of an interchange.
StartLoopFires when the starting of a loop is detected in a transaction set.
StartTransactionFires whenever a control segment is read that marks the start of a transaction.
ValidationErrorFires whenever a validation error is encountered.

Configuration Settings


The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.

ComponentDelimiterThe delimiter separating classes.
CrossFieldValidationEnabledEnables cross-field validation rules.
ElementDelimiterThe delimiter character separating data elements.
EncodingThe character encoding to be applied when reading and writing data.
ExtraDataExtra data that has not been parsed by the class.
HasXPathDetermines if the specified XPath exists.
ISA11IsRepetitionSeparatorSpecifies whether the ISA11 value is treated as a Repetition Separator or Standard Identifier.
MaxValidationErrorsThe maximum number of errors to save in the ValidationErrors property.
ReleaseCharThe character used to escape delimiters within values.
ResolveXPathOnSetDetermines whether or not the XPath is resolved when set.
SegmentDelimiterThe delimiter character separating segments within the EDI document.
StrictSchemaValidationSpecifies the behavior during schema validation.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
UseInternalSecurityAPITells the class whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 Qt Edition - Version 20.0 [Build 8203]