def encode(value, type)
      raise ArgumentError, "Invalid argument type. Expected string, got #{type.class}" unless type.is_a?(String)
      value = [value] unless value.is_a?(Array)
      return value.pack(vr_to_str(type))
    end
def encode(value, type)
      raise ArgumentError, "Invalid argument type. Expected string, got #{type.class}" unless type.is_a?(String)
      value = [value] unless value.is_a?(Array)
      return value.pack(vr_to_str(type))
    end
Encodes a given value to a binary string.

 @param [String, Integer, Float, Array] value a formatted value (String, Integer, etc..) or an array of numbers
 @param [String] type the type (vr) of data to encode
 @return [String] an encoded binary string