Class: Renalware::Hospitals::Unit

Inherits:
ApplicationRecord show all
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

Class Method Details

.policy_classObject



34
35
36
# File 'app/models/renalware/hospitals/unit.rb', line 34

def self.policy_class
  BasePolicy
end

Instance Method Details

#to_sObject



38
39
40
# File 'app/models/renalware/hospitals/unit.rb', line 38

def to_s
  "#{name} (#{unit_code})"
end

#unit_type_rr8Object

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