Patient source code
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package login;
import [Link];
import [Link];
import [Link];
import [Link].*;
import [Link];
import [Link].*;
/**
*
* @author Easter
*/
@WebService()
public class patient {
/**
* Web service operation
*/
@WebMethod(operationName = "getPatientInfo")
public String getPatientInfo(@WebParam(name = "User")
String User, @WebParam(name = "Pid")
String Pid)
{
String result="";
int flag=0;
try
{
String ss1[]=[Link]("@");
Pid=ss1[0];
String sn=ss1[1];
String clip=ss1[2];
[Link]("Comes in Patient Service");
String
addr[]=[Link]().toString().split("/");
[Link]("Client Address : "+ss1[2]);
[Link]("[Link]");
Connection
con=[Link]("jdbc:odbc:LocalServer");
Statement st=[Link]();
[Link]("use RemoteService");
ResultSet rs=[Link]("select * from Policy where
UserName='"+User+"'and Service='"+sn+"'");
while([Link]())
{
String user1=[Link](1);
String service=[Link](2);
String ip=[Link](3);
[Link]("service & IP : "+service + " :
"+ip+" : "+user1);
if([Link](clip) && [Link]("Patient"))
{
int from=[Link]([Link](4));
int to=[Link]([Link](5));
Date dt=new Date();
int hours=[Link]();
[Link]("Time : "+from+" : "+hours+" :
"+to);
if(hours>from && hours<to)
{
flag=1;
}
}
}
// [Link]();
[Link]();
[Link]("Flag : "+flag);
if(flag==1)
{
rs=[Link]("select * from Patient where
PatientId='"+Pid+"'");
if([Link]())
{
result=[Link](1)+"#"+[Link](2)+"#"+[Link](3);
}
else
{
result="Invalid Patient Id" ;
}
}
else
{
result="You are Not Allowed to Access This service at
this time";
}
[Link]("Result : "+result);
}
catch(Exception e)
{
[Link](e);
}
//TODO write your implementation code here:
return result;
}