You are on page 1of 135

2012

Department of Computer Applications

Affiliated to (WEST BENGAL UNIVERSITY OF TECHNOLOGY)

Project Name: iDoc-Tools for Doctor Consultation


From: Ecotech Consultants Pvt. Ltd.

Submitted by
Aloke Kumar. Mondal Roll No.: 0967010034

Under Supervision of Mr. Souvik Das

-Tools for Doctor Consultation

CERTIFICATION:
Certified that this project report titled iDoc-Tools for Doctor Consultation is the bonafide work of Aloke Kr. Mondal(Roll No: 0967010034), who carried out the main project work done under my supervision. Certified further, that to the best of my knowledge the work reported herein does not form part of any other project report or dissertation on the basis of which a degree or award was conferred on an earlier occasion on this or any other candidate.

Signature of Internal Guide

Signature of HOD

.. Signature of Principal

Signature of Director

Ecotech Consultants

Page 2

-Tools for Doctor Consultation

ACKNOWLEDGEMENT:

I express my sincere gratitude to Dr. MUKHERJEE, DIRECTOR and Dr. ANSARI, PRINCIPAL, MID,Rajbandh, for their support and encouragement for the successful completion of the project. I record my sincere thanks to Mr. NIRUPAM BURMAN Head, Department of Computer Applications, Management Institute of Durgapur, for his continuous support and keen interest to make this project a successful one. I find no word to express profound gratitude to my internal guide Mr. Atanu
Sarkar ,MCA department, MID,Rajbandh.

I also find no word to express profound gratitude to my external guidee


Mr.Souvik Das, Ecotech Consultants Pvt. Ltd.,Kolkata-7000006

Finally I thank my beloved family member and friend for their motivation, encouragement and cooperation in all aspect which led me to the completion of this project.
Name of the Student
Aloke Kr. Mondal.

Ecotech Consultants

Page 3

-Tools for Doctor Consultation

TABLE OF CONTENTS:
1 2 OBJECTIVE ............................................................................................................................................ 6 SOFTWARE SPECIFICATION .............................................................................................................. 6 About STRUTS5 Struts Flow Diagram...6

Technologies Used: ................................................................................................................................ 7


3 4 FUNCTIONAL SPECIFICATION ........................................................................................................... 7 TECHNICAL DESIGNS ......................................................................................................................... 9

JSP Pages................................................................................................................................................... 9
JAVA Files ................................................................................................................................................. 9 XML Details ............................................................................................................................................... 9 5 SYSTEM DESIGNS .............................................................................................................................. 12 Data Flow Diagram....12
Context Level DFD...12 Level-1 DFD..13 Level-2 DFD.14

E-R Diagram.....15 Database Designs.....18 6 7 ARCHITECTURE OVERVIEW ............................................................................................................. 21 CODING ................................................................................................................................................ 22 JSP Pages Code..23 Property Resources Details29 Form pages Code.33 DTO Pages Codes69 Delegate Pages Code..93 Common Pages Code..94 Action Pages Code...98 DAO Pages code.111 Handler Pages Code..112 XML Pages Code....123 Ecotech Consultants Page 4

-Tools for Doctor Consultation


8 SCREENSHOTS ................................................................................................................................. 128

TESTING.133
Unit Testing.133 Integration Testing....133 System Testing133

10 CONCLUSION135 11 BIBLIOGRAPHIES135

Ecotech Consultants

Page 5

-Tools for Doctor Consultation

1. OBJECTIVE
I-Health is a great effort to provide sustainable benefits to doctors and patients. This is an online healthcare portal where patients can seek online doctor consultation by scheduling appointments online. This is a platform too for doctors where they can show their expertise and capability to diagnose severe ailments of registered patients. This portal is controlled by centralized admin where every action is monitored by the concerned admin user.

2.SOFTWARE SPECIFICATION About Struts:


In a standard Java EE web application, the client will typically call to the server via a web form. The information is then either handed over to a Java Servlet which interacts with a database and produces an HTML-formatted response, or it is given to a JavaServer Pages (JSP) document that intermingles HTML and Java code to achieve the same result. Both approaches are often considered inadequate for large projects because they mix application logic with presentation and make maintenance difficult. The goal of Struts is to separate the model (application logic that interacts with a database) from the view (HTML pages presented to the client) and the controller (instance that passes information between view and model). Struts provides the controller (a servlet known as ActionServlet) and facilitates the writing of templates for the view or presentation layer (typically in JSP, but XML/XSLT and Velocity are also supported). The web application programmer is responsible for writing the model code, and for creating a central configuration file struts-config.xml that binds together model, view and controller. Requests from the client are sent to the controller in the form of "Actions" defined in the configuration file; if the controller receives such a request it calls the corresponding Action class that interacts with the application-specific model code. The model code returns an "ActionForward", a string telling the controller what output page to send to the client. Information is passed between model and view in the form of special JavaBeans. A powerful custom tag library allows it to read and write the content of these beans from the presentation layer without the need for any embedded Java code. Struts is categorized as a request-based web application framework.

Ecotech Consultants

Page 6

-Tools for Doctor Consultation

Technologies Used For This J2EE Project:


Language: Core Java JDK Version: 1.5 Framework: STRUTS 1.2.9 Database: MySQL 5.5 Server

3. FUNCTIONAL SPECIFICATION
This J2EE project contains three major modules viz. Doctor Module, Patient Module and Admin Module.

Doctor Module:
Functional Requiremen t Serial No 1 Functional Specification Functional Specification Details

Doctor

To register doctor has to enter data into fields User Id, Password, Confirm Password, First Name, Last Page 7

Ecotech Consultants

-Tools for Doctor Consultation


Registration Name,Gender,Address,City,State,Designation,Speciality,Contact,Emai l. A doctor can login by UserId and Password. A doctor can update his/her existing profile First Name, Last Name,Gender,Address,City,State,Designation,Certification,Hospital Affiliation, Awards, Language, Picture, Profile Statement, Payment, Specialty, Contact,Email. Doctor can deactivate or delete his/her profile.

2 3

Doctor Login Doctor Profile Update

Deactivate / Delete Profile View Patient Appointment s Diagnosis

Doctor can view patients appointment.

Doctor can diagnosis patient.

Patient Module:
Functional Requirement Serial No 1 Functional Specification Functional Specification Details

Patient Registration

To register doctor has to enter data into fields User Id, Password, Confirm Password, First Name, Last Name, Gender, Address, City, State, Reason, Contact, Email. Patient can login by UserId and Password. Patient can search doctor by City and Specialty Patient can view doctors appointment schedule and book the doctor.

2 3 4

Patient Login Search Doctor View Doctors Appointment Schedule

Admin Module:
Functional Requirement Serial No 1 Functional Specification Functional Specification Details

Maintains Doctors database

Maintains Doctors database Page 8

Ecotech Consultants

-Tools for Doctor Consultation


2 3 Maintains Patients Database Receive Payment Maintains Patients Database Receive Payment via PAYPAL Gateway

4. TECHNICAL DESIGN
JSP Pages:
index.jsp patientReg.jsp deleteProfile.jsp doctorFind.jsp doctor-patient-search.jsp doctorUpdate.jsp patientUpdate.jsp forgetLogin.jsp forgetLoginActive.jsp doctorReg.jsp insurance-reg.jsp logout.jsp profile.jsp profile1.jsp success.jsp

JAVA Files:
Struts Action Java Classes
DoctorAction.java DoctorModifyAction.java DoctorProfileAction.java DoctorSearchAction.java DoctorUpdateAction.java ForgetLoginAction.java InsurenceAction.java PatientAction.java PatientModifyAction.java PatientUpdateAction.java SearchDoctorAction.java Ecotech Consultants Page 9

-Tools for Doctor Consultation


SearchPatientAction.java SigninAction.java Application Common Reusable Classes ApplicationUtility.java AppOnLoad.java Constant.java IHealthConstants.java Data Access Objects (DAO) CommonDAO.java DaoFactory.java DoctorDAO.java DoctorPrfileDAO.java InsuranceDAO.java LoginDAO.java PatientDAO.java Delegate Classes DoctorDelegate.java DoctorProfileDelegate.java InsuranceDelegate.java PatientDelegate.java LoginDelegate.java Data Transfer Objects (DTO) DoctorDto.java DoctorProfileDto.java InsuranceDto.java PatientDto.java LoginDto.java Struts Form Java classes DoctorForm.java DoctorProfileForm.java InsuranceForm.java PatientForm.java LoginForm.java Handler classes DoctorHandler.java Ecotech Consultants Page 10

-Tools for Doctor Consultation


DoctorProfileHandler.java InsuranceHandler.java PatientHandler.java LoginHandler.java

XML DETAILS
struts-config.xml web.xml

Ecotech Consultants

Page 11

-Tools for Doctor Consultation 5. SYSTEM DESIGN

Data Flow Diagram:

Context level DFD:

ADMIN

Control

Control

Search & Fix Appointment

PATIENT

Confirm appointment

DOCTOR

Ecotech Consultants

Page 12

-Tools for Doctor Consultation

Level-1 DFD:

Master DB

ADMIN

Paymen t Confir m to to

Patient DB

Store and retrieve

PATIENT

Registe r to to

DOCTOR Store and retrieve

Health Covera ge

Search & Set appointmen t

Doctor DB

INSURANCE Store and retrieve

Insurance DB

Ecotech Consultants

Page 13

-Tools for Doctor Consultation

Level-2 DFD
Payment Gateway

Master DB

ADMIN

to
Patient DB

Conf irm to
Register to

Store and Retrieve

PATIENT

DOCTOR

Store and
Health Coverag e

Retrieve
Search & Fix appointment

Doctor DB

INSURANCE
Store and Retrieve

Logi n to

Insurance DB

DOCTOR Profile

Ecotech Consultants

Page 14

-Tools for Doctor Consultation

Entity Relationship Diagram:


DOCTOR ATTRIBUTES

DOCTOR
Email #Doctor_i d Doctor _regno User_nam e passwo rd Fst_nam e Lst_nam e gen der City Addres s State Designation

Contact_no

Specialty

PATIENT ATTRIBUTES

PATIENT
#Patient_i d Username City Password addre ss Fst_name age State Email Contact_no Insurance_id Reason_of _visit

Zip

Lst_nam e

Gender

Ecotech Consultants

Page 15

-Tools for Doctor Consultation


INSURANCE ATTRIBUTES

INSURANCE
#insu_id Claim_a mt Policy _amt Claim last_da te Agent_nm Agent_id

Policy_na me Comp_nam ee Person_nam e Person_age Policy_render_dat e Policy_exp_dat e Policy_start

DOCTOR PROFILE ATTRIBUTES

DOCTOR PROFILE
Payment _Gateway

Practise_nam e Date_of_regist ratn Hospital _affln Designatio n

picture Profile_stmt Board of cert Award language

Ecotech Consultants

Page 16

-Tools for Doctor Consultation

ADMIN

1
Controlled

Payment Gateway

1
Controlle d by

m m
Search

m m
PATIENT

DOCTOR

Fix Appointme nt

1 m

NO

1
Pay via credit card or cash

Pay by insurance Yes r no ?

1 YES
INSURANCE

Ecotech Consultants

Page 17

-Tools for Doctor Consultation

Database Diagram:
doctor_mstr Table Details:
COLUMN NAME doc_id doctor_regno usrnm pwd fst_nm lst_nm gender addr city state designation specialty cntc_no email DATA TYPE CONSTRAINTS DESCRIPTION

bigint(100) varchar(100) varchar(100) varchar(100) varchar(100) varchar(100) varchar(100) varchar(100) varchar(100) varchar(100) varchar(100) varchar(100) varchar(100) varchar(100)

primary key unique key NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL

Unique Doctor Id for every Doctor Unique Doctor Registration no. User Name of Doctor Password of Doctor First name of Doctor Last Name of Doctor Gender Address of Doctor City State Designation Specialty Contact No of Doctor E-mail Id f Doctor

patient_mstr Table Details:


COLUMN NAME patient_id usrrnm pwd DATA TYPE CONSTRAINTS DESCRIPTION

bigint(100) varchar(100) varchar(100)

primary key unique key NOT NULL

Unique Patient Id for every Doctor User Name of Patient Password of Patient

Ecotech Consultants

Page 18

-Tools for Doctor Consultation


fst_nm lst_nm gender age addr city state zip cntc_no email reason_of_visit varchar(100) varchar(100) varchar(100) varchar(100) varchar(100) varchar(100) varchar(100) varchar(100) varchar(100) varchar(100) varchar(100) NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL First name of Patient Last Name of Patient Gender of Patient Age of Patient Address City State Zip cde Contact No of Doctor E-mail Id f Doctor Reason for visit Doctor

doctor_profile Table Details:


COLUMN NAME DocId practice_nm date_of_reg designation board_of_cert hospital_affln awards lngs prof_stmt pic DATA TYPE CONSTRAINTS DESCRIPTION

varchar(100) varchar(100) date varchar(100) varchar(100) varchar(100) varchar(100) blob(100) varchar(100) BLOB

Foreign Key NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL

Unique number for every doctor Practice name of Doctor Date of Registration of doctor Designation of doctor Board of Certification Hospital Affiliation Awards won Language known Professional Statement Picture

Ecotech Consultants

Page 19

-Tools for Doctor Consultation


payment varchar(100) NOT NULL Payment gateway

insu_mstr Table Details:


COLUMN NAME insu_id comp_nm policy_nm person_nm person_age policy_start policy_exp date policy_ren date agent_nm Varchar(100) agent_id claim_date policy_amount claim_amount Varchar(100) Varchar(100) Varchar(100) Varchar(100) NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL DATA TYPE CONSTRAINTS DESCRIPTION

bigint(100) Varchar(100) Varchar(100) Varchar(100) Varchar(100) date date

Primary key, auto increment NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL

Unique insurance ID no. Company Name Policy Name Person Name

Ecotech Consultants

Page 20

-Tools for Doctor Consultation

6. ARCHITECTURE OVERVIEW
In software engineering, the delegation pattern is a design pattern in object-oriented programming where an object, instead of performing one of its stated tasks, delegates that task to an associated helper object. There is an Inversion of Responsibility in which a helper object, known as a delegate, is given the responsibility to execute a task for the delegator. The delegation pattern is one of the fundamental abstraction patterns that underlie other software patterns. In iDoc we have used Delegate Design pattern. Struts action mapping is intercepted and appropriate action method is invoked from Dispatch Action class. Following design pattern is used: User inputs are validated first. If any validation error occurs appropriate exception is thrown and displayed to the user Delegate layer: A delegate method is invoked from dispatch action method and user input is passed for business validations and dao operations. Here multiple handlers are invoked according to user input and business rules Handler layer: This layer handles the incoming data from user and performs business rule validation. Here multiple handler methods. From here multiple DAO methods can be invoked.

Ecotech Consultants

Page 21

-Tools for Doctor Consultation

7. CODING
JSP Pages Code: index.jsp
Username field will be added in the following way:

<html:text property="username" name="LoginForm" value="" styleId="username" /> Password field will be added in the following way: <html:password property="Pwd" name="LoginForm" value="" styleId="Pwd" />
Category(Doctor or Patient) field will be added in the following way:

<html:radio property="category" value="DOCTOR" name="LoginForm" styleId="category" />


<html:radio property="category" value="PATIENT" name="LoginForm" styleId="category" /> Forgot Password Link will be added in the following way:

<a href="#" onclick="submitForm('forgetpassrord')"> Forget Password</a>


Login Button will be added in the following way:

<html:button property="LoginForm" onclick="submitForm('Login')">LOGIN</html:button>


New Doctor Link will be added in the following way:

<a href="#" onclick="submitForm('ForwardRegDoctorAction')"> New Doctor </a>


New Patient Link will be added in the following way:

<a href="#"onclick="submitForm('ForwardRegPatientAction')"> New Patient </a>

doctorReg.jsp
Username field will be added in the following way:

<html:text property="docUserName" name="DoctorForm" value="" styleId="docUserName"/>


Password field will be added in the following way:

Ecotech Consultants

Page 22

-Tools for Doctor Consultation


<html:password property="docPasswrd" name="DoctorForm" value="" styleId="docPasswrd" />
Confirm Password field will be added in the following way: <html:password property="docConfirmPassword" name="DoctorForm" value="" styleId="docConfirmPassword"/> Doctor First Name field will be added in the following way:

<html:text property="docFirstName" name="DoctorForm" value="" styleId="docFirstName"/>


Doctor Last Name field will be added in the following way:

<html:text property="docLastName" name="DoctorForm" value="" styleId="docLastName"/>


Gender field will be added in the following way:

<html:radio property="docGender" value="MALE" name="DoctorForm" styleId="docGender" /> <html:radio property="docGender" value="FEMALE" name="DoctorForm" styleId="docGender" />
Doctor Address Fields will be added in the following way:

<html:textarea property="docAddress" name="DoctorForm" cols="20" rows="4" value="" styleId="docAddress"/>


Doctor City Fields will be added in the following way:

<html:text property="docCity" name="DoctorForm" value="" styleId="docCity" />


Doctor State Fields will be added in the following way:

<html:text property="docState" name="DoctorForm" value="" styleId="docState" />


Doctor Designation field will be added in the following way:

