function insert_prescription($encounter_nr, $drug_list_id, $type) { global $db; global $is_transmit_to_weberp_enable; $enc_obj = new Encounter(); $diag_obj_sub = new Diagnostics(); $diag_obj = new Diagnostics(); $drg_obj = new DrugsAndServices(); $debug = true; $debug ? $db->debug = TRUE : ($db->debug = FALSE); if ($debug) { echo "class prescription::insert_prescription({$encounter_nr}, {$drug_list_id}, {$type})<br>"; } $enc_class = $enc_obj->EncounterClass($encounter_nr); if ($enc_class == 2) { $class = 1; } else { $class = 0; } $this->sql = "INSERT INTO `care_encounter_prescription` ( " . "\t\t\t" . "\t\t\t`encounter_nr` , " . "\t\t\t`prescription_type_nr` , " . "\t\t\t`article` , " . "\t\t\t`article_item_number` , " . "\t\t\t`price` , " . "\t\t\t`drug_class` , " . "\t\t\t`order_nr` , " . "\t\t\t`dosage` , " . "\t\t\t`times_per_day` , " . "\t\t\t`days` , " . "\t\t\t`application_type_nr` , " . "\t\t\t`notes` , " . "\t\t\t`prescribe_date` , " . "\t\t\t`prescriber` , " . "\t\t\t`color_marker` , " . "\t\t\t`is_stopped` , " . "\t\t\t`is_outpatient_prescription` , " . "\t\t\t`is_disabled` , " . "\t\t\t`stop_date` , " . "\t\t\t`status` , " . "\t\t\t`history` , " . "\t\t\t`bill_number` , " . "\t\t\t`bill_status` , " . "\t\t\t`modify_id` , " . "\t\t\t`modify_time` , " . "\t\t\t`create_id` , " . "\t\t\t`create_time` )" . "VALUES (" . "\t\t\t" . "\t\t\t'" . $encounter_nr . "', " . "\t\t\t'" . $this->GetClassOfItem($this->GetItemNumberByID($drug_list_id)) . "', " . "\t\t\t'" . $this->GetNameOfItem($this->GetItemNumberByID($drug_list_id)) . "', " . "\t\t\t'" . $drug_list_id . "', " . "\t\t\t'" . $this->GetPriceOfItem($this->GetItemNumberByID($drug_list_id)) . "', " . "\t\t\t'" . $this_obj->GetClassOfItem($this->getItemNumberByID($drug_list_id)) . "', " . "\t\t\t'01', " . "\t\t\t'1', " . "\t\t\t'1', " . "\t\t\t'1', " . "\t\t\t'01', " . "\t\t\t'0', " . "\t\t\tNOW(), " . "\t\t\t'" . $enc_obj->ConsultingDr($encounter_nr) . "', " . "\t\t\t'1', " . "\t\t\t'0', " . "\t\t\t'" . $class . "', " . "\t\t\tNULL , " . "\t\t\tNULL , " . "\t\t\t'pending', " . "\t\t\t'Create: '" . date('Y-m-d H:i:s') . "' = '" . $_SESSION['sess_user_name'] . "'\n' , " . "\t\t\t'0', " . "\t\t\t'', " . "\t\t\t'', " . "\t\t\t'0000-00-00 00:00:00', " . "\t\t\t'" . $_SESSION['sess_user_name'] . "', " . "\t\t\t NOW() )"; if ($debug) { echo $this->sql; } $db->Execute($this->sql); if ($is_transmit_to_weberp_enable == 1) { $this->sql = 'select max(nr) from care_encounter_prescription where encounter_nr="' . $encounter_nr . '"'; $result = $db->Execute($this->sql); $WONumberArray = $result->FetchRow(); $WONumber = $WONumberArray[0]; $weberp_obj = new_weberp(); $weberp_obj->make_patient_workorder_in_webERP($WONumber); // $weberp_obj->issue_to_patient_workorder_in_weberp($WONumber, $StockID, $Location, $Quantity, $Batch); weberp_destroy($weberp_obj); } return TRUE; }
color="#000000" size=2> <?php echo $batch_nr; ?> </td> <td width="25%" align="right" border="1"> <?php $user = $_SESSION['sess_user_name']; ?> </font> <font size=1 color="purple" face="verdana,arial"><?php echo $LDDoctorRequest; ?> </font><font color="#000000" size=2> <?php echo $enc_obj->ConsultingDr($pn); ?> </font> </td> </tr> </tbody> </table> </td> <td> </td> </tr> </table>