class RTP::ExtendedField

The ExtendedField class.

@note Relations:

* Parent: Field
* Children: none

Attributes

accessory_code[R]
accessory_type[R]
field_id[R]
high_dose_authorization[R]
is_fff[R]
original_beam_name[R]
original_beam_number[R]
original_plan_uid[R]
parent[RW]

The Record which this instance belongs to.

referenced_rt_plan_relationship[R]
referenced_rt_plan_uid[R]

Public Class Methods

load(string, parent) click to toggle source

Creates a new (treatment) ExtendedField by parsing a RTPConnect string line.

@param [#to_s] string the extended treatment field definition record string line @param [Record] parent a record which is used to determine the proper parent of this instance @return [ExtendedField] the created ExtendedField instance @raise [ArgumentError] if given a string containing an invalid number of elements

# File lib/rtp-connect/extended_field.rb, line 31
def self.load(string, parent)
  ef = self.new(parent)
  ef.load(string)
end
new(parent) click to toggle source

Creates a new (treatment) ExtendedField.

@param [Record] parent a record which is used to determine the proper parent of this instance

Calls superclass method
# File lib/rtp-connect/extended_field.rb, line 40
def initialize(parent)
  super('EXTENDED_FIELD_DEF', 4, 12)
  # Parent relation (may get more than one type of record here):
  @parent = get_parent(parent.to_record, Field)
  @parent.add_extended_field(self)
  @attributes = [
    # Required:
    :keyword,
    :field_id,
    :original_plan_uid,
    # Optional:
    :original_beam_number,
    :original_beam_name,
    :is_fff,
    :accessory_code,
    :accessory_type,
    :high_dose_authorization,
    :referenced_rt_plan_uid,
    :referenced_rt_plan_relationship
  ]
end

Public Instance Methods

==(other) click to toggle source

Checks for equality.

Other and self are considered equivalent if they are of compatible types and their attributes are equivalent.

@param other an object to be compared with self. @return [Boolean] true if self and other are considered equivalent

# File lib/rtp-connect/extended_field.rb, line 70
def ==(other)
  if other.respond_to?(:to_extended_field)
    other.send(:state) == state
  end
end
Also aliased as: eql?
accessory_code=(value) click to toggle source

Sets the accessory_code attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/extended_field.rb, line 148
def accessory_code=(value)
  @accessory_code = value && value.to_s
end
accessory_type=(value) click to toggle source

Sets the accessory_type attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/extended_field.rb, line 156
def accessory_type=(value)
  @accessory_type = value && value.to_s
end
children() click to toggle source

Gives an empty array, as these instances are child-less by definition.

@return [Array] an emtpy array

# File lib/rtp-connect/extended_field.rb, line 82
def children
  return Array.new
end
eql?(other)
Alias for: ==
field_id=(value) click to toggle source

Sets the field_id attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/extended_field.rb, line 108
def field_id=(value)
  @field_id = value && value.to_s
end
hash() click to toggle source

Computes a hash code for this object.

@note Two objects with the same attributes will have the same hash code.

@return [Fixnum] the object's hash code

# File lib/rtp-connect/extended_field.rb, line 92
def hash
  state.hash
end
high_dose_authorization=(value) click to toggle source

Sets the high_dose_authorization attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/extended_field.rb, line 164
def high_dose_authorization=(value)
  @high_dose_authorization = value && value.to_s
end
is_fff=(value) click to toggle source

Sets the is_fff attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/extended_field.rb, line 140
def is_fff=(value)
  @is_fff = value && value.to_s
end
original_beam_name=(value) click to toggle source

Sets the original_beam_name attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/extended_field.rb, line 132
def original_beam_name=(value)
  @original_beam_name = value && value.to_s
end
original_beam_number=(value) click to toggle source

Sets the original_beam_number attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/extended_field.rb, line 124
def original_beam_number=(value)
  @original_beam_number = value && value.to_s
end
original_plan_uid=(value) click to toggle source

Sets the original_plan_uid attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/extended_field.rb, line 116
def original_plan_uid=(value)
  @original_plan_uid = value && value.to_s
end
referenced_rt_plan_relationship=(value) click to toggle source

Sets the referenced_rt_plan_relationship attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/extended_field.rb, line 180
def referenced_rt_plan_relationship=(value)
  @referenced_rt_plan_relationship = value && value.to_s
end
referenced_rt_plan_uid=(value) click to toggle source

Sets the referenced_rt_plan_uid attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/extended_field.rb, line 172
def referenced_rt_plan_uid=(value)
  @referenced_rt_plan_uid = value && value.to_s
end
to_extended_field() click to toggle source

Returns self.

@return [ExtendedField] self

# File lib/rtp-connect/extended_field.rb, line 100
def to_extended_field
  self
end