Skip to main content

Crate hl7v2_query

Crate hl7v2_query 

Source
Expand description

HL7 v2 path-based field access and query functionality.

This crate provides query functionality for HL7 v2 messages, including:

§Path Format

Paths use the format: SEGMENT.FIELD\[REP\].COMPONENT

Examples:

  • PID.5.1 - First component of 5th field in PID segment (first repetition)
  • PID.5[2].1 - First component of 5th field, second repetition
  • MSH.9 - 9th field of MSH segment
  • MSH.9.1 - First component of 9th field of MSH segment

§Example

use hl7v2_model::Message;
use hl7v2_query::get;

// Assuming you have a parsed Message from hl7v2-parser
// let message = hl7v2_parser::parse(hl7_bytes).unwrap();
// let last_name = get(&message, "PID.5.1").unwrap();

Functions§

get
Get value at path (e.g., PID.5[1].1)
get_presence
Get presence semantics for a field at path.