-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAddPractitionerServlet.java
83 lines (61 loc) · 2.75 KB
/
AddPractitionerServlet.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
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender;
/**
* Servlet implementation class HapiFhirPractitionerServlet
*/
@WebServlet("/AddPractitionerServlet")
public class AddPractitionerServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public AddPractitionerServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//get fields from patient.jsp
String prefix=request.getParameter("prefix");
String qualification=request.getParameter("qualification");
String famName=request.getParameter("famName");
String givenName=request.getParameter("givenName");
String usualName=request.getParameter("usualName");
AdministrativeGender gender = AdministrativeGender.valueOf(request.getParameter("gender"));
String registrationNumber=request.getParameter("registrationNumber");
String payNumber=request.getParameter("payNumber");
String addressLine=request.getParameter("addressLine");
String city=request.getParameter("city");
String state=request.getParameter("state");
String postCode=request.getParameter("postCode");
String language=request.getParameter("language");
String workPhone=request.getParameter("workPhone");
String mobilePhone=request.getParameter("mobilePhone");
String email=request.getParameter("email");
SearchPatient.addAPractitioner(prefix, qualification, famName, givenName, usualName, gender,
registrationNumber, payNumber, addressLine, city, state, postCode, language, workPhone, mobilePhone, email);
//AddPatient.createPractitioner(true);
//get the message from HapiFhirPatient
response.setContentType("text/html");
request.setAttribute("message", SearchPatient.message);
try {
//send results to jsp
request.getRequestDispatcher("/index.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);
}
}