<html:text property="docDesignation" name="DoctorForm" value="" styleId="docDesignation"/>


Doctor Specialty will be added in the following way:

<html:select property="docSpecialty" name="DoctorForm" styleId="docSpecialty">


Doctor Specialty will be added in the following way:

<html:text property="docContact" name="DoctorForm" value="" styleId="docContact" />


Doctors Contact No will be added in the following way: Page 23

Ecotech Consultants

-Tools for Doctor Consultation


<html:text property="docContact" name="DoctorForm" value="" styleId="docContact" />
Doctors E_mail Id will be added in the following way:

<html:text property="docMail" name="DoctorForm" value="" styleId="docMail" />


Save Button will be added in the following way:

<html:button property="DoctorForm" onclick="submitForm('save')">SAVE</html:button>


Edit Button will be added in the following way:

<html:button property="DoctorForm" onclick="submitForm('edit')">EDIT</html:button>


Cancel Button will be added in the following way:

<html:button property="DoctorForm" onclick="submitForm('cancel')">CANCEL</html:button>

Patient-reg.jsp
Username field will be added in the following way:
<html:text property="ptntusername" name="PatientForm" value="" styleId="ptntusername" />

Password field will be added in the following way:


<html:password property="ptntPwd" name=" PatientForm " value="" styleId=" ptntPwd " />

Confirm Password field will be added in the following way:


<html:password property="ptntConfirmPwd" name=" PatientForm " value="" styleId=" ptntConfirmPwd "/>

Patient First Name field will be added in the following way:


<html:text property="ptntFrstNm" name=" PatientForm " value="" styleId=" ptntFrstNm "/>

Patient Last Name field will be added in the following way:


<html:text property="ptntLstNm" name=" PatientForm " value="" styleId=" ptntLstNm "/>

Gender field will be added in the following way:


<td width="50%" valign="top">Male <html:radio property="ptntGender" value="M" styleId="ptntGenderm" /> Female <html:radio property="ptntGender" value="F" styleId="ptntGenderf" /></td>

Ecotech Consultants

Page 24

-Tools for Doctor Consultation

Patient Age Fields will be added in the following way:


<html:text property="ptntAge" name="PatientForm"
value="" styleId="ptntAge"/>

Patient Address Fields will be added in the following way:


<html:textarea property="ptntAddress" name="PatientForm" cols="20" rows="4" value="" styleId="ptntAddress"/>

Patient City Fields will be added in the following way:


<html:text property="ptntCity" name="PatientForm" value="" styleId="ptntCity"/>

Patient State Fields will be added in the following way:


<html:text property="ptntState" name="PatientForm" value="" styleId="ptntState"/>

Patient Zip Code field will be added in the following way:


<html:text property="ptntzip" name="PatientForm" value="" styleId="ptntzip"/>

Patients Contact No will be added in the following way:


<html:text property="ptntContact" name="PatientForm" value="" styleId="ptntContact"/>

Patients E_mail Id will be added in the following way:


<html:text property="ptntMail" name="PatientForm" value="" styleId="ptntMail"/>

Patient Zip Code field will be added in the following way:


<html:textarea property="ptntReasonOfVisit" name="PatientForm" cols="20" rows="4"value="" styleId="ptntReasonOfVisit"/>

Patient Zip Code field will be added in the following way:


<html:text property="ptntinsuranceid" name="PatientForm" value="" styleId="ptntinsuranceid" />

Save Button will be added in the following way:


<html:button property=" PatientForm " onclick="submitForm('save')">SAVE</html:button>

Edit Button will be added in the following way:


<html:button property=" PatientForm " onclick="submitForm('reset')">RESET</html:button>

Ecotech Consultants

Page 25

-Tools for Doctor Consultation

Cancel Button will be added in the following way:


<html:button property=" PatientForm " onclick="submitForm('cancel')">CANCEL</html:button>

patient-doctor-Search.jsp

Logout Link will be added in the following way:


<a href="#" onclick="submitForm('logOut')">Logout</a>

Update Link will be added in the following way:


<a href="#" >Update</a></td>

Search Link will be added in the following way:


<a href="#" onclick="submitForm('search')">Search</a>

Delete Link will be added in the following way:


<a href="#" onclick="submitForm('delete')">Delete</a>

Search by City Drop Down list will be added in the following way:
<td>City</td> <select name=DoctorForm property=selectedCity/>

<select> value="">Any State</option> value="1">Kolkata</option> value="2">Mumbai</option> </select>

<option <option <option

Search by Specialty Drop Down list will be added in the following way: <td> Specialty </td><select>
<option <option <option <option value="153">Find a Doctor by Specialty</option> value="132">Allergist (Immunologist)</option> value="105">Cardiologist (Heart Doctor)</option> value="98">Dentist</option></select>

Submit Button will be added in the following way:


<html:button property="DoctorForm" onclick="submitForm('submit')">Submit</html:button>

Ecotech Consultants

Page 26

-Tools for Doctor Consultation

doctor-profile.jsp
Username field will be added in the following way:
<html:text property="docUserName" name="DoctorProfileForm" value="" styleId="docUserName"/>

Password field will be added in the following way:


<html:password property="docPasswrd" name=" DoctorProfileForm" value="" styleId="docPasswrd" />

Practice name field will be added in the following way:


<html:text property="docPracticeName"name="DoctorProfileForm" value="" styleId=" docPracticeName " />

Registration date field will be added in the following way:


<html:text property="docDateofReg
name="DoctorProfileForm" styleId="docDateofReg" value="" />

Designation field will be added in the following way:


<html:text property="docDesignation" name="DoctorProfileForm"
styleId="docDesignation" value="" />

Doctor Certification field will be added in the following way:


<html:text property="doctorCertification" name="DoctorProfileForm" styleId="doctorCertification" value="" />

Doctor Hospital Affiliation field will be added in the following way:


<html:text property="doctorHospital" name="DoctorProfileForm"
styleId="doctorHospital" value="" />

Doctor Awards field will be added in the following way:


<html:text property="doctorAwards" name="DoctorProfileForm" styleId="doctorAwards" value="" />

Language field will be added in the following way:


<html:text property="doctorLanguage" name="DoctorProfileForm" styleId="doctorLanguage" value="" />

Doctor profile statement field will be added in the following way:


<html:text property="doctorStatement" name="DoctorProfileForm" styleId="doctorStatement" value="" />

Ecotech Consultants

Page 27

-Tools for Doctor Consultation

Doctor picture field will be added in the following way:


<html:text property="doctorPic" name="DoctorProfileForm"
styleId="doctorPic" value="" />

Doctor payment field will be added in the following way:


<html:text property="doctorPayment" name="DoctorProfileForm" styleId="doctorPayment" value="" />

Save button will be added in the following way:


<html:button property="DoctorProfileForm" onclick="submitForm('save')">SAVE</html:button>

Edit buttonwill be added in the following way:


<html:button property="DoctorForm"

onclick="submitForm('edit')">EDIT</html:button>

Cancel button will be added in the following way:


<html:button property="DoctorForm" onclick="submitForm('cancel')">CANCEL</html:button>

insurance-registration.jsp
Insurance company name field will be added in the following way:
<html:text property="inscompnm" name="InsuranceForm" value="" styleId="inscompnm" />

Insurance policy name field will be added in the following way:


<html:text property="inspolicynm" name="InsuranceForm" value="" styleId="inspolicynm" />

Person taking insurance field will be added in the following way:


<html:text property="inspersonnm" name="InsuranceForm" value="" styleId="inspersonnm" />

Persons age field will be added in the following way:


<html:text property="inspersonage" name="InsuranceForm" value="" styleId="inspersonage" readonly="" />

Policy start date field will be added in the following way:


<html:text property="inspolicystart" name="InsuranceForm" value=""styleId="inspolicystart" readonly="true" />

Ecotech Consultants

Page 28

-Tools for Doctor Consultation


Policy expiry date field will be added in the following way:
<html:text property="inspolicyexp"
name="InsuranceForm" value="" styleId="inspolicyexp" />

Policy renew date field will be added in the following way:


<html:text property="inspolicyren" name="InsuranceForm" value="" styleId="inspolicyren" />

Insurance agent name field will be added in the following way:


<html:text property="insagentnm" name="InsuranceForm" value="" styleId="insagentnm" />

Insurance cashless field will be added in the following way:


<html:text property="inscashless" name="InsuranceForm" value="" styleId="inscashless" />

Insurance amount field will be added in the following way:


<html:text property="insamount"
name="InsuranceForm" value="" styleId="insamount" />

Save button will be added in the following way:


<html:button property="InsuranceForm" onclick="submitForm('save')">SAVE</html:button>

Reset button will be added in the following way:


<html:button property="InsuranceForm" onclick="submitForm('cancel')">CANCEL</html:button>

Properties Resource Details: ApplicationResource:


Following keys will be added: #iHealth gender.label=Gender user.category.label=Category user.catDoc.label=Doctor user.catPat.label=Patient #Patient pattient.patientid.label=Patient Id patient.username.label=User Name patient.password.label=Password patient.confirmpassword.label=Confirm password patient.firstName.label=First Name Ecotech Consultants Page 29

-Tools for Doctor Consultation


patient.lastName.label=Last Name patient.address.label= Address patient.age.label=Age patient.city.label=City patient.state.label=State patient.zip.label=ZIP patient.contact.label=Contact No patient.mail.label=Mail Id patient.reasonofvisit.label=Reason patient.insuranceid.label=Insurance ID #login login.username.label=USER NAME login.password.label=PASSWORD login.email.label=EMAIL ID #insurance insurance.compname.label=Company Name insurance.policy.label=Policy Name insurance.personnm.label=Person Name insurance.personage.label=Person Age insurance.policyst.label=Policy Start insurance.policyexp.label=Policy Expire insurance.policyrenew.label=Policy Renew insurance.agentnm.label=Agent Name insurance.agentid.label=Agent ID insurance.cashless.label=Cashless insurance.amount.label=Amount insurance.claimdate.label=Claim Date insurance.claimamount.label=Claim Amount #errors #patient registration error error.ptntusername.null=User Name Should n't be Blank error.ptntusername.format=User Name Is Not Proper error.ptntPwd.null=Password Should n't be Blank error.ptntPwd.format=Password Is Not Proper error.ptntConfirmPwd.null=Confirm Password Should n't be Blank error.ptntConfirmPwd.format=Confirm Password Is Not Match with Password error.ptntFrstNm.null= First Name Should n't be Blank error.ptntFrstNm.format= First Name Is Not Proper error.ptntLstNm.null= Last Name Should n't be Blank error.ptntLstNm.format=Patient Last Name Is Not Proper error.ptntGender.null=Gender Should n't be Blank error.ptntGender.format=GenderIs Not Proper error.ptntAge.null= Age Should n't be Blank error.ptntAge.format=Age Is Not Proper error.ptntAddress.null=Address Should n't be Blank error.ptntAddress.format=Address Is Not Proper error.ptntCity.null=City Name Should n't be Blank error.ptntCity.format=City Is Not Proper error.ptntState.null= State Should n't be Blank Ecotech Consultants Page 30

-Tools for Doctor Consultation


error.ptntState.format= State Is Not Proper error.ptntzip.null= ZIP Code Should n't be Blank error.ptntzip.format= ZIP Is Not Proper error.ptntContact.null= Contact Number Should n't be Blank error.ptntContact.format= Contact Number Is Not Proper error.ptntMail.null= Email Should n't be Blank error.ptntMail.format= Email Is Not Proper error.ptntReasonOfVisit.null=Reason of visit Should n't be Blank error.ptntReasonOfVisit.format=Reason of visit Is Not Proper error.ptntinsuranceid.null=Insurance ID Should n't be Blank error.ptntinsuranceid.format=Insurance ID Is Not Proper #insurance registration error error.inscompnm.null= Company name should n't be Blank error.inscompnm.format= Company name Is Not proper error.inspolicynm.null= Policy name should n't be Blank error.inspolicynm.format= Policy name Is Not proper error.inspersonnm.null= Person name should n't be Blank error.inspersonnm.format= Person name Is Not proper error.inspersonage.null= Person age should n't be Blank error.inspersonage.format= Person age Is Not proper error.inspolicystart.null= Policy start date should n't be Blank error.inspolicystart.format= Policy start date Is Not proper error.inspolicyexp.null= Policy expiry date should n't be Blank error.inspolicyexp.format= Policy expiry date Is Not proper error.inspolicyren.null= Policy Renew date should n't be Blank error.inspolicyren.format= Policy Renew date Is Not proper error.insagentnm.null= Agent name date should n't be Blank error.insagentnm.format= Agent name Is Not proper error.insagentid.null= Agent ID should n't be Blank error.insagentid.format= Agent ID Is Not proper error.inscashless.null= Cashless should n't be Blank error.inscashless.format= Cashless Is Not proper error.insamount.null= Amount should n't be Blank error.insamount.format= Amount Is Not proper error.insclaimdt.null= Claim date should n't be Blank error.insclaimdt.format=Insurance Claim date Is Not proper error.insclaim.null=Insurance Claim amount should n't be Blank error.insclaim.format=Insurance Claim amount Is Not proper #doctor profile errors error.docUserName.null=Doctor UserName should n't be Blank error.docUserName.format=Doctor UserNameIs Not proper error.docPasswrd.null=Doctor Password should n't be Blank error.docPasswrd.format=Doctor Password Is Not proper error.docPracticeName.null=Doctor PracticeName should n't be Blank error.docPracticeName.format=Doctor PracticeName Is Not proper error.docDateofReg.null=Doctor DateofReg should n't be Blank error.docDateofReg.format=Doctor DateofReg Is Not proper error.docDesignation.null=Doctor Designation should n't be Blank error.docDesignation.format=Doctor Designation Is Not proper error.doctorCertification.null=Doctor Certification should n't be Blank error.doctorCertification.format=Doctor Certification Is Not proper Ecotech Consultants Page 31

-Tools for Doctor Consultation


error.doctorHospital.null=Doctor Hospital name should n't be Blank error.doctorHospital.format=Doctor Hospital name Is Not proper error.doctorAwards.null=Doctor Awards should n't be Blank error.doctorAwards.format=Doctor Awards Is Not proper error.doctorLanguage.null=Doctor Language should n't be Blank error.doctorLanguage.format=Doctor Language Is Not proper error.doctorStatement.null=Doctor Statement should n't be Blank error.doctorStatement.format=Doctor Statement Is Not proper error.doctorPic.null=Doctor Picture should be required error.doctorPic.format=Doctor Picture size should be less than 300 KB error.doctorPayment.null=Payment ID should n't be Blank error.doctorPayment.format=Payment ID Is Not proper #doctor registration error error.docFirstName.null= FirstName should n't be Blank error.docFirstName.format=FirstName Is Not proper error.docLastName.null=LastName should n't be Blank error.docLastName.format=LastName Is Not proper error.docAddress.null=Address should n't be Blank error.docAddress.format=Address Is Not proper error.docCity.null=City should n't be Blank error.docCityt.format=City Is Not proper error.docState.null=State should n't be Blank error.docState.format=State Is Not proper error.docContact.null=Contact Number should n't be Blank error.docContact.format=ContactNumber must be less than twelve characters error.docMail.null=Mail should n't be Blank error.docMail.format=Mail Is Not proper error.docSpecialty.null=Specialty should n't be Blank error.docSpecialty.format=Specialty Is Not proper error.docGender.null=Gender; should n't be Blank error.docGender.format=Gender; Is Not proper error.docDesignation.null=Designation should n't be Blank error.docDesignation.format=Designation Is Not proper error.docMessage.null=Message should n't be Blank error.docMessage.format=Message Is Not proper error.docUserName.null=UserName should n't be Blank error.docUserName.format=UserName Is Not proper error.docPasswrd.null=Password should n't be Blank error.docPasswrd.format=Password Is Not proper error.docConfirmPassword.null=ConfirmPassword should n't be Blank error.docConfirmPasswordformat=ConfirmPassword Is Not proper error.doctorid.null=doctor ID should n't be Blank error.doctorid.format=doctor ID Is Not proper error.doctorReg.null=Registration should n't be Blank error.doctorReg.format=Registration Is Not proper #--- Doctor--doctor.docFirstName.label=First Name doctor.docLastName.label=Last Name doctor.docAddress.label=Address doctor.docCity.label=City doctor.docState.label=State Ecotech Consultants Page 32

-Tools for Doctor Consultation


doctor.docContact.label=Contact doctor.docMail.label=Mail doctor.docDesignation.label=Designation doctor.docSpecialty.label=Specialty doctor.docGender.label=Gender doctor.docMale.label=Male doctor.docFemale.label=Female doctor.docMessage.label=Message doctor.docUserName.label=User Name doctor.docPasswrd.label=Password doctor.docConfirmPassword.label=Confirm Password doctor.doctorid.label=Doctor Id doctor.doctorReg.label=Doctor Registration ID doctor.docPracticeName.label=Practice Name doctor.docDateofReg.label=Registration Date doctor.docDesignation.label=Designation doctor.doctorBoardofCertification.label=Board of Certification doctor.doctorHospitalAffiliation.label=Hospital Affiliation doctor.doctorAwards.label=Awards doctor.doctorLanguage.label=Language Known doctor.doctorProfileStatement.label=Profile Statement doctor.doctorPic.label=Picture doctor.doctorPayAccount.label=Paypal A/C No

