change eligibility batch from ssn to policy number, minor fix to filename with extra...
[openemr.git] / library / group.inc
blob3cf5cbd97c48b12d6adb788876cad0a644e301c4
1 <?php
2 /**
3  * interface/therapy_groups/index.php routing for therapy groups
4  *
5  * group.inc includes methods for groups
6  *
7  * Copyright (C) 2016 Shachar Zilbershlag <shaharzi@matrix.co.il>
8  * Copyright (C) 2016 Amiel Elboim <amielel@matrix.co.il>
9  *
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>;.
20  *
21  * @package OpenEMR
22  * @author  Shachar Zilbershlag <shaharzi@matrix.co.il>
23  * @author  Amiel Elboim <amielel@matrix.co.il>
24  * @link    http://www.open-emr.org
25  */
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)
38     $model = new Therapy_Groups();
39     $result = $model->getGroup($gid);
40     return $result;
43 //Fetches groups data by given search parameter (used in popup search when in add_edit_event for groups)
44 function getGroupData($search_params, $result_columns, $column)
46     $model = new Therapy_Groups();
47     $result = $model->getGroupData($search_params, $result_columns, $column);
48     return $result;
51 //Fetches group statuses from 'groupstat' list
52 function getGroupStatuses()
54     $model = new Group_Statuses();
55     $result = $model->getGroupStatuses();
56     return $result;
59 //Fetches group attendance statuses from 'attendstat' list
60 function getGroupAttendanceStatuses()
62     $model = new Group_Statuses();
63     $result = $model->getGroupAttendanceStatuses();
64     return $result;
67 //Fetches counselors for specific group
68 function getCounselors($gid)
70     $model = new Therapy_Groups_Counselors();
71     $result = $model->getCounselors($gid);
72     return $result;
75 //Fetches participants of group
76 function getParticipants($gid, $onlyActive = false)
78     $model = new Therapy_groups_participants();
79     $result = $model->getParticipants($gid, $onlyActive);
80     return $result;
83 //Fetches group status name by status key
84 function getTypeName($key)
86     $types_array = TherapyGroupsController::prepareGroupTypesList();
87     $types_name = $types_array[$key];
88     return $types_name;
91 //Fetches providers for a specific group event
92 function getProvidersOfEvent($eid)
94     $model = new Users();
95     $result = $model->getProvidersOfEvent($eid);
96     return $result;
99 //Fetches name of user by his id
100 function getUserNameById($uid)
102     $model = new Users();
103     $result = $model->getUserNameById($uid);
104     return $result;
107 function getGroupCounselorsNames($gid)
110     $model = new Therapy_Groups_Counselors();
111     $result = $model->getAllCounselorsNames($gid);
112     return $result;
115 function unsetGroup()
118     unset($_SESSION['therapy_group']);