public function getRespondent($patientId, $organizationId, $respondentId = null)
    {
        if ($patientId) {
            if (isset($this->_respondents[$organizationId][$patientId])) {
                return $this->_respondents[$organizationId][$patientId];
            }
        }
        $newResp = $this->_loadClass('Tracker_Respondent', true, array($patientId, $organizationId, $respondentId));
        $patientId = $newResp->getPatientNumber();

        if (! isset($this->_respondents[$organizationId][$patientId])) {
            $this->_respondents[$organizationId][$patientId] = $newResp;
        }

        return $this->_respondents[$organizationId][$patientId];
    }
public function getRespondent($patientId, $organizationId, $respondentId = null)
    {
        if ($patientId) {
            if (isset($this->_respondents[$organizationId][$patientId])) {
                return $this->_respondents[$organizationId][$patientId];
            }
        }
        $newResp = $this->_loadClass('Tracker_Respondent', true, array($patientId, $organizationId, $respondentId));
        $patientId = $newResp->getPatientNumber();

        if (! isset($this->_respondents[$organizationId][$patientId])) {
            $this->_respondents[$organizationId][$patientId] = $newResp;
        }

        return $this->_respondents[$organizationId][$patientId];
    }
public function getRespondent ( $ patientId , $ organizationId , $ respondentId = null ) { if ( $ patientId ) { if ( isset ( $ this -> _respondents [ $ organizationId ] [ $ patientId ] ) ) { return $ this -> _respondents [ $ organizationId ] [ $ patientId ] ; } } $ newResp = $ this -> _loadClass ( 'Tracker_Respondent' , true , array ( $ patientId , $ organizationId , $ respondentId ) ) ; $ patientId = $ newResp -> getPatientNumber ( ) ; if ( ! isset ( $ this -> _respondents [ $ organizationId ] [ $ patientId ] ) ) { $ this -> _respondents [ $ organizationId ] [ $ patientId ] = $ newResp ; } return $ this -> _respondents [ $ organizationId ] [ $ patientId ] ; }
Get a respondent object

@param string $patientId   Patient number, you can use $respondentId instead
@param int $organizationId Organization id
@param int $respondentId   Optional respondent id, used when patient id is empty
@return \Gems_Tracker_Respondent
Get a respondent object