<?php if (isset($_REQUEST['yf'])) { echo "<br>"; if ($date_from == $date_to) { echo LangUtil::$generalTerms['DATE'] . ": " . DateLib::mysqlToString($date_from); } else { echo LangUtil::$generalTerms['FROM_DATE'] . ": " . DateLib::mysqlToString($date_from); echo " | "; echo LangUtil::$generalTerms['TO_DATE'] . ": " . DateLib::mysqlToString($date_to); } } ?> <br> <?php $patient = get_patient_by_id($patient_id); if ($patient == null) { echo LangUtil::$generalTerms['PATIENT_ID'] . " {$patient_id} " . LangUtil::$generalTerms['MSG_NOTFOUND']; } else { # Fetch test entries to print in report $record_list = get_records_to_print($lab_config, $patient_id); # If single date supplied, check if- # 1. Physician name is the same for all # 2. Patient daily number is the same for all # 3. All tests were completed or not $physician_same = false; $daily_number_same = false; $all_tests_completed = false; if ($date_from == $date_to) { $physician_same = true; $daily_number_same = true;
} ?> <br><a href='specimen_info.php?sid=<?php echo $specimen->specimenId; ?> '> <?php echo LangUtil::$generalTerms['DETAILS']; ?> »</a> </div> <?php return; } # Print HTML results form $test_list = get_tests_by_specimen_id($specimen->specimenId); $patient = get_patient_by_id($specimen->patientId); ?> <div class='pretty_box'> <?php if (0) { if ($_SESSION['sid'] != 0) { echo LangUtil::$generalTerms['SPECIMEN_ID'] . ": "; $specimen->getAuxId(); echo "<br>"; } if ($_SESSION['pid'] != 0) { echo LangUtil::$generalTerms['PATIENT_ID'] . ": " . $patient->surrogateId . "<br>"; } if ($_SESSION['dnum'] != 0) { echo LangUtil::$generalTerms['PATIENT_DAILYNUM'] . ": " . $specimen->getDailyNum() . "<br>";
function update_patient($modified_record) { # Updates an existing patient record # Called from ajax/patient_update.php $myFile = "../../local/myFile.txt"; $fh = fopen($myFile, 'a') or die("can't open file"); $pid = $modified_record->patientId; $current_record = get_patient_by_id($pid); if ($modified_record->name == "") { $modified_record->name = $current_record->name; } if (trim($modified_record->age) == "" || is_nan($modified_record->age)) { $modified_record->age = 0; } $query_string = "UPDATE patient SET " . "name='{$modified_record->name}', " . "surr_id='{$modified_record->surrogateId}', " . "addl_id='{$modified_record->addlId}', " . "sex='{$modified_record->sex}', "; if ($modified_record->age != 0) { $today = date("Y-m-d"); $today_parts = explode("-", $today); # Find year of birth based on supplied age value if ($modified_record->age < 0) { # Age was specified in months $timestamp = mktime(0, 0, 0, $today_parts[1] - -1 * $modified_record->age, $today_parts[2], $today_parts[0]); $year = date("Y", $timestamp); $month = date("m", $timestamp); $dob = ""; $modified_record->partialDob = $year . "-" . $month; } else { # Age specified in years $timestamp = mktime(0, 0, 0, $today_parts[1], $today_parts[2], $today_parts[0] - $modified_record->age); $year = date("Y", $timestamp); $dob = ""; $modified_record->partialDob = $year; } } $modified_record->age = 0; if ($modified_record->partialDob != "") { $query_string .= "age={$modified_record->age}, partial_dob='{$modified_record->partialDob}' "; } else { if ($modified_record->dob != "") { $query_string .= "age={$modified_record->age}, partial_dob='', dob='{$modified_record->dob}' "; } } $query_string .= "WHERE patient_id={$pid}"; fwrite($fh, $query_string); fclose($fh); query_blind($query_string); # Addition of custom fields: done from calling function/page return true; }
public function getPatientUpdateForm($pid) { $patient = get_patient_by_id($pid); $lab_config = LabConfig::getById($_SESSION['lab_config_id']); ?> <form name='profile_update_form' id='profile_update_form'> <input type='hidden' value='<?php echo $patient->patientId; ?>' name='patient_id'></input> <input type='hidden' value='0' name='pd_ym' id='pd_ym'></input> <input type='hidden' value='0' name='pd_y' id='pd_y'></input> <table class='hor-minimalist-b'> <tbody> <tr <?php if($lab_config->pid == 0) { echo " style='display:none;' "; } ?>> <td><u><?php echo LangUtil::$generalTerms['PATIENT_ID']; ?></u></td> <td> <input type='text' name='surr_id' id='surr_id' value='<?php echo $patient->surrogateId; ?>' class='uniform_width'></input> </td> </tr> <tr <?php if($lab_config->patientAddl == 0) { echo " style='display:none;' "; } ?>> <td><u><?php echo LangUtil::$generalTerms['ADDL_ID']; ?></u></td> <td> <input type='text' value='<?php echo $patient->addlId; ?>' name='addl_id' class='uniform_width'></input> </td> </tr> <tr> <td><u><?php echo LangUtil::$generalTerms['NAME']; ?></u></td> <td> <input type='text' value='<?php echo $patient->name; ?>' name='name' class='uniform_width'></input> </td> </tr> <tr> <td><u><?php echo LangUtil::$generalTerms['GENDER']; ?></u></td> <td> <select name='sex' class='uniform_width'> <option value='M' <?php if($patient->sex == 'M') echo " selected "; ?> > <?php echo LangUtil::$generalTerms['MALE']; ?> </option> <option value='F' <?php if($patient->sex == 'F') echo " selected "; ?> > <?php echo LangUtil::$generalTerms['FEMALE']; ?> </option> </select> </tr> <tr> <td><u title='Enter either Age or Date of Birth'><?php echo LangUtil::$generalTerms['AGE']; ?></u></td> <td> <?php if($patient->age != null and $patient->age != "" and $patient->age != "0") { ?> <input type='text' name='age' id='age' value='<?php echo $patient->age; ?>' class='uniform_width'></input> <?php } else { ?> <input type='text' name='age' id='age' value='' class='uniform_width'></input> <?php } ?> <select name='age_param' id='age_param'> <option value='1'><?php echo LangUtil::$generalTerms['YEARS']; ?></option> <option value='2'><?php echo LangUtil::$generalTerms['MONTHS']; ?></option> </select> </td> </tr> <tr valign='top'> <td><u title='Enter either Age or Date of Birth'><?php echo LangUtil::$generalTerms['DOB']; ?></u></td> <td><?php $value_list = array(); $name_list = array(); $id_list = array(); $name_list[] = "yyyy"; $name_list[] = "mm"; $name_list[] = "dd"; $id_list = $name_list; if($patient->partialDob != null && $patient->partialDob != "") { # Partial DoB value is present if(strpos($patient->partialDob, "-") === false) { # Year-only available $value_list[] = $patient->partialDob; $value_list[] = ""; $value_list[] = ""; } else { # Year and month available $partial_dob_parts = explode("-", $patient->partialDob); $value_list[] = $partial_dob_parts[0]; $value_list[] = $partial_dob_parts[1]; $value_list[] = ""; } } else if($patient->dob == null || $patient->dob == "") { # DoB not previously entered $value_list[] = ""; $value_list[] = ""; $value_list[] = ""; } else { # Previous DoB value exists $dob_parts = explode("-", $patient->dob); $value_list = $dob_parts; } $this->getDatePicker($name_list, $id_list, $value_list, $show_format=true); ?> </td> </tr> <?php # Custom fields here $custom_field_list = get_custom_fields_patient(); $custom_data_list = get_custom_data_patient($patient->patientId); $custom_data_map = array(); foreach($custom_data_list as $custom_data) { $custom_data_map[$custom_data->fieldId] = $custom_data->fieldValue; } foreach($custom_field_list as $custom_field) { ?> <tr valign='top'> <td><u><?php echo $custom_field->fieldName; ?></u></td> <td> <?php if(isset($custom_data_map[$custom_field->id])) $field_value = $custom_data_map[$custom_field->id]; else $field_value = ""; $this->getCustomFormField($custom_field, $field_value); ?> </td> </tr> <?php } ?> <tr> <td> </td> <td> <input type='button' value='<?php echo LangUtil::$generalTerms['CMD_UPDATE']; ?>' onclick='javascript:update_profile();'></input> <a href='javascript:toggle_profile_divs();'><?php echo LangUtil::$generalTerms['CMD_CANCEL']; ?></a> <span id='update_profile_progress' style='display:none;'><?php $this->getProgressSpinner(LangUtil::$generalTerms['CMD_SUBMITTING']); ?></span> </td> </tr> </tbody> </table> </form> <?php }
public function getPatientTaskList($patient_id) { $patient = get_patient_by_id($patient_id); $patient_num =$patient->getDailyNum(); $pieces = explode("-", $patient_num); # Lists patient-profile related tasks in a tips box $patientBarcodes = patientBarcodeCheck(); global $LIS_TECH_RO, $DISABLE_UPDATE_PATIENT_PROFILE; if($_SESSION['user_level'] != $LIS_TECH_RO) { ?> <div class='sidetip_nopos'> <p> <a href='new_specimen.php?pid=<?php echo $patient_id; ?>&dnum=<?php echo $pieces[1]; ?>' title='Click to Register a New Specimen for this Patient'> <?php echo LangUtil::$pageTerms['MSG_REGNEWSPECIMEN']; ?> </a> </p> <?php if(($DISABLE_UPDATE_PATIENT_PROFILE === false)&&(get_level_by_id($_SESSION['user_id']) ==2)) { ?> <p> <a href='javascript:toggle_profile_divs();' title='Click to Update Patient Profile'> <?php echo LangUtil::$pageTerms['MSG_UPDATEPROFILE']; ?> </a> </p> <?php } ?> <p> <a href='reports_testhistory.php?location=<?php echo $_SESSION['lab_config_id']; ?>&patient_id=<?php echo $patient_id; ?>' title='Click to Generate Test History Report for this Patient' target='_blank'> <?php echo LangUtil::$pageTerms['MSG_PRINTHISTORY']; ?> </a> </p> <?php if($patientBarcodes == 1) { ?> <p> <a href='javascript:print_patient_barcode();' title='Click to Print Patient Barcode'> <?php echo "Print Patient Barcode" ?> </a> </p> <?php } ?> <!--<p><a href='#'>Export as XML</a></p>--> <?php if (is_billing_enabled($_SESSION['lab_config_id'])) { ?> <p> <a rel='facebox' href='bill_generator.php?location=<?php echo$_SESSION['lab_config_id']; ?>&patient_id=<?php echo $patient_id; ?>' title='Click to generate a billing statement for this Patient' target='_blank'> <?php echo "Billing Report" ?> </a> </p> <?php } ?> </div> <?php } }
public function get_patient($patient_id) { /*$chk = check_api_token($tok); if($chk != 1) return $chk;*/ $pat = get_patient_by_id($patient_id); if ($pat != 3) { $ret = $pat; } else { $ret = 0; } return $ret; }