Form Pages Code: doctorForm.java


package com.ihealth.form; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.servlet.http.HttpServletRequest; import import import import import import org.apache.struts.action.ActionErrors; org.apache.struts.action.ActionForm; org.apache.struts.action.ActionMapping; org.apache.struts.action.ActionMessage; org.apache.struts.util.LabelValueBean; com.ihealth.common.ApplicationUtility;

public class DoctorForm extends ActionForm { private private private private


Ecotech Consultants

static String String String

final long serialVersionUID = 1L; docFirstName; docLastName; docAddress;


Page 33

-Tools for Doctor Consultation


private private private private private private private private private private private private private private private private private private private private private private private private private private private String String String String String String String String String String String String String String String String String String String String String String String String String String String docCity; docState; docContact; docMail; docSpecialty; docGender; docDesignation; docMessage; docUserName; docPasswrd; docConfirmPassword; doctorid; doctorReg; myaction; searchaction; usernameerror; pwderror; confpwderror; fstnmerror; lstnmerror; gendererror; designationerror; contacterror; mailerror; addrerror; cityerror; stateerror;

private List<LabelValueBean> spList; public List<LabelValueBean> getSpList() { return spList; } public void setSpList(List<LabelValueBean> spList) { this.spList = spList; } public String getDocGender() { return docGender; } public void setDocGender(String docGender) { this.docGender = docGender; } public String getDocFirstName() { return docFirstName; }
Ecotech Consultants Page 34

-Tools for Doctor Consultation


public void setDocFirstName(String docFirstName) { this.docFirstName = docFirstName; } public String getDocLastName() { return docLastName; } public void setDocLastName(String docLastName) { this.docLastName = docLastName; } public String getDocAddress() { return docAddress; } public void setDocAddress(String docAddress) { this.docAddress = docAddress; } public String getDocCity() { return docCity; } public void setDocCity(String docCity) { this.docCity = docCity; } public String getDocState() { return docState; } public void setDocState(String docState) { this.docState = docState; } public String getDocContact() { return docContact; } public void setDocContact(String docContact) { this.docContact = docContact; } public String getDocMail() { return docMail; } public void setDocMail(String docMail) { this.docMail = docMail;
Ecotech Consultants Page 35

-Tools for Doctor Consultation


} public String getDocSpecialty() { return docSpecialty; } public String getDocDesignation() { return docDesignation; } public void setDocMessage(String docMessage) { this.docMessage = docMessage; } public String getDocMessage() { return docMessage; } public void setDocPasswrd(String docPasswrd) { this.docPasswrd = docPasswrd; } public String getDocPasswrd() { return docPasswrd; } public void setDocConfirmPassword(String docConfirmPassword) { this.docConfirmPassword = docConfirmPassword; } public String getDocConfirmPassword() { return docConfirmPassword; } public void setDoctorid(String doctorid) { this.doctorid = doctorid; } public String getDoctorid() { return doctorid; } public void setDocUserName(String docUserName) { this.docUserName = docUserName; } public String getDocUserName() { return docUserName; }
Ecotech Consultants Page 36

-Tools for Doctor Consultation


public void setMyaction(String myaction) { this.myaction = myaction; } public String getMyaction() { return myaction; } public void setDoctorReg(String doctorReg) { this.doctorReg = doctorReg; } public String getDoctorReg() { return doctorReg; } public void setSearchaction(String searchaction) { this.searchaction = searchaction; } public String getSearchaction() { return searchaction; } public void setUsernameerror(String usernameerror) { this.usernameerror = usernameerror; } public String getUsernameerror() { return usernameerror; } public void setPwderror(String pwderror) { this.pwderror = pwderror; } public String getPwderror() { return pwderror; } public void setConfpwderror(String confpwderror) { this.confpwderror = confpwderror; } public String getConfpwderror() { return confpwderror; } public void setFstnmerror(String fstnmerror) { this.fstnmerror = fstnmerror;
Ecotech Consultants Page 37

-Tools for Doctor Consultation


} public String getFstnmerror() { return fstnmerror; } public void setLstnmerror(String lstnmerror) { this.lstnmerror = lstnmerror; } public String getLstnmerror() { return lstnmerror; } public void setGendererror(String gendererror) { this.gendererror = gendererror; } public String getGendererror() { return gendererror; } public void setDesignationerror(String designationerror) { this.designationerror = designationerror; } public String getDesignationerror() { return designationerror; } public void setContacterror(String contacterror) { this.contacterror = contacterror; } public String getContacterror() { return contacterror; } public void setMailerror(String mailerror) { this.mailerror = mailerror; } public String getMailerror() { return mailerror; } public void setAddrerror(String addrerror) { this.addrerror = addrerror; }
Ecotech Consultants Page 38

-Tools for Doctor Consultation

public String getAddrerror() { return addrerror; } public void setCityerror(String cityerror) { this.cityerror = cityerror; } public String getCityerror() { return cityerror; } public void setStateerror(String stateerror) { this.stateerror = stateerror; } public String getStateerror() { return stateerror; } @Override public ActionErrors validate(ActionMapping mapping, HttpServletRequest req) { ActionErrors err = super.validate(mapping, req); if (err == null) { err = new ActionErrors(); } if (getMyaction()!=null&&"save".equals(getMyaction())) { System.out.println("****************Calling Doctor Master vallidation************"); if (getDocUserName().isEmpty()) { err.add("docUserName", new ActionMessage( "error.docUserName.null")); } if (!getDocUserName().isEmpty()) { boolean i = ApplicationUtility .isStringWithNumeric(getDocUserName()); if (i == false) { err.add("docUserName", new ActionMessage( "error.docUserName.format"));
Ecotech Consultants Page 39

-Tools for Doctor Consultation


} } if (getDocPasswrd().isEmpty()) { err.add("docPasswrd", new ActionMessage("error.docPasswrd.null")); } if (!getDocPasswrd().isEmpty()) { boolean i = ApplicationUtility .isStringWithNumeric(getDocPasswrd()); if (i == false) { err.add("docPasswrd", new ActionMessage( "error.docPasswrd.format")); } } if (getDocConfirmPassword().isEmpty()) { err.add("docConfirmPassword", new ActionMessage( "error.docConfirmPassword.null")); } if (!getDocConfirmPassword().isEmpty()) { boolean i = ApplicationUtility.isPwdMatch(getDocPasswrd(), getDocConfirmPassword()); if (i == false) { err.add("ptntConfirmPwd", new ActionMessage( "error.ptntConfirmPwd.format")); } } if (getDocFirstName().isEmpty()) { err.add("docFirstName", new ActionMessage( "error.docFirstName.null")); } if (!getDocFirstName().isEmpty()) { if (!ApplicationUtility.isStringWithNumeric(getDocFirstName())) { err.add("docFirstName", new ActionMessage( "error.docFirstName.format")); } } if (getDocLastName().isEmpty()) { err.add("docLastName", new ActionMessage(
Ecotech Consultants Page 40

-Tools for Doctor Consultation


"error.docLastName.null")); } if (!getDocLastName().isEmpty()) { if (!ApplicationUtility.isStringWithNumeric(getDocLastName())) { err.add("docLastName", new ActionMessage( "error.docLastName.format")); } } if (getDocAddress().isEmpty()) { err.add("docAddress", new ActionMessage("error.docAddress.null")); } if (!getDocAddress().isEmpty()) { if (!ApplicationUtility.isStringWithNumeric(getDocAddress())) { err.add("docAddress", new ActionMessage( "error.docAddress.format")); } } if (getDocCity().isEmpty()) { err.add("docCity", new ActionMessage("error.docCity.null")); } if (!getDocCity().isEmpty()) { if (ApplicationUtility.isStringWithNumeric(getDocCity())) { err.add("docCity", new ActionMessage("error.docCity.format")); } } if (getDocState().isEmpty()) { err.add("docState", new ActionMessage("error.docState.null")); } System.out.println("sTATE111111111"); if (!getDocState().isEmpty()) { if (ApplicationUtility.isStringWithNumeric(getDocState())) { err.add("docState", new ActionMessage( "error.docState.format")); } } if (getDocDesignation() == null || getDocDesignation().isEmpty()) { err.add("docDesignation", new ActionMessage(
Ecotech Consultants Page 41

-Tools for Doctor Consultation


"error.docDesignation.null")); } if (!((getDocDesignation() == null) || !getDocDesignation() .isEmpty())) { if (ApplicationUtility.isStringWithNumeric(getDocDesignation())) { err.add("docDesignation", new ActionMessage( "error.docDesignation.format")); } } if (getDocContact().isEmpty()) { err.add("docContact", new ActionMessage("error.docContact.null")); } if (!getDocContact().isEmpty()) { if (ApplicationUtility.contactNumberChecking(getDocContact())) { err.add("docContact", new ActionMessage( "error.docContact.format")); } } if (getDocMail().isEmpty()) { err.add("docMail", new ActionMessage("error.docMail.null")); } if (!getDocMail().isEmpty()) { if (ApplicationUtility.eMailChecking(getDocMail())) { err.add("docMail", new ActionMessage("error.docMail.format")); } } System.out.println("END OF DOCTOR REGISTRATION"); } return err; } }

doctorProfileForm.java
package com.ihealth.form; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionErrors;
Ecotech Consultants Page 42

-Tools for Doctor Consultation


import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; import com.ihealth.common.ApplicationUtility; public class DoctorProfileForm extends ActionForm { private private private private private private private private private private private private private private static String String String String String String String String String String String String String final long serialVersionUID = 1L; docUserName; docPasswrd; docPracticeName; docDateofReg; docDesignation; doctorCertification; doctorHospital; doctorAwards; doctorLanguage; doctorStatement; doctorPic; doctorPayment; myaction;

public String getDocUserName() { return docUserName; } public void setDocUserName(String docUserName) { this.docUserName = docUserName; } public String getDocPasswrd() { return docPasswrd; } public void setDocPasswrd(String docPasswrd) { this.docPasswrd = docPasswrd; } public String getDocPracticeName() { return docPracticeName; } public void setDocPracticeName(String docPracticeName) { this.docPracticeName = docPracticeName; } public String getDocDateofReg() { return docDateofReg; }
Ecotech Consultants Page 43

-Tools for Doctor Consultation

public void setDocDateofReg(String docDateofReg) { this.docDateofReg = docDateofReg; } public String getDocDesignation() { return docDesignation; } public void setDocDesignation(String docDesignation) { this.docDesignation = docDesignation; } public String getDoctorCertification() { return doctorCertification; } public void setDoctorCertification(String doctorCertification) { this.doctorCertification = doctorCertification; } public String getDoctorHospital() { return doctorHospital; } public void setDoctorHospital(String doctorHospital) { this.doctorHospital = doctorHospital; } public String getDoctorAwards() { return doctorAwards; } public void setDoctorAwards(String doctorAwards) { this.doctorAwards = doctorAwards; } public String getDoctorLanguage() { return doctorLanguage; } public void setDoctorLanguage(String doctorLanguage) { this.doctorLanguage = doctorLanguage; } public String getDoctorStatement() { return doctorStatement; } public void setDoctorStatement(String doctorStatement) {
Ecotech Consultants Page 44

-Tools for Doctor Consultation


this.doctorStatement = doctorStatement; } public String getDoctorPic() { return doctorPic; } public void setDoctorPic(String doctorPic) { this.doctorPic = doctorPic; } public String getDoctorPayment() { return doctorPayment; } public void setDoctorPayment(String doctorPayment) { this.doctorPayment = doctorPayment; } public void setMyaction(String myaction) { this.myaction = myaction; } public String getMyaction() { return myaction; } @Override public ActionErrors validate(ActionMapping mapping, HttpServletRequest req) { ActionErrors err = super.validate(mapping, req); if (err == null) { err = new ActionErrors(); } if (getMyaction() != null && "save".equals(getMyaction())) { System.out.println("****************Calling Doctor profile vallidation************"); if (getDocUserName().isEmpty()) { err.add("docUserName", new ActionMessage( "error.ptntusername.null")); } if (!getDocUserName().isEmpty()) { boolean i = ApplicationUtility .isStringWithNumeric(getDocUserName()); if (i == false) {
Ecotech Consultants Page 45

-Tools for Doctor Consultation

err.add("docUserName", new ActionMessage( "error.docFirstName.format")); } } if (getDocPasswrd().isEmpty()) { err.add("docPasswrd", new ActionMessage("error.docPasswrd.null")); } if (!getDocPasswrd().isEmpty()) { boolean i = ApplicationUtility .isStringWithNumeric(getDocUserName()); if (i == false) { err.add("docPasswrd", new ActionMessage( "error.docPasswrd.format")); } } if (getDocPracticeName().isEmpty()) { err.add("docPracticeName", new ActionMessage( "error.docPracticeName.null")); } if (!getDocPracticeName().isEmpty()) { boolean i = ApplicationUtility .isStringWithNumeric(getDocPracticeName()); if (i == false) { err.add("docPracticeName", new ActionMessage( "error.docPracticeName.format")); } } if (getDocDateofReg().isEmpty()) { err.add("docDateofReg", new ActionMessage( "error.docDateofReg.null")); } if (!getDocDateofReg().isEmpty()) { boolean i = ApplicationUtility .isStringWithNumeric(getDocDateofReg()); if (i == false) { err.add("docDateofReg", new ActionMessage(
Ecotech Consultants Page 46

-Tools for Doctor Consultation


"error.docDateofReg.format")); } } if (getDoctorCertification().isEmpty()) { err.add("doctorCertification", new ActionMessage( "error.doctorCertification.null")); } if (!getDoctorCertification().isEmpty()) { boolean i = ApplicationUtility .isStringWithNumeric(getDoctorCertification()); if (i == false) { err.add("doctorCertificatione", new ActionMessage( "error.doctorCertification.format")); } } if (getDoctorHospital().isEmpty()) { err.add("doctorHospital", new ActionMessage( "error.doctorHospital.null")); } if (!getDoctorHospital().isEmpty()) { boolean i = ApplicationUtility .isStringWithNumeric(getDoctorHospital()); if (i == false) { err.add("doctorHospital", new ActionMessage( "error.doctorHospital.format")); } } if (getDoctorAwards().isEmpty()) { err.add("doctorAwards", new ActionMessage( "error.doctorAwards.null")); } if (!getDoctorAwards().isEmpty()) { boolean i = ApplicationUtility .isStringWithNumeric(getDoctorAwards()); if (i == false) { err.add("doctorAwards", new ActionMessage( "error.doctorAwards.format"));
Ecotech Consultants Page 47

-Tools for Doctor Consultation


} } if (getDoctorLanguage().isEmpty()) { err.add("doctorLanguage", new ActionMessage( "error.doctorLanguage.null")); } if (!getDoctorLanguage().isEmpty()) { boolean i = ApplicationUtility .isStringWithNumeric(getDoctorLanguage()); if (i == false) { err.add("doctorLanguage", new ActionMessage( "error.doctorLanguage.format")); } } if (getDoctorStatement().isEmpty()) { err.add("doctorStatement", new ActionMessage( "error.doctorStatement.null")); } if (!getDoctorStatement().isEmpty()) { boolean i = ApplicationUtility .isStringWithNumeric(getDoctorStatement()); if (i == false) { err.add("doctorStatement", new ActionMessage( "error.doctorStatement.format")); } } if (getDoctorPayment().isEmpty()) { err.add("doctorPayment", new ActionMessage( "error.doctorPayment.null")); } if (!getDoctorPayment().isEmpty()) { boolean i = ApplicationUtility .isStringWithNumeric(getDoctorPayment()); if (i == false) { err.add("doctorPayment", new ActionMessage( "error.doctorPayment.format")); }
Ecotech Consultants Page 48

-Tools for Doctor Consultation


} if (getDocDesignation() == null || getDocDesignation().isEmpty()) { err.add("docDesignation", new ActionMessage( "error.docDesignation.null")); } if (!((getDocDesignation()== null) || !getDocDesignation().isEmpty())) { boolean i = ApplicationUtility .isStringWithNumeric(getDocDesignation()); if (i == false) { err.add("docDesignation", new ActionMessage( "error.docDesignation.format")); } } } return err; } }

patientForm.java
package com.ihealth.form; import javax.servlet.http.HttpServletRequest; import import import import org.apache.struts.action.ActionErrors; org.apache.struts.action.ActionForm; org.apache.struts.action.ActionMapping; org.apache.struts.action.ActionMessage;

