tosch-hl7
    Preparing search index...

    Class HL7Message

    Represents an HL7 message, providing methods for parsing, accessing, and modifying its segments and fields.

    Indexable

    • [segmentName: string]: any
    Index

    Constructors

    • Constructs an HL7Message instance from a raw HL7 string.

      Parameters

      • rawHL7: string

        The raw HL7 message string

      Returns HL7Message

    Properties

    Direct access to specific segments by name, if they exist.

    Methods

    • Retrieves a value using path notation.

      Parameters

      • path: string

        Format: 'SEGMENT-FIELD.COMPONENT.SUBCOMPONENT' (e.g., 'PID-5.1.2')

      Returns string

      The value at the specified path

    • Retrieves all segments matching the specified name.

      Parameters

      • name: string

        The name of the segment (e.g., 'PID', 'OBX')

      Returns Segment[]

      An array of matching segments

    • Retrieves a specific segment by name. If there are multiple segments of the same type, returns the first one.

      Parameters

      • name: string

        The name of the segment

      Returns undefined | Segment

      The matching segment, or undefined if not found

    • Checks if a specific segment exists.

      Parameters

      • name: string

        The name of the segment

      Returns boolean

      True if the segment exists, false otherwise

    • Sets a value using path notation. Creates the field/component/subcomponent if it does not exist.

      Parameters

      • path: string

        Format: 'SEGMENT-FIELD.COMPONENT.SUBCOMPONENT' (e.g., 'PID-5.1.2')

      • value: string

        Value to set

      Returns void

    • Converts the HL7 message to a formatted string.

      Returns string

      The HL7 message as a string