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");
10 //the maximum number of records to pull out with the search:
13 //the number of records to display before starting a second column:
16 $code_type = $_GET['type'];
21 <?php
html_header_show();?
>
22 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
24 <!-- add jQuery support
-->
25 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-2-2/index.js"></script
>
28 <body
class="body_bottom">
29 <div id
="patient_search_code">
31 <table border
=0 cellspacing
=0 cellpadding
=0 height
=100%
>
36 <form name
="search_form" id
="search_form" method
="post" action
="search_code.php?type=<?php echo $code_type ?>">
37 <input type
="hidden" name
="mode" value
="search">
39 <span
class="title"><?php
echo $code_type ?
> <?php
xl('Codes','e'); ?
></span
><br
>
41 <input type
="textbox" id
="text" name
="text" size
=15>
43 <input type
='submit' id
="submitbtn" name
="submitbtn" value
='<?php xl('Search
','e
'); ?>'>
44 <div id
="searchspinner" style
="display: inline; visibility:hidden;"><img src
="<?php echo $GLOBALS['webroot'] ?>/interface/pic/ajax-loader.gif"></div
>
49 if (isset($_POST["mode"]) && $_POST["mode"] == "search" && $_POST["text"] == "") {
50 echo "<div id='resultsummary' style='background-color:lightgreen;'>";
51 echo "Enter search criteria above</div>";
54 if (isset($_POST["mode"]) && $_POST["mode"] == "search" && $_POST["text"] != "") {
55 // $sql = "SELECT * FROM codes WHERE (code_text LIKE '%" . $_POST["text"] .
56 // "%' OR code LIKE '%" . $_POST["text"] . "%') AND code_type = '" .
57 // $code_types[$code_type]['id'] . "' ORDER BY code LIMIT " . ($M + 1);
59 // The above is obsolete now, fees come from the prices table:
60 $sql = "SELECT codes.*, prices.pr_price FROM codes " .
61 "LEFT OUTER JOIN patient_data ON patient_data.pid = '$pid' " .
62 "LEFT OUTER JOIN prices ON prices.pr_id = codes.id AND " .
63 "prices.pr_selector = '' AND " .
64 "prices.pr_level = patient_data.pricelevel " .
65 "WHERE (code_text LIKE '%" . $_POST["text"] . "%' OR " .
66 "code LIKE '%" . $_POST["text"] . "%') AND " .
67 "code_type = '" . $code_types[$code_type]['id'] . "' " .
72 if ($res = sqlStatement($sql) ) {
73 for($iter=0; $row=sqlFetchArray($res); $iter++
)
75 $result[$iter] = $row;
77 echo "<div id='resultsummary' style='background-color:lightgreen;'>";
78 if (count($result) > $M) {
79 echo "Showing the first ".$M." results";
81 else if (count($result) == 0) {
82 echo "No results found";
85 echo "Showing all ".count($result)." results";
90 <table
><tr
class='text'><td valign
='top'>
96 foreach ($result as $iter) {
98 echo "</td><td valign='top'>\n";
102 echo "<div class='oneresult' style='padding: 3px 0px 3px 0px;'>";
103 echo "<a target='".xl('Diagnosis')."' href='diagnosis.php?mode=add" .
104 "&type=" . urlencode($code_type) .
105 "&code=" . urlencode($iter{"code"}) .
106 "&modifier=" . urlencode($iter{"modifier"}) .
107 "&units=" . urlencode($iter{"units"}) .
108 // "&fee=" . urlencode($iter{"fee"}) .
109 "&fee=" . urlencode($iter['pr_price']) .
110 "&text=" . urlencode($iter{"code_text"}) .
111 "' onclick='top.restoreSession()'>";
112 echo ucwords("<b>" . strtoupper($iter{"code"}) . " " . $iter['modifier'] .
113 "</b>" . " " . strtolower($iter{"code_text"}));
121 echo "</span><span class=alert>".xl('Some codes were not displayed.')."</span>\n";
138 </div
> <!-- end large outer patient_search_code DIV
-->
141 <script language
="javascript">
143 // jQuery stuff to make the page a little easier to use
145 $
(document
).ready(function(){
147 $
(".oneresult").mouseover(function() { $
(this
).toggleClass("highlight"); });
148 $
(".oneresult").mouseout(function() { $
(this
).toggleClass("highlight"); });
149 //$(".oneresult").click(function() { SelectPatient(this); });
150 $
("#search_form").submit(function() { SubmitForm(this
); });
153 // show the 'searching...' status and submit the form
154 var SubmitForm
= function(eObj
) {
155 $
("#submitbtn").attr("disabled", "true");
156 $
("#submitbtn").css("disabled", "true");
157 $
("#searchspinner").css("visibility", "visible");
158 return top
.restoreSession();