Groups and segments can be accessed by name like in a map.

    import ca.uhn.hl7v2.model.Message

    val message: Message = ...

    // Accessing a segment
    val msh   = message["MSH"]

    // Accessing a group
    val group = message["PATIENT_RESULT"]

    // Accessing a segment nested within groups
    val pid   = message["PATIENT_RESULT"]["PATIENT"]["PID"]

In case the structure is repeating, this simple syntax only returns the first repetition

Back to top

Version: 3.5-SNAPSHOT. Last Published: 2018-04-20.

Reflow Maven skin by Andrius Velykis.