IPWorks EDI 2020 Python Edition

Questions / Feedback?

HL7Validator Class

Properties   Methods   Events   Configuration Settings   Errors  

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

Syntax

class ipworksedi.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 schema_format and call load_schema 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 on_validation_error event will fire with details about each error as it is encountered. After the document has been validated the validation_errors property will be populated with details of each error.

Inspect the validation_errors 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.

edi_standard_versionThe version of the EDI specification.
input_dataThe data to parse.
input_fileThe file to parse.
schema_formatThe format of the schema file.
validation_error_countThe number of records in the ValidationError arrays.
validation_error_columnThe column number in the EDI document where the error occurred.
validation_error_element_error_codeThe error code which may be used in the IK403 property of a 999.
validation_error_element_positionThis property holds the position of the element where the error occurred.
validation_error_error_codeThe ErrorCode property contains the type of error encountered.
validation_error_lineThe line number in the EDI document where the error occurred.
validation_error_messageMessage is a textual description of the error.
validation_error_segment_error_codeThe error code which may be used in the IK304 property of a 999.
validation_error_segment_numberThis property is the index of the segment where the error occurred.
validation_error_segment_tagThis property specifies the tag name of the segment where the error occurred.
validation_error_technical_error_codeThis 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.

compile_schemaCompiles an existing XSD schema into an optimized binary representation.
configSets or retrieves a configuration setting.
display_schema_infoReturns a string showing the structure of the schema defining the document.
display_xml_infoReturns a string showing the structure of the parsed document as XML.
flushFlushes the parser and checks its end state.
load_schemaLoads 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.

on_end_functional_groupFires whenever a control segment is read that marks the end of an interchange.
on_end_interchangeFires whenever a control segment is read that marks the end of an interchange.
on_end_loopFires when the end of a loop is detected in a transaction set.
on_end_transactionFires whenever a control segment is read that marks the end of a transaction.
on_errorInformation about errors during data delivery.
on_resolve_schemaFires whenever a new transaction set is encountered and no schema is found for it.
on_segmentFires whenever a data segment in a transaction set is read.
on_start_functional_groupFires whenever a control segment is read that marks the start of a functional group.
on_start_interchangeFires whenever a control segment is read that marks the start of an interchange.
on_start_loopFires when the starting of a loop is detected in a transaction set.
on_start_transactionFires whenever a control segment is read that marks the start of a transaction.
on_validation_errorFires 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.
ProcessIdleEventsWhether the class uses its internal event loop to process events when the main thread is idle.
SelectWaitMillisThe length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.
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 Python Edition - Version 20.0 [Build 8203]