translation fixes to prepare for a translation spreadsheet update
[openemr.git] / interface / modules / zend_modules / module / Carecoordination / view / carecoordination / encountermanager / index.phtml
bloba4a7bb0d671801e42c1f7e97156c9ae09056c685
1 <?php
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  Vinish K <vinish@zhservices.com>
19 *    @author  Riju K P <rijukp@zhservices.com>
20 *    @author  Chandni Babu <chandnib@zhservices.com> 
21 * +------------------------------------------------------------------------------+
23 $status_title   = array('0' => 'Pending', '1' => 'Completed','2' => 'Secure Transfer', '3' => 'View');
24 $status_details = array();
25 foreach($this->status_details as $row_status){
26         $status_details[$row_status['pid']][] = $row_status;
29 <script>
30       $(function(){
31         srcset = false;
32         $('.sendto').on("click",function(){
33           $('.new_wrapper').toggle().css({
34             "margin-left" :"30%"
35           });
36         });
37     $(".search_button2").click(function(e){
38       $(".ap-st-st-12").css("left",Number(e.pageX)+"px");
39       $(".ap-st-st-12").toggle();
40     });
41       
42     $(document).mouseup(function (e){
43         var container = $(".ap-st-st-12");
44         button = $(".search_button2");
45         if(!container.is(e.target) && container.has(e.target).length === 0 && !button.is(e.target) )
46         {
47           $(container).css("display","none");
48         }
49     });
50       
51     /* Main tab click function **/
52     $('.main-tab-head li').on("click",function(){
53       $('.main-tab-head li').removeClass("main_active");
54       $(this).addClass("main_active");
55       $('.child-all').hide(); 
56       data_type = $(this).data('type');
57           if(data_type == 'import') {
58               if(srcset == false){
59                  var src = $('#ccd_iframe').data('src');
60                  $('#ccd_iframe').attr('src',src);
61                  $('.import-child-tab-1').show();
62                  srcset = true; 
63               }              
64           }
65       $('.child-tab-1').show();
66       var mainIndex = $(this).index() + 1;
67       $('.main-all').hide();
68       if(mainIndex == 4) {
69         var div = document.getElementsByClassName("main-tab-"+mainIndex)[0];
70         var iFrame = div.getElementsByTagName("iframe")[0];
71         if(iFrame) {
72           var src = iFrame.getAttribute('src');
73           var dataSrc = iFrame.getAttribute('data-src');
74           if(src == '')
75             iFrame.src = dataSrc;
76         }
77       }
78       $('.main-tab-'+mainIndex).fadeIn();
79     });
81     /* Child tab Click function */
82     $('.child-tab-head li').not('.disabled_child').click(function(){
83       $('.child-tab-head li').removeClass("child_active");
84       $(this).addClass("child_active");
85       var mainIndex = $(this).index() + 1;
86       $('.child-all').hide();
87       var div = document.getElementsByClassName("child-tab-"+mainIndex)[0];
88       var iFrame = div.getElementsByTagName("iframe")[0];
89       if(iFrame) {
90         var src = iFrame.getAttribute('src');
91         var dataSrc = iFrame.getAttribute('data-src');
92         if(src == '')
93           iFrame.src = dataSrc;
94       }
95       $('.child-tab-'+mainIndex).fadeIn();
96     });
98     /* Import tab Click function */
99     $('.child-tab-head-import li').not('.disabled_child').click(function(){
100       $('.child-tab-head-import li').removeClass("child_active");
101       $(this).addClass("child_active");
102       var mainIndex = $(this).index() + 1;
103       $('.child-all-import').hide();
104       var div = document.getElementsByClassName("import-child-tab-"+mainIndex)[0];
105       var iFrame = div.getElementsByTagName("iframe")[0];
106       if(iFrame) {
107         var src = iFrame.getAttribute('src');
108         var dataSrc = iFrame.getAttribute('data-src');
109         if(src == '')
110           iFrame.src = dataSrc;
111       }
112       $('.import-child-tab-'+mainIndex).fadeIn();
113     });
115     $("#download_ccda").click(function(){
116       $('#downloadccda').val('download_ccda');
117       $('#theform').submit();
118     });
119     
120     $("#download_ccr").click(function(){
121       $("#downloadccr").val('download_ccr');
122       $("#theform").submit();
123     });
124     
125     $("#download_ccd").click(function(){
126       $("#downloadccd").val('download_ccd');
127       $("#theform").submit();
128     });
129     
130   });
131   function reloadIframe()
132   {
133     document.getElementById('documents_iframe').src=document.getElementById('documents_iframe').src;
134   }
135 </script>
137     <style>
138       .ap-st-st-12 {
139         display: none;
140         width: 550px;
141       }
142     </style>
143     <div class="new_wrapper">
144   <ul class="main-tab-head">
145     <li class="main_active" data-type="export"><?php echo $this->listenerObject->z_xlt('Export');?></li>
146     <li class="" data-type="import"><?php echo $this->listenerObject->z_xlt('Import');?></li>
147   </ul>
148   <div class="clear"></div>
149   <div class="main-tab-1 main-all" style="display: block;">
150     <ul class="child-tab-head">
151       <li class="child_active"><?php echo $this->listenerObject->z_xlt('Transition Of Care');?></li>
152       <li><?php echo $this->listenerObject->z_xlt('Immunization');?></li>
153       <li><?php echo $this->listenerObject->z_xlt('Syndromic Surveillance');?></li>
154     </ul>
155     <div class="clear"></div>
156     <div class="child-tab-1 child-all">
157       <!-- -->
158       <div>
159         <form method="post" id="theform" style="font-size: 12px;">
160         <div class="se_in_15 se_in_16">
161                 <table>
162                     <tr>
163                         <td class="se_in_16_label"><label><?php echo $this->listenerObject->z_xlt('Date'); ?></label></td>
164                         <td nowrap>
165                                 <input readonly maxlength="10" style="width: 42%" type="text" name="form_date_from" id="form_date_from" class="dateClass"/>
166                                 <input readonly maxlength="10" style="width: 42%" type="text" name="form_date_to" id="form_date_to" class="dateClass"/>
167                                 <script type="text/javascript">
168                                         $(document).ready(function(){
169                                                 $( "#form_date_from" ).datepicker("setDate", '<?php echo $this->commonplugin->date_format($this->form_data['from_date'], $GLOBALS['date_display_format'], 'yyyy-mm-dd');?>' );
170                                                 $( "#form_date_to" ).datepicker("setDate", '<?php echo $this->commonplugin->date_format($this->form_data['to_date'], $GLOBALS['date_display_format'], 'yyyy-mm-dd');?>');
171                                         });
172                                 </script>
173                         </td> 
174                     </tr>
175                     <tr>
176                         <td nowrap><label><?php echo $this->listenerObject->z_xlt('Patient Name/ID'); ?></label></td>
177                         <td><input maxlength="25" type="text" name="form_pid" value="<?php echo $this->escapeHtml($this->form_data['pid']);?>" /><br/></td>
178                     </tr>
179                     <tr>
180                         <td><label><?php echo $this->listenerObject->z_xlt('Encounter'); ?></label></td>
181                         <td><input maxlength="10" type="text" onkeypress="return isNumber(event)" name="form_encounter" value="<?php echo $this->escapeHtml($this->form_data['encounter']);?>" /><br/></td>
182                     </tr>
183                     <tr>
184                         <td></td>
185                         <td><input type="submit" onclick="clearCount();return validate_search();"  value="<?php echo $this->listenerObject->z_xlt('SEARCH'); ?>" name="search" id="search_encounter" /></td>
186                     </tr>
187                 </table> <!-- table -->
188         </div><!-- se in 15 -->
189         
190         <div class="body_inner_wrapper">
191             <div class="header_wrap">
192                 <div class="header_wrap_left">
193                     <div class="search_button" title="Search"><?php echo $this->listenerObject->z_xlt('SEARCH'); ?></div>&nbsp;&nbsp;
194                     <div id="download_ccda" style="display: none;"><?php echo $this->listenerObject->z_xlt('DOWNLOAD'); ?></div>&nbsp;&nbsp;
195                     <input type="hidden" name="downloadccda" id="downloadccda" value="">
196                     <input type="hidden" name="components" id="components" value="">
197                     <div style="display:none;" id="download_ccr"><?php echo $this->listenerObject->z_xlt('DOWNLOAD'); ?></div>&nbsp;&nbsp;
198                     <input type="hidden" name="downloadccr" id="downloadccr" value="">
199                     <div style="display:none;" id="download_ccd"><?php echo $this->listenerObject->z_xlt('DOWNLOAD'); ?></div>&nbsp;&nbsp;
200                     <input type="hidden" name="downloadccd" id="downloadccd" value="">
201                     <input type="hidden" name="pid_ccda" id="pid_ccda" value="">
202                     <?php
203                     $arr = $this->getVariables('Application\Controller\SendtoController','sendAction');
204                     $arr['required_butons'] = array('hie','emr_direct','download_all');
205                     $arr['send_via']        = 'hie';
206                     $this->layout('carecoordination/layout/encountermanager');
207                     echo $this->partial("application/sendto/send",$arr);
208                     ?>
209                     <div class="se_in_3" title="<?php echo $this->listenerObject->z_xlt('Reload');?>" onclick="javascript:clearCount();document.getElementById('theform').submit();"></div>
210                 </div><!-- header_wrap_left -->
211                 <div class="header_wrap_right" style="<?php if(count($this->details) == 0){ ?>display: none;<?php } ?>">
212                     <div class="se_in_4">
213                         <label><?php echo $this->listenerObject->z_xlt('Show');?>&nbsp;</label>&nbsp;<input maxlength="3" type="text" onkeypress="return isNumber(event)" name="form_results" value="<?php echo $this->escapeHtml($this->form_data['results']);?>" />&nbsp;<label>&nbsp;<?php echo $this->listenerObject->z_xlt('Encounters'); ?></label>
214                     </div>
215                     <div class="se_in_6">
216                         <div class="se_in_5">
217                             <div class="se_in_5-1" onclick="pagination('first');"></div>
218                             <div class="se_in_5-2" onclick="<?php if($this->form_data['current_page']>1) {?>pagination('previous');<?php }?>"></div>
219                             <div class="se_in_5-3" onclick="<?php if($this->form_data['current_page']<$this->form_data['total_pages']) {?>pagination('next');<?php }?>"></div>
220                             <div class="se_in_5-4" onclick="pagination('last');"></div>
221                         </div>
222                         <div class="clear"></div>
223                         <div class="se_in_7">
224                             <label><?php echo $this->listenerObject->z_xlt('Page');?> <?php echo $this->escapeHtml($this->form_data['current_page']);?> - <?php echo $this->listenerObject->z_xlt('of');?> <?php echo $this->escapeHtml($this->form_data['total_pages']);?></label>
225                         </div><!-- se_in_7 -->
226                     </div><!-- se_in_6 -->
227                 </div>
228             </div><!-- header_wrap  -->
229             <!-- body content  -->
230             <div class="clear"></div>
231             <div class="se_in_8">
232                 <style type="text/css">
233                 select{
234                         line-height: 17px !important;
235                 }
236                 </style>
237                 <script type="text/javascript">                
238                 $(document).ready(function(){
239                         $('.expand_details').click(function(){
240                                 var arr = (this.id).split('_');
241                                 
242                                 if($('#'+this.id).hasClass('se_in_23')){
243                                         $('#'+this.id).addClass("se_in_24");
244                                         $('#'+this.id).removeClass("se_in_23");
245                                         $('#hide_'+arr[arr.length-1]).show('slow');
246                                 }
247                                 else if($('#'+this.id).hasClass('se_in_24')){
248                                         $('#'+this.id).addClass("se_in_23");
249                                         $('#'+this.id).removeClass("se_in_24");
250                                         $('#hide_'+arr[arr.length-1]).hide('slow');
251                                 }
252                         });
253                         $('#expand_all').click(function(){
254                                 if($('#expand_all').hasClass('se_in_23')){                                        
255                                         $('.expand_details').addClass("se_in_24");
256                                         $('.expand_details').removeClass("se_in_23");                                        
257                                         $('.expand_all').addClass("se_in_24");
258                                         $('.expand_all').removeClass("se_in_23");                                        
259                                         $('.ccda_details').show('slow');
260                                 }
261                                 else if($('#expand_all').hasClass('se_in_24')){
262                                         $('.expand_details').addClass("se_in_23");
263                                         $('.expand_details').removeClass("se_in_24");                                        
264                                         $('.expand_all').addClass("se_in_23");
265                                         $('.expand_all').removeClass("se_in_24");                                        
266                                         $('.ccda_details').hide('slow');
267                                 }
268                         });
269                 });
270                 function iframeLoaded(height_offset, frame_id) {
271                         var iFrameID = document.getElementById(frame_id);
272                         if(iFrameID) {
273                                 if(height_offset > 0) {
274                                         iFrameID.height = height_offset + "px";
275                                 }
276                                 else{
277                                         iFrameID.height = iFrameID.contentWindow.document.body.scrollHeight + "px";
278                                 }
279                         }
280                 }
281                 </script>
282                 <table class="responsive" style="<?php if(count($this->details) == 0){ ?>display: none; <?php } ?>">
283                     <tr class="se_in_9">
284                         <th width="1%" id="expand_all" class="expand_all se_in_23">&nbsp;</th>
285                         <th width="3%"><label><?php echo $this->escapeHtml('#'); ?></label></th>
286                         <th width="5%"><label><?php echo $this->listenerObject->z_xlt('PID'); ?></label></th>
287                         <th><label><?php echo $this->listenerObject->z_xlt('Name'); ?></label></th>
288                         <th><label><?php echo $this->listenerObject->z_xlt('Encounter Count'); ?></label></th>
289                         <th><label><?php echo $this->listenerObject->z_xlt('Total Transfers'); ?></label></th>
290                         <th><label><?php echo $this->listenerObject->z_xlt('Successful Transfers'); ?></label></th>
291                         <th><label><?php echo $this->listenerObject->z_xlt('Last Visit'); ?></label></th>
292                         <th width="3%"><input type="checkbox" value="1" name="form_select_all" id="form_select_all" <?php if($this->form_data['select_all'] == 1) echo "checked"; ?> /></th>
293                         <th width="3%">&nbsp;</th>
294                     </tr>
295                     <?php
296                     $slno       = ($this->escapeHtml($this->form_data['current_page']) - 1) * $this->escapeHtml($this->form_data['results']);                    
297                     foreach($this->details as $row){
298                         $slno++;
299                         ?>
300                             <tr>
301                                 <td id="expand_details_<?php echo $this->escapeHtml($row['pid']);?>" class="expand_details se_in_23" style="cursor: pointer;"></td>
302                                 <td><label><?php echo $slno;?>)</label></td>
303                                 <td><label><?php echo $this->escapeHtml($row['pid']);?></label></td>
304                                 <td><label><?php echo $this->escapeHtml($row['fname'])." ".$this->escapeHtml($row['mname'])." ".$this->escapeHtml($row['lname']); ?></label></td>
305                                 <td><label><?php echo $this->escapeHtml($row['enc_count']);?></label></td>
306                                 <td><label><?php echo $this->escapeHtml($row['ccda_transfer_count']);?></label></td>
307                                 <td><label><?php echo $this->escapeHtml($row['ccda_successfull_transfer_count']);?></label></td>
308                                 <td><label><?php echo $this->commonplugin->date_format($row['last_visit_date'], $GLOBALS['date_display_format'], 'yyyy-mm-dd');?></label></td>
309                                 <td nowrap>                                        
310                                         <input class="check_pid check_pid_<?php echo $this->escapeHtml($row['pid']);?>" type="checkbox" name="ccda_pid[]" value="<?php echo $this->escapeHtml($row['pid']);?>" <?php if($this->form_data['select_all'] ==1) echo "checked"; ?>>                                        
311                                 </td>
312                                 <td style="padding: 5px;">
313                                         <a href="<?php echo $this->basePath();?>/encounterccdadispatch/index?combination=<?php echo $this->escapeHtml($row['pid']);?>&view=1&recipient=self&param=<?php echo $_SESSION['authId'];?>" target="_blank" style="text-decoration: none;">
314                                                 <img style="height:20px; cursor: pointer;" src="<?php echo $this->basePath();?>/css/icons/view.png" title="<?php echo $this->listenerObject->z_xlt('View CCDA');?>">
315                                         </a>
316                                 </td>
317                             </tr>
318                         <?php
319                                 ?>
320                                 <tr>
321                                         <td colspan="9" id="hide_<?php echo $this->escapeHtml($row['pid']);?>" class="ccda_details" style="display: none;">
322                                                 <table style="width: 85% !important; margin-left: auto !important; margin-right: auto !important;">
323                                                         <tr class="se_in_9">
324                                                                 <th width="1%"><?php echo '#'; ?></th>
325                                                                 <th><label><?php echo $this->listenerObject->z_xlt('Encounter'); ?></label></th>
326                                                                 <th><label><?php echo $this->listenerObject->z_xlt('DOS'); ?></label></th>
327                                                                 <th><label><?php echo $this->listenerObject->z_xlt('Transferred Date'); ?></label></th>
328                                                                 <th><label><?php echo $this->listenerObject->z_xlt('Transferred By'); ?></label></th>
329                                                                 <th><label><?php echo $this->listenerObject->z_xlt('Status'); ?></label></th>
330                                                                 <th><label>&nbsp;</label></th>
331                                                         </tr>
332                                                         <?php
333                                                         $slno_sub   = 0;
334                                                         foreach($status_details[$row['pid']] as $row_status){
335                                                                 $slno_sub++;
336                                                                 ?>
337                                                                 <tr>
338                                                                         <td><?php echo $slno_sub;?>)</td>
339                                                                         <td><?php echo $this->escapeHtml($row_status['encounter']);?></td>
340                                                                         <td><?php echo $this->commonplugin->date_format($row_status['dos'], $GLOBALS['date_display_format'], 'yyyy-mm-dd');?></td>
341                                                                         <td><?php echo $this->commonplugin->date_format(date('Y-m-d H:i:s',$row_status['time']), $GLOBALS['date_display_format'], 'yyyy-mm-dd');?></td>
342                                                                         <td><?php echo ($row_status['user_id'] == 'Scheduler' ? $this->listenerObject->z_xlt('Auto Transfer') : $this->escapeHtml($row_status['user_name']));?></td>
343                                                                         <td>
344                                                                                 <?php
345                                                                                 if($row_status['emr_transfer'] == 1)
346                                                                                         echo $this->listenerObject->z_xlt($status_title[2]);
347                                                                                 else {
348                                                                                   if($row_status['view'] == 1)
349                                                                                           echo $this->listenerObject->z_xlt($status_title[3]);
350                                                                                   else
351                                                                                           echo $this->listenerObject->z_xlt($status_title[$row_status['status']]);
352                                                                                 }
353                                                                                 ?>
354                                                                                 </td>
355                                                                         <td title="<?php echo $this->listenerObject->z_xlt('Download CCDA file');?>">
356                                                                                 <a target="_blank" href="<?php echo $this->basePath();?>/encountermanager/download?id=<?php echo $this->escapeHtml($row_status['id']);?>">
357                                                                                         <img src="<?php echo $this->basePath();?>/css/icons/request.png" width="17px">
358                                                                                 </a>
359                                                                         </td>
360                                                                 </tr>
361                                                                 <?php                                                        
362                                                         }
363                                                         ?>
364                                                 </table>
365                                         </td>
366                                 </tr>
367                                         <?php                                
368                     }
369                     ?>
370                 </table>
371                 <div style="width: 60%; margin-left: auto; margin-right: auto; border: 1px solid #CCCCCC; text-align:center; padding: 30px; font-size: 15px; font-weight: bold; background: #f7f7f7;<?php if(count($this->details) > 0){ ?>display: none; <?php } ?>">
372                         <?php echo $this->listenerObject->z_xlt('Nothing to display');?>
373                 </div>
374             </div>   
375             <!-- body contents  -->
376         </div><!-- body_inner_wrapper -->
377         <input type="hidden" name="form_current_page" id="form_current_page" value="<?php echo $this->escapeHtml($this->form_data['current_page']);?>" />
378         <input type="hidden" name="form_total_pages" id="form_total_pages" value="<?php echo $this->escapeHtml($this->form_data['total_pages']);?>" />
379         <input type="hidden" name="form_count" id="form_count" value="<?php echo $this->escapeHtml($this->form_data['res_count']);?>" />
380         <input type="hidden" name="form_expand_all" id="form_expand_all" value="<?php echo $this->escapeHtml($this->form_data['expand_all']);?>" />
381         <input type="hidden" name="form_sl_no" id="form_sl_no" value="<?php echo $slno;?>" />
382         <input type="hidden" name="form_new_search" id="form_new_search" value="" />
383         </form>
384       </div>
385             <!-- --> 
386           </div>
387           </div><!-- Immunization Tab -->
388           <div class="child-tab-2 child-all">
389                 <iframe id="immunization_iframe" border="0" width="100%" src="" data-src="<?php echo $GLOBALS['web_root']?>/interface/modules/zend_modules/public/immunization/index"></iframe>               
390           </div><!-- Syndromic Surveillance Tab -->
391           <div class="child-tab-3 child-all">
392                 <iframe id="syndromicsurveillance_iframe" border="0" width="100%" src="" data-src="<?php echo $GLOBALS['web_root']?>/interface/modules/zend_modules/public/syndromicsurveillance/index"></iframe>
393             </div><!-- third tab -->
394         <div class="main-tab-2 main-all" style="display: none;">
395             <ul class="child-tab-head-import">
396                 <li class="child_active"><?php echo $this->listenerObject->z_xlt('CCD');?></li>
397                 <li><?php echo $this->listenerObject->z_xlt('CCR');?></li>
398                 <li><?php echo $this->listenerObject->z_xlt('CCDA');?></li>                
399           </ul><div class="clear"></div>
400                 <!--CCD Tab-->
401           <div class="import-child-tab-1 child-all-import">
402                <iframe id="ccd_iframe" border="0" width="100%" src="" data-src="<?php echo $GLOBALS['web_root']?>/interface/modules/zend_modules/public/ccd/upload"></iframe>
403            </div>
404                 <!--CCR Tab-->
405           <div class="import-child-tab-2 child-all-import">
406                 <iframe id="ccr_iframe" border="0" width="100%" src="" data-src="<?php echo $GLOBALS['web_root']?>/interface/modules/zend_modules/public/ccr/index"></iframe>
407           </div>
408                 <!--CCDA Tab-->
409           <div class="import-child-tab-3 child-all-import">
410                 <iframe id="ccda_iframe" border="0" width="100%" src="" data-src="<?php echo $GLOBALS['web_root']?>/interface/modules/zend_modules/public/carecoordination/upload?id=1"></iframe>
411            </div>                
412         </div> 
413         <div class="clear"></div>
414     </div> <!-- New Wrapper ends-->