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.
- #name ⇒ Object
-
#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.
31 32 33 |
# File 'app/models/renalware/feeds/hl7_message.rb', line 31 def initialize(observation_request_segment) super(observation_request_segment) end |
Instance Method Details
#identifier ⇒ Object
35 36 37 |
# File 'app/models/renalware/feeds/hl7_message.rb', line 35 def identifier universal_service_id.split("^").first end |
#name ⇒ Object
39 40 41 |
# File 'app/models/renalware/feeds/hl7_message.rb', line 39 def name universal_service_id.split("^")[1] end |
#observations ⇒ Object
Select only OBX children. OBR can have other types of child segments but we want to ignore those.
45 46 47 48 49 50 51 |
# File 'app/models/renalware/feeds/hl7_message.rb', line 45 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
53 54 55 |
# File 'app/models/renalware/feeds/hl7_message.rb', line 53 def ordering_provider_name ordering_provider.last end |
#placer_order_number ⇒ Object
57 58 59 |
# File 'app/models/renalware/feeds/hl7_message.rb', line 57 def placer_order_number super.split("^").first end |