- modules/fotolab updated imagej to current version & some cod fixes to make it work
[care2x.git] / Care2007 / modules / registration_admission / show_prescription.php
blobb0c3a5907844ccae73d97bd69758e717e37e30cf
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 ///$db->debug=1;
16 $thisfile=basename(__FILE__);
17 if(!isset($mode)){
18 $mode='show';
19 } elseif($mode=='create'||$mode=='update') {
20 include_once($root_path.'include/care_api_classes/class_prescription.php');
21 if(!isset($obj)) $obj=new Prescription;
22 include_once($root_path.'include/inc_date_format_functions.php');
24 if($HTTP_POST_VARS['prescribe_date']) $HTTP_POST_VARS['prescribe_date']=@formatDate2STD($HTTP_POST_VARS['prescribe_date'],$date_format);
25 else $HTTP_POST_VARS['prescribe_date']=date('Y-m-d');
27 $HTTP_POST_VARS['create_id']=$HTTP_SESSION_VARS['sess_user_name'];
29 //$db->debug=true;
30 # Check the important items
31 if($article&&$dosage&&$application_type_nr&&$prescriber){
32 //include('./include/save_prescription.inc.php');
33 include('./include/save_admission_data.inc.php');
37 require('./include/init_show.php');
39 if($parent_admit){
40 $sql="SELECT pr.*, e.encounter_class_nr FROM care_encounter AS e, care_person AS p, care_encounter_prescription AS pr
41 WHERE p.pid=".$HTTP_SESSION_VARS['sess_pid']."
42 AND p.pid=e.pid
43 AND e.encounter_nr=".$HTTP_SESSION_VARS['sess_en']."
44 AND e.encounter_nr=pr.encounter_nr
45 ORDER BY pr.modify_time DESC";
46 }else{
47 $sql="SELECT pr.*, e.encounter_class_nr FROM care_encounter AS e, care_person AS p, care_encounter_prescription AS pr
48 WHERE p.pid=".$HTTP_SESSION_VARS['sess_pid']." AND p.pid=e.pid AND e.encounter_nr=pr.encounter_nr
49 ORDER BY pr.modify_time DESC";
53 if($result=$db->Execute($sql)){
54 $rows=$result->RecordCount();
55 }else{
56 echo $sql;
59 $subtitle=$LDPrescriptions;
60 $notestype='prescription';
62 $HTTP_SESSION_VARS['sess_file_return']=$thisfile;
64 $buffer=str_replace('~tag~',$title.' '.$name_last,$LDNoRecordFor);
65 $norecordyet=str_replace('~obj~',strtolower($subtitle),$buffer);
68 /* Load GUI page */
69 require('./gui_bridge/default/gui_show.php');