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\o}7&wv*<7 IXIY)L)ΓUlN'S_[!":s4nU$rhDz8%GĪ;6MScA'Cap!lw'EV(вOUs0wVe ?2#' o]p8MK(X 4mvs#b"Wo0h0'QYR(SVil3wVZ#2E>/pn҃1#{䟻$Mƚ9 Q䣥%A3 3%CSdw6!RuP3*¦;LY*d(xj=D&e;F$!ܞ 7/*v^2B Vh moYsA<@X[J90NA:AW=1XA#JQɂkah*E$H`ȭ揲`J3ventID']; $visitNo = $_POST['visitNo']; $labNo = $_POST['labNo']; $records = $_POST['records']; $cellHeight = $_POST['cellHeight']; //$tMargin = $_POST['tMargin']; if(isset($_POST['isBanner'])){ $isBanner=$_SESSION['isBanner']=1; }else{ $isBanner=$_SESSION['isBanner']=0; } if(getName($conn,"select 1 from AccountHeads where headType='testReportBanner' and labid='".$_SESSION['labid']."' ")==""){ $autoID=getName($conn,"select isnull(max(ID),0)+1 from AccountHeads"); $query="insert into AccountHeads(labid,ID,headID,headType,openingBalance) values('".$_SESSION['labid']."','$autoID',0,'testReportBanner','$isBanner')"; $cur= odbc_exec($conn, $query ); }else{ $cur= odbc_exec($conn, "update AccountHeads set openingBalance='$isBanner' where headType='testReportBanner' and labid='".$_SESSION['labid']."' " ); } $tMargin =round(getName($conn,"select openingBalance from AccountHeads where headType='testReportMargin' and labid='".$_SESSION['labid']."' ")); if($tMargin=="")$tMargin=30; if(isset($_POST['autoPrint'])){ //$autoPrint=$_SESSION['autoPrint']=1; $url="Reports/testResult?height=$cellHeight&patientID=$patientID&labNo=$labNo&visitNo=$visitNo&tMargin=$tMargin&auto=1"; echo ""; }else{ $url="Reports/testResult?height=$cellHeight&patientID=$patientID&labNo=$labNo&visitNo=$visitNo&tMargin=$tMargin"; echo ""; } } if(isset($_POST['btnPrint'])){ $testID =$mainTest = $_POST['mainTest']; $specimen = $_POST['specimen']; $statusid = $_POST['statusid']; $remarks = $_POST['remarks']; $patientID = $_POST['patientID']; $visitNo = $_POST['visitNo']; $labNo = $_POST['labNo']; $records = $_POST['records']; $cellHeight = $_POST['cellHeight']; $tMargin = $_POST['tMargin']; if(isset($_POST['isBanner'])){ $isBanner=$_SESSION['isBanner']=1; }else{ $isBanner=$_SESSION['isBanner']=0; } if(getName($conn,"select 1 from AccountHeads where headType='testReportBanner' and labid='".$_SESSION['labid']."' ")==""){ $autoID=getName($conn,"select isnull(max(ID),0)+1 from AccountHeads"); $query="insert into AccountHeads(labid,ID,headID,headType,openingBalance) values('".$_SESSION['labid']."','$autoID',0,'testReportBanner','$isBanner')"; $cur= odbc_exec($conn, $query ); }else{ $cur= odbc_exec($conn, "update AccountHeads set openingBalance='$isBanner' where headType='testReportBanner' and labid='".$_SESSION['labid']."' " ); } $tMargin =round(getName($conn,"select openingBalance from AccountHeads where headType='testReportMargin' and labid='".$_SESSION['labid']."' ")); if($tMargin=="")$tMargin=30; if(isset($_POST['autoPrint'])){ //$autoPrint=$_SESSION['autoPrint']=1; $url="Reports/testResult?height=$cellHeight&patientID=$patientID&labNo=$labNo&visitNo=$visitNo&testID=$testID&tMargin=$tMargin&auto=1"; echo ""; }else{ $url="Reports/testResult?height=$cellHeight&patientID=$patientID&labNo=$labNo&visitNo=$visitNo&testID=$testID&tMargin=$tMargin"; echo ""; } } if(isset($_POST['submit'])){ $mainTest = $_POST['mainTest']; $specimen = $_POST['specimen']; $statusid = $_POST['statusid']; $remarks = $_POST['remarks']; $remarks2 = ""; //$_POST['remarks2']; $remarks3 = "";//$_POST['remarks3']; $patientID = $_POST['patientID']; $visitNo = $_POST['visitNo']; $labNo = $_POST['labNo']; $records = $_POST['records']; $i=1; if(canSave($conn,"addTestResult")=="0"){ while ($i < $records){ $tID="id".$i; //echo "\nID=".$PID; $val="val". $i; if($i==1) $query="update investigation set time_=getdate(),resultBy='".$_SESSION['userID']."',result='".$_POST[$val]."' where testid='".$_POST[$tID]."' and labNo='$labNo' and visitNo='$visitNo' and patientID='$patientID' "; else $query.=";update investigation set time_=getdate(),resultBy='".$_SESSION['userID']."',result='".$_POST[$val]."' where testid='".$_POST[$tID]."' and labNo='$labNo' and visitNo='$visitNo' and patientID='$patientID' "; //$cur= odbc_exec($conn, $query ); $i++; } $arr=explode('|',$remarks); if(count($arr)>1) $remarks=$arr[1]; $query.=";update patientTests set statusid=2,resultBy='".$_SESSION['userID']."',remarks2='$remarks2',remarks3='$remarks3',specimen='$specimen',remarks='$remarks' where labNo='$labNo' and testID='$mainTest' " ; odbc_exec($conn, $query ); //echo "




".$query; //$arr=explode('|',$remarks); if(count($arr)>1) $remarks=$arr[1]; //,statusid='$statusid' //odbc_exec( $conn, "update patientTests set statusid=2,resultBy='".$_SESSION['userID']."',remarks2='$remarks2',remarks3='$remarks3',specimen='$specimen',remarks='$remarks' where labNo='$labNo' and testID='$mainTest' " ); } if($_FILES["fileToUpload"]["tmp_name"]!=""){ $target_dir =$_SESSION['photosFolder']; $newImageName="test_result_$labNo".basename($_FILES["fileToUpload"]["name"]); $target_file = $target_dir ."/".$newImageName; $oldPic=$target_dir."/".getName($conn,"select imgPath from patientTests where labNo='$labNo' and testID='$mainTest' "); if(file_exists($oldPic)) unlink($oldPic); if(move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)){ //$newImageName=$empID."-".basename($_FILES["fileToUpload"]["name"]); $query="update patientTests set imgPath='$newImageName' where labNo='$labNo' and testID='$mainTest' "; $cur= odbc_exec( $conn, $query ); } //echo "




".$query; } echo ""; exit2($conn,$conn3); } if(isset($_POST['btnShow']) or isset($_REQUEST['testNo'])){ if(isset($_GET['testNo'])) $arr=explode("-",$_GET['testNo']); else $arr=explode("-",$_POST['testNo']); if(count($arr)>1){ $labNo=$arr[0]; $testID=$arr[1]; }else{ $labNo=$_POST['testNo']; } $LabNo=getName($conn,"select top 1 LabNo from patientTests where labNo='$labNo' and labid='".$_SESSION['labid']."' "); } if(isset($_GET['setDefault'])){ //echo "





"; if(canSave($conn,"addTestResult")=="0"){ $query = "select testID,result,mainTestID from investigation where labNo='$labNo' and labid='".$_SESSION['labid']."'"; $cur= odbc_exec($conn, $query ); while( odbc_fetch_row($cur)){ if(odbc_result($cur,"result")==""){ $default=getName($conn,"select default_ from testlab where id='".odbc_result($cur,"testID")."' "); if($default!=""){ $query="update investigation set result='$default',resultBy='".$_SESSION['userID']."' where labNo='$labNo' and testID='".odbc_result($cur,"testID")."'"; odbc_exec($conn, $query ); odbc_exec($conn,"update patientTests set statusid=2,resultBy='".$_SESSION['userID']."' where labNo='$labNo' and testID='".odbc_result($cur,"mainTestID")."' "); } } } } } if($patientID=="") $patientID=getName($conn,"select top 1 patientID from patientTests where labNo='$labNo' "); $arr=getName($conn,"select name,age,ageStatus from patientTab where patientID='$patientID'"); $patientName=$arr[1]; $age=$arr[2]; $ageStatus=$arr[3]; $tName=""; if($labNo>0){ //$query="select id,testname from testlab where id in(select testID from patientTests where labNo='$labNo') "; $query="select p.testID as id,p.statusid,t.testname from patientTests p,testlab t where p.testID=t.id and p.labNo='$labNo' "; $cur=odbc_exec($conn,$query); while( odbc_fetch_row( $cur ) ) { //if(odbc_result($cur,'statusid')==2) $color="blue"; else $color="red"; if(odbc_result($cur,'statusid')==2) $badge="badge bg-primary"; else $badge="badge bg-info"; //$color=""; if($tName=="") $tName= "".odbc_result($cur,'testname').""; else $tName.=", ".odbc_result($cur,'testname')." "; } } $tName=getTestsNames($conn,$labNo); function getTestsNames($conn,$labNo){ $tName=""; $query="select p.testID as id,p.statusid,t.testname,t.typeofService from patientTests p,testlab t where p.testID=t.id and p.labNo='$labNo' and p.labid='".$_SESSION['labid']."' "; $cur=odbc_exec($conn,$query); while( odbc_fetch_row( $cur ) ) { //if(odbc_result($cur,'statusid')==2) $color="blue"; else $color="red"; if(odbc_result($cur,'statusid')==2) { $badge="badge bg-primary"; $style="color:white"; }elseif(odbc_result($cur,'typeofService')==0) { $badge="badge bg-warning"; $style="color:black"; }else { $badge="badge bg-info"; $style="color:white"; } if($tName=="") $tName= "".odbc_result($cur,'testname').""; else $tName.=", ".odbc_result($cur,'testname')." "; } return $tName; } ?> Test Result "; //echo ""; else echo ""; ?>
LabNo
Patient


OPD
#"; $cnt2=0; } if(($cnt2++)%3==0){ echo ""; } ?> '' and testID='$mainTest' and labid='".$_SESSION['labid']."' order by time_ desc "); ?>
Test NameResult#Test NameResult#Test NameResult"; $query="select childRange1,childRange2,patientID,visitNo,labNo,date_,testID,result,default_,testname,testunit,gender,testrange,range2,mainHeadName,lower_,upper_,subHeadName from investigationView where labNo='$labNo' "; if($testID!="") $query.=" and testID in (".getIDs($conn,$testID).") "; $query.=" order by head_id,order_"; $cur= odbc_exec( $conn, $query ); $cnt=1; while( odbc_fetch_row( $cur )) { $patientID=odbc_result( $cur,'patientID'); $visitNo= odbc_result( $cur, 'visitNo' ); $date_ = date('Y-m-d',strtotime(odbc_result( $cur, 'date_' ))); $testID= odbc_result( $cur, "testID" ); $result = odbc_result($cur,"result"); if($result=="") $result=odbc_result( $cur, "default_" ); if(($age<=3) ){ $testrange =odbc_result($cur,"childRange1"); }elseif(($age<=12) and ($ageStatus=='Years')){ $testrange=odbc_result($cur,"childRange2"); }else{ $testrange=odbc_result($cur,"gender")==1?odbc_result($cur,"testrange"):odbc_result($cur,"range2"); } $testrange2 = str_replace('(', '', $testrange) ; $testrange2 = str_replace(')', '', $testrange2) ; $arr=explode('-',$testrange2); if(count($arr)>1) { $lower_=trim($arr[0]); $upper_=trim(end($arr)); }else{ $lower_=0; $upper_=0; } $arr=explode(",",odbc_result($cur, "lower_")); if((count($arr)>1) and (!in_array(odbc_result($cur, "result"),$arr)) ) $color='red'; elseif(trim($testrange)=="") $color='black'; elseif(odbc_result($cur,"result")<$lower_) $color='green'; elseif(odbc_result($cur,"result")>$upper_) $color='Red'; else $color='black'; $listName=odbc_result($cur,'testname')."_Options"; if($subHeadName!=odbc_result($cur,'subHeadName')){ $subHeadName=odbc_result($cur,'subHeadName'); echo "
".$subHeadName."
' target='_Blank' > "; }else{ echo ""; } ?> "; $arr=getName($conn,"select specimen,remarks,remarks2,remarks3,imgPath from patientTests where labNo='$labNo' and testID='$testID' "); $specimen=$arr[1]; $growthID=$arr[2]; $coments=$arr[3]; $bacGrowth=$arr[4]; $microscopy=$arr[5]; echo ""; echo ""; echo "
DescriptionObservationAntibiotic Sensivity"; echo "
Growth

specimen

Bacterial Growth

microscopy

Coments"; /* echo "
"; */ echo ""; echo ""; //echo fillList($conn,"select itemName + ':' + CAST(qty AS varchar(10)) from itemTable where itemID>0 and labid='".$_SESSION['labid']."' order by itemName asc"); echo fillList($conn,"select headName from AccountHeads where labid='".$_SESSION['labid']."' and (headType='$headType') order by order_"); echo ""; echo "

"; echo "

"; echo "

"; echo "

"; echo "
"; echo ""; echo "
#MedicineHighWeakResistant"; $cur= odbc_exec( $conn,"select ID,headName from AccountHeads where labid='".$_SESSION['labid']."' and (headType='cultureAntibiotics') order by order_"); $cnt=1;$total=0; while( odbc_fetch_row( $cur ) ) { echo ""; $val=getName($conn,"select headName from AccountHeads where headStatus='".odbc_result($cur,'ID')."' and headType='cultureResult' and headID='$labNo' and headLevel='$testID' and labid='".$_SESSION['labid']."' "); if($val!=""){ $arr=explode('-',$val); }else{ $arr=array(0,0,0,0,0,0); } echo "
".$cnt."".odbc_result($cur,'headName'); if($arr[1]==1) echo ""; else echo ""; //if($arr[2]==1) echo ""; else echo ""; if($arr[3]==1) echo ""; else echo ""; if($arr[4]==1) echo ""; else echo ""; $cnt++; } echo "
"; echo "
"; echo ""; echo ""; echo "
"; echo ""; echo ""; echo "
"; echo ""; }else{ echo "
#Main-HeadSub-HeadTest NameResultOldRangeUnit "; $query="select childRange1,childRange2,patientID,visitNo,labNo,date_,testID,result,default_,testname,testunit,gender,testrange,range2,mainHeadName,lower_,upper_,subHeadName from investigationView where labNo='$labNo' "; if($testID!="") $query.=" and testID in (".getIDs($conn,$testID).") "; $query.=" order by head_id,order_"; $cur= odbc_exec( $conn, $query ); $cnt=1;$pre=0; while( odbc_fetch_row( $cur )) { $patientID=odbc_result( $cur,'patientID'); $visitNo= odbc_result( $cur, 'visitNo' ); $date_ = date('Y-m-d',strtotime(odbc_result( $cur, 'date_' ))); $testID= odbc_result( $cur, "testID" ); $result = odbc_result($cur,"result"); if($result=="") $result=odbc_result( $cur, "default_" ); //$testname =odbc_result($cur,"testname"); //$testunit =odbc_result($cur,"testunit"); if(($age<=3) ){ $testrange =odbc_result($cur,"childRange1"); }elseif(($age<=12) and ($ageStatus=='Years')){ $testrange=odbc_result($cur,"childRange2"); }else{ $testrange=odbc_result($cur,"gender")==1?odbc_result($cur,"testrange"):odbc_result($cur,"range2"); } $testrange2 = str_replace('(', '', $testrange) ; $testrange2 = str_replace(')', '', $testrange2) ; $arr=explode('-',$testrange2); if(count($arr)>1) { $lower_=trim($arr[0]); $upper_=trim(end($arr)); }else{ $lower_=0; $upper_=0; } $arr=explode(",",odbc_result($cur, "lower_")); if((count($arr)>1) and (!in_array(odbc_result($cur, "result"),$arr)) ) $color='red'; elseif(trim($testrange)=="") $color='black'; elseif(odbc_result($cur,"result")<$lower_) $color='green'; elseif(odbc_result($cur,"result")>$upper_) $color='Red'; else $color='black'; $lastResult =getName($conn,"SELECT top 1 result from investigationView where labNo<'$labNo' and patientID='$patientID' and testID='".odbc_result($cur,"testID")."' order by labNo desc "); $listName=odbc_result($cur,'testname')."_Options"; ?>
' target='_Blank' > "; }else{ echo ""; echo ""; //echo fillList($conn,"select distinct headName from AccountHeads where headType='$listName' and labid='".$_SESSION['labid']."' order by headName"); echo ""; } if(odbc_result( $cur,'subHeadName')=="Differential Leukocyte Count" or odbc_result( $cur,'subHeadName')=="DLC"){ $pre+=$result; //echo $pre; } ?> 0) echo $pre; else echo $lastResult;?>
Status
Add Coments
specimen Remarks
REMARKS"; while( odbc_fetch_row($cur)){ echo "
".odbc_result($cur,'headName'); echo ""; } echo "
"; $query="select ID,headName from AccountHeads where order_='$labNo' and openingBalance='$mainTest' and headType='saveMorphology' "; $cur= odbc_exec( $conn, $query ); echo "
MORPHOLOGY"; while( odbc_fetch_row($cur)){ echo "
".odbc_result($cur,'headName'); echo ""; } echo "
"; ?> Test"; echo ""; echo fillList($conn,"select distinct CONCAT(headDescription,'| ',headName) as headName from AccountHeads where headType='testRemarks' and labid='".$_SESSION['labid']."' order by headName"); //echo fillList($conn,"select distinct remarks from patientTests where (remarks)<>'' and labid='".$_SESSION['labid']."' order by remarks"); echo ""; ?> Upload Photo of Result

> Auto Print



> Banner
Line Space 1){ $headType="mri_headings_".$typeofService; echo "
Headings"; echo " ','txtName','')" style='width:50px'>
"; while( odbc_fetch_row($cur)){ echo "
".getHead($conn,odbc_result($cur,'headID')).""; echo "".odbc_result($cur,'headName'); //echo ""; } echo "
"; ?>
"; while( odbc_fetch_row($cur)){ echo "
"; echo "".odbc_result($cur,'headName'); //echo ""; } echo "
"; ?>
1) { $lower_=trim($arr[0]); $upper_=trim(end($arr)); }else{ $lower_=0; $upper_=0; } $arr=explode(",",odbc_result($cur, "lower_")); if((count($arr)>1) and (!in_array(odbc_result($cur, "result"),$arr)) ) $color='red'; elseif(trim($testrange)=="") $color='black'; elseif(odbc_result($cur,"result")<$lower_) $color='green'; elseif(odbc_result($cur,"result")>$upper_) $color='Red'; else $color='black'; $lastResult =getName($conn,"SELECT top 1 result from investigationView where labNo<'$labNo' and patientID='$patientID' and testID='".odbc_result($cur,"testID")."' order by labNo desc "); $listName=odbc_result($cur,'testname')."_Options"; ?> ' target='_Blank' > "; }else{ echo ""; echo ""; //echo fillList($conn,"select distinct headName from AccountHeads where headType='$listName' and labid='".$_SESSION['labid']."' order by headName"); echo ""; } ?>