<!-- End Patient Information --> <!-- Start Sample Test Information --> <div style=\"padding: 0px 0px 2px 0px\"> <div style=\"padding: 5px; background: #ccc; border-bottom: 1px solid #666\"><strong>SAMPLE TEST INFORMATION</strong></div> <div style=\"padding: 2px 5px; border-left: 1px solid #999; border-right: 1px solid #999; border-bottom: 1px solid #999\"> <!-- Start Sample Collection Date --> <div style=\"width: 95%; padding:5px 0px; border-bottom: 1px solid #CCC\"> <table style=\"width: 95%\"> <tr> <td style=\"width: 23%\">Sample Collection Date:</td> <td style=\"width: 15%; padding:0px 5px\">".getFormattedDateLessDay($sampleCollectionDate)."</td> <td style=\"width: 15%\">Reception Date:</td> <td style=\"width: 10%\" style=\"padding:0px 5px\">".getFormattedDateLessDay($sampleReceiptDate)."</td> <td style=\"width: 20%\">Viral Load Test Date:</td> <td style=\"width: 17%; padding:0px 5px\">".getFormattedDateLessDay($sampleVLTestDate)."</td> </tr> </table> </div> <!-- End Sample Collection Date --> <!-- Start Repeat Test --> <div style=\"width: 95%; padding:5px 0px; border-bottom: 1px solid #CCC\"> <table style=\"width: 60%\"> <tr> <td style=\"width: 35%\">Repeat Test:</td> <td style=\"width: 2%\"><div style=\"padding: 1px; height: 12px; width:12px; border: 1px solid #333; text-align: center\">".(getDetailedTableInfo2("vl_logs_samplerepeats","sampleID='$sampleID' and withWorksheetID!=''","id")?"<img src=\"$home_url"."/images/check.gif\" />":" ")."</div></td> <td style=\"width: 18%; padding:0px 5px 0px 5px\">Yes</td> <td style=\"width: 2%\"><div style=\"padding: 1px; height: 12px; width:12px; border: 1px solid #333; text-align: center\">".(getDetailedTableInfo2("vl_logs_samplerepeats","sampleID='$sampleID' and withWorksheetID!=''","id")?" ":"<img src=\"$home_url"."/images/check.gif\" />")."</div></td> <td style=\"width: 43%; padding:0px 0px 0px 5px\">No</td> </tr>
<? //register a globals variable for security $GLOBALS['vlDC']=true; include "conf.php"; //CSV File $csv=0; $csv="Query,RemovedData,Date,User\n"; //compile $from and $to $from=0; $from="$fromYear-$fromMonth-$fromDay"; $to=0; $to="$toYear-$toMonth-$toDay"; $query=0; $query=mysqlquery("select * from vl_logs_removals where date(created)>='$from' and date(created)<='$to'"); if(mysqlnumrows($query)) { $q=array(); while($q=mysqlfetcharray($query)) { $csv.=preg_replace("/,/is","",$q["sqlQuery"]).",".preg_replace("/,/is","",$q["removedData"]).",".getFormattedDateLessDay($q["created"]).",$q[createdby]\n"; } } //output header("Content-type: application/vnd.ms-excel"); header("Content-disposition: attachment; filename=".($id?"$qFilename":"download.csv")); print $csv; ?>
} if($receiptDateYear && $receiptDateMonth && $receiptDateDay) { $receiptDate=0; $receiptDate="$receiptDateYear-$receiptDateMonth-$receiptDateDay"; //ensure received at CPHL date is not greater than the current date if(getStandardDateDifference($datetime,$receiptDate)<0) { $error.="<br /><strong>Received at CPHL Date ".getFormattedDateLessDay($receiptDate)." should not be in the future.</strong><br />Kindly provide an alternative Date<br />"; } //ensure received at CPHL date is not before 01-05-2014 if(getStandardDateDifference($receiptDate,"2014-05-01")<0) { $error.="<br /><strong>Received at CPHL Date ".getFormattedDateLessDay($receiptDate)." should not be prior to 01/May/2014.</strong><br />Kindly provide an alternative Date<br />"; } //ensure collection date is not greater than the received at CPHL date if($collectionDateYear && $collectionDateMonth && $collectionDateDay && getStandardDateDifference($receiptDate,$collectionDate)<0) { $error.="<br /><strong>Sample Collection Date ".getFormattedDateLessDay($collectionDate)." should not be greater than the Received at CPHL Date ".getFormattedDateLessDay($receiptDate).".</strong><br />Kindly provide an alternative Sample Collection Date<br />"; } } //input data if(!$error) { //log changes logTableChange("vl_samples","lrCategory",$modify,getDetailedTableInfo2("vl_samples","id='$modify'","lrCategory"),$lrCategory); logTableChange("vl_samples","lrEnvelopeNumber",$modify,getDetailedTableInfo2("vl_samples","id='$modify'","lrEnvelopeNumber"),$lrEnvelopeNumber); logTableChange("vl_samples","lrNumericID",$modify,getDetailedTableInfo2("vl_samples","id='$modify'","lrNumericID"),$lrNumericID); logTableChange("vl_samples","formNumber",$modify,getDetailedTableInfo2("vl_samples","id='$modify'","formNumber"),$formNumber); logTableChange("vl_samples","districtID",$modify,getDetailedTableInfo2("vl_samples","id='$modify'","districtID"),$districtID); logTableChange("vl_samples","hubID",$modify,getDetailedTableInfo2("vl_samples","id='$modify'","hubID"),$hubID); logTableChange("vl_samples","facilityID",$modify,getDetailedTableInfo2("vl_samples","id='$modify'","facilityID"),$facilityID); logTableChange("vl_samples","currentRegimenID",$modify,getDetailedTableInfo2("vl_samples","id='$modify'","currentRegimenID"),$currentRegimenID);
" width="20%"><?php echo $q["username"]; ?> </td> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> " width="40%"><?php echo $q["email"]; ?> </td> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> " width="20%"><?php echo getFormattedDate($q["login"]) ? getFormattedDateLessDay($q["login"]) : "Unavailable"; ?> </td> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> " width="20%"><a href="?act=admins&nav=configuration&modify=modify&id=<?php echo $q["id"]; ?> ">edit</a> :: <a href="javascript:if(confirm('Are you sure?')) { document.location.href='?act=admins&nav=configuration&option=remove&id=<?php echo $q["id"]; ?> '; }">delete</a></td> </tr> <? } ?> </table>
<td class="print-val"><?php echo getFormattedDateLessDay($row_collectionDate); ?> </td> </tr> <tr> <td>Reception Date: </td> <td class="print-val"><?php echo getFormattedDateLessDay($row_receiptDate); ?> </td> </tr> <tr> <td>Test Date: </td> <td class="print-val"><?php echo getFormattedDateLessDay($test_date); ?> </td> </tr> </table> </div> <div class="col-xs-6"> <table> <tr> <td>Repeat Test: </td> <td><?php echo MyHTML::boolean_draw($yes_no, $repeated);
<b>Last Viral Load Date</b>:<span class='input-sect'><?php echo MyHTML::text('smpl[repeatVLTestLastVLDate]', getFormattedDateLessDay($smpl_arr['repeatVLTestLastVLDate']), array('class' => 'sm_input date-picker')); ?> </span><br> <b>Value</b>: <span class='input-sect'><?php echo MyHTML::text('smpl[repeatVLTestValue]', $smpl_arr['repeatVLTestValue'], array('class' => 'sm_input')); ?> </span> <br> </td> <td width="50%" class='info-sect'> <b>Captured by</b>: <span class='input-sect'><?php echo $smpl_arr['createdby']; ?> <br> <b>On</b>: <span class='input-sect'><?php echo getFormattedDateLessDay($smpl_arr['created']); ?> <br> </td> </tr> <tr class='info-sect'> <td colspan='2'> <span class='hdg-sm'>Received Status</span><br> <select name="outcome" id="outcome" class="search" onchange="checkOutcome()"> <option value="">Select Outcome</option> <option value="Accepted">Accepted</option> <option value="Rejected">Rejected</option> </select> <div id="outcomeID"></div>
" width="30%"><?php echo $q["otherID"] ? $q["otherID"] : " "; ?> </td> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> " width="5%" align="center"><?php echo number_format((double) $numberSamples); ?> </td> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> " width="15%"><?php echo getFormattedDateLessDay($q["created"]); ?> </td> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> " width="20%"><a href="?act=addPatient&nav=datamanagement&modify=modify&id=<?php echo $q["id"]; ?> ">edit</a> :: <a href="javascript:if(confirm('Are you sure?')) { document.location.href='?act=addPatient&nav=datamanagement&option=remove&id=<?php echo $q["id"]; ?> '; }">delete</a></td> </tr> <? } ?> </table>
?> </td> <td align="center" style="padding: 5px; border-bottom: 1px solid #ccc; border-left: 1px solid #ccc"><?php echo $worksheetID ? "<div>" . getDetailedTableInfo2("vl_samples_worksheetcredentials", "id='{$worksheetID}' limit 1", "bulkLysisBuffer") . "</div><div class=\"vls_grey\"><strong>Exp Date:</strong> " . getFormattedDateLessDay(getDetailedTableInfo2("vl_samples_worksheetcredentials", "id='{$worksheetID}' limit 1", "bulkLysisBufferExpiryDate")) . "</div>" : " "; ?> </td> <td align="center" style="padding: 5px; border-bottom: 1px solid #ccc; border-left: 1px solid #ccc"><?php echo $worksheetID ? "<div>" . getDetailedTableInfo2("vl_samples_worksheetcredentials", "id='{$worksheetID}' limit 1", "control") . "</div><div class=\"vls_grey\"><strong>Exp Date:</strong> " . getFormattedDateLessDay(getDetailedTableInfo2("vl_samples_worksheetcredentials", "id='{$worksheetID}' limit 1", "controlExpiryDate")) . "</div>" : " "; ?> </td> <td align="center" style="padding: 5px; border-bottom: 1px solid #ccc; border-left: 1px solid #ccc"><?php echo $worksheetID ? "<div>" . getDetailedTableInfo2("vl_samples_worksheetcredentials", "id='{$worksheetID}' limit 1", "calibrator") . "</div><div class=\"vls_grey\"><strong>Exp Date:</strong> " . getFormattedDateLessDay(getDetailedTableInfo2("vl_samples_worksheetcredentials", "id='{$worksheetID}' limit 1", "calibratorExpiryDate")) . "</div>" : " "; ?> </td> <td align="center" style="padding: 5px; border-bottom: 1px solid #ccc; border-left: 1px solid #ccc; border-right: 1px solid #ccc"><?php echo $worksheetID ? "<div>" . getDetailedTableInfo2("vl_samples_worksheetcredentials", "id='{$worksheetID}' limit 1", "amplificationKit") . "</div><div class=\"vls_grey\"><strong>Exp Date:</strong> " . getFormattedDateLessDay(getDetailedTableInfo2("vl_samples_worksheetcredentials", "id='{$worksheetID}' limit 1", "amplificationKitExpiryDate")) . "</div>" : " "; ?> </td> </tr> </table></td> </tr> <? } ?> </table> </div> <div class="vl" style="padding:10px 0px 0px 0px"> <table width="100%" border="0" class="vl"> <? //abbott has 8 columns, so start by getting total number of rows $numberRows=0; $numberRows=ceil(count($contents)/$columns); $dataCounter=0;
<? //register a globals variable for security $GLOBALS['vlDC']=true; include "conf.php"; //CSV File $csv=0; $csv="URL,Logged,User\n"; //compile $from and $to $from=0; $from="$fromYear-$fromMonth-$fromDay"; $to=0; $to="$toYear-$toMonth-$toDay"; $query=0; $query=mysqlquery("select * from vl_logs_pagehits where date(created)>='$from' and date(created)<='$to'"); if(mysqlnumrows($query)) { $q=array(); while($q=mysqlfetcharray($query)) { $csv.="$q[url],".getFormattedDateLessDay($q["created"]).",$q[createdby]\n"; } } //output header("Content-type: application/vnd.ms-excel"); header("Content-disposition: attachment; filename=".($id?"$qFilename":"download.csv")); print $csv; ?>
</div> </div> <!-- End Patient Information --> <!-- Start Sample Test Information --> <div style=\"padding: 0px 0px 2px 0px\"> <div style=\"padding: 5px; background: #ccc; border-bottom: 1px solid #666\"><strong>SAMPLE TEST INFORMATION</strong></div> <div style=\"padding: 2px 5px; border-left: 1px solid #999; border-right: 1px solid #999; border-bottom: 1px solid #999\"> <!-- Start Sample Collection Date --> <div style=\"width: 95%; padding:5px 0px; border-bottom: 1px solid #CCC\"> <table style=\"width: 95%\"> <tr> <td style=\"width: 23%\">Sample Collection Date:</td> <td style=\"width: 15%; padding:0px 5px\">".getFormattedDateLessDay($sampleCollectionDate)."</td> <td style=\"width: 15%\">Reception Date:</td> <td style=\"width: 47%\" style=\"padding:0px 5px\">".getFormattedDateLessDay($sampleReceiptDate)."</td> </tr> </table> </div> <!-- End Sample Collection Date --> <!-- Start Repeat Test --> <div style=\"width: 95%; padding:5px 0px; border-bottom: 1px solid #CCC\"> <table style=\"width: 60%\"> <tr> <td style=\"width: 35%\">Repeat Test:</td> <td style=\"width: 2%\"><div style=\"padding: 1px; height: 12px; width:12px; border: 1px solid #333; text-align: center\">".(getDetailedTableInfo2("vl_logs_samplerepeats","sampleID='$sampleID' and withWorksheetID!=''","id")?"<img src=\"$home_url"."/images/check.gif\" />":" ")."</div></td> <td style=\"width: 18%; padding:0px 5px 0px 5px\">Yes</td> <td style=\"width: 2%\"><div style=\"padding: 1px; height: 12px; width:12px; border: 1px solid #333; text-align: center\">".(getDetailedTableInfo2("vl_logs_samplerepeats","sampleID='$sampleID' and withWorksheetID!=''","id")?" ":"<img src=\"$home_url"."/images/check.gif\" />")."</div></td> <td style=\"width: 43%; padding:0px 0px 0px 5px\">No</td> </tr>
<? //register a globals variable for security $GLOBALS['vlDC']=true; include "conf.php"; //CSV File $csv=0; $csv="TableName,FieldName,FieldID,fieldValueOld,fieldValueNew,Changed,User\n"; //compile $from and $to $from=0; $from="$fromYear-$fromMonth-$fromDay"; $to=0; $to="$toYear-$toMonth-$toDay"; $query=0; $query=mysqlquery("select * from vl_logs_tables where date(created)>='$from' and date(created)<='$to'"); if(mysqlnumrows($query)) { $q=array(); while($q=mysqlfetcharray($query)) { $csv.="$q[tableName],$q[fieldName],$q[fieldID],".preg_replace("/,/is","",$q["fieldValueOld"]).",".preg_replace("/,/is","",$q["fieldValueNew"]).",".getFormattedDateLessDay($q["created"]).",$q[createdby]\n"; } } //output header("Content-type: application/vnd.ms-excel"); header("Content-disposition: attachment; filename=".($id?"$qFilename":"download.csv")); print $csv; ?>
"><?php echo getFormattedDateLessDay($q["collectionDate"]); ?> </td> <td class="<?php echo $count < $num_rows ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo getFormattedDateLessDay($q["treatmentInitiationDate"]); ?> </td> <td class="<?php echo $count < $num_rows ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo getFormattedDateLessDay($q["receiptDate"]); ?> </td> <!-- <td class="<?php echo $count < $num_rows ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo preg_replace("/\\s/s", " ", getDetailedTableInfo2("vl_patients", "id='{$q['patientID']}'", "artNumber")); ?> </td> <td class="<?php echo $count < $num_rows ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo preg_replace("/\\s/s", " ", getDetailedTableInfo2("vl_patients", "id='{$q['patientID']}'", "otherID")); ?>
<td>Sample Type:</td> <td><?php echo getDetailedTableInfo2("vl_appendix_sampletype", "id='" . getDetailedTableInfo2("vl_samples", "id='{$id}' limit 1", "repeatVLTestSampleTypeID") . "' limit 1", "appendix"); ?> </td> </tr> <? } ?> <? if(getDetailedTableInfo2("vl_samples","id='$id' limit 1","vlTestingSuspectedTreatmentFailure")) { ?> <tr> <td style="padding:5px 0px; border-bottom: 1px dashed #dfe6e6" colspan="2"><strong>Suspected Treatment Failure</strong></td> </tr> <tr> <td>Last Viral Load Date:</td> <td><?php echo getFormattedDateLessDay(getDetailedTableInfo2("vl_samples", "id='{$id}' limit 1", "suspectedTreatmentFailureLastVLDate")); ?> </td> </tr> <tr> <td>Value:</td> <td><?php echo getDetailedTableInfo2("vl_samples", "id='{$id}' limit 1", "suspectedTreatmentFailureValue"); ?> </td> </tr> <tr> <td>Sample Type:</td> <td><?php echo getDetailedTableInfo2("vl_appendix_sampletype", "id='" . getDetailedTableInfo2("vl_samples", "id='{$id}' limit 1", "suspectedTreatmentFailureSampleTypeID") . "' limit 1", "appendix"); ?>
/** * update employer */ function XloadArtHistory($artNumber,$facilityID) { $artNumber=validate($artNumber); $facilityID=validate($facilityID); //concatenations, patient ID $uniqueID=0; $patientID=0; if($artNumber) { $artNumberModified=0; $artNumberModified=$artNumber; //clean art number by removing - . / and spaces $artNumberModified=preg_replace("/\-/s","",$artNumberModified); $artNumberModified=preg_replace("/\./s","",$artNumberModified); $artNumberModified=preg_replace("/\//s","",$artNumberModified); $artNumberModified=preg_replace("/\s/s","",$artNumberModified); $uniqueID=$facilityID."-A-$artNumberModified"; //$patientID=getDetailedTableInfo2("vl_patients","uniqueID='$uniqueID' and artNumber='$artNumber' limit 1","id"); $patientID=getDetailedTableInfo2("vl_patients","uniqueID='$uniqueID' limit 1","id"); } $objResponse = new vlDCResponse(); if($artNumber && $facilityID && $patientID) { //get historical samples from this ART/Facility $query=0; $query=mysqlquery("select * from vl_samples where patientUniqueID='$uniqueID' order by receiptDate desc limit 3"); $queryResults=""; $num=0; $num=mysqlnumrows($query); if($num) { $queryResults="<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td colspan=\"3\" class=\"vls_grey\" style=\"padding:0px 0px 8px 0px\">ART # <strong>$artNumber</strong> VL Testing History (last 3)</td> </tr> <tr> <td class=\"vl_tdsub\" width=\"5%\"><strong>Form #</strong></td> <td class=\"vl_tdsub\" width=\"85%\"><strong>Location ID</strong></td> <td class=\"vl_tdsub\" width=\"5%\" align=\"center\"><strong>Received at CPHL</strong></td> <td class=\"vl_tdsub\" width=\"5%\" align=\"center\"><strong>Date of Birth</strong></td> </tr>"; $q=array(); $count=0; while($q=mysqlfetcharray($query)) { $count+=1; $queryResults.="<tr onMouseover=\"this.bgColor='#f0e6dd'\" onMouseout=\"this.bgColor='#ebdfd4'\"> <td class=\"".($count<$num?"vl_tdstandard":"vl_tdnoborder")."\" style=\"padding:8px\">$q[formNumber]</td> <td class=\"".($count<$num?"vl_tdstandard":"vl_tdnoborder")."\" style=\"padding:8px\">$q[lrCategory]$q[lrEnvelopeNumber]/$q[lrNumericID]</td> <td class=\"".($count<$num?"vl_tdstandard":"vl_tdnoborder")."\" align=\"center\">".getFormattedDateLessDay($q["receiptDate"])."</td> <td class=\"".($count<$num?"vl_tdstandard":"vl_tdnoborder")."\" align=\"center\">".getFormattedDateLessDay(getDetailedTableInfo2("vl_patients","id='$patientID' limit 1","dateOfBirth"))."</td> </tr>"; } $queryResults.="</table>"; //return results $objResponse->addAssign("artNumberHistoryID","innerHTML","<div style=\"border: 1px solid #c3ab94; background-color: #ebdfd4; padding: 10px\">$queryResults</div>"); } else { $objResponse->addAssign("artNumberHistoryID","innerHTML",""); } } else { $objResponse->addAssign("artNumberHistoryID","innerHTML",""); } return $objResponse->getXML(); }