import com.ihealth.common.ApplicationUtility; public class PatientForm extends ActionForm { private static final long serialVersionUID = 1L; private private private private private private private private private private String String String String String String String String String String ptntId; ptntusername; ptntPwd; ptntConfirmPwd; ptntFrstNm; ptntLstNm; ptntGender; ptntAge; ptntAddress; ptntCity;
Page 49

Ecotech Consultants

-Tools for Doctor Consultation


private private private private private private private private private private private private private private private private private private private private private private private String String String String String String String String String String String String String String String String String String String String String String String ptntState; ptntzip; ptntContact; ptntMail; ptntReasonOfVisit; ptntinsuranceid; myaction; mssg; usernameerror; pwderror; confpwderror; fstnmerror; lstnmerror; gendererror; ageerror; addrerror; cityerror; stateerror; ziperror; contacterror; mailerror; reasonerror; insuerror;

public String getPtntId() { return ptntId; } public void setPtntId(String ptntId) { this.ptntId = ptntId; } public String getPtntusername() { return ptntusername; } public void setPtntusername(String ptntusername) { this.ptntusername = ptntusername; } public String getPtntPwd() { return ptntPwd; } public void setPtntPwd(String ptntPwd) { this.ptntPwd = ptntPwd; } public String getPtntConfirmPwd() { return ptntConfirmPwd;
Ecotech Consultants Page 50

-Tools for Doctor Consultation


} public void setPtntConfirmPwd(String ptntConfirmPwd) { this.ptntConfirmPwd = ptntConfirmPwd; } public String getPtntFrstNm() { return ptntFrstNm; } public void setPtntFrstNm(String ptntFrstNm) { this.ptntFrstNm = ptntFrstNm; } public String getPtntLstNm() { return ptntLstNm; } public void setPtntLstNm(String ptntLstNm) { this.ptntLstNm = ptntLstNm; } public String getPtntGender() { return ptntGender; } public void setPtntGender(String ptntGender) { this.ptntGender = ptntGender; } public String getPtntAge() { return ptntAge; } public void setPtntAge(String ptntAge) { this.ptntAge = ptntAge; } public String getPtntAddress() { return ptntAddress; } public void setPtntAddress(String ptntAddress) { this.ptntAddress = ptntAddress; } public String getPtntCity() { return ptntCity; }
Ecotech Consultants Page 51

-Tools for Doctor Consultation


public void setPtntCity(String ptntCity) { this.ptntCity = ptntCity; } public String getPtntState() { return ptntState; } public void setPtntState(String ptntState) { this.ptntState = ptntState; } public String getPtntzip() { return ptntzip; } public void setPtntzip(String ptntzip) { this.ptntzip = ptntzip; } public String getPtntContact() { return ptntContact; } public void setPtntContact(String ptntContact) { this.ptntContact = ptntContact; } public String getPtntMail() { return ptntMail; } public void setPtntMail(String ptntMail) { this.ptntMail = ptntMail; } public String getPtntReasonOfVisit() { return ptntReasonOfVisit; } public void setPtntReasonOfVisit(String ptntReasonOfVisit) { this.ptntReasonOfVisit = ptntReasonOfVisit; } public String getMyaction() { return myaction; } public void setMyaction(String myaction) { this.myaction = myaction;
Ecotech Consultants Page 52

-Tools for Doctor Consultation


} public String getMssg() { return mssg; } public void setMssg(String mssg) { this.mssg = mssg; } public String getUsernameerror() { return usernameerror; } public void setUsernameerror(String usernameerror) { this.usernameerror = usernameerror; } public String getPwderror() { return pwderror; } public void setPwderror(String pwderror) { this.pwderror = pwderror; } public String getConfpwderror() { return confpwderror; } public void setConfpwderror(String confpwderror) { this.confpwderror = confpwderror; } public String getFstnmerror() { return fstnmerror; } public void setFstnmerror(String fstnmerror) { this.fstnmerror = fstnmerror; } public String getLstnmerror() { return lstnmerror; } public void setLstnmerror(String lstnmerror) { this.lstnmerror = lstnmerror; }
Ecotech Consultants Page 53

-Tools for Doctor Consultation


public String getGendererror() { return gendererror; } public void setGendererror(String gendererror) { this.gendererror = gendererror; } public String getAgeerror() { return ageerror; } public void setAgeerror(String ageerror) { this.ageerror = ageerror; } public String getAddrerror() { return addrerror; } public void setAddrerror(String addrerror) { this.addrerror = addrerror; } public String getCityerror() { return cityerror; } public void setCityerror(String cityerror) { this.cityerror = cityerror; } public String getStateerror() { return stateerror; } public void setStateerror(String stateerror) { this.stateerror = stateerror; } public String getZiperror() { return ziperror; } public void setZiperror(String ziperror) { this.ziperror = ziperror; } public String getContacterror() { return contacterror;
Ecotech Consultants Page 54

-Tools for Doctor Consultation


} public void setContacterror(String contacterror) { this.contacterror = contacterror; } public String getMailerror() { return mailerror; } public void setMailerror(String mailerror) { this.mailerror = mailerror; } public String getReasonerror() { return reasonerror; } public void setReasonerror(String reasonerror) { this.reasonerror = reasonerror; } public void setPtntinsuranceid(String ptntinsuranceid) { this.ptntinsuranceid = ptntinsuranceid; } public String getPtntinsuranceid() { return ptntinsuranceid; } public void setInsuerror(String insuerror) { this.insuerror = insuerror; } public String getInsuerror() { return insuerror; } @Override public ActionErrors validate(ActionMapping mapping, HttpServletRequest req) { ActionErrors err = super.validate(mapping, req); if (err == null) { err = new ActionErrors(); } if (getMyaction() != null && "save".equals(getMyaction())) {

Ecotech Consultants

Page 55

-Tools for Doctor Consultation


System.out.println("****************Calling Patient vallidation************"); if (getPtntusername().isEmpty()) { err.add("ptntusername", new ActionMessage( "error.ptntusername.null")); } if (!getPtntusername().isEmpty()) { boolean i = ApplicationUtility .isStringWithNumeric(getPtntusername()); if (i == false) { err.add("ptntusername", new ActionMessage( "error.ptntusername.format")); } } if (getPtntPwd().isEmpty()) { err.add("ptntPwd", new ActionMessage( "error.ptntPwd.null")); } if (!getPtntPwd().isEmpty()) { boolean i = ApplicationUtility .isStringWithNumeric(getPtntPwd()); if (i == false) { err.add("ptntPwd", new ActionMessage( "error.ptntPwd.format")); } } if (getPtntConfirmPwd().isEmpty()) { err.add("ptntConfirmPwd", new ActionMessage( "error.ptntConfirmPwd.null")); } if (!getPtntConfirmPwd().isEmpty()) { boolean i = ApplicationUtility .isPwdMatch(getPtntPwd(),getPtntConfirmPwd()); if (i == false) { err.add("ptntConfirmPwd", new ActionMessage( "error.ptntConfirmPwd.format")); } }
Ecotech Consultants Page 56

Master

-Tools for Doctor Consultation


if (getPtntFrstNm().isEmpty()) { err.add("ptntFrstNm", new ActionMessage( "error.ptntFrstNm.null")); } if (!getPtntFrstNm().isEmpty()) { boolean i = ApplicationUtility .isStringWith(getPtntFrstNm()); if (i == false) { err.add("ptntFrstNm", new ActionMessage( "error.ptntFrstNm.format")); } } if (getPtntLstNm().isEmpty()) { err.add("ptntLstNm", new ActionMessage( "error.ptntLstNm.null")); } if (!getPtntLstNm().isEmpty()) { boolean i = ApplicationUtility .isStringWith(getPtntLstNm()); if (i == false) { err.add("ptntLstNm", new ActionMessage( "error.ptntLstNm.format")); } } if (getPtntAge().isEmpty()) { err.add("ptntAge", new ActionMessage( "error.ptntAge.null")); } if (!getPtntAge().isEmpty()) { boolean i = ApplicationUtility .isNumeric(getPtntAge()); if (i == false) { err.add("ptntAge", new ActionMessage( "error.ptntAge.format")); } } if (getPtntAddress().isEmpty()) { err.add("ptntAddress", new ActionMessage( "error.ptntAddress.null")); }
Ecotech Consultants Page 57

-Tools for Doctor Consultation


if (!getPtntAddress().isEmpty()) { boolean i = ApplicationUtility .isStringWithNumeric(getPtntAddress()); if (i == false) { err.add("ptntAddress", new ActionMessage( "error.ptntAddress.format")); } } if (getPtntCity().isEmpty()) { err.add("ptntCity", new ActionMessage( "error.ptntCity.null")); } if (!getPtntCity().isEmpty()) { boolean i = ApplicationUtility .isStringWith(getPtntCity()); if (i == false) { err.add("ptntCity", new ActionMessage( "error.ptntCity.format")); } } if (getPtntState().isEmpty()) { err.add("ptntState", new ActionMessage( "error.ptntState.null")); } if (!getPtntState().isEmpty()) { boolean i = ApplicationUtility .isStringWith(getPtntState()); if (i == false) { err.add("ptntState", new ActionMessage( "error.ptntState.format")); } } if (getPtntzip().isEmpty()) { err.add("ptntzip", new ActionMessage( "error.ptntState.null")); } if (!getPtntzip().isEmpty()) { boolean i = ApplicationUtility .zipChecking(getPtntzip()); if (i == false) {
Ecotech Consultants Page 58

-Tools for Doctor Consultation


err.add("ptntzip", new ActionMessage( "error.ptntzip.format")); } } if (getPtntContact().isEmpty()) { err.add("ptntContact", new ActionMessage( "error.ptntContact.null")); } if (!getPtntContact().isEmpty()) { boolean i = ApplicationUtility .contactNumberChecking(getPtntContact()); if (i == false) { err.add("ptntContact", new ActionMessage( "error.ptntContact.format")); } } if (getPtntMail().isEmpty()) { err.add("ptntMail", new ActionMessage( "error.ptntMail.null")); } if (!getPtntMail().isEmpty()) { boolean i = ApplicationUtility .eMailChecking(getPtntMail()); if (i == false) { err.add("ptntMail", new ActionMessage( "error.ptntMail.format")); } } if (getPtntReasonOfVisit().isEmpty()) { err.add("ptntReasonOfVisit", new ActionMessage( "error.ptntReasonOfVisit.null")); } if (!getPtntReasonOfVisit().isEmpty()) { boolean i = ApplicationUtility .isStringWith(getPtntReasonOfVisit()); if (i == false) { err.add("ptntReasonOfVisit", new ActionMessage( "error.ptntReasonOfVisit.format")); } }
Ecotech Consultants Page 59

-Tools for Doctor Consultation


if (getPtntinsuranceid().isEmpty()) { err.add("ptntinsuranceid", new ActionMessage( "error.ptntinsuranceid.null")); } if (!getPtntinsuranceid().isEmpty()) { boolean i = ApplicationUtility .isStringWithNumeric(getPtntinsuranceid()); if (i == false) { err.add("ptntinsuranceid", new ActionMessage( "error.ptntinsuranceid.format")); } } System.out.println(">>>>>>>>>>>"); } return err; } }

loginForm.java
package com.ihealth.form; import org.apache.struts.action.ActionForm; public class LoginForm extends ActionForm{

private static final long serialVersionUID = 1L; private private private private String String String String username; pwd; myaction; category;

public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPwd() { return pwd; } public void setPwd(String pwd) { this.pwd = pwd; } public String getMyaction() { return myaction; } public void setMyaction(String myaction) { this.myaction = myaction; Ecotech Consultants Page 60

-Tools for Doctor Consultation


} public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } public static long getSerialversionuid() { return serialVersionUID; } }

InsuranceForm.java
package com.ihealth.form; import javax.servlet.http.HttpServletRequest; import import import import org.apache.struts.action.ActionErrors; org.apache.struts.action.ActionForm; org.apache.struts.action.ActionMapping; org.apache.struts.action.ActionMessage;

import com.ihealth.common.ApplicationUtility; public class InsuranceForm extends ActionForm { private private private private private private private private private private private private private private private private private private private private private private private private private private private static String String String String String String String String String String String String String String String String String String String String String String String String String String final long serialVersionUID = 1L; inscompnm; inspolicynm; inspersonnm; inspersonage; inspolicystart; inspolicyexp; inspolicyren; insagentnm; insagentid; inscashless; insamount; insclaimdt; insclaim; myaction; inscompnmerror; inspolicyerror; inspersonerror; inspersonageerror; insstarterror; insexperror; insreneweerror; insagentnmerror; insagentiderror; inscashlesserror; insamounterror; insclaimdterror; Page 61

Ecotech Consultants

-Tools for Doctor Consultation


private String insclaimerror; public String getInscompnm() { return inscompnm; } public void setInscompnm(String inscompnm) { this.inscompnm = inscompnm; } public String getInspolicynm() { return inspolicynm; } public void setInspolicynm(String inspolicynm) { this.inspolicynm = inspolicynm; } public String getInspersonnm() { return inspersonnm; } public void setInspersonnm(String inspersonnm) { this.inspersonnm = inspersonnm; } public String getInspersonage() { return inspersonage; } public void setInspersonage(String inspersonage) { this.inspersonage = inspersonage; } public String getInspolicystart() { return inspolicystart; } public void setInspolicystart(String inspolicystart) { this.inspolicystart = inspolicystart; } public String getInspolicyexp() { return inspolicyexp; } public void setInspolicyexp(String inspolicyexp) { this.inspolicyexp = inspolicyexp; } public String getInspolicyren() { return inspolicyren; }

Ecotech Consultants

Page 62

-Tools for Doctor Consultation


public void setInspolicyren(String inspolicyren) { this.inspolicyren = inspolicyren; } public String getInsagentnm() { return insagentnm; } public void setInsagentnm(String insagentnm) { this.insagentnm = insagentnm; } public String getInsagentid() { return insagentid; } public void setInsagentid(String insagentid) { this.insagentid = insagentid; } public String getInsamount() { return insamount; } public void setInsamount(String insamount) { this.insamount = insamount; } public String getInsclaimdt() { return insclaimdt; } public void setInsclaimdt(String insclaimdt) { this.insclaimdt = insclaimdt; } public String getInsclaim() { return insclaim; } public void setInsclaim(String insclaim) { this.insclaim = insclaim; } public String getMyaction() { return myaction; } public void setMyaction(String myaction) { this.myaction = myaction; } public String getInscompnmerror() { return inscompnmerror; } public void setInscompnmerror(String inscompnmerror) { this.inscompnmerror = inscompnmerror; Ecotech Consultants Page 63

-Tools for Doctor Consultation


} public String getInspolicyerror() { return inspolicyerror; } public void setInspolicyerror(String inspolicyerror) { this.inspolicyerror = inspolicyerror; } public String getInspersonerror() { return inspersonerror; } public void setInspersonerror(String inspersonerror) { this.inspersonerror = inspersonerror; } public String getInspersonageerror() { return inspersonageerror; } public void setInspersonageerror(String inspersonageerror) { this.inspersonageerror = inspersonageerror; } public String getInsstarterror() { return insstarterror; } public void setInsstarterror(String insstarterror) { this.insstarterror = insstarterror; } public String getInsexperror() { return insexperror; } public void setInsexperror(String insexperror) { this.insexperror = insexperror; } public String getInsagentnmerror() { return insagentnmerror; } public void setInsagentnmerror(String insagentnmerror) { this.insagentnmerror = insagentnmerror; } public String getInsagentiderror() { return insagentiderror; } public void setInsagentiderror(String insagentiderror) { this.insagentiderror = insagentiderror; } Ecotech Consultants Page 64

-Tools for Doctor Consultation

public String getInscashlesserror() { return inscashlesserror; } public void setInscashlesserror(String inscashlesserror) { this.inscashlesserror = inscashlesserror; } public String getInsamounterror() { return insamounterror; } public void setInsamounterror(String insamounterror) { this.insamounterror = insamounterror; } public String getInsclaimdterror() { return insclaimdterror; } public void setInsclaimdterror(String insclaimdterror) { this.insclaimdterror = insclaimdterror; } public String getInsclaimerror() { return insclaimerror; } public void setInsclaimerror(String insclaimerror) { this.insclaimerror = insclaimerror; } public void setInsreneweerror(String insreneweerror) { this.insreneweerror = insreneweerror; } public String getInsreneweerror() { return insreneweerror; } @Override public ActionErrors validate(ActionMapping mapping, HttpServletRequest req) { ActionErrors err = super.validate(mapping, req); if (err == null) { err = new ActionErrors(); } if (getMyaction() != null && "save".equals(getMyaction())) { System.out .println("****************Calling Insurance vallidation************"); Ecotech Consultants Master

Page 65

-Tools for Doctor Consultation

if (getInscompnm().isEmpty()) { err.add("inscompnm", new ActionMessage( "error.inscompnm.null")); } if (!getInscompnm().isEmpty()) { boolean i = ApplicationUtility .isStringWith(getInscompnm()); if (i == false) { err.add("inscompnm", new ActionMessage( "error.inscompnm.format")); } }

if (getInspolicynm().isEmpty()) { err.add("inspolicynm", new ActionMessage( "error.inspolicynm.null")); } if (!getInspolicynm().isEmpty()) { boolean i = ApplicationUtility .isStringWith(getInspolicynm()); if (i == false) { err.add("inspolicynm", new ActionMessage( "error.inspolicynm.format")); } } if (getInspersonnm().isEmpty()) { err.add("inspersonnm", new ActionMessage( "error.inspersonnm.null")); } if (!getInspersonnm().isEmpty()) { boolean i = ApplicationUtility .isStringWith(getInspersonnm()); if (i == false) { err.add("inspersonnm", new ActionMessage( "error.inspersonnm.format")); } } if (getInspersonage().isEmpty()) { err.add("inspersonage", new ActionMessage( Ecotech Consultants Page 66

-Tools for Doctor Consultation


"error.inspersonage.null")); } if (!getInspersonage().isEmpty()) { boolean i = ApplicationUtility .isNumeric(getInspersonage()); if (i == false) { err.add("inspersonage", new ActionMessage( "error.inspersonage.format")); } } if (getInspolicystart().isEmpty()) { err.add("inspolicystart", new ActionMessage( "error.inspolicystart.null")); } if (!getInspolicystart().isEmpty()) { boolean i = ApplicationUtility .dateChecking(getInspolicystart()); if (i == false) { err.add("inspolicystart", new ActionMessage( "error.inspolicystart.format")); } } if (getInspolicyexp().isEmpty()) { err.add("inspolicyexp", new ActionMessage( "error.inspolicyexp.null")); } if (!getInspolicyexp().isEmpty()) { boolean i = ApplicationUtility .dateChecking(getInspolicyexp()); if (i == false) { err.add("inspolicyexp", new ActionMessage( "error.inspolicyexp.format")); } } if (getInspolicyren().isEmpty()) { err.add("inspolicyren", new ActionMessage( "error.inspolicyren.null")); } if (!getInspolicyren().isEmpty()) { boolean i = ApplicationUtility .dateChecking(getInspolicyren()); if (i == false) { err.add("inspolicyren", new ActionMessage( "error.inspolicyexp.format")); Ecotech Consultants Page 67

-Tools for Doctor Consultation

} } if (getInsagentnm().isEmpty()) { err.add("insagentnm", new ActionMessage( "error.insagentnm.null")); } if (!getInsagentnm().isEmpty()) { boolean i = ApplicationUtility .isStringWith(getInsagentnm()); if (i == false) { err.add("insagentnm", new ActionMessage( "error.insagentnm.format")); } } if (getInsagentid().isEmpty()) { err.add("insagentid", new ActionMessage( "error.insagentid.null")); } if (!getInsagentid().isEmpty()) { boolean i = ApplicationUtility .isStringWith(getInsagentid()); if (i == false) { err.add("insagentid", new ActionMessage( "error.insagentid.format")); } } if (getInsamount().isEmpty()) { err.add("insamount", new ActionMessage( "error.insamount.null")); } if (!getInsamount().isEmpty()) { boolean i = ApplicationUtility .isNumeric(getInsamount()); if (i == false) { err.add("insamount", new ActionMessage( "error.insamount.format")); } } if (getInsclaimdt().isEmpty()) { err.add("insclaimdt", new ActionMessage( "error.insclaimdt.null")); }

Ecotech Consultants

Page 68

-Tools for Doctor Consultation


if (!getInsclaimdt().isEmpty()) { boolean i = ApplicationUtility .dateChecking(getInsclaimdt()); if (i == false) { err.add("insclaimdt", new ActionMessage( "error.insclaimdt.format")); } } if (getInsclaim().isEmpty()) { err.add("insclaim", new ActionMessage( "error.insclaim.null")); } if (!getInsclaim().isEmpty()) { boolean i = ApplicationUtility .isNumeric(getInsclaim()); if (i == false) { err.add("insclaim", new ActionMessage( "error.insclaim.format")); } } } return err; } }

