"><a href="/results/<?php echo $q["machineType"]; ?> /pg/1/<?php echo $q["id"]; ?> /"><?php echo number_format((double) getDetailedTableInfo3($q["machineType"] == "abbott" ? "vl_results_abbott" : "vl_results_roche", "worksheetID='{$q['id']}'", "count(id)", "num")); ?> </a></td> <? } else { ?> <td class="<?php echo $count < mysqlnumrows($xquery) ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo number_format((double) getDetailedTableInfo3($q["machineType"] == "abbott" ? "vl_results_abbott" : "vl_results_roche", "worksheetID='{$q['id']}'", "count(id)", "num")); ?> </td> <? } ?> <td class="<?php echo $count < mysqlnumrows($xquery) ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo getDetailedTableInfo2("vl_appendix_sampletype", "id='{$q['worksheetType']}' limit 1", "appendix"); ?> </td> <td class="<?php echo $count < mysqlnumrows($xquery) ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo $q["machineType"];
<td> </td> </tr> <? } else if($error) { ?> <tr> <td class="vl_error">Unable to process your submission due to the following error(s): <?php echo $error; ?> </td> </tr> <tr> <td> </td> </tr> <? } else if($searchQuery) { $queryResults=0; $queryResults=getDetailedTableInfo3("vl_patients","artNumber like '%$searchQuery%' or otherID like '%$searchQuery%'","count(id)","num"); if($queryResults) { ?> <tr> <td class="vl_success"><?php echo $queryResults; ?> result<?php echo $queryResults == 1 ? "" : "s"; ?> found while searching for <strong><?php echo $searchQuery; ?> </strong></td> </tr> <tr>
<td style="padding:5px 0px" align="center"> <div style="height: 200px; border: 1px solid #ccccff; overflow: auto"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl"> <tr> <td class="vl_tdsub" width="1%"><strong>#</strong></td> <td class="vl_tdsub" width="60%"><strong>Appendix</strong></td> <td class="vl_tdsub" width="10%"><strong>Samples</strong></td> <td class="vl_tdsub" width="29%"> </td> </tr> <? $count=0; $q=array(); while($q=mysqlfetcharray($query)) { $count+=1; $numberSamples=0; $numberSamples=getDetailedTableInfo3("vl_samples","sampleTypeID='$q[id]'","count(id)","num"); ?> <tr> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo $q["position"]; ?> </td> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo $q["appendix"]; ?>
Region</strong></td> </tr> </table> </td> </tr> <tr> <td style="padding:5px 0px 5px 0px" align="center"> <div style="height: 200px; border: 1px solid #ccccff; overflow: auto"> <table width="95%" border="0" cellspacing="0" cellpadding="0" class="vl"> <? $count=0; $q=array(); while($q=mysqlfetcharray($query)) { $count+=1; $facilities=0; $facilities=getDetailedTableInfo3("vl_facilities","districtID='$q[id]'","count(id)","num"); ?> <tr> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> " width="70%"> <div><a href="?act=facilities&districtID=<?php echo $q["id"]; ?> &nav=configuration"><?php echo $q["district"]; ?> </a></div> <div class="vls_grey" style="padding:3px 0px"><?php echo number_format((double) $facilities);
<td class="vl_tdstandard" align="center"><?php echo number_format((double) getDetailedTableInfo3("vl_patients", "gender='Male'", "count(id)", "num")); ?> </td> </tr> <tr onMouseover="this.bgColor='#f0e6dd'" onMouseout="this.bgColor='#FFFFFF'"> <td class="vl_tdstandard" style="padding:8px 8px 8px 20px">Female</td> <td class="vl_tdstandard" align="center"><?php echo number_format((double) getDetailedTableInfo3("vl_patients", "gender='Female'", "count(id)", "num")); ?> </td> </tr> <tr onMouseover="this.bgColor='#f0e6dd'" onMouseout="this.bgColor='#FFFFFF'"> <td class="vl_tdnoborder" style="padding:8px 8px 8px 20px">Left Blank</td> <td class="vl_tdnoborder" align="center"><?php echo number_format((double) getDetailedTableInfo3("vl_patients", "gender='Left Blank'", "count(id)", "num")); ?> </td> </tr> </table> </div> <div style="padding:1px 0px 0px 0px"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="vl_tdsub" width="95%"><strong>Lab TAT Statistics</strong></td> <td class="vl_tdsub" width="5%" align="center"><strong>Value</strong></td> </tr> <tr onMouseover="this.bgColor='#f0e6dd'" onMouseout="this.bgColor='#FFFFFF'"> <td class="vl_tdstandard">Dispatch to Facility - Receipt at Lab</td> <td class="vl_tdstandard" align="center"> </td> </tr>
$refNumber=validate($refNumber); $serialNumberStart=validate($serialNumberStart); $serialNumberEnd=validate($serialNumberEnd); $dispatchedDateDay=validate($dispatchedDateDay); $dispatchedDateMonth=validate($dispatchedDateMonth); $dispatchedDateYear=validate($dispatchedDateYear); $facilityID=validate($facilityID); $oldDispatchedDate=0; $oldDispatchedDate=getDetailedTableInfo2("vl_forms_clinicalrequest_dispatch","refNumber='$refNumber' limit 1","dispatchDate"); $oldFacilityID=0; $oldFacilityID=getDetailedTableInfo2("vl_forms_clinicalrequest_dispatch","refNumber='$refNumber' limit 1","facilityID"); $serialNumberStartValue=0; $serialNumberStartValue=getDetailedTableInfo3("vl_forms_clinicalrequest","refNumber='$refNumber'","min(formNumber)","start"); $serialNumberEndValue=0; $serialNumberEndValue=getDetailedTableInfo3("vl_forms_clinicalrequest","refNumber='$refNumber'","max(formNumber)","end"); if($saveDate) { //validate data $error=0; $error=checkFormFields("Dispatched_Date::$dispatchedDateYear Dispatched_Date::$dispatchedDateMonth Dispatched_Date::$dispatchedDateDay Facility::$facilityID Starting_Serial_Number::$serialNumberStart Ending_Serial_Number::$serialNumberEnd"); //ensure ending serial number is greater than starting serial number if($serialNumberStart>=$serialNumberEnd) { $error.="Starting Serial Number should be less than the Ending Serial Number"; } //ensure ending serial number does not exceed $serialNumberStart by more than $default_formsPerBook if(($serialNumberEnd-$serialNumberStart)>$default_formsPerBook) { $error.="Ending Serial Number should not exceed Starting Serial Number by more than $default_formsPerBook"; }
echo $count < mysqlnumrows($xquery) ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo $count; ?> </td> <td class="<?php echo $count < mysqlnumrows($xquery) ? "vl_tdstandard" : "vl_tdnoborder"; ?> "> <div>Clinical Request Form # <?php echo $q["refNumber"]; ?> </div> <div style="padding:5px 0px 0px 0px" class="vls_grey"><strong><?php echo number_format((double) getDetailedTableInfo3("vl_forms_clinicalrequest", "refNumber='{$q['refNumber']}'", "count(id)", "num")); ?> </strong> (<?php echo getDetailedTableInfo2("vl_forms_clinicalrequest", "refNumber='{$q['refNumber']}' order by formNumber asc limit 1", "formNumber"); ?> to <?php echo getDetailedTableInfo2("vl_forms_clinicalrequest", "refNumber='{$q['refNumber']}' order by formNumber desc limit 1", "formNumber"); ?> )</div> </td> <!--<td class="<?php echo $count < mysqlnumrows($xquery) ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><div class="vls_grey" style="padding:3px 0px 0px 0px"><a href="/downloads.forms/Clinical.Request.Form.<?php echo $q["refNumber"]; ?>
<option value="50">50</option> <option value="100">100</option> <option value="125">125</option> </select> </td> </tr> <tr> <td><input type="submit" name="Submit" class="button" value=" Generate Forms " /></td> </tr> </table> </form> </td> </tr> <tr> <td style="padding:10px 0px 0px 0px"><a href="/generateforms/download/">Download Historical Forms</a> <font class="vls_grey">(<?php echo number_format((double) getDetailedTableInfo3("vl_forms_clinicalrequest", "id!=''", "count(id)", "num")); ?> )</font></td> </tr> <tr> <td style="padding:10px 0px 0px 0px"><a href="/generateforms/email/">Email Downloadable Forms</a></td> </tr> --> <tr> <td style="padding:10px 0px 0px 0px"><a href="/generateforms/dispatch/">Update Form Dispatch Status</a></td> </tr> <tr> <td style="padding:10px 0px 0px 0px"><a href="/generateforms/dispatch/new/">Add Form Batch/Dispatch Status</a></td> </tr> </table></td> </tr>
<td style="padding:5px 0px" align="center"> <div style="height: 200px; border: 1px solid #ccccff; overflow: auto"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl"> <tr> <td class="vl_tdsub" width="1%"><strong>#</strong></td> <td class="vl_tdsub" width="60%"><strong>Appendix</strong></td> <td class="vl_tdsub" width="10%"><strong>Samples</strong></td> <td class="vl_tdsub" width="29%"> </td> </tr> <? $count=0; $q=array(); while($q=mysqlfetcharray($query)) { $count+=1; $numberSamples=0; $numberSamples=getDetailedTableInfo3("vl_samples","arvAdherenceID='$q[id]'","count(id)","num"); ?> <tr> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo $q["position"]; ?> </td> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo $q["appendix"]; ?>
</tr> <tr> <td class="vls_grey" style="padding:10px 0px 5px 0px">Number of unique facilities within samples DB: <?php echo number_format((double) getDetailedTableInfo3("vl_samples", "id>0", "count(distinct facilityID)", "num")); ?> </td> </tr> <tr> <td class="vls_grey" style="padding:5px 0px">Number of unique districts within samples DB: <?php echo number_format((double) getDetailedTableInfo3("vl_samples", "id>0", "count(distinct districtID)", "num")); ?> </td> </tr> <tr> <td class="vls_grey" style="padding:5px 0px">Number of unique hubs within samples DB: <?php echo number_format((double) getDetailedTableInfo3("vl_samples", "id>0", "count(distinct hubID)", "num")); ?> </td> </tr> </table></td> <td width="20%" style="padding:20px 0px 0px 10px" valign="top"> <!-- start alert --> <table border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px solid #f3f3f3" width="100%"> <tr> <td style="padding:10px"><table width="100%" border="0" class="vl"> <tr> <td><strong>TEMPLATES</strong></td> </tr> <tr> <td> </td> </tr>
<td style="padding:5px 0px" align="center"> <div style="height: 200px; border: 1px solid #ccccff; overflow: auto"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl"> <tr> <td class="vl_tdsub" width="1%"><strong>#</strong></td> <td class="vl_tdsub" width="60%"><strong>Appendix</strong></td> <td class="vl_tdsub" width="10%"><strong>Samples</strong></td> <td class="vl_tdsub" width="29%"> </td> </tr> <? $count=0; $q=array(); while($q=mysqlfetcharray($query)) { $count+=1; $numberSamples=0; $numberSamples=getDetailedTableInfo3("vl_samples_verify","outcomeReasonsID='$q[id]'","count(id)","num"); ?> <tr> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo $q["position"]; ?> </td> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "> <div><?php echo $q["appendix"];
$numberPages=ceil($num_rows/$rowsToDisplay); if(mysqlnumrows($query)) { //how many pages are there? if($numberPages>1) { echo "<tr><td style=\"padding:0px 0px 10px 0px\" class=\"vls_grey\"><strong>Pages:</strong> ".displayPagesLinks("/verify/".($approvedstatus=="search"?"search/$encryptedSample":$approvedstatus)."/pg/",1,$numberPages,($pg?$pg:1),$default_radius)."</td></tr>"; } $numberOfRelevantSamples=0; $numberOfRelevantSamples=getDetailedTableInfo3("vl_samples","verified=0","count(id)","num"); $resultsPending=0; $resultsPending=$numberOfRelevantSamples; $resultsProcessed=0; $resultsProcessed=getDetailedTableInfo3("vl_samples"," verified=1","count(id)","num"); $resultsSearch=0; $resultsSearch=mysqlnumrows($query); ?> <tr> <td> <table border="0" cellspacing="0" cellpadding="0"> <tr> <? if($approvedstatus=="pending") { ?> <td class="bluetab_active"><?php echo "Pending (" . number_format((double) $resultsPending) . ")"; ?> </td> <? } else { ?> <td class="bluetab_inactive"><a href="/verify/pending/">
//$searchQueryNextPosition=getDetailedTableInfo2("vl_samples","id not in (select sampleID from vl_samples_verify) and (formNumber='$searchQuery' or vlSampleID='$searchQuery' or concat(lrCategory,lrEnvelopeNumber,'/',lrNumericID) like '$searchQuery%') order by if(lrCategory='',1,0),lrCategory, if(lrEnvelopeNumber='',1,0),lrEnvelopeNumber, if(lrNumericID='',1,0),lrNumericID,created desc limit $searchQueryCurrentPosition,1","id"); //if(!$searchQueryNextPosition) { $searchQueryNextPosition=getDetailedTableInfo2("vl_samples","id not in (select sampleID from vl_samples_verify) and id!='$id' and (formNumber='$searchQuery' or vlSampleID='$searchQuery' or concat(lrCategory,lrEnvelopeNumber,'/',lrNumericID) like '$searchQuery%') order by lrNumericID asc limit 1","id"); //} } } //envelope Number From $searchQueryFrom=0; $searchQueryTo=0; //$searchQueryCurrentPosition=0; //$searchQueryNextPosition=0; if($envelopeNumberFrom && $envelopeNumberTo) { $searchQueryFrom=validate(vlDecrypt($envelopeNumberFrom)); $searchQueryTo=validate(vlDecrypt($envelopeNumberTo)); $searchQueryCurrentPosition=getDetailedTableInfo3("vl_samples y","y.vlSampleID='".getDetailedTableInfo2("vl_samples","id='$id'","vlSampleID")."'","(select count(x.id) from vl_samples x where concat(x.lrCategory,x.lrEnvelopeNumber)>='$searchQueryFrom' and concat(x.lrCategory,x.lrEnvelopeNumber)<='$searchQueryTo' and x.vlSampleID<=y.vlSampleID order by if(x.lrCategory='',1,0),x.lrCategory, if(x.lrEnvelopeNumber='',1,0),x.lrEnvelopeNumber, if(x.lrNumericID='',1,0),x.lrNumericID,x.created desc)","position"); if($searchQueryCurrentPosition) { $searchQueryNextPosition=getDetailedTableInfo2("vl_samples","id not in (select sampleID from vl_samples_verify) and concat(lrCategory,lrEnvelopeNumber)>='$searchQueryFrom' and concat(lrCategory,lrEnvelopeNumber)<='$searchQueryTo' order by if(lrCategory='',1,0),lrCategory, if(lrEnvelopeNumber='',1,0),lrEnvelopeNumber, if(lrNumericID='',1,0),lrNumericID,created desc limit $searchQueryCurrentPosition,1","id"); if(!$searchQueryNextPosition) { $searchQueryNextPosition=getDetailedTableInfo2("vl_samples","id not in (select sampleID from vl_samples_verify) and id!='$id' and concat(lrCategory,lrEnvelopeNumber)>='$searchQueryFrom' and concat(lrCategory,lrEnvelopeNumber)<='$searchQueryTo' order by if(lrCategory='',1,0),lrCategory, if(lrEnvelopeNumber='',1,0),lrEnvelopeNumber, if(lrNumericID='',1,0),lrNumericID,created desc limit 1","id"); } } } if($saveChangesReturn || $saveChangesProceed) { //validate data $error=0; $error=checkFormFields("Received_Status::$outcome"); //is gender male and pregnancy set to yes? if($outcome=="Rejected" && !$outcomeReasonsID) {
</div> <div><img src="/images/spacer.gif" width="3" height="3" /></div> <div class="vls_grey" style="padding:5px; border: 1px solid #f0d7b4; background-color: #fffee6">Samples pending approval (All): <?php echo number_format((double) getDetailedTableInfo3("vl_samples", "verified=0", "count(id)", "num")); ?> </div> <div><img src="/images/spacer.gif" width="3" height="3" /></div> <div class="vls_grey" style="padding:5px; border: 1px solid #f0d7b4; background-color: #fffee6">Samples Pending approval (DBS): <?php echo number_format((double) getDetailedTableInfo3("vl_samples", "verified=0 and sampleTypeID=1", "count(id)", "num")); ?> </div> <div><img src="/images/spacer.gif" width="3" height="3" /></div> <div class="vls_grey" style="padding:5px; border: 1px solid #f0d7b4; background-color: #fffee6">Samples Pending approval (Plasma): <?php echo number_format((double) getDetailedTableInfo3("vl_samples", "verified=0 and sampleTypeID=2", "count(id)", "num")); ?> </div> <div><img src="/images/spacer.gif" width="3" height="3" /></div> <div class="vls_grey" style="padding:5px; border: 1px solid #f0d7b4; background-color: #fffee6">Printed Worksheets: <?php echo number_format((double) getDetailedTableInfo3("vl_logs_worksheetsamplesprinted,vl_samples_worksheetcredentials", "vl_logs_worksheetsamplesprinted.worksheetID=vl_samples_worksheetcredentials.id", "count(distinct vl_logs_worksheetsamplesprinted.worksheetID)", "num")); ?> </div> <div><img src="/images/spacer.gif" width="3" height="3" /></div> <div class="vls_grey" style="padding:5px; border: 1px solid #f0d7b4; background-color: #fffee6">Total Worksheets: <?php echo number_format((double) getDetailedTableInfo3("vl_samples_worksheetcredentials", "id>0", "count(id)", "num")); ?> </div> </td> </tr> </table></td> </tr> </table>
<td style="padding:5px 0px" align="center"> <div style="height: 200px; border: 1px solid #ccccff; overflow: auto"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl"> <tr> <td class="vl_tdsub" width="1%"><strong>#</strong></td> <td class="vl_tdsub" width="60%"><strong>Appendix</strong></td> <td class="vl_tdsub" width="10%"><strong>Samples</strong></td> <td class="vl_tdsub" width="29%"> </td> </tr> <? $count=0; $q=array(); while($q=mysqlfetcharray($query)) { $count+=1; $numberSamples=0; $numberSamples=getDetailedTableInfo3("vl_samples","viralLoadTestingID='$q[id]'","count(id)","num"); ?> <tr> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo $q["position"]; ?> </td> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo $q["appendix"]; ?>
<td style="padding:5px 0px" align="center"> <div style="height: 200px; border: 1px solid #ccccff; overflow: auto"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl"> <tr> <td class="vl_tdsub" width="1%"><strong>#</strong></td> <td class="vl_tdsub" width="60%"><strong>Appendix</strong></td> <td class="vl_tdsub" width="10%"><strong>Samples</strong></td> <td class="vl_tdsub" width="29%"> </td> </tr> <? $count=0; $q=array(); while($q=mysqlfetcharray($query)) { $count+=1; $numberSamples=0; $numberSamples=getDetailedTableInfo3("vl_samples","treatmentInitiationID='$q[id]'","count(id)","num"); ?> <tr> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo $q["position"]; ?> </td> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo $q["appendix"]; ?>
/** * log new arvAdherence, return arvAdherenceID */ function logNewARVAdherence($arvAdherence) { global $datetime,$user; //avoid duplicates if($arvAdherence) { if(!getDetailedTableInfo2("vl_appendix_arvadherence","lower(appendix)='".strtolower($arvAdherence)."' limit 1","id")) { //position $position=0; $position=getDetailedTableInfo3("vl_appendix_arvadherence","appendix!=''","count(id)","num")+1; //insert into vl_appendix_arvadherence mysqlquery("insert into vl_appendix_arvadherence (appendix,position,created,createdby) values ('$arvAdherence','$position','$datetime','$user')"); //return arvAdherenceID return getDetailedTableInfo2("vl_appendix_arvadherence","createdby='$user' order by id desc limit 1","id"); } else { //return arvAdherenceID return getDetailedTableInfo2("vl_appendix_arvadherence","lower(appendix)='".strtolower($arvAdherence)."' limit 1","id"); } } }
<td style="padding:5px 0px" align="center"> <div style="height: 200px; border: 1px solid #ccccff; overflow: auto"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl"> <tr> <td class="vl_tdsub" width="1%"><strong>#</strong></td> <td class="vl_tdsub" width="60%"><strong>Appendix</strong></td> <td class="vl_tdsub" width="10%"><strong>Samples</strong></td> <td class="vl_tdsub" width="29%"> </td> </tr> <? $count=0; $q=array(); while($q=mysqlfetcharray($query)) { $count+=1; $numberSamples=0; $numberSamples=getDetailedTableInfo3("vl_samples","currentRegimenID='$q[id]'","count(id)","num"); //samples /* $samples=""; $squery=0; $squery=mysqlquery("select * from vl_samples where currentRegimenID='$q[id]' order by created"); $snum=0; $snum=mysqlnumrows($squery); if($snum) { $scount=0; $sq=array(); while($sq=mysqlfetcharray($squery)) { $scount+=1; $samples.="$sq[lrCategory]$sq[lrEnvelopeNumber]/$sq[lrNumericID]".($scount<$snum?",":""); } }
$plasmaSampleTypeID=getDetailedTableInfo2("vl_appendix_sampletype","appendix='Plasma' limit 1","id"); $array=array(); while($q=mysqlfetcharray($query)) { //process last portion of output based on age category switch($q["theAgeCategory"]) { case 1: //age is < 5 //samples_received echo "$q[theMonth], $q[theYear], $q[facilityID], $q[theAgeCategory], ".getDetailedTableInfo3("vl_samples a,vl_patients b","a.patientID=b.id and month(a.created)='$q[theMonth]' and year(a.created)='$q[theYear]' and a.facilityID='$q[facilityID]' and (round(datediff(now(),b.dateOfBirth)/365)<5 or b.dateOfBirth='0000-00-00')","count(a.id)","num")."<br>"; break; case 2: //age >= 5 && age <= 9 //samples_received echo "$q[theMonth], $q[theYear], $q[facilityID], $q[theAgeCategory], ".getDetailedTableInfo3("vl_samples a,vl_patients b","a.patientID=b.id and month(a.created)='$q[theMonth]' and year(a.created)='$q[theYear]' and a.facilityID='$q[facilityID]' and round(datediff(now(),b.dateOfBirth)/365)>=5 and round(datediff(now(),b.dateOfBirth)/365)<=9 and b.dateOfBirth!='0000-00-00'","count(a.id)","num")."<br>"; break; case 3: //age >= 10 && age <= 18 //samples_received echo "$q[theMonth], $q[theYear], $q[facilityID], $q[theAgeCategory], ".getDetailedTableInfo3("vl_samples a,vl_patients b","a.patientID=b.id and month(a.created)='$q[theMonth]' and year(a.created)='$q[theYear]' and a.facilityID='$q[facilityID]' and round(datediff(now(),b.dateOfBirth)/365)>=10 and round(datediff(now(),b.dateOfBirth)/365)<=18 and b.dateOfBirth!='0000-00-00'","count(a.id)","num")."<br>"; break; case 4: //age >= 19 && age <= 25 //samples_received echo "$q[theMonth], $q[theYear], $q[facilityID], $q[theAgeCategory], ".getDetailedTableInfo3("vl_samples a,vl_patients b","a.patientID=b.id and month(a.created)='$q[theMonth]' and year(a.created)='$q[theYear]' and a.facilityID='$q[facilityID]' and round(datediff(now(),b.dateOfBirth)/365)>=19 and round(datediff(now(),b.dateOfBirth)/365)<=25 and b.dateOfBirth!='0000-00-00'","count(a.id)","num")."<br>"; break; case 5: //age >= 26 default: //age >= 26 //samples_received echo "$q[theMonth], $q[theYear], $q[facilityID], $q[theAgeCategory], ".getDetailedTableInfo3("vl_samples a,vl_patients b","a.patientID=b.id and month(a.created)='$q[theMonth]' and year(a.created)='$q[theYear]' and a.facilityID='$q[facilityID]' and round(datediff(now(),b.dateOfBirth)/365)>=26 and b.dateOfBirth!='0000-00-00'","count(a.id)","num")."<br>"; break; } } } ?>
if(!$machineType) { $machineType="abbott"; } } //results $resultsAbbott=0; $resultsAbbott=getDetailedTableInfo3("vl_results_abbott,vl_samples","vl_samples.vlSampleID=vl_results_abbott.sampleID".($showPrinted?" and vl_samples.id in (select sampleID from vl_logs_printedresults)":""),"count(vl_results_abbott.sampleID)","num"); $resultsRoche=0; $resultsRoche=getDetailedTableInfo3("vl_results_roche,vl_samples","vl_samples.vlSampleID=vl_results_roche.SampleID".($showPrinted?" and vl_samples.id in (select sampleID from vl_logs_printedresults)":""),"count(vl_results_roche.SampleID)","num"); $rejectedSamples=0; $rejectedSamples=getDetailedTableInfo3("vl_samples_verify","outcome='Rejected'".($showPrinted?" and sampleID in (select sampleID from vl_logs_printedrejectedresults)":" and sampleID not in (select sampleID from vl_logs_printedrejectedresults)"),"count(id)","num"); $resultsPrinted=0; $resultsPrinted=getDetailedTableInfo3("vl_results_abbott,vl_samples","vl_samples.vlSampleID=vl_results_abbott.sampleID and vl_samples.id in (select sampleID from vl_logs_printedresults)","count(vl_results_abbott.sampleID)","num")+getDetailedTableInfo3("vl_results_roche,vl_samples","vl_samples.vlSampleID=vl_results_roche.SampleID and vl_samples.id in (select sampleID from vl_logs_printedresults)","count(vl_results_roche.SampleID)","num"); $resultsNotPrinted=0; $resultsNotPrinted=getDetailedTableInfo3("vl_results_abbott,vl_samples","vl_samples.vlSampleID=vl_results_abbott.sampleID and vl_samples.id not in (select sampleID from vl_logs_printedresults)","count(vl_results_abbott.sampleID)","num")+getDetailedTableInfo3("vl_results_roche,vl_samples","vl_samples.vlSampleID=vl_results_roche.SampleID and vl_samples.id not in (select sampleID from vl_logs_printedresults)","count(vl_results_roche.SampleID)","num"); //pages if(!$pg) { $pg=1; } $offset=0; $offset=($pg-1)*$rowsToDisplay; //proceed with query $rawQuery=0; $xRawQuery=0; $query=0; $xquery=0; if(!$searchQuery) {
<td class="vl_tdsub" width="42%"><strong>Permissions</strong></td> </tr> </table> </td> </tr> <tr> <td style="padding:5px 0px 5px 0px" align="center"> <div style="height: 200px; border: 1px solid #ccccff; overflow: auto"> <table width="95%" border="0" cellspacing="0" cellpadding="0" class="trailanalytics"> <? $count=0; $q=array(); while($q=mysqlfetcharray($query)) { $count+=1; $permissions=0; $permissions=getDetailedTableInfo3("vl_users_permissions","userID='$q[id]'","count(id)","num"); ?> <tr> <td width="60%" class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><a href="?act=permissions&nav=configuration&task=modify&id=<?php echo $q["id"]; ?> "><?php echo $q["names"]; ?> </a></td> <td width="40%" class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?>
</div> <div><img src="/images/spacer.gif" width="3" height="3" /></div> <div class="vls_grey" style="padding:5px; border: 1px solid #f0d7b4; background-color: #fffee6">Failed Available Samples (Abbott, Plasma): <?php echo number_format((double) getDetailedTableInfo3("vl_results_abbott,vl_samples", "vl_samples.vlSampleID=vl_results_abbott.sampleID and vl_samples.sampleTypeID='" . getDetailedTableInfo2("vl_appendix_sampletype", "appendix='Plasma' limit 1", "id") . "' and vl_results_abbott.sampleID not in (select distinct sampleID from vl_results_abbott where \n\t\t\t\t\t\t(trim(result)!='-1.00' and \n\t\t\t\t\t\t\ttrim(result)!='3153 There is insufficient volume in the vessel to perform an aspirate or dispense operation.' and \n\t\t\t\t\t\t\t\ttrim(result)!='3109 A no liquid detected error was encountered by the Liquid Handler.' and \n\t\t\t\t\t\t\t\t\ttrim(result)!='A no liquid detected error was encountered by the Liquid Handler.' and \n\t\t\t\t\t\t\t\t\t\ttrim(result)!='Unable to process result, instrument response is invalid.' and \n\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='3118 A clot limit passed error was encountered by the Liquid Handler.' and \n\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='3130 A less liquid than expected error was encountered by the Liquid Handler.' and \n\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='3131 A more liquid than expected error was encountered by the Liquid Handler.' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='3152 The specified submerge position for the requested liquid volume exceeds the calibrated Z bottom' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='4455 Unable to process result, instrument response is invalid.' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='A no liquid detected error was encountered by the Liquid Handler.' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='Failed Internal control cycle number is too high. Valid range is [18.48, 22.48].' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='Failed Failed Internal control cycle number is too high. Valid range is [18.48,' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='Failed Failed Internal control cycle number is too high. Valid range is [18.48, 2' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='OPEN' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='There is insufficient volume in the vessel to perform an aspirate or dispense operation.' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='Unable to process result, instrument response is invalid.' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsubstr(flags,1,47)!='4442 Internal control cycle number is too high.')) \n\t\t\t\t\t\tand \n\t\t\t\t\t\t(trim(vl_results_abbott.result)='-1.00' or \n\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='3153 There is insufficient volume in the vessel to perform an aspirate or dispense operation.' or \n\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='3109 A no liquid detected error was encountered by the Liquid Handler.' or \n\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='A no liquid detected error was encountered by the Liquid Handler.' or \n\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='Unable to process result, instrument response is invalid.' or \n\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='3118 A clot limit passed error was encountered by the Liquid Handler.' or \n\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='3130 A less liquid than expected error was encountered by the Liquid Handler.' or \n\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='3131 A more liquid than expected error was encountered by the Liquid Handler.' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='3152 The specified submerge position for the requested liquid volume exceeds the calibrated Z bottom' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='4455 Unable to process result, instrument response is invalid.' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='A no liquid detected error was encountered by the Liquid Handler.' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='Failed Internal control cycle number is too high. Valid range is [18.48, 22.48].' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='Failed Failed Internal control cycle number is too high. Valid range is [18.48,' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='Failed Failed Internal control cycle number is too high. Valid range is [18.48, 2' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='OPEN' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='There is insufficient volume in the vessel to perform an aspirate or dispense operation.' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='Unable to process result, instrument response is invalid.' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsubstr(vl_results_abbott.flags,1,47)='4442 Internal control cycle number is too high.')", "count(distinct vl_results_abbott.sampleID)", "num")); ?> </div> <div><img src="/images/spacer.gif" width="3" height="3" /></div> <div class="vls_grey" style="padding:5px; border: 1px solid #f0d7b4; background-color: #fffee6">Failed Available Samples (Abbott, Whole Blood): <?php echo number_format((double) getDetailedTableInfo3("vl_results_abbott,vl_samples", "vl_samples.vlSampleID=vl_results_abbott.sampleID and vl_samples.sampleTypeID='" . getDetailedTableInfo2("vl_appendix_sampletype", "appendix='Whole blood' limit 1", "id") . "' and vl_results_abbott.sampleID not in (select distinct sampleID from vl_results_abbott where \n\t\t\t\t\t\t(trim(result)!='-1.00' and \n\t\t\t\t\t\t\ttrim(result)!='3153 There is insufficient volume in the vessel to perform an aspirate or dispense operation.' and \n\t\t\t\t\t\t\t\ttrim(result)!='3109 A no liquid detected error was encountered by the Liquid Handler.' and \n\t\t\t\t\t\t\t\t\ttrim(result)!='A no liquid detected error was encountered by the Liquid Handler.' and \n\t\t\t\t\t\t\t\t\t\ttrim(result)!='Unable to process result, instrument response is invalid.' and \n\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='3118 A clot limit passed error was encountered by the Liquid Handler.' and \n\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='3130 A less liquid than expected error was encountered by the Liquid Handler.' and \n\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='3131 A more liquid than expected error was encountered by the Liquid Handler.' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='3152 The specified submerge position for the requested liquid volume exceeds the calibrated Z bottom' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='4455 Unable to process result, instrument response is invalid.' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='A no liquid detected error was encountered by the Liquid Handler.' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='Failed Internal control cycle number is too high. Valid range is [18.48, 22.48].' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='Failed Failed Internal control cycle number is too high. Valid range is [18.48,' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='Failed Failed Internal control cycle number is too high. Valid range is [18.48, 2' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='OPEN' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='There is insufficient volume in the vessel to perform an aspirate or dispense operation.' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(result)!='Unable to process result, instrument response is invalid.' and \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsubstr(flags,1,47)!='4442 Internal control cycle number is too high.')) \n\t\t\t\t\t\tand \n\t\t\t\t\t\t(trim(vl_results_abbott.result)='-1.00' or \n\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='3153 There is insufficient volume in the vessel to perform an aspirate or dispense operation.' or \n\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='3109 A no liquid detected error was encountered by the Liquid Handler.' or \n\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='A no liquid detected error was encountered by the Liquid Handler.' or \n\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='Unable to process result, instrument response is invalid.' or \n\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='3118 A clot limit passed error was encountered by the Liquid Handler.' or \n\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='3130 A less liquid than expected error was encountered by the Liquid Handler.' or \n\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='3131 A more liquid than expected error was encountered by the Liquid Handler.' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='3152 The specified submerge position for the requested liquid volume exceeds the calibrated Z bottom' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='4455 Unable to process result, instrument response is invalid.' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='A no liquid detected error was encountered by the Liquid Handler.' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='Failed Internal control cycle number is too high. Valid range is [18.48, 22.48].' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='Failed Failed Internal control cycle number is too high. Valid range is [18.48,' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='Failed Failed Internal control cycle number is too high. Valid range is [18.48, 2' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='OPEN' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='There is insufficient volume in the vessel to perform an aspirate or dispense operation.' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrim(vl_results_abbott.result)='Unable to process result, instrument response is invalid.' or \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsubstr(vl_results_abbott.flags,1,47)='4442 Internal control cycle number is too high.')", "count(distinct vl_results_abbott.sampleID)", "num")); ?> </div> <div><img src="/images/spacer.gif" width="3" height="3" /></div> <div class="vls_grey" style="padding:5px; border: 1px solid #f0d7b4; background-color: #fffee6">Failed Available Samples (Roche, DBS): <?php echo number_format((double) getDetailedTableInfo3("vl_results_roche,vl_samples", "vl_samples.vlSampleID=vl_results_roche.SampleID and vl_samples.sampleTypeID='" . getDetailedTableInfo2("vl_appendix_sampletype", "appendix='DBS' limit 1", "id") . "' and vl_results_roche.SampleID not in (select distinct SampleID from vl_results_roche where (Result!='Failed' and Result!='Invalid')) and (vl_results_roche.Result='Failed' or vl_results_roche.Result='Invalid')", "count(distinct vl_results_roche.SampleID)", "num")); ?> </div> <div><img src="/images/spacer.gif" width="3" height="3" /></div> <div class="vls_grey" style="padding:5px; border: 1px solid #f0d7b4; background-color: #fffee6">Failed Available Samples (Roche, Plasma): <?php echo number_format((double) getDetailedTableInfo3("vl_results_roche,vl_samples", "vl_samples.vlSampleID=vl_results_roche.SampleID and vl_samples.sampleTypeID='" . getDetailedTableInfo2("vl_appendix_sampletype", "appendix='Plasma' limit 1", "id") . "' and vl_results_roche.SampleID not in (select distinct SampleID from vl_results_roche where (Result!='Failed' and Result!='Invalid')) and (vl_results_roche.Result='Failed' or vl_results_roche.Result='Invalid')", "count(distinct vl_results_roche.SampleID)", "num")); ?> </div> <div><img src="/images/spacer.gif" width="3" height="3" /></div> <div class="vls_grey" style="padding:5px; border: 1px solid #f0d7b4; background-color: #fffee6">Failed Available Samples (Roche, Whole Blood): <?php echo number_format((double) getDetailedTableInfo3("vl_results_roche,vl_samples", "vl_samples.vlSampleID=vl_results_roche.SampleID and vl_samples.sampleTypeID='" . getDetailedTableInfo2("vl_appendix_sampletype", "appendix='Whole blood' limit 1", "id") . "' and vl_results_roche.SampleID not in (select distinct SampleID from vl_results_roche where (Result!='Failed' and Result!='Invalid')) and (vl_results_roche.Result='Failed' or vl_results_roche.Result='Invalid')", "count(distinct vl_results_roche.SampleID)", "num")); ?> </div> </td> </tr> </table></td> </tr> </table>
</table> </td> </tr> <tr> <td style="padding:5px 0px 5px 0px" align="center"> <div style="height: 200px; border: 1px solid #ccccff; overflow: auto"> <table width="95%" border="0" cellspacing="0" cellpadding="0" class="vl"> <? $count=0; $q=array(); while($q=mysqlfetcharray($query)) { $count+=1; $districts=0; $districts=getDetailedTableInfo3("vl_districts","regionID='$q[id]'","count(id)","num"); $facilities=0; $facilities=getDetailedTableInfo3("vl_regions,vl_districts,vl_facilities","vl_regions.id=vl_districts.regionID and vl_districts.id=vl_facilities.districtID and vl_regions.id='$q[id]'","count(distinct vl_facilities.id)","num"); ?> <tr> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> " width="70%"> <div><a href="?act=districts®ionID=<?php echo $q["id"]; ?> &nav=configuration"><?php echo $q["region"]; ?> </a></div> <div class="vls_grey" style="padding:3px 0px"><?php echo number_format((double) $districts);
<tr> <td class="vl_tdsub" width="1%"><strong>#</strong></td> <td class="vl_tdsub" width="50%"><strong>Appendix</strong></td> <td class="vl_tdsub" width="10%"><strong>Samples</strong></td> <td class="vl_tdsub" width="10%"><strong>Regimen</strong></td> <td class="vl_tdsub" width="29%"> </td> </tr> <? $count=0; $q=array(); while($q=mysqlfetcharray($query)) { $count+=1; $numberSamples=0; $numberSamples=getDetailedTableInfo3("vl_samples","treatmentStatusID='$q[id]'","count(id)","num"); $numberRegimen=0; $numberRegimen=getDetailedTableInfo3("vl_appendix_regimen","treatmentStatusID='$q[id]'","count(id)","num"); ?> <tr> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo $q["position"]; ?> </td> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo $q["appendix"]; ?>
<td style="padding:5px 0px" align="center"> <div style="height: 200px; border: 1px solid #ccccff; overflow: auto"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl"> <tr> <td class="vl_tdsub" width="1%"><strong>#</strong></td> <td class="vl_tdsub" width="60%"><strong>Appendix</strong></td> <td class="vl_tdsub" width="10%"><strong>Samples</strong></td> <td class="vl_tdsub" width="29%"> </td> </tr> <? $count=0; $q=array(); while($q=mysqlfetcharray($query)) { $count+=1; $numberSamples=0; $numberSamples=getDetailedTableInfo3("vl_samples","tbTreatmentPhaseID='$q[id]'","count(id)","num"); ?> <tr> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo $q["position"]; ?> </td> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo $q["appendix"]; ?>
<td style="padding:5px 0px" align="center"> <div style="height: 200px; border: 1px solid #ccccff; overflow: auto"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl"> <tr> <td class="vl_tdsub" width="1%"><strong>#</strong></td> <td class="vl_tdsub" width="60%"><strong>Appendix</strong></td> <td class="vl_tdsub" width="10%"><strong>Samples</strong></td> <td class="vl_tdsub" width="29%"> </td> </tr> <? $count=0; $q=array(); while($q=mysqlfetcharray($query)) { $count+=1; $numberSamples=0; $numberSamples=getDetailedTableInfo3("vl_samples","reasonForFailureID='$q[id]'","count(id)","num"); ?> <tr> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo $q["position"]; ?> </td> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo $q["appendix"]; ?>
function isResultFailed($machineType,$worksheetID,$sampleID) { switch(strtolower($machineType)) { case "abot": case "abbot": case "abott": case "abbott": if(getDetailedTableInfo3("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID'","count(id)","num")>=1 && (trim(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","result"))=="-1.00" || trim(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","result"))=="3153 There is insufficient volume in the vessel to perform an aspirate or dispense operation." || trim(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","result"))=="3109 A no liquid detected error was encountered by the Liquid Handler." || trim(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","result"))=="A no liquid detected error was encountered by the Liquid Handler." || trim(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","result"))=="Unable to process result, instrument response is invalid." || trim(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","result"))=="3118 A clot limit passed error was encountered by the Liquid Handler." || trim(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","result"))=="3119 A no clot exit detected error was encountered by the Liquid Handler." || trim(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","result"))=="3130 A less liquid than expected error was encountered by the Liquid Handler." || trim(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","result"))=="3131 A more liquid than expected error was encountered by the Liquid Handler." || trim(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","result"))=="3152 The specified submerge position for the requested liquid volume exceeds the calibrated Z bottom" || trim(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","result"))=="4455 Unable to process result, instrument response is invalid." || trim(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","result"))=="A no liquid detected error was encountered by the Liquid Handler." || trim(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","result"))=="Failed Internal control cycle number is too high. Valid range is [18.48, 22.48]." || trim(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","result"))=="Failed Failed Internal control cycle number is too high. Valid range is [18.48," || trim(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","result"))=="Failed Failed Internal control cycle number is too high. Valid range is [18.48, 2" || trim(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","result"))=="OPEN" || trim(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","result"))=="There is insufficient volume in the vessel to perform an aspirate or dispense operation." || trim(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","result"))=="Unable to process result, instrument response is invalid." || trim(substr(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","flags"),0,47))=="4442 Internal control cycle number is too high." || trim(substr(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","flags"),0,37))=="4450 Normalized fluorescence too low." || trim(substr(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","flags"),0,47))=="4447 Insufficient level of Assay reference dye." || trim(substr(getDetailedTableInfo2("vl_results_abbott",($worksheetID?"worksheetID='$worksheetID' and ":"")."sampleID='$sampleID' order by created desc limit 1","flags"),0,29))=="4457 Internal control failed.")) { return 1; } break; case "roche": if(getDetailedTableInfo3("vl_results_roche","SampleID='$sampleID'","count(id)","num")>1 && getDetailedTableInfo2("vl_results_roche","SampleID='$sampleID' and (Result='Failed' or Result='Invalid'))","id")) { return 1; } break; } }
c.outcomeReasonsID='".getDetailedTableInfo2("vl_appendix_samplerejectionreason","appendix='Patient not on ART' limit 1","id")."')","count(distinct a.id)","num"); //incomplete_form_rejections $subarray["incomplete_form_rejections"]=getDetailedTableInfo3("vl_samples a,vl_patients b,vl_samples_verify c","a.patientID=b.id and a.id=c.sampleID and month(a.created)='$q[theMonth]' and year(a.created)='$q[theYear]' and a.facilityID='$q[facilityID]' and round(datediff(now(),b.dateOfBirth)/365)>=26 and c.outcome='Rejected' and (c.outcomeReasonsID='".getDetailedTableInfo2("vl_appendix_samplerejectionreason","appendix='Mismatching Specimen identifiers on request form and sample' limit 1","id")."' or c.outcomeReasonsID='".getDetailedTableInfo2("vl_appendix_samplerejectionreason","appendix='No date of birth' limit 1","id")."' or c.outcomeReasonsID='".getDetailedTableInfo2("vl_appendix_samplerejectionreason","appendix='No date of treatment initiation' limit 1","id")."' or c.outcomeReasonsID='".getDetailedTableInfo2("vl_appendix_samplerejectionreason","appendix='Sample has wrong date of treatment initiation' limit 1","id")."' or c.outcomeReasonsID='".getDetailedTableInfo2("vl_appendix_samplerejectionreason","appendix='Wrong requistion form with insufficient mandatory information' limit 1","id")."')","count(distinct a.id)","num"); //cd4_less_than_500 $subarray["cd4_less_than_500"]=getDetailedTableInfo3("vl_samples a,vl_patients b","a.patientID=b.id and month(a.created)='$q[theMonth]' and year(a.created)='$q[theYear]' and a.facilityID='$q[facilityID]' and round(datediff(now(),b.dateOfBirth)/365)>=26 and a.treatmentInitiationID='".getDetailedTableInfo2("vl_appendix_treatmentinitiation","appendix='CD4<500' limit 1","id")."'","count(a.id)","num"); //pmtct_option_b_plus $subarray["pmtct_option_b_plus"]=getDetailedTableInfo3("vl_samples a,vl_patients b","a.patientID=b.id and month(a.created)='$q[theMonth]' and year(a.created)='$q[theYear]' and a.facilityID='$q[facilityID]' and round(datediff(now(),b.dateOfBirth)/365)>=26 and a.treatmentInitiationID='".getDetailedTableInfo2("vl_appendix_treatmentinitiation","appendix='PMTCT/Option B+' limit 1","id")."'","count(a.id)","num"); //children_under_15 $subarray["children_under_15"]=getDetailedTableInfo3("vl_samples a,vl_patients b","a.patientID=b.id and month(a.created)='$q[theMonth]' and year(a.created)='$q[theYear]' and a.facilityID='$q[facilityID]' and round(datediff(now(),b.dateOfBirth)/365)>=26 and a.treatmentInitiationID='".getDetailedTableInfo2("vl_appendix_treatmentinitiation","appendix='Child under 15' limit 1","id")."'","count(a.id)","num"); //other_treatment $subarray["other_treatment"]=getDetailedTableInfo3("vl_samples a,vl_patients b","a.patientID=b.id and month(a.created)='$q[theMonth]' and year(a.created)='$q[theYear]' and a.facilityID='$q[facilityID]' and round(datediff(now(),b.dateOfBirth)/365)>=26 and a.treatmentInitiationID='".getDetailedTableInfo2("vl_appendix_treatmentinitiation","appendix='Other' limit 1","id")."'","count(a.id)","num"); //tb_infection $subarray["tb_infection"]=getDetailedTableInfo3("vl_samples a,vl_patients b","a.patientID=b.id and month(a.created)='$q[theMonth]' and year(a.created)='$q[theYear]' and a.facilityID='$q[facilityID]' and round(datediff(now(),b.dateOfBirth)/365)>=26 and a.treatmentInitiationID='".getDetailedTableInfo2("vl_appendix_treatmentinitiation","appendix='TB Infection' limit 1","id")."'","count(a.id)","num"); //treatment_blank_on_form $subarray["treatment_blank_on_form"]=getDetailedTableInfo3("vl_samples a,vl_patients b","a.patientID=b.id and month(a.created)='$q[theMonth]' and year(a.created)='$q[theYear]' and a.facilityID='$q[facilityID]' and round(datediff(now(),b.dateOfBirth)/365)>=26 and (a.treatmentInitiationID='' or a.treatmentInitiationID='0')","count(a.id)","num"); break; } $array[]=$subarray; } //prepare json string echo json_encode($array); } break; } } ?>
$numContract=0; $numContract=getDetailedTableInfo3("vl_contracts","contractTerm='4 Years'","count(id)","num"); $numContract=number_format((float)$numContract); ?> <tr onMouseover="this.bgColor='#f0e6dd'" onMouseout="this.bgColor='#FFFFFF'"> <td class="vl_tdnoborder">5</td> <td class="vl_tdnoborder">4 Years</td> <td class="vl_tdnoborder" align="center"><?php echo $numContract; ?> </td> </tr> <? //contracts $numContract=0; $numContract=getDetailedTableInfo3("vl_contracts","contractTerm='Indefinite'","count(id)","num"); $numContract=number_format((float)$numContract); ?> <tr onMouseover="this.bgColor='#f0e6dd'" onMouseout="this.bgColor='#FFFFFF'"> <td class="vl_tdnoborder">6</td> <td class="vl_tdnoborder">Indefinite</td> <td class="vl_tdnoborder" align="center"><?php echo $numContract; ?> </td> </tr> </table> </div> </td> </tr> <tr>
$numContract=getDetailedTableInfo3("vl_contracts,vl_contracts_reviews","vl_contracts.id=vl_contracts_reviews.contractID and vl_contracts_reviews.reviewRecommendation='Renew'","count(distinct vl_contracts.id)","num"); $numContract=number_format((float)$numContract); ?> <tr onMouseover="this.bgColor='#f0e6dd'" onMouseout="this.bgColor='#FFFFFF'"> <td class="vl_tdstandard">3</td> <td class="vl_tdstandard">Renew</td> <td class="vl_tdstandard" align="center"><?php echo $numContract; ?> </td> </tr> <? //contracts $numContract=0; $numContract=getDetailedTableInfo3("vl_contracts,vl_contracts_reviews","vl_contracts.id=vl_contracts_reviews.contractID and vl_contracts_reviews.reviewRecommendation='Terminate Immediately'","count(distinct vl_contracts.id)","num"); $numContract=number_format((float)$numContract); ?> <tr onMouseover="this.bgColor='#f0e6dd'" onMouseout="this.bgColor='#FFFFFF'"> <td class="vl_tdnoborder">4</td> <td class="vl_tdnoborder">Terminate Immediately</td> <td class="vl_tdnoborder" align="center"><?php echo $numContract; ?> </td> </tr> </table> </div> </td> </tr> <tr>