Mr.Fn4ticHz Shell
Server IP : 162.240.98.243  /  Your IP : 3.147.67.16
Web Server : Apache
System : Linux server.bti.yaw.mybluehostin.me 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : btiyawmy ( 1003)
PHP Version : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/btiyawmy/www/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/btiyawmy/www/patientmanager_ipd.php
<?php 
require_once("LoginManager.php");
class PatientManager
{	
public static $userhomepage="welcome.php",$loginpage="login.php",$adminhomepage="price.php",$drhomepage="drprofile.php",$patienthomepage="patient_basic.php";

//START NEW  ADD AS PATIENT//

public static function testpatientfinal26MARC($patientid,$hospitalid,$typevisit,$casetype,$Admitted_Under,$triage,$entered_by)
{
	echo "";
	$link=DBManager::connect();
	include("dbconnection.php");
$sql1 ="SELECT * FROM dr WHERE drid='$Admitted_Under'";
		$qsql1 = mysqli_query($con,$sql1);
		if($rh1 = mysqli_fetch_array($qsql1))
		
		
		$narayan=LoginManager::currentUser();
	$anilka=LoginManager::getUserTypeByuname("$narayan");
	$entered_by="$anilka";
			$updated_at=date("Y/m/d");
   $created_at=date("F d, Y / h:i:s A");
		
	$sql="INSERT INTO addaspatient(prescriptionid,patientid,hospitalid,typevisit,casetype,Admitted_Under,triage,entered_by, created_at,updated_at) VALUES (NULL,'$patientid','$hospitalid','$typevisit','$casetype','$Admitted_Under','$triage','$entered_by','$created_at','$updated_at')";
		if($qsql = mysqli_query($link,$sql))
		{
			$insid= mysqli_insert_id($link);
			$prescriptionid= $insid;
		   PatientManager::dischargetry($prescriptionid,"$patientid","$hospitalid","$typevisit","Admission","","","","$admissiondate","$entered_by");
		   if($typevisit == 'OPD'){
  PatientManager::billingLog("$patientid","$prescriptionid","Consultant_fees","$casetype","drinvace.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh1[Visit_fee]","discount","grand_total","paymentmode","status","$Admitted_Under");
	PatientManager::tatLog("$patientid","$prescriptionid","$casetype","OPD_Consultation","showtatlog.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh1[ipd_visit_fee]","discount","grand_total","","","","$Admitted_Under");
} elseif($typevisit == 'Opd_Emergency'){
   PatientManager::billingLog("$patientid","$prescriptionid","Consultant_fees","$casetype","drinvace.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh1[opd_EMG_fee]","discount","grand_total","paymentmode","status","$Admitted_Under");
  
	PatientManager::tatLog("$patientid","$prescriptionid","$casetype","OPD_Consultation","showtatlog.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh1[ipd_visit_fee]","discount","grand_total","","","","$Admitted_Under");
}
elseif($typevisit == 'OPD_Routine'){
   PatientManager::billingLog("$patientid","$prescriptionid","Consultant_fees","$casetype","drinvace.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh1[routin_fee]","discount","grand_total","paymentmode","status","$Admitted_Under");
  
	PatientManager::tatLog("$patientid","$prescriptionid","$casetype","OPD_Consultation","showtatlog.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh1[ipd_visit_fee]","discount","grand_total","","","","$Admitted_Under");
}
elseif($typevisit == 'Ipd_Emergency'){
   PatientManager::billingLog("$patientid","$prescriptionid","Consultant_fees","$casetype","drinvace.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh1[ipd_EMG_fee]","discount","grand_total","paymentmode","status","$Admitted_Under");
	PatientManager::tatLog("$patientid","$prescriptionid","$casetype","Emergency_care","showtatlog.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh1[ipd_visit_fee]","discount","grand_total","","","","$Admitted_Under");
		PatientManager::tatLog("$patientid","$prescriptionid","$casetype","Bed_Allotment","showtatlog.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh1[ipd_visit_fee]","discount","grand_total","","","","$Admitted_Under");
}
else{
   PatientManager::billingLog("$patientid","$prescriptionid","Consultant_fees","$casetype","drinvace.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh1[ipd_visit_fee]","discount","grand_total","paymentmode","status","$Admitted_Under");
   PatientManager::tatLog("$patientid","$prescriptionid","$casetype","Bed_Allotment","showtatlog.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh1[ipd_visit_fee]","discount","grand_total","","","","$Admitted_Under");
}
 	PatientManager::tatLog("$patientid","$prescriptionid","$casetype","Add_As_Patient_Page","showtatlog.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh1[ipd_visit_fee]","discount","grand_total","","","","$Admitted_Under");
	PatientManager::tatLog("$patientid","$prescriptionid","$casetype","Vitals","showtatlog.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh1[ipd_visit_fee]","discount","grand_total","","","","$Admitted_Under");

	
		   
		   
		   		echo "<script>window.location='document_verify.php?prescriptionid=" . $insid . "&patientid=$_GET[patientid]';</script>";
		}
		else
		{
			echo mysqli_error($link);
		}
	$link=DBManager::close($link);
}



public static function dischargetry($prescriptionid,$patientid,$hospital_id,$typevisit,$status,$COdischarge,$Advice_Discharge,$admissiondate,$created_by,$entered_by)
{
	echo "";
	$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
$admissiondate=date("Y/m/d");
		  	$sql="INSERT INTO discharge(id,prescriptionid,patientid,hospital_id,typevisit,status,COdischarge,Advice_Discharge,admissiondate,created_by,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$hospital_id','$typevisit','$status','$COdischarge','$Advice_Discharge','$admissiondate','$created_by','$entered_by',now(),now())";
		$result=mysqli_query($link,$sql);
if($result)
	$link=DBManager::close($link);
}



public static function billingLog($patientid,$prescriptionid,$discription,$pagetype,$link,$pricetotal,$discount,$grand_total,$paymentmode,$status,$enteredby)
{
    date_default_timezone_set('Asia/Kolkata');
    $created_at=date('Y/m/d H:i:s');
	$sql="INSERT INTO patient_invace(invaceid,patientid,prescriptionid,discription,pagetype,link,pricetotal,discount,grand_total,paymentmode,status,entered_by,created_at,updated_at) VALUES (NULL, '$patientid','$prescriptionid','$discription','$pagetype','$link','$pricetotal','$discount','$grand_total','$paymentmode','$status','$enteredby','$created_at',now())";
	$link=DBManager::connect();
	$result=mysqli_query($link,$sql);
	if($result)
		$link=DBManager::close($link);
	}
//START TAT LOG//
public static function tatLog($patientid,$prescriptionid,$discription,$pagetype,$hospital_id,$start_date,$stop_date,$start_time,$stop_time,$solution,$entered_by,$currenctive_by)
{
 date_default_timezone_set('Asia/Kolkata');
$timeva=time();
$pavam=date( "H:i:s","$timeva");
$start_date=date('Y/m/d H:i:s');

$narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
include("dbconnection.php");
$sql1 ="SELECT * FROM site_users WHERE userno='$entered_by'";
		$qsql1 = mysqli_query($con,$sql1);
		if($rh1 = mysqli_fetch_array($qsql1))
		

	$sql="INSERT INTO tat(tatid,patientid,prescriptionid,discription,pagetype,hospital_id,start_date,stop_date,start_time,stop_time,solution,entered_by,reported_at,currenctive_at,currenctive_by,updated_at) VALUES (NULL, '$patientid','$prescriptionid','$discription','$pagetype','$rh1[entered_by]','$start_date','$stop_date','$pavam','$stop_time','$solution','$entered_by',now(),'$currenctive_at','$currenctive_by',now())";
	$link=DBManager::connect();
	$result=mysqli_query($link,$sql);
	if($result)
		$link=DBManager::close($link);
	}
//Transfer TO IPD//
public static function tripd($prescriptionid,$patientid,$hospital_id,$status,$COdischarge,$Advice_Discharge,$created_by,$entered_by)
{
	echo "";
	$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
		   PatientManager::setActivityLog($patientid,"$prescriptionid","Discharge","showinvestigation.php?prescriptionid=$prescriptionid&patientid=$patientid","$entered_by");
$sql ="UPDATE discharge SET status='$status',  COdischarge='$COdischarge', Advice_Discharge='$Advice_Discharge', created_by='$created_by' WHERE patientid='$_GET[patientid]'";
		$result=mysqli_query($link,$sql);
if($result)
echo "<script>window.location='addpatientrecodsipd.php?patientid=$patientid';</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}



public static function discharge($prescriptionid,$patientid,$hospital_id,$status,$COdischarge,$Advice_Discharge,$created_by,$entered_by)
{
	echo "";
	$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
		   PatientManager::setActivityLog($patientid,"$prescriptionid","Discharge","showinvestigation.php?prescriptionid=$prescriptionid&patientid=$patientid","$entered_by");
		  		 PatientManager::updatebedindexdext("$wardid","$bedname","$price","$status","$prescriptionid");
$sql ="UPDATE discharge SET status='$status',  COdischarge='$COdischarge', Advice_Discharge='$Advice_Discharge', created_by='$created_by' WHERE patientid='$_GET[patientid]'";
		$result=mysqli_query($link,$sql);
if($result)
// echo "<script>window.location='patient_basic.php?patientid=$patientid';</script>;</script>";
echo "<script>window.location='show_discharge_summery.php?prescriptionid=$prescriptionid&patientid=$patientid';</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function updatebedindexdext($wardid,$bedname,$price,$status,$prescriptionid)
{

	$link=DBManager::connect();
	$sql ="UPDATE bedindex SET status='Active',prescriptionid='' WHERE  prescriptionid='$prescriptionid'";
	$result=mysqli_query($link,$sql);
if($result)
{
}
else 
{
	echo "Fail";
	$link=DBManager::close($link);
}
}

public static function Gatepassfinal($prescriptionid,$patientid,$Checklist_Filed,$Ambulance_Required,$Discharge_Handover,$Time_Exit,$Follow_Visit,$entered_by)
{
	echo "";
	$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
		   PatientManager::setActivityLog($patientid,"$prescriptionid","Discharge Summery<br>Gate Pass","showpage_Create_Gate_pass.php?prescriptionid=$prescriptionid&patientid=$patientid&srno=","$entered_by");
	$sql="INSERT INTO Gatepass(id,prescriptionid,patientid,Checklist_Filed,Ambulance_Required,Discharge_Handover,Time_Exit,Follow_Visit,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$Checklist_Filed','$Ambulance_Required','$Discharge_Handover','$Time_Exit','$Follow_Visit','$entered_by',now(),now())";
		$result=mysqli_query($link,$sql);
if($result)
echo "<script>alert('add successfully..');</script><script>window.location='Dischargesummery.php?prescriptionid=$prescriptionid&patientid=$patientid';</script>;</script>";
//echo "<script>window.location='treatment_timline.php?prescriptionid=$prescriptionid&patientid=$patientid';</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}



//Start Medicine//

public static function Medicine($prescriptionid,$patientid,$DRUGS,$Dose,$Route,$Frequency,$duration,$potential,$poa,$status,$Action_med,$availability,$batchno,$st0,$st1,$st2,$st3,$st4,$st5,$drid,$treatmentid,$entered_by)
{
	echo "";
	$link=DBManager::connect();
	$narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
include("dbconnection.php");

$DisplayForm=True;
$sql1 ="SELECT * FROM medicinede WHERE prescriptionid='$_GET[prescriptionid]'";
		$qsql1 = mysqli_query($con,$sql1);
		while($rh1 = mysqli_fetch_array($qsql1))
		{
	$DisplayForm=False;
echo "";
}
if($DisplayForm)
{
PatientManager::setActivityLog($patientid,"$prescriptionid","Opd Slip<br>Medicine Prescription","showmedicine.php?prescriptionid=$prescriptionid&patientid=$patientid&srno=","$entered_by");
} else{
  
}

$narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
$sql1 ="SELECT * FROM site_users WHERE userno='$entered_by'";
		$qsql1 = mysqli_query($con,$sql1);
		while($re = mysqli_fetch_array($qsql1))
		$admin_id=$re[entered_by];
   $sql="SELECT  count('id') FROM medicinede WHERE prescriptionid='$_GET[prescriptionid]'";
$result=mysqli_query($con,$sql);
$row=mysqli_fetch_array($result);
    $slot=$row[0]+1;
    $durationselect='1';
		     $x=$durationselect; $y=$duration; $w=$Frequency; 
		  $a=$x*$y;
		  $z=$a*$w;
$sql2 ="SELECT * FROM medicine_stok WHERE medicine_id='$DRUGS'";
$qsql2 = mysqli_query($con,$sql2);
while($re2 = mysqli_fetch_array($qsql2))
  $price=$re2[mrp]/$re2[size];
           $price = number_format($price, 2, '.', ''); 
           $product=$price;
            $product1=$price*$z;
if (is_numeric($DRUGS))
{
$availability='Available';
PatientManager::medicineslotgive("$prescriptionid","$patientid","$DRUGS","$admin_id","medicinein","$z","$slot","$product","$product1","discount","process","batchno","paymentmode","$entered_by");
}
else
{
$availability='Not Available';
PatientManager::medicineslotgive("$prescriptionid","$patientid","$DRUGS","$admin_id","medicinein","$z","$slot","$product","$product1","discount","process","batchno","paymentmode","$entered_by");
}

$Action_med='process';
	$sql="INSERT INTO medicinede(id,prescriptionid,patientid,DRUGS,Dose,Route,Frequency,duration,potential,poa,status,Action_med,availability,batchno,st0,st1,st2,st3,st4,st5,drid,treatmentid,entered_by,created_at,updated_at) VALUES (NULL, '$prescriptionid','$patientid','$DRUGS','$Dose','$Route','$Frequency','$duration','$potential','$poa','$status','$Action_med','$availability','$batchno','$st0','$st1','$st2','$st3','$st4','$st5','$drid','$treatmentid','$entered_by',now(),now())";
    $result=mysqli_query($link,$sql);
if($result)
echo "<script>alert('Medicine add successfully..');</script><script>
 window.history.go(-1)</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
	
}

//End Medicine//
public static function medicineslotgive($prescriptionid,$patientid,$medicine_id	,$admin_id,$linkfor,$quantitygiven,$slot_id,$price,$pricetotal,$discount,$paymentmode,$action,$batchno,$entered_by)
{
$narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
	$link=DBManager::connect();
		$updated_at=date("F d, Y / h:i:s A");
   $created_at=date("F d, Y / h:i:s A");
	$sql="INSERT INTO medicine_slot(srno,prescriptionid,patientid,medicine_id	,admin_id,linkfor,quantitygiven,slot_id,price,pricetotal,discount,paymentmode,action,batchno,entered_by,created_at,updated_at) VALUES (NULL, '$prescriptionid','$patientid','$medicine_id','$admin_id','$linkfor','$quantitygiven','$slot_id','$price','$pricetotal','$discount','$paymentmode','$action','$batchno','$entered_by','$created_at','$updated_at')";
 $link=DBManager::connect();
	$result=mysqli_query($link,$sql);
	if($result)
		$link=DBManager::close($link);
	}





//  START REQUEST FOR TRANSPORT//

public static function followupd($prescriptionid,$patientid,$Food_Intake,$Kindly_Avoid,$Kindly_Follow,$Follow_Visit,$entered_by)
{
	echo "";
	$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
		   PatientManager::setActivityLog($patientid,"$prescriptionid","Discharge Summery<br>Follow Up","showpage_followupdischarge.php?prescriptionid=$prescriptionid&patientid=$patientid&srno=","$entered_by");
	$sql="INSERT INTO followdis(id,prescriptionid,patientid,Food_Intake,Kindly_Avoid,Kindly_Follow,Follow_Visit,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$Food_Intake','$Kindly_Avoid','$Kindly_Follow','$Follow_Visit','$entered_by',now(),now())";
		$result=mysqli_query($link,$sql);
if($result)
echo "<script>alert('add successfully..');</script><script>window.location='Dischargesummery.php?prescriptionid=$prescriptionid&patientid=$patientid';</script>;</script>";
//echo "<script>window.location='treatment_timline.php?prescriptionid=$prescriptionid&patientid=$patientid';</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}



public static function diagnosistimilinetest($prescriptionid,$patientid,$diagnosis,$Surgery,$entered_by)
{
	echo "";
	$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
$admissiondate=date("Y/m/d");
		  	$sql="INSERT INTO diagnosis_timiline(id,prescriptionid,patientid,diagnosis,Surgery,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$diagnosis','$Surgery','$entered_by','$admissiondate',now())";
		$result=mysqli_query($link,$sql);
if($result)
echo "<script>alert('Add successfully..');</script><script> window.history.go(-1)</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function RequestTransport($prescriptionid,$patientid,$Type_Ambulance,$Departure,$Arrival,$EN_Route,$Loading_Startup,$Duration,$Inspection_Report,$Duration2,$entered_by)
{
    $updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");
	echo "";
	$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
		   PatientManager::setActivityLog($patientid,"$prescriptionid","Discharge Summery<br>Request Transport","showpage_RequestTransport.php?prescriptionid=$prescriptionid&patientid=$patientid&srno=","$entered_by");
	$sql="INSERT INTO Request_Transport(id,prescriptionid,patientid,Type_Ambulance,Departure,Arrival,EN_Route,Loading_Startup,Duration,Inspection_Report,Duration2,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$Type_Ambulance','$Departure','$Arrival','$EN_Route','$Loading_Startup','$Duration','$Inspection_Report','$Duration2','$entered_by','$created_at','$updated_at')";
		$result=mysqli_query($link,$sql);
if($result)
echo "<script>alert('add successfully..');</script><script>window.location='Dischargesummery.php?prescriptionid=$prescriptionid&patientid=$patientid';</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}


public static function dischargechecklist($prescriptionid,$patientid,$Pharmacy_Replacement,$Billing_Completed,$summary_handed,$Prescription_explained,$Report_handed,$iv_cannula_removed,$Hospital_Dress_Changed,$Hospital_belonging,$Pending_report_informed,$Admission_Consent,$Transfusion_Consent,$Cost_Consent,$Procedure_Consent,$High_Risk_Consent,$Anesthesia_Consent,$LAMA_DOR_Consent,$Discharge_Consent,$check_date,$Nurse_Name,$entered_by)
{
    $updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");
	echo "";
	$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
		   PatientManager::setActivityLog($patientid,"$prescriptionid","Discharge Summery<br>Discharge Checklist","showpage_dischargechecklist.php?prescriptionid=$prescriptionid&patientid=$patientid&srno=","$entered_by");
	$sql="INSERT INTO dischargechecklist(id,prescriptionid,patientid,Pharmacy_Replacement,Billing_Completed,summary_handed,Prescription_explained,Report_handed,iv_cannula_removed,Hospital_Dress_Changed,Hospital_belonging,Pending_report_informed,Admission_Consent,Transfusion_Consent,Cost_Consent,Procedure_Consent,High_Risk_Consent,Anesthesia_Consent,LAMA_DOR_Consent,Discharge_Consent,check_date,Nurse_Name,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$Pharmacy_Replacement','$Billing_Completed','$summary_handed','$Prescription_explained','$Report_handed','$iv_cannula_removed','$Hospital_Dress_Changed','$Hospital_belonging','$Pending_report_informed','$Admission_Consent','$Transfusion_Consent','$Cost_Consent','$Procedure_Consent','$High_Risk_Consent','$Anesthesia_Consent','$LAMA_DOR_Consent','$Discharge_Consent','$check_date','$Nurse_Name','$entered_by','$created_at','$updated_at')";
		$result=mysqli_query($link,$sql);
if($result)
echo "<script>alert('Add successfully..');</script>;<script>window.location='Dischargesummery.php?prescriptionid=$prescriptionid&patientid=$patientid';</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}
public static function setActivityLog($userno,$prescriptionid,$discription,$link,$enteredby)
{
	$updated_at=date("Y-m-d");
   $created_at=date("F d, Y / h:i:s A");
	$sql="INSERT INTO save_activity(srno,userno,prescriptionid,discription,entered_by,link,created_at,updated_at) VALUES (NULL, '$userno','$prescriptionid','$discription<br>Doc.no-','$enteredby','$link',' $created_at','$updated_at')";
	$link=DBManager::connect();

	$result=mysqli_query($link,$sql);
	if($result){
		$insid= mysqli_insert_id($link);
			$srid= $insid;
		$link=DBManager::close($link);
	}

}

public static function vilalsloging($prescriptionid,$patientid,$Wt,$bmi,$BP,$BP2,$Temp,$RBS,$Spo2,$HR,$Pulse,$poa,$entered_by)
{
    $link=DBManager::connect();
$narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
  $updated_at=date("Y-m-d");
   $created_at=date("F d, Y / h:i:s A");
$sql="INSERT INTO vitals_final(id,prescriptionid,patientid,Wt,bmi,BP,BP2,Temp,RBS,Spo2,HR,Pulse,poa,entered_by,created_at,updated_at) VALUES (NULL, '$prescriptionid','$patientid','$Wt','$bmi','$BP','$BP2','$Temp','$RBS','$Spo2','$HR','$Pulse','$poa','$entered_by','$created_at','$updated_at')";
	$sql1 ="UPDATE patient SET Weight='$Wt' WHERE patientid='$patientid'";
$result=mysqli_query($link,$sql1);
	$result=mysqli_query($link,$sql);
	if(!$result)
	return false;
$sql ="select last_insert_id() from vitals_final";
$result=mysqli_query($link,$sql);
if(!$result)
	return false;
$row=mysqli_fetch_row($result);
$id=$row[0];
PatientManager::setActivityLog($patientid,"$prescriptionid","Nursing Assessment<br>Vitals","showpageipd_vitals.php?prescriptionid=$prescriptionid&patientid=$patientid&id=$id&srno=","$entered_by");
	$result=mysqli_query($link,$sql);
		
if($result)
echo "<script>alert('Vitals add successfully..');</script><script>window.location='nursingset.php?prescriptionid=$prescriptionid&patientid=$patientid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}




public static function outputva($prescriptionid,$patientid,$output_datetime,$Intake,$Amount,$Output,$output_Amount,$entered_by)
{
      $link=DBManager::connect();
$narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
  $updated_at=date("Y-m-d");
   $created_at=date("F d, Y / h:i:s A");
  date_default_timezone_set("Asia/Calcutta");   //India time (GMT+5:30)
$Al_Date= date('Y-m-d'); 
$TimeIn= date('H:i:s');
  
   
	$sql="INSERT INTO output_patient(id,prescriptionid,patientid,output_datetime,Intake,Amount,Output,output_Amount,entered_by,created_at,updated_at) VALUES (NULL, '$prescriptionid','$patientid','$output_datetime','$Intake','$Amount','$Output','$output_Amount','$entered_by','$created_at','$updated_at')";
$result=mysqli_query($link,$sql);


	if(!$result)
	return false;
$sql ="select last_insert_id() from output_patient";
$result=mysqli_query($link,$sql);
if(!$result)
	return false;
$row=mysqli_fetch_row($result);
$id=$row[0];
PatientManager::setActivityLog($patientid,"$prescriptionid","Nursing Assessment<br>Input & Output Timeline","showpage_Input_Output_Timeline.php?prescriptionid=$prescriptionid&patientid=$patientid&id=$id&srno=","$entered_by");
	$result=mysqli_query($link,$sql);


 $nurse="INSERT INTO `al_Nurse`(`prescriptionid`, `patientid`, `hospital_id`, `Nurse_id`, `towards_link`, `TimeIn`, `Al_Date`,`ANSPunctuality`, `ANSBehavior`, `ANSKnowledge`, `grade`, `Created_at`, `Status`) VALUES ('$prescriptionid','$patientid','0','$entered_by','showpage_Input_Output_Timeline.php?prescriptionid=$prescriptionid&patientid=$patientid&id=$id&srno=','$TimeIn','$Al_Date','null','null','null','null','$created_at','0')";	
$result=mysqli_query($link,$nurse);		
if($result)
echo "<script>alert('Add successfully..');</script><script>window.location='nursingset.php?prescriptionid=$prescriptionid&patientid=$patientid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}


public static function narayanharilal($prescriptionid,$patientid,$Assessment_note,$Nursing_diagnosis_note,$Plan_of_Action,$Implementation,$Evaluation,$entered_by)
{
    	$link=DBManager::connect();
  
$narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
  $updated_at=date("Y-m-d");
   $created_at=date("F d, Y / h:i:s A");
   date_default_timezone_set("Asia/Calcutta");   //India time (GMT+5:30)
$time=date('H:i:s');
 $start_date=date('Y-m-d');  
 
 $Al_Date= date('Y-m-d'); 
$TimeIn= date('H:i:s');
	$sql="INSERT INTO nurse_note(id,prescriptionid,patientid,Assessment_note,Nursing_diagnosis_note,Plan_of_Action,Implementation,Evaluation,entered_by,date_start,start_time,created_at,updated_at) VALUES (NULL, '$prescriptionid','$patientid','$Assessment_note','$Nursing_diagnosis_note','$Plan_of_Action','$Implementation','$Evaluation','$entered_by','$start_date','$time','$created_at','$updated_at')";
	
	$result=mysqli_query($link,$sql);
	$sql ="select last_insert_id() from nurse_note";
$result=mysqli_query($link,$sql);
$row=mysqli_fetch_row($result);
$id=$row[0];

		$tat=$link->query("INSERT INTO `tat`(`tatid`, `patientid`, `prescriptionid`, `discription`,`type`, `pagetype`, `hospital_id`, `start_date`, `stop_date`, `start_time`, `stop_time`, `solution`, `entered_by`, `reported_at`, `currenctive_at`, `currenctive_by`, `updated_at`) VALUES (NULL,'$patientid','$prescriptionid','IPD','Nursing Assessment<br>Plan Of care','showpage_Plan_Of_care.php?prescriptionid=$prescriptionid&patientid=$patientid&id=$id&srno=','$entered_by','".date('Y-m-d')."','0','".date('H:i:s')."','0','solution','$entered_by','NULL','$created_at','NULL','')");
		

$nurse="INSERT INTO `al_Nurse`(`prescriptionid`, `patientid`, `hospital_id`, `Nurse_id`, `towards_link`, `TimeIn`, `Al_Date`,`ANSPunctuality`, `ANSBehavior`, `ANSKnowledge`, `grade`, `Created_at`, `Status`) VALUES ('$prescriptionid','$patientid','0','$entered_by','showpage_Plan_Of_care.php?prescriptionid=$prescriptionid&patientid=$patientid&id=$id&srno=','$TimeIn','$Al_Date','null','null','null','null','$created_at','0')";	
$result=mysqli_query($link,$nurse);

// PatientManager::setActivityLog($patientid,"$prescriptionid","Nursing Assessment<br>Plan Of care","showpage_Plan_Of_care.php?prescriptionid=$prescriptionid&patientid=$patientid&id=$id&srno=","$entered_by");
if($result){
echo "<script>alert('Nursing Plan Of care add successfully..');</script><script>window.location='nursingset.php?prescriptionid=$prescriptionid&patientid=$patientid'</script>;</script>";
}else {
	echo "Fail";
	$link=DBManager::close($link);
}
}

public static function handover($prescriptionid,$patientid,$Nursinggivern_Instruction)
{
	echo "";
	$link=DBManager::connect();
		$link=DBManager::connect();
		$narayan=LoginManager::currentUser();
	$anilka=LoginManager::getUserTypeByuname("$narayan");
	$entered_by="$anilka";
		$updated_at=date("Y-m-d");
   $created_at=date("F d, Y / h:i:s A");
  
$sql="INSERT INTO handover(id,prescriptionid,patientid,Nursinggivern_Instruction,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$Nursinggivern_Instruction','$entered_by','$created_at','$updated_at')";

	$result=mysqli_query($link,$sql);
	if(!$result)
	return false;
$sql ="select last_insert_id() from handover";
$result=mysqli_query($link,$sql);
if(!$result)
	return false;
$row=mysqli_fetch_row($result);
$id=$row[0];
PatientManager::setActivityLog($patientid,"$prescriptionid","Nursing Assessment<br>Handover","showpage_Handover.php?prescriptionid=$prescriptionid&patientid=$patientid&id=$id&srno=","$entered_by");
	$result=mysqli_query($link,$sql);
if($result)
echo "<script>alert('Add successfully..');</script><script> window.history.go(-1);</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function testsurgury($prescriptionid,$patientid,$hospitalid,$surgery,$case_status,$Admitted_Under,$status,$entered_by)
{
    echo "";
    $link=DBManager::connect();
    include("dbconnection.php");
    $sql12 ="SELECT * FROM create_inhouse WHERE ivid='$surgery' AND hospitalid='$hospitalid'";
    $qsql12 = mysqli_query($con,$sql12);
    if($rh12 = mysqli_fetch_array($qsql12))
    {
    	$narayan=LoginManager::currentUser();
    	$anilka=LoginManager::getUserTypeByuname("$narayan");
    	$entered_by="$anilka";
    	$updated_at=date("F d, Y / h:i:s A");
    	$created_at=date("F d, Y / h:i:s A");
    	$Admitted_Date=date("Y-m-d");
    	$sql="INSERT INTO surgerytracker(surgeryid,prescriptionid,patientid,hospitalid,surgery,case_status,Admitted_Under,AdmittedDate, InDate, InTime,status,entered_by, created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$hospitalid','$surgery','$case_status','$Admitted_Under','$Admitted_Date','".date("Y-m-d")."','".date("H:i:s")."','$status','$entered_by','$created_at','$updated_at')";
    	 PatientManager::billingLog("$patientid","$prescriptionid","surgury_fees","$surgery","show_testsurgury.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh12[rate]","discount","grand_total","paymentmode","status","$Admitted_Under");
    	 $result=mysqli_query($link,$sql);
    	 
    	 $Surgery="INSERT INTO `al_Surgery`(`prescriptionid`, `patientid`, `hospital_id`, `Surgery_id`, `type`, `towards_link`, `TimeIn`, `Al_Date`, `treatmentSurgeries`, `grade`, `Created_at`, `Status`) VALUES ('$prescriptionid','$patientid','$hospitalid','$surgery','IPD','show_testsurgury.php?prescriptionid=$prescriptionid&patientid=$patientid','".date("H:i:s")."','".date("Y-m-d")."','null','null','$created_at','0')";
    	 $result=mysqli_query($link,$Surgery);
    	if($result)
    	{
    		$surgeryid=mysqli_insert_id($link);
    
    		echo "<script>alert('Operative Process start successfully');</script><script>window.location='operativemenu.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid'</script>;</script>";
    	}
    	else{
    		echo "<script>alert('Selected treatment and surgery not created.');</script>";
    		$link=DBManager::close($link);
    	} 	
    }else{
    	echo "<script>alert('Selected treatment and surgery not created.');</script>";
    	$link=DBManager::close($link);
    } 	


}

public static function RoutineInformation($prescriptionid,$patientid,$surgeryid,$Information_Obtained_from,$Date_of_Operative_procedure,$Time_of_Operative_procedure,$name_Surgeon,$Name_of_Anesthetist,$Pre_Operative_Diagnosis,$Systemic_Disease,$Systemic_Disease_note,$Anesthesia_Events,$Anesthesia_Events_note,$ho_Operations,$ho_Operations_note,$Adverse_Drugs_Reaction,$Adverse_Drugs_Reaction_note,$DRUG_THERAPY,$DRUG_THERAPY_note,$Duration_Surgery,$WRITTEN_CONSENT,$Ward,$Bed,$entered_by)
{
	echo "";
	$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
$updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");

$timeIn= date('H:i:s');
	  PatientManager::setActivityLog($patientid,"$prescriptionid","Pre-Assessment Sheet<br>Routine Information","showpage_Routine_Information.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid&srno=","$entered_by");
	 PatientManager::transferbedpatient("$prescriptionid","$Bed","$datetime");
	$sql="INSERT INTO Routine_Information(srno,prescriptionid,patientid,surgeryid,Information_Obtained_from,Date_of_Operative_procedure, Time_of_Operative_procedure,name_Surgeon,Name_of_Anesthetist, Pre_Operative_Diagnosis,Systemic_Disease,Systemic_Disease_note,Anesthesia_Events,Anesthesia_Events_note,ho_Operations,ho_Operations_note,Adverse_Drugs_Reaction,Adverse_Drugs_Reaction_note,DRUG_THERAPY,DRUG_THERAPY_note,Duration_Surgery,WRITTEN_CONSENT,Ward,Bed,TimeIn,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid', '$patientid','$surgeryid', '$Information_Obtained_from', '$Date_of_Operative_procedure', '$Time_of_Operative_procedure','$name_Surgeon', '$Name_of_Anesthetist','$Pre_Operative_Diagnosis','$Systemic_Disease','$Systemic_Disease_note','$Anesthesia_Events','$Anesthesia_Events_note','$ho_Operations','$ho_Operations_note','$Adverse_Drugs_Reaction','$Adverse_Drugs_Reaction_note','$DRUG_THERAPY','$DRUG_THERAPY_note','$Duration_Surgery','$WRITTEN_CONSENT','$Ward','$Bed','$timeIn','$entered_by','$created_at','$updated_at')";
	
		$result=mysqli_query($link,$sql);
	//	echo "$sql";
if($result)
//echo "save";
echo "<script>alert('Routine Information Add successfully');</script><script>window.location='PreOperativeAssessmentSheet.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function transferbedpatient($prescriptionid,$towords,$datetime)
{
   $datetime=date("Y-m-d H:i:s");
	$sql="INSERT INTO transferbed(srno,prescriptionid,towords,datetime) VALUES (NULL, '$prescriptionid','$towords','$datetime')";
	$link=DBManager::connect();

	$result=mysqli_query($link,$sql);
	if($result)
		$insid= mysqli_insert_id($link);
			$srid= $insid;
		$link=DBManager::close($link);
	}


public static function BriefHistory($prescriptionid,$patientid,$surgeryid,$Family_History,$entered_by)
{

	$link=DBManager::connect();
			$narayan=LoginManager::currentUser();
	$anilka=LoginManager::getUserTypeByuname("$narayan");
	$entered_by="$anilka";
		$updated_at=date("Y-m-d");
   $created_at=date("F d, Y / h:i:s A");
	PatientManager::setActivityLog($patientid,"$prescriptionid","Pre-Assessment Sheet<br>Brief History","showpage_Brief_History_Patient.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid&srno=","$entered_by");
	$sql="INSERT INTO Brief_History_Patient(Briefid,prescriptionid,patientid,	surgeryid,Family_History,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$surgeryid','$Family_History','$entered_by','$created_at','$updated_at')";
	$result=mysqli_query($link,$sql);
if($result)
echo "<script>alert('Brief History add successfully..');</script><script>window.location='PreOperativeAssessmentSheet.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}


public static function SystemicExamination($prescriptionid,$patientid,$surgeryid,$Systemic_Disease,$Systemic_Disease_note,$Anesthesia_Events,$Anesthesia_Events_note,$ho_Operations,$ho_Operations_note,$Adverse_Drugs_Reaction,$Adverse_Drugs_Reaction_note,$DRUG_THERAPY,$DRUG_THERAPY_note,$HISTORY_CHEST_PAIN,$HISTORY_PALPITATION,$HISTORY_HYPERTENTION,$S1_S2,$MURMUR,$ECG_REPORT,$ENTER_LUNGS,$CREPITATIONS_WHEEZ,$HISTORY_COUGH,$HISTORY_BRONCHIAL,$HISTORY_REPAIRATORY,$PULMONARY_TEST,$CARDIAO_VASCULAR_note,$HISTORY_CONVULSION,$HISTORY_TREMOR,$HISTORY_GI_BLEEDING,$NEUROLOGICAL_DISEASE,$CENTRAL_NERVOUS_note,$HEART_BURN,$OTHER_DISEASE,$LIVER_FUNCTION_TEST,$GASTRO_INTESTINAL_note,$HISTORY_DM,$HISTORY_HYPER,$HARMONAL_ABNORMALITY,$ENDOCRINE_SYSTEM_note,$HISTORY_HAEMATURIA,$HISTORY_UTI,$HISTORY_STD,$RENAL_PROBLEM,$GENITO_URINARY_note,$respiratory_system_note,$entered_by)
{
	echo "";
	$link=DBManager::connect();
$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
$updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");
	  PatientManager::setActivityLog($patientid,"$prescriptionid","Pre-Assessment Sheet<br>Systemic Examination","showpage_Systemic_Examination.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid&srno=","$entered_by");
	$sql="INSERT INTO Systemic_Examination(srno,prescriptionid,patientid,surgeryid,Systemic_Disease,Systemic_Disease_note,Anesthesia_Events,Anesthesia_Events_note,ho_Operations,ho_Operations_note,Adverse_Drugs_Reaction,Adverse_Drugs_Reaction_note,DRUG_THERAPY,DRUG_THERAPY_note,HISTORY_CHEST_PAIN,HISTORY_PALPITATION,HISTORY_HYPERTENTION,S1_S2,MURMUR,ECG_REPORT,ENTER_LUNGS,CREPITATIONS_WHEEZ,HISTORY_COUGH,HISTORY_BRONCHIAL,HISTORY_REPAIRATORY,PULMONARY_TEST,CARDIAO_VASCULAR_note,HISTORY_CONVULSION,HISTORY_TREMOR,HISTORY_GI_BLEEDING,NEUROLOGICAL_DISEASE,CENTRAL_NERVOUS_note,HEART_BURN,OTHER_DISEASE,LIVER_FUNCTION_TEST,GASTRO_INTESTINAL_note,HISTORY_DM,HISTORY_HYPER,HARMONAL_ABNORMALITY,ENDOCRINE_SYSTEM_note,HISTORY_HAEMATURIA,HISTORY_UTI,HISTORY_STD,RENAL_PROBLEM,GENITO_URINARY_note,respiratory_system_note,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid', '$patientid','$surgeryid','$Systemic_Disease','$Systemic_Disease_note','$Anesthesia_Events','$Anesthesia_Events_note','$ho_Operations','$ho_Operations_note','$Adverse_Drugs_Reaction','$Adverse_Drugs_Reaction_note','$DRUG_THERAPY','$DRUG_THERAPY_note','$HISTORY_CHEST_PAIN','$HISTORY_PALPITATION','$HISTORY_HYPERTENTION','$S1_S2','$MURMUR','$ECG_REPORT','$ENTER_LUNGS','$CREPITATIONS_WHEEZ','$HISTORY_COUGH','$HISTORY_BRONCHIAL','$HISTORY_REPAIRATORY','$PULMONARY_TEST','$CARDIAO_VASCULAR_note','$HISTORY_CONVULSION','$HISTORY_TREMOR','$HISTORY_GI_BLEEDING','$NEUROLOGICAL_DISEASE','$CENTRAL_NERVOUS_note','$HEART_BURN','$OTHER_DISEASE','$LIVER_FUNCTION_TEST','$GASTRO_INTESTINAL_note','$HISTORY_DM','$HISTORY_HYPER','$HARMONAL_ABNORMALITY','$ENDOCRINE_SYSTEM_note','$HISTORY_HAEMATURIA','$HISTORY_UTI','$HISTORY_STD','$RENAL_PROBLEM','$GENITO_URINARY_note','$respiratory_system_note','$entered_by','$created_at','$updated_at')";
	$result=mysqli_query($link,$sql);
if($result)
echo "<script>alert('Systemic Examination Add successfully');</script><script>window.location='PreOperativeAssessmentSheet.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function preAssessmentSheet($prescriptionid,$patientid,$surgeryid,$Cough,$Fever,$Wheezing,$Hypertension,$Diabetes,$Liverproblem,$Previous_Operation,$Smoking,$Migraine,$Pregnancy,$Bleeding_Disorder,$SOB,$Palpitation,$Chest_Pain,$Renal_Disease,$Allergies,$Alcohol,$Anesthesia_Problem,$Urination,$Back_Neck_Pain,$Arthritis,$Blackouts,$Muscie,$Weight_Loss_Gain,$hernia,$Pacemaker,$Artificial,$Resp_System,$Resp_System_note,$CVS_status,$CVS_status_note,$Dentures_status,$Dentures_status_note, $Dentures_status_lower, $Dentures_lower_note, $Mouth_Opening, $Mouth_Opening_note, $Neck_Mobility, $Neck_Mobility_note, $Venous_Access, $Venous_Access_note, $Nervous_System, $Nervous_System_note, $Abdomen_System, $Intubation_Difficulty, $Intubation_Difficulty_note, $Special_Anesthesia_Problems, $Special_Anesthesia_Problems_note, $PALLOR, $ICTERUS, $CYANOSIS, $LYMPHNODES, $JVP_RAISED, $TM_JOINT, $DENTAL_REACTION, $Abdomen_note, $Neck, $Neck_note, $Asthama_Breathlesness, $BloodTransfusion, $Previous_Admission, $Indigestion, $Acid, $Heartburn, $Hiatus, $ContactLens, $HearingAid, $entered_by)
{
	echo "";
	$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
	  PatientManager::setActivityLog($patientid,"$prescriptionid","Pre-Assessment Sheet<br>Routine Examination","showpage_Routine_Examination.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid&srno=","$entered_by");
	  	$updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");
	  
	$sql="INSERT INTO `Pre_Operative_Assessment_Sheet`(`srno`, `prescriptionid`, `patientid`, `surgeryid`, `Cough`, `Fever`, `Wheezing`, `Hypertension`, `Diabetes`, `Liverproblem`, `Previous_Operation`, `Smoking`, `Migraine`, `Pregnancy`, `Bleeding_Disorder`, `SOB`, `Palpitation`, `Chest_Pain`, `Renal_Disease`, `Allergies`, `Alcohol`, `Anesthesia_Problem`, `Urination`, `Back_Neck_Pain`, `Arthritis`, `Blackouts`, `Muscie`, `Weight_Loss_Gain`, `hernia`, `Pacemaker`, `Artificial`, `Resp_System`, `Resp_System_note`, `CVS_status`, `CVS_status_note`, `Dentures_status`, `Dentures_status_note`, `Dentures_status_lower`, `Dentures_lower_note`, `Mouth_Opening`, `Mouth_Opening_note`, `Neck_Mobility`, `Neck_Mobility_note`, `Venous_Access`, `Venous_Access_note`, `Nervous_System`, `Nervous_System_note`, `Abdomen_System`, `Intubation_Difficulty`, `Intubation_Difficulty_note`, `Special_Anesthesia_Problems`, `Special_Anesthesia_Problems_note`, `PALLOR`, `ICTERUS`, `CYANOSIS`, `LYMPHNODES`, `JVP_RAISED`, `TM_JOINT`, `DENTAL_REACTION`, `Abdomen_note`, `Neck`, `Neck_note`, `Asthama_Breathlesness`, `BloodTransfusion`, `Previous_Admission`, `Indigestion`, `Acid`, `Heartburn`, `Hiatus`, `ContactLens`, `HearingAid`, `entered_by`, `created_at`, `updated_at`) VALUES (NULL,'$prescriptionid','$patientid','$surgeryid','$Cough','$Fever','$Wheezing','$Hypertension','$Diabetes','$Liverproblem','$Previous_Operation','$Smoking','$Migraine','$Pregnancy','$Bleeding_Disorder','$SOB','$Palpitation','$Chest_Pain','$Renal_Disease','$Allergies','$Alcohol','$Anesthesia_Problem','$Urination','$Back_Neck_Pain','$Arthritis','$Blackouts','$Muscie','$Weight_Loss_Gain','$hernia','$Pacemaker','$Artificial','$Resp_System','$Resp_System_note','$CVS_status','$CVS_status_note','$Dentures_status','$Dentures_status_note', '$Dentures_status_lower', '$Dentures_lower_note', '$Mouth_Opening', '$Mouth_Opening_note', '$Neck_Mobility', '$Neck_Mobility_note', '$Venous_Access', '$Venous_Access_note', '$Nervous_System', '$Nervous_System_note', '$Abdomen_System', '$Intubation_Difficulty', '$Intubation_Difficulty_note', '$Special_Anesthesia_Problems', '$Special_Anesthesia_Problems_note', '$PALLOR', '$ICTERUS', '$CYANOSIS', '$LYMPHNODES', '$JVP_RAISED', '$TM_JOINT', '$DENTAL_REACTION', '$Abdomen_note', '$Neck', '$Neck_note', '$Asthama_Breathlesness', '$BloodTransfusion', '$Previous_Admission', '$Indigestion', '$Acid', '$Heartburn', '$Hiatus', '$ContactLens', '$HearingAid', '$entered_by', '$created_at', '$updated_at')";
	echo $sql;
	$result=mysqli_query($link,$sql);

if($result)
echo "<script>alert('Routine Examination Add successfully');</script><script>window.location='PreOperativeAssessmentSheet.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}


public static function PhysicalAssessment($prescriptionid,$patientid,$surgeryid,$XYLOCAINE_SENSITIVITY,$Food_Intake,$PHYSICAL_STATUS,$Mallampati_Score,$Thyromental_Distance,$Metabolic_Score,$entered_by)
{
	echo "";
	$link=DBManager::connect();
$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
$updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");


	  PatientManager::setActivityLog($patientid,"$prescriptionid","Pre-Assessment Sheet<br>Pre Anesthesia evaluation","showpage_Physical_Assessment.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid&srno=","$entered_by");
	$sql="INSERT INTO Physical_Assessment(srno,prescriptionid,patientid,surgeryid,XYLOCAINE_SENSITIVITY,Food_Intake,PHYSICAL_STATUS,Mallampati_Score,Thyromental_Distance,Metabolic_Score,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid', '$patientid','$surgeryid','$XYLOCAINE_SENSITIVITY','$Food_Intake','$PHYSICAL_STATUS','$Mallampati_Score','$Thyromental_Distance','$Metabolic_Score','$entered_by','$created_at','$updated_at')";

	$result=mysqli_query($link,$sql);
if($result)

echo "<script>alert('Physical Assessment Add successfully');</script><script>window.location='PreOperativeAssessmentSheet.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}


public static function Anesthesiapavam($prescriptionid,$patientid,$surgeryid,$Patient_not_accepted,$Patient_accepted,$Anesthesia_procedure,$Upload_Consent,$entered_by)
{

	$link=DBManager::connect();
		$narayan=LoginManager::currentUser();
	$anilka=LoginManager::getUserTypeByuname("$narayan");
	$entered_by="$anilka";
	$updated_at=date("Y-m-d");
   $created_at=date("F d, Y / h:i:s A");
	PatientManager::setActivityLog($patientid,"$prescriptionid","Pre-Assessment Sheet<br>Anesthesia Consent","showpage_Anesthesia_Consent.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid&srno=","$entered_by");
	$sql="INSERT INTO AnesthesiaConsent(id,prescriptionid,patientid,surgeryid,Patient_not_accepted,Patient_accepted,Anesthesia_procedure,Upload_Consent,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$surgeryid','$Patient_not_accepted','$Patient_accepted','$Anesthesia_procedure','$Upload_Consent','$entered_by','$created_at','$updated_at')";
	$result=mysqli_query($link,$sql);
if($result)
echo "<script>alert('Anesthesia Consent  Upload  successfully..');</script><script>window.location='PreOperativeAssessmentSheet.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}


public static function PostConfirmationSheet($prescriptionid,$patientid,$surgeryid,$verify_pt_identity,$name_tag,$consent_form_signed,$Operation_consent,$operative_assessment,$Medical_fitness,$Last_meal,$Allergy_noted,$reports_checked,$entered_by)
{
echo "";
$link=DBManager::connect();
$link=DBManager::connect();
$narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
$updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");
	  PatientManager::setActivityLog($patientid,"$prescriptionid","Post-Operative Checklist<br>Assessment","showpage_Postoperative_Confirmation_Sheet.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid&srno=","$entered_by");
	$sql="INSERT INTO post_Confirmation_Sheet(srno,prescriptionid,patientid,surgeryid,verify_pt_identity,name_tag,consent_form_signed,Operation_consent,operative_assessment,Medical_fitness,Last_meal,Allergy_noted,reports_checked,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$surgeryid','$verify_pt_identity','$name_tag','$consent_form_signed','$Operation_consent','$operative_assessment','$Medical_fitness','$Last_meal','$Allergy_noted','$reports_checked','$entered_by','$created_at','$updated_at')";
	$result=mysqli_query($link,$sql);
if($result)
echo "<script>alert('Post-Operative Checklist Add successfully');</script><script>window.location='PostOperativeChecklistset.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function PatientLeaves($prescriptionid,$patientid,$surgeryid,$Verbally_Confirmed,$Procedure_Recorded,$Specimen_Labeled,$infection_present,$Equipment_Problems,$Detail,$Review_Key,$Prognosis_Explained,$entered_by)
{
	echo "";
	$link=DBManager::connect();
$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
$updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");
 PatientManager::setActivityLog($patientid,"$prescriptionid","Post-Operative Checklist<br>Patient Leaves","showpage_Patient_Leaves.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid&srno=","$entered_by");
	$sql="INSERT INTO Patient_Leaves(srno,prescriptionid,patientid,surgeryid,Verbally_Confirmed,Procedure_Recorded,Specimen_Labeled,infection_present,Equipment_Problems,Detail,Review_Key,Prognosis_Explained,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$surgeryid','$Verbally_Confirmed','$Procedure_Recorded','$Specimen_Labeled','$infection_present','$Equipment_Problems','$Detail','$Review_Key','$Prognosis_Explained','$entered_by','$created_at','$updated_at')";
	$result=mysqli_query($link,$sql);
if($result)
echo "<script>alert('Before Patient Leaves Add successfully');</script><script>window.location='PostOperativeChecklistset.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}
//END Patient Leaves//

public static function medimgnt($prescriptionid,$patientid,$medicine_id,$DRUGS,$timeslot,$admissiondate,$status,$entered_by)
{
	echo "";
		$narayan=LoginManager::currentUser();
		$link=DBManager::connect();
$anilka=LoginManager::getUserTypeByuname("$narayan");
	$entered_by="$anilka";
	$admissiondate=date("Y/m/d");
PatientManager::setActivityLog($patientid,"$prescriptionid","Medication Tracker","show_testmedifinal.php?prescriptionid=$prescriptionid&patientid=$patientid","$entered_by");

$sql="INSERT INTO medication_mng(id,prescriptionid,patientid,medicine_id,DRUGS,timeslot,admissiondate,status,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$medicine_id','$DRUGS','$timeslot','$admissiondate','$status','$entered_by',now(),now())";
	$result=mysqli_query($link,$sql);

$nurse="INSERT INTO `al_Nurse`(`prescriptionid`, `patientid`, `hospital_id`, `Nurse_id`, `towards_link`, `TimeIn`, `Al_Date`,`ANSPunctuality`, `ANSBehavior`, `ANSKnowledge`, `grade`, `Created_at`, `Status`) VALUES ('$prescriptionid','$patientid','0','$entered_by','null','$TimeIn','$Al_Date','null','null','null','null','$created_at','0')";	
$result=mysqli_query($link,$nurse);
if($result)
echo "<script>alert('$status successfully..');</script>;<script>window.location='testmedifinal.php?prescriptionid=$prescriptionid&patientid=$patientid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function vilalslog2($prescriptionid,$patientid,$Wt,$bmi,$BP,$BP2,$Temp,$RBS,$Spo2,$HR,$Pulse,$poa,$entered_by)
{
    	$link=DBManager::connect();
$narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
$updated_at=date("Y-m-d");
   $created_at=date("F d, Y / h:i:s A");
   date_default_timezone_set("Asia/Calcutta");   //India time (GMT+5:30)
$Al_Date= date('Y-m-d');
$TimeIn= date('H:i:s');

	$sql="INSERT INTO vitals_final(id,prescriptionid,patientid,Wt,bmi,BP,BP2,Temp,RBS,Spo2,HR,Pulse,poa,entered_by,created_at,updated_at) VALUES (NULL, '$prescriptionid','$patientid','$Wt','$bmi','$BP','$BP2','$Temp','$RBS','$Spo2','$HR','$Pulse','$poa','$entered_by','$created_at','$updated_at')";
$sql1 ="UPDATE patient SET Weight='$Wt' WHERE patientid='$patientid'";
$result=mysqli_query($link,$sql1);

$result=mysqli_query($link,$sql1);
	$result=mysqli_query($link,$sql);
	if(!$result)
	return false;
$sql ="select last_insert_id() from vitals_final";
$result=mysqli_query($link,$sql);
if(!$result)
	return false;
$row=mysqli_fetch_row($result);
$id=$row[0];


PatientManager::setActivityLog($patientid,"$prescriptionid","Progress Chart<br>$poa","showpageipd_vitals.php?prescriptionid=$prescriptionid&patientid=$patientid&id=$id&srno=","$entered_by");
	$result=mysqli_query($link,$sql);
	
	
	$nurse="INSERT INTO `al_Nurse`(`prescriptionid`, `patientid`, `hospital_id`, `Nurse_id`, `towards_link`, `TimeIn`, `Al_Date`,`ANSPunctuality`, `ANSBehavior`, `ANSKnowledge`, `grade`, `Created_at`, `Status`) VALUES ('$prescriptionid','$patientid','0','$entered_by','showpageipd_vitals.php?prescriptionid=$prescriptionid&patientid=$patientid&id=$id&srno=','$TimeIn','$Al_Date','null','null','null','null','$created_at','0')";	
$result=mysqli_query($link,$nurse);	

if($result)
echo "<script>alert('Vitals add successfully..');</script><script>window.location='vitals_chart.php?prescriptionid=$prescriptionid&patientid=$patientid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function outputvatimiline($prescriptionid,$patientid,$output_datetime,$Intake,$Amount,$Output,$output_Amount,$entered_by)
{
      $link=DBManager::connect();
$narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
  $updated_at=date("Y-m-d");
   $created_at=date("F d, Y / h:i:s A");
	$sql="INSERT INTO output_patient(id,prescriptionid,patientid,output_datetime,Intake,Amount,Output,output_Amount,entered_by,created_at,updated_at) VALUES (NULL, '$prescriptionid','$patientid','$output_datetime','$Intake','$Amount','$Output','$output_Amount','$entered_by','$created_at','$updated_at')";
$result=mysqli_query($link,$sql);
	if(!$result)
	return false;
$sql ="select last_insert_id() from output_patient";
$result=mysqli_query($link,$sql);
if(!$result)
	return false;
$row=mysqli_fetch_row($result);
$id=$row[0];
PatientManager::setActivityLog($patientid,"$prescriptionid","Nursing Assessment<br>Input & Output Timeline","showpage_Input_Output_Timeline.php?prescriptionid=$prescriptionid&patientid=$patientid&id=$id&srno=","$entered_by");
	$result=mysqli_query($link,$sql);
		
if($result)
echo "<script>alert('Add successfully..');</script><script>window.location='timiline_inputandoutput.php?prescriptionid=$prescriptionid&patientid=$patientid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}



public static function admissionipd($prescriptionid,$patientid,$significate,$Admission_diagnosis,$other_Admission_diagnosis,$tratment,$Nutritional_Diagnosis,$eyetype,$note,$entered_by)
{
	echo "";
	$link=DBManager::connect();
		$narayan=LoginManager::currentUser();
	$anilka=LoginManager::getUserTypeByuname("$narayan");
	$entered_by="$anilka";
		$updated_at=date("Y-m-d");
   $created_at=date("F d, Y / h:i:s A");
   date_default_timezone_set("Asia/Calcutta");   //India time (GMT+5:30)
$TimeIn= date('H:i:s');
$Al_Date= date('Y-m-d');
		PatientManager::setActivityLog($patientid,"$prescriptionid","Intial Assessment<br>Initial Diagnosis","showpage_Diagnosis.php?prescriptionid=$prescriptionid&patientid=$patientid&srno=","$entered_by");
		  PatientManager::diagnosistimiline("$prescriptionid","$patientid","$Admission_diagnosis","$tratment","$entered_by");
$sql="INSERT INTO opdslip(Srno,prescriptionid,patientid,significate,Admission_diagnosis,other_Admission_diagnosis,tratment,Nutritional_Diagnosis,eyetype,note,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$significate','$Admission_diagnosis','$other_Admission_diagnosis','$tratment','$Nutritional_Diagnosis','$eyetype','$note','$entered_by','$created_at','$updated_at')";
	$result=mysqli_query($link,$sql);
	

if($result)
echo "<script>alert('Initial Diagnosis add successfully..');</script><script>window.location='admission1.php?prescriptionid=$prescriptionid&patientid=$patientid'</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function diagnosistimiline($prescriptionid,$patientid,$diagnosis,$Surgery,$entered_by)
{
    $updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");
	echo "";
	$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
$admissiondate=date("Y-m-d");
		  	$sql="INSERT INTO diagnosis_timiline(id,prescriptionid,patientid,diagnosis,Surgery,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$diagnosis','$Surgery','$entered_by','$created_at','$updated_at')";
		$result=mysqli_query($link,$sql);
if($result)
	$link=DBManager::close($link);
}

public static function nayainvestigationIPD($prescriptionid,$patientid,$hospital_id,$Raised_at,$Investigation_type,$Category,$Sub_Category,$Priority_slip,$Investigation,$ivid,$Result,$Evidence,$entered_by)
{
    $updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");


	$link=DBManager::connect();
		$narayan=LoginManager::currentUser();
	$anilka=LoginManager::getUserTypeByuname("$narayan");
	$entered_by="$anilka";
	include("dbconnection.php");
	
$sql1 ="SELECT * FROM site_users WHERE userno='$anilka'";
		$qsql1 = mysqli_query($con,$sql1);
		if($re = mysqli_fetch_array($qsql1))	
	
$sql1 ="SELECT * FROM create_inhouse WHERE ivid='$ivid' AND entered_by='$re[entered_by]' OR ivid='$Investigation' AND entered_by='$re[entered_by]'";
		$qsql1 = mysqli_query($con,$sql1);
		if($rh1 = mysqli_fetch_array($qsql1))
		    	$pricetotal=$rh1[rate];
		    	$ivname=$rh1[ivid];
		    		PatientManager::billingLog("$patientid","$prescriptionid","Investigation_charge","$ivid$Investigation","patient_investigation_invoice.php?prescriptionid=$prescriptionid&patientid=$patientid","$pricetotal","","","$paymentmode","$status","$entered_by");
		    	
$DisplayForm=True;
$sql1 ="SELECT * FROM investigation WHERE prescriptionid='$_GET[prescriptionid]'";
		$qsql1 = mysqli_query($con,$sql1);
		while($rh1 = mysqli_fetch_array($qsql1))
		{
	$DisplayForm=False;
echo "";
}
if($DisplayForm)
{
PatientManager::setActivityLog($patientid,"$prescriptionid","Initial Assessment<br>Request for investigation","showpage_investigation.php?prescriptionid=$prescriptionid&patientid=$patientid&srno=","$entered_by");
} else{
  
}

$Admitted= date("Y-m-d");
$Time= date('H:i:s');


$sql="INSERT INTO investigation(id,prescriptionid,patientid,hospital_id,Raised_at,Investigation_type,Category,Sub_Category,Priority_slip,Investigation,ivid,Result,Evidence,AdmittedDate, TimeIn,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid', '$patientid','$hospital_id','$Raised_at','$Investigation_type','$Category','$Sub_Category','$Priority_slip','$Investigation','$ivid','$Result','$Evidence','$Admitted','$Time','$entered_by','$created_at','$updated_at')";
$result=mysqli_query($link,$sql);
if(!$result)
	return false;
$sql ="select last_insert_id() from investigation";
$result=mysqli_query($link,$sql);
if(!$result)
	return false;
$row=mysqli_fetch_row($result);
$id=$row[0];
	$result=mysqli_query($link,$sql);
		
if($result)
echo "<script>alert('$Investigation add successfully..');</script><script>window.location='Requestforinvestigationipd.php?prescriptionid=$prescriptionid&patientid=$patientid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function potentialipd($prescriptionid,$patientid,$operative_date,$Mode_Treatment,$Plan_Of_Care,$Follow_Up_Care,$treatment_Facility,$enteredby)
{
	echo "";
	$link=DBManager::connect();
		$narayan=LoginManager::currentUser();
	$anilka=LoginManager::getUserTypeByuname("$narayan");
	$entered_by="$anilka";
		$updated_at=date("Y-m-d");
   $created_at=date("F d, Y / h:i:s A");
   $Al_Date= date('Y-m-d'); 
$TimeIn= date('H:i:s');
		PatientManager::updatetatLog("$patientid","$prescriptionid","Consultant_fees","$casetype","drinvace.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh1[ipd_visit_fee]","grand_total","q","w","ee","$Admitted_Under",""); 
	PatientManager::setActivityLog($patientid,"$prescriptionid","Initial Assessment<br>Assessment","showpage_Assessment.php?prescriptionid=$prescriptionid&patientid=$patientid&srno=","$entered_by");
$sql="INSERT INTO potential(id,prescriptionid,patientid,operative_date,Mode_Treatment,Plan_Of_Care,Follow_Up_Care,treatment_Facility,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$operative_date','$Mode_Treatment','$Plan_Of_Care','$Follow_Up_Care','$treatment_Facility','$entered_by','$created_at','$updated_at')";
	$result=mysqli_query($link,$sql);
	
$dr="INSERT INTO `al_Doctor`(`prescriptionid`, `patientid`, `hospital_id`, `Doctor_id`, `towards_link`, `TimeIn`, `Al_Date`,`KnowledgeableCounseling`,  `grade`, `Created_at`, `Status`) VALUES ('$prescriptionid','$patientid','0','$entered_by','showpage_Assessment.php?prescriptionid=$prescriptionid&patientid=$patientid&srno=','$TimeIn','$Al_Date','null','null','$created_at','0')";
$result=mysqli_query($link,$dr);	
	
if($result)
echo "<script>alert('Add successfully..');</script><script>window.location='admission4.php?prescriptionid=$prescriptionid&patientid=$patientid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function updatetatLog($patientid,$prescriptionid,$discription,$pagetype,$hospital_id,$start_date,$stop_date,$start_time,$stop_time,$solution,$entered_by,$currenctive_by)
{
	$link=DBManager::connect();
	 date_default_timezone_set('Asia/Kolkata');
$timeva=time();
$pavam=date( "H:i:s","$timeva");
$sjdjs=date('Y/m/d H:i:s');
$sql ="UPDATE tat SET stop_date='$sjdjs',stop_time='$pavam'  WHERE prescriptionid='$_GET[prescriptionid]' AND 	pagetype='Add_As_Patient_Page'";
$result=mysqli_query($link,$sql);
if($result)
echo "";
else 
	echo "";
	$link=DBManager::close($link);
}

public static function vilalslogingdrnote($prescriptionid,$patientid,$Wt,$bmi,$BP,$BP2,$Temp,$RBS,$Spo2,$HR,$Pulse,$poa,$entered_by)
{
    $link=DBManager::connect();
$narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
$admissiondate=date("Y-m-d");
  $updated_at=date("Y-m-d");
   $created_at=date("F d, Y / h:i:s A");
$sql="INSERT INTO vitals_final(id,prescriptionid,patientid,Wt,bmi,BP,BP2,Temp,RBS,Spo2,HR,Pulse,poa,entered_by,created_at,updated_at) VALUES (NULL, '$prescriptionid','$patientid','$Wt','$bmi','$BP','$BP2','$Temp','$RBS','$Spo2','$HR','$Pulse','$poa','$entered_by','$created_at','$admissiondate')";
	$sql1 ="UPDATE patient SET Weight='$Wt' WHERE patientid='$patientid'";
$result=mysqli_query($link,$sql1);
	$result=mysqli_query($link,$sql);
	if(!$result)
	return false;
$sql ="select last_insert_id() from vitals_final";
$result=mysqli_query($link,$sql);
if(!$result)
	return false;
$row=mysqli_fetch_row($result);
$id=$row[0];
PatientManager::setActivityLog($patientid,"$prescriptionid","Doctor Note<br>Vitals","showpageipd_vitals.php?prescriptionid=$prescriptionid&patientid=$patientid&id=$id&srno=","$entered_by");
	$result=mysqli_query($link,$sql);
		
if($result)
echo "<script>alert('Vitals add successfully..');</script><script>window.location='vitals_drnote.php?prescriptionid=$prescriptionid&patientid=$patientid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function nayainvestigationdr($prescriptionid,$patientid,$hospital_id,$Raised_at,$Investigation_type,$Category,$Sub_Category,$Priority_slip,$Investigation,$ivid,$Result,$Evidence,$entered_by)
{

	$link=DBManager::connect();
		$narayan=LoginManager::currentUser();
	$anilka=LoginManager::getUserTypeByuname("$narayan");
	$entered_by="$anilka";
	$admissiondate=date("Y-m-d");
	include("dbconnection.php");
$sql1 ="SELECT * FROM create_inhouse WHERE ivid='$ivid' OR ivid='$Investigation'";
		$qsql1 = mysqli_query($con,$sql1);
		if($rh1 = mysqli_fetch_array($qsql1))
		    	$pricetotal=$rh1[rate];
		    	$ivname=$rh1[ivid];
		    		PatientManager::billingLog("$patientid","$prescriptionid","Investigation_charge","$ivid$Investigation","patient_investigation_invoice.php?prescriptionid=$prescriptionid&patientid=$patientid","$pricetotal","","","$paymentmode","$status","$entered_by");
		    	
$DisplayForm=True;
$sql1 ="SELECT * FROM investigation WHERE prescriptionid='$_GET[prescriptionid]'";
		$qsql1 = mysqli_query($con,$sql1);
		while($rh1 = mysqli_fetch_array($qsql1))
		{
	$DisplayForm=False;
echo "";
}
if($DisplayForm)
{
PatientManager::setActivityLog($patientid,"$prescriptionid","Doctor Note<br>Request for investigation","showpage_investigation.php?prescriptionid=$prescriptionid&patientid=$patientid&srno=","$entered_by");
} else{
  
}
$updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");

$Admitted= date("Y-m-d");
$Time= date('H:i:s');



$sql="INSERT INTO investigation(id,prescriptionid,patientid,hospital_id,Raised_at,Investigation_type,Category,Sub_Category,Priority_slip,Investigation,ivid,Result,Evidence,AdmittedDate, TimeIn,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid', '$patientid','$hospital_id','$Raised_at','$Investigation_type','$Category','$Sub_Category','$Priority_slip','$Investigation','$ivid','$Result','$Evidence','$Admitted','$Time','$entered_by','$created_at','$admissiondate')";
$result=mysqli_query($link,$sql);
if(!$result)
	return false;
$sql ="select last_insert_id() from investigation";
$result=mysqli_query($link,$sql);
if(!$result)
	return false;
$row=mysqli_fetch_row($result);
$id=$row[0];
	$result=mysqli_query($link,$sql);
		
if($result)
echo "<script>alert('$Investigation add successfully..');</script><script>window.location='drnoteinvestigation.php?prescriptionid=$prescriptionid&patientid=$patientid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function drnoteIPD($prescriptionid,$patientid,$Potential_side_effect,$Nursing_Instruction,$TypeOfVisit,$Status_of_Patient,$Response_to_Treatment,$Intensive_unit,$Shift_Ward,$Expected_Outcome,$Risk_Involved,$Mode_Treatment,$treatment_Facility,$Assurances_Guarantee,$Second_Opinious,$Referral_Higher_Center,$nameofhospital,$Name_Consultant,$Prognosis_Explained,$Diagnosis,$Detail_Note,$Schedule_Operative_procedure,$entered_by)
{
	$link=DBManager::connect();
	include("dbconnection.php");

		$narayan=LoginManager::currentUser();
	$anilka=LoginManager::getUserTypeByuname("$narayan");
	$entered_by="$anilka";
		$updated_at=date("Y/m/d");
   $created_at=date("F d, Y / h:i:s A");
$sql="INSERT INTO drnote(id,prescriptionid,patientid,Potential_side_effect,Nursing_Instruction,TypeOfVisit,Status_of_Patient,Response_to_Treatment,Intensive_unit,Shift_Ward,Expected_Outcome,Risk_Involved,Mode_Treatment,treatment_Facility,Assurances_Guarantee,Second_Opinious,Referral_Higher_Center,nameofhospital,Name_Consultant,Prognosis_Explained,Diagnosis,Detail_Note,Schedule_Operative_procedure,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$Potential_side_effect','$Nursing_Instruction','$TypeOfVisit','$Status_of_Patient','$Response_to_Treatment','$Intensive_unit','$Shift_Ward','$Expected_Outcome','$Risk_Involved','$Mode_Treatment','$treatment_Facility','$Assurances_Guarantee','$Second_Opinious','$Referral_Higher_Center','$nameofhospital','$Name_Consultant','$Prognosis_Explained','$Diagnosis','$Detail_Note','$Schedule_Operative_procedure','$entered_by','$created_at','$updated_at')";
//	echo $sql;
	$result=mysqli_query($link,$sql);
	if(!$result)
	return false;
$sql ="select last_insert_id() from drnote";
$result=mysqli_query($link,$sql);
if(!$result)
	return false;
$row=mysqli_fetch_row($result);
$id=$row[0];

$sql12 ="SELECT * FROM addaspatient WHERE prescriptionid='$prescriptionid'";
$qsql12 = mysqli_query($con,$sql12);
$rh12 = mysqli_fetch_array($qsql12);

$sql1 ="SELECT * FROM dr WHERE drid='$entered_by'";
$qsql1 = mysqli_query($con,$sql1);
$rh1 = mysqli_fetch_array($qsql1);
		
if($rh12[typevisit] == 'Ipd_Emergency'){
   PatientManager::billingLog("$patientid","$prescriptionid","visit_fees","$id","drinvace.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh1[ipd_EMG_fee]","discount","grand_total","paymentmode","status","$entered_by");
}
else{
   PatientManager::billingLog("$patientid","$prescriptionid","visit_fees","$id","drinvace.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh1[ipd_visit_fee]","discount","grand_total","paymentmode","status","$entered_by");
}
PatientManager::setActivityLog($patientid,"$prescriptionid","Doctor Note<br>Assessment","showpage_drnote.php?prescriptionid=$prescriptionid&patientid=$patientid&id=$id&srno=","$entered_by");
	$result=mysqli_query($link,$sql);
		PatientManager::diagnosistimiline("$prescriptionid","$patientid","$Diagnosis","$Surgery","$entered_by");
		
		

$dr="INSERT INTO `al_Doctor`(`prescriptionid`, `patientid`, `hospital_id`, `Doctor_id`, `towards_link`, `TimeIn`, `Al_Date`,`KnowledgeableCounseling`,  `grade`, `Created_at`, `Status`) VALUES ('$prescriptionid','$patientid','0','$entered_by','showpage_drnote.php?prescriptionid=$prescriptionid&patientid=$patientid&id=$id&srno=','$TimeIn','$Al_Date','null','null','$created_at','0')";
$result=mysqli_query($link,$dr);		
		
if($result)
echo "<script>alert('Add successfully..');</script><script>window.location='drnote.php?prescriptionid=$prescriptionid&patientid=$patientid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function drnote($prescriptionid,$patientid,$Potential_side_effect,$Nursing_Instruction,$TypeOfVisit,$Status_of_Patient,$Response_to_Treatment,$Intensive_unit,$Shift_Ward,$Expected_Outcome,$Risk_Involved,$Mode_Treatment,$treatment_Facility,$Assurances_Guarantee,$Second_Opinious,$Referral_Higher_Center,$nameofhospital,$Name_Consultant,$Prognosis_Explained,$Diagnosis,$Detail_Note,$Schedule_Operative_procedure,$entered_by)
{
	$link=DBManager::connect();
	include("dbconnection.php");

		$narayan=LoginManager::currentUser();
	$anilka=LoginManager::getUserTypeByuname("$narayan");
	$entered_by="$anilka";
		$updated_at=date("Y/m/d");
   $created_at=date("F d, Y / h:i:s A");
$sql="INSERT INTO drnote(id,prescriptionid,patientid,Potential_side_effect,Nursing_Instruction,TypeOfVisit,Status_of_Patient,Response_to_Treatment,Intensive_unit,Shift_Ward,Expected_Outcome,Risk_Involved,Mode_Treatment,treatment_Facility,Assurances_Guarantee,Second_Opinious,Referral_Higher_Center,nameofhospital,Name_Consultant,Prognosis_Explained,Diagnosis,Detail_Note,Schedule_Operative_procedure,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$Potential_side_effect','$Nursing_Instruction','$TypeOfVisit','$Status_of_Patient','$Response_to_Treatment','$Intensive_unit','$Shift_Ward','$Expected_Outcome','$Risk_Involved','$Mode_Treatment','$treatment_Facility','$Assurances_Guarantee','$Second_Opinious','$Referral_Higher_Center','$nameofhospital','$Name_Consultant','$Prognosis_Explained','$Diagnosis','$Detail_Note','$Schedule_Operative_procedure','$entered_by','$created_at','$updated_at')";
//	echo $sql;
	$result=mysqli_query($link,$sql);
	if(!$result)
	return false;
$sql ="select last_insert_id() from drnote";
$result=mysqli_query($link,$sql);
if(!$result)
	return false;
$row=mysqli_fetch_row($result);
$id=$row[0];

	$sql12 ="SELECT * FROM addaspatient WHERE prescriptionid='$prescriptionid'";
		$qsql12 = mysqli_query($con,$sql12);
		$rh12 = mysqli_fetch_array($qsql12);
    $sql1 ="SELECT * FROM dr WHERE drid='$rh12[Admitted_Under]'";
		$qsql1 = mysqli_query($con,$sql1);
		$rh1 = mysqli_fetch_array($qsql1);
if($rh12[typevisit] == 'Ipd_Emergency'){
   PatientManager::billingLog("$patientid","$prescriptionid","visit_fees","$id","drinvace.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh1[ipd_EMG_fee]","discount","grand_total","paymentmode","status","$rh12[Admitted_Under]");
}
else{
   PatientManager::billingLog("$patientid","$prescriptionid","visit_fees","$id","drinvace.php?prescriptionid=$prescriptionid&patientid=$patientid","$rh1[ipd_visit_fee]","discount","grand_total","paymentmode","status","$rh12[Admitted_Under]");
}
PatientManager::setActivityLog($patientid,"$prescriptionid","Doctor Note<br>Assessment","showpage_drnote.php?prescriptionid=$prescriptionid&patientid=$patientid&id=$id&srno=","$entered_by");
	$result=mysqli_query($link,$sql);
		PatientManager::diagnosistimiline("$prescriptionid","$patientid","$Diagnosis","$Surgery","$entered_by");
		
		

$dr="INSERT INTO `al_Doctor`(`prescriptionid`, `patientid`, `hospital_id`, `Doctor_id`, `towards_link`, `TimeIn`, `Al_Date`,`KnowledgeableCounseling`,  `grade`, `Created_at`, `Status`) VALUES ('$prescriptionid','$patientid','0','$entered_by','showpage_drnote.php?prescriptionid=$prescriptionid&patientid=$patientid&id=$id&srno=','$TimeIn','$Al_Date','null','null','$created_at','0')";
$result=mysqli_query($link,$dr);		
		
if($result)
echo "<script>alert('Add successfully..');</script><script>window.location='drnote.php?prescriptionid=$prescriptionid&patientid=$patientid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function RiskStatus($prescriptionid,$patientid,$surgeryid,$Fitness_Procedure,$Risk_Factors_Present,$Arranged_units_blood,$RequisitionForm,$abo_rh,$units,$group_name,$address,$Ref_Dr,$Nurse_Name,$Blood_Bag_Number,$Products_Blood_Group,$product_name,$blood_bank_name,$date_of_expiry,$Blood_Checked_Doctor,$doctor_id_no,$Plan_Action,$entered_by)
{
	echo "";
	$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
$updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");
	  PatientManager::setActivityLog($patientid,"$prescriptionid","Pre-Assessment Sheet<br>Risk Assessment Status","showpage_Risk_Assessment_Status.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid&srno=","$entered_by");
	$sql="INSERT INTO Risk_Assessment_Status(srno,prescriptionid,patientid,surgeryid,Fitness_Procedure,Risk_Factors_Present,Arranged_units_blood, RequisitionForm,abo_rh,units,group_name,address,Ref_Dr,Nurse_Name ,Blood_Bag_Number,Products_Blood_Group,product_name,blood_bank_name ,date_of_expiry,Blood_Checked_Doctor,doctor_id_no,Plan_Action,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$surgeryid','$Fitness_Procedure','$Risk_Factors_Present','$Arranged_units_blood', '$RequisitionForm','$abo_rh','$units','$group_name','$address','$Ref_Dr','$Nurse_Name','$Blood_Bag_Number','$Products_Blood_Group','$product_name','$blood_bank_name','$date_of_expiry','$Blood_Checked_Doctor','$doctor_id_no','$Plan_Action','$entered_by','$created_at','$updated_at')";
		$result=mysqli_query($link,$sql);
if($result)
echo "<script>alert('Risk Assessment Status Add successfully');</script><script>window.location='PreOperativeAssessmentSheet.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}


public static function OperationCare($prescriptionid,$patientid,$surgeryid,$Analgesia_Plan,$Analgesia_Plan_Note,$entered_by)
{
	echo "";
	$link=DBManager::connect();
$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
$updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");
 PatientManager::setActivityLog($patientid,"$prescriptionid","Pre-Assessment Sheet<br>OperationCare","showpage_Operation_Care.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid&srno=","$entered_by");
	$sql="INSERT INTO Operation_Plan(srno,prescriptionid,patientid,surgeryid,Analgesia_Plan,Analgesia_Plan_Note,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid', '$patientid','$surgeryid','$Analgesia_Plan','$Analgesia_Plan_Note','$entered_by','$created_at','$updated_at')";
	$result=mysqli_query($link,$sql);
if($result)
echo "<script>alert('Operation Plan Add successfully');</script><script>window.location='PreOperativeAssessmentSheet.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}


public static function InstructionSheet($prescriptionid,$patientid,$surgeryid,$foodtake,$Anesthesia_Note,$entered_by)
{
	echo "";
	$link=DBManager::connect();
$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
$updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");
	  PatientManager::setActivityLog($patientid,"$prescriptionid","Pre-Assessment Sheet<br>Nursing Instruction","showpage_Nursing_Instruction_Sheet.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid&srno=","$entered_by");
	$sql="INSERT INTO Instruction_Sheet(srno,prescriptionid,patientid,surgeryid,foodtake,Anesthesia_Note,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid', '$patientid','$surgeryid','$foodtake','$Anesthesia_Note','$entered_by','$created_at','$updated_at')";
	$result=mysqli_query($link,$sql);
if($result)
echo "<script>alert('Nursing Instruction Sheet Add successfully');</script><script>window.location='PreOperativeAssessmentSheet.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function ConfirmationSheet($prescriptionid,$patientid,$surgeryid,$verify_pt_identity,$time_surgery,$name_tag,$site_marked,$Operation_consent,$operative_assessment,$Medical_fitness,$Last_meal,$Bladder_voided,$topical_antibiotics,$Lab_investigation,$General_systematic,$infection_present,$Xylocaine_sensitivity,$Hospital_dress,$jewelry_removed,$Dentures_removed,$Hair_clips,$Allergy_noted,$Operation_site_marked,$reports_checked,$entered_by)
{
	echo "";
	$link=DBManager::connect();
$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
$updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");
	  PatientManager::setActivityLog($patientid,"$prescriptionid","Pre-Assessment Sheet<br>Confirmation Sheet","showpage_Preoperative_Confirmation_Sheet.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid&srno=","$entered_by");
	$sql="INSERT INTO Confirmation_Sheet(srno,prescriptionid,patientid,surgeryid,verify_pt_identity,time_surgery,name_tag,site_marked,Operation_consent,operative_assessment,Medical_fitness,Last_meal,Bladder_voided,topical_antibiotics,Lab_investigation,General_systematic,infection_present,Xylocaine_sensitivity,Hospital_dress,jewelry_removed,Dentures_removed,Hair_clips,Allergy_noted,Operation_site_marked,reports_checked,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$surgeryid','$verify_pt_identity','$time_surgery','$name_tag','$site_marked','$Operation_consent','$operative_assessment','$Medical_fitness','$Last_meal','$Bladder_voided','$topical_antibiotics','$Lab_investigation','$General_systematic','$infection_present','$Xylocaine_sensitivity','$Hospital_dress','$jewelry_removed','$Dentures_removed','$Hair_clips','$Allergy_noted','$Operation_site_marked','$reports_checked','$entered_by','$created_at','$updated_at')";
	$result=mysqli_query($link,$sql);
if($result)
echo "<script>alert('Pre-Operative Checklist Add successfully');</script><script>window.location='preoperativechecklist.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function BeforeConduction($prescriptionid,$patientid,$surgeryid,$Anesthesia_Safety,$Pulse_Oximeter,$Known_Allergy,$Difficult_Airways,$Risk_500,$entered_by)
{
	echo "";
	$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
$updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");
	  PatientManager::setActivityLog($patientid,"$prescriptionid","Pre-Assessment Sheet<br>Before Conduction","showpage_Before_Conduction.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid&srno=","$entered_by");
	$sql="INSERT INTO Before_Conduction(srno,prescriptionid,patientid,surgeryid,Anesthesia_Safety,Pulse_Oximeter,Known_Allergy,Difficult_Airways,Risk_500,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$surgeryid','$Anesthesia_Safety','$Pulse_Oximeter','$Known_Allergy','$Difficult_Airways','$Risk_500','$entered_by','$created_at','$updated_at')";
	$result=mysqli_query($link,$sql);
if($result)
echo "<script>alert('Before Conduction Of Sign-In Add successfully');</script><script>window.location='preoperativechecklist.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function Anesthesianote($prescriptionid,$patientid,$surgeryid,$Name_Anesthetist,$Name_of_Surgeon,$member_1,$member_2,$Proposed_Surgery,$Duration,$Duration_time,$Pre_Operative_Diagnosis,$Anesthesia_Type,$Procedure_Executed,$Procedure_performed,$Surgeon_Note,$Anesthetic_Note,$Patient_Status,$Expected_Outcome,$Record_time_Death,$Revesalr,$Post_Op_advice,$entered_by,$SignIn,$SignOut)
{

	$link=DBManager::connect();
		$narayan=LoginManager::currentUser();
	$anilka=LoginManager::getUserTypeByuname("$narayan");
	$entered_by="$anilka";
	$updated_at=date("Y-m-d");
   $created_at=date("F d, Y / h:i:s A");
   date_default_timezone_set("Asia/Calcutta");   //India time (GMT+5:30)
$timeIn= date('H:i:s');
	PatientManager::setActivityLog($patientid,"$prescriptionid","Pre-Assessment Sheet<br>Anesthesia Note","showpage_Anesthesia_note.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid&srno=","$entered_by");
	$sql='INSERT INTO Anesthesia_note(id,prescriptionid,patientid,surgeryid,Name_Anesthetist,Name_of_Surgeon,member_1,member_2,Proposed_Surgery,Duration,Duration_time,Pre_Operative_Diagnosis,Anesthesia_Type,Procedure_Executed,Procedure_performed,Surgeon_Note,Anesthetic_Note,Patient_Status,Expected_Outcome,Record_time_Death,Revesalr,Post_Op_advice,entered_by,SignIn,SignOut,TimeIn,created_at,updated_at) VALUES (NULL,"'.$prescriptionid.'","'.$patientid.'","'.$surgeryid.'","'.$Name_Anesthetist.'","'.$Name_of_Surgeon.'","'.$member_1.'","'.$member_2.'","'.$Proposed_Surgery.'","'.$Duration.'","'.$Duration_time.'","'.$Pre_Operative_Diagnosis.'","'.$Anesthesia_Type.'","'.$Procedure_Executed.'","'.$Procedure_performed.'","'.$Surgeon_Note.'","'.$Anesthetic_Note.'","'.$Patient_Status.'","'.$Expected_Outcome.'","'.$Record_time_Death.'","'.$Revesalr.'","'.$Post_Op_advice.'","'.$entered_by.'","'.$SignIn.'","'.$SignOut.'","'.$timeIn.'","'.$created_at.'","'.$updated_at.'")';
	$result=mysqli_query($link,$sql);

if($result)
echo "<script>alert('Anesthesia Note Add  successfully..');</script><script>window.location='Anesthesia_Note.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid'</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function Suspected_Reaction($prescriptionid,$patientid,$surgeryid,$Minor,$Major,$Minor_Reaction,$Major_Reaction,$Specify,$otherAnswer,$otherAnswer_date,$Name_Medicine,$Treatment_Given,$Outcome,$Corrective_action,$Recovery_time,$entered_by)
{
    $updated_at=date("F d, Y / h:i:s A");
$created_at=date("F d, Y / h:i:s A");
	echo "";
	$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
		   PatientManager::setActivityLog($patientid,$prescriptionid,"Post-Operative Checklist<br>Suspected Reaction","showpage_Suspected_Reaction.php?prescriptionid=$prescriptionid&patientid=$patientid&surgeryid=$surgeryid&srno=","$entered_by");
	$Suspected_Reaction="INSERT INTO Suspected_Reaction(id,prescriptionid,patientid,surgeryid,Minor,Major,Minor_Reaction,Major_Reaction,Specify,otherAnswer,otherAnswer_date,Name_Medicine,Treatment_Given,Outcome,Corrective_action,Recovery_time,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$surgeryid','$Minor','$Major','$Minor_Reaction','$Major_Reaction','$Specify','$otherAnswer','$otherAnswer_date','$Name_Medicine','$Treatment_Given','$Outcome','$Corrective_action','$Recovery_time','$entered_by','$created_at','$updated_at')";
		$result=mysqli_query($link,$Suspected_Reaction);
		
if($result){
    echo "<script>alert('Suspected Reaction Add Successfully..');</script>";
    
   echo "<script>window.location='PostOperativeChecklistset.php?prescriptionid=$prescriptionid&patientid=$patientid'&surgeryid='$surgeryid'</script>";


}
else {
	echo "Fail";
	$link=DBManager::close($link);
}
}


public static function dis_diagnosistimilinetest($prescriptionid,$patientid,$diagnosis,$Surgery,$entered_by)
{
     $updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");
	echo "";
	$link=DBManager::connect();
	  $narayan=LoginManager::currentUser();
$harilal=LoginManager::getUserTypeByuname("$narayan");
$entered_by=$harilal;
$admissiondate=date("Y-m-d");
		  	$sql="INSERT INTO diagnosis_timiline(id,prescriptionid,patientid,diagnosis,Surgery,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$diagnosis','$Surgery','$entered_by','$admissiondate','$created_at')";
		$result=mysqli_query($link,$sql);
if($result)
echo "<script>alert('Add successfully..');</script><script> window.history.go(-1)</script>;</script>";
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function testoccu($prescriptionid,$patientid,$hospitalid,$occu,$Admitted_Under,$status,$entered_by)
{
	echo "";
	$link=DBManager::connect();
		$narayan=LoginManager::currentUser();
	$anilka=LoginManager::getUserTypeByuname("$narayan");
	$entered_by="$anilka";
   $updated_at=date("Y-m-d");
   $created_at=date("F d, Y / h:i:s A");
	$sql="INSERT INTO occutracker(occuid,prescriptionid,patientid,hospitalid,occu,Admitted_Under,status,entered_by, created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$hospitalid','$occu','$Admitted_Under','$status','$entered_by','$created_at','$updated_at')";
     $result=mysqli_query($link,$sql);
if($result)
{
    	$occuid=mysqli_insert_id($link);

echo "<script>alert('Occular Process start successfully');</script><script>window.location='OcularMenu.php?prescriptionid=$prescriptionid&patientid=$patientid&occuid=$occuid'</script>;</script>";
}
else 
	echo "Fail";
	$link=DBManager::close($link);
}

public static function onevisualexam($prescriptionid,$patientid,$occuid,$Un_right,$Un_left,$Aided_right,$Aided_left,$entered_by)
{
	echo "";
	$updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");
	$link=DBManager::connect();
		$narayan=LoginManager::currentUser();
	$anilka=LoginManager::getUserTypeByuname("$narayan");
	$entered_by="$anilka";
	PatientManager::setActivityLog($patientid,"$prescriptionid","Examination <br> Visual Acuity Test","show_Visual_Acuity_Test.php?prescriptionid=$prescriptionid&patientid=$patientid&occuid=$occuid&srno=","$entered_by");
$sql="INSERT INTO visual(id,prescriptionid,patientid,occuid,Un_right,Un_left,Aided_right,Aided_left,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$occuid','$Un_right','$Un_left','$Aided_right','$Aided_left','$entered_by','$created_at','$updated_at')";
	$result=mysqli_query($link,$sql);
if($result){
echo "<script>alert('Examination add successfully..');</script>";
echo "<script>window.history.go(-1)</script>";}
else {
	echo "Fail";
	$link=DBManager::close($link);
}
}

public static function GlassAdvices($prescriptionid,$patientid,$occuid,$Examination_type,$SPH,$SPH_right,$SPH_left,$CYL,$CYL_right,$CYL_left,$AXIS,$AXIS_right,$AXIS_left,$VISION,$VISION_right,$VISION_left,$entered_by)
{
    $updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");
	echo "Patient admission new";
	$link=DBManager::connect();
		$narayan=LoginManager::currentUser();
	$anilka=LoginManager::getUserTypeByuname("$narayan");
	$entered_by="$anilka";
	PatientManager::setActivityLog($patientid,"$prescriptionid","Examination <br>Glass Advices $Examination_type","show_GlassAdvices.php?prescriptionid=$prescriptionid&patientid=$patientid&occuid=$occuid&srno=","$entered_by");
$sql="INSERT INTO Glass_Advices(id,prescriptionid,patientid,occuid,Examination_type,SPH,SPH_right,SPH_left,CYL,CYL_right,CYL_left,AXIS,AXIS_right,AXIS_left,VISION,VISION_right,VISION_left,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$occuid','$Examination_type','$SPH','$SPH_right','$SPH_left','$CYL','$CYL_right','$CYL_left','$AXIS','$AXIS_right','$AXIS_left','$VISION','$VISION_right','$VISION_left','$entered_by','$created_at','$updated_at')";
	$result=mysqli_query($link,$sql);
if($result){
echo "<script>alert('Examination add successfully..');</script>";
echo "<script>window.history.go(-1)</script>";}
else {
	echo "Fail";
	$link=DBManager::close($link);
}}

public static function Glassnear($prescriptionid,$patientid,$occuid,$Examination_type,$SPH,$SPH_right,$SPH_left,$CYL,$CYL_right,$CYL_left,$AXIS,$AXIS_right,$AXIS_left,$VISION,$VISION_right,$VISION_left,$entered_by)
{
    $updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");
	echo "Patient admission new";
	$link=DBManager::connect();
		$narayan=LoginManager::currentUser();
	$anilka=LoginManager::getUserTypeByuname("$narayan");
	$entered_by="$anilka";
	PatientManager::setActivityLog($patientid,"$prescriptionid","Examination <br>Glass Advices $Examination_type","show_GlassAdvices_near.php?prescriptionid=$prescriptionid&patientid=$patientid&occuid=$occuid&srno=","$entered_by");
$sql="INSERT INTO Glass_Advices(id,prescriptionid,patientid,occuid,Examination_type,SPH,SPH_right,SPH_left,CYL,CYL_right,CYL_left,AXIS,AXIS_right,AXIS_left,VISION,VISION_right,VISION_left,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$occuid','$Examination_type','$SPH','$SPH_right','$SPH_left','$CYL','$CYL_right','$CYL_left','$AXIS','$AXIS_right','$AXIS_left','$VISION','$VISION_right','$VISION_left','$entered_by','$created_at','$updated_at')";
	$result=mysqli_query($link,$sql);
if($result){
echo "<script>alert('Examination add successfully..');</script>";
echo "<script>window.history.go(-1)</script>";}
else {
	echo "Fail";
	$link=DBManager::close($link);
}
}


public static function oneexamnation($prescriptionid,$patientid,$occuid,$Examination,$eye,$Result,$left_result,$entered_by)
{
    $updated_at=date("Y-m-d");
$created_at=date("F d, Y / h:i:s A");
	echo "Eye Examination";
	$link=DBManager::connect();
		$narayan=LoginManager::currentUser();
	$anilka=LoginManager::getUserTypeByuname("$narayan");
	$entered_by="$anilka";
	PatientManager::setActivityLog($patientid,"$prescriptionid","Examination <br>Eye Examination","show_oneexamnation.php?prescriptionid=$prescriptionid&patientid=$patientid&occuid=$occuid&srno=","$entered_by");
$sql="INSERT INTO onexamnation(id,prescriptionid,patientid,occuid,Examination,eye,Result,left_result,entered_by,created_at,updated_at) VALUES (NULL,'$prescriptionid','$patientid','$occuid','$Examination','$eye','$Result','$left_result','$entered_by','$created_at','$updated_at')";
//echo $sql;
	$result=mysqli_query($link,$sql);
if($result){
echo "<script>alert('Eye Examination add successfully..');</script>";
echo "<script>window.history.go(-1)</script>";}
else {
	echo "Fail";
	$link=DBManager::close($link);
}
}


























}
?>

Anon7 - 2022
AnonSec Team