ElementLetter::calculateRe PHP Method

calculateRe() public method

public calculateRe ( $patient )
    public function calculateRe($patient)
    {
        $re = $patient->first_name . ' ' . $patient->last_name;
        foreach (array('address1', 'address2', 'city', 'postcode') as $field) {
            if ($patient->contact->address && $patient->contact->address->{$field}) {
                $re .= ', ' . $patient->contact->address->{$field};
            }
        }
        return $re . ', DOB: ' . $patient->NHSDate('dob') . ', Hosp No: ' . $patient->hos_num . ', NHS No: ' . $patient->nhsnum;
    }