'Look at the rs_codes and returns the status from the code.'

def lookupstatusfromcode(self, statuscode):

    status = 'UNKNOWN'
    if (self._rs_codes is not None):
        statuscode = str(statuscode).strip()
        for i in self._rs_codes:
            val = str(self._rs_codes[i]).strip()
            if (',' in val):
                splitted = val.split(',')
                for code in splitted:
                    code = str(code).strip()
                    if (statuscode == code):
                        status = i.upper()
                        break
            elif (statuscode == val):
                status = i.upper()
                break
    return status
