public function getSpecimenInfo($sid) { # Returns HTML table displaying specimen info $specimen = get_specimen_by_id($sid); if($specimen == null) { ?> <div class='sidetip_nopos'> <?php echo LangUtil::$generalTerms['ERROR'].": ".LangUtil::$generalTerms['SPECIMEN_ID']." ".LangUtil::$generalTerms['MSG_NOTFOUND']; ?> </div> <?php return; } ?> <table class='hor-minimalist-b'> <tbody> <tr> <td><u><?php echo LangUtil::$generalTerms['TYPE']; ?></u></td> <td><?php echo get_specimen_name_by_id($specimen->specimenTypeId); ?></td> </tr> <?php if($_SESSION['sid'] != 0) { ?> <tr valign='top' style='display:none;'> <td><u>DB Key</u></td> <td><?php echo $specimen->specimenId; ?></td> </tr> <?php } if($_SESSION['s_addl'] != 0) { ?> <tr> <td><u><?php echo LangUtil::$generalTerms['SPECIMEN_ID']; ?></u></td> <td><?php $specimen->getAuxId(); ?></td> </tr> <?php } if($_SESSION['dnum'] != 0) { ?> <tr> <td><u><?php echo LangUtil::$generalTerms['PATIENT_DAILYNUM']; ?></u></td> <td><?php echo $specimen->getDailyNum(); ?></td> </tr> <?php } ?> <tr valign='top'> <td><u><?php echo LangUtil::$generalTerms['ACCESSION_NUM']; ?></u></td> <td><?php echo $specimen->sessionNum; ?></td> </tr> <tr> <td><u><?php echo LangUtil::$generalTerms['PATIENT']; ?></u></td> <td> <?php $patient = Patient::getById($specimen->patientId); echo $patient->getName()." (".$patient->sex." ".$patient->getAge().")"; ?> <a href='patient_profile.php?pid=<?php echo $specimen->patientId?>' title='Click to go to Patient Profile'>Profile</a> </td> </tr> <tr> <td><u><?php echo LangUtil::$generalTerms['R_DATE']; ?></u></td> <td> <?php echo DateLib::mysqlToString($specimen->dateRecvd); ?> </td> </tr> <tr> <td><u><?php echo LangUtil::$generalTerms['REGD_BY']; ?></u></td> <td><?php echo get_username_by_id($specimen->userId); ?></td> </tr> <?php if($_SESSION['comm'] != 0) { ?> <tr> <td><u><?php echo LangUtil::$generalTerms['COMMENTS']; ?></u></td> <td><?php echo $specimen->getComments(); ?></td> </tr> <?php } ?> <tr valign='top'> <td><u><?php echo LangUtil::$generalTerms['TESTS']; ?></u></td> <td><?php echo $specimen->getTestNames(); ?></td> </tr> <?php if($_SESSION['doctor'] != 0) { ?> <tr> <td><u><?php echo LangUtil::$generalTerms['DOCTOR']; ?></u></td> <td> <?php if(trim($specimen->doctor) == "") { echo "-"; } else { echo $specimen->doctor; } ?> </td> </tr> <?php } ?> <?php # Custom fields here $custom_data_list = get_custom_data_specimen($specimen->specimenId); foreach($custom_data_list as $custom_data) { $field_name = get_custom_field_name_specimen($custom_data->fieldId); if(stripos($field_name ,"^^")==NULL) { $field_value = $custom_data->fieldValue; ?> <tr> <td><u><?php echo $field_name; ?></u></td> <td><?php echo $custom_data->getFieldValueString($_SESSION['lab_config_id'], 1); ?></td> </tr> <?php } } if($_SESSION['refout'] != 0) { # Show referred-out hospital name if specimen was referred out and/or returned back if ( $specimen->statusCodeId == Specimen::$STATUS_REFERRED || $specimen->statusCodeId == Specimen::$STATUS_RETURNED ) { ?> <tr> <td><u><?php echo LangUtil::$generalTerms['REF_TO']; ?></u></td> <td> <?php if(trim($specimen->referredToName) == "") { echo "Not Known"; } else { echo $specimen->referredToName; } ?> </td> </tr> <?php } } ?> <tr> <td><u><?php echo LangUtil::$generalTerms['SP_STATUS']; ?></u></td> <td> <?php echo $specimen->getStatus(); $result1="Completed"; $result= $specimen->getStatus(); ?> <a href='specimen_result.php?sid=<?php echo $specimen->specimenId;?>' <?php if(strcmp($result,$result1)==0){ ?> style='display:none;' <?php }?> title='Click to Enter result values for this Specimen'><?php echo LangUtil::$generalTerms['ENTER_RESULTS']; ?></a> </td> </tr> </tbody> </table> <?php }
public function getSpecimenInfo($sid) { # Returns HTML table displaying specimen info $specimen = get_specimen_by_id($sid); //print_r($rem_specs); if($specimen == null) { ?> <div class='sidetip_nopos'> <?php echo LangUtil::$generalTerms['ERROR'].": ".LangUtil::$generalTerms['SPECIMEN_ID']." ".LangUtil::$generalTerms['MSG_NOTFOUND']; ?> </div> <?php return; } $rem_recs = get_removed_specimens($_SESSION['lab_config_id'], "specimen"); $rem_specs = array(); $rem_remarks = array(); foreach($rem_recs as $rem_rec) { $rem_specs[] = $rem_rec['r_id']; $rem_remarks[] = $rem_rec['remarks']; } ?> <script type="text/javascript"> function retrieve_deleted(sid, category){ var params = "item_id="+sid+"&ret_cat="+category; $.ajax({ type: "POST", url: "ajax/retrieve_deleted.php", data: params, success: function(msg) { if(msg.indexOf("1")> -1){ location.href = location.href; } else { $("#target_div_id_del").html("Specimen cannot be Retrieved"); } } }); } </script> <table class='hor-minimalist-b'> <tbody> <tr> <td><u><?php echo LangUtil::$generalTerms['TYPE']; ?></u></td> <td><?php echo get_specimen_name_by_id($specimen->specimenTypeId); ?></td> </tr> <?php if($_SESSION['sid'] != 0) { ?> <tr valign='top' style='display:none;'> <td><u>DB Key</u></td> <td><?php echo $specimen->specimenId; ?></td> </tr> <?php } if($_SESSION['s_addl'] != 0) { ?> <tr> <td><u><?php echo LangUtil::$generalTerms['SPECIMEN_ID']; ?></u></td> <td><?php $specimen->getAuxId(); ?></td> </tr> <?php } if($_SESSION['dnum'] != 0) { ?> <tr> <td><u><?php echo LangUtil::$generalTerms['PATIENT_DAILYNUM']; ?></u></td> <td><?php echo $specimen->getDailyNum(); ?></td> </tr> <?php } ?> <tr valign='top'> <td><u><?php echo LangUtil::$generalTerms['ACCESSION_NUM']; ?></u></td> <td><?php echo $specimen->sessionNum; ?></td> </tr> <tr> <td><u><?php echo LangUtil::$generalTerms['PATIENT']; ?></u></td> <td> <?php $patient = Patient::getById($specimen->patientId); echo $patient->getName()." (".$patient->sex." ".$patient->getAge().")"; ?> <a href='patient_profile.php?pid=<?php echo $specimen->patientId?>' title='Click to go to Patient Profile'>Profile</a> </td> </tr> <tr> <td><u><?php echo LangUtil::$generalTerms['R_DATE']; ?></u></td> <td> <?php echo DateLib::mysqlToString($specimen->dateRecvd); ?> </td> </tr> <tr> <td><u><?php echo LangUtil::$generalTerms['REGD_BY']; ?></u></td> <td><?php echo get_username_by_id($specimen->userId); ?></td> </tr> <?php if($_SESSION['comm'] != 0) { ?> <tr> <td><u><?php echo LangUtil::$generalTerms['COMMENTS']; ?></u></td> <td><?php echo $specimen->getComments(); ?></td> </tr> <?php } ?> <tr valign='top'> <td><u><?php echo LangUtil::$generalTerms['TESTS']; ?></u></td> <td><?php echo $specimen->getTestNames(); ?></td> </tr> <?php if($_SESSION['doctor'] != 0) { ?> <tr> <td><u><?php echo LangUtil::$generalTerms['DOCTOR']; ?></u></td> <td> <?php if(trim($specimen->doctor) == "") { echo "-"; } else { echo $specimen->doctor; } ?> </td> </tr> <?php } ?> <?php # Custom fields here $custom_data_list = get_custom_data_specimen($specimen->specimenId); foreach($custom_data_list as $custom_data) { $field_name = get_custom_field_name_specimen($custom_data->fieldId); if(stripos($field_name ,"^^")==NULL) { $field_value = $custom_data->fieldValue; ?> <tr> <td><u><?php echo $field_name; ?></u></td> <td><input type="text" value="<?php echo $custom_data->getFieldValueString($_SESSION['lab_config_id'], 1); ?>" /></td> </tr> <?php } } if($_SESSION['refout'] != 0) { # Show referred-out hospital name if specimen was referred out and/or returned back if ( $specimen->statusCodeId == Specimen::$STATUS_REFERRED || $specimen->statusCodeId == Specimen::$STATUS_RETURNED ) { if(strlen(trim($specimen->referredToName)) > 0){ ?> <tr> <td><u><?php echo LangUtil::$generalTerms['REF_TO']; ?></u></td> <td> <?php if(trim($specimen->referredToName) == "") { echo "Not Known"; } else { echo $specimen->referredToName; } ?> </td> </tr> <?php } if(strlen(trim($specimen->referredFromName)) > 0){ ?> <tr> <td><u><?php echo "Referred From "; ?></u></td> <td> <?php if(trim($specimen->referredFromName) == "") { echo "Not Known"; } else { echo $specimen->referredFromName; } ?> </td> </tr> <?php } } } ?> <tr> <td><u><?php echo LangUtil::$generalTerms['SP_STATUS']; ?></u></td> <td> <?php if(in_array($specimen->specimenId, $rem_specs) && is_admin(get_user_by_id($_SESSION['user_id']))!=1){ echo "Specimen Removed. Contact lab admin"; } else if(in_array($specimen->specimenId, $rem_specs) && is_admin(get_user_by_id($_SESSION['user_id']))==1){ ?> <a href='javascript:retrieve_deleted(<?php echo $specimen->specimenId;?>, "specimen")' title='Click to retrieve deleted Specimen'>Retrieve Specimen</a> <?php } else { echo $specimen->getStatus(); $result1="Completed"; $result= $specimen->getStatus(); ?> <a href='specimen_result.php?sid=<?php echo $specimen->specimenId;?>' <?php if(strcmp($result,$result1)==0 || $_SESSION['user_level'] == 17){ ?> style='display:none;' <?php }?> title='Click to Enter result values for this Specimen'><?php echo LangUtil::$generalTerms['ENTER_RESULTS']; ?></a> <?php } ?> </td> </tr> </tbody> </table> <?php }