2 //error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR);
3 require('./roots.php');
4 require($root_path.'include/inc_environment_global.php');
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
11 * See the file "copy_notice.txt" for the licence notice
16 $thisfile=basename(__FILE__
);
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'];
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');
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']."
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";
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();
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);
69 require('./gui_bridge/default/gui_show.php');