Class OruBuilder

java.lang.Object
com.framed.interop.hl7.hl7v2.OruBuilder

public final class OruBuilder extends Object
Builds ORU^R01 (unsolicited observation result) HL7 v2.5 messages from FRAMED observations. Segments are joined with \r as required by MLLP.

All data taken from observations, mapping and configuration is delimiter-escaped via Hl7Escape before embedding; the configured patient location is treated as component-structured (its ^ separators are preserved). Each OBX carries its own observation's time in OBX-14, so receivers (including a FRAMED inbound side) keep the original per-observation timestamps instead of re-stamping on arrival or inheriting the message time.

  • Method Details

    • build

      public static String build(SendingIds ids, PatientContext patient, CodedConcept concept, String value, Instant timestamp, String controlId)
      Builds an ORU^R01 carrying a single observation.
      Parameters:
      ids - MSH sender/receiver ids
      patient - patient context for PID/PV1
      concept - the coded concept
      value - the observation value (already formatted)
      timestamp - the observation time
      controlId - the MSH-10 message control id
      Returns:
      the HL7 message text
    • build

      public static String build(SendingIds ids, PatientContext patient, List<OruBuilder.Observation> observations, Instant timestamp, String controlId)
      Builds an ORU^R01 carrying one or more observations (one OBX each, stamped with its own observation time in OBX-14).
      Parameters:
      ids - MSH sender/receiver ids
      patient - patient context for PID/PV1
      observations - the observations to encode
      timestamp - the message time (MSH-7)
      controlId - the MSH-10 message control id
      Returns:
      the HL7 message text