function ShowNewQuotations($in_outpatient, $sid) { global $db; $counter = 0; $color_change = FALSE; $this->debug = FALSE; $this->debug ? $db->debug = true : ($db->debug = FALSE); if ($this->debug) { echo "<br><b>Method class_tz_billing::ShowNewQuotations()</b><br>"; } if ($this->CreateTmpTableOfElementsToQuote(0, $in_outpatient)) { $result = $this->GetNewQuotationOverview(); } $ins_obj = new Insurance_tz(); // $result=$this->getNewQuotation_Prescriptions(0,$in_outpatient,$id_array); // $this->getNewQuotation_Laboratory(0,$in_outpatient,$id_array); // $this->getNewQuotation_Radiology(0,$in_outpatient,&$id_array); if ($result) { while ($row = $result->FetchRow()) { $counter++; if ($color_change) { $BGCOLOR = 'bgcolor="#ffffdd"'; $color_change = FALSE; } else { $BGCOLOR = 'bgcolor="#ffffaa"'; $color_change = TRUE; } if ($row['purchasing_class'] == 'xray') { $createmode = 'radiology'; } if ($row['purchasing_class'] == 'labtest') { $createmode = 'laboratory'; } $total_count = 0; $row['anzahl'] += $row['anzahl']; if (empty($row['anzahl'])) { $row['anzahl'] = 0; } //$labinfo = $this->GetLaboratoryCount($row['encounter_nr']); $row['anzahl_lab'] += $row['anzahl_lab']; if (empty($row['anzahl_lab'])) { $row['anzahl_lab'] = 0; } //$radinfo = $this->GetRadiologyCount($row['encounter_nr']); $row['anzahl_rad'] += $row['anzahl_rad']; if (empty($row['anzahl_rad'])) { $row['anzahl_rad'] = 0; } $total_count = $row['anzahl'] / 2; //echo $row['anzahl']." + ".$row['anzahl_lab']." = ".$total_count; if ($in_outpatient == 'outpatient' || $in_outpatient == 'artndental') { $sql = 'SELECT name_formal from care_department where nr=' . $row['current_dept_nr']; $deptresult = $db->Execute($sql); if ($row['current_dept_nr'] == 0) { $deptname = 'Admissions'; } else { $deptrow = $deptresult->FetchRow(); $deptname = $deptrow[0]; } } else { $sql = 'SELECT name from care_ward where nr=' . $row['current_ward_nr']; $deptresult = $db->Execute($sql); if ($row['current_ward_nr'] == 0) { $deptname = 'Admissions'; } else { $deptrow = $deptresult->FetchRow(); $deptname = $deptrow[0]; } } if ($row['insurance_ID'] > 0) { if ($ins_obj->CheckCurrentContractValidity($row['insurance_ID'])) { $ins_name = $ins_obj->GetName_insurance_from_id($row['insurance_ID']); } else { $ins_name = 'Cash'; } } else { $ins_name = 'Cash'; } if ($ins_name == 'CASH-PATIENT') { $row['insurance_ID'] = -1; } echo ' <tr> <form method="GET" action="billing_tz_quotation_select_pricelist.php"> <td ' . $BGCOLOR . ' class="td_content"><div align="center">' . $row['encounter_date'] . '</div></td> <td ' . $BGCOLOR . ' class="td_content"><div align="center">' . $row['encounter_nr'] . '</div></td> <td ' . $BGCOLOR . ' class="td_content"><div align="center">' . $this->ShowPID($row['pid']) . '</div></td> <td ' . $BGCOLOR . ' class="td_content"><div align="center">' . $row['selian_pid'] . '</div></td> <td ' . $BGCOLOR . ' class="td_content"><div align="center">' . $row['name_last'] . ', ' . $row['name_first'] . '</div></td> <td ' . $BGCOLOR . ' class="td_content"><div align="center">' . $row['date_birth'] . '</div></td> <td ' . $BGCOLOR . ' class="td_content"><div align="center">' . $ins_name . '</div></td> <td ' . $BGCOLOR . ' class="td_content"><div align="center">' . $total_count . '</div></td> <td ' . $BGCOLOR . ' class="td_content"><div align="center">' . $deptname . '</div></td> <td ' . $BGCOLOR . ' class="td_content"><div align="center">' . '<a href="../../modules/ambulatory/amb_clinic_discharge_info.php' . URL_APPEND . '&ntid=false&lang=en&target=search&pn=' . $row['encounter_nr'] . '" target="_blank" title="Admission data : Click to show data"><img src="../../gui/img/common/default/pdata.gif" alt="Admission data : Click to show data" width="20" border="0" height="20"></a>' . '</div></td> <td ' . $BGCOLOR . ' class="td_content"><div align="center"><input type="hidden" name="namelast" value="' . $row['name_last'] . '"><input type="hidden" name="patient" value="' . $_REQUEST['patient'] . '"><input type="hidden" name="namefirst" value="' . $row['name_first'] . '"><input type="hidden" name="createmode" value="' . $createmode . '"><input type="hidden" name="countpres" value="' . $row['anzahl'] . '"><input type="hidden" name="countrad" value="' . $row['anzahl_rad'] . '"><input type="hidden" name="countlab" value="' . $row['anzahl_lab'] . '"><input type="hidden" value="' . $row['encounter_nr'] . '" name="encounter_nr"><input type="hidden" value="' . $row['pid'] . '" name="pid"><input type="hidden" name="insurance_id" value="' . $row['insurance_ID'] . '"><input type="submit" value=">>"></div></td> </form> </tr>'; $alreadyshown[$row['encounter_nr']] = $row['encounter_nr']; } } else { echo '<tr><td colspan="8" align="center">Houston we have a problem. Database error :(</td></tr>'; } if (!$counter) { echo '<tr><td colspan="8" align="center">Nothing to do :)</td></tr>'; } }
} //if ($bed['encounter_nr']) $smarty->assign('sPatNr',$bed['encounter_nr']); if ($bed['encounter_nr']) { # Create encounter object require_once $root_path . 'include/care_api_classes/class_encounter.php'; $enc_obj = new Encounter($bed['encounter_nr']); $enc_obj->loadEncounterData($bed['encounter_nr']); $pid = $enc_obj->SelianPID(); $date = $enc_obj->EncounterDate(); $dateArr = date_parse($date); $smarty->assign('sPatNr', $pid); $smarty->assign('sAdmDate', formatDate2Local($date, $date_format) . ' ' . $dateArr['hour'] . ':' . $dateArr['minute']); } $insurance_name = ''; if ($bed['insurance_ID']) { if ($ins_obj->CheckCurrentContractValidity($bed['insurance_ID'])) { $insurance_name = $ins_obj->GetName_insurance_from_id($bed['insurance_ID']); } $smarty->assign('sInsuranceType', substr($insurance_name, 0, 15)); } else { $smarty->assign('sInsuranceType', substr($insurance_name, 0, 15)); } $sBuffer = ''; $kct = $multi_obj->CheckDiagnosis($bed['encounter_nr']); if ($vct[9] == 1 && $bed['encounter_nr'] != '') { if ($kct < 1) { $smarty->assign('sFlagDiag', ' style="background-color:yellow !important; color:#000000;" '); $smarty->assign('sFlagDiag2', ' style="background-color:gold !important; color:#000000;" '); $smarty->assign('sNoDiag', ' [ No Dx ] '); $nodischarge = 1; }