DTO Pages Code: Doctordto.java


package com.ihealth.dto; public class DoctorDto { private static final long serialVersionUID = 1L; private String docFirstName; private String docLastName; private String docAddress; private String docCity; private String docState; private String docContact; private String docMail; Ecotech Consultants Page 69

-Tools for Doctor Consultation


private String docSpecialty; private String docGender; private String docDesignation; private String docMessage; private String docUserName; private String docPasswrd; private String docConfirmPassword; private String doctorid; private String doctorReg; private String myaction; private String searchaction; private String usernameerror; private String pwderror; private String confpwderror; private String fstnmerror; private String lstnmerror; private String gendererror; private String designationerror; private String contacterror; private String mailerror; private String addrerror; private String cityerror; private String stateerror; public String getSearchaction() { return searchaction; } public void setSearchaction(String searchaction) { Ecotech Consultants Page 70

-Tools for Doctor Consultation


this.searchaction = searchaction; } public String getUsernameerror() { return usernameerror; } public void setUsernameerror(String usernameerror) { this.usernameerror = usernameerror; } public String getPwderror() { return pwderror; } public void setPwderror(String pwderror) { this.pwderror = pwderror; } public String getConfpwderror() { return confpwderror; } public void setConfpwderror(String confpwderror) { this.confpwderror = confpwderror; } public String getFstnmerror() { return fstnmerror; } public void setFstnmerror(String fstnmerror) { this.fstnmerror = fstnmerror; } public String getLstnmerror() { Ecotech Consultants Page 71

-Tools for Doctor Consultation


return lstnmerror; } public void setLstnmerror(String lstnmerror) { this.lstnmerror = lstnmerror; } public String getGendererror() { return gendererror; } public void setGendererror(String gendererror) { this.gendererror = gendererror; } public String getDesignationerror() { return designationerror; } public void setDesignationerror(String designationerror) { this.designationerror = designationerror; } public String getContacterror() { return contacterror; } public void setContacterror(String contacterror) { this.contacterror = contacterror; } public String getMailerror() { return mailerror; } public void setMailerror(String mailerror) { Ecotech Consultants Page 72

-Tools for Doctor Consultation


this.mailerror = mailerror; } public String getAddrerror() { return addrerror; } public void setAddrerror(String addrerror) { this.addrerror = addrerror; } public String getCityerror() { return cityerror; } public void setCityerror(String cityerror) { this.cityerror = cityerror; } public String getStateerror() { return stateerror; } public void setStateerror(String stateerror) { this.stateerror = stateerror; } public String getDocGender() { return docGender; } public void setDocGender(String docGender) { this.docGender = docGender; } private String docDegree; Ecotech Consultants Page 73

-Tools for Doctor Consultation


public String getDocDegree() { return docDegree; } public void setDocDegree(String docDegree) { this.docDegree = docDegree; } public String getDocFirstName() { return docFirstName; } public void setDocFirstName(String docFirstName) { this.docFirstName = docFirstName; } public String getDocLastName() { return docLastName; } public void setDocLastName(String docLastName) { this.docLastName = docLastName; } public String getDocAddress() { return docAddress; } public void setDocAddress(String docAddress) { this.docAddress = docAddress; } public String getDocCity() { return docCity; } Ecotech Consultants Page 74

-Tools for Doctor Consultation


public void setDocCity(String docCity) { this.docCity = docCity; } public String getDocState() { return docState; } public void setDocState(String docState) { this.docState = docState; } public String getDocContact() { return docContact; } public void setDocContact(String docContact) { this.docContact = docContact; } public String getDocMail() { return docMail; } public void setDocMail(String docMail) { this.docMail = docMail; } public String getDocSpecialty() { return docSpecialty; } public void setDocSpecialty(String docSpecialty) { this.docSpecialty = docSpecialty; } Ecotech Consultants Page 75

-Tools for Doctor Consultation


public void setDocDesignation(String docDesignation) { this.docDesignation = docDesignation; } public String getDocDesignation() { return docDesignation; } public void setDocMessage(String docMessage) { this.docMessage = docMessage; } public String getDocMessage() { return docMessage; } public void setDocPasswrd(String docPasswrd) { this.docPasswrd = docPasswrd; } public String getDocPasswrd() { return docPasswrd; } public void setDocConfirmPassword(String docConfirmPassword) { this.docConfirmPassword = docConfirmPassword; } public String getDocConfirmPassword() { return docConfirmPassword; } public void setDoctorid(String doctorid) { this.doctorid = doctorid; } Ecotech Consultants Page 76

-Tools for Doctor Consultation


public String getDoctorid() { return doctorid; } public void setDocUserName(String docUserName) { this.docUserName = docUserName; } public String getDocUserName() { return docUserName; } public void setMyaction(String myaction) { this.myaction = myaction; } public String getMyaction() { return myaction; } public void setDoctorReg(String doctorReg) { this.doctorReg = doctorReg; } public String getDoctorReg() { return doctorReg; } public static long getSerialversionuid() { return serialVersionUID; } }

DoctorProfiledto.java
package com.ihealth.dto; Ecotech Consultants Page 77

-Tools for Doctor Consultation

public class DoctorProfileDto { private static final long serialVersionUID = 1L; private String docUserName; private String docPasswrd; private String docPracticeName; private String docDateofReg; private String docDesignation; private String doctorCertification; private String doctorHospital; private String doctorAwards; private String doctorLanguage; private String doctorStatement; private String doctorPic; private String doctorPayment; public String getDocUserName() { return docUserName; } public void setDocUserName(String docUserName) { this.docUserName = docUserName; } public String getDocPasswrd() { return docPasswrd; } public void setDocPasswrd(String docPasswrd) { this.docPasswrd = docPasswrd; } public String getDocPracticeName() { return docPracticeName; } public void setDocPracticeName(String docPracticeName) { this.docPracticeName = docPracticeName; } public String getDocDateofReg() { return docDateofReg; } public void setDocDateofReg(String docDateofReg) { this.docDateofReg = docDateofReg; } public String getDocDesignation() { return docDesignation; } public void setDocDesignation(String docDesignation) { this.docDesignation = docDesignation; } public String getDoctorCertification() { return doctorCertification; } public void setDoctorCertification(String doctorCertification) { this.doctorCertification = doctorCertification; } public String getDoctorHospital() { return doctorHospital; } Ecotech Consultants Page 78

-Tools for Doctor Consultation


public void setDoctorHospital(String doctorHospital) { this.doctorHospital = doctorHospital; } public String getDoctorAwards() { return doctorAwards; } public void setDoctorAwards(String doctorAwards) { this.doctorAwards = doctorAwards; } public String getDoctorLanguage() { return doctorLanguage; } public void setDoctorLanguage(String doctorLanguage) { this.doctorLanguage = doctorLanguage; } public String getDoctorStatement() { return doctorStatement; } public void setDoctorStatement(String doctorStatement) { this.doctorStatement = doctorStatement; } public String getDoctorPic() { return doctorPic; } public void setDoctorPic(String doctorPic) { this.doctorPic = doctorPic; } public String getDoctorPayment() { return doctorPayment; } public void setDoctorPayment(String doctorPayment) { this.doctorPayment = doctorPayment; } }

DoctorProfiledto.java
package com.ihealth.dto; public class PatientDto { private static final long serialVersionUID = 1L; private String ptntId; private String ptntusername; private String ptntPwd; private String ptntConfirmPwd; private String ptntFrstNm; Ecotech Consultants Page 79

-Tools for Doctor Consultation


private String ptntLstNm; private String ptntGender; private String ptntAge; private String ptntAddress; private String ptntCity; private String ptntState; private String ptntzip; private String ptntContact; private String ptntMail; private String ptntReasonOfVisit; private String ptntinsuranceid; private String myaction; private String mssg; private String usernameerror; private String pwderror; private String confpwderror; private String fstnmerror; private String lstnmerror; private String gendererror; private String ageerror; private String addrerror; private String cityerror; private String stateerror; private String ziperror; private String contacterror; private String mailerror; private String reasonerror; Ecotech Consultants Page 80

-Tools for Doctor Consultation


private String insuerror; public String getPtntId() { return ptntId; } public void setPtntId(String ptntId) { this.ptntId = ptntId; } public String getPtntusername() { return ptntusername; } public void setPtntusername(String ptntusername) { this.ptntusername = ptntusername; } public String getPtntPwd() { return ptntPwd; } public void setPtntPwd(String ptntPwd) { this.ptntPwd = ptntPwd; } public String getPtntConfirmPwd() { return ptntConfirmPwd; } public void setPtntConfirmPwd(String ptntConfirmPwd) { this.ptntConfirmPwd = ptntConfirmPwd; } public String getPtntFrstNm() { return ptntFrstNm; Ecotech Consultants Page 81

-Tools for Doctor Consultation


} public void setPtntFrstNm(String ptntFrstNm) { this.ptntFrstNm = ptntFrstNm; } public String getPtntLstNm() { return ptntLstNm; } public void setPtntLstNm(String ptntLstNm) { this.ptntLstNm = ptntLstNm; } public String getPtntGender() { return ptntGender; } public void setPtntGender(String ptntGender) { this.ptntGender = ptntGender; } public String getPtntAge() { return ptntAge; } public void setPtntAge(String ptntAge) { this.ptntAge = ptntAge; } public String getPtntAddress() { return ptntAddress; } public void setPtntAddress(String ptntAddress) { this.ptntAddress = ptntAddress; Ecotech Consultants Page 82

-Tools for Doctor Consultation


} public String getPtntCity() { return ptntCity; } public void setPtntCity(String ptntCity) { this.ptntCity = ptntCity; } public String getPtntState() { return ptntState; } public void setPtntState(String ptntState) { this.ptntState = ptntState; } public String getPtntzip() { return ptntzip; } public void setPtntzip(String ptntzip) { this.ptntzip = ptntzip; } public String getPtntContact() { return ptntContact; } public void setPtntContact(String ptntContact) { this.ptntContact = ptntContact; } public String getPtntMail() { return ptntMail; Ecotech Consultants Page 83

-Tools for Doctor Consultation


} public void setPtntMail(String ptntMail) { this.ptntMail = ptntMail; } public String getPtntReasonOfVisit() { return ptntReasonOfVisit; } public void setPtntReasonOfVisit(String ptntReasonOfVisit) { this.ptntReasonOfVisit = ptntReasonOfVisit; } public String getPtntinsuranceid() { return ptntinsuranceid; } public void setPtntinsuranceid(String ptntinsuranceid) { this.ptntinsuranceid = ptntinsuranceid; } public String getMyaction() { return myaction; } myaction the myaction to set public String getMssg() { return mssg; } public void setMssg(String mssg) { this.mssg = mssg; } public String getUsernameerror() { Ecotech Consultants Page 84

-Tools for Doctor Consultation


return usernameerror; } public void setUsernameerror(String usernameerror) { this.usernameerror = usernameerror; } public String getPwderror() { return pwderror; } public void setPwderror(String pwderror) { this.pwderror = pwderror; } public String getConfpwderror() { return confpwderror; } public void setConfpwderror(String confpwderror) { this.confpwderror = confpwderror; } public String getFstnmerror() { return fstnmerror; } public void setFstnmerror(String fstnmerror) { this.fstnmerror = fstnmerror; } public String getLstnmerror() { return lstnmerror; } public void setLstnmerror(String lstnmerror) { Ecotech Consultants Page 85

-Tools for Doctor Consultation


this.lstnmerror = lstnmerror; } public String getGendererror() { return gendererror; } public void setGendererror(String gendererror) { this.gendererror = gendererror; } public String getAgeerror() { return ageerror; } public void setAgeerror(String ageerror) { this.ageerror = ageerror; } public String getAddrerror() { return addrerror; } public void setAddrerror(String addrerror) { this.addrerror = addrerror; } public String getCityerror() { return cityerror; } public void setCityerror(String cityerror) { this.cityerror = cityerror; } public String getStateerror() { Ecotech Consultants Page 86

-Tools for Doctor Consultation


return stateerror; } public void setStateerror(String stateerror) { this.stateerror = stateerror; } public String getZiperror() { return ziperror; } public void setZiperror(String ziperror) { this.ziperror = ziperror; } public String getContacterror() { return contacterror; } public void setContacterror(String contacterror) { this.contacterror = contacterror; } public String getMailerror() { return mailerror; } public void setMailerror(String mailerror) { this.mailerror = mailerror; } public String getReasonerror() { return reasonerror; } public void setReasonerror(String reasonerror) { Ecotech Consultants Page 87

-Tools for Doctor Consultation


this.reasonerror = reasonerror; } public String getInsuerror() { return insuerror; } public void setInsuerror(String insuerror) { this.insuerror = insuerror; } }

