Class: Prescription

Inherits:
Common::Base show all
Defined in:
app/models/prescription.rb

Overview

Models a Prescription

Direct Known Subclasses

PrescriptionDetails

Instance Attribute Summary collapse

Attributes inherited from Common::Base

#errors_hash, #metadata

Instance Method Summary collapse

Methods inherited from Common::Base

#changed, #changed?, #changes, default_sort, filterable_attributes, #initialize, max_per_page, per_page, sortable_attributes

Constructor Details

This class inherits a constructor from Common::Base

Instance Attribute Details

#dispensed_dateCommon::UTCTime

Returns:



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'app/models/prescription.rb', line 41

class Prescription < Common::Base
  attribute :prescription_id, Integer, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :prescription_image, String
  attribute :refill_status, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :refill_submit_date, Common::UTCTime, sortable: { order: 'DESC' }, filterable: %w[eq not_eq]
  attribute :refill_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :refill_remaining, Integer
  attribute :facility_name, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :facility_api_name, String
  attribute :ordered_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :quantity, Integer
  attribute :expiration_date, Common::UTCTime, filterable: %w[eq lteq gteq]
  attribute :prescription_number, String
  attribute :sig, String
  attribute :prescription_name, String, sortable: { order: 'ASC', default: true }
  attribute :dispensed_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :station_number, String
  attribute :is_refillable, Boolean, filterable: %w[eq not_eq]
  attribute :is_trackable, Boolean, filterable: %w[eq not_eq]
  attribute :cmop_division_phone, String

  alias refillable? is_refillable
  alias trackable? is_trackable

  def <=>(other)
    prescription_id <=> other.prescription_id
  end
end

#expiration_dateCommon::UTCTime

Returns:



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'app/models/prescription.rb', line 41

class Prescription < Common::Base
  attribute :prescription_id, Integer, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :prescription_image, String
  attribute :refill_status, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :refill_submit_date, Common::UTCTime, sortable: { order: 'DESC' }, filterable: %w[eq not_eq]
  attribute :refill_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :refill_remaining, Integer
  attribute :facility_name, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :facility_api_name, String
  attribute :ordered_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :quantity, Integer
  attribute :expiration_date, Common::UTCTime, filterable: %w[eq lteq gteq]
  attribute :prescription_number, String
  attribute :sig, String
  attribute :prescription_name, String, sortable: { order: 'ASC', default: true }
  attribute :dispensed_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :station_number, String
  attribute :is_refillable, Boolean, filterable: %w[eq not_eq]
  attribute :is_trackable, Boolean, filterable: %w[eq not_eq]
  attribute :cmop_division_phone, String

  alias refillable? is_refillable
  alias trackable? is_trackable

  def <=>(other)
    prescription_id <=> other.prescription_id
  end
end

#facility_nameString

Returns:

  • (String)


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'app/models/prescription.rb', line 41

class Prescription < Common::Base
  attribute :prescription_id, Integer, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :prescription_image, String
  attribute :refill_status, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :refill_submit_date, Common::UTCTime, sortable: { order: 'DESC' }, filterable: %w[eq not_eq]
  attribute :refill_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :refill_remaining, Integer
  attribute :facility_name, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :facility_api_name, String
  attribute :ordered_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :quantity, Integer
  attribute :expiration_date, Common::UTCTime, filterable: %w[eq lteq gteq]
  attribute :prescription_number, String
  attribute :sig, String
  attribute :prescription_name, String, sortable: { order: 'ASC', default: true }
  attribute :dispensed_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :station_number, String
  attribute :is_refillable, Boolean, filterable: %w[eq not_eq]
  attribute :is_trackable, Boolean, filterable: %w[eq not_eq]
  attribute :cmop_division_phone, String

  alias refillable? is_refillable
  alias trackable? is_trackable

  def <=>(other)
    prescription_id <=> other.prescription_id
  end
end

#is_refillableBoolean Also known as: refillable?

Returns:

  • (Boolean)


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'app/models/prescription.rb', line 41

