-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFindPractitionerServlet.java
99 lines (70 loc) · 3.41 KB
/
FindPractitionerServlet.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import java.io.IOException;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet implementation class DeletePatientsServlet
*/
@WebServlet("/FindPractitionerServlet")
public class FindPractitionerServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public FindPractitionerServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String practitionerId=request.getParameter("practitionerId");
SearchPatient.getAPractitioner(practitionerId);
//response.sendRedirect("searchPatient.jsp");
request.setAttribute("html", SearchPatient.html);
request.setAttribute("active", SearchPatient.active);
request.setAttribute("resourceType", SearchPatient.resourceType);
request.setAttribute("id", SearchPatient.id);
request.setAttribute("version", SearchPatient.version);
request.setAttribute("lastUpdate", SearchPatient.lastUpdate);
request.setAttribute("language", SearchPatient.language);
request.setAttribute("gender", SearchPatient.gender);
request.setAttribute("birthDate", SearchPatient.birthDate);
request.setAttribute("prefix", SearchPatient.prefix);
request.setAttribute("familyName", SearchPatient.familyName);
request.setAttribute("nameGiven", SearchPatient.nameGiven);
request.setAttribute("street", SearchPatient.street);
request.setAttribute("city", SearchPatient.city);
request.setAttribute("state", SearchPatient.state);
request.setAttribute("postcode", SearchPatient.postcode);
//get arrays
request.setAttribute("idSystem", SearchPatient.idSystem);
request.setAttribute("idValue", SearchPatient.idValue);
request.setAttribute("idDisplay", SearchPatient.idDisplay);
request.setAttribute("telecomSystem", SearchPatient.telecomSystem);
request.setAttribute("telecomValue", SearchPatient.telecomValue);
request.setAttribute("telecomUse", SearchPatient.telecomUse);
request.setAttribute("qualification", SearchPatient.qualification);
//System.out.println("Telecom system findPatientServlet= "+SearchPatient.contactTelecomSystem);
//System.out.println("Telecom value findPatientServlet= "+SearchPatient.contactTelecomValue);
//System.out.println("telecom use findPatientServlet= "+SearchPatient.contactTelecomUse);
response.setContentType("text/html");
request.setAttribute("message", SearchPatient.message);
try {
if(!SearchPatient.message.equals("")) {
request.getRequestDispatcher("/index.jsp").forward(request, response);
}else
//send results to searchPatient.jsp
request.getRequestDispatcher("/searchPractitionerResults.jsp").forward(request, response);
} catch (ServletException e) {
}
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}