Class: Renalware::Feeds::PersistMessage
- Inherits:
-
Object
- Object
- Renalware::Feeds::PersistMessage
- Defined in:
- app/models/renalware/feeds/persist_message.rb
Instance Method Summary collapse
-
#call(hl7_message) ⇒ Object
hl7_message is an HL7Message (a decorator around ::HL7::Message) If the same message is persisted twice we’ll get an ActiveRecord::RecordNotUnique error but that’s fine as we don’t want to process the same HL7 message twice.
Instance Method Details
#call(hl7_message) ⇒ Object
hl7_message is an HL7Message (a decorator around ::HL7::Message) If the same message is persisted twice we’ll get an ActiveRecord::RecordNotUnique error but that’s fine as we don’t want to process the same HL7 message twice.
11 12 13 14 15 16 17 18 19 |
# File 'app/models/renalware/feeds/persist_message.rb', line 11 def call() Message.create!( event_code: .type, header_id: .header_id, body: .to_s, body_hash: Digest::MD5.hexdigest(.to_s), patient_identifier: .patient_identification&.internal_id ) end |