Home > Class Reference > ENSLIB namespace > EnsLib.HL7.Util.Validator

EnsLib.HL7.Util.Validator

abstract class EnsLib.HL7.Util.Validator

Method Inventory

Methods

classmethod Validate(pDoc As EnsLib.HL7.Message, pValSpec As %String = 1) as %Status
pDoc is the HL7 message document to validate. pValSpec is a string specifying types of Validation to perform

Set to 1 to block documents that don't pass default validation. Default validation requires a DocType, allows messages with unmapped Z-segments, and blocks messages with any other error encountered while mapping the document's sequence of segments using the HL7 schema structure specified by the document's DocType. This is equivalent to 'dm-z'.

(The '-z' means 'the opposite of z', i.e. do tolerate unrecognized trailing Z-segments, which is the customary HL7 behavior.)

'd' - require DocType
'm' - don't tolerate BuildMap segment mapping errors (includes 'z' by default; specify '-z' to tolerate unrecognized trailing Z-segments)
'z' - don't tolerate unrecognized trailing Z-segments
'n' - enforce segment structures
'r' - enforce required fields being present
'l' - enforce field size restrictions
'a' - enforce field array repetition limits
't' - enforce code tables
'b' - permit values not explicitly listed in a code table to pass validation when the code table uses "..." to indicate that any other values are also allowed.
'u' - ignore code tables that do not list any permissible values; permit any value in fields that use such a code table.
'y' - enforce data types
'p' - enforce component data structures
'j' - enforce optionality at the subcomponent level
'w' - enforce subcomponent size restrictions
's' - perform all available subcomponent-level validations. Equivalent to 'pjw'.
'g' - enforce field data structures
'o' - enforce optionality at the component level
'i' - enforce component size restrictions
'c' - perform all available component - level validations. Equivalent to 'gois'.
'f' - perform all validations available within an individual segment. Equivalent to 'nrlatbuyc'.
'e' - perform every available validation. Equivalent to 'dmf'.
'x' - stop validating when an error is encountered. This is the default behavior. Specify '-x' to scan the entire document and report all errors.

classmethod ValidateElementaryDT(pDT As %String, pVal As %String, ByRef info) as %Status
classmethod ValidateSeg(pSeg As EnsLib.HL7.Segment, pValSpec As %String = 1) as %Status
pSeg is the HL7 message segment to validate. pValSpec is a string specifying types of Validation to perform

Set to 1 to block documents that don't pass default validation. Default validation... 'n' - enforce segment structures
'r' - enforce required fields being present
'l' - enforce field size restrictions
'a' - enforce field array repetition limits
't' - enforce code tables
'b' - permit values not explicitly listed in a code table to pass validation when the code table uses "..." to indicate that any other values are also allowed.
'u' - ignore code tables that do not list any permissible values; permit any value in fields that use such a code table.
'y' - enforce data types
'p' - enforce component data structures
'j' - enforce optionality at the subcomponent level
'w' - enforce subcomponent size restrictions
's' - perform all available subcomponent-level validations. Equivalent to 'pjw'.
'g' - enforce field data structures
'o' - enforce optionality at the component level
'i' - enforce component size restrictions
'c' - perform all available component - level validations. Equivalent to 'gois'.
'f' - perform all validations available within an individual segment. Equivalent to 'nrlatbuyc'.
'x' - stop validating when an error is encountered. This is the default behavior. Specify '-x' to scan the entire document and report all errors.

classmethod simplifyValSpec(pValSpec As %String) as %String
Simplify so that ValSpec contains only those specifications which we want