if($id) { echo "<option value=\"".getDetailedTableInfo2("vl_users","id='$id'","role")."\">".getDetailedTableInfo2("vl_users","id='$id'","role")."</option>"; } else { echo "<option value=\"\" selected=\"selected\">Select Role</option>"; } ?> <option value="Lab Technologist">Lab Technologist</option> <option value="Lab Manager">Lab Manager</option> <option value="Other">Other</option> </select></td> </tr> <? if($id && $option!="remove") { ?> <tr> <td>Last Login</td> <td><?php echo $id ? getFormattedDate(getDetailedTableInfo2("vl_users", "id='{$id}'", "lastLogin")) : "Unavailable"; ?> </td> </tr> <? } ?> </table></td> </tr> <tr> <td style="border-top:1px solid #cccccc; padding-top:10px"> <input type="submit" name="button" id="button" value=" Save " /> <? if($task=="modify") { ?> <button type="button" id="button" name="button" value="button" onclick="document.location.href='?act=users&nav=configuration'"> Cancel </button> <input name="id" type="hidden" id="id" value="<?php echo $id; ?> ">
/** * function to log result overrides */ function logResultOverride($sampleID,$worksheetID,$result) { global $datetime,$trailSessionUser; //validate $sampleID=validate($sampleID); $worksheetID=validate($worksheetID); $result=validate($result); $id=0; $id=getDetailedTableInfo2("vl_results_override","sampleID='$sampleID' and worksheetID='$worksheetID'","id"); //avoid duplicates if(!$id) { //insert into vl_results_override mysqlquery("insert into vl_results_override (sampleID,worksheetID,result,created,createdby) values ('$sampleID','$worksheetID','$result','$datetime','$trailSessionUser')"); } else { //log table change logTableChange("vl_results_override","result",$id,getDetailedTableInfo2("vl_results_override","id='$id'","result"),$result); //update vl_results_override mysqlquery("update vl_results_override set result='$result' where id='$id'"); } }
</tr> </table> </td> <td style="padding: 0px 0px 0px 10px" align="right">Value:</td> <td style="padding:0px 0px 0px 5px"><input type="text" name="suspectedTreatmentFailureValue" id="suspectedTreatmentFailureValue" value="<?php echo $suspectedTreatmentFailureValue; ?> " class="search_pre" size="7" maxlength="10" /></td> <td align="right">Sample Type:</td> <td style="padding:0px 0px 0px 5px"> <select name="suspectedTreatmentFailureSampleTypeID" id="suspectedTreatmentFailureSampleTypeID" class="search"> <? $query=0; $query=mysqlquery("select * from vl_appendix_sampletype order by position"); if($suspectedTreatmentFailureSampleTypeID) { echo "<option value=\"$suspectedTreatmentFailureSampleTypeID\" selected=\"selected\">".getDetailedTableInfo2("vl_appendix_sampletype","id='$suspectedTreatmentFailureSampleTypeID' limit 1","appendix")."</option>"; } else { echo "<option value=\"\" selected=\"selected\">Select Sample Type</option>"; } if(mysqlnumrows($query)) { while($q=mysqlfetcharray($query)) { echo "<option value=\"$q[id]\">$q[appendix]</option>"; } } ?> </select> </td> </tr> </table> </div> </fieldset>
<td width="70%"><input type="text" name="appendix" id="appendix" class="search" size="25" value="<?php echo $id ? getDetailedTableInfo2("vl_appendix_tbtreatmentphase", "id='{$id}'", "appendix") : ""; ?> "></td> </tr> <tr> <td>Position</td> <td><select name="position" id="position" class="search"> <? //get max number of records $position=0; if(!$id) { $position=getDetailedTableInfo3("vl_appendix_tbtreatmentphase","appendix!=''","count(id)","num"); $position+=1; } else { $position=getDetailedTableInfo2("vl_appendix_tbtreatmentphase","id='$id'","position"); } echo "<option value=\"$position\" selected=\"selected\">$position</option>"; for($j=1;$j<=50;$j++) { echo "<option value=\"$j\">$j</option>"; } ?> </select></td> </tr> </table></td> </tr> <tr> <td style="border-top:1px solid #cccccc; padding-top:10px"> <input type="submit" name="button" id="button" value=" Save " /> <? if($task=="modify") { ?> <button type="button" id="button" name="button" value="button" onclick="document.location.href='?act=atbtreatmentphase&nav=configuration'"> Cancel </button>
</td> <td class="<?php echo $count < mysqlnumrows($xquery) ? "vl_tdstandard" : "vl_tdnoborder"; ?> " align="center"><a <?php echo $sampleURL; ?> ><?php echo number_format((double) $numberSamples); ?> </a></td> <td class="<?php echo $count < mysqlnumrows($xquery) ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo getDetailedTableInfo2("vl_facilities", "id='" . getDetailedTableInfo2("vl_samples", "patientID='{$q['id']}'", "facilityID") . "'", "facility"); ?> </td> <td class="<?php echo $count < mysqlnumrows($xquery) ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><div class="vls_grey" style="padding:3px 0px 0px 0px"><a href="/samples/manage.patients/modify/<?php echo $q["id"]; ?> /">Edit Patient Information</a></div></td> </tr> <? } ?> </table> </div> </td> </tr>
</strong><br /><a href="?act=facilities&districtID=<?php echo $districtID; ?> &nav=configuration">Return to previous page</a></td> </tr> </table> <? } ?> </td> <td width="35%" valign="top" style="padding:3px 0px 0px 12px"> <div> <table border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px solid #d5d5d5" width="100%"> <tr> <td style="padding:10px"><table width="100%" border="0" class="vl"> <tr> <td><strong>MANAGE FACILITIES IN <?php echo getDetailedTableInfo2("vl_districts", "id='{$districtID}'", "district"); ?> DISTRICT</strong></td> </tr> <tr> <td> </td> </tr> <tr> <td bgcolor="#d5d5d5" style="padding:10px">Create, Delete or Manage Facilities</td> </tr> </table></td> </tr> </table> </div> <div style="padding:10px 0px 0px 0px"> <script Language="JavaScript" Type="text/javascript">
/** * log search query * @param: $refNumber */ function logDownloadedVLClinicalForms($refNumber) { global $datetime,$trailSessionUser; if(!getDetailedTableInfo2("vl_logs_downloadedclinicalforms","refNumber='$refNumber' limit 1","id")) { mysqlquery("insert into vl_logs_downloadedclinicalforms (refNumber,created,createdby) values ('$refNumber','$datetime','$trailSessionUser')"); } }
$result=0; $result=getVLResult($machineType,$worksheetID,$sampleReferenceNumber,$factor); //dispatch details $scheduledDate=0; $scheduledDate=getDetailedTableInfo2("vl_logs_samplerepeats","sampleID='$sampleID' and oldWorksheetID='$worksheetID' limit 1","created"); $by=0; $by=getDetailedTableInfo2("vl_logs_samplerepeats","sampleID='$sampleID' and oldWorksheetID='$worksheetID' limit 1","createdby"); ?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" cellspacing="0" cellpadding="0" class="vl"> <tr> <td class="tab_active">FORM: <?php echo getDetailedTableInfo2("vl_samples", "id='{$sampleID}'", "formNumber"); ?> </td> </tr> </table></td> </tr> <tr> <td style="border:1px solid #CCCCFF; padding:20px"> <table width="100%" border="0" class="vl"> <tr> <td> <div style="height: 280px; overflow: auto; padding:3px"> <table width="92%" border="0" class="vl"> <tr> <td> <fieldset style="width: 100%">
$query=0; $query=mysqlquery("select distinct month(a.created) theMonth,year(a.created) theYear,a.facilityID facilityID, CASE WHEN (round(datediff(now(),b.dateOfBirth)/365)<5 or b.dateOfBirth='0000-00-00') then 1 WHEN round(datediff(now(),b.dateOfBirth)/365)>=5 and round(datediff(now(),b.dateOfBirth)/365)<=9 then 2 WHEN round(datediff(now(),b.dateOfBirth)/365)>=10 and round(datediff(now(),b.dateOfBirth)/365)<=18 then 3 WHEN round(datediff(now(),b.dateOfBirth)/365)>=19 and round(datediff(now(),b.dateOfBirth)/365)<=25 then 4 WHEN round(datediff(now(),b.dateOfBirth)/365)>=26 then 5 END theAgeCategory from vl_samples a,vl_patients b where a.patientID=b.id order by a.created"); if(mysqlnumrows($query)) { //sample type IDs $dbsSampleTypeID=0; $dbsSampleTypeID=getDetailedTableInfo2("vl_appendix_sampletype","appendix='DBS' limit 1","id"); $plasmaSampleTypeID=0; $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
<fieldset style="width: 100%"> <legend><strong>PATIENT SAMPLES</strong></legend> <div style="padding:5px 0px 0px 0px"> <table width="100%" border="0" class="vl" cellspacing="0" cellpadding="0"> <tr> <td width="20%" class="vl_tdsub"><strong>Form #</strong></td> <td width="20%" class="vl_tdsub"><strong>Sample Reference #</strong></td> <td width="20%" class="vl_tdsub"><strong>Status</strong></td> <td width="40%" class="vl_tdsub"><strong>Date Captured</strong></td> </tr> <? $count=0; while($q=mysqlfetcharray($query)) { $count+=1; $status=0; $status=getDetailedTableInfo2("vl_samples_verify","sampleID='$q[id]'","outcome"); if($count<$num) { echo "<tr> <td class=\"vl_tdstandard\">$q[formNumber]</td> <td class=\"vl_tdstandard\"><a href=\"/verify/find.and.edit/$q[id]/1/\">$q[vlSampleID]</a></td> <td class=\"vl_tdstandard\">".($status?$status:"Pending")."</td> <td class=\"vl_tdstandard\">".getFormattedDate($q["created"])." at ".getFormattedTimeLessS($q["created"])."</td> </tr>"; } else { echo "<tr> <td class=\"vl_tdnoborder\">$q[formNumber]</td> <td class=\"vl_tdnoborder\"><a href=\"/verify/find.and.edit/$q[id]/1/\">$q[vlSampleID]</a></td> <td class=\"vl_tdnoborder\">".($status?$status:"Pending")."</td> <td class=\"vl_tdnoborder\">".getFormattedDate($q["created"])." at ".getFormattedTimeLessS($q["created"])."</td> </tr>"; }
<td class="vl_error">There are No Results matching the Search Criteria <strong><?php echo $searchQuery; ?> </strong>!</td> </tr> </table> <? } else { ?> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td class="vl_error">No <?php echo $machineType; ?> Results Found<?php echo ($facilityID || $worksheetID ? " within " : "") . ($facilityID && !$worksheetID ? getDetailedTableInfo2("vl_facilities", "id='{$facilityID}' limit 1", "facility") . " Facility" : "") . (!$facilityID && $worksheetID ? getDetailedTableInfo2("vl_samples_worksheetcredentials", "id='{$worksheetID}' limit 1", "worksheetReferenceNumber") . " Worksheet" : "") . ($facilityID && $worksheetID ? getDetailedTableInfo2("vl_facilities", "id='{$facilityID}' limit 1", "facility") . " Facility and " . getDetailedTableInfo2("vl_samples_worksheetcredentials", "id='{$worksheetID}' limit 1", "worksheetReferenceNumber") . " Worksheet" : ""); ?> </td> </tr> </table> <? } } ?> </div> </td> </tr> </table> <!-- End Printed/Not Printed Items --> </td> </tr>
echo "<option value=\"$q[id]\">$q[hub]</option>"; } } ?> </select> </td> </tr> <tr> <td>District</td> <td> <select name="districtID" id="districtID" class="search"> <? $query=0; $query=mysqlquery("select * from vl_districts order by district"); if($districtID) { echo "<option value=\"$districtID\" selected=\"selected\">".getDetailedTableInfo2("vl_districts","id='$districtID'","district")."</option>"; } else { echo "<option value=\"\" selected=\"selected\">Select District</option>"; } if(mysqlnumrows($query)) { while($q=mysqlfetcharray($query)) { echo "<option value=\"$q[id]\">$q[district]</option>"; } } ?> </select> </td> </tr> <tr> <td>Date Received <font class="vl_red">*</font></td> <td>
$count=0; $q=array(); while($q=mysqlfetcharray($query)) { $count+=1; $patientID=0; $patientID=getDetailedTableInfo2("vl_samples","id='$q[sampleID]'","patientID"); $artNumber=0; $artNumber=getDetailedTableInfo2("vl_patients","id='$patientID'","artNumber"); $otherID=0; $otherID=getDetailedTableInfo2("vl_patients","id='$patientID'","otherID"); $sampleID=0; $sampleID=getDetailedTableInfo2("vl_samples","id='$q[sampleID]'","vlSampleID"); $created=0; $created=getDetailedTableInfo2("vl_samples_verify","sampleID='$q[sampleID]'","created"); $createdby=0; $createdby=getDetailedTableInfo2("vl_samples_verify","sampleID='$q[sampleID]'","createdby"); ?> <tr> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "> <div><strong><?php echo $artNumber ? "ART Number" : ""; echo $artNumber && $otherID ? "/" : ""; echo $otherID ? "OtherID" : ""; ?> :</strong> <?php echo $artNumber ? $artNumber : ""; echo $artNumber && $otherID ? "/" : ""; echo $otherID ? $otherID : "";
<td style="padding:5px 0px; border-bottom: 1px solid #efefef"><?php echo $activeTB; ?> </td> </tr> <tr> <td style="padding:5px 0px; border-bottom: 1px solid #efefef"><strong>TB Treatment Phase</strong></td> <td style="padding:5px 0px; border-bottom: 1px solid #efefef"><?php echo getDetailedTableInfo2("vl_appendix_tbtreatmentphase", "id='{$tbTreatmentPhase}' limit 1", "appendix"); ?> </td> </tr> <tr> <td style="padding:5px 0px"><strong>ARV Adherence</strong></td> <td style="padding:5px 0px"><?php echo getDetailedTableInfo2("vl_appendix_arvadherence", "id='{$arvAdherence}' limit 1", "appendix"); ?> </td> </tr> </table> </div> </fieldset> </td> </tr> </table> </div> </td> </tr> <tr> <td><img src="/images/spacer.gif" width="10" height="10" /></td> </tr>
echo $id ? getDetailedTableInfo2("vl_admins", "id='{$id}'", "email") : ""; ?> "></td> </tr> <tr> <td>Phone</td> <td><input type="text" name="phone" id="phone" class="search" size="25" value="<?php echo $id ? getDetailedTableInfo2("vl_admins", "id='{$id}'", "phone") : "+"; ?> "></td> </tr> <? if($id && $option!="remove") { ?> <tr> <td>Last Login</td> <td><?php echo $id ? getFormattedDate(getDetailedTableInfo2("vl_admins", "id='{$id}'", "login")) : "Unavailable"; ?> </td> </tr> <? } ?> </table></td> </tr> <tr> <td style="border-top:1px solid #cccccc; padding-top:10px"> <input type="submit" name="button" id="button" value=" Save " /> <? if($task=="modify") { ?> <button type="button" id="button" name="button" value="button" onclick="document.location.href='?act=admins&nav=configuration'"> Cancel </button> <input name="id" type="hidden" id="id" value="<?php echo $id; ?> ">
<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"]; ?> .pdf" target="_blank">Download Batch Form</a> :: <a href="#" onclick="iDisplayMessage('/generateforms/preview/<?php echo $q["refNumber"]; ?> /')">View/Download Individual Forms</a></div></td>--> </tr> <? } ?>
:: <a href="/verify/" class="vll_grey">Verify Samples</a> <? } ?> <? if(getDetailedTableInfo2("vl_users_permissions","userID='".getUserID($trailSessionUser)."' and permission='worksheets' limit 1","id")) { ?> :: <a href="/worksheets/" class="vll_grey">Worksheets</a> <? } ?> <? if(getDetailedTableInfo2("vl_users_permissions","userID='".getUserID($trailSessionUser)."' and permission='generateForms' limit 1","id")) { ?> :: <a href="/generateforms/" class="vll_grey">Generate Forms</a> <? } ?> <? if(getDetailedTableInfo2("vl_users_permissions","userID='".getUserID($trailSessionUser)."' and permission='results' limit 1","id")) { ?> :: <a href="/results/" class="vll_grey">Results</a> <? } ?> <? if(getDetailedTableInfo2("vl_users_permissions","userID='".getUserID($trailSessionUser)."' and permission='results' limit 1","id")) { ?> :: <a href="/results_new/" class="vll_grey">Results (Browser Printing)</a> <? } ?> <? if(getDetailedTableInfo2("vl_users_permissions","userID='".getUserID($trailSessionUser)."' and permission='reports' limit 1","id") || getDetailedTableInfo2("vl_users_permissions","userID='".getUserID($trailSessionUser)."' and permission='reportsQC' limit 1","id")) { ?> :: <a href="/reports/" class="vll_grey">Reports</a></td> <? } ?> </tr> <tr> <td align="center"> <table width="90%" border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top"> <!-- Begin Center Table --> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="100%" bgcolor="#FFFFFF" style="padding:20px 30px"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr>
/** * function to change a user's setting * @param: $userID * @param: $setting * @param: $value */ function alterUserSetting($userID,$setting,$value) { //globals global $datetime,$trailSessionUser; //does user have a setting account? $query=0; $query=mysqlquery("select * from vl_users_settings where userID='$userID'"); if(mysqlnumrows($query)) { //log table change logTableChange("vl_users_settings","$setting",getDetailedTableInfo2("vl_users_settings","userID='$userID'","id"),getDetailedTableInfo2("vl_users_settings","userID='$userID'","$setting"),$value); //update mysqlquery("update vl_users_settings set $setting='$value' where userID='$userID'"); } else { //insert mysqlquery("insert into vl_users_settings (userID,$setting,created,createdby) values ('$userID','$value','$datetime','$trailSessionUser')"); } }
* task 6: remove facilities for which there are no samples * task 7: remove regimen which have no samples * task 8: remove treatment lines which have no samples or regimen * task 9: match the districtID and hubID within vl_samples to the facility within vl_facilities * task 10: remove facilities with no samples * task 11: populate vl_results_merged */ //task 11: populate vl_results_merged, begin with abbott $query=0; $query=mysqlquery("select * from vl_results_abbott"); if(mysqlnumrows($query)) { while($q=mysqlfetcharray($query)) { //factor $factor=0; $factor=getDetailedTableInfo2("vl_results_multiplicationfactor","worksheetID='$q[worksheetID]' limit 1","factor"); if(!$factor) { $factor=1; } //alphanumeric result $resultAlphanumeric=0; $resultAlphanumeric=getVLResult("abbott",$q["worksheetID"],$q["sampleID"],$factor); //numeric result $resultNumeric=0; $resultNumeric=getVLNumericResultOnly($resultAlphanumeric); mysqlquery("insert ignore into vl_results_merged (machine,worksheetID,vlSampleID,resultAlphanumeric, resultNumeric,created,createdby) values ('abbott','$q[worksheetID]','$q[sampleID]','$resultAlphanumeric', '$resultNumeric','$q[created]','$q[createdby]')");
date(created)>='2015-12-27' group by vlSampleID having num=1"); if(mysqlnumrows($query)) { while($q=mysqlfetcharray($query)) { //get the id $id=0; $id=getDetailedTableInfo2("vl_results_override","sampleID='$q[vlSampleID]' and date(created)>='2015-12-27' order by created desc limit 1","id"); //log and remove record logDataRemoval("delete from vl_results_override where id='$id'"); mysqlquery("delete from vl_results_override where id='$id'"); } } */ //task 4: a procedure to override key abbott results $query=0; $query=mysqlquery("select sampleID, count(id) num, max(created) dateCreated from vl_results_abbott where result='3119 A no clot exit detected error was encountered by the Liquid Handler.' and sampleID not in (select sampleID from vl_results_override) group by sampleID having num>1 order by num desc"); if(mysqlnumrows($query)) { while($q=mysqlfetcharray($query)) { //log result override logResultOverride($q["sampleID"],getDetailedTableInfo2("vl_results_abbott","sampleID='$q[sampleID]' and created='$q[dateCreated]' limit 1","worksheetID"),$default_resultFailureNewSampleMessage); } } //task 5: fix a result typo mysqlquery("update vl_results_override set result='There is No Result Given. The Test Failed the Quality Control Criteria. We advise you send a new sample.' where result='There is No Result Given. The Test Failed the Quality Control Criteria. We advise you send a a new sample.'"); ?>
$worksheet=0; $worksheet=getDetailedTableInfo2("vl_samples_worksheetcredentials","id='$worksheetArray[$i]'","worksheetReferenceNumber"); $patientID=0; $patientID=getDetailedTableInfo2("vl_samples","id='$sampleArray[$i]'","patientID"); $artNumber=0; $artNumber=getDetailedTableInfo2("vl_patients","id='$patientID'","artNumber"); $sampleID=0; $sampleID=$sampleArray[$i]; $created=0; $created=getDetailedTableInfo2("vl_samples_verify","sampleID='$sampleArray[$i]'","created"); $createdby=0; $createdby=getDetailedTableInfo2("vl_samples_verify","sampleID='$sampleArray[$i]'","createdby"); $id=0; $id=getDetailedTableInfo2("vl_results_override","sampleID='$sampleArray[$i]' and worksheetID='$worksheetArray[$i]'","id"); $result=0; $result=getDetailedTableInfo2("vl_results_override","sampleID='$sampleArray[$i]' and worksheetID='$worksheetArray[$i]'","result"); ?> <tr> <td class="<?php echo $class; ?> "><input name="samplesID[]" type="checkbox" id="samplesID[]" value="<?php echo $sampleArray[$i] . "::" . $worksheetArray[$i]; ?> " /></td> <td class="<?php echo $class; ?> "> <div><strong>ART Number:</strong> <?php echo $artNumber;
<td class="vl_tdstandard"><input name="results" type="checkbox" id="results" <?php echo getDetailedTableInfo2("vl_users_permissions", "userID='{$id}' and permission='results'", "id") ? "checked=\"checked\"" : ""; ?> value="1" /></td> <td class="vl_tdstandard">View Results</td> </tr> <tr> <td class="vl_tdstandard"><input name="reports" type="checkbox" id="reports" <?php echo getDetailedTableInfo2("vl_users_permissions", "userID='{$id}' and permission='reports'", "id") ? "checked=\"checked\"" : ""; ?> value="1" /></td> <td class="vl_tdstandard">View Reports</td> </tr> <tr> <td class="vl_tdnoborder"><input name="reportsQC" type="checkbox" id="reportsQC" <?php echo getDetailedTableInfo2("vl_users_permissions", "userID='{$id}' and permission='reportsQC'", "id") ? "checked=\"checked\"" : ""; ?> value="1" /></td> <td class="vl_tdnoborder">View Reports (Quality Control)</td> </tr> </table> </div> </td> </tr> <tr> <td style="border-top:1px solid #cccccc; padding-top:10px"> <input type="submit" name="button" id="button" value=" Save " /> <? if($task=="modify") { ?> <button type="button" id="button" name="button" value="button" onclick="document.location.href='?act=permissions&nav=configuration'"> Cancel </button> <input name="id" type="hidden" id="id" value="<?php
<tr> <td style="padding:10px 0px 10px 0px"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="50%" valign="top"><table width="100%" border="0" class="vl"> <tr> <td colspan="2"><strong>Link this Patient</strong></td> </tr> <tr> <td width="20%">Facility Name <font class="vl_red">*</font></td> <td width="80%"> <select name="facilityID" id="facilityID" class="search" onchange="checkForHubDistrict()"> <? $query=0; $query=mysqlquery("select * from vl_facilities where facility!='' order by facility"); if($facilityID) { echo "<option value=\"$facilityID\" selected=\"selected\">".getDetailedTableInfo2("vl_facilities","id='$facilityID'","facility")."</option>"; } else { echo "<option value=\"\" selected=\"selected\"></option>"; } if(mysqlnumrows($query)) { while($q=mysqlfetcharray($query)) { echo "<option value=\"$q[id]\">$q[facility]</option>"; } } ?> </select> <script> var z = dhtmlXComboFromSelect("facilityID"); z.enableFilteringMode(true); </script> </td>
</td> </tr> <tr> <td style="padding:5px 0px"><a href="?act=regions&nav=configuration">Return to List of Regions</a></td> </tr> </table> <? } ?> </td> <td width="35%" valign="top" style="padding:3px 0px 0px 12px"> <div> <table border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px solid #d5d5d5" width="100%"> <tr> <td style="padding:10px"><table width="100%" border="0" class="vl"> <tr> <td><strong>MANAGE DISTRICTS IN <?php echo getDetailedTableInfo2("vl_regions", "id='{$regionID}'", "region"); ?> REGION</strong></td> </tr> <tr> <td> </td> </tr> <tr> <td bgcolor="#d5d5d5" style="padding:10px">Create, Delete or Manage Districts</td> </tr> </table></td> </tr> </table> </div> <div style="padding:10px 0px 0px 0px"> <script Language="JavaScript" Type="text/javascript">
?> " class="search_pre" size="20" maxlength="100" /></td> </tr> <tr> <td style="padding:0px 0px 5px 0px">Machine Type <font class="vl_red">*</font></td> <td style="padding:0px 0px 5px 0px">Roche <input name="machineType" id="machineType" value="roche" type="hidden" /></td> </tr> <tr> <td style="padding:0px 0px 15px 0px; border-bottom: 1px dashed #dfe6e6">Worksheet Type <font class="vl_red">*</font></td> <td style="padding:0px 0px 15px 0px; border-bottom: 1px dashed #dfe6e6"> <select name="worksheetType" id="worksheetType" class="search"> <? $query=0; $query=mysqlquery("select * from vl_appendix_sampletype order by position"); if($worksheetType) { echo "<option value=\"$worksheetType\" selected=\"selected\">".getDetailedTableInfo2("vl_appendix_sampletype","id='$worksheetType' limit 1","appendix")."</option>"; } else { echo "<option value=\"\" selected=\"selected\">Select Worksheet Type</option>"; } if(mysqlnumrows($query)) { while($q=mysqlfetcharray($query)) { echo "<option value=\"$q[id]\">$q[appendix]</option>"; } } ?> </select></td> </tr> <tr> <td style="padding:10px 0px 5px 0px">HI2CAP <font class="vl_red">*</font></td> <td style="padding:10px 0px 5px 0px"><input type="text" name="samplePrep" id="samplePrep" value="<?php
$rejectionReason=0; $outcomeReasonID=0; if($worksheetID) { //worksheets $worksheetUniqueID=$worksheetID; $worksheetReferenceNumber=getDetailedTableInfo2("vl_samples_worksheetcredentials","id='$worksheetUniqueID'","worksheetReferenceNumber"); //factor $factor=getDetailedTableInfo2("vl_results_multiplicationfactor","worksheetID='$worksheetUniqueID' limit 1","factor"); if(!$factor) { $factor=1; } //results $result=getVLResult($machineType,$worksheetID,$sampleReferenceNumber,$factor); } else { $outcomeReasonID=getDetailedTableInfo2("vl_samples_verify","sampleID='$sampleID' and outcome='Rejected' limit 1","outcomeReasonsID"); $rejectionReason=getDetailedTableInfo2("vl_appendix_samplerejectionreason","id='$outcomeReasonID' and sampleTypeID='$sampleTypeID'","appendix"); } ?> <tr onMouseover="this.bgColor='#f0e6dd'" onMouseout="this.bgColor='#FFFFFF'"> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder"; ?> "><?php echo $count; ?> <input name="sampleResultHidden[]" type="hidden" id="sampleResultHidden[]" value="<?php echo $sampleID . "|" . $worksheetUniqueID; ?> "></td> <td class="<?php echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder";
<td width="70%"><input type="text" name="appendix" id="appendix" class="search" size="25" value="<?php echo $id ? getDetailedTableInfo2("vl_appendix_sampletype", "id='{$id}'", "appendix") : ""; ?> "></td> </tr> <tr> <td>Position</td> <td><select name="position" id="position" class="search"> <? //get max number of records $position=0; if(!$id) { $position=getDetailedTableInfo3("vl_appendix_sampletype","appendix!=''","count(id)","num"); $position+=1; } else { $position=getDetailedTableInfo2("vl_appendix_sampletype","id='$id'","position"); } echo "<option value=\"$position\" selected=\"selected\">$position</option>"; for($j=1;$j<=50;$j++) { echo "<option value=\"$j\">$j</option>"; } ?> </select></td> </tr> </table></td> </tr> <tr> <td style="border-top:1px solid #cccccc; padding-top:10px"> <input type="submit" name="button" id="button" value=" Save " /> <? if($task=="modify") { ?> <button type="button" id="button" name="button" value="button" onclick="document.location.href='?act=asampletype&nav=configuration'"> Cancel </button>
<? } ?> <? if($task=="add") { ?> <tr> <td style="border-bottom:1px solid #cccccc; padding-bottom:10px">Add Region</td> </tr> <? } else { ?> <tr> <td style="border-bottom:1px solid #cccccc; padding-bottom:10px">Manage Regions</td> </tr> <? } ?> <tr> <td style="padding:10px 0px 10px 0px"><table width="100%" border="0" class="vl"> <tr> <td width="30%">Region</td> <td width="70%"><input type="text" name="region" id="region" class="search" size="25" value="<?php echo $id ? getDetailedTableInfo2("vl_regions", "id='{$id}'", "region") : ""; ?> "></td> </tr> </table></td> </tr> <tr> <td style="border-top:1px solid #cccccc; padding-top:10px"> <input type="submit" name="button" id="button" value=" Save " /> <? if($task=="modify") { ?> <button type="button" id="button" name="button" value="button" onclick="document.location.href='?act=regions&nav=configuration'"> Cancel </button> <input name="id" type="hidden" id="id" value="<?php echo $id; ?> "> <? } ?>
<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> </table> </div> <!-- End Repeat Test --> <!-- Start Sample Rejected --> <div style=\"width: 95%; padding:5px 0px; border-bottom: 1px solid #CCC\"> <table style=\"width: 60%\"> <tr> <td style=\"width: 35%\">Sample Rejected:</td> <td style=\"width: 2%\"><div style=\"padding: 1px; height: 12px; width:12px; border: 1px solid #333; text-align: center\"> </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\"><img src=\"$home_url"."/images/check.gif\" /></div></td> <td style=\"width: 43%; padding:0px 0px 0px 5px\">No</td>
if(mysqlnumrows($query)) { while($q=mysqlfetcharray($query)) { //remove logDataRemoval("delete from vl_appendix_treatmentstatus where id='$q[id]'"); mysqlquery("delete from vl_appendix_treatmentstatus where id='$q[id]'"); } } //task 8: match the districtID and hubID within vl_samples to the facility within vl_facilities $query=0; $query=mysqlquery("select distinct facilityID,districtID,hubID from vl_samples"); if(mysqlnumrows($query)) { while($q=mysqlfetcharray($query)) { //log table change logTableChange("vl_facilities","districtID",$q["facilityID"],getDetailedTableInfo2("vl_facilities","id='$q[facilityID]'","districtID"),$q["districtID"]); logTableChange("vl_facilities","hubID",$q["facilityID"],getDetailedTableInfo2("vl_facilities","id='$q[facilityID]'","hubID"),$q["hubID"]); //update vl_facilities mysqlquery("update vl_facilities set districtID='$q[districtID]', hubID='$q[hubID]' where id='$q[facilityID]'"); } } //task 9: remove facilities with no samples $query=0; $query=mysqlquery("select * from vl_facilities where id not in (select facilityID from vl_samples)"); if(mysqlnumrows($query)) { while($q=mysqlfetcharray($query)) { //remove logDataRemoval("delete from vl_facilities where id='$q[id]'"); mysqlquery("delete from vl_facilities where id='$q[id]'"); } }