Insurancedto.java
package com.ihealth.dto; public class InsuranceDto { private static final long serialVersionUID = 1L; private String inscompnm; private String inspolicynm; private String inspersonnm; private String inspersonage; private String inspolicystart; private String inspolicyexp; private String inspolicyren; private String insagentnm; private String insagentid; private String inscashless; private String insamount; private String insclaimdt; private String insclaim; private String myaction; private String inscompnmerror; private String inspolicyerror; private String inspersonerror; private String inspersonageerror; private String insstarterror; private String insexperror; private String insreneweerror; private String insagentnmerror; private String insagentiderror; private String inscashlesserror; private String insamounterror; private String insclaimdterror; private String insclaimerror; public String getInscompnm() { return inscompnm; Ecotech Consultants Page 88

-Tools for Doctor Consultation


} public void setInscompnm(String inscompnm) { this.inscompnm = inscompnm; } public String getInspolicynm() { return inspolicynm; } public void setInspolicynm(String inspolicynm) { this.inspolicynm = inspolicynm; } public String getInspersonnm() { return inspersonnm; } public void setInspersonnm(String inspersonnm) { this.inspersonnm = inspersonnm; } public String getInspersonage() { return inspersonage; } public void setInspersonage(String inspersonage) { this.inspersonage = inspersonage; } public String getInspolicystart() { return inspolicystart; } public void setInspolicystart(String inspolicystart) { this.inspolicystart = inspolicystart; } public String getInspolicyexp() { return inspolicyexp; } public void setInspolicyexp(String inspolicyexp) { this.inspolicyexp = inspolicyexp; } public String getInspolicyren() { return inspolicyren; } public void setInspolicyren(String inspolicyren) { this.inspolicyren = inspolicyren; } public String getInsagentnm() { return insagentnm; } public void setInsagentnm(String insagentnm) { this.insagentnm = insagentnm; } public String getInsagentid() { return insagentid; } public void setInsagentid(String insagentid) { Ecotech Consultants Page 89

-Tools for Doctor Consultation


this.insagentid = insagentid; } public String getInscashless() { return inscashless; } public void setInscashless(String inscashless) { this.inscashless = inscashless; } public String getInsamount() { return insamount; } public void setInsamount(String insamount) { this.insamount = insamount; } public String getInsclaimdt() { return insclaimdt; } public void setInsclaimdt(String insclaimdt) { this.insclaimdt = insclaimdt; } public String getInsclaim() { return insclaim; } public void setInsclaim(String insclaim) { this.insclaim = insclaim; } public String getMyaction() { return myaction; } public void setMyaction(String myaction) { this.myaction = myaction; } public String getInscompnmerror() { return inscompnmerror; } public void setInscompnmerror(String inscompnmerror) { this.inscompnmerror = inscompnmerror; } public String getInspolicyerror() { return inspolicyerror; } public void setInspolicyerror(String inspolicyerror) { this.inspolicyerror = inspolicyerror; } public String getInspersonerror() { return inspersonerror; } public void setInspersonerror(String inspersonerror) { this.inspersonerror = inspersonerror; } public String getInspersonageerror() { Ecotech Consultants Page 90

-Tools for Doctor Consultation


return inspersonageerror; } public void setInspersonageerror(String inspersonageerror) { this.inspersonageerror = inspersonageerror; } public String getInsstarterror() { return insstarterror; } public void setInsstarterror(String insstarterror) { this.insstarterror = insstarterror; } public String getInsexperror() { return insexperror; } public void setInsexperror(String insexperror) { this.insexperror = insexperror; } public String getInsreneweerror() { return insreneweerror; } public void setInsreneweerror(String insreneweerror) { this.insreneweerror = insreneweerror; } public String getInsagentnmerror() { return insagentnmerror; } public void setInsagentnmerror(String insagentnmerror) { this.insagentnmerror = insagentnmerror; } public String getInsagentiderror() { return insagentiderror; } public void setInsagentiderror(String insagentiderror) { this.insagentiderror = insagentiderror; } public String getInscashlesserror() { return inscashlesserror; } public void setInscashlesserror(String inscashlesserror) { this.inscashlesserror = inscashlesserror; } public String getInsamounterror() { return insamounterror; } public void setInsamounterror(String insamounterror) { this.insamounterror = insamounterror; } public String getInsclaimdterror() { return insclaimdterror; } Ecotech Consultants Page 91

-Tools for Doctor Consultation


public void setInsclaimdterror(String insclaimdterror) { this.insclaimdterror = insclaimdterror; } public String getInsclaimerror() { return insclaimerror; } public void setInsclaimerror(String insclaimerror) { this.insclaimerror = insclaimerror; } }

logindto.java
package com.ihealth.dto; public class LoginDto { private static final long serialVersionUID = 1L; private private private private String String String String username; pwd; myaction; category;

public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPwd() { return pwd; } public void setPwd(String pwd) { this.pwd = pwd; } public String getMyaction() { return myaction; } public void setMyaction(String myaction) { this.myaction = myaction; } public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } public static long getSerialversionuid() { return serialVersionUID; } } Ecotech Consultants Page 92

-Tools for Doctor Consultation Delegate Pages Code: DoctorDelegate.java


package com.ihealth.delegate; import java.util.List; import com.ihealth.dto.DoctorDto; import com.ihealth.handler.DoctorHandler; public class DoctorDelegate { public static int saveDoctor(DoctorDto doctordto) { return DoctorHandler.saveDoctor(doctordto); } public static List<DoctorDto> searchDoctor(DoctorDto doctordto) { return DoctorHandler.searchDoctor(doctordto); } }

DoctorProfileDelegate.java
package com.ihealth.delegate; import com.ihealth.dto.DoctorProfileDto; public class DoctorProfileDelegate { public static int saveDoctorProfile(DoctorProfileDto doctorprofiledto) { return 0; } }

patientDelegate.java
package com.ihealth.delegate; import com.ihealth.dto.PatientDto; import com.ihealth.handler.PatientHandler; public class PatientDelegate { Ecotech Consultants Page 93

-Tools for Doctor Consultation

public static int savePatient(PatientDto patientdto) { return PatientHandler.savePatient(patientdto); } }

loginDelegate.java
package com.ihealth.delegate; import com.ihealth.dto.LoginDto; import com.ihealth.handler.LoginHandler; public class LoginDelegate {

public static int LogDoctor(LoginDto logindto) { return LoginHandler.LogDoctor(logindto); } }

Common Pages Code: ApplicationUtility.java


package com.ihealth.common; import java.text.SimpleDateFormat; import java.util.Date; import java.util.regex.Matcher; import java.util.regex.Pattern; public class ApplicationUtility { public static boolean isStringWithNumeric(String number) { System.out.println("Calling isStringWithNumeric"); boolean isValid = false; Ecotech Consultants Page 94

-Tools for Doctor Consultation


String expression = "[0-9A-Za-z.,@!#$%^&*?<>+=_`~- ]+"; CharSequence inputStr = number; Pattern pattern = Pattern.compile(expression); Matcher matcher = pattern.matcher(inputStr); if (matcher.matches()){ isValid = true; } return isValid; } public static boolean isStringWith(String number) { System.out.println("Calling isString"); boolean isValid = false; String expression = "[A-Za-z.,@!#$%^&*?<>_+=~`- ]+"; CharSequence inputStr = number; Pattern pattern = Pattern.compile(expression); Matcher matcher = pattern.matcher(inputStr); if(matcher.matches()){ isValid = true; } return isValid; } public static boolean contactNumberChecking(String contactno) { Pattern p3 = Pattern.compile("(^[0-9]{3}-[0-9]{3}-[0-9]{4}$)|([09]{10})|(^[0-9]{5}-[0-9]{6})|(^[0-9]{3}-[0-9]{8})"); Matcher m = p3.matcher(contactno); boolean b = m.matches(); if(b){ return true; } return false; } public static boolean zipChecking(String zip) { Pattern p3 = Pattern.compile("\\d{5}(-\\d{4})?"); Matcher m = p3.matcher(zip); boolean b = m.matches(); if(b){ return true; } return false; } public static boolean eMailChecking(String email) { Pattern p1= Pattern.compile("[a-zA-Z0-9_-]*.[a-zA-Z]*[0-9]*@[azA-Z]*.[a-zA-Z]*"); Matcher m=p1.matcher(email); //Matcher m=p.matcher(args[0]); boolean b=m.matches(); if(b){ return true; Ecotech Consultants Page 95

-Tools for Doctor Consultation


} return false; } public static boolean dateChecking(String date) { String DATE_FORMAT = "yyyy/mm/dd"; SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); Date date1=new Date(); String currentday= sdf.format(date1); if(date.compareTo(currentday)<=0){ return true; } return false; }

public static boolean isPwdMatch(String ptntPwd, String ptntConfirmPwd) { Boolean b = false; b=ptntPwd.equals(ptntConfirmPwd); if(b){ return true; } else { return false; } } }

AppOnLoad.java
package com.ihealth.common; import import import import import import java.sql.SQLException; javax.naming.Context; javax.naming.InitialContext; javax.naming.NamingException; javax.servlet.ServletException; javax.sql.DataSource;

import org.apache.struts.action.ActionServlet; import org.apache.struts.action.PlugIn; import org.apache.struts.config.ModuleConfig; import com.mysql.jdbc.Connection; public class AppOnLoad implements PlugIn { Ecotech Consultants Page 96

-Tools for Doctor Consultation


public void destroy() { } public void init(ActionServlet arg0, ModuleConfig arg1) throws ServletException { } public static Connection getConnection() { Connection connection = null; Context context = null; try { context = new InitialContext(); DataSource ds = (DataSource) context.lookup("java:comp/env/jdbc/ihealthDB"); connection = (Connection) ds.getConnection(); } catch (NamingException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } return connection; } }

IHealthConstants.java
public interface IHealthConstants { public static final String MYSQLURL = "java:comp/env/jdbc/ihealthDB"; public static final int PATIENT_DAO = 1; public static final int DOCTOR_DAO = 2; }

Action Pages Code:


SigninAction.java
Ecotech Consultants Page 97

-Tools for Doctor Consultation


package com.ihealth.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.actions.DispatchAction; import com.ihealth.delegate.LoginDelegate; import com.ihealth.dto.LoginDto; import com.ihealth.form.LoginForm;

