2 /* +-----------------------------------------------------------------------------+
3 * OpenEMR - Open Source Electronic Medical Record
4 * Copyright (C) 2014 Z&H Consultancy Services Private Limited <sam@zhservices.com>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * @author BASIL PT <basil@zhservices.com>
19 * +------------------------------------------------------------------------------+
22 namespace Application\Model
;
24 use Zend\Db\TableGateway\AbstractTableGateway
;
25 use Application\Model\ApplicationTable
;
26 use Zend\Db\Adapter\Driver\Pdo\Result
;
28 class SendtoTable
extends AbstractTableGateway
32 * @return array facility
35 public function getFacility()
37 $appTable = new ApplicationTable();
38 $sql = "SELECT * FROM facility ORDER BY name";
39 $result = $appTable->zQuery($sql);
50 public function getUsers($type)
52 $appTable = new ApplicationTable();
53 $sql = "SELECT * FROM users WHERE abook_type = ?";
54 $result = $appTable->zQuery($sql, array($type));
61 * @return array fax reciever types
64 public function getFaxRecievers()
66 $appTable = new ApplicationTable();
67 $sql = "SELECT option_id, title FROM list_options WHERE list_id = 'abook_type'";
68 $result = $appTable->zQuery($sql, array($formId));
76 * @return $components Array of CCDA components
78 public function getCCDAComponents($type)
80 $components = array();
81 $query = "select * from ccda_components where ccda_type = ?";
82 $appTable = new ApplicationTable();
83 $result = $appTable->zQuery($query, array($type));
85 foreach ($result as $row) {
86 $components[$row['ccda_components_field']] = $row['ccda_components_name'];