Class: Renalware::Patients::Ingestion::CommandFactory

Inherits:
Object
  • Object
show all
Defined in:
app/models/renalware/patients/ingestion/command_factory.rb

Overview

Responsible for making commands to process messages based on the message type.

Instance Method Summary collapse

Instance Method Details

#for(message) ⇒ Object

rubocop:disable Metrics/CyclomaticComplexity Note that for now most of these mapped methods will only try and update the patient info and master patient index, and not actually try and create an admission/transfer etc



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/models/renalware/patients/ingestion/command_factory.rb', line 16

def for(message)
  case message.action
  when :add_person_information    then make_add_patient(message)
  when :update_person_information then make_update_patient(message)
  when :admit_patient             then make_admit_patient(message)
  when :update_admission          then make_update_admission(message)
  when :cancel_admission          then make_cancel_admission(message)
  when :transfer_patient          then make_transfer_patient(message)
  when :discharge_patient         then make_discharge_patient(message)
  when :cancel_discharge          then make_cancel_discharge(message)
  # when :merge_patient then make_merge_patient(message) # complex so ignore for now.
  # when :add_consultant then make_add_consultant(message)
  else noop
  end
end