Sha256: a9becfa6199e8121c6a7930490ac1349bc14613b2faeb56b76b8196bb3aee029

Contents?: true

Size: 936 Bytes

Versions: 2

Compression:

Stored size: 936 Bytes

Contents

module Extensions
  module HL7
    module Segments
      module IN1

        def self.included base
          base.send :include, InstanceMethods
          base.extend ClassMethods
        end
        
        module InstanceMethods
          def insurance_co
            self.value_for_field("4")
          end
          
          def insurance_plan
            self.value_for_field("2.2")
          end
          
          def insured_name
            lname = self.value_for_field("16.1")
            fname = self.value_for_field("16.2")
            middle = self.value_for_field("16.3")
            "#{lname}, #{fname} #{middle}"
          end
          
          def insured_address
            address1, address2, city, state, zip = self.value_for_field("19").split(@item_delim)
            "#{address1}#{address2.blank? ? "," : ", #{address2},"} #{city}, #{state}, #{zip}"
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-hl7-extensions-0.1.2 lib/core_ext/segments/in1.rb
ruby-hl7-extensions-0.1.1 lib/core_ext/segments/in1.rb