예제 #1
0
				//xls
				$dataRocheResults[]=array($patientART,$patientOtherID,$facility,$numberResults,$results);
			}
		}

		//output to xlsx
		$writer = new XLSXWriter();
		$writer->setAuthor($default_institutionName);
		$writer->writeSheet($dataAbbottResults,"abbott",$headerAbbottResults);
		$writer->writeSheet($dataRocheResults,"roche",$headerRocheResults);
		$writer->writeToStdOut();
	break;
	case "clinicalrequestformsexcel":
		//filename of the excel file to be downloaded
		$filename=0;
		$filename="excel.clinical.request.forms.".getFormattedDateCRB($datetime).".xls";

		//create an instance of the class
		$xls = new ExportXLS($filename);

		//period
		$from=0;
		$from="$fromYear-$fromMonth-$fromDay";
		$to=0;
		$to="$toYear-$toMonth-$toDay";
		
		$query=0;
		if($fromYear && $fromMonth && $fromDay && $toYear && $toMonth && $toDay) {
			$query=mysqlquery("select * from vl_forms_clinicalrequest where date(created)>='$from' and date(created)<='$to' order by created");
		} else {
			$query=mysqlquery("select * from vl_forms_clinicalrequest order by created");
예제 #2
0
				$dateFirstPrinted=getDetailedTableInfo2("vl_logs_printedresults","sampleID='$q[id]' order by created limit 1","created");
				if(!$dateFirstPrinted) {
					$dateFirstPrinted=getDetailedTableInfo2("vl_logs_printedrejectedresults","sampleID='$q[id]' order by created limit 1","created");
				}
				
				//xls
				$xls.="$q[formNumber],$q[lrCategory]$q[lrEnvelopeNumber]/$q[lrNumericID],$q[vlSampleID],".preg_replace("/,/s","",getDetailedTableInfo2("vl_facilities","id='$q[facilityID]' limit 1","facility")).",".preg_replace("/,/s","",getDetailedTableInfo2("vl_districts","id='$q[districtID]' limit 1","district")).",".preg_replace("/,/s","",getDetailedTableInfo2("vl_hubs","id='$q[hubID]' limit 1","hub")).",".getRawFormattedDateLessDay($q["collectionDate"]).",".preg_replace("/,/s","",getDetailedTableInfo2("vl_appendix_sampletype","id='$q[sampleTypeID]' limit 1","appendix")).",".preg_replace("/,/s","",getDetailedTableInfo2("vl_patients","id='$q[patientID]' limit 1","artNumber")).",".preg_replace("/,/s","",getDetailedTableInfo2("vl_patients","id='$q[patientID]' limit 1","otherID")).",".preg_replace("/,/s","",getDetailedTableInfo2("vl_patients","id='$q[patientID]' limit 1","gender")).",".ceil(getDateDifference(getDetailedTableInfo2("vl_patients","id='$q[patientID]' limit 1","dateOfBirth"),$datetime)/365).",".preg_replace("/,/s","",getDetailedTableInfo2("vl_patients_phone","patientID='$q[patientID]' order by created desc limit 1","phone")).",$q[treatmentLast6Months],".getRawFormattedDateLessDay($q["treatmentInitiationDate"]).",".preg_replace("/,/s","",getDetailedTableInfo2("vl_appendix_regimen","id='$q[currentRegimenID]' limit 1","appendix")).",".preg_replace("/,/s","",($q["treatmentInitiationID"]?getDetailedTableInfo2("vl_appendix_treatmentinitiation","id='$q[treatmentInitiationID]' limit 1","appendix"):$q["treatmentInitiationOther"])).",".preg_replace("/,/s","",getDetailedTableInfo2("vl_appendix_treatmentstatus","id='$q[treatmentStatusID]' limit 1","appendix")).",".preg_replace("/,/s","",getDetailedTableInfo2("vl_appendix_failurereason","id='$q[reasonForFailureID]' limit 1","appendix")).",$q[pregnant],$q[pregnantANCNumber],$q[breastfeeding],$q[activeTBStatus],".preg_replace("/,/s","",getDetailedTableInfo2("vl_appendix_tbtreatmentphase","id='$q[tbTreatmentPhaseID]' limit 1","appendix")).",".preg_replace("/,/s","",getDetailedTableInfo2("vl_appendix_arvadherence","id='$q[arvAdherenceID]' limit 1","appendix")).",".($q["vlTestingRoutineMonitoring"]?"Yes":"No").",".getRawFormattedDateLessDay($q["routineMonitoringLastVLDate"]).",$q[routineMonitoringValue],".preg_replace("/,/s","",getDetailedTableInfo2("vl_appendix_sampletype","id='$q[routineMonitoringSampleTypeID]' limit 1","appendix")).",".($q["vlTestingRepeatTesting"]?"Yes":"No").",".getRawFormattedDateLessDay($q["repeatVLTestLastVLDate"]).",$q[repeatVLTestValue],".preg_replace("/,/s","",getDetailedTableInfo2("vl_appendix_sampletype","id='$q[repeatVLTestSampleTypeID]' limit 1","appendix")).",".($q["vlTestingSuspectedTreatmentFailure"]?"Yes":"No").",".getRawFormattedDateLessDay($q["suspectedTreatmentFailureLastVLDate"]).",$q[suspectedTreatmentFailureValue],".preg_replace("/,/s","",getDetailedTableInfo2("vl_appendix_sampletype","id='$q[suspectedTreatmentFailureSampleTypeID]' limit 1","appendix")).",$sampleTested,".preg_replace("/,/s","",$lastWorksheetName).",$machineType,".preg_replace("/,/s","",preg_replace("/&lt;/is","<",$result)).",".(getDetailedTableInfo2("vl_samples_verify","sampleID='$q[id]' and outcome='Accepted' and created!='' limit 1","id")?getRawFormattedDateLessDay(getDetailedTableInfo2("vl_samples_verify","sampleID='$q[id]' and outcome='Accepted' limit 1","created")):"").",".(getDetailedTableInfo2("vl_samples_verify","sampleID='$q[id]' and outcome='Rejected' and created!='' limit 1","id")?getRawFormattedDateLessDay(getDetailedTableInfo2("vl_samples_verify","sampleID='$q[id]' and outcome='Rejected' limit 1","created")):"").",".preg_replace("/,/s","",getDetailedTableInfo2("vl_appendix_samplerejectionreason","id='".getDetailedTableInfo2("vl_samples_verify","sampleID='$q[id]' and outcome='Rejected' limit 1","outcomeReasonsID")."' limit 1","appendix")).",".(getDetailedTableInfo2("vl_samples_worksheet","sampleID='$q[id]' and created!='' limit 1","id")?getRawFormattedDateLessDay(getDetailedTableInfo2("vl_samples_worksheet","sampleID='$q[id]' order by created desc limit 1","created")):"").",".($dateLatestResultsUploaded?getRawFormattedDateLessDay($dateLatestResultsUploaded):"").",".($dateLatestResultsPrinted?getRawFormattedDateLessDay($dateLatestResultsPrinted):"").",".getRawFormattedDateLessDay($q["receiptDate"]).",".($dateFirstPrinted?getRawFormattedDateLessDay($dateFirstPrinted):"")."\n";	
			}
		}

		echo $xls;
	break;
	case "samplesreceivedexcel":
		//filename of the excel file to be downloaded
		$filename=0;
		$filename="excel.samplesreceived.".getFormattedDateCRB($datetime).".xls";

		//create an instance of the class
		$xls = new ExportXLS($filename);

		//period
		$from=0;
		$from="$fromYear-$fromMonth-$fromDay";
		$to=0;
		$to="$toYear-$toMonth-$toDay";
		
		$query=0;
		if($fromYear && $fromMonth && $fromDay && $toYear && $toMonth && $toDay) {
			$query=mysqlquery("select * from vl_samples where date(created)>='$from' and date(created)<='$to' order by created");
		} else {
			$query=mysqlquery("select * from vl_samples order by created");