OEModule\OphCoCvi\components\OphCoCvi_Manager::getStatusText PHP Method

getStatusText() public method

public getStatusText ( $status ) : string
$status
return string
    public function getStatusText($status)
    {
        if ($status & self::$ISSUED) {
            return 'Issued';
        }
        $map = array('Clinical' => self::$CLINICAL_COMPLETE, 'Clerical' => self::$CLERICAL_COMPLETE, 'Demographics' => self::$DEMOGRAPHICS_COMPLETE, 'Consent signature' => self::$CONSENTED, 'Consultant signature' => self::$CONSULTANT_SIGNED);
        $result = array();
        foreach ($map as $label => $flag) {
            if (($status & $flag) != $flag) {
                $result[] = $label;
            }
        }
        if (count($result) === count($map)) {
            return 'Incomplete';
        } elseif (count($result) === 0) {
            return 'Complete';
        } else {
            return 'Incomplete/Missing: ' . implode(', ', $result);
        }
    }