class Prescription < Common::Base
  attribute :prescription_id, Integer, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :prescription_image, String
  attribute :refill_status, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :refill_submit_date, Common::UTCTime, sortable: { order: 'DESC' }, filterable: %w[eq not_eq]
  attribute :refill_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :refill_remaining, Integer
  attribute :facility_name, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :facility_api_name, String
  attribute :ordered_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :quantity, Integer
  attribute :expiration_date, Common::UTCTime, filterable: %w[eq lteq gteq]
  attribute :prescription_number, String
  attribute :sig, String
  attribute :prescription_name, String, sortable: { order: 'ASC', default: true }
  attribute :dispensed_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :station_number, String
  attribute :is_refillable, Boolean, filterable: %w[eq not_eq]
  attribute :is_trackable, Boolean, filterable: %w[eq not_eq]
  attribute :cmop_division_phone, String

  alias refillable? is_refillable
  alias trackable? is_trackable

  def <=>(other)
    prescription_id <=> other.prescription_id
  end
end

#is_trackableBoolean Also known as: trackable?

Returns:

  • (Boolean)


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'app/models/prescription.rb', line 41

class Prescription < Common::Base
  attribute :prescription_id, Integer, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :prescription_image, String
  attribute :refill_status, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :refill_submit_date, Common::UTCTime, sortable: { order: 'DESC' }, filterable: %w[eq not_eq]
  attribute :refill_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :refill_remaining, Integer
  attribute :facility_name, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :facility_api_name, String
  attribute :ordered_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :quantity, Integer
  attribute :expiration_date, Common::UTCTime, filterable: %w[eq lteq gteq]
  attribute :prescription_number, String
  attribute :sig, String
  attribute :prescription_name, String, sortable: { order: 'ASC', default: true }
  attribute :dispensed_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :station_number, String
  attribute :is_refillable, Boolean, filterable: %w[eq not_eq]
  attribute :is_trackable, Boolean, filterable: %w[eq not_eq]
  attribute :cmop_division_phone, String

  alias refillable? is_refillable
  alias trackable? is_trackable

  def <=>(other)
    prescription_id <=> other.prescription_id
  end
end

#ordered_dateCommon::UTCTime

Returns:



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'app/models/prescription.rb', line 41

class Prescription < Common::Base
  attribute :prescription_id, Integer, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :prescription_image, String
  attribute :refill_status, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :refill_submit_date, Common::UTCTime, sortable: { order: 'DESC' }, filterable: %w[eq not_eq]
  attribute :refill_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :refill_remaining, Integer
  attribute :facility_name, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :facility_api_name, String
  attribute :ordered_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :quantity, Integer
  attribute :expiration_date, Common::UTCTime, filterable: %w[eq lteq gteq]
  attribute :prescription_number, String
  attribute :sig, String
  attribute :prescription_name, String, sortable: { order: 'ASC', default: true }
  attribute :dispensed_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :station_number, String
  attribute :is_refillable, Boolean, filterable: %w[eq not_eq]
  attribute :is_trackable, Boolean, filterable: %w[eq not_eq]
  attribute :cmop_division_phone, String

  alias refillable? is_refillable
  alias trackable? is_trackable

  def <=>(other)
    prescription_id <=> other.prescription_id
  end
end

#prescription_idInteger

Returns:

  • (Integer)


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'app/models/prescription.rb', line 41

class Prescription < Common::Base
  attribute :prescription_id, Integer, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :prescription_image, String
  attribute :refill_status, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :refill_submit_date, Common::UTCTime, sortable: { order: 'DESC' }, filterable: %w[eq not_eq]
  attribute :refill_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :refill_remaining, Integer
  attribute :facility_name, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :facility_api_name, String
  attribute :ordered_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :quantity, Integer
  attribute :expiration_date, Common::UTCTime, filterable: %w[eq lteq gteq]
  attribute :prescription_number, String
  attribute :sig, String
  attribute :prescription_name, String, sortable: { order: 'ASC', default: true }
  attribute :dispensed_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :station_number, String
  attribute :is_refillable, Boolean, filterable: %w[eq not_eq]
  attribute :is_trackable, Boolean, filterable: %w[eq not_eq]
  attribute :cmop_division_phone, String

  alias refillable? is_refillable
  alias trackable? is_trackable

  def <=>(other)
    prescription_id <=> other.prescription_id
  end
end

#prescription_nameString

Returns:

  • (String)


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'app/models/prescription.rb', line 41