public class SigninAction extends DispatchAction { public ActionForward save(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { final String NEXT_PAGE = "success"; return mapping.findForward(NEXT_PAGE); } public ActionForward Login(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { final String doctot_page = "doctorhomepage"; final String patient_page = "patienthomepage"; String next_page = null; LoginForm loginForm = (LoginForm) actionForm; String category = loginForm.getCategory(); if(category.equals("DOCTOR")) { Ecotech Consultants Page 98

-Tools for Doctor Consultation


next_page=doctot_page; } else if(category.equals("PATIENT")) { next_page=patient_page; } return mapping.findForward(next_page); } public ActionForward forgetpassrord(ActionMapping mapping, actionForm,HttpServletRequest request, HttpServletResponse throws Exception { System.out.println("forget login password"); return mapping.findForward("forget"); } public ActionForward ForwardRegDoctorAction(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { System.out.println("oooooooooo"); return mapping.findForward("doctorRegPage"); } public ActionForward ForwardRegPatientAction(ActionMapping mapping, ActionForm actionForm,HttpServletRequest request, HttpServletResponse response) throws Exception { return mapping.findForward("patientRegPage"); } ActionForm response)

DoctorAction.java
package com.ihealth.action; import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; Ecotech Consultants Page 99

-Tools for Doctor Consultation


import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.actions.DispatchAction; import org.apache.struts.util.LabelValueBean; import com.ihealth.delegate.DoctorDelegate; import com.ihealth.dto.DoctorDto; import com.ihealth.form.DoctorForm; public class DoctorAction extends DispatchAction {

public ActionForward save(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { final String NEXT_PAGE = "success"; DoctorForm doctorForm = (DoctorForm) actionForm; doctorForm.setDocMessage("inside save method"); DoctorDto doctordto = new DoctorDto();

doctordto.setDoctorid(doctorForm.getDoctorid()); doctordto.setDocUserName(doctorForm.getDocUserName()); doctordto.setDocPasswrd(doctorForm.getDocPasswrd()); doctordto.setDocConfirmPassword(doctorForm.getDocConfirmPassword()); doctordto.setDoctorReg(doctorForm.getDoctorReg()); doctordto.setDocFirstName(doctorForm.getDocFirstName()); doctordto.setDocLastName(doctorForm.getDocLastName()); doctordto.setDocAddress(doctorForm.getDocAddress()); doctordto.setDocGender(doctorForm.getDocGender()); doctordto.setDocDesignation(doctorForm.getDocDesignation()); Ecotech Consultants Page 100

-Tools for Doctor Consultation


doctordto.setDocCity(doctorForm.getDocCity()); doctordto.setDocState(doctorForm.getDocState()); doctordto.setDocSpecialty(doctorForm.getDocSpecialty()); doctordto.setDocContact(doctorForm.getDocContact()); doctordto.setDocMail(doctorForm.getDocMail()); int status = DoctorDelegate.saveDoctor(doctordto); if (status == 1) { System.out.println("heeeeeeee"); doctorForm.setDocMessage("success"); } else { System.out.println("faillllllll"); } return mapping.findForward(NEXT_PAGE); }

public ActionForward edit(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { final String NEXT_PAGE = "doctorreg"; DoctorForm doctorForm = (DoctorForm) actionForm; doctorForm.setDocMessage("inside Edit method"); List<LabelValueBean> specialityList = new ArrayList<LabelValueBean>(); LabelValueBean lbValueBean = new LabelValueBean("Find a Doctor by Specialty", "Find a Doctor by Specialty"); LabelValueBean lbValueBean1 = new LabelValueBean("Dentist", "Dentist");LabelValueBean lbValueBean2 = new LabelValueBean("Dermatologist", "Dermatologist"); LabelValueBean lbValueBean3 = new LabelValueBean("Dietitian", Ecotech Consultants Page 101

-Tools for Doctor Consultation


"Dietitian"); LabelValueBean lbValueBean4 = new LabelValueBean("Ear, Nose & Throat Doctor (ENT)","Ear, Nose & Throat Doctor (ENT)"); LabelValueBean lbValueBean5 = new LabelValueBean("Endocrinologist (incl Diabetes Specialists)","Endocrinologist (incl Diabetes Specialists)"); LabelValueBean lbValueBean6 = new LabelValueBean("Eye Doctor", "Eye Doctor"); LabelValueBean lbValueBean7 = new LabelValueBean("Gaestroenteroly", "Gaestroenteroly"); LabelValueBean lbValueBean8 = new LabelValueBean("Hematologist", "Hematologist"); LabelValueBean Disease Specialist", lbValueBean9 = new LabelValueBean("Infectious

"Infectious Disease Specialist"); LabelValueBean lbValueBean10 = new LabelValueBean("Nephrologist (Kidney Specialist)", "Nephrologist (Kidney Specialist)"); LabelValueBean lbValueBean11 (incl Headache Specialists)", = new LabelValueBean("Neurologist

"Neurologist (incl Headache Specialists)"); LabelValueBean lbValueBean12 (Obstetrician-Gynecologist)", = new LabelValueBean("OB-GYN

"OB-GYN (Obstetrician-Gynecologist)"); LabelValueBean lbValueBean13 LabelValueBean("Ophthalmologist", "Ophthalmologist"); LabelValueBean lbValueBean14= new LabelValueBean("Optometrist", "Optometrist"); LabelValueBean lbValueBean15= new LabelValueBean("Orthodontist", "Orthodontist"); LabelValueBean Ecotech Consultants lbValueBean16= new LabelValueBean("Orthopedic Page 102 = new

-Tools for Doctor Consultation


Surgeon (Orthopedist)", "Orthopedic Surgeon (Orthopedist)"); LabelValueBean lbValueBean17= new LabelValueBean("Pain Management Specialist", "Pain Management Specialist"); LabelValueBean Dentist", "Pediatric Dentist"); LabelValueBean lbValueBean19 = new LabelValueBean("Pediatrician", "Pediatrician"); LabelValueBean lbValueBean20= Therapist (Physical Medicine)", new LabelValueBean("Physical lbValueBean18 = new LabelValueBean("Pediatric

"Physical Therapist (Physical Medicine)"); LabelValueBean Surgeon", "Plastic Surgeon"); LabelValueBean (Foot Specialist)", lbValueBean22 = new LabelValueBean("Podiatrist lbValueBean21 = new LabelValueBean("Plastic

"Podiatrist (Foot Specialist)"); LabelValueBean lbValueBean23 = new LabelValueBean("Primary Care Doctor (General Practitioner)", "Primary Care Doctor (General Practitioner)"); LabelValueBean LabelValueBean("Prosthodontist", "Prosthodontist"); LabelValueBean lbValueBean25 = new LabelValueBean("Psychiatrist", "Psychiatrist"); LabelValueBean lbValueBean26 = new LabelValueBean("Psychologist", "Psychologist"); LabelValueBean lbValueBean27 = new LabelValueBean("Pulmonologist (Lung Doctor)", Ecotech Consultants Page 103 lbValueBean24 = new

-Tools for Doctor Consultation


"Pulmonologist (Lung Doctor)"); LabelValueBean lbValueBean28 = new LabelValueBean("Radiologist", "Radiologist"); LabelValueBean LabelValueBean("Rheumatologist", "Rheumatologist"); LabelValueBean lbValueBean30 = new LabelValueBean("Sleep Medicine Specialist", "Sleep Medicine Specialist"); LabelValueBean Medicine Specialist", lbValueBean31 = new LabelValueBean("Sports lbValueBean29 = new

"Sports Medicine Specialist"); LabelValueBean lbValueBean32 = new LabelValueBean("Urologist", "Urologist"); specialityList.add(lbValueBean); specialityList.add(lbValueBean1); specialityList.add(lbValueBean2); specialityList.add(lbValueBean3); specialityList.add(lbValueBean4); specialityList.add(lbValueBean5); specialityList.add(lbValueBean6); specialityList.add(lbValueBean7); specialityList.add(lbValueBean8); specialityList.add(lbValueBean9); specialityList.add(lbValueBean10) specialityList.add(lbValueBean11); specialityList.add(lbValueBean12); specialityList.add(lbValueBean13); specialityList.add(lbValueBean14); specialityList.add(lbValueBean15); specialityList.add(lbValueBean16); specialityList.add(lbValueBean17); specialityList.add(lbValueBean18); specialityList.add(lbValueBean19); specialityList.add(lbValueBean20); specialityList.add(lbValueBean21); specialityList.add(lbValueBean22); specialityList.add(lbValueBean23); specialityList.add(lbValueBean24); specialityList.add(lbValueBean25); specialityList.add(lbValueBean26); specialityList.add(lbValueBean27); specialityList.add(lbValueBean28); specialityList.add(lbValueBean29); Ecotech Consultants Page 104

-Tools for Doctor Consultation


specialityList.add(lbValueBean30); specialityList.add(lbValueBean31); specialityList.add(lbValueBean32); doctorForm.setSpList(specialityList); return mapping.findForward(NEXT_PAGE); } public ActionForward cancel(ActionMapping mapping, ActionForm actionForm,HttpServletRequest request, HttpServletResponse response) throws Exception { final String NEXT_PAGE = "index"; DoctorForm doctorForm = (DoctorForm) actionForm; doctorForm.setDocMessage("inside cancle method"); return mapping.findForward(NEXT_PAGE); } }

PatientAction.java
package com.ihealth.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.actions.DispatchAction; import com.ihealth.delegate.PatientDelegate; import com.ihealth.dto.PatientDto; import com.ihealth.form.PatientForm;

public class PatientAction extends DispatchAction { Ecotech Consultants Page 105

-Tools for Doctor Consultation


public ActionForward save(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { final String NEXT_PAGE = "success"; PatientForm patientForm = (PatientForm) actionForm; patientForm.setMssg("inside save method"); PatientDto patientdto = new PatientDto(); patientdto.setPtntusername(patientForm.getPtntusername()); patientdto.setPtntPwd(patientForm.getPtntPwd()); patientdto.setPtntConfirmPwd(patientForm.getPtntConfirmPwd()); patientdto.setPtntFrstNm(patientForm.getPtntFrstNm()); patientdto.setPtntLstNm(patientForm.getPtntLstNm()); patientdto.setPtntGender(patientForm.getPtntGender()); patientdto.setPtntAge(patientForm.getPtntAge()); patientdto.setPtntAddress(patientForm.getPtntAddress()); patientdto.setPtntCity(patientForm.getPtntCity()); patientdto.setPtntState(patientForm.getPtntState()); patientdto.setPtntzip(patientForm.getPtntzip()); patientdto.setPtntContact(patientForm.getPtntContact()); patientdto.setPtntMail(patientForm.getPtntMail());

patientdto.setPtntReasonOfVisit(patientForm.getPtntReasonOfVisit()); patientdto.setPtntinsuranceid(patientForm.getPtntinsuranceid()); int status = PatientDelegate.savePatient(patientdto); if (status == 1) { System.out.println("heghhgeehhhhhhhhgggeeehhee"); Ecotech Consultants Page 106

-Tools for Doctor Consultation


patientForm.setMssg("success"); } else { System.out.println("faillllllll"); } return mapping.findForward(NEXT_PAGE); } public ActionForward reset(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { final String NEXT_PAGE = "patient-reg"; PatientForm patientForm = (PatientForm) actionForm; patientForm.setMssg("inside reset method");

return mapping.findForward(NEXT_PAGE); } public ActionForward cancel(ActionMapping mapping, ActionForm actionForm,HttpServletRequest request, HttpServletResponse response) throws Exception { final String NEXT_PAGE = "index"; PatientForm patientForm = (PatientForm) actionForm; patientForm.setMssg("inside camcle method"); return mapping.findForward(NEXT_PAGE); } }

DoctorSearchAction.java
package com.ihealth.action; Ecotech Consultants Page 107

-Tools for Doctor Consultation


import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.actions.DispatchAction; import com.ihealth.delegate.DoctorDelegate; import com.ihealth.dto.DoctorDto; import com.ihealth.form.DoctorForm;

public class DoctorSearchAction extends DispatchAction{ public ActionForward search(ActionMapping mapping, ActionForm actionForm,HttpServletRequest request, HttpServletResponse response) throws Exception { DoctorForm doctorForm = (DoctorForm) actionForm; doctorForm.setDocMessage("inside search method"); DoctorDto doctordto = new DoctorDto(); doctordto.setDoctorid(doctorForm.getDoctorid()); doctordto.setDocUserName(doctorForm.getDocUserName()); doctordto.setDocPasswrd(doctorForm.getDocPasswrd()); doctordto.setDocConfirmPassword(doctorForm.getDocConfirmPassword()); doctordto.setDoctorReg(doctorForm.getDoctorReg()); doctordto.setDocFirstName(doctorForm.getDocFirstName()); doctordto.setDocLastName(doctorForm.getDocLastName()); doctordto.setDocAddress(doctorForm.getDocAddress()); doctordto.setDocGender(doctorForm.getDocGender()); doctordto.setDocDesignation(doctorForm.getDocDesignation()); doctordto.setDocCity(doctorForm.getDocCity()); doctordto.setDocState(doctorForm.getDocState()); doctordto.setDocSpecialty(doctorForm.getDocSpecialty()); doctordto.setDocContact(doctorForm.getDocContact()); doctordto.setDocMail(doctorForm.getDocMail());

Ecotech Consultants

Page 108

-Tools for Doctor Consultation


List<DoctorDto> docList = DoctorDelegate.searchDoctor(doctordto); return null; } }

DoctorProfileAction.java
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.actions.DispatchAction; import com.ihealth.delegate.DoctorProfileDelegate; import com.ihealth.dto.DoctorProfileDto; import com.ihealth.form.DoctorProfileForm; public class DoctorProfileAction extends DispatchAction { public ActionForward save(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { final String NEXT_PAGE = "success"; DoctorProfileForm doctorProfilrForm = (DoctorProfileForm) actionForm; DoctorProfileDto doctorprofiledto = new DoctorProfileDto(); doctorprofiledto.setDocUserName(doctorProfilrForm.getDocUserName()); doctorprofiledto.setDocPasswrd(doctorProfilrForm.getDocPasswrd()); doctorprofiledto.setDocPracticeName(doctorProfilrForm .getDocPracticeName()); doctorprofiledto.setDocDateofReg(doctorProfilrForm.getDocDateofReg()); doctorprofiledto.setDocDesignation(doctorProfilrForm .getDocDesignation()); doctorprofiledto.setDoctorCertification(doctorProfilrForm Ecotech Consultants Page 109

-Tools for Doctor Consultation


.getDoctorCertification()); doctorprofiledto.setDoctorHospital(doctorProfilrForm .getDoctorHospital()); doctorprofiledto.setDoctorAwards(doctorProfilrForm.getDoctorAwards()); doctorprofiledto.setDoctorLanguage(doctorProfilrForm .getDoctorLanguage()); doctorprofiledto.setDoctorStatement(doctorProfilrForm .getDoctorStatement()); doctorprofiledto.setDoctorPic(doctorProfilrForm.getDoctorPic()); doctorprofiledto.setDoctorPayment(doctorProfilrForm.getDoctorPayment()); int status = DoctorProfileDelegate.saveDoctorProfile(doctorprofiledto); if (status == 1) { System.out.println("heehehehehehee"); } else { System.out.println("faillllllll"); } return mapping.findForward(NEXT_PAGE); } public ActionForward edit(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { final String NEXT_PAGE = "doctorReg"; return mapping.findForward(NEXT_PAGE); } public ActionForward cancel(ActionMapping mapping, ActionForm actionForm,HttpServletRequest request, HttpServletResponse response) throws Exception { final String NEXT_PAGE = "doctorReg"; return mapping.findForward(NEXT_PAGE); } Ecotech Consultants Page 110

-Tools for Doctor Consultation


}

DAO Pages Code: CommonDao.java


package com.ihealth.dao; import java.util.List; import import import import com.ihealth.dto.DoctorDto; com.ihealth.dto.DoctorProfileDto; com.ihealth.dto.InsuranceDto; com.ihealth.dto.PatientDto;

public interface CommonDao { int savePatient(PatientDto patientdto); int saveDoctor(DoctorDto doctordto); int saveInsurance(InsuranceDto insuranceDto); List<DoctorDto> searchDoctor(DoctorDto doctordto); int saveDoctorProfile(DoctorProfileDto doctorprofiledto); }

DaoFactory.java
package com.ihealth.dao; import com.ihealth.common.IHealthConstants; public class DaoFactory { private static DaoFactory daoFactory = null; private DaoFactory() { } public static DaoFactory getInstance() { if (daoFactory == null) { daoFactory = new DaoFactory(); } return daoFactory; }

Ecotech Consultants

Page 111

-Tools for Doctor Consultation


public CommonDao getDAO(int demo) { CommonDao commondao = null; switch (demo) { case IHealthConstants.PATIENT_DAO: commondao = new PatientDAO(); break; case IHealthConstants.DOCTOR_DAO: commondao = new DoctorDAO(); break; } return commondao; } }

DoctorDao.java
package com.ihealth.dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.List; import import import import import import import import javax.naming.Context; javax.naming.InitialContext; javax.naming.NamingException; javax.sql.DataSource; com.ihealth.dto.DoctorDto; com.ihealth.dto.DoctorProfileDto; com.ihealth.dto.InsuranceDto; com.ihealth.dto.PatientDto;

public class DoctorDAO implements CommonDao { public int saveDoctor(DoctorDto doctordto) { System.out.println("callling doctordao"); Connection connection = getConnection(); int status=0; String doctusername=doctordto.getDocUserName(); String doctpwd=doctordto.getDocPasswrd(); String doctreg=doctordto.getDoctorReg(); String doctfstname=doctordto.getDocFirstName(); String doctlstname=doctordto.getDocLastName(); String doctgender=doctordto.getDocGender(); String doctaddress=doctordto.getDocAddress(); String docdesignation=doctordto.getDocDesignation(); String doctcity=doctordto.getDocCity(); String doctstate=doctordto.getDocState(); String doctspecialty=doctordto.getDocSpecialty(); String doctcontact=doctordto.getDocContact(); String doctmail=doctordto.getDocMail(); try{ Ecotech Consultants Page 112

-Tools for Doctor Consultation

PreparedStatement preparedStatement = connection.prepareStatement("insert into doctor_mstr(doctor_regno,usrnm,pwd,fst_nm,lst_nm,gender,addr,city,state,desig nation,specialty,cntc_no,email) values(?,?,?,?,?,?,?,?,?,?,?,?,?)"); preparedStatement.setString(1,doctreg ); preparedStatement.setString(2,doctusername ); preparedStatement.setString(3,doctpwd); preparedStatement.setString(4,doctfstname ); preparedStatement.setString(5,doctlstname ); preparedStatement.setString(6,doctaddress ); preparedStatement.setString(7,doctcity ); preparedStatement.setString(8,doctstate ); preparedStatement.setString(9,doctgender ); preparedStatement.setString(10,docdesignation ); preparedStatement.setString(11,doctspecialty ); preparedStatement.setString(12,doctcontact ); preparedStatement.setString(13,doctmail); status=preparedStatement.executeUpdate(); System.out.println(status); }catch(SQLException e) { System.out.println(e.getMessage()); e.printStackTrace(); } return status; } private Connection getConnection() { Connection connection = null; Context context = null; try { context = new InitialContext(); DataSource ds = (DataSource) context.lookup("java:comp/env/jdbc/ihealthDB"); connection = (Connection) ds.getConnection(); } catch (NamingException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } return connection; } @Override public List<DoctorDto> searchDoctor(DoctorDto doctordto) { return null; }

Ecotech Consultants

Page 113

-Tools for Doctor Consultation


@Override public int savePatient(PatientDto patientdto) { return 0; } @Override public int saveInsurance(InsuranceDto insuranceDto) { return 0; } @Override public int saveDoctorProfile(DoctorProfileDto doctorprofiledto) { return 0; } }

DoctorProfileDao.java
package com.ihealth.dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.List; import import import import import import import import javax.naming.Context; javax.naming.InitialContext; javax.naming.NamingException; javax.sql.DataSource; com.ihealth.dto.DoctorDto; com.ihealth.dto.DoctorProfileDto; com.ihealth.dto.InsuranceDto; com.ihealth.dto.PatientDto;

public class DoctorProfileDAO implements CommonDao { @Override public int saveDoctorProfile(DoctorProfileDto doctorprofiledto) { System.out.println("callling doctorpatientdao"); Connection connection = getConnection(); int status=0; String doctusername=doctorprofiledto.getDocUserName(); String doctpwd=doctorprofiledto.getDocPasswrd(); String PracticeName=doctorprofiledto.getDocPracticeName(); String docDateofReg=doctorprofiledto.getDocDateofReg(); String docDesignation=doctorprofiledto.getDocDesignation(); String docCertification=doctorprofiledto.getDoctorCertification(); String docHospital=doctorprofiledto.getDoctorHospital(); Ecotech Consultants Page 114

-Tools for Doctor Consultation


String String String String String try{ docAwards=doctorprofiledto.getDoctorAwards(); docLanguage=doctorprofiledto.getDoctorLanguage(); docStatement=doctorprofiledto.getDoctorStatement(); docPic=doctorprofiledto.getDoctorPic(); docPayment=doctorprofiledto.getDoctorPayment();

PreparedStatement preparedStatement = connection.prepareStatement("insert into dctor_profile(practice_nm,date_of_reg,designation,board_of_cert,hospital_affl n,awards,lngs,prof_stmt,pic,payple) values(?,?,?,?,?,?,?,?,?,?)"); preparedStatement.setString(1,PracticeName ); preparedStatement.setString(2,docDateofReg ); preparedStatement.setString(3,docDesignation); preparedStatement.setString(4,docCertification ); preparedStatement.setString(5,docHospital ); preparedStatement.setString(6,docAwards ); preparedStatement.setString(7,docLanguage ); preparedStatement.setString(8,docStatement ); preparedStatement.setString(9,docPic ); preparedStatement.setString(10,docPayment );

status=preparedStatement.executeUpdate(); System.out.println(status); }catch(SQLException e) {

System.out.println(e.getMessage()); e.printStackTrace(); } return status; } private Connection getConnection() { Connection connection = null; Context context = null; try { context = new InitialContext(); DataSource ds = (DataSource) context.lookup("java:comp/env/jdbc/ihealthDB"); connection = (Connection) ds.getConnection(); } catch (NamingException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } return connection; Ecotech Consultants Page 115

-Tools for Doctor Consultation


} @Override public int savePatient(PatientDto patientdto) { return 0; } @Override public int saveDoctor(DoctorDto doctordto) { return 0; } @Override public int saveInsurance(InsuranceDto insuranceDto) { return 0; } @Override public List<DoctorDto> searchDoctor(DoctorDto doctordto) { return null; } }

PatientDao.java
package com.ihealth.dao; import import import import import import import import import import import import java.sql.Connection; java.sql.PreparedStatement; java.sql.SQLException; java.util.List; com.ihealth.dto.DoctorDto; com.ihealth.dto.DoctorProfileDto; com.ihealth.dto.InsuranceDto; com.ihealth.dto.PatientDto; javax.naming.Context; javax.naming.InitialContext; javax.naming.NamingException; javax.sql.DataSource;

public class PatientDAO implements CommonDao { public int savePatient(PatientDto patientdto) { System.out.println("---------->>>>>___-----"); System.out.println("callling patitentdao"); Connection connection = getConnection(); Ecotech Consultants Page 116

-Tools for Doctor Consultation


int status = 0; String String String String String String String String String String String String String String try { System.out.println("inside try"); PreparedStatement preparedStatement = connection .prepareStatement("insert into patient_mstr(usrnm,pwd,fst_nm,lst_nm,gender,age,addr,city,state,zip,cntc_no,e mail,reason_of_visit,insu_id) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); preparedStatement.setString(1, ptntusername); preparedStatement.setString(2, ptntpwd); preparedStatement.setString(3, ptntfstname); preparedStatement.setString(4, ptntlstname); preparedStatement.setString(5, ptntgender); preparedStatement.setString(6, ptntage); preparedStatement.setString(7, ptntaddress); preparedStatement.setString(8, ptntcity); preparedStatement.setString(9, ptntstate); preparedStatement.setString(10, ptntzip); preparedStatement.setString(11, ptntcontact); preparedStatement.setString(12, ptntmail); preparedStatement.setString(13, ptntreason); preparedStatement.setString(14, insuranceid); status = preparedStatement.executeUpdate(); System.out.println(status); } catch (SQLException e) { System.out.println(e.getMessage()); e.printStackTrace(); } return status; } Ecotech Consultants Page 117 ptntusername = patientdto.getPtntusername(); ptntpwd = patientdto.getPtntPwd(); ptntfstname = patientdto.getPtntFrstNm(); ptntlstname = patientdto.getPtntLstNm(); ptntgender = patientdto.getPtntGender(); ptntage = patientdto.getPtntAge(); ptntaddress = patientdto.getPtntAddress(); ptntcity = patientdto.getPtntCity(); ptntstate = patientdto.getPtntState(); ptntzip = patientdto.getPtntzip(); ptntcontact = patientdto.getPtntContact(); ptntmail = patientdto.getPtntMail(); ptntreason = patientdto.getPtntReasonOfVisit(); insuranceid = patientdto.getPtntinsuranceid();

-Tools for Doctor Consultation


private Connection getConnection() { Connection connection = null; Context context = null; try { context = new InitialContext(); DataSource ds = (DataSource) context .lookup("java:comp/env/jdbc/ihealthDB"); connection = (Connection) ds.getConnection(); } catch (NamingException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } return connection; } @Override public int saveDoctor(DoctorDto doctordto) { return 0; } @Override public List<DoctorDto> searchDoctor(DoctorDto doctordto) { return null; } @Override public int saveInsurance(InsuranceDto insuranceDto) { return 0; } @Override public int saveDoctorProfile(DoctorProfileDto doctorprofiledto) { return 0; } }

InsuranceDao.java
package com.ihealth.dao; import import import import java.sql.Connection; java.sql.PreparedStatement; java.sql.SQLException; java.util.List;

import javax.naming.Context; import javax.naming.InitialContext; Ecotech Consultants Page 118

-Tools for Doctor Consultation


import javax.naming.NamingException; import javax.sql.DataSource; import import import import com.ihealth.dto.DoctorDto; com.ihealth.dto.DoctorProfileDto; com.ihealth.dto.InsuranceDto; com.ihealth.dto.PatientDto;

public class InsuranceDAO implements CommonDao{ @Override public int saveInsurance(InsuranceDto insuranceDto) { System.out.println("callling patitentdao"); Connection connection = getConnection(); int status = 0; //String patientid=""; String inscompnm = insuranceDto.getInscompnm(); String inspolicynm = insuranceDto.getInspolicynm(); String inspersonnm = insuranceDto.getInspersonnm(); String inspersonage = insuranceDto.getInspersonage(); String inspolicystart = insuranceDto.getInspolicystart(); String inspolicyexp = insuranceDto.getInspolicyexp(); String inspolicyren = insuranceDto.getInspolicyren(); String insagentnm = insuranceDto.getInsagentnm(); String insagentid = insuranceDto.getInsagentid(); String inscashless = insuranceDto.getInscashless(); String insamount = insuranceDto.getInsamount(); String insclaimdt = insuranceDto.getInsclaimdt(); String insclaim = insuranceDto.getInsclaim(); try { System.out.println("inside try"); PreparedStatement preparedStatement = connection .prepareStatement("insert into insu_mstr(comp_nm,policy_nm,person_nm,person_age,policy_start,policy_exp,poli cy_ren,agent_nm,agent_id,cashless,policy_amount,claim_dt,claim_amount) values(?,?,?,?,?,?,?,?,?,?,?,?,?)"); preparedStatement.setString(1, preparedStatement.setString(2, preparedStatement.setString(3, preparedStatement.setString(4, preparedStatement.setString(5, preparedStatement.setString(6, preparedStatement.setString(7, preparedStatement.setString(8, preparedStatement.setString(9, Ecotech Consultants inscompnm); inspolicynm); inspersonnm); inspersonage); inspolicystart); inspolicyexp); inspolicyren); insagentnm); insagentid); Page 119

-Tools for Doctor Consultation


preparedStatement.setString(10, preparedStatement.setString(11, preparedStatement.setString(12, preparedStatement.setString(13, inscashless); insamount); insclaimdt); insclaim);

status = preparedStatement.executeUpdate(); System.out.println(status); } catch (SQLException e) { System.out.println(e.getMessage()); e.printStackTrace(); } return status; } private Connection getConnection() { Connection connection = null; Context context = null; try { context = new InitialContext(); DataSource ds = (DataSource) context.lookup("java:comp/env/jdbc/ihealthDB"); connection = (Connection) ds.getConnection(); } catch (NamingException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } return connection; } @Override public int savePatient(PatientDto patientdto) { return 0; } @Override public int saveDoctor(DoctorDto doctordto) { return 0; } @Override public List<DoctorDto> searchDoctor(DoctorDto doctordto) { return null; } @Override public int saveDoctorProfile(DoctorProfileDto doctorprofiledto) { Ecotech Consultants Page 120

-Tools for Doctor Consultation


return 0; } }

Handler Pages code: DoctorHandler.java


package com.ihealth.handler; import java.sql.ResultSet; import java.util.List; import com.ihealth.dao.CommonDao; import com.ihealth.dao.DaoFactory; import com.ihealth.dto.DoctorDto; import com.ihealth.common.*; public class DoctorHandler extends constant { private static CommonDao commondao; public static CommonDao getDAO() { DaoFactory dao = DaoFactory.getInstance(); return dao.getDAO(constant.DEMO); } public static int saveDoctor(DoctorDto doctordto) { commondao = getDAO(); return commondao.saveDoctor(doctordto); } public static List<DoctorDto> searchDoctor(DoctorDto doctordto) { commondao = getDAO(); return commondao.searchDoctor(doctordto); } Ecotech Consultants Page 121

-Tools for Doctor Consultation


}

DoctorProfileHandler.java
package com.ihealth.handler; import com.ihealth.common.constant; import com.ihealth.dao.CommonDao; import com.ihealth.dao.DaoFactory; import com.ihealth.dto.DoctorProfileDto; public class DoctorProfileHandler { private static CommonDao commondao; public static CommonDao getDAO() { DaoFactory dao = DaoFactory.getInstance(); return dao.getDAO(constant.DEMO); } public static int saveDoctorProfile(DoctorProfileDto doctorprofiledto) { commondao = getDAO(); return commondao.saveDoctorProfile(doctorprofiledto); } }

PatientHandler.java
package com.ihealth.handler; import import import import com.ihealth.dao.CommonDao; com.ihealth.dao.DaoFactory; com.ihealth.dto.PatientDto; com.ihealth.common.*;

public class PatientHandler extends constant { public static int savePatient(PatientDto patientdto) { System.out.println("Patient Handler"); DaoFactory dao = DaoFactory.getInstance(); Ecotech Consultants Page 122

-Tools for Doctor Consultation


CommonDao commondao = dao.getDAO(IHealthConstants.PATIENT_DAO); return commondao.savePatient(patientdto); } }

InsuranceHandler.java
package com.ihealth.handler; import com.ihealth.common.constant; import com.ihealth.dao.CommonDao; import com.ihealth.dao.DaoFactory; import com.ihealth.dto.InsuranceDto; public class InsuranceHandler extends constant { private static CommonDao commondao; public static CommonDao getDAO() { DaoFactory dao = DaoFactory.getInstance(); return dao.getDAO(constant.DEMO); } public static int saveInsurance(InsuranceDto insuranceDto) { commondao = getDAO(); return commondao.saveInsurance(insuranceDto); } }

XML Pages code: Struts-config.xml


<struts-config> <form-beans> <form-bean name="PatientForm" type="com.ihealth.form.PatientForm" /> <form-bean name="LoginForm" type="com.ihealth.form.LoginForm" /> <form-bean name="InsuranceForm" type="com.ihealth.form.InsuranceForm" /> <form-bean name="DoctorForm" type="com.ihealth.form.DoctorForm" /> <form-bean name="DoctorProfileForm" type="com.ihealth.form.DoctorProfileForm" /> </form-beans> <global-exceptions> </global-exceptions> <action-mappings> Ecotech Consultants Page 123

-Tools for Doctor Consultation

<action path="/LoginAction" name="LoginForm" type="com.ihealth.action.SigninAction" scope="request" parameter="myaction"> <forward name="doctorhomepage" path="/Profile.jsp"></forward> <forward name="patienthomepage" path="/Profile1.jsp"></forward> <forward name="forget" path="/forgetLogin.jsp"></forward> <forward name="doctorRegPage" path="/doctorReg.jsp" /> <forward name="patientRegPage" path="/patient-reg.jsp" /> </action> <action path="/PatientUpdateAction" name="PatientForm" type="com.ihealth.action.PatientUpdateAction" parameter="myaction" scope="request"> <forward name="logOut" path="/logout.jsp" /> <forward name="patientUpdate" path="/patient-update.jsp" /> <forward name="search" path="/patient-doctor-search.jsp" /> <forward name="delete" path="/deleteProfile.jsp" /> </action> <action path="/patientAction" name="PatientForm" type="com.ihealth.action.PatientAction" parameter="myaction" scope="request" validate="true" input="/patient-reg.jsp"> <forward name="success" path="/patient-reg.jsp" /> <forward name="patient-reg" path="/patient-reg.jsp" /> <forward name="index" path="/index.jsp" /> </action> <action path="/patientProfileAction" name="PatientForm" type="com.ihealth.action.PatientProfileAction" parameter="myaction" scope="request" validate="true" input="/Ptientprofile.jsp"> <forward name="success" path="/Ptient-profile.jsp" /> <forward name="patient-reg" path="/Ptient-profile.jsp" /> <forward name="index" path="/index.jsp" /> </action> <action path="/InsuranceAction" name="InsuranceForm" type="com.ihealth.action.InsuranceAction" scope="request" parameter="myaction" input="/insurance-reg.jsp" validate="true"> <forward name="success" path="/insurance-reg.jsp" /> <forward name="insurance-reg" path="/insurance-reg.jsp" /> <forward name="index" path="/index.jsp" /> </action> <action path="/DoctorAction" name="DoctorForm"

Ecotech Consultants

Page 124

-Tools for Doctor Consultation


type="com.ihealth.action.DoctorAction" scope="request" parameter="myaction" input="/doctorReg.jsp" validate="true"> <forward name="success" path="/success.jsp" /> <forward name="doctorreg" path="/doctorReg.jsp" /> <forward name="index" path="/index.jsp" /> </action> <action path="/DoctorProfileAction" name="DoctorProfileForm" type="com.ihealth.action.DoctorProfileAction" scope="request" parameter="myaction" input="/doctor-profile.jsp" validate="true"> </action>

<action path="/DoctorUpdateAction" name="DoctorForm" type="com.ihealth.action.DoctorUpdateAction" scope="request" parameter="myaction"> <forward name="logOut" path="/logout.jsp" /> <forward name="doctorUpdate" path="/doctor-update.jsp" /> <forward name="search" path="/doctor-patient-search.jsp" /> <forward name="delete" path="/deleteProfile.jsp" /> </action> <action path="/DoctorModifyAction" name="DoctorForm" type="com.ihealth.action.DoctorUpdateAction" scope="request" parameter="myaction"> <forward name="logOut" path="/logout.jsp" /> <forward name="doctorUpdate" path="/doctor-update.jsp" /> <forward name="search" path="/doctor-patient-search.jsp" /> <forward name="delete" path="/deleteProfile.jsp" /> <forward name="success" path="/success.jsp" /> <forward name="reg" path="/doctor-update.jsp" /> <forward name="back" path="/Profile.jsp" /> </action> <action path="/SearchDoctorAction" name="DoctorForm" type="com.ihealth.action.DoctorUpdateAction" parameter="myaction" scope="request"> <forward name="logOut" path="/logout.jsp" /> <forward name="patientUpdate" path="/doctor-update.jsp" /> <forward name="search" path="/doctor-patient-search.jsp" /> <forward name="delete" path="/deleteProfile.jsp" /> <forward name="submit" path="/doctorFind.jsp" /> </action> <action path="/PatientModifyaction" name="PatientForm" type="com.ihealth.action.PatientUpdateAction" parameter="myaction" Ecotech Consultants Page 125

-Tools for Doctor Consultation


scope="request"> <forward name="logOut" path="/logout.jsp" /> <forward name="patientUpdate" path="/patient-update.jsp" /> <forward name="search" path="/patient-doctor-search.jsp" /> <forward name="delete" path="/deleteProfile.jsp" /> <forward name="success" path="/success.jsp" /> <forward name="reg" path="/Ptient-profile.jsp" /> <forward name="back" path="/Profile1.jsp" /> </action> <action path="/SearchPatientAction" name="PatientForm" type="com.ihealth.action.PatientUpdateAction" parameter="myaction" scope="request"> <forward name="logOut" path="/logout.jsp" /> <forward name="patientUpdate" path="/patient-update.jsp" /> <forward name="search" path="/patient-doctor-search.jsp" /> <forward name="delete" path="/deleteProfile.jsp" /> <forward name="submit" path="/doctorFind.jsp" /> </action> <action path="/ForgetLoginAction" name="LoginForm" type="com.ihealth.action.ForgetLoginAction" parameter="myaction" scope="request"> <forward name="submit" path="/forgetLoginActive.jsp" /> </action> <!-- GLOBAL SEARCH --> <!-- End Code: Login page implementation --> </action-mappings> </struts-config>

web.xml
<servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> <init-param> <param-name>debug</param-name> <param-value>2</param-value> </init-param> <init-param> <param-name>detail</param-name> <param-value>2</param-value> </init-param> <load-on-startup>2</load-on-startup> Ecotech Consultants Page 126

-Tools for Doctor Consultation


</servlet> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <session-config> <session-timeout>30</session-timeout> </session-config> <jsp-config> <taglib> <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri> <taglib-location>/WEB-INF/struts-bean.tld</taglib-location> </taglib> <taglib> <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri> <taglib-location>/WEB-INF/struts-html.tld</taglib-location> </taglib> <taglib> <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri> <taglib-location>/WEB-INF/struts-logic.tld</taglib-location> </taglib> <taglib> <taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri> <taglib-location>/WEB-INF/struts-nested.tld</taglib-location> </taglib> <taglib> <taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri> <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location> </taglib> </jsp-config> <resource-ref> <description>DB Connection</description> <res-ref-name>jdbc/ihealthtDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </web-app>

Ecotech Consultants

Page 127

-Tools for Doctor Consultation

8. SCREENSHOTS
Home Page:

Doctor Registration Page

Ecotech Consultants

Page 128

-Tools for Doctor Consultation


Patient Registration Page

Login Page:

Ecotech Consultants

Page 129

-Tools for Doctor Consultation


About Us Page:

Contact Us Page:

Ecotech Consultants

Page 130

-Tools for Doctor Consultation


Terms of Use Page:

Search Page:

Ecotech Consultants

Page 131

-Tools for Doctor Consultation


Admin Control Panel Page

Ecotech Consultants

Page 132

-Tools for Doctor Consultation 9.

TESTING

Unit Testing:
In computer programming, unit testing is a method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine if they are fit for use. Intuitively, one can view a unit as the smallest testable part of an application. In procedural programming a unit could be an entire module but is more commonly an individual function or procedure. In object-oriented programming a unit is often an entire interface, such as a class, but could be an individual method. Unit Benefits: The goal of unit testing is to isolate each part of the program and show that the individual parts are correct.A unit test provides a strict, written contract that the piece of code must satisfy. As a result, it affords several benefits. Tests are created by programmers or occasionally by white box testers during the development process.

Integration Testing:
Integration testing (sometimes called Integration and Testing, abbreviated "I&T") is the phase in software testing in which individual software modules are combined and tested as a group. It occurs after unit testing and before validation testing. Integration testing takes as its input modules that have been unit tested, groups them in larger aggregates, applies tests defined in an integration test plan to those aggregates, and delivers as its output the integrated system ready for system testing. There are two major ways of carrying out an integration test, called the bottom-up method and the top-down method. Bottom-up integration testing begins with unit testing, followed by tests of of progressively higher-level combinations of units called modules or builds. In top-down integration testing, the highest-level modules are tested first and progressively lower-level modules are tested after that. In a comprehensive software development environment, bottomup testing is usually done first, followed by top-down testing. The process concludes with multiple tests of the complete application

Ecotech Consultants

Page 133

-Tools for Doctor Consultation


System Testing:
System testing is the final stage of the software testing process. It is attempting to respond to the question, Can we ship the software to our customer yet? To answer that, system testing takes a holistic view of the software by examining if the application is performing adequately under realistic, real world situations. In particular. System testing of software or hardware is testing conducted on a complete, integrated system to evaluate the system's compliance with its specified requirements. System testing falls within the scope of black box testing, and as such, should require no knowledge of the inner design of the code or logic. As a rule, system testing takes, as its input, all of the "integrated" software components that have successfully passed integration testing and also the software system itself integrated with any applicable hardware system(s). The purpose of integration testing is to detect any inconsistencies between the software units that are integrated together or between any of the assemblages and the hardware. System testing is a more limited type of testing; it seeks to detect defects both within the "inter-assemblages" and also within the system as a whole.

Ecotech Consultants

Page 134

-Tools for Doctor Consultation

10.CONCLUSION
This project is all about online searching and appointment of respective Doctors. A patient can search his/her required doctors by searching them via practice name or speciality or city and can fix appointment with the selected one according to their requirement for ailment. This project contains certain features such as: Time saving is a major advantage of this project. Sitting at home a patient can search for doctors according to their reasons and can fix appointment online. Faster, secure and convenient delivery of results regarding doctor profiles More Productivity of doctors. Higher quality service and satisfaction for patients.

Despite so many advantages, there are certain limitations which are to be worked upon during future enhancements. Some of the demerits of the project is: Doctors need to regularly update their profile so as that it becomes easy for the patients to search proper doctors. Doctors need to pay a registration fee to the admin of this website. A patient should be efficient in using internet, he must know machine usage so as to search doctors properly following instructions. This project needs a gateway to build the link between the admin, doctors, patients. Lastly, there are many more features to be added to this project to make it live on internet which are not possible at present due to its confidentiality.

11.BIBLIOGRAPHY
1. Herbert Schildt, Patrick Naughton: JAVA :The Complete Reference , McGraw-Hill Osborne Media. 2. James Holmes: Struts: The Complete Reference, McGraw-Hill Osborne Media, ISBN 0-07223131-9 3. We use The Web Sits www.google.com, www.zocdoc.com, www.roseindia.com, www.vannlia.com, strutssurvivalguide.pdf.
Ecotech Consultants Page 135

You might also like