Class: Renalware::UKRDC::SendPatient

Inherits:
Object
  • Object
show all
Defined in:
app/models/renalware/ukrdc/send_patient.rb

Defined Under Namespace

Classes: Payload

Instance Method Summary collapse

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/models/renalware/ukrdc/send_patient.rb', line 11

def call
  UKRDC::TransmissionLog.with_logging(patient, request_uuid) do |log|
    logger.info "  Patient #{patient.to_param}"
    xml_payload = build_payload(log)
    if xml_payload_same_as_last_sent_payload?(xml_payload)
      log.unsent_no_change_since_last_send!
    else
      send_file(xml_payload, log)
    end
    logger.info "    Status: #{log.status}"
  end
end