3 # Resolve href for return button
5 if(isset($HTTP_SESSION_VARS['sess_file_return'])&&!empty($HTTP_SESSION_VARS['sess_file_return']))
6 $returnfile=$HTTP_SESSION_VARS['sess_file_return'];
7 else $returnfile=$top_dir.'show_appointment.php';
11 $retbuf='&encounter_nr='.$HTTP_SESSION_VARS['sess_full_en'];
12 $sTitleNr =($HTTP_SESSION_VARS['sess_full_en']);
14 $retbuf='&pid='.$HTTP_SESSION_VARS['sess_pid'];
15 $sTitleNr =($HTTP_SESSION_VARS['sess_full_pid']);
18 # Resolve href for close button
20 if($HTTP_COOKIE_VARS["ck_login_logged".$sid]) $breakfilen = $root_path."main/startframe.php".URL_APPEND
;
21 else $breakfile = $breakfile.URL_APPEND
."&target=entry";
23 # Start Smarty templating here
27 # Note: it is advisable to load this after the inc_front_chain_lang.php so
28 # that the smarty script can use the user configured template theme
30 require_once($root_path.'gui/smarty_template/smarty_care.class.php');
31 $smarty = new smarty_care('common');
33 # Title in the toolbar
34 $smarty->assign('sToolbarTitle',"$page_title ($sTitleNr)");
36 $smarty->assign('breakfile',$breakfile);
39 $smarty->assign('title',"$page_title ($sTitleNr)");
41 # href for help button
42 $smarty->assign('pbHelp',"javascript:gethelp('notes_router.php','$notestype','".strtr($subtitle,' ','+')."','$mode','$rows')");
44 # Onload Javascript code
45 $smarty->assign('sOnLoadJs','onLoad="if (window.focus) window.focus();"');
47 # href for the return button
48 $smarty->assign('pbBack',$returnfile.URL_APPEND
.$retbuf.'&target='.$target.'&mode=show&type_nr='.$type_nr);
51 * Helper function to generate rows
53 function createTR($ld_text, $input_val, $colspan = 1)
55 global $toggle, $root_path;
59 <td bgColor
="#eeeeee" ><FONT SIZE
=-1 FACE
="Arial,verdana,sans serif"><?php
echo $ld_text ?
>:
61 <td colspan
=<?php
echo $colspan; ?
> bgcolor
="#ffffee"><FONT SIZE
=-1 FACE
="Arial,verdana,sans serif"><?php
echo $input_val; ?
>
70 # Collect extra javascript code
76 <script language
="javascript">
79 function popRecordHistory(table
,pid
) {
80 urlholder
="./record_history.php<?php echo URL_REDIRECT_APPEND; ?>&table="+table+
"&pid="+pid
;
81 HISTWIN
<?php
echo $sid ?
>=window
.open(urlholder
,"histwin<?php echo $sid ?>","menubar=no,width=400,height=550,resizable=yes,scrollbars=yes");
83 function popNotesDetails(n
,t
) {
84 urlholder
="./show_notes_details.php<?php echo URL_REDIRECT_APPEND; ?>&nr="+n+
"&title="+t+
"&ln=<?php echo $name_last ?>&fn=<?php echo $name_first ?>&bd=<?php echo $date_birth ?>";
85 HISTWIN
<?php
echo $sid ?
>=window
.open(urlholder
,"histwin<?php echo $sid ?>","menubar=no,width=400,height=550,resizable=yes,scrollbars=yes");
88 <?php
require($root_path.'include/inc_checkdate_lang.php'); ?
>
93 //gjergji : new calendar
94 require_once ('../../js/jscalendar/calendar.php');
95 $calendar = new DHTML_Calendar('../../js/jscalendar/', $lang, 'calendar-system', true);
96 $calendar->load_files();
100 if($parent_admit) include($root_path.'include/inc_js_barcode_wristband_popwin.php');
102 $sTemp = ob_get_contents();
106 $smarty->append('JavaScript',$sTemp);
110 $tab_bot_line='#66ee66';
111 include('./gui_bridge/default/gui_tabs_patadmit.php');
112 $smarty->assign('sTabsFile','registration_admission/admit_tabs.tpl');
113 $smarty->assign('sClassItem','class="adm_item"');
114 $smarty->assign('sClassInput','class="adm_input"');
116 $tab_bot_line='#66ee66';
117 include('./gui_bridge/default/gui_tabs_patreg.php');
118 $smarty->assign('sTabsFile','registration_admission/reg_tabs.tpl');
119 $smarty->assign('sClassItem','class="reg_item"');
120 $smarty->assign('sClassInput','class="reg_input"');
123 # If encounter is already discharged, show warning
125 if($parent_admit&&$is_discharged){
127 $smarty->assign('is_discharged',TRUE);
128 $smarty->assign('sWarnIcon',"<img ".createComIcon($root_path,'warn.gif','0','absmiddle').">");
129 if($current_encounter) $smarty->assign('sDischarged',$LDEncounterClosed);
130 else $smarty->assign('sDischarged',$LDPatientIsDischarged);
133 if($parent_admit) $smarty->assign('LDCaseNr',$LDAdmitNr);
134 else $smarty->assign('LDCaseNr',$LDRegistrationNr);
136 if($parent_admit) $smarty->assign('sEncNrPID',$HTTP_SESSION_VARS['sess_full_en']);
137 else $smarty->assign('sEncNrPID',$HTTP_SESSION_VARS['sess_full_pid']);
139 $smarty->assign('img_source',"<img $img_source>");
141 $smarty->assign('LDTitle',$LDTitle);
142 $smarty->assign('title',$title);
143 $smarty->assign('LDLastName',$LDLastName);
144 $smarty->assign('name_last',$name_last);
145 $smarty->assign('LDFirstName',$LDFirstName);
146 $smarty->assign('name_first',$name_first);
148 # If person is dead show a black cross and assign death date
150 if($death_date && $death_date != DBF_NODATE
){
151 $smarty->assign('sCrossImg','<img '.createComIcon($root_path,'blackcross_sm.gif','0').'>');
152 $smarty->assign('sDeathDate',@formatDate2Local
($death_date,$date_format));
155 # Set a row span counter, initialize with 7
158 if($GLOBAL_CONFIG['patient_name_2_show']&&$name_2){
159 $smarty->assign('LDName2',$LDName2);
160 $smarty->assign('name_2',$name_2);
164 if($GLOBAL_CONFIG['patient_name_3_show']&&$name_3){
165 $smarty->assign('LDName3',$LDName3);
166 $smarty->assign('name_3',$name_3);
170 if($GLOBAL_CONFIG['patient_name_middle_show']&&$name_middle){
171 $smarty->assign('LDNameMid',$LDNameMid);
172 $smarty->assign('name_middle',$name_middle);
176 $smarty->assign('sRowSpan',"rowspan=\"$iRowSpan\"");
178 $smarty->assign('LDBday',$LDBday);
179 $smarty->assign('sBdayDate',@formatDate2Local
($date_birth,$date_format));
181 $smarty->assign('LDSex',$LDSex);
182 if($sex=='m') $smarty->assign('sSexType',$LDMale);
183 elseif($sex=='f') $smarty->assign('sSexType',$LDFemale);
185 $smarty->assign('LDBloodGroup',$LDBloodGroup);
187 $buf='LD'.$blood_group;
188 $smarty->assign('blood_group',$
$buf);
191 # Assign common element names
193 $smarty->assign('LDDate',$LDDate);
194 $smarty->assign('LDBy',$LDBy);
197 # If mode is to show the data
201 if($parent_admit) $bgimg='tableHeaderbg3.gif';
202 else $bgimg='tableHeader_gr.gif';
203 $tbg= 'background="'.$root_path.'gui/img/common/'.$theme_com_icon.'/'.$bgimg.'"';
205 $smarty->assign('subtitle',$subtitle);
206 $smarty->assign('LDDetails',$LDDetails);
209 $smarty->assign('parent_admit',TRUE);
210 $smarty->assign('LDEncounterNr',$LDEncounterNr);
213 # Start displaying the data in a list using the "report_row.tpl" template
218 while($row=$result->FetchRow()){
220 $sRowClass = 'class="wardlistrow2"';
222 $sRowClass = 'class="wardlistrow1"';
226 $smarty->assign('sRowClass',$sRowClass);
228 if(!empty($row['date'])) $smarty->assign('sDate',@formatDate2Local
($row['date'],$date_format));
232 if(!empty($row['notes'])) $sTemp = hilite(substr($row['notes'],0,$GLOBAL_CONFIG['notes_preview_maxlen']));
233 if (strlen($row['notes']) > $GLOBAL_CONFIG['notes_preview_maxlen']) $sTemp = $sTemp.' [...]';
234 $sTemp = $sTemp.'<br>';
235 if(!empty($row['short_notes'])) $sTemp = $sTemp.'[ '.hilite($row['short_notes']).' ]';
236 $smarty->assign('sPreview',$sTemp);
238 # Link to pdf generator
239 $topdf= '<a href="'.$root_path.'modules/pdfmaker/emr_generic/report.php'.URL_APPEND
.'&enc='.$row['encounter_nr'].'&recnr='.$row['nr'].'&type_nr='.$this_type['nr'].'&LD_var='.$this_type['LD_var'].'" target=_blank><img '.createComIcon($root_path,'pdf_icon.gif','0','',TRUE).'></a>';
241 if (strlen($row['notes']) > $GLOBAL_CONFIG['notes_preview_maxlen']){
242 $smarty->assign('sDetails','<a href="javascript:popNotesDetails(\''.$row['nr'].'\',\''.strtr($subtitle,"' ","´+").'\',\''.$this_type['LD_var'].'\')"><img '.createComIcon($root_path,'info3.gif','0','',TRUE).'></a>');
244 $smarty->assign('sMakePdf',$topdf);
245 }elseif(!empty($row['notes'])){
246 $smarty->assign('sMakePdf',$topdf);
249 if($row['personell_name']) $smarty->assign('sAuthor',$row['personell_name']);
252 $smarty->assign('sEncNr','<a href="aufnahme_daten_zeigen.php'.URL_APPEND
.'&encounter_nr='.$row['encounter_nr'].'&origin=patreg_reg">'.$row['encounter_nr'].'</a>');
254 # buffer the row and assign to array
256 $smarty->display('registration_admission/report_row.tpl');
257 $sRows = $sRows.ob_get_contents();
260 $smarty->assign('sReportRows',$sRows);
263 # Else prompt no data available yet.
265 $smarty->assign('bShowNoRecord',TRUE);
266 $smarty->assign('sMascotImg','<img '.createMascot($root_path,'mascot1_r.gif','0','absmiddle').'>');
267 $smarty->assign('norecordyet',$norecordyet);
272 # Else, mode is new data entry. Show the entry form
274 $smarty->assign('bShowEntryForm',TRUE);
275 $smarty->assign('bSetAsForm',TRUE);
277 # collect Javascript for the form
283 <script language
="JavaScript">
285 function chkform(d
) {
286 if(d
.date
.value
==""){
287 alert("<?php echo $LDPlsEnterDate; ?>");
290 }else if(d
.notes
.value
==""){
291 alert("<?php echo $LDPlsEnterReport; ?>");
294 }else if(d
.personell_name
.value
==""){
295 alert("<?php echo $LDPlsEnterFullName; ?>");
296 d
.personell_name
.focus();
307 $sTemp = ob_get_contents();
310 $smarty->assign('sFormJavaScript',$sTemp);
312 //gjergji : new calendar
313 $smarty->assign('sDateMiniCalendar',$calendar->show_calendar($calendar,$date_format,'date'));
316 $smarty->assign('LDNotes',$LDApplication.' '.$LDNotes);
317 $smarty->assign('sNotesInput','<textarea name="notes" cols=40 rows=8 wrap="virtual"></textarea>');
318 $smarty->assign('LDShortNotes',$LDShortNotes);
319 $smarty->assign('sShortNotesInput','<input type="text" name="short_notes" size=50 maxlength=25>');
320 $smarty->assign('LDSendCopyTo',$LDSendCopyTo);
321 $smarty->assign('sSendCopyInput','<input type="text" name="send_to_name" size=50 maxlength=60>');
323 $smarty->assign('sAuthorInput','<input type="text" name="personell_name" size=50 maxlength=60 value="'.$HTTP_SESSION_VARS['sess_user_name'].'" readonly>');
326 $sTemp = '<input type="hidden" name="encounter_nr" value="'.$HTTP_SESSION_VARS['sess_en'].'">
327 <input type="hidden" name="pid" value="'.$HTTP_SESSION_VARS['sess_pid'].'">
328 <input type="hidden" name="modify_id" value="'.$HTTP_SESSION_VARS['sess_user_name'].'">
329 <input type="hidden" name="create_id" value="'.$HTTP_SESSION_VARS['sess_user_name'].'">
330 <input type="hidden" name="create_time" value="null">
331 <input type="hidden" name="mode" value="create">
332 <input type="hidden" name="personell_nr">
333 <input type="hidden" name="send_to_pid">
334 <input type="hidden" name="type_nr" value="'.$type_nr.'">
335 <input type="hidden" name="target" value="'.$target.'">
336 <input type="hidden" name="history" value="Created: '.date('Y-m-d H:i:s').' : '.$HTTP_SESSION_VARS['sess_user_name']."\n".'">';
338 $smarty->assign('sHiddenInputs',$sTemp);
340 $smarty->assign('pbSubmit','<input type="image" '.createLDImgSrc($root_path,'savedisc.gif','0').'>');
344 $smarty->assign('sBackIcon','<img '.createComIcon($root_path,'l-arrowgrnlrg.gif','0','absmiddle').'>');
346 if($parent_admit) $buf='&encounter_nr='.$HTTP_SESSION_VARS['sess_full_en'];
347 else $buf='&pid='.$HTTP_SESSION_VARS['sess_full_pid'];
349 $smarty->assign('sBackLink','<a href="'.$returnfile.URL_APPEND
.$buf.'&target='.$target.'&mode=show&type_nr='.$type_nr.'">'.$LDBackToOptions.'</a>');
351 # Type nr 3 = discharge summary/notes
352 # Type nr 99 = auxilliary notes
354 if($parent_admit&&(!$is_discharged||
$type_nr==3||
$type_nr==99)) {
356 $smarty->assign('sNewRecIcon','<img '.createComIcon($root_path,'bul_arrowgrnlrg.gif','0','absmiddle').'>');
357 $smarty->assign('sNewRecLink','<a href="'.$thisfile.URL_APPEND
.'&pid='.$HTTP_SESSION_VARS['sess_pid'].'&target='.$target.'&mode=new&type_nr='.$type_nr.'">'.$LDEnterNewRecord.'</a>');
360 // Buffer the options table
365 <!- Column
for the options table
-->
366 <!-- Load the options table
-->
368 <div
class="vi_data">
369 <img
<?php
echo createComIcon($root_path,'angle_left_s.gif',0); ?
>>
371 <?php
echo "$LDNotes $LDAndSym $LDReports $LDTypes" ?
>
374 <!-- Reports
/Notes types table
-->
376 <TABLE cellSpacing
=0 cellPadding
=0 class="frame" border
=0>
380 <TABLE cellSpacing
=1 cellPadding
=2 border
=0>
381 <TBODY
class="submenu" >
383 while(list($x,$v)=each($types)){
389 # Type nr 3 = discharge summary/notes
390 # Type nr 99 = auxilliary notes
392 if($parent_admit&&(!$is_discharged||
$v['nr']==3||
$v['nr']==99)) echo createComIcon($root_path,'comments.gif','0');
393 else echo createComIcon($root_path,'docu_unrd.gif','0');
397 <a href
="show_notes.php<?php echo URL_APPEND ?>&pid=<?php echo $pid ?>&target=<?php echo $target ?>&type_nr=<?php echo $v['nr'] ?>">
399 if(isset($
$v['LD_var'])&&!empty($
$v['LD_var'])) echo $
$v['LD_var']; else echo $v['name']
410 <img
<?php
echo createComIcon($root_path,'icon_acro.gif','0');?
>>
413 <a href
="<?php echo $root_path."modules
/pdfmaker
/emr_generic
/report_all
.php
".URL_APPEND."&enc
=".$HTTP_SESSION_VARS['sess_en']; ?>" target
=_blank
>
415 echo $LDPrintPDFDocAllReport;
433 <!-- End of main data block table
-->
439 $sTemp = ob_get_contents();
442 $smarty->assign('sOptionsMenu',$sTemp);
444 # Now buffer the bottom controls
449 include('./include/bottom_controls_admission_options.inc.php');
451 include('./include/bottom_controls_registration_options.inc.php');
454 $sTemp = ob_get_contents();
457 $smarty->assign('sBottomControls',$sTemp);
459 $smarty->assign('pbCancel','<a href="'.$returnfile.URL_APPEND
.$buf.'&target='.$target.'&mode=show&type_nr='.$type_nr.'"><img '.createLDImgSrc($root_path,'cancel.gif','0').' alt="'.$LDCancelClose.'"></a>');
461 $smarty->assign('sMainBlockIncludeFile','registration_admission/common_report.tpl');
463 $smarty->display('common/mainframe.tpl');