Sha256: bd7fb5577015f6947564dcb8253b76e6b933cc3f99e30d4ce4e949ee70322b55

Contents?: true

Size: 838 Bytes

Versions: 15

Compression:

Stored size: 838 Bytes

Contents

require_dependency "renalware/feeds"

module Renalware
  module Feeds
    #
    # Responsible for coordinating the processing sequences of a raw HL7 message.
    #
    class MessageProcessor
      include Wisper::Publisher

      def call(raw_message)
        message_payload = parse_message(raw_message)
        persist_message(message_payload)

        broadcast(:message_processed, message_payload)
      rescue StandardError => exception
        notify_exception(exception)
        raise exception
      end

      private

      def parse_message(raw_message)
        MessageParser.new.parse(raw_message)
      end

      def persist_message(message_payload)
        PersistMessage.new.call(message_payload)
      end

      def notify_exception(exception)
        ExceptionNotifier.new.notify(exception)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc11 app/models/renalware/feeds/message_processor.rb
renalware-core-2.0.0.pre.rc10 app/models/renalware/feeds/message_processor.rb
renalware-core-2.0.0.pre.rc9 app/models/renalware/feeds/message_processor.rb
renalware-core-2.0.0.pre.rc8 app/models/renalware/feeds/message_processor.rb
renalware-core-2.0.0.pre.rc7 app/models/renalware/feeds/message_processor.rb
renalware-core-2.0.0.pre.rc6 app/models/renalware/feeds/message_processor.rb
renalware-core-2.0.0.pre.rc5 app/models/renalware/feeds/message_processor.rb
renalware-core-2.0.0.pre.rc4 app/models/renalware/feeds/message_processor.rb
renalware-core-2.0.0.pre.rc3 app/models/renalware/feeds/message_processor.rb
renalware-core-2.0.0.pre.rc1 app/models/renalware/feeds/message_processor.rb
renalware-core-2.0.0.pre.beta12 app/models/renalware/feeds/message_processor.rb
renalware-core-2.0.0.pre.beta11 app/models/renalware/feeds/message_processor.rb
renalware-core-2.0.0.pre.beta10 app/models/renalware/feeds/message_processor.rb
renalware-core-2.0.0.pre.beta9 app/models/renalware/feeds/message_processor.rb
renalware-core-2.0.0.pre.beta8 app/models/renalware/feeds/message_processor.rb