Class Hl7v2Dispatcher


public final class Hl7v2Dispatcher extends Dispatcher
Outbound HL7 v2 sink: maps FRAMED datapoints to ORU^R01 messages and sends them over MLLP to a remote endpoint, retrying on transient failures via the Dispatcher base.

Only channels present in the mapping are emitted (so high-rate waveforms are naturally skipped), and emission is further throttled by the EmissionGate, keyed per device and channel.

Deployment caution: never point host/port at FRAMED's own Hl7v2Protocol MLLP server. The inbound side republishes received observations under the mapped device groups — the very groups this dispatcher subscribes to — so a self-referential endpoint creates a feedback loop that re-emits every observation indefinitely.

  • Constructor Details

    • Hl7v2Dispatcher

      public Hl7v2Dispatcher(EventBus eventBus, org.json.JSONArray devices, String host, int port, String mappingPath, org.json.JSONObject patient, org.json.JSONObject sendingIds, org.json.JSONObject gate)
      Parameters:
      eventBus - the event bus
      devices - device groups whose announced channels are forwarded
      host - MLLP server host to send to
      port - MLLP server port
      mappingPath - path to the interop mapping JSON
      patient - PID/PV1 context (config JSON)
      sendingIds - MSH-3..6 identifiers (config JSON)
      gate - emission gate config (minIntervalMs, onChange)
  • Method Details

    • push

      public void push(DataPoint<?> dataPoint) throws IOException
      Description copied from class: Dispatcher
      Pushes a single datapoint to the underlying sink.

      Invoked on the dispatcher's worker thread. Implementations may throw IOException to signal a transient failure, which triggers retry with exponential backoff.

      Specified by:
      push in class Dispatcher
      Parameters:
      dataPoint - the datapoint to push
      Throws:
      IOException - if the push fails due to a transient IO error and should be retried
    • pushBatch

      public void pushBatch(List<DataPoint<?>> batch)
      Description copied from class: Dispatcher
      Pushes a batch of datapoints to the underlying sink.
      Specified by:
      pushBatch in class Dispatcher
      Parameters:
      batch - the datapoints to push
    • stop

      public void stop()
      Description copied from class: Service
      Stops the service.

      By default, this method logs a message indicating that no stop logic is implemented. Subclasses should override this method to provide custom shutdown behavior when necessary.

      Overrides:
      stop in class Dispatcher