Highway to PSR2
[openemr.git] / interface / therapy_groups / therapy_groups_models / therapy_groups_encounters_model.php
blobd52ccc4af7a0005d092dcebe72a1dc6d913c29f1
1 <?php
2 /**
3 * interface/therapy_groups/therapy_groups_models/therapy_groups_encounters_model.php contains the model for therapy group encounters.
5 * This model fetches the encounters for the therapy group from the DB.
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>;.
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
27 class Therapy_Groups_Encounters
30 const TABLE = 'form_groups_encounter';
32 /**
33 * Get all encounters of specified group.
34 * @param $gid
35 * @return ADORecordSet_mysqli
37 public function getGroupEncounters($gid)
39 $sql = "SELECT * FROM " . self::TABLE . " WHERE group_id = ? AND date >= CURDATE();";
40 $result = sqlStatement($sql, array($gid));
41 while ($row = sqlFetchArray($result)) {
42 $encounters[] = $row;
45 return $encounters;