Class: Renalware::Feeds::HL7Message::ObservationRequest
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Renalware::Feeds::HL7Message::ObservationRequest
- Defined in:
- app/models/renalware/feeds/hl7_message.rb
Instance Method Summary collapse
- #identifier ⇒ Object
-
#initialize(observation_request_segment) ⇒ ObservationRequest
constructor
A new instance of ObservationRequest.
-
#observations ⇒ Object
Select only OBX children.
- #ordering_provider_name ⇒ Object
- #placer_order_number ⇒ Object
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
#identifier ⇒ Object
26 27 28 |
# File 'app/models/renalware/feeds/hl7_message.rb', line 26 def identifier universal_service_id.split("^").first end |
#observations ⇒ Object
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_name ⇒ Object
40 41 42 |
# File 'app/models/renalware/feeds/hl7_message.rb', line 40 def ordering_provider_name ordering_provider.last end |
#placer_order_number ⇒ Object
44 45 46 |
# File 'app/models/renalware/feeds/hl7_message.rb', line 44 def placer_order_number super.split("^").first end |