class Prescription < Common::Base
  attribute :prescription_id, Integer, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :prescription_image, String
  attribute :refill_status, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :refill_submit_date, Common::UTCTime, sortable: { order: 'DESC' }, filterable: %w[eq not_eq]
  attribute :refill_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :refill_remaining, Integer
  attribute :facility_name, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :facility_api_name, String
  attribute :ordered_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :quantity, Integer
  attribute :expiration_date, Common::UTCTime, filterable: %w[eq lteq gteq]
  attribute :prescription_number, String
  attribute :sig, String
  attribute :prescription_name, String, sortable: { order: 'ASC', default: true }
  attribute :dispensed_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :station_number, String
  attribute :is_refillable, Boolean, filterable: %w[eq not_eq]
  attribute :is_trackable, Boolean, filterable: %w[eq not_eq]
  attribute :cmop_division_phone, String

  alias refillable? is_refillable
  alias trackable? is_trackable

  def <=>(other)
    prescription_id <=> other.prescription_id
  end
end

#prescription_numberString

Returns:

  • (String)


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'app/models/prescription.rb', line 41

class Prescription < Common::Base
  attribute :prescription_id, Integer, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :prescription_image, String
  attribute :refill_status, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :refill_submit_date, Common::UTCTime, sortable: { order: 'DESC' }, filterable: %w[eq not_eq]
  attribute :refill_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :refill_remaining, Integer
  attribute :facility_name, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :facility_api_name, String
  attribute :ordered_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :quantity, Integer
  attribute :expiration_date, Common::UTCTime, filterable: %w[eq lteq gteq]
  attribute :prescription_number, String
  attribute :sig, String
  attribute :prescription_name, String, sortable: { order: 'ASC', default: true }
  attribute :dispensed_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :station_number, String
  attribute :is_refillable, Boolean, filterable: %w[eq not_eq]
  attribute :is_trackable, Boolean, filterable: %w[eq not_eq]
  attribute :cmop_division_phone, String

  alias refillable? is_refillable
  alias trackable? is_trackable

  def <=>(other)
    prescription_id <=> other.prescription_id
  end
end

#quantityInteger

Returns:

  • (Integer)


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'app/models/prescription.rb', line 41

class Prescription < Common::Base
  attribute :prescription_id, Integer, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :prescription_image, String
  attribute :refill_status, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :refill_submit_date, Common::UTCTime, sortable: { order: 'DESC' }, filterable: %w[eq not_eq]
  attribute :refill_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :refill_remaining, Integer
  attribute :facility_name, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :facility_api_name, String
  attribute :ordered_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :quantity, Integer
  attribute :expiration_date, Common::UTCTime, filterable: %w[eq lteq gteq]
  attribute :prescription_number, String
  attribute :sig, String
  attribute :prescription_name, String, sortable: { order: 'ASC', default: true }
  attribute :dispensed_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :station_number, String
  attribute :is_refillable, Boolean, filterable: %w[eq not_eq]
  attribute :is_trackable, Boolean, filterable: %w[eq not_eq]
  attribute :cmop_division_phone, String

  alias refillable? is_refillable
  alias trackable? is_trackable

  def <=>(other)
    prescription_id <=> other.prescription_id
  end
end

#refill_dateCommon::UTCTime

Returns:



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'app/models/prescription.rb', line 41

class Prescription < Common::Base
  attribute :prescription_id, Integer, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :prescription_image, String
  attribute :refill_status, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :refill_submit_date, Common::UTCTime, sortable: { order: 'DESC' }, filterable: %w[eq not_eq]
  attribute :refill_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :refill_remaining, Integer
  attribute :facility_name, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :facility_api_name, String
  attribute :ordered_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :quantity, Integer
  attribute :expiration_date, Common::UTCTime, filterable: %w[eq lteq gteq]
  attribute :prescription_number, String
  attribute :sig, String
  attribute :prescription_name, String, sortable: { order: 'ASC', default: true }
  attribute :dispensed_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :station_number, String
  attribute :is_refillable, Boolean, filterable: %w[eq not_eq]
  attribute :is_trackable, Boolean, filterable: %w[eq not_eq]
  attribute :cmop_division_phone, String

  alias refillable? is_refillable
  alias trackable? is_trackable

  def <=>(other)
    prescription_id <=> other.prescription_id
  end
end

#refill_remainingInteger

Returns:

  • (Integer)


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'app/models/prescription.rb', line 41

