- modules/fotolab updated imagej to current version & some cod fixes to make it work
[care2x.git] / Care2007 / modules / registration_admission / show_sick_confirm.php
blob1b7b8b04317dc1b5dc4406e346b2fac70003f6d1
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
14 $logo_ht_limit=50; # Maximum deparment logo�s height in pixels
16 # Load the encounter class
17 require_once($root_path.'include/care_api_classes/class_encounter.php');
18 $enc_obj=new Encounter($HTTP_SESSION_VARS['sess_full_en']);
19 $thisfile=basename(__FILE__);
21 if(!isset($mode)||empty($mode)){
23 $sickconfirm_obj=&$enc_obj->allSicknessConfirm();
24 if($rows=$enc_obj->LastRecordCount()){
25 $mode='show';
26 # If $get_nr is non-empty, get the single record
27 if(isset($get_nr)&&$get_nr){
28 if(!$single_obj=&$enc_obj->getSicknessConfirm($get_nr)) $get_nr=0;
29 }else{
30 $get_nr=0;
32 }else{
33 $mode='';
36 }elseif($mode=='create'||$mode=='update') {
37 //$db->debug=true;
38 include_once($root_path.'include/inc_date_format_functions.php');
39 # Convert date to standard format
40 $HTTP_POST_VARS['date_end']=formatDate2STD($HTTP_POST_VARS['date_end'],$date_format);
41 $HTTP_POST_VARS['date_start']=formatDate2STD($HTTP_POST_VARS['date_start'],$date_format);
42 $HTTP_POST_VARS['date_confirm']=formatDate2STD($HTTP_POST_VARS['date_confirm'],$date_format);
44 $HTTP_POST_VARS['encounter_nr']=$HTTP_SESSION_VARS['sess_en'];
45 $HTTP_POST_VARS['history']="Create ".date('Y-m-d H:i:s')." ".$HTTP_SESSION_VARS['sess_user_name']."\n";
46 $HTTP_POST_VARS['modify_id']=$HTTP_SESSION_VARS['sess_user_name'];
47 $HTTP_POST_VARS['create_id']=$HTTP_SESSION_VARS['sess_user_name'];
48 $HTTP_POST_VARS['create_time']=date('YmdHis');
51 if($enc_obj->saveSicknessConfirm($HTTP_POST_VARS)) {
52 $get_nr=$db->Insert_ID();
53 header("location:".$thisfile.URL_REDIRECT_APPEND."&get_nr=$get_nr&dept_nr=$dept_nr&target=$target&type_nr=$type_nr&pid=".$HTTP_SESSION_VARS['sess_pid']);
54 exit;
55 } else echo "$obj->sql<br>$LDDbNoSave";
58 if($mode=='new'){
59 # Load the department class
60 include_once($root_path.'include/care_api_classes/class_department.php');
61 $dept_obj=new Department($dept_nr);
62 $dept=&$dept_obj->getDeptAllInfo($dept_nr);
64 # Get the insurance data of the encounter
65 if($insure_obj=$enc_obj->EncounterInsuranceData()){
66 $insurance=$insure_obj->FetchRow();
67 }else{
68 $insurance=false;
71 $lang_tables=array('departments.php','legal.php','prompt.php');
72 require('./include/init_show.php');
74 $subtitle=$LDSickReport;
75 $notestype='sickness';
77 $buffer=str_replace('~tag~',$title.' '.$name_last,$LDNoRecordFor);
78 $norecordyet=str_replace('~obj~',strtolower($subtitle),$buffer);
79 $HTTP_SESSION_VARS['sess_file_return']=$thisfile;
81 /* Load all medical depts info */
82 require_once($root_path.'include/care_api_classes/class_department.php');
83 $dept_obj=new Department;
84 $dept_med=$dept_obj->getAllMedical();
86 /* Load GUI page */
87 require('./gui_bridge/default/gui_show.php');