3 * interface/therapy_groups/index.php routing for therapy groups
5 * group.inc includes methods for groups
7 * Copyright (C) 2016 Shachar Zilbershlag <shaharzi@matrix.co.il>
8 * Copyright (C) 2016 Amiel Elboim <amielel@matrix.co.il>
10 * LICENSE: This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 3
13 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
22 * @author Shachar Zilbershlag <shaharzi@matrix.co.il>
23 * @author Amiel Elboim <amielel@matrix.co.il>
24 * @link http://www.open-emr.org
27 require_once (dirname(__FILE__) . "/sql.inc");
28 require_once (dirname(__FILE__) . "/../interface/therapy_groups/therapy_groups_models/therapy_groups_model.php");
29 require_once (dirname(__FILE__) . "/../interface/therapy_groups/therapy_groups_models/group_statuses_model.php");
30 require_once (dirname(__FILE__) . "/../interface/therapy_groups/therapy_groups_models/therapy_groups_counselors_model.php");
31 require_once (dirname(__FILE__) . "/../interface/therapy_groups/therapy_groups_models/users_model.php");
32 require_once (dirname(__FILE__) . "/../interface/therapy_groups/therapy_groups_models/therapy_groups_participants_model.php");
33 require_once (dirname(__FILE__) . "/../interface/therapy_groups/therapy_groups_controllers/therapy_groups_controller.php");
35 //Fetches groups data by given search parameter (used in popup search when in add_edit_event for groups)
36 function getGroup($gid){
37 $model = new Therapy_Groups();
38 $result = $model->getGroup($gid);
42 //Fetches groups data by given search parameter (used in popup search when in add_edit_event for groups)
43 function getGroupData($search_params, $result_columns, $column){
44 $model = new Therapy_Groups();
45 $result = $model->getGroupData($search_params, $result_columns, $column);
49 //Fetches group statuses from 'groupstat' list
50 function getGroupStatuses(){
51 $model = new Group_Statuses();
52 $result = $model->getGroupStatuses();
56 //Fetches group attendance statuses from 'attendstat' list
57 function getGroupAttendanceStatuses(){
58 $model = new Group_Statuses();
59 $result = $model->getGroupAttendanceStatuses();
63 //Fetches counselors for specific group
64 function getCounselors($gid){
65 $model = new Therapy_Groups_Counselors();
66 $result = $model->getCounselors($gid);
70 //Fetches participants of group
71 function getParticipants($gid){
72 $model = new Therapy_groups_participants();
73 $result = $model->getParticipants($gid);
77 //Fetches group status name by status key
78 function getTypeName($key){
79 $types_array = TherapyGroupsController::prepareGroupTypesList();
80 $types_name = $types_array[$key];
84 //Fetches providers for a specific group event
85 function getProvidersOfEvent($eid){
87 $result = $model->getProvidersOfEvent($eid);
91 //Fetches name of user by his id
92 function getUserNameById($uid){
94 $result = $model->getUserNameById($uid);
98 function getGroupCounselorsNames($gid){
100 $model = new Therapy_Groups_Counselors();
101 $result = $model->getAllCounselorsNames($gid);
105 function unsetGroup(){
107 unset($_SESSION['therapy_group']);