Sha256: a6dc67657fbee5328e10fc9acb071399624cce7afab05395d36707c5530b8ebf

Contents?: true

Size: 689 Bytes

Versions: 2

Compression:

Stored size: 689 Bytes

Contents

require_dependency "renalware/pathology"

#
# When subscribed to HL7 `message_processed` messages, gets notified of incoming HL7 messages
# and creates the observations contained therein provided the patient exists.
#
module Renalware
  module Pathology
    class MessageListener
      def message_processed(message_payload)
        pathology_params = parse_pathology_params(message_payload)
        create_observations(pathology_params)
      end

      private

      def parse_pathology_params(message_payload)
        MessageParamParser.new.parse(message_payload)
      end

      def create_observations(params)
        CreateObservations.new.call(params)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc1 app/models/renalware/pathology/message_listener.rb
renalware-core-2.0.0.pre.beta12 app/models/renalware/pathology/message_listener.rb