From c04a70f43d2afaa951e851165f793390b72de513 Mon Sep 17 00:00:00 2001
From: Aditya Bhansali <adityab3@illinois.edu>
Date: Thu, 5 Nov 2020 16:35:31 -0600
Subject: [PATCH] Backend: added skeleton code for
 AddPreRegisteredPatientAction

---
 .../action/AddPreRegisteredPatientAction.java | 49 +++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 iTrust/src/edu/ncsu/csc/itrust/action/AddPreRegisteredPatientAction.java

diff --git a/iTrust/src/edu/ncsu/csc/itrust/action/AddPreRegisteredPatientAction.java b/iTrust/src/edu/ncsu/csc/itrust/action/AddPreRegisteredPatientAction.java
new file mode 100644
index 0000000..50de00c
--- /dev/null
+++ b/iTrust/src/edu/ncsu/csc/itrust/action/AddPreRegisteredPatientAction.java
@@ -0,0 +1,49 @@
+package edu.ncsu.csc.itrust.action;
+
+
+import edu.ncsu.csc.itrust.RandomPassword;
+import edu.ncsu.csc.itrust.beans.PatientBean;
+import edu.ncsu.csc.itrust.dao.DAOFactory;
+import edu.ncsu.csc.itrust.dao.mysql.PatientDAO;
+import edu.ncsu.csc.itrust.dao.mysql.AuthDAO;
+
+/**
+ * Used for Add Pre-registered Patient page (PreRegisterPatient.jsp). This just adds an empty patient, creates an entered password for
+ * that patient.
+ * 
+ * Very similar to {@link AddOfficeVisitAction}
+ * 
+ * 
+ */
+public class AddPreRegisteredPatientAction {
+	private PatientDAO patientDAO;
+	private AuthDAO authDAO;
+	private long loggedInMID;
+
+	/**
+	 * Just the factory and logged in MID
+	 * 
+	 * @param factory
+	 * @param loggedInMID
+	 */
+	public AddPreRegisteredPatientAction(DAOFactory factory, long loggedInMID) {
+		this.patientDAO = factory.getPatientDAO();
+		this.loggedInMID = loggedInMID;
+		this.authDAO = factory.getAuthDAO();
+	}
+	
+	/**
+	 * Creates a new patient, returns the new MID.
+	 * 
+	 * @param p patient to be created
+	 * @return the new MID of the patient
+	 */
+	public long addPatient(PatientBean p) {
+		
+        // Add patient to DB
+
+        long newMID = 0L;
+        
+		return newMID;
+	}
+}
-- 
GitLab