Jump to content

kenny724

Members
  • Posts

    29
  • Joined

  • Last visited

    Never

Everything posted by kenny724

  1. I'm trying to: There are several columns, MD aapt, PA, PCP....all columns have dates that are highlighted red over due, blue less than 7 days, and yellow less than 14. I need to change the PA column to red less than 7 days, blue less than 14, and yellow less than 21. I can't quite figure this on out either b/c all information is pulled at same time, using one color scheme. How can I just separate the PA column. Thanks for any input. Actually, here is the code for the page. I cannot tell where the colors are coming from??!!! Can anyone? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <style type="text/css"> .style1 { font-family: "Lucida Sans Unicode"; font-size: 13px; } A:link { color: black } A:active { color: red; font-size: 100% } A:visited { color: black; font-size: 100% } .dbd { font-weight: bold; color: black; } .note { font-weight: lighter; font-size: 70%; color: #AAAAAA; } .req { font-weight: lighter; font-size: 70%; color: #AA3333; } .fixed { font-family: "Courier"; font-size: 12px; font-weight: normal;} .cv_normal { background-color:#FFFFFF; } .cv_late { background-color:#FFFF99; } .cv_1weeks { background-color:#AACCFF; } .cv_1weekspa { background-color:#CC0000; } .cv_2weeks { background-color:#FFFF99; } .cv_2weekspa { background-color:#AACCFF; } .cv_now { background-color:#CC0000; } .cv_annual { background-color:#FFBB00; } .cv_inactive { background-color:#AACCFF; } .cv_closed { background-color:#CC0000; } </style> <title>Life Strategies Of Arkansas, LLC Patient Compliance Report</title> <link rel="stylesheet" href="../css/demos.css"> <link rel="stylesheet" href="../css/droppy.css"> <link rel="stylesheet" href="../css/droppy_lsa.css"> <link rel="stylesheet" href="../css/themes/cupertino/jquery-ui-1.7.2.custom.css"> <script type="text/javascript" language="javascript" src="../scripts/jquery-1.3.2.min.js"></script> <script type="text/javascript" language="javascript" src="../scripts/jquery-ui-1.7.2.custom.min.js"></script> <script type="text/javascript" language="javascript" type="text/javascript" src="../scripts/jquery.jclock.js"></script> <script type="text/javascript" language="javascript" src="../scripts/jquery.droppy.js"></script> <script type="text/javascript" language="javascript" src="../scripts/jquery.dataTables.js"></script> <script type="text/javascript" language="javascript" src="../scripts/jquery.jeditable.min.js"></script> <script type="text/javascript" language="javascript" src="../scripts/jquery.timers.js"></script> <script type="text/javascript" language="javascript" src="../scripts/jquery.tooltip.js"></script> <script type="text/javascript" charset="utf-8"> var oTable; var giRedraw = false; var oCache = { iCacheLower: -1 }; function fnSetKey( aoData, sKey, mValue ) { for ( var i=0, iLen=aoData.length ; i<iLen ; i++ ) { if ( aoData[i].name == sKey ) { aoData[i].value = mValue; } } } function fnGetKey( aoData, sKey ) { for ( var i=0, iLen=aoData.length ; i<iLen ; i++ ) { if ( aoData[i].name == sKey ) { return aoData[i].value; } } return null; } function fnDataTablesPipeline ( sSource, aoData, fnCallback ) { var iPipe = 5; /* Ajust the pipe size */ var bNeedServer = false; var sEcho = fnGetKey(aoData, "sEcho"); var iRequestStart = fnGetKey(aoData, "iDisplayStart"); var iRequestLength = fnGetKey(aoData, "iDisplayLength"); var iRequestEnd = iRequestStart + iRequestLength; oCache.iDisplayStart = iRequestStart; /* outside pipeline? */ if ( oCache.iCacheLower < 0 || iRequestStart < oCache.iCacheLower || iRequestEnd > oCache.iCacheUpper ) { bNeedServer = true; } /* sorting etc changed? */ if ( oCache.lastRequest && !bNeedServer ) { for( var i=0, iLen=aoData.length ; i<iLen ; i++ ) { if ( aoData[i].name != "iDisplayStart" && aoData[i].name != "iDisplayLength" && aoData[i].name != "sEcho" ) { if ( aoData[i].value != oCache.lastRequest[i].value ) { bNeedServer = true; break; } } } } /* Store the request for checking next time around */ oCache.lastRequest = aoData.slice(); if ( bNeedServer ) { if ( iRequestStart < oCache.iCacheLower ) { iRequestStart = iRequestStart - (iRequestLength*(iPipe-1)); if ( iRequestStart < 0 ) { iRequestStart = 0; } } oCache.iCacheLower = iRequestStart; oCache.iCacheUpper = iRequestStart + (iRequestLength * iPipe); oCache.iDisplayLength = fnGetKey( aoData, "iDisplayLength" ); fnSetKey( aoData, "iDisplayStart", iRequestStart ); fnSetKey( aoData, "iDisplayLength", iRequestLength*iPipe ); $.getJSON( sSource, aoData, function (json) { /* Callback processing */ oCache.lastJson = jQuery.extend(true, {}, json); if ( oCache.iCacheLower != oCache.iDisplayStart ) { json.aaData.splice( 0, oCache.iDisplayStart-oCache.iCacheLower ); } json.aaData.splice( oCache.iDisplayLength, json.aaData.length ); fnCallback(json) } ); } else { json = jQuery.extend(true, {}, oCache.lastJson); json.sEcho = sEcho; /* Update the echo for each response */ json.aaData.splice( 0, iRequestStart-oCache.iCacheLower ); json.aaData.splice( iRequestLength, json.aaData.length ); fnCallback(json); return; } } $(document).ready(function() { oTable = $('#example').dataTable( { "bProcessing": true, "bServerSide": true, "bStateSave": true, "sPaginationType": "full_numbers", "sDom": 'lipft<bottom>rp', "sAjaxSource": 'compliance_report_query_dev2.php?where=%&status=1', "fnServerData": fnDataTablesPipeline, "fnDrawCallback": function() { //alert( 'DataTables has finished it\'s initialisation.' ); //-----------------------------------------------------------Edit status entry $('.editable').editable( function( sValue ) { // the id has the Patient ID var patientID = $(this).attr('id'); //alert('1: ' + sValue); $.post("ajax_update_patient.php", { patientID: patientID, value: sValue }, function(data){ // if it was not ok show the error if (data != "OK") { alert(data); } }); if(sValue == 1) sValue = '<font color=#007700>Active</font>'; if(sValue == 2) sValue = '<font color=#777777>Inactive</font>' if(sValue == 3) sValue = 'Discharged'; if(sValue == 99) sValue = '<b><font color=#660000>DELETED</font></b>'; return sValue; }, { data : " {'1':'Active','2':'Inactive','3':'Closed'}", type : 'select', id : 'field', indicator : 'Saving...', tooltip : 'Click to edit. Note If you Delete a patient they will not show up on any queries, reports, etc...', event : 'click', submit : 'OK' } ).addClass('ui-state-highlight ui-corner-all'); //-----------------------------------------------------------Date entries $('#example tbody td input[date=1]').attr({readonly: '1'}).datepicker({ yearRange: '1909:2040', changeMonth: true, changeYear: true, onSelect: function(dateText){ // Build the post data if($(this).val() == "01/01/1909") $(this).val(""); var postData = { patientID: $(this).attr('patientID'), field: $(this).attr('field'), value: $(this).val() }; var myparent = $(this).parent().attr('class'); var temp = $(this).val(); var thisdate = new Date(); var new_date = new Date(temp.substring(6,10),temp.substring(0,2)-1,temp.substring(3,5)); var dateDiff = Math.ceil((new_date - thisdate)/(1000*60*60*24)); var new_class = ''; //alert(var_diff); $(this).parent().removeClass(myparent); $(this).parent().addClass(new_class); // Update the database $.post("ajax_update_patient.php", postData, function(data){ // if it was not ok show the error if (data != "OK") { alert(data); } }); } }).addClass('ui-state-highlight ui-corner-all'); //-----------------------------------------------------------Date field entries $('.edit').editable( function( sValue ) { // the id has the Patient ID var patientID = $(this).attr('id'); $.post("ajax_update_patient.php", { patientID: patientID, value: sValue }, function(data){ // if it was not ok show the error if (data != "OK") { alert(data); } }); if(sValue=="") sValue = "<font class='note'>N/A</font>"; return sValue; }, { id : 'field', indicator : 'Saving...', tooltip : 'Click to edit', event : 'click', submit : 'OK' } ).addClass('ui-state-highlight ui-corner-all'); // Now make all columes no wrap and centered //$('#example tbody td div').css('white-space','nowrap').css('text-align','center'); $('#example tbody td:not(editarea)').css('white-space','nowrap').css('text-align','center'); $('.editarea').parent().css('white-space','').css('text-align','center'); //*********************************************************************************************************Fix me 6/28/2010 // Add the table row tooltip $('#example tbody tr').each( function() { //this.$(td a); // We have our rows, we need the name and patientID //get the first td and it's offset var this_text = $(this).html(); var t1 = this_text.indexOf('patient_id=',this_text)+19; var t2 = this_text.indexOf('</a>',this_text); var td1_text = this_text.substring(t1,t2); //alert(t1 + ' '+ t2 + ' ' + this_text ); //alert(td3_text + ' ' + td1_text); $(this).attr('title', td1_text); });// //-----------------------------------------------------------Checkboxes $('#example tbody:checkbox').click( function() { var checked = this.checked; var patientID = $(this).attr('id'); var sValue = checked ? '1' : ''; // translated boolean to character 1 or blank $.post("ajax_update_patient.php", { patientID: patientID, value: sValue }, function(data){ // if it was not ok show the error if (data != "OK") { alert(data); } }); }); //-----------------------------------------------------------Notes $('.editarea').editable( function( sValue ) { //alert('1'); var patientID = $(this).attr('id'); //alert(id); $.post("ajax_update_patient.php", { patientID: patientID, value: sValue }, function(data){ // if it was not ok show the error if (data != "OK"){ alert(data); } }); return sValue; }, { id : 'field', type : 'textarea', rows : '4', indicator : 'Saving...', tooltip : 'Click to edit.', event : 'click', submit : 'Save' , data : function(value, settings) { $(this).fadeTo(1,.01).fadeTo(1000,1); var retval = value; return retval; } }).addClass('ui-state-highlight ui-corner-all'); } } ); //$('#example tbody tr').tooltip( {cssClass:"tooltip-yellow", delay:1000,duration : 400,fadeDuration: 10, opacity:20} ); //$(function() { $('#clinic_picker').droppy({speed: 130}); // }); /* Apply the jEditable handlers to the table */ } ); $(function() { $('#nav').droppy({speed: 130}); var options1 = { format: '%I:%M:%S %p' // 12-hour } $('#jclock1').jclock(options1); $('#timeout').everyTime(5000,function(i) { var cookiename = "time_left="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(cookiename) == 0) { var data = c.substring(cookiename.length,c.length); data = unescape(data.replace(/\+/," ")); data = "Session expires<br/>at " + data; } } //$('#timeout').slideUp(400).slideDown(400).html(data); $('#timeout').html(data); //$(this).html(i); }); // scroll reminder droppy menuYloc = 5;// parseInt($('#reminder').css('top').substring(0,$('#reminder').css('top').indexOf('px'))); menuXloc = 5;//parseInt($('#reminder').css('top').substring(0,$('#reminder').css('left').indexOf('px'))); $(window).scroll(function () { var yoffset = menuYloc; var xoffset = menuXloc; if($('#float_pref').attr('value') != 2) { yoffset = menuYloc+$(document).scrollTop()+'px'; xoffset = menuYloc+$(document).scrollLeft()+'px'; } $('#reminder').animate({top:yoffset, left:xoffset},{duration:500,queue:false}); }); $('#float_pref').bind('click', function(event) { var sValue = $(this).attr('value'); if(sValue == 1) sValue = 2; else sValue = 1; //alert(sValue); $.post('ajax_update_user.php', { userID: '10014', field: 'float_pref', value: sValue }, function(data){ // if it was not ok show the error if (data != 'OK'){ alert(data); } else { if(sValue == 1){ $('#float_pref').html('<span class=\'ui-icon ui-icon-carat-2-n-s\'></span>'); $('#float_pref').attr('value', '1'); } else { $('#float_pref').html('<span class=\'ui-icon ui-icon-stop\'></span>'); $('#float_pref').attr('value','2'); } } }); }); }); </script> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> </head> <body id="dt_example"> <br /><br /> <div id="reminder" style="position:absolute; top:5px; margin-left:5px; width:100%; z-index:2; "> <div id="reminder_inner" style="float:left;height:15px;"> <ul id='nav'> <li><a href='#'>Mr Kenny Hunt</a> <ul> <li><a onclick="newwindow=window.open('guide/ct_guide.html','mywindow','scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes');if(window.focus)newwindow.focus()" href='#'>User Guide</a></li> <li><a href='unsigned_report.php'>Unsigned Forms Report</a></li> </ul> </li> <li><a href='#'>Admin Menu</a> <ul> <li><a href='approval_form.php'>Form Approvals</a></li> <li><a href='#'>Maintenance</a> <ul> <li><a href='users_clinics.php'>Clinician to Clinic Assignment</a></li><li><a href='mtp_template_maint.php'>Template Maintenance</a></li><li><a href='user_maint.php'>User Maintenance</a></li> </ul> </li> </li> </ul> </li> <li><a href='#'>Reports Menu</a> <ul> <li><a href='#'>Billing</a> <ul> <li><a href='daily_billing_individual.php'>Kenny's Daily Billing</a></li><li><a href='daily_billing.php'>Daily Billing Form</a></li><li><a href='daily_billing_adhoc.php'>Provider Adhoc Report</a></li><li><a onclick="newwindow=window.open('new.html','mywindow','width=500,height=300,scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes');if(window.focus)newwindow.focus()" href='#'>New Report</a></li> </ul> </li> <li><a href='compliance_report_dev2.php'>Compliance Report</a></li><li><a href='adm_dc_report_dev2.php'>Admissions, Transfers, Discharges Report</a></li><li><a href='patient_list_report_dev2.php'>Patient List Report</a></li><li><a href='patient_demo_report.php'>Patient Demographics Report</a></li> </ul> </li> <li><a href='patientselect.php?patient_id='>Select Patient</a></li> <li></li> <li><a href='logoff.php'>Log Off</a></li> </ul></div><div id='jclock1' style="float:left;"></div> <div id='timeout' style="float:left; text-align:center;">Session expires<br/>at 5:01:30 pm</div><div id='float_pref' value='1'><span class='ui-icon ui-icon-carat-2-n-s'></span></div><div style="clear: both;"></div> <div style="clear: both;"></div></div> <br /> <center><form method="post"><div style="float:center; width:550px;"> <ul id='clinic_picker'> <li> Select a Clinic from either list </li> <li> </li> <li><a href='#'> Clinics A through M </a> <ul> <li><a href='/secure/compliance_report_dev2.php?where=%'>All Clinics </a></li><li><a href='/secure/compliance_report_dev2.php?where=3'>Corporate Office <font size="-1"></font></a></li><li><a href='/secure/compliance_report_dev2.php?where=9'>Earle Outpatient Clinic <font size="-1">171503526</font></a></li><li><a href='/secure/compliance_report_dev2.php?where=5'>Forrest City Outpatient Clinic <font size="-1"></font></a></li><li><a href='/secure/compliance_report_dev2.php?where=10'>Hughes <font size="-1">171533526</font></a></li><li><a href='/secure/compliance_report_dev2.php?where=6'>Marianna Outpatient Clinic <font size="-1">171504526</font></a></li> </ul> </li> <li><a href='#'> Clinics N through Z </a> <ul> <li><a href='/secure/compliance_report_dev2.php?where=7'>Newport Comprehensive Clinic <font size="-1">170936526</font></a></li><li><a href='/secure/compliance_report_dev2.php?where=2'>West Memphis Adult Day Treatment Program <font size="-1">1700950011</font></a></li><li><a href='/secure/compliance_report_dev2.php?where=4'>West Memphis After School Program <font size="-1">171532526</font></a></li><li><a href='/secure/compliance_report_dev2.php?where=1'>West Memphis Outpatient Clinic <font size="-1">171534526</font></a></li><li><a href='/secure/compliance_report_dev2.php?where=8'>Wynne Outpatient Clinic <font size="-1">171535526</font></a></li> </ul> </li> </ul> </div> <tr><td colspan=2><center>Show: <input onclick="this.form.submit()" type="radio" name="status" value="1" checked="CHECKED"> Active Patients <input onclick="this.form.submit()" type="radio" name="status" value="2"> Inactive Patients <input onclick="this.form.submit()" type="radio" name="status" value="3"> Closed Patients <br /><br /> </form><b>Current Clinic: All Clinics</b></center> <br /><div style='text-align: center;'> <form name='xlsout' method='post' action='/secure/compliance_report_dev2.php?excel=1' enctype='application_x-www-form-urlencoded'> <input type='submit' name='submit_b' value='Excel Output'></form></div> <div class="full_width big"><b><font size="+1">Patient Compliance Report</font></b></div> <tr><td><center><font class='note'>Key: <font color="#CCCC33">Yellow</font>: less than 14 days to appt. date <font color="#3399FF">Blue</font>: Less than 7 days to appt. date <font color="#CC0000">Red</font>: Appt. date is past due. <br />*Note: be sure to enter all dates in the following format MM/DD/YYYY. "/"'s are included</font> <table cellpadding="0" cellspacing="0" border="1" class="display" id="example" width='95%'> <thead> <tr><td colspan="18">Click the<font class="ui-state-highlight ui-corner-all"> highlighted text </font>to edit the contents. You can prese Escape or click elsewhere to cancel any changes. To delete a date set it to Jan 1, 1909</td></tr> <tr> <th>Client Name</th> <th width="4%">On<br />Meds</th> <th width="9%">MD Appt<br />Due</th> <th width="9%">PA</th> <th width="9%">PCP</th> <th width="9%">YOQ</th> <th width="9%">Treatment<br />Plan</th> <th width="9%">Date of<br />Admission</th> <th>Comments</th> <th width="9%">Status</th> </tr> </thead> <tbody> </tbody> <tfoot> </tfoot> </table> </body> </html>
  2. sup_id_fk posts in the database as a 0. I change it to 72...the id for Scot's signature. Nothing shows up...no signature or anything. does anyone see what i'm doing wrong?
  3. error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '','1', NULL,'' )' at line 7
  4. and activity_therapy.php <?php //activity_therapy.php /* This is the Activity Therapy Note form */ require_once('custom_tech.inc'); //error_reporting(E_ALL); include("tool_tip2.inc"); $form_title_string = "Activity Therapy Note"; $pre_note = ""; $patient_multi_string = ""; $multi_pre_note = ""; $completed_date=""; $message=""; $host_form_items_string=""; $program_loc_string=""; $sup_id_fk=""; //echo "This form: $this_form_action and this patient: $this_patient_id<br />"; include_once('note_processing.inc'); /*echo "<br />"; print_r($_POST); echo "<br />";*/ // Connect to database for following queries mysql_connect("localhost", $db_user, $db_pass) or die("Failure to communicate with database"); mysql_select_db($db_database) or die("Unable to select database"); include_once('patient_demos.inc'); // Include our Insert code include_once('activity_therapy_note_insert.inc'); if( ($this_form_action == "Print" || $this_form_action == "View") && ($this_eval_form_id != NULL) && ($this_patient_id != NULL) ) { $disabled_string = "";//" disabled=\"disabled\""; //echo "we are in Print"; require('activity_therapy_note_print_query.inc'); include("cpt_form.inc"); include('signatures.inc'); include('print_style.inc'); //echo "This is the query $intake_eval_query"; $frm_str = <<<EOP <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>$this_custom_tech_customer $form_title_string</title> $print_style_string <tr> <td><br /><b>ACTIVITY THERAPY NOTE:</b><br /></td> </tr> $diagnosis_string <tr> <td><b>DOB:</b> <font class="dbd">$dob</font></td> </tr> <tr> <td><br><b>GOALS FROM THE MTP:</b><br /><font class="dbd">$goals</font></td> </tr> <tr> <td><br><b>OBJECTIVES FROM THE MTP:</b><br /><font class="dbd">$objectives</font></td> </tr> <tr> <td><br><b>INTERVENTIONS FROM THE MTP:</b><br /><font class="dbd">$interventions</font></td> </tr> <tr> <td><br /><b>PROGRESS/RESPONSE:</b> <table width="100%" border="0"> <tr> <td width="5%"> </td> <td>How is the client responding to your efforts?<br /> <font class="dbd">$response</font></td> </tr> <tr> <td width="5%"> </td> <td>Is the client improving, regressing, or staying the same?<br /> <font class="dbd">$progress</font></td> </tr> </table> </td> </tr> <tr> <td> <table width="100%" border="0"> <tr> <td width="15%"><b>TIME IN:</b></td> <td><b>TIME OUT:</b></td> </tr> <tr> <td><font class="dbd">$time_in_1</font></td> <td><font class="dbd">$time_out_1</font></td> </tr> <tr> <td><font class="dbd">$time_in_2</font></td> <td><font class="dbd">$time_out_2</font></td> </tr> <tr> <td><font class="dbd">$time_in_3</font></td> <td><font class="dbd">$time_out_3</font></td> </tr> <tr> <td><font class="dbd">$time_in_4</font></td> <td><font class="dbd">$time_out_4</font></td> </tr> </table> <b>TOTAL TIME: </b><font class="dbd">$total_time</font> minutes</td> </tr> <tr> <td><br><br><b>PROGRAM LOCATION:</b> $program_loc_string <font class="dbd">$program_location</font></td> </tr> /html> EOP; echo $frm_str.'<hr>'; if(($completed_date_string != "")) { echo ' <tr> <td valign="bottom">'. $clinician_sig. '<hr /></td> <td valign="bottom">'. $completed_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $sup_sig. '<hr /></td> <td valign="bottom">'. $completed_date_string. '<hr />Date:</td> </tr> </table> </td> </tr> </td> </tr>'; } $frm_str = <<<EOP <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> </tbody> </table> </div> </div> </body> </html> EOP; $message = $frm_str; } if($this_form_action == "Multi") { $thisfile="activity_therapy_note_multi.php"; include('activity_therapy_note_multi.php'); exit; } if($this_form_action == "New" || $this_form_action == "Update") { // query the database for any existing information //echo "$time_in_1 <br />"; if($this_form_action == "Update") { require('activity_therapy_note_print_query.inc'); $insert_or_update = "Add"; $ioru_1 = "update"; $ioru_2 = "in"; //$this_time = $start_time; } else { // Include our code support queries here $insert_or_update = "Insert"; $ioru_1 = "add"; $ioru_2 = "to"; //$start_time = $this_time; //$seen_date = $this_entry_date; // Added 4/13/2010 Need to have the most recent diagnosis from the Psych Eval or MD Review $sql_query = "SELECT form_id_pk, MAX( completed_date ), patient_id_fk, dsm_axis1 FROM psychiatric_eval WHERE patient_id_fk = $this_patient_id AND completed_date IS NOT NULL GROUP BY form_id_pk, patient_id_fk ORDER BY completed_date DESC LIMIT 1"; $sql_result = mysql_query($sql_query) or die ("Error in psychiatric_eval_query"); $psych_hist_array = mysql_fetch_array($sql_result); if( $psych_hist_array[0] != 0 ){ //echo "<br /><br /><br />$sql_query"; $diagnosis = $psych_hist_array['dsm_axis1']; //echo "<br />$host_form_id $host_form_name"; } else { $psych_hist_array[1] = "1970-01-01 00:00:00"; } // Now check the Med Managment note $sql_query = "SELECT form_id_pk, MAX( completed_date ), patient_id_fk, dsm_axis1 FROM med_management WHERE patient_id_fk = $this_patient_id AND completed_date IS NOT NULL GROUP BY form_id_pk, patient_id_fk ORDER BY completed_date DESC LIMIT 1"; $sql_result = mysql_query($sql_query) or die ("Error in med_management_query"); $med_hist_array = mysql_fetch_array($sql_result); if( $med_hist_array[0] != 0 && $med_hist_array[1] > $psych_hist_array[1]){ //echo "<br /><br /><br />$sql_query"; $diagnosis = $med_hist_array['dsm_axis1']; //echo "<br />$host_form_id $host_form_name"; } else { $diagnosis = $psych_hist_array['dsm_axis1']; } // we want to pick the most recent MTP or 90-day. To do this we will use the views // first grab the MTP date and form_id $sql_query = "SELECT form_id_pk, MAX(approved_date), patient_id_fk FROM approved_master_treat WHERE patient_id_fk = $this_patient_id GROUP BY form_id_pk, patient_id_fk ORDER BY approved_date desc LIMIT 1"; $sql_result = mysql_query($sql_query) or die ("Error in approved_master_treat_query"); $mtp_hist_array = mysql_fetch_array($sql_result); if( $mtp_hist_array[0] != 0 ){ //echo "<br /><br /><br />$sql_query"; $host_form_id = $mtp_hist_array['form_id_pk']; $host_form_name = "master_treat"; //echo "<br />$host_form_id $host_form_name"; } else { $mtp_hist_array[1] = "1970-01-01 00:00:00"; } // Now see if we have a more recent date for a 90-day review $sql_query = "SELECT form_id_pk, MAX(approved_date), patient_id_fk FROM approved_ninety_review WHERE patient_id_fk = $this_patient_id AND approved_date > STR_TO_DATE('$mtp_hist_array[1]','%Y-%m-%d %H:%i:%s') GROUP BY form_id_pk, patient_id_fk ORDER BY approved_date desc LIMIT 1"; //2009-07-21 23:02:43 $sql_result = mysql_query($sql_query) or die ("Error in approved_ninety_review_query"); $ninety_hist_array = mysql_fetch_array($sql_result); if( $ninety_hist_array[0] != NULL){ //echo "<br /><br /><br />$sql_query"; $host_form_id = $ninety_hist_array['form_id_pk']; $host_form_name = "ninety_review"; //echo "<br />$host_form_id $host_form_name"; } else { $ninety_hist_array[1] = "1970-01-01 00:00:00"; } // Must have a MTP or 90-day to work from if( $host_form_id == NULL ){ $message = "<html><body><br /><br /><br /><br /><center><h2>No Approved Master Treatment Plan or Ninety Day Review found. Please report this to your site coordinator.</h2> Causes for this are: <li>The doctor has not yet approved the form<li>No treatement plan has been submitted<br /><br /><hr><h3>Please close this window to continue.</h3></center></body></html>"; print($message); exit; } } if(IsSet($host_form_id) && $host_form_name == "activity_therapy_note") { $this_eval_form_id = $host_form_id; $pre_note = "<br /><font class=\"note\">Values brought over from a previous Activity Therapy Note</font>"; include('activity_therapy_note_print_query.inc'); $completed_date = "NULL"; $sup_id_fk=""; $seen_date = ""; $start_time = ""; $end_time = ""; $response = ""; $progress = ""; $time_in_1 = $time_in_2 = $time_in_3 = $time_in_4 = ""; $time_out_1 = $time_out_2 = $time_out_3 = $time_out_4 = $total_time = ""; } else if(IsSet($host_form_id) && $host_form_name == "master_treat") { $sql_query = "select problem_1_statement,problem_1_goal,problem_1_obj,problem_1_int, problem_2_statement,problem_2_goal,problem_2_obj,problem_2_int, problem_3_statement,problem_3_goal,problem_3_obj,problem_3_int,completed_date FROM $host_form_name WHERE patient_id_fk = '$this_patient_id' and form_id_pk = $host_form_id"; //echo " $sql_query "; $sql_results = mysql_query($sql_query) or die ("Error in $host_form_name query"); $sql_array = mysql_fetch_array($sql_results); $pre_note = "<font class=note>Values brought over from Master Treatment Plan dated " . stripslashes($sql_array['completed_date']) . "</font>"; // Updates made 4/15/2008 per LSA. We need to parse out the individual Objectives and Interventions to allow the // clinicians to chekc the ones they want included on this note // Each item should be number sequentially starting from 1., 2. , ... n. // First get the Objectives in a string to parse $temp_string = stripslashes($sql_array['problem_1_goal']); // now call our parseText function parseText($temp_string,$goal_prob_1,"goal1","goals"); $temp_string = stripslashes($sql_array['problem_1_obj']); // now call our parseText function parseText($temp_string,$objectives_prob_1,"obj1","objectives"); $temp_string = stripslashes($sql_array['problem_1_int']); // now call our parseText function parseText($temp_string,$interventions_prob_1,"int1","interventions"); // Problem 2 $temp_string = stripslashes($sql_array['problem_2_goal']); // now call our parseText function parseText($temp_string,$goal_prob_2,"goal2","goals"); $temp_string = stripslashes($sql_array['problem_2_obj']); // now call our parseText function parseText($temp_string,$objectives_prob_2,"obj2","objectives"); $temp_string = stripslashes($sql_array['problem_2_int']); // now call our parseText function parseText($temp_string,$interventions_prob_2,"int2","interventions"); // Problem 3 $temp_string = stripslashes($sql_array['problem_3_goal']); // now call our parseText function parseText($temp_string,$goal_prob_3,"goal3","goals"); $temp_string = stripslashes($sql_array['problem_3_obj']); // now call our parseText function parseText($temp_string,$objectives_prob_3,"obj3","objectives"); $temp_string = stripslashes($sql_array['problem_3_int']); // now call our parseText function parseText($temp_string,$interventions_prob_3,"int3","interventions"); $problem_2_statement = $sql_array['problem_2_statement']; $problem_3_statement = $sql_array['problem_3_statement']; // Now that we have our parsed strings, we need to bundle them into a nice neat presentation { $host_form_items_string = "<div style=\"position:relative; left:8%; width: 625; border: 1px solid black;\"><div style=\"text-align: left; background-color: #CCC\"><b>Problem 1:</b> " . stripslashes($sql_array['problem_1_statement']) . "</div>"; $host_form_items_string .= "<div style=\"position:relative; left:10px\"><b>Goal:</b> <font class=\"note\">Check all that apply</font><br />$goal_prob_1</div>"; $host_form_items_string .= "<div style=\"position:relative; left:10px\"><b>Objectives:</b> <font class=\"note\">Check all that apply</font><br />$objectives_prob_1</div>"; $host_form_items_string .= "<div style=\"position:relative; left:10px\"><b>Interventions:</b> <font class=\"note\">Check all that apply</font><br />$interventions_prob_1</div></div>"; } if(isSet($problem_2_statement) && $problem_2_statement != "") { $host_form_items_string .= "<div style=\"position:relative; left:8%; width: 625; border: 1px solid black;\"><div style=\"text-align: left; background-color: #CCC\"><b>Problem 2:</b> " . stripslashes($sql_array['problem_2_statement']) . "</div>"; $host_form_items_string .= "<div style=\"position:relative; left:10px\"><b>Goal:</b> <font class=\"note\">Check all that apply</font><br />$goal_prob_2</div>"; $host_form_items_string .= "<div style=\"position:relative; left:10px\"><b>Objectives:</b> <font class=\"note\">Check all that apply</font><br />$objectives_prob_2</div>"; $host_form_items_string .= "<div style=\"position:relative; left:10px\"><b>Interventions:</b> <font class=\"note\">Check all that apply</font><br />$interventions_prob_2</div></div>"; } if(isSet($problem_3_statement) && $problem_3_statement != "") { $host_form_items_string .= "<div style=\"position:relative; left:8%; width: 625; border: 1px solid black;\"><div style=\"text-align: left; background-color: #CCC\"><b>Problem 3:</b> " . stripslashes($sql_array['problem_3_statement']) . "</div>"; $host_form_items_string .= "<div style=\"position:relative; left:10px\"><b>Goal:</b> <font class=\"note\">Check all that apply</font><br />$goal_prob_3</div>"; $host_form_items_string .= "<div style=\"position:relative; left:10px\"><b>Objectives:</b> <font class=\"note\">Check all that apply</font><br />$objectives_prob_3</div>"; $host_form_items_string .= "<div style=\"position:relative; left:10px\"><b>Interventions:</b> <font class=\"note\">Check all that apply</font><br />$interventions_prob_3</div></div>"; } //$problem_1_goal = stripslashes($sql_array['problem_1_goal']) . "\n" . stripslashes($sql_array['problem_2_goal']) . "\n" . stripslashes($sql_array['problem_3_goal']) . "\nObjectives: " . stripslashes($sql_array['problem_1_obj']) . "\n" . stripslashes($sql_array['problem_2_obj']) . "\n" . stripslashes($sql_array['problem_3_obj']); //$interventions = stripslashes($sql_array['problem_1_int']) . "\n" . stripslashes($sql_array['problem_2_int']) . "\n" . stripslashes($sql_array['problem_3_int']); } elseif(IsSet($host_form_id) && $host_form_name == "ninety_review") { $sql_query = "select problem_1_statement,problem_1_goal,problem_1_obj,problem_1_int, problem_2_statement,problem_2_goal,problem_2_obj,problem_2_int, problem_3_statement,problem_3_goal,problem_3_obj,problem_3_int,completed_date FROM ninety_review WHERE patient_id_fk = '$this_patient_id' and form_id_pk = $host_form_id"; //echo " $sql_query "; $sql_results = mysql_query($sql_query) or die ("Error in ninety_review query"); $sql_array = mysql_fetch_array($sql_results); $pre_note = "<font class=note>Values brought over from 90-Day Review dated " . stripslashes($sql_array['completed_date']) . "</font>"; // Updates made 4/15/2008 per LSA. We need to parse out the individual Objectives and Interventions to allow the // clinicians to chekc the ones they want included on this note // Each item should be number sequentially starting from 1., 2. , ... n. // First get the Objectives in a string to parse $temp_string = stripslashes($sql_array['problem_1_goal']); // now call our parseText function parseText($temp_string,$goal_prob_1,"goal1","goals"); $temp_string = stripslashes($sql_array['problem_1_obj']); // now call our parseText function parseText($temp_string,$objectives_prob_1,"obj1","objectives"); $temp_string = stripslashes($sql_array['problem_1_int']); // now call our parseText function parseText($temp_string,$interventions_prob_1,"int1","interventions"); // Problem 2 $temp_string = stripslashes($sql_array['problem_2_goal']); // now call our parseText function parseText($temp_string,$goal_prob_2,"goal2","goals"); $temp_string = stripslashes($sql_array['problem_2_obj']); // now call our parseText function parseText($temp_string,$objectives_prob_2,"obj2","objectives"); $temp_string = stripslashes($sql_array['problem_2_int']); // now call our parseText function parseText($temp_string,$interventions_prob_2,"int2","interventions"); // Problem 3 $temp_string = stripslashes($sql_array['problem_3_goal']); // now call our parseText function parseText($temp_string,$goal_prob_3,"goal3","goals"); $temp_string = stripslashes($sql_array['problem_3_obj']); // now call our parseText function parseText($temp_string,$objectives_prob_3,"obj3","objectives"); $temp_string = stripslashes($sql_array['problem_3_int']); // now call our parseText function parseText($temp_string,$interventions_prob_3,"int3","interventions"); $problem_2_statement = $sql_array['problem_2_statement']; $problem_3_statement = $sql_array['problem_3_statement']; // Now that we have our parsed strings, we need to bundle them into a nice neat presentation { $host_form_items_string = "<div style=\"position:relative; left:8%; width: 625; border: 1px solid black;\"><div style=\"text-align: left; background-color: #CCC\"><b>Problem 1:</b> " . stripslashes($sql_array['problem_1_statement']) . "</div>"; $host_form_items_string .= "<div style=\"position:relative; left:10px\"><b>Goal:</b> <font class=\"note\">Check all that apply</font><br />$goal_prob_1</div>"; $host_form_items_string .= "<div style=\"position:relative; left:10px\"><b>Objectives:</b> <font class=\"note\">Check all that apply</font><br />$objectives_prob_1</div>"; $host_form_items_string .= "<div style=\"position:relative; left:10px\"><b>Interventions:</b> <font class=\"note\">Check all that apply</font><br />$interventions_prob_1</div></div>"; } if(isSet($problem_2_statement) && $problem_2_statement != "") { $host_form_items_string .= "<div style=\"position:relative; left:8%; width: 625; border: 1px solid black;\"><div style=\"text-align: left; background-color: #CCC\"><b>Problem 2:</b> " . stripslashes($sql_array['problem_2_statement']) . "</div>"; $host_form_items_string .= "<div style=\"position:relative; left:10px\"><b>Goal:</b> <font class=\"note\">Check all that apply</font><br />$goal_prob_2</div>"; $host_form_items_string .= "<div style=\"position:relative; left:10px\"><b>Objectives:</b> <font class=\"note\">Check all that apply</font><br />$objectives_prob_2</div>"; $host_form_items_string .= "<div style=\"position:relative; left:10px\"><b>Interventions:</b> <font class=\"note\">Check all that apply</font><br />$interventions_prob_2</div></div>"; } if(isSet($problem_3_statement) && $problem_3_statement != "") { $host_form_items_string .= "<div style=\"position:relative; left:8%; width: 625; border: 1px solid black;\"><div style=\"text-align: left; background-color: #CCC\"><b>Problem 3:</b> " . stripslashes($sql_array['problem_3_statement']) . "</div>"; $host_form_items_string .= "<div style=\"position:relative; left:10px\"><b>Goal:</b> <font class=\"note\">Check all that apply</font><br />$goal_prob_3</div>"; $host_form_items_string .= "<div style=\"position:relative; left:10px\"><b>Objectives:</b> <font class=\"note\">Check all that apply</font><br />$objectives_prob_3</div>"; $host_form_items_string .= "<div style=\"position:relative; left:10px\"><b>Interventions:</b> <font class=\"note\">Check all that apply</font><br />$interventions_prob_3</div></div>"; } } //get our program locations codes $codes_query_string = "SELECT * FROM code_support WHERE type_cd=39 ORDER BY item_cd ASC"; //if($User_ID==1) echo "$codes_query_string<br/>"; $codes_query_result = mysql_query($codes_query_string) or die ("Error in program locs query"); $program_loc_string = ""; $i = 0; while($codes_query_array = mysql_fetch_array($codes_query_result)) { $program_loc_string .= "<input ctp_reqrd=\"1\" type=\"radio\" name=\"program_where\" value=\"$codes_query_array[1]\""; if(IsSet($program_where)) { if($program_where == $i + 1) $program_loc_string .= " checked=\"checked\"$disabled_string>$codes_query_array[2] "; else $program_loc_string .= "$disabled_string>$codes_query_array[2] "; } else $program_loc_string .= "$disabled_string>$codes_query_array[2] "; $i++; } require_once("form_submit.inc"); include_once("cpt_form.inc"); include_once("form_check.inc"); include_once("date_functions.inc"); $frm_str = <<<EOT <html> <head> <title>$this_custom_tech_customer $form_title_string</title> $style_string <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> </head> <body onload="calc_total_time('time_in_','time_out_',4,'total_time')"> $javascript_select_function $javascript_string $date_javascript $form_check_java <center> <form name="psych_eval" method="post" action="$thisfile" enctype="application_x-www-form-urlencoded" onKeyUp="highlight(event)" onClick="highlight(event)"> $patient_multi_string <table width="625" border="0"> <tr> <td colspan="2"> <table width="100%" border="0" bgcolor="$my_bgcolor" class="ui-corner-all"> <tr> <td><b>NAME:</b> <font class="dbd">$first_name $last_name</font></td> <td><b>CLIENT #:</b> <font class="dbd">$patient_num</font> <b>Medical Record#:</b> <font class="dbd">$medical_record_num</font> <input type="hidden" name="patient_id" value="$this_patient_id"></td> </tr> <tr> <td><b>$this_custom_tech_customer</b></td> <td><b>LOCATION:</b> <font class="dbd">$clinic_name $clinic_provider_num</font></td> </tr> <tr> <td><b>DATE:</b> <input date="1" ctp_reqrd="1" type="text" id="seen_date" name="seen_date" size="8" value="$seen_date"><input type="hidden" name="completed_date" value="$completed_date"></td> </tr> </table> </td> </tr> <tr> <td colspan="2"><br /><b>ACTIVITY THERAPY NOTE:</b><br /></td> </tr> <tr> <td colspan="2"><b>DIAGNOSIS:</b> <font class="dbd">$diagnosis</font><input type="hidden" name="diagnosis" value="$diagnosis"></td> </tr> <tr> <td colspan="2"><b>DOB:</b> <font class="dbd">$dob</font></td> </tr> <tr> <td colspan="2"><br><b>DATA FROM THE MTP:</b>$pre_note<br />$host_form_items_string <table width="100%" border="0"> <tr> <td width="5%"> </td> <td><b>GOALS FROM THE MTP:</b>$multi_pre_note<br /> <textarea ctp_reqrd="1" id="goals" name="goals" rows="5" cols="80">$goals</textarea></td> </tr> <tr> <td width="5%"> </td> <td><b>OBJECTIVES FROM THE MTP:</b>$multi_pre_note<br /> <textarea ctp_reqrd="1" id="objectives" name="objectives" rows="5" cols="80">$objectives</textarea></td> </tr> <tr> <td width="5%"> </td> <td><b>INTERVENTIONS FROM THE MTP:</b><br /> <textarea ctp_reqrd="1" id="interventions" name="interventions" rows="5" cols="80">$interventions</textarea></td> </td> </tr> </table> </td> </tr> <tr> <td colspan="2"><br /><b>PROGRESS/RESPONSE:</b> <table width="100%" border="0"> <tr> <td width="5%"> </td> <td>How is the client responding to your efforts?$multi_pre_note<br /> <textarea ctp_reqrd="1" name="response" rows="5" cols="80">$response</textarea></td> </tr> <tr> <td width="5%"> </td> <td>Is the client improving, regressing, or staying the same?$multi_pre_note<br /> <textarea ctp_reqrd="1" name="progress" rows="5" cols="80">$progress</textarea></td> </tr> </table> </td> </tr> <tr> <td colspan="2"><center><font class="note">Please enter times using the HH:MM A/PM format such as 12:45 pm</font> <table border="0"> <tr> <td><b>TIME IN:</b></td> <td><b>TIME OUT:</b></td> </tr> <tr> <td><input onblur="calc_total_time('time_in_','time_out_',4,'total_time')" ctp_reqrd="1" type="text" id="time_in_1" name="time_in_1" size="7" value="$time_in_1"></td> <td><input onblur="calc_total_time('time_in_','time_out_',4,'total_time')" ctp_reqrd="1" type="text" id="time_out_1" name="time_out_1" size="7" value="$time_out_1"></td> </tr> <tr> <td><input onblur="calc_total_time('time_in_','time_out_',4,'total_time')" type="text" id="time_in_2" name="time_in_2" size="7" value="$time_in_2"></td> <td><input onblur="calc_total_time('time_in_','time_out_',4,'total_time')" type="text" id="time_out_2" name="time_out_2" size="7" value="$time_out_2"></td> </tr> <tr> <td><input onblur="calc_total_time('time_in_','time_out_',4,'total_time')" type="text" id="time_in_3" name="time_in_3" size="7" value="$time_in_3"></td> <td><input onblur="calc_total_time('time_in_','time_out_',4,'total_time')" type="text" id="time_out_3" name="time_out_3" size="7" value="$time_out_3"></td> </tr> <tr> <td><input onblur="calc_total_time('time_in_','time_out_',4,'total_time')" type="text" id="time_in_4" name="time_in_4" size="7" value="$time_in_4"></td> <td><input onblur="calc_total_time('time_in_','time_out_',4,'total_time')" type="text" id="time_out_4" name="time_out_4" size="7" value="$time_out_4"></td> </tr> </table><font class="note">Note: The Total Time will be system calculated</font><br /> <b>TOTAL TIME: </b><input type="text" id="total_time" name="total_time" size="8" value="$total_time">minutes</center> </td> </tr> <tr> <td><br /><center><b>Supervisor's Signature</b></center> <table border=0 width=100%> <tr><td colspan="2"></td></tr> <tr> <td width="70%"><b>Supervisor:</b> <select name="sup_id_fk" size="1"><option value="72"> Canfield, Scot [Nurse Practitioner/Supervisor]</option><option value="66"> Jackson, Tia [supervisor/Therapist]</option><option value="124"> Lira, Misti [intake Coordinator/Supervisor]</option><option value="38"> Martin, Lillian [Asst. Clinical Director/Supervisor]</option></select></td> <td>Date:<u> </u></td> </tr> </table> </td> </tr> <tr> <td colspan="2"><br><br><b>PROGRAM LOCATION:</b>$program_loc_string<br /><input ctp_reqrd="1" type="text" name="program_location" size="110" value="$program_location"></td> </tr> <tr> <td colspan="2">$adult_cpt_select_string</td> </tr> <tr> <th colspan="2">$submit_button_string</th> </tr> </table> </form> </center> </body> </html> EOT; $message = $frm_str; } print($message); ?>
  5. get sql error on line 7 and error in signature.inc file: Sorry for code length..i'm desparate to figure this out..ugh. signature.inc file <?php // Include this file to add signatures to the print output // This file will set two signature variables: md_sig and clinician_sig //first step is to use the query results from the cpt_form.inc for the billed_by var if(IsSet($billed_by)) $sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $billed_by"; else $sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $completed_by_fk"; //echo "clinician_sig: $sql_query <br />"; $sql_query_result = mysql_query($sql_query) or die ("Error in sql_query signatures.inc"); $sql_array = mysql_fetch_array($sql_query_result); $clinician_sig = $sql_array[0]; $clinician_name_string = "$sql_array[1] $sql_array[2]"; if(file_exists($clinician_sig)) $clinician_sig = "<img src=\"$clinician_sig\" border=\"0\" />"; else $clinician_sig = "<br /><br /><br />"; //now clean up the date format if(IsSet($completed_date)) $completed_date_string = strftime("%m/%d/%Y", strtotime($completed_date)); else $completed_date_string=""; if(IsSet($approved_by) && $approved_by != "") { $sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $approved_by"; //echo "md_sig: $sql_query <br />"; $sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc"); $sql_array = mysql_fetch_array($sql_query_result); $md_sig = $sql_array[0]; //echo "sig: $md_sig <br />"; $md_name_string = "$sql_array[1] $sql_array[2]"; if(file_exists($md_sig)) { $md_sig = "<img src=\"$md_sig\" border=\"0\" alt=\"\" />"; $md_date_string = strftime("%m/%d/%Y", strtotime($approved_date)); } else { $md_sig = "<br /><br /><br />"; } //now clean up the date format $approved_date_string = strftime("%m/%d/%Y", strtotime($approved_date)); } else { $md_sig = ""; $md_name_string = "FORM IS NOT APPROVED"; $approved_date_string=""; } if(IsSet($psychiatrist_id_fk) && $psychiatrist_id_fk != 0) { $sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $psychiatrist_id_fk"; //echo "md_sig: $sql_query <br />"; $sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc"); $sql_array = mysql_fetch_array($sql_query_result); $psychiatrist_sig = $sql_array[0]; $psychiatrist_name_string = "$sql_array[1] $sql_array[2]"; if(file_exists($psychiatrist_sig)) $psychiatrist_sig = "<img src=\"$psychiatrist_sig\" border=\"0\" alt=\"test\" />"; $approved_date_string = strftime("%m/%d/%Y", strtotime($approved_date)); } else { $psychiatrist_sig = "<br /><br /><br />"; $psychiatrist_name_string = "Not Assigned"; $approved_date_string=""; } if(IsSet($therapist_id_fk) && $therapist_id_fk != 0) { $sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $therapist_id_fk"; //echo "md_sig: $sql_query <br />"; $sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc"); $sql_array = mysql_fetch_array($sql_query_result); $therapist_sig = $sql_array[0]; $therapist_name_string = "$sql_array[1] $sql_array[2]"; if(file_exists($therapist_sig)) $therapist_sig = "<img src=\"$therapist_sig\" border=\"0\" alt=\"test\" />"; $therapist_date_string = strftime("%m/%d/%Y", strtotime($completed_date)); } else { $therapist_sig = "<br /><br /><br />"; $therapist_name_string=""; $therapist_date_string=""; } if(IsSet($activity_therapist_id_fk) && $activity_therapist_id_fk != 0) { $sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $activity_therapist_id_fk"; //echo "md_sig: $sql_query <br />"; $sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc"); $sql_array = mysql_fetch_array($sql_query_result); $activity_therapist_sig = $sql_array[0]; $activity_therapist_name_string = "$sql_array[1] $sql_array[2]"; if(file_exists($activity_therapist_sig)) $activity_therapist_sig = "<img src=\"$activity_therapist_sig\" border=\"0\" alt=\"test\" />"; $activity_date_string = strftime("%m/%d/%Y", strtotime($completed_date)); } else { $activity_therapist_sig = "<br /><br /><br />"; $activity_therapist_name_string=""; $activity_date_string=""; } if(IsSet($case_manager_id_fk) && $case_manager_id_fk != 0) { $sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $case_manager_id_fk"; //echo "md_sig: $sql_query <br />"; $sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc"); $sql_array = mysql_fetch_array($sql_query_result); $case_manager_sig = $sql_array[0]; $case_manager_name_string = "$sql_array[1] $sql_array[2]"; if(file_exists($case_manager_sig)) $case_manager_sig = "<img src=\"$case_manager_sig\" border=\"0\" alt=\"test\" />"; $case_date_string = strftime("%m/%d/%Y", strtotime($completed_date)); } else { $case_manager_sig = "<br /><br /><br />"; $case_manager_name_string=""; $case_date_string=""; } if(IsSet($other_id_fk) && $other_id_fk != 0) { $sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $other_id_fk"; //echo "md_sig: $sql_query <br />"; $sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc"); $sql_array = mysql_fetch_array($sql_query_result); $other_sig = $sql_array[0]; $other_name_string = "$sql_array[1] $sql_array[2]"; if(file_exists($other_sig)) $other_sig = "<img src=\"$other_sig\" border=\"0\" alt=\"test\" />"; $other_date_string = strftime("%m/%d/%Y", strtotime($completed_date)); } else { $other_sig = "<br /><br /><br />"; $other_name_string=""; $other_date_string=""; } ?> and activity_therapy_note_insert.inc <?PHP // activity_therapy_note_insert.inc // our vars if(IsSet($_SESSION['User_ID']) and $_SESSION['User_level'] > 10) //valid user with access privs? { $this_validation = NULL; if(IsSet($_POST['this_validation'])) $this_validation = mysql_real_escape_string($_POST['this_validation']); elseif(IsSet($_GET['this_validation'])) $this_validation = mysql_real_escape_string($_GET['this_validation']); $host_form_id = "NULL"; if(IsSet($_POST['host_form_id'])) $host_form_id = mysql_real_escape_string($_POST['host_form_id']); elseif(IsSet($_GET['host_form_id'])) $host_form_id = mysql_real_escape_string($_GET['host_form_id']); $host_form_name = ""; if(IsSet($_POST['host_form_name'])) $host_form_name = mysql_real_escape_string($_POST['host_form_name']); elseif(IsSet($_GET['host_form_name'])) $host_form_name = mysql_real_escape_string($_GET['host_form_name']); $completed_by_fk = $User_ID; if(IsSet($_POST['completed_date'])) $completed_date = mysql_real_escape_string($_POST['completed_date']); $last_edited = "'" . date("Y-m-d G:i:s") . "'"; if(IsSet($_POST['seen_date'])) $seen_date = mysql_real_escape_string($_POST['seen_date']); else $seen_date = ""; if(IsSet($_POST['diagnosis'])) $diagnosis = mysql_real_escape_string($_POST['diagnosis']); else $diagnosis = ""; /*if(IsSet($_POST['end_time'])) $end_time = mysql_real_escape_string($_POST['end_time']); else $end_time = "";*/ $start_time=NULL; $end_time=NULL; if(IsSet($_POST['goals'])) $goals = mysql_real_escape_string($_POST['goals']); else $goals = ""; if(IsSet($_POST['objectives'])) $objectives = mysql_real_escape_string($_POST['objectives']); else $objectives = ""; if(IsSet($_POST['interventions'])) $interventions = mysql_real_escape_string($_POST['interventions']); else $interventions = ""; if(IsSet($_POST['response'])) $response = mysql_real_escape_string($_POST['response']); else $response = ""; if(IsSet($_POST['progress'])) $progress = mysql_real_escape_string($_POST['progress']); else $progress = ""; if(IsSet($_POST['time_in_1'])) $time_in_1 = mysql_real_escape_string($_POST['time_in_1']); else $time_in_1 = ""; if(IsSet($_POST['time_out_1'])) $time_out_1 = mysql_real_escape_string($_POST['time_out_1']); else $time_out_1 = ""; if(IsSet($_POST['time_in_2'])) $time_in_2 = mysql_real_escape_string($_POST['time_in_2']); else $time_in_2 = ""; if(IsSet($_POST['time_out_2'])) $time_out_2 = mysql_real_escape_string($_POST['time_out_2']); else $time_out_2 = ""; if(IsSet($_POST['time_in_3'])) $time_in_3 = mysql_real_escape_string($_POST['time_in_3']); else $time_in_3 = ""; if(IsSet($_POST['time_out_3'])) $time_out_3 = mysql_real_escape_string($_POST['time_out_3']); else $time_out_3 = ""; if(IsSet($_POST['time_in_4'])) $time_in_4 = mysql_real_escape_string($_POST['time_in_4']); else $time_in_4 = ""; if(IsSet($_POST['time_out_4'])) $time_out_4 = mysql_real_escape_string($_POST['time_out_4']); else $time_out_4 = ""; if(IsSet($_POST['total_time'])) $total_time = mysql_real_escape_string($_POST['total_time']); else $total_time = ""; if(IsSet($_POST['program_location'])) $program_location = mysql_real_escape_string($_POST['program_location']); else $program_location = ""; if(IsSet($_POST['program_where'])) $program_where = mysql_real_escape_string($_POST['program_where']); else $program_where = ""; // Added 11/6/2009 We need to look at the seen_date and start and end times to make sure they don't overlap an already billed form // If it does, we provide a "message" and we set the validation to Conflict //$start_time //include('cpt_time_check.inc'); if($this_form_action == "Insert") { if(!$host_form_id) $host_form_id = "NULL"; if($this_validation == "Bill") $completed_date = "'" . date("Y-m-d G:i:s") . "'"; else $completed_date = "NULL"; $insert_string = "INSERT INTO activity_therapy_note (form_id_pk, patient_id_fk, completed_date, last_edited, seen_date, completed_by_fk,diagnosis, start_time, end_time, goals, objectives, interventions, response, progress, time_in_1, time_out_1, time_in_2, time_out_2, time_in_3, time_out_3, time_in_4, time_out_4, total_time, sup_id_fk, program_location,program_where, host_form_id_fk, host_form_table_name )VALUES (NULL, '$this_patient_id',$completed_date,$last_edited,'$seen_date', '$User_ID','$diagnosis', NULL, NULL, '$goals', '$objectives','$interventions', '$response', '$progress', '$time_in_1', '$time_out_1', '$time_in_2', '$time_out_2', '$time_in_3', '$time_out_3', '$time_in_4', '$time_out_4','$total_time', '$sup_id_fk', $program_location','$program_where', $host_form_id,'$host_form_name' )"; //echo "<br /><br /><br />$insert_string"; $message = "<html><body><br /><br /><center>"; $insert_result = mysql_query($insert_string); if(mysql_error() == "") { $message .= "<font color=#0000DD>Success. $first_name $last_name's $form_title_string was inserted.</font>"; } else print(mysql_error()); //Use built-in function to get the new patient's ID $this_eval_form_id = mysql_insert_id(); // Now Update our billing code for this patient/this form // for below //<INPUT TYPE=\"submit\" name=\"submit_b\" VALUE=\"Print\" onclick=\"newwindow=window.open('ct_splash.html','mywindow','width=680,height=680,menubar=yes,scrollbars=yes,resizable=yes');if(window.focus)newwindow.focus()\"></form> this Activity Therapy Note form<br />"; if($this_validation == "Bill") { include("cpt_form_insert.inc"); $message .= "<form method=\"post\" action=\"activity_therapy_note.php\" target=\"mywindow\" enctype=\"application_x-www-form-urlencoded\"> <input type=\"hidden\" name=\"patient_id\" value=\"$this_patient_id\"> <input type=\"hidden\" name=\"eval_form_id\" value=\"$this_eval_form_id\"> <INPUT TYPE=\"submit\" name=\"submit_b\" VALUE=\"Print\" onclick=\"newwindow=window.open('ct_splash.html','mywindow','$win_width,menubar=yes,scrollbars=yes,resizable=yes');if(window.focus)newwindow.focus()\"></form> this Activity Therapy Note form<br />"; $this_form_action = 'Blank'; } else { //$message .= $cpt_time_message; $this_form_action = 'Update'; } //echo $insert_string; } /**/ if($this_form_action == "Add" && (!$completed_date || $completed_date == "NULL") ) { if($this_validation == "Bill") $completed_date = "'" . date("Y-m-d G:i:s") . "'"; else $completed_date = "NULL"; $update_string = "UPDATE `activity_therapy_note` SET `completed_date` = $completed_date, `completed_by_fk` = $User_ID, 'sup_id_fk' = $sup_id_fk `last_edited` = $last_edited, `seen_date` = '$seen_date', `diagnosis` = '$diagnosis', `start_time` = NULL, `end_time` = NULL, `goals` = '$goals', `objectives` = '$objectives', `interventions` = '$interventions', `response` = '$response', `progress` = '$progress', `time_in_1` = '$time_in_1', `time_out_1` = '$time_out_1', `time_in_2` = '$time_in_2', `time_out_2` = '$time_out_2', `time_in_3` = '$time_in_3', `time_out_3` = '$time_out_3', `time_in_4` = '$time_in_4', `time_out_4` = '$time_out_4', `total_time` = '$total_time', `program_location` = '$program_location', `program_where` = '$program_where' WHERE `form_id_pk` = '$this_eval_form_id' LIMIT 1"; //echo $update_string . "<br />"; $update_result = mysql_query($update_string); if(mysql_affected_rows() == 1) { // Now Update our billing code for this patient/this form //else include("cpt_form_update.inc"); $message = "<html><body><br /><br /><center><font color=\"#0000DD\">Success. $first_name $last_name's $form_title_string was updated.</font>"; if($this_validation == "Bill") { include("cpt_form_insert.inc"); $message .= "<form method=\"post\" action=\"activity_therapy_note.php\" target=\"mywindow\" enctype=\"application_x-www-form-urlencoded\"> <input type=\"hidden\" name=\"patient_id\" value=\"$this_patient_id\"> <input type=\"hidden\" name=\"eval_form_id\" value=\"$this_eval_form_id\"> <INPUT TYPE=\"submit\" name=\"submit_b\" VALUE=\"Print\" onclick=\"newwindow=window.open('ct_splash.html','mywindow','$win_width,menubar=yes,scrollbars=yes,resizable=yes');if(window.focus)newwindow.focus()\"></form> this Activity Therapy Note form<br />"; $this_form_action = 'Blank'; } else { //$message .= $cpt_time_message; $this_form_action = 'Update'; } } else { print(mysql_error()); // Now Update our billing code for this patient/this form // else include("cpt_form_update.inc"); $message = "<html><body><br /><br /><center><font color=#0000DD>No information was changed so nothing to update.</font>"; if($this_validation == "Bill") { include("cpt_form_insert.inc"); $message .= "<form method=\"post\" action=\"activity_therapy_note.php\" target=\"mywindow\" enctype=\"application_x-www-form-urlencoded\"> <input type=\"hidden\" name=\"patient_id\" value=\"$this_patient_id\"> <input type=\"hidden\" name=\"eval_form_id\" value=\"$this_eval_form_id\"> <INPUT TYPE=\"submit\" name=\"submit_b\" VALUE=\"Print\" onclick=\"newwindow=window.open('ct_splash.html','mywindow','$win_width,menubar=yes,scrollbars=yes,resizable=yes');if(window.focus)newwindow.focus()\"></form> this Activity Therapy Note form or<br />"; } else { //$message .= $cpt_time_message; $this_form_action = 'Update'; } } } elseif($this_form_action == "Add") { $message = "<html><body><br /><br /><center><font class=req>Error: you are not allowed to update a signed and billed form. Open an Addendum.</font>"; } } ?>
  6. Ok, I see. the IsSet....how would I post it to that column where it's not IsSet?
  7. I shouldn't get it from the post...I should post it to the sup_id_fk column in the activity_therapy_note table. Each user has 4 ids...and the id will populate a png picture signature file. I get all sorts of errors.....because probably I don't know what the heck I'm doing...arghhh....took this site over from someone
  8. so instead of this ... if(IsSet($_POST['sup_id_fk'])) $sup_id_fk = mysql_real_escape_string($_POST['sup_id_fk']); else $sup_id_fk = ""; it would be this: if(IsSet($_POST['sup_id_fk'])) $value = mysql_real_escape_string($_POST['sup_id_fk']); else $sup_id_fk = "";
  9. ok...there is heredoc in the php. So I have this drop own menu <select name="sup_id_fk" size="1"><option value="72"> Canfield, Scot [Nurse Practitioner/Supervisor]</option><option value="66"> Jackson, Tia [supervisor/Therapist]</option><option value="124"> Lira, Misti [intake Coordinator/Supervisor]</option><option value="38"> Martin, Lillian [Asst. Clinical Director/Supervisor]</option></select></td> so the sup_id_fk becomes the value correct? or am I missing something? The the correct syntax would be if($sup_id_fk == 72) $sup_sig = <img src="sigs/Scot_Canfield.png" border="0" />; Correct? Then to print the signature if(($completed_date_string != "")) { echo ' <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom">'. $clinician_sig. '<hr /></td> <td valign="bottom">'. $completed_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $sup_sig. '<hr /></td> <td valign="bottom">'. $completed_date_string. '<hr />Date:</td> </tr>
  10. Got it fixed. Thanks. I need to put a break in heredoc...I thought this would work, but it isn't. Any comments? Thanks. $frm_str = <<<EOP <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> *alot of *stuff* </html> EOP; $message .= $frm_str; if(($md_date_string != "") && ($other_name_string != "")) { echo ' <tr> what I need in the middle } $frm_str = <<<EOP <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> second part </html> EOP; $message .= $frm_str; }
  11. What's wrong with this statement? It works with the md_date_string...., but there is not always an other...so if the other is blank then it needs not to show. if($md_date_string != "") && ($other_name_string != "") { echo ' <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom">'. $md_sig. '<hr />Psychiatrist: '. $md_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $case_manager_sig. '<hr />Case Manager: '. $case_manager_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $therapist_sig. '<hr />Therapist: '. $therapist_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $activity_therapist_sig. '<hr />Activity Therapist: '. $activity_therapist_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $other_sig. '<hr />Other: '. $other_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td colspan="2"><br />NEXT TREATMENT PLAN REVIEW: <font class="dbd">$next_review</font></td> </tr> </table> </td> </tr>'; } elseif ($md_date_string = "") && ($other_name_string != "") { echo ' <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom"><hr />Psychiatrist: '. $md_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Case Manager: '. $case_manager_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Therapist: '. $therapist_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Activity Therapist: '. $activity_therapist_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Other: '. $other_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td colspan="2"><br />NEXT TREATMENT PLAN REVIEW: <font class="dbd">$next_review</font></td> </tr> </table> </td> </tr>'; } elseif ($md_date_string = "") && ($other_name_string = "") echo ' <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom"><hr />Psychiatrist: '. $md_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Case Manager: '. $case_manager_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Therapist: '. $therapist_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Activity Therapist: '. $activity_therapist_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td colspan="2"><br />NEXT TREATMENT PLAN REVIEW: <font class="dbd">$next_review</font></td> </tr> </table> </td> </tr>'; } else { echo ' <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom">'. $md_sig. '<hr />Psychiatrist: '. $md_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $case_manager_sig. '<hr />Case Manager: '. $case_manager_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $therapist_sig. '<hr />Therapist: '. $therapist_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $activity_therapist_sig. '<hr />Activity Therapist: '. $activity_therapist_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td colspan="2"><br />NEXT TREATMENT PLAN REVIEW: <font class="dbd">$next_review</font></td> </tr> </table> </td> </tr>'; } }
  12. HOT DAMN!!!!! I FIGURED IT OUT. I DID IT THIS WAY: if($md_date_string != "") { echo ' <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom">'. $md_sig. '<hr />Psychiatrist: '. $md_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $case_manager_sig. '<hr />Case Manager: '. $case_manager_name_string. '</td> <td valign="bottom">'. $case_date_string. '<hr />Date:</td> </tr> </table> </td> </tr>'; } else { echo ' <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom"><hr />Psychiatrist: '. $md_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Case Manager: '. $case_manager_name_string. '</td> <td valign="bottom">'. $case_date_string. '<hr />Date:</td> </tr> </table> </td> </tr>'; } } HOWEVER...There is another issue. The signatures appear at the top and not the bottom. Anyone know why this is?
  13. Ok, I tried it this way and the signatures aren't show up at all again. This is so confusing. The signatures are in a signatures.inc file...and it's included. if(file_exists($md_sig)) { echo ' <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom">'. $md_sig. '<hr />Psychiatrist: '. $md_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $case_manager_sig. '<hr />Case Manager: '. $case_manager_name_string. '</td> <td valign="bottom">'. $case_date_string. '<hr />Date:</td> </tr> </table> </td> </tr>'; } else { echo ' <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom"><hr />Psychiatrist: '. $md_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Case Manager: '. $case_manager_name_string. '</td> <td valign="bottom">'. $case_date_string. '<hr />Date:</td> </tr> </table> </td> </tr>'; } }
  14. Should I add the empty if statement into the signature.inc file? <?php // Include this file to add signatures to the print output // This file will set two signature variables: md_sig and clinician_sig //first step is to use the query results from the cpt_form.inc for the billed_by var if(IsSet($billed_by)) $sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $billed_by"; else $sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $completed_by_fk"; //echo "clinician_sig: $sql_query <br />"; $sql_query_result = mysql_query($sql_query) or die ("Error in sql_query signatures.inc"); $sql_array = mysql_fetch_array($sql_query_result); $clinician_sig = $sql_array[0]; $clinician_name_string = "$sql_array[1] $sql_array[2]"; if(file_exists($clinician_sig)) $clinician_sig = "<img src=\"$clinician_sig\" border=\"0\" />"; else $clinician_sig = "<br /><br /><br />"; //now clean up the date format if(IsSet($completed_date)) $completed_date_string = strftime("%m/%d/%Y", strtotime($completed_date)); else $completed_date_string=""; if(IsSet($approved_by) && $approved_by != "") { $sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $approved_by"; //echo "md_sig: $sql_query <br />"; $sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc"); $sql_array = mysql_fetch_array($sql_query_result); $md_sig = $sql_array[0]; //echo "sig: $md_sig <br />"; $md_name_string = "$sql_array[1] $sql_array[2]"; if(file_exists($md_sig)) { $md_sig = "<img src=\"$md_sig\" border=\"0\" alt=\"\" />"; $md_date_string = strftime("%m/%d/%Y", strtotime(approved_date)); } else { $md_sig = "<br /><br /><br />"; } //now clean up the date format $approved_date_string = strftime("%m/%d/%Y", strtotime($approved_date)); } else { $md_sig = "<br /><br /><br />"; $md_name_string = "Waiting for Approval"; $md_date_string=""; } if(IsSet($psychiatrist_id_fk) && $psychiatrist_id_fk != 0) { $sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $psychiatrist_id_fk"; //echo "md_sig: $sql_query <br />"; $sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc"); $sql_array = mysql_fetch_array($sql_query_result); $psychiatrist_sig = $sql_array[0]; $psychiatrist_name_string = "$sql_array[1] $sql_array[2]"; if(file_exists($psychiatrist_sig)) $psychiatrist_sig = "<img src=\"$psychiatrist_sig\" border=\"0\" alt=\"test\" />"; $approved_date_string = strftime("%m/%d/%Y", strtotime($approved_date)); } else { $psychiatrist_sig = "<br /><br /><br />"; $psychiatrist_name_string = "Not Assigned"; $approved_date_string=""; } if(IsSet($therapist_id_fk) && $therapist_id_fk != 0) { $sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $therapist_id_fk"; //echo "md_sig: $sql_query <br />"; $sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc"); $sql_array = mysql_fetch_array($sql_query_result); $therapist_sig = $sql_array[0]; $therapist_name_string = "$sql_array[1] $sql_array[2]"; if(file_exists($therapist_sig)) $therapist_sig = "<img src=\"$therapist_sig\" border=\"0\" alt=\"test\" />"; $therapist_date_string = strftime("%m/%d/%Y", strtotime($completed_date)); } else { $therapist_sig = "<br /><br /><br />"; $therapist_name_string=""; $therapist_date_string=""; } if(IsSet($activity_therapist_id_fk) && $activity_therapist_id_fk != 0) { $sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $activity_therapist_id_fk"; //echo "md_sig: $sql_query <br />"; $sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc"); $sql_array = mysql_fetch_array($sql_query_result); $activity_therapist_sig = $sql_array[0]; $activity_therapist_name_string = "$sql_array[1] $sql_array[2]"; if(file_exists($activity_therapist_sig)) $activity_therapist_sig = "<img src=\"$activity_therapist_sig\" border=\"0\" alt=\"test\" />"; $activity_date_string = strftime("%m/%d/%Y", strtotime($completed_date)); } else { $activity_therapist_sig = "<br /><br /><br />"; $activity_therapist_name_string=""; $activity_date_string=""; } if(IsSet($case_manager_id_fk) && $case_manager_id_fk != 0) { $sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $case_manager_id_fk"; //echo "md_sig: $sql_query <br />"; $sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc"); $sql_array = mysql_fetch_array($sql_query_result); $case_manager_sig = $sql_array[0]; $case_manager_name_string = "$sql_array[1] $sql_array[2]"; if(file_exists($case_manager_sig)) $case_manager_sig = "<img src=\"$case_manager_sig\" border=\"0\" alt=\"test\" />"; $case_date_string = strftime("%m/%d/%Y", strtotime($completed_date)); } else { $case_manager_sig = "<br /><br /><br />"; $case_manager_name_string=""; $case_date_string=""; } if(IsSet($other_id_fk) && $other_id_fk != 0) { $sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $other_id_fk"; //echo "md_sig: $sql_query <br />"; $sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc"); $sql_array = mysql_fetch_array($sql_query_result); $other_sig = $sql_array[0]; $other_name_string = "$sql_array[1] $sql_array[2]"; if(file_exists($other_sig)) $other_sig = "<img src=\"$other_sig\" border=\"0\" alt=\"test\" />"; $other_date_string = strftime("%m/%d/%Y", strtotime($completed_date)); } else { $other_sig = "<br /><br /><br />"; $other_name_string=""; $other_date_string=""; } ?>
  15. Ugh, thanks for trying to help. This is increasing my blood pressure really bad...ugh. Anyone else know about this?
  16. The file is attached. I tried the code you had...same thing. It's a php file. Thanks. 17477_.php
  17. This is at very top )) { } else { } ?> and this comes out where it should. The first has signatures, but the second doesn't. It's doesn't show here though..but it's listed wice TREATMENT TEAM SIGNATURES Services ordered are Appropriate�See SMI/SED for additional explanation Psychiatrist: Waiting for Approval Date: testCase Manager: Jacqueline Thomas 02/02/2012 Date: testTherapist: Devonda Newsome 02/02/2012 Date: Activity Therapist: Date: testOther: Denita Malone 02/02/2012 Date: NEXT TREATMENT PLAN REVIEW: 05/08/2012 TREATMENT TEAM SIGNATURES Services ordered are Appropriate�See SMI/SED for additional explanation Psychiatrist: Waiting for Approval Date: Case Manager: Jacqueline Thomas 02/02/2012 Date: Therapist: Devonda Newsome 02/02/2012 Date: Activity Therapist: Date: Other: Denita Malone 02/02/2012 Date: NEXT TREATMENT PLAN REVIEW: 05/08/2012
  18. <?php if(file_exists($md_sig)) { <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom">$md_sig<hr />Psychiatrist: $md_name_string</td> <td valign="bottom">$md_date_string<hr />Date:</td> </tr> <tr> <td valign="bottom">$case_manager_sig<hr />Case Manager: $case_manager_name_string</td> <td valign="bottom">$case_date_string <hr />Date:</td> </tr> <tr> <td valign="bottom">$therapist_sig<hr />Therapist: $therapist_name_string</td> <td valign="bottom">$therapist_date_string <hr />Date:</td> </tr> <tr> <td valign="bottom">$activity_therapist_sig<hr />Activity Therapist: $activity_therapist_name_string</td> <td valign="bottom">$activity_date_string <hr />Date:</td> </tr> <tr> <td valign="bottom">$other_sig<hr />Other: $other_name_string</td> <td valign="bottom">$other_date_string <hr />Date:</td> </tr> <tr> <td colspan="2"><br />NEXT TREATMENT PLAN REVIEW: <font class="dbd">$next_review</font></td> </tr> </table> </td> </tr> } else { <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom"><hr />Psychiatrist: $md_name_string</td> <td valign="bottom">$md_date_string<hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Case Manager: $case_manager_name_string</td> <td valign="bottom">$case_date_string <hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Therapist: $therapist_name_string</td> <td valign="bottom">$therapist_date_string <hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Activity Therapist: $activity_therapist_name_string</td> <td valign="bottom">$activity_date_string <hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Other: $other_name_string</td> <td valign="bottom">$other_date_string <hr />Date:</td> </tr> <tr> <td colspan="2"><br />NEXT TREATMENT PLAN REVIEW: <font class="dbd">$next_review</font></td> </tr> </table> </td> </tr> } ?>
  19. Ok, did the if else for table....and I had two tables come up...one with signatures and one without. Can't figure out why both displayed. Tried the last...and it didn't empty the sigs.
  20. how would I turn this html code into an if else state...if the $md_sig is not there...the others aren't supposed to show up. If the md approves it and the$md_sig is there...all the other sigs need to populate <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom">$md_sig<hr />Psychiatrist: $md_name_string</td> <td valign="bottom">$approved_date_string <hr />Date:</td> </tr> <tr> <td valign="bottom">$case_manager_sig<hr />Case Manager: $case_manager_name_string</td> <td valign="bottom">$case_date_string <hr />Date:</td> </tr> <tr> <td valign="bottom">$therapist_sig<hr />Therapist: $therapist_name_string</td> <td valign="bottom">$therapist_date_string <hr />Date:</td> </tr> <tr> <td valign="bottom">$activity_therapist_sig<hr />Activity Therapist: $activity_therapist_name_string</td> <td valign="bottom">$activity_date_string <hr />Date:</td> </tr> <tr> <td valign="bottom">$other_sig<hr />Other: $other_name_string</td> <td valign="bottom">$other_date_string <hr />Date:</td> </tr> <tr> <td colspan="2"><br />NEXT TREATMENT PLAN REVIEW: <font class="dbd">$next_review</font></td> </tr> </table> </td> </tr>
  21. How can I find the invalid argument in all of this mess? Thanks.
  22. Anyone know why an empty date is showing up as 12/31/1969? Thanks. if(IsSet($approved_by) && $approved_by != "") { $sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $approved_by"; //echo "md_sig: $sql_query <br />"; $sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc"); $sql_array = mysql_fetch_array($sql_query_result); $md_sig = $sql_array[0]; //echo "sig: $md_sig <br />"; $md_name_string = "$sql_array[1] $sql_array[2]"; if(file_exists($md_sig)) { $md_sig = "<img src=\"$md_sig\" border=\"0\" alt=\"\" />"; } else { $md_sig = "<br /><br /><br />"; } //now clean up the date format $approved_date_string = strftime("%m/%d/%Y", strtotime($approved_date)); } else { $md_sig = "<br /><br /><br />"; $md_name_string = "Waiting for Approval"; $approved_date_string=""; }
  23. kenny724

    help

    Hi, everyone. I need a little help on where to begin here. I need a search option to bring up a table like which has check marks. When someone searches for 309.81...all the information just needs to appear below. Then it has to be checked...when inserted it needs to be saved. For now, if someone searches for that code...how can I have all this appear? Little confused. Thanks. DIAGNOSTIC FORMULATION (interpretive summary): Search by: Number Key word [] 309.81 Posttraumatic Stress Disorder Specify: [] Acute: if duration of symptoms is less than 3 months [] Chronic: if duration of symptoms is 3 months or more Specify: [] With Delayed Onset: if onset of symptoms is at least 6 months after the stressor Posttraumatic Stress Disorder core criteria: [] Duration of the disturbance is more than 1 month. [] The disturbance causes clinically significant distress or impairment in social, occupational, or other important areas of functioning. The person has been exposed to a traumatic event in which both of the following were present- [] Person experienced, witnessed, or was confronted with an event or events that involved actual or threatened death or serious injury, or a threat to the physical integrity of self or others. [] Person's response involved intense fear, helplessness, or horror. [] In children- this may be expressed instead by disorganized or agitated behavior. Traumatic event is persistently re-experienced in 1 or more of the following ways- [] Recurrent and intrusive distressing recollections of the event, including images, thoughts, or perceptions. [] In young children, repetitive play occurs in which themes or aspects of the trauma are expressed. [] Recurrent distressing dreams of the event. [] In children- there may be frightening dreams without recognizable content. [] Acting or feeling as if the traumatic event were recurring. [] In young children, trauma-specific reenactment may occur. [] Intense psychological distress at exposure to internal or external cues that symbolize or resemble an aspect of the traumatic event. [] Physiological reactivity on exposure to internal or external cues that symbolize or resemble an aspect of the traumatic event. Persistent avoidance of stimuli associated with the trauma and numbing of general responsiveness (not present before the trauma), as indicated by 3 or more of the following: [] Efforts to avoid thoughts, feelings, or conversations associated with the trauma. [] Efforts to avoid activities, places, or people that arouse recollections of the trauma. [] Inability to recall an important aspect of the trauma [] Markedly diminished interest or participation in significant activities. [] Feeling of detachment or estrangement from others. [] Restricted range of affect. [] Sense of a foreshortened future. Persistent symptoms of increased arousal (not present before the trauma), as indicated by 2 or more of the following: [] Difficulty falling or staying asleep [] Irritability or outbursts of anger [] Difficulty concentrating [] Hypervigilance [] Exaggerated startle response
  24. the main pages being my html pages that is. Thanks for any help.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.