Join in CodeIgniter

    public function vp_patients(){
        $this->db->select('b.*');
        $this->db->from($this->table . ' as a');
        $this->db->join('_patient as b', 'b.CHART = a.patient_id');
        $this->db->order_by('b.CHART', 'asc');
        $query = $this->db->get();

        return $query->result();
    }