Beispiel #1
0
 public static function dobToAgeNumber($dob)
 {
     # Converts date of birth to age in years without appendin string " years"
     $today = date("m-d-Y");
     $dob_array = explode("-", $dob);
     # gives Y-m-d
     $dob_formatted = $dob_array[1] . "-" . $dob_array[2] . "-" . $dob_array[0];
     $diff = round(DateLib::dateDiff("-", $today, $dob_formatted) / 365, 0);
     return $diff;
 }
			<td><?php 
//echo $lab_config->getSiteName();
?>
</td>
		</tr>
		<tr>
			<td><?php 
echo LangUtil::$pageTerms['REPORT_PERIOD'];
?>
:</td>
			<td>
			<?php 
if ($date_from == $date_to) {
    echo DateLib::mysqlToString($date_from);
} else {
    echo DateLib::mysqlToString($date_from) . " to " . DateLib::mysqlToString($date_to);
}
?>
			</td>
		</tr>
		<?php 
if ($cat_code != 0) {
    # Specific tets category selected: Show category name in report
    ?>
			<tr>
				<td><?php 
    echo LangUtil::$generalTerms['LAB_SECTION'];
    ?>
:</td>
				<td><?php 
    echo getTestCategoryAggNameById($cat_code);
Beispiel #3
0
        ?>
");
			$('#mm_to').attr("value", "<?php 
        echo $latest_collection_parts[1];
        ?>
");
			$('#yyyy_to').attr("value", "<?php 
        echo $latest_collection_parts[0];
        ?>
");
			var date_from = "<?php 
        echo DateLib::mysqlToString($earliest_specimen->dateCollected);
        ?>
";
			var date_to = "<?php 
        echo DateLib::mysqlToString($latest_specimen->dateCollected);
        ?>
";
			var html_string = "";
			if(date_from == date_to)
			{
				html_string = "<br><?php 
        echo LangUtil::$generalTerms['DATE'] . ": ";
        ?>
"+date_from;		
			}
			else
			{
				html_string = "<br><?php 
        echo LangUtil::$generalTerms['FROM_DATE'] . ": ";
        ?>
Beispiel #4
0
function publishDates($date_from, $date_to)
{
    echo "<br><br>";
    if ($date_from == $date_to) {
        echo LangUtil::$generalTerms['DATE'] . ": " . DateLib::mysqlToString($date_from) . "<br>";
    } else {
        echo LangUtil::$generalTerms['FROM_DATE'] . ": " . DateLib::mysqlToString($date_from);
        echo " | ";
        echo LangUtil::$generalTerms['TO_DATE'] . ": " . DateLib::mysqlToString($date_to) . "<br>";
    }
    echo "<br>";
}
Beispiel #5
0
         $custom_data = get_custom_data_patient_bytype($patient->patientId, $custom_field->id);
         echo "<td>";
         if ($custom_data == null) {
             echo "-";
         } else {
             $field_value = $custom_data->getFieldValueString($lab_config->id, 2);
             if (trim($field_value) == "") {
                 $field_value = "-";
             }
             echo $field_value;
         }
         echo "</td>";
     }
 }
 if ($report_config->useDateRecvd == 1) {
     echo "<td>" . DateLib::mysqlToString($specimen->dateRecvd) . "</td>";
 }
 # Specimen Custom fields here
 $custom_field_list = $lab_config->getSpecimenCustomFields();
 foreach ($custom_field_list as $custom_field) {
     if (in_array($custom_field->id, $report_config->specimenCustomFields)) {
         echo "<td>";
         $custom_data = get_custom_data_specimen_bytype($specimen->specimenId, $custom_field->id);
         if ($custom_data == null) {
             echo "-";
         } else {
             $field_value = $custom_data->getFieldValueString($lab_config->id, 1);
             if ($field_value == "" or $field_value == null) {
                 $field_value = "-";
             }
             echo $field_value;
	<?php 
    return;
}
echo LangUtil::$generalTerms['FACILITY'];
?>
: <?php 
echo $lab_config->getSiteName();
?>
 | 
<?php 
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><br>
<?php 
DbUtil::switchToLabConfig($lab_config_id);
# Cumulative summary
$stat_list = StatsLib::getDiscreteInfectionStats($lab_config, $date_from, $date_to);
if (count($stat_list) == 0) {
    ?>
	<div class='sidetip_nopos'>
	<?php 
    echo LangUtil::$pageTerms['TIPS_NODISCRETE'];
    ?>
	</div>
	<?php 
Beispiel #7
0
'></input>
&nbsp;&nbsp;&nbsp;&nbsp;
<input type='button' onclick="javascript:window.close();" value='<?php 
echo LangUtil::$generalTerms['CMD_CLOSEPAGE'];
?>
'></input>
<hr>

<div id='export_content'>
<link rel='stylesheet' type='text/css' href='css/table_print.css' />
<?php 
# Site name and location
echo "<b>";
echo LangUtil::$generalTerms['FACILITY'] . ": " . $lab_config->getSiteName();
echo "<br>";
echo LangUtil::$generalTerms['G_DATE'] . ": " . DateLib::mysqlToString(date("Y-m-d"));
echo "</b>";
echo "<br><br>";
echo "<hr>";
# Summary
echo "<b>" . $LANG_ARRAY['lab_config_home']['MENU_CUSTOM'] . "</b>";
echo "<br><br>";
$page_elems->getLabConfigInfo($lab_config->id);
echo "<hr>";
echo "<br><br>";
/*
# Specimen types
echo "<b>".LangUtil::$generalTerms['SPECIMEN_TYPES']."</b>";
echo "<br><br>";
$specimen_id_list = get_lab_config_specimen_types($lab_config->id);
var_dump($specimen_id_list);
	
	<!--
	<td>
		<?php 
    # echo $specimen->specimenId;
    ?>
	</td>
	-->
	<td>
		<?php 
    echo $specimen->getTypeName();
    ?>
	</td>
	<td>
		<?php 
    echo DateLib::mysqlToString($specimen->dateRecvd);
    ?>
	</td>
	<td>
		<?php 
    echo $specimen->getTestNames();
    ?>
	</td>
	<td>
		<?php 
    echo $specimen->getStatus();
    ?>
	</td>
	</tr>
<?php 
}
Beispiel #9
0
 public function getDob()
 {
     # Returns patient dob value
     if ($this->partialDob != null && $this->partialDob != "") {
         return $this->partialDob . " (" . LangUtil::$generalTerms['APPROX'] . ")";
     } else {
         if ($this->dob == null || trim($this->dob) == "") {
             return " - ";
         } else {
             return DateLib::mysqlToString($this->dob);
         }
     }
 }
Beispiel #10
0
	public function getReportResultsForm($form_name, $form_id)
	{
		$specimen_list = Specimen::getUnreported();
		if($specimen_list == null || count($specimen_list) == 0)
			return;
		?>
		<table class='tablesorter'>
			<thead>
				<tr valign='top'>
					<?php
					if($_SESSION['pid'] != 0)
					{
						?>
						<th><?php echo LangUtil::$generalTerms['PATIENT_ID']; ?></th>
						<?php
					}
					if($_SESSION['dnum'] != 0)
					{
						?>
						<th><?php echo LangUtil::$generalTerms['PATIENT_DAILYNUM']; ?></th>
						<?php
					}
					if($_SESSION['s_addl'] != 0)
					{
						?>
						<th><?php echo LangUtil::$generalTerms['SPECIMEN_ID']; ?></th>
						<?php
					}
					?>
					<th><?php echo LangUtil::$generalTerms['PATIENT_NAME']; ?></th>
					<th><?php echo LangUtil::$generalTerms['SPECIMEN_TYPE']; ?></th>
					<th><?php echo LangUtil::$generalTerms['C_DATE']; ?></th>
					<th><?php echo LangUtil::$generalTerms['TESTS']; ?></th>
					<th><?php echo LangUtil::$generalTerms['REPORT_TO']; ?></th>
					<th>
						<?php echo LangUtil::$generalTerms['REPORTED']; ?>?
						<input type='checkbox' name='check_all' id='check_all' onclick='checkoruncheckall();'>
						</input>
					</th>
				</tr>
			</thead>
			<tbody>
			<?php
			foreach($specimen_list as $specimen)
			{
				$test_list = get_tests_by_specimen_id($specimen->specimenId);
				$patient = Patient::getById($specimen->patientId);
				?>
				<tr valign='top'>
					<input type='hidden' name='sid[]' value='<?php echo $specimen->specimenId; ?>'></input>
					<?php
					if($_SESSION['pid'] != 0)
					{
						?>
						<td><?php echo $specimen->getSurrogateId(); ?></td>
						<?php
					}
					if($_SESSION['dnum'] != 0)
					{
						?>
						<td><?php $specimen->getDailyNum(); ?></td>
						<?php
					}
					if($_SESSION['s_addl'] != 0)
					{
						?>
						<td><?php $specimen->getAuxId(); ?></td>
						<?php
					}
					?>
					<td><?php echo $patient->getName(); ?></td>
					<td><?php echo get_specimen_name_by_id($specimen->specimenTypeId); ?></td>
					<td><?php echo DateLib::mysqlToString($specimen->dateCollected)." ".$specimen->timeCollected; ?></td>
					<td>
						<?php 
						foreach($test_list as $test)
						{
							echo get_test_name_by_id($test->testTypeId);
							echo "<br>";
						}
						?>
					</td>
					<td><?php echo $specimen->getReportTo(); ?></td>
					<td>
						<center>
							<input type='checkbox' class='report_flag' name='mark_<?php echo $specimen->specimenId; ?>'></input>
						</center>
					</td>
				</tr>
				<?php
			}
			?>
			</tbody>
		</table>
		<?php
	}
             //echo " ".$measure->unit;
             //	echo "<br>";
         } else {
             echo "&nbsp;&nbsp;&nbsp;" . $measure->unit;
         }
         echo "<br>";
     }
     echo "</td>";
 }
 if ($report_config->useEntryDate == 1) {
     echo "<td>";
     if (trim($test->result) == "") {
         echo "-";
     } else {
         $ts_parts = explode(" ", $test->timestamp);
         echo DateLib::mysqlToString($ts_parts[0]);
     }
     echo "</td>";
 }
 if ($report_config->useRemarks == 1) {
     echo "<td>" . $test->getComments() . "</td>";
 }
 if ($report_config->useEnteredBy == 1) {
     echo "<td>" . $test->getEnteredBy() . "</td>";
 }
 if ($report_config->useVerifiedBy == 1) {
     echo "<td>" . $test->getVerifiedBy() . "</td>";
 }
 if ($report_config->useStatus == 1) {
     echo "<td>" . $test->getStatus() . "</td>";
 }
Beispiel #12
0
				<th><?php 
    echo LangUtil::$generalTerms['RESULTS'];
    ?>
</th>
			</tr>
		</thead>
		<tbody>
		<?php 
    $count = 1;
    foreach ($activity_test as $entry) {
        echo "<tr valign='top'>";
        echo "<td>{$count}</td>";
        $timestamp_parts = explode(" ", $entry->timestamp);
        $time_parts = explode(":", $timestamp_parts[1]);
        $specimen = Specimen::getById($entry->specimenId);
        echo "<td>" . DateLib::mysqlToString($timestamp_parts[0]) . " {$time_parts['0']}:{$time_parts['1']}</td>";
        echo "<td>";
        $specimen->getAuxId();
        echo "</td>";
        echo "<td>" . get_specimen_name_by_id($specimen->specimenTypeId) . "</td>";
        echo "<td>" . get_test_name_by_id($entry->testTypeId) . "</td>";
        echo "<td>" . $entry->decodeResult() . "</td>";
        echo "</tr>";
        $count++;
    }
    ?>
		</tbody>
	</table>
	<?php 
}
DbUtil::switchRestore($saved_db);
:</td>
			<td><?php 
echo $lab_config->getSiteName();
?>
</td>
		</tr>
		<tr>
			<td><?php 
echo LangUtil::$pageTerms['REPORT_PERIOD'];
?>
:</td>
			<td><?php 
echo DateLib::mysqlToString($date_from);
?>
 to <?php 
echo DateLib::mysqlToString($date_to);
?>
</td>
		</tr>
		<?php 
if ($cat_code != 0) {
    # Specific tets category selected: Show category name in report
    ?>
		<tr>
			<td><?php 
    echo LangUtil::$generalTerms['LAB_SECTION'];
    ?>
:</td>
			<td><?php 
    echo get_test_category_name_by_id($cat_code);
    ?>
Beispiel #14
0
            echo $row;
            ?>
"><?php 
            echo $currencyExchageRow->getCurrencyTo();
            array_push($alreadyExistingExchangeRates, $currencyExchageRow->getCurrencyTo());
            ?>
 </div>&nbsp;&nbsp;</td>
                                        <td>&nbsp;&nbsp; <input type="text" id="exchangeRate<?php 
            echo $row;
            ?>
" value="<?php 
            echo $currencyExchageRow->getExchangeRate();
            ?>
" size="4" />&nbsp;&nbsp; </td>
                                        <td>&nbsp;&nbsp; <?php 
            echo DateLib::mysqlToString($currencyExchageRow->getLastUpdatedDate());
            ?>
&nbsp;&nbsp; </td>
                                        <td>&nbsp;&nbsp; <a href="javascript:updateCurrencyRatio(<?php 
            echo $row;
            ?>
);">Update</a>&nbsp;&nbsp; | &nbsp;&nbsp;<a href="javascript:deleteCurrencyRatio(<?php 
            echo $row;
            ?>
);">Delete</a> &nbsp;&nbsp; </td>
                                        </tr>
                                        <?php 
            $row++;
        }
        ?>
                                        </table>
</style>
<div id='report_config_content'>
<h3><?php 
LangUtil::$generalTerms['PATIENT_BARCODE'];
?>
</h3>
<?php 
echo "<b>" . LangUtil::$generalTerms['FACILITY'] . "</b>: &nbsp;&nbsp;" . $lab_config->getSiteName() . "&nbsp;&nbsp;";
?>
 <?php 
if ($date_from == $date_to) {
    echo "&nbsp;&nbsp;<b>" . LangUtil::$generalTerms['DATE'] . "&nbsp;&nbsp;</b>: " . DateLib::mysqlToString($date_from) . "&nbsp;&nbsp;";
} else {
    echo "&nbsp;&nbsp;<b>" . LangUtil::$generalTerms['FROM_DATE'] . "&nbsp;&nbsp;</b>: " . DateLib::mysqlToString($date_from) . "&nbsp;&nbsp;";
    echo " | ";
    echo "&nbsp;&nbsp;<b>" . LangUtil::$generalTerms['TO_DATE'] . "&nbsp;&nbsp;</b>: " . DateLib::mysqlToString($date_to) . "&nbsp;&nbsp;";
}
?>
  
<?php 
if ((count($patient_list) == 0 || $patient_list == null) && (count($patient_list_U) == 0 || $patient_list_U == null)) {
    echo LangUtil::$pageTerms['TIPS_NONEWPATIENTS'];
    return;
}
?>
<br><br>
<?php 
$patientCount = 0;
foreach ($patient_list as $patient) {
    ?>
<input type="text" id="barcodeCode<?php