Method: Services::IscCodeLookup#find_isc_value

Defined in:
app/models/services/isc_code_lookup.rb

#find_isc_value(assessment) ⇒ Object

——————————————————————#

Finds and returns the actual isc code (eg: "NC")                #
Returns nil if:                                                 #
  1) any of the attributes required for isc calculation are nil #
  2) isc code is not found due to an invalid combination of     #
     required attributes                                        #

——————————————————————#



38
39
40
41
42
43
44
45
# File 'app/models/services/isc_code_lookup.rb', line 38

def find_isc_value(assessment)
  return Services::IscCode.inactivation_code if inactivation_isc?(assessment)

  if all_lookup_attributes_exist?(assessment)
    isc_lookup = self.class.isc_lookup(assessment).first
    isc_lookup.isc_code.code if isc_lookup
  end
end