Sha256: 9d2f68d7f9b89753d7b86ea92f1279f141552a5127a362955ef89ab8becf0082
Contents?: true
Size: 1.05 KB
Versions: 42
Compression:
Stored size: 1.05 KB
Contents
# frozen_string_literal: true require_dependency "renalware/pathology" # # When subscribed to HL7 `oru_message_arrived` messages, gets notified of incoming HL7 messages # and creates the observations contained therein provided the patient exists. # module Renalware module Pathology class MessageListener # Note: We are already inside a transaction here def oru_message_arrived(hl7_message:, **) pathology_params = parse_pathology_params(hl7_message) create_observation_requests_and_their_child_observations_from(pathology_params) # # Note: The current_observation_set for the patient is updated by a trigger here! # end private def parse_pathology_params(hl7_message) ObservationRequestsAttributesBuilder.new(hl7_message).parse end def create_observation_requests_and_their_child_observations_from(pathology_params) return if pathology_params.nil? # e.g. patient does not exist CreateObservationRequests.new.call(pathology_params) end end end end
Version data entries
42 entries across 42 versions & 1 rubygems