Class: Renalware::Feeds::HL7Message::ObservationRequest

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
app/models/renalware/feeds/hl7_message.rb

Instance Method Summary collapse

Constructor Details

#initialize(observation_request_segment) ⇒ ObservationRequest

Returns a new instance of ObservationRequest.



22
23
24
# File 'app/models/renalware/feeds/hl7_message.rb', line 22

def initialize(observation_request_segment)
  super(observation_request_segment)
end

Instance Method Details

#identifierObject



26
27
28
# File 'app/models/renalware/feeds/hl7_message.rb', line 26

def identifier
  universal_service_id.split("^").first
end

#observationsObject

Select only OBX children. OBR can have other types of child segments but we want to ignore those.



32
33
34
35
36
37
38
# File 'app/models/renalware/feeds/hl7_message.rb', line 32

def observations
  @observations ||= begin
    children
      .select{ |segment| segment.is_a? HL7::Message::Segment::OBX }
      .map{ |obx_segment| Observation.new(obx_segment) }
  end
end

#ordering_provider_nameObject



40
41
42
# File 'app/models/renalware/feeds/hl7_message.rb', line 40

def ordering_provider_name
  ordering_provider.last
end

#placer_order_numberObject



44
45
46
# File 'app/models/renalware/feeds/hl7_message.rb', line 44

def placer_order_number
  super.split("^").first
end