3 ////////////////////////////////////////////////////////////////////////////////
4 // THIS MODULE REPLACES cptcm_codes.php, hcpcs_codes.php AND icd9cm_codes.php.
5 ////////////////////////////////////////////////////////////////////////////////
7 include_once("../../globals.php");
8 include_once("../../../custom/code_types.inc.php");
9 include_once("$srcdir/sql.inc");
11 //the maximum number of records to pull out with the search:
14 //the number of records to display before starting a second column:
17 $code_type = $_GET['type'];
22 <?php
html_header_show();?
>
23 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
25 <!-- add jQuery support
-->
26 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery-1.2.2.min.js"></script
>
29 <body
class="body_bottom">
30 <div id
="patient_search_code">
32 <table border
=0 cellspacing
=0 cellpadding
=0 height
=100%
>
37 <form name
="search_form" id
="search_form" method
="post" action
="search_code.php?type=<?php echo $code_type ?>">
38 <input type
="hidden" name
="mode" value
="search">
40 <span
class="title"><?php
echo $code_type ?
> <?php
xl('Codes','e'); ?
></span
><br
>
42 <input type
="textbox" id
="text" name
="text" size
=15>
44 <input type
='submit' id
="submitbtn" name
="submitbtn" value
='<?php xl('Search
','e
'); ?>'>
45 <div id
="searchspinner" style
="display: inline; visibility:hidden;"><img src
="<?php echo $GLOBALS['webroot'] ?>/interface/pic/ajax-loader.gif"></div
>
50 if (isset($_POST["mode"]) && $_POST["mode"] == "search" && $_POST["text"] == "") {
51 echo "<div id='resultsummary' style='background-color:lightgreen;'>";
52 echo "Enter search criteria above</div>";
55 if (isset($_POST["mode"]) && $_POST["mode"] == "search" && $_POST["text"] != "") {
56 // $sql = "SELECT * FROM codes WHERE (code_text LIKE '%" . $_POST["text"] .
57 // "%' OR code LIKE '%" . $_POST["text"] . "%') AND code_type = '" .
58 // $code_types[$code_type]['id'] . "' ORDER BY code LIMIT " . ($M + 1);
60 // The above is obsolete now, fees come from the prices table:
61 $sql = "SELECT codes.*, prices.pr_price FROM codes " .
62 "LEFT OUTER JOIN patient_data ON patient_data.pid = '$pid' " .
63 "LEFT OUTER JOIN prices ON prices.pr_id = codes.id AND " .
64 "prices.pr_selector = '' AND " .
65 "prices.pr_level = patient_data.pricelevel " .
66 "WHERE (code_text LIKE '%" . $_POST["text"] . "%' OR " .
67 "code LIKE '%" . $_POST["text"] . "%') AND " .
68 "code_type = '" . $code_types[$code_type]['id'] . "' " .
73 if ($res = sqlStatement($sql) ) {
74 for($iter=0; $row=sqlFetchArray($res); $iter++
)
76 $result[$iter] = $row;
78 echo "<div id='resultsummary' style='background-color:lightgreen;'>";
79 if (count($result) > $M) {
80 echo "Showing the first ".$M." results";
82 else if (count($result) == 0) {
83 echo "No results found";
86 echo "Showing all ".count($result)." results";
91 <table
><tr
class='text'><td valign
='top'>
97 foreach ($result as $iter) {
99 echo "</td><td valign='top'>\n";
103 echo "<div class='oneresult' style='padding: 3px 0px 3px 0px;'>";
104 echo "<a target='".xl('Diagnosis')."' href='diagnosis.php?mode=add" .
105 "&type=" . urlencode($code_type) .
106 "&code=" . urlencode($iter{"code"}) .
107 "&modifier=" . urlencode($iter{"modifier"}) .
108 "&units=" . urlencode($iter{"units"}) .
109 // "&fee=" . urlencode($iter{"fee"}) .
110 "&fee=" . urlencode($iter['pr_price']) .
111 "&text=" . urlencode($iter{"code_text"}) .
112 "' onclick='top.restoreSession()'>";
113 echo ucwords("<b>" . strtoupper($iter{"code"}) . " " . $iter['modifier'] .
114 "</b>" . " " . strtolower($iter{"code_text"}));
122 echo "</span><span class=alert>".xl('Some codes were not displayed.')."</span>\n";
139 </div
> <!-- end large outer patient_search_code DIV
-->
142 <script language
="javascript">
144 // jQuery stuff to make the page a little easier to use
146 $
(document
).ready(function(){
148 $
(".oneresult").mouseover(function() { $
(this
).toggleClass("highlight"); });
149 $
(".oneresult").mouseout(function() { $
(this
).toggleClass("highlight"); });
150 //$(".oneresult").click(function() { SelectPatient(this); });
151 $
("#search_form").submit(function() { SubmitForm(this
); });
154 // show the 'searching...' status and submit the form
155 var SubmitForm
= function(eObj
) {
156 $
("#submitbtn").attr("disabled", "true");
157 $
("#submitbtn").css("disabled", "true");
158 $
("#searchspinner").css("visibility", "visible");
159 return top
.restoreSession();