- modules/fotolab updated imagej to current version & some cod fixes to make it work
[care2x.git] / Care2007 / modules / registration_admission / patient_register_show.php
blob8abf75ac9980a1e58204ae2e0b41387ca2984753
1 <?php
2 //error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR);
3 require('./roots.php');
4 require($root_path.'include/inc_environment_global.php');
5 /**
6 * CARE2X Integrated Hospital Information System beta 2.0.1 - 2004-07-04
7 * GNU General Public License
8 * Copyright 2002,2003,2004,2005,2006 Elpidio Latorilla
9 * elpidio@care2x.org,
11 * See the file "copy_notice.txt" for the licence notice
13 $lang_tables[]='prompt.php';
14 $lang_tables[]='person.php';
15 define('LANG_FILE','aufnahme.php');
16 $local_user='aufnahme_user';
17 require_once($root_path.'include/inc_front_chain_lang.php');
19 $thisfile=basename(__FILE__);
20 //$breakfile='patient.php';
22 if($HTTP_COOKIE_VARS["ck_login_logged".$sid]) $breakfile=$root_path."main/startframe.php".URL_APPEND;
23 else $breakfile="patient.php".URL_APPEND."&target=entry";
25 $admissionfile='aufnahme_start.php'.URL_APPEND;
27 # Resolve PID
28 if((!isset($pid)||!$pid)&&$HTTP_SESSION_VARS['sess_pid']) $pid=$HTTP_SESSION_VARS['sess_pid'];
30 # Save session data
31 $HTTP_SESSION_VARS['sess_path_referer']=$top_dir.$thisfile;
32 $HTTP_SESSION_VARS['sess_file_return']=$thisfile;
33 $HTTP_SESSION_VARS['sess_pid']=$pid;
34 //$HTTP_SESSION_VARS['sess_full_pid']=$pid+$GLOBAL_CONFIG['person_id_nr_adder'];
35 $HTTP_SESSION_VARS['sess_parent_mod']='registration';
36 $HTTP_SESSION_VARS['sess_user_origin']='registration';
37 # Reset the encounter number
38 $HTTP_SESSION_VARS['sess_en']=0;
40 # Create the person show GUI
41 require_once($root_path.'include/care_api_classes/class_gui_person_show.php');
42 $person = & new GuiPersonShow;
44 # Set PID to load the data
45 $person->setPID($pid);
47 # Import the current encounter number
48 $current_encounter = $person->CurrentEncounter();
50 # Import the death date
51 $death_date = $person->DeathDate();
53 # Load GUI page
54 //include('./gui_bridge/default/gui_person_reg_show.php');
56 # Start Smarty templating here
57 /**
58 * LOAD Smarty
60 # Note: it is advisable to load this after the inc_front_chain_lang.php so
61 # that the smarty script can use the user configured template theme
63 require_once($root_path.'gui/smarty_template/smarty_care.class.php');
64 $smarty = new smarty_care('common');
66 # Title in the toolbar
67 $smarty->assign('sToolbarTitle',$LDPatientRegister);
69 # href for help button
70 $smarty->assign('pbHelp',"javascript:gethelp('submenu1.php','$LDPatientRegister')");
72 $smarty->assign('breakfile',$breakfile);
74 # Window bar title
75 $smarty->assign('title',$LDPatientRegister);
77 # Onload Javascript code
78 $smarty->assign('sOnLoadJs',"if (window.focus) window.focus();");
80 # href for help button
81 $smarty->assign('pbHelp',"javascript:gethelp('person_admit.php')");
83 # Hide the return button
84 $smarty->assign('pbBack',FALSE);
86 # Loads the standard gui tags for the registration display page
87 require('./gui_bridge/default/gui_std_tags.php');
89 # Collect additional javascript code
90 ob_start();
93 <script language="javascript">
94 <!--
95 <?php require($root_path.'include/inc_checkdate_lang.php'); ?>
97 function popRecordHistory(table,pid) {
98 urlholder="./record_history.php<?php echo URL_REDIRECT_APPEND; ?>&table="+table+"&pid="+pid;
99 HISTWIN<?php echo $sid ?>=window.open(urlholder,"histwin<?php echo $sid ?>","menubar=no,width=400,height=550,resizable=yes,scrollbars=yes");
102 </script>
104 <?php
106 $sTemp = ob_get_contents();
107 ob_end_clean();
109 # Append the extra javascript to JavaScript block
110 $smarty->append('JavaScript',$sTemp);
112 # Load the tabs
113 $tab_bot_line='#66ee66';
114 require('./gui_bridge/default/gui_tabs_patreg.php');
116 # Display the data
117 $sRegForm = $person->create();
119 $smarty->assign('sRegForm',$sRegForm);
121 # Load and display the options table
122 ob_start();
123 require('./gui_bridge/default/gui_patient_reg_options.php');
124 $sTemp = ob_get_contents();
125 ob_end_clean();
127 $smarty->assign('sRegOptions',$sTemp);
129 # If the data is not new , show new search button
131 if (!$newdata) {
133 if($target=="search") $newsearchfile='patient_register_search.php'.URL_APPEND;
134 else $newsearchfile='patient_register_archive.php'.URL_APPEND;
136 $smarty->assign('pbNewSearch',"<a href=\"$newsearchfile\"><img ".createLDImgSrc($root_path,'new_search.gif','0','absmiddle')."></a>");
139 $smarty->assign('pbUpdateData',"<a href=\"patient_register.php".URL_APPEND."&pid=$pid&update=1\"><img ".createLDImgSrc($root_path,'update_data.gif','0','absmiddle')."></a>");
141 # If currently admitted show button link to admission data display
142 if($current_encounter){
144 $smarty->assign('pbShowAdmData',"<a href=\"aufnahme_daten_zeigen.php".URL_APPEND."&encounter_nr=$current_encounter&origin=patreg_reg\"><img ".createLDImgSrc($root_path,'admission_data.gif','0','absmiddle')."></a>");
146 # Else if person still living, show button links to admission
147 }elseif(!$death_date||$death_date==$dbf_nodate){
149 $smarty->assign('pbAdmitInpatient',"<a href=\"$admissionfile&pid=$pid&origin=patreg_reg&encounter_class_nr=1\"><img ".createLDImgSrc($root_path,'admit_inpatient.gif','0','absmiddle')."></a>");
150 $smarty->assign('pbAdmitOutpatient',"<a href=\"$admissionfile&pid=$pid&origin=patreg_reg&encounter_class_nr=2\"><img ".createLDImgSrc($root_path,'admit_outpatient.gif','0','absmiddle')."></a>");
153 # Create new button to fresh input form
154 $sNewRegBuffer='
155 <form action="patient_register.php" method=post>
156 <input type=submit value="'.$LDRegisterNewPerson.'">
157 <input type=hidden name="sid" value="'.$sid.'">
158 <input type=hidden name="lang" value="'.$lang.'">
159 </form>';
161 $smarty->assign('pbRegNewPerson',$sNewRegBuffer);
163 # Assign help links
164 $smarty->assign('sSearchLink','<img '.createComIcon($root_path,'varrow.gif','0').'> <a href="patient_register_search.php'.URL_APPEND.'">'.$LDPatientSearch.'</a>');
165 $smarty->assign('sArchiveLink','<img '.createComIcon($root_path,'varrow.gif','0').'> <a href="patient_register_archive.php'.URL_APPEND.'&newdata=1&from=entry">'.$LDArchive.'</a>');
167 $sCancel="<a href=";
168 if($HTTP_COOKIE_VARS['ck_login_logged'.$sid]) $sCancel.=$breakfile;
169 else $sCancel.='aufnahme_pass.php';
170 $sCancel.=URL_APPEND.'><img '.createLDImgSrc($root_path,'cancel.gif','0').' alt="'.$LDCancelClose.'"></a>';
172 $smarty->assign('pbCancel',$sCancel);
174 # Assign the page template to mainframe block
175 $smarty->assign('sMainBlockIncludeFile','registration_admission/reg_show.tpl');
177 # Show main frame
178 $smarty->display('common/mainframe.tpl');