psr12 fixes for new PHP_CodeSniffer (#4795)
[openemr.git] / interface / therapy_groups / therapy_groups_models / therapy_groups_encounters_model.php
blobfabc76103c701e652412356264ce344bb2076c73
1 <?php
3 /**
4 * interface/therapy_groups/therapy_groups_models/therapy_groups_encounters_model.php contains the model for therapy group encounters.
6 * This model fetches the encounters for the therapy group from the DB.
8 * Copyright (C) 2016 Shachar Zilbershlag <shaharzi@matrix.co.il>
9 * Copyright (C) 2016 Amiel Elboim <amielel@matrix.co.il>
11 * LICENSE: This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 3
14 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
22 * @package OpenEMR
23 * @author Shachar Zilbershlag <shaharzi@matrix.co.il>
24 * @author Amiel Elboim <amielel@matrix.co.il>
25 * @link http://www.open-emr.org
28 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;