class Prescription < Common::Base
  attribute :prescription_id, Integer, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :prescription_image, String
  attribute :refill_status, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :refill_submit_date, Common::UTCTime, sortable: { order: 'DESC' }, filterable: %w[eq not_eq]
  attribute :refill_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :refill_remaining, Integer
  attribute :facility_name, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :facility_api_name, String
  attribute :ordered_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :quantity, Integer
  attribute :expiration_date, Common::UTCTime, filterable: %w[eq lteq gteq]
  attribute :prescription_number, String
  attribute :sig, String
  attribute :prescription_name, String, sortable: { order: 'ASC', default: true }
  attribute :dispensed_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :station_number, String
  attribute :is_refillable, Boolean, filterable: %w[eq not_eq]
  attribute :is_trackable, Boolean, filterable: %w[eq not_eq]
  attribute :cmop_division_phone, String

  alias refillable? is_refillable
  alias trackable? is_trackable

  def <=>(other)
    prescription_id <=> other.prescription_id
  end
end

#refill_statusString

Returns:

  • (String)


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'app/models/prescription.rb', line 41

class Prescription < Common::Base
  attribute :prescription_id, Integer, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :prescription_image, String
  attribute :refill_status, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :refill_submit_date, Common::UTCTime, sortable: { order: 'DESC' }, filterable: %w[eq not_eq]
  attribute :refill_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :refill_remaining, Integer
  attribute :facility_name, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :facility_api_name, String
  attribute :ordered_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :quantity, Integer
  attribute :expiration_date, Common::UTCTime, filterable: %w[eq lteq gteq]
  attribute :prescription_number, String
  attribute :sig, String
  attribute :prescription_name, String, sortable: { order: 'ASC', default: true }
  attribute :dispensed_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :station_number, String
  attribute :is_refillable, Boolean, filterable: %w[eq not_eq]
  attribute :is_trackable, Boolean, filterable: %w[eq not_eq]
  attribute :cmop_division_phone, String

  alias refillable? is_refillable
  alias trackable? is_trackable

  def <=>(other)
    prescription_id <=> other.prescription_id
  end
end

#refill_submit_dateCommon::UTCTime

Returns:



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'app/models/prescription.rb', line 41

class Prescription < Common::Base
  attribute :prescription_id, Integer, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :prescription_image, String
  attribute :refill_status, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :refill_submit_date, Common::UTCTime, sortable: { order: 'DESC' }, filterable: %w[eq not_eq]
  attribute :refill_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :refill_remaining, Integer
  attribute :facility_name, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :facility_api_name, String
  attribute :ordered_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :quantity, Integer
  attribute :expiration_date, Common::UTCTime, filterable: %w[eq lteq gteq]
  attribute :prescription_number, String
  attribute :sig, String
  attribute :prescription_name, String, sortable: { order: 'ASC', default: true }
  attribute :dispensed_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :station_number, String
  attribute :is_refillable, Boolean, filterable: %w[eq not_eq]
  attribute :is_trackable, Boolean, filterable: %w[eq not_eq]
  attribute :cmop_division_phone, String

  alias refillable? is_refillable
  alias trackable? is_trackable

  def <=>(other)
    prescription_id <=> other.prescription_id
  end
end

#station_numberString

Returns:

  • (String)


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'app/models/prescription.rb', line 41

class Prescription < Common::Base
  attribute :prescription_id, Integer, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :prescription_image, String
  attribute :refill_status, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :refill_submit_date, Common::UTCTime, sortable: { order: 'DESC' }, filterable: %w[eq not_eq]
  attribute :refill_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :refill_remaining, Integer
  attribute :facility_name, String, sortable: { order: 'ASC' }, filterable: %w[eq not_eq]
  attribute :facility_api_name, String
  attribute :ordered_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :quantity, Integer
  attribute :expiration_date, Common::UTCTime, filterable: %w[eq lteq gteq]
  attribute :prescription_number, String
  attribute :sig, String
  attribute :prescription_name, String, sortable: { order: 'ASC', default: true }
  attribute :dispensed_date, Common::UTCTime, sortable: { order: 'DESC' }
  attribute :station_number, String
  attribute :is_refillable, Boolean, filterable: %w[eq not_eq]
  attribute :is_trackable, Boolean, filterable: %w[eq not_eq]
  attribute :cmop_division_phone, String

  alias refillable? is_refillable
  alias trackable? is_trackable

  def <=>(other)
    prescription_id <=> other.prescription_id
  end
end

Instance Method Details

#<=>(other) ⇒ Object



65
66
67
# File 'app/models/prescription.rb', line 65

def <=>(other)
  prescription_id <=> other.prescription_id
end