class YAHL7::V2::DataType::FT

This is the HL7 data type for formatted text

Public Class Methods

new(value, parse_options) click to toggle source
# File lib/yahl7/v2/data_type/ft.rb, line 10
def initialize(value, parse_options)
  @value = value
  @formatter = YAHL7::V2::Formatter.new(parse_options)
end
repeated?(value) click to toggle source
# File lib/yahl7/v2/data_type/ft.rb, line 19
def self.repeated?(value)
  value.is_a?(Array)
end

Public Instance Methods

formatted() click to toggle source
# File lib/yahl7/v2/data_type/ft.rb, line 15
def formatted
  @formatted ||= parse_value
end

Private Instance Methods

parse_body(body) click to toggle source
# File lib/yahl7/v2/data_type/ft.rb, line 29
def parse_body(body)
  @formatter.format(body)
end
parse_value() click to toggle source
# File lib/yahl7/v2/data_type/ft.rb, line 25
def parse_value
  value.is_a?(Array) ? value.map { |v| parse_body(v) }.join("\n") : parse_body(value)
end