OEModule\PatientTicketing\components\PatientTicketing_API::getLatestFollowUp PHP Method

getLatestFollowUp() public method

Returns the most recent followup value for a patient.
public getLatestFollowUp ( $patient ) : array | boolean
$patient
return array | boolean followup value or false if not present
    public function getLatestFollowUp($patient)
    {
        $ticket_service = Yii::app()->service->getService(self::$TICKET_SERVICE);
        $tickets = $ticket_service->getTicketsForPatient($patient);
        foreach ($tickets as $ticket) {
            if ($follow_up = $this->getFollowUpFromAutoSave($patient->id, $ticket->current_queue->id)) {
                return $follow_up;
            } elseif ($follow_up = $this->getFollowUp($ticket->id)) {
                return $follow_up;
            }
        }
        return false;
    }