Class: Renalware::Hospitals::Unit
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Renalware::Hospitals::Unit
- Extended by:
- Enumerize
- Defined in:
- app/models/renalware/hospitals/unit.rb
Constant Summary collapse
- UNIT_TYPE_RR8_MAP =
{ hospital: "HOSP", satellite: "SATL", home: "HOME" }.freeze
Class Method Summary collapse
Instance Method Summary collapse
- #to_s ⇒ Object
-
#unit_type_rr8 ⇒ Object
Map unit_type to its equivalent Renal Registry RR8 code.
Class Method Details
.policy_class ⇒ Object
34 35 36 |
# File 'app/models/renalware/hospitals/unit.rb', line 34 def self.policy_class BasePolicy end |
Instance Method Details
#to_s ⇒ Object
38 39 40 |
# File 'app/models/renalware/hospitals/unit.rb', line 38 def to_s "#{name} (#{unit_code})" end |
#unit_type_rr8 ⇒ Object
Map unit_type to its equivalent Renal Registry RR8 code.
43 44 45 |
# File 'app/models/renalware/hospitals/unit.rb', line 43 def unit_type_rr8 UNIT_TYPE_RR8_MAP[unit_type.to_sym] end |