Highway to PSR2
[openemr.git] / interface / modules / zend_modules / module / Carecoordination / src / Carecoordination / Model / Configuration.php
blob6b79c3d35b0036e25082cf0d906b27bfbeaac0a5
1 <?php
2 namespace Carecoordination\Model;
4 use Zend\InputFilter\Factory as InputFactory;
5 use Zend\InputFilter\InputFilter;
6 use Zend\InputFilter\InputFilterAwareInterface;
7 use Zend\InputFilter\InputFilterInterface;
8 use Zend\Form\Form;
10 class Configuration extends Form implements InputFilterAwareInterface
12 protected $inputFilter;
14 public function __construct()
16 parent::__construct('configuration');
17 $this->setAttribute('method', 'post');
20 * Automatic SignOff settings
22 $this->add(array(
23 'name' => 'hie_auto_sign_off_id',
24 'attributes' => array(
25 'type' => 'text',
26 'id' => 'hie_auto_sign_off_id'
28 'options' => array(
29 'label' => \Application\Listener\Listener::z_xlt('Auto Sign-Off [days]'),
31 ));
34 * Automatic Tranfer settings
36 $this->add(array(
37 'type' => 'Zend\Form\Element\Checkbox',
38 'name' => 'hie_auto_send_id',
39 'attributes' => array(
40 'id' => 'hie_auto_send_id'
42 'options' => array(
43 'label' => \Application\Listener\Listener::z_xlt('Auto Send'),
44 'checked_value' => 'yes',
45 'unchecked_value' => 'no'
47 ));
50 * Author settings
52 $this->add(array(
53 'name' => 'hie_author_id',
54 'type' => 'Zend\Form\Element\Select',
55 'attributes'=> array(
56 'class' => '',
57 'data-options' => 'required:true',
58 'editable' => 'false',
59 'required' => 'required',
60 'id' => 'hie_author_fname'
62 'options' => array(
63 'label' => \Application\Listener\Listener::z_xlt('Author'),
64 'value_options' => $this->getUsers(),
66 ));
69 * Data Enterer settings
71 $this->add(array(
72 'name' => 'hie_data_enterer_id',
73 'type' => 'Zend\Form\Element\Select',
74 'attributes'=> array(
75 'class' => '',
76 'data-options' => 'required:true',
77 'editable' => 'false',
78 'required' => 'required',
79 'id' => 'hie_data_enterer_id'
81 'options' => array(
82 'label' => \Application\Listener\Listener::z_xlt('Data Enterer'),
83 'value_options' => $this->getUsers(),
85 ));
88 * Informant settings
90 $this->add(array(
91 'name' => 'hie_informant_id',
92 'type' => 'Zend\Form\Element\Select',
93 'attributes'=> array(
94 'class' => '',
95 'data-options' => 'required:true',
96 'editable' => 'false',
97 'required' => 'required',
98 'id' => 'hie_informant_id'
100 'options' => array(
101 'label' => \Application\Listener\Listener::z_xlt('Informant'),
102 'value_options' => $this->getUsers(),
107 * Personal Informant settings
109 $this->add(array(
110 'name' => 'hie_personal_informant_id',
111 'attributes'=> array(
112 'type' => 'text',
113 'id' => 'hie_personal_informant_id'
115 'options' => array(
116 'label' => \Application\Listener\Listener::z_xlt('Informant'),
121 * Custodian settings
123 $this->add(array(
124 'name' => 'hie_custodian_id',
125 'type' => 'Zend\Form\Element\Select',
126 'attributes'=> array(
127 'class' => '',
128 'data-options' => 'required:true',
129 'editable' => 'false',
130 'required' => 'required',
131 'id' => 'hie_custodian_id'
133 'options' => array(
134 'label' => \Application\Listener\Listener::z_xlt('Custodian'),
135 'value_options' => $this->getUsers(),
140 * Recipient settings
142 $this->add(array(
143 'name' => 'hie_recipient_id',
144 'type' => 'Zend\Form\Element\Select',
145 'attributes'=> array(
146 'class' => '',
147 'data-options' => 'required:true',
148 'editable' => 'false',
149 'required' => 'required',
150 'id' => 'hie_recipient_id'
152 'options' => array(
153 'label' => \Application\Listener\Listener::z_xlt('Recipient'),
154 'value_options' => $this->getUsers(),
159 * Legal Authenticator settings
161 $this->add(array(
162 'name' => 'hie_legal_authenticator_id',
163 'type' => 'Zend\Form\Element\Select',
164 'attributes'=> array(
165 'class' => '',
166 'data-options' => 'required:true',
167 'editable' => 'false',
168 'required' => 'required',
169 'id' => 'hie_legal_authenticator_id'
171 'options' => array(
172 'label' => \Application\Listener\Listener::z_xlt('Legal Authenticator'),
173 'value_options' => $this->getUsers(),
178 * Authenticator settings
180 $this->add(array(
181 'name' => 'hie_authenticator_id',
182 'type' => 'Zend\Form\Element\Select',
183 'attributes'=> array(
184 'class' => '',
185 'data-options' => 'required:true',
186 'editable' => 'false',
187 'required' => 'required',
188 'id' => 'hie_authenticator_id'
190 'options' => array(
191 'label' => \Application\Listener\Listener::z_xlt('Authenticator'),
192 'value_options' => $this->getUsers(),
197 * Primary Care Provider settings
199 $this->add(array(
200 'name' => 'hie_primary_care_provider_id',
201 'type' => 'Zend\Form\Element\Select',
202 'attributes'=> array(
203 'class' => '',
204 'data-options' => 'required:true',
205 'editable' => 'false',
206 'required' => 'required',
207 'id' => 'hie_primary_care_provider_id'
209 'options' => array(
210 'label' => \Application\Listener\Listener::z_xlt('Primary Care Provider'),
211 'value_options' => $this->getUsers(),
216 * MIRTH IP settings
218 $this->add(array(
219 'name' => 'hie_mirth_ip',
220 'attributes'=> array(
221 'type' => 'text',
222 'id' => 'hie_mirth_ip'
224 'options' => array(
225 'label' => \Application\Listener\Listener::z_xlt('Mirth IP'),
230 public function exchangeArray($data)
233 public function getArrayCopy()
235 return get_object_vars($this);
237 public function setInputFilter(InputFilterInterface $inputFilter)
239 throw new \Exception("Not used");
242 public function getInputFilter()
244 if (!$this->inputFilter) {
245 $inputFilter = new InputFilter();
246 $factory = new InputFactory();
249 $this->inputFilter = $inputFilter;
252 return $this->inputFilter;
255 public function getHookConfig()
257 //SOECIFY HOOKS DETAILS OF A MODULE IN AN ARRAY, WITH MODULE NAME AS KEY
258 //SHOULD SPECIFY THE CONTROLLER AND ITS ACTION IN THE PATH, INCLUDING INDEX ACTION
259 $hooks = array(
260 '0' => array(
261 'name' => "send_to_hie",
262 'title' => "Send To HIE",
263 'path' => "encountermanager",
267 return $hooks;
270 public function getUsers()
272 $users = array('0' => '');
273 $res = sqlStatement("SELECT id, fname, lname, street, city, state, zip FROM users WHERE abook_type='ccda'");
274 while ($row = sqlFetchArray($res)) {
275 $users[$row['id']] = $row['fname']." ".$row['lname'];
278 return $users;
281 public function getDependedModulesConfig()
285 public function getAclConfig()
287 $acl = array(
288 array(
289 'section_id' => 'send_to_hie',
290 'section_name' => 'Send To HIE',
291 'parent_section' => 'carecoordination',
294 return $acl;