Class: Services::AcceptHl7MessageContext
- Inherits:
-
Object
- Object
- Services::AcceptHl7MessageContext
- Defined in:
- app/contexts/services/accept_hl7_message_context.rb
Class Attribute Summary collapse
-
.message_processing_context_class ⇒ Object
Returns the value of attribute message_processing_context_class.
Instance Attribute Summary collapse
-
#message_body ⇒ Object
Returns the value of attribute message_body.
-
#message_type ⇒ Object
Returns the value of attribute message_type.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(message_type, body) ⇒ AcceptHl7MessageContext
constructor
A new instance of AcceptHl7MessageContext.
Constructor Details
#initialize(message_type, body) ⇒ AcceptHl7MessageContext
Returns a new instance of AcceptHl7MessageContext.
16 17 18 19 20 |
# File 'app/contexts/services/accept_hl7_message_context.rb', line 16 def initialize(, body) @message_type = @message_body = body self.extend Services::Hl7AdtMessageSaver end |
Class Attribute Details
.message_processing_context_class ⇒ Object
Returns the value of attribute message_processing_context_class.
6 7 8 |
# File 'app/contexts/services/accept_hl7_message_context.rb', line 6 def @message_processing_context_class end |
Instance Attribute Details
#message_body ⇒ Object
Returns the value of attribute message_body.
9 10 11 |
# File 'app/contexts/services/accept_hl7_message_context.rb', line 9 def @message_body end |
#message_type ⇒ Object
Returns the value of attribute message_type.
9 10 11 |
# File 'app/contexts/services/accept_hl7_message_context.rb', line 9 def @message_type end |
Class Method Details
.call(message_type, body) ⇒ Object
11 12 13 14 |
# File 'app/contexts/services/accept_hl7_message_context.rb', line 11 def self.call(, body) raise "No message processing context class specified" if self..nil? AcceptHl7MessageContext.new(, body).call end |
Instance Method Details
#call ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/contexts/services/accept_hl7_message_context.rb', line 22 def call # Save the raw message information persist(, ).tap do | msg | # Then drop a message on beanstalk to process it self.class..ayl_send(:call, msg) if msg.valid? end end |