diff --git a/iTrust/sql/data/deadPatient1.sql b/iTrust/sql/data/deadPatient1.sql index ca621879fb1eb7aa9b4103238cec03bd3eb82362..4621ff83e43f9c540a5071b5eb2e461b73e7d1b0 100644 --- a/iTrust/sql/data/deadPatient1.sql +++ b/iTrust/sql/data/deadPatient1.sql @@ -1,8 +1,15 @@ +DELETE FROM users WHERE MID = 81; +DELETE FROM officevisits WHERE PatientID = 81; DELETE FROM patients WHERE MID = 81; -INSERT INTO patients (MID, Gender, DateOfDeath, CauseOfDeath) -VALUES (81,'Male','2019-07-01',84.50); +INSERT INTO users(MID, password, role, sQuestion, sAnswer) + VALUES (81, '30c952fab122c3f9759f02a6d95c3758b246b4fee239957b2d4fee46e26170c4', 'patient', 'what is your favorite color?', 'blue') + ON DUPLICATE KEY UPDATE MID = MID; +INSERT INTO patients (MID, Gender, DateOfDeath, CauseOfDeath) + VALUES (81,'Male','2019-07-01',84.50) + ON DUPLICATE KEY UPDATE MID = MID; -INSERT INTO officevisits(id,HCPID,PatientID) -VALUES (201,9000000000,81); \ No newline at end of file +INSERT INTO officevisits(id,visitDate,HCPID,notes,HospitalID,PatientID) + VALUES (20771,'2019-07-01',9000000000,'died','1',81) + ON DUPLICATE KEY UPDATE id = id; \ No newline at end of file diff --git a/iTrust/sql/data/deadPatient10.sql b/iTrust/sql/data/deadPatient10.sql index a50864f187e23be008d9003412ca490c431f6634..2f9d356a95d2a721ef2e528027614adbfd51350c 100644 --- a/iTrust/sql/data/deadPatient10.sql +++ b/iTrust/sql/data/deadPatient10.sql @@ -1,9 +1,15 @@ +DELETE FROM users WHERE MID = 90; +DELETE FROM officevisits WHERE PatientID = 90; DELETE FROM patients WHERE MID = 90; +INSERT INTO users(MID, password, role, sQuestion, sAnswer) + VALUES (90, '30c952fab122c3f9759f02a6d95c3758b246b4fee239957b2d4fee46e26170c4', 'patient', 'what is your favorite color?', 'blue') + ON DUPLICATE KEY UPDATE MID = MID; INSERT INTO patients (MID, Gender, DateOfDeath, CauseOfDeath) -VALUES (90,'Male','2019-01-01',487.00); + VALUES (90,'Male','2019-01-01',487.00) + ON DUPLICATE KEY UPDATE MID = MID; - -INSERT INTO officevisits(id,HCPID,PatientID) -VALUES (210,9000000001,90); \ No newline at end of file +INSERT INTO officevisits(id,visitDate,HCPID,notes,HospitalID,PatientID) + VALUES (20780,'2019-01-01',9000000003,'died','1',90) + ON DUPLICATE KEY UPDATE id = id; \ No newline at end of file diff --git a/iTrust/sql/data/deadPatient2.sql b/iTrust/sql/data/deadPatient2.sql index c549a935cf7f1292ebb045a85313563f9e1080ba..b8986ae5a3774675942d03dd0e4d539dc9696999 100644 --- a/iTrust/sql/data/deadPatient2.sql +++ b/iTrust/sql/data/deadPatient2.sql @@ -1,9 +1,15 @@ +DELETE FROM users WHERE MID = 82; +DELETE FROM officevisits WHERE PatientID = 82; DELETE FROM patients WHERE MID = 82; +INSERT INTO users(MID, password, role, sQuestion, sAnswer) + VALUES (82, '30c952fab122c3f9759f02a6d95c3758b246b4fee239957b2d4fee46e26170c4', 'patient', 'what is your favorite color?', 'blue') + ON DUPLICATE KEY UPDATE MID = MID; INSERT INTO patients (MID, Gender, DateOfDeath, CauseOfDeath) -VALUES (82,'Male','2018-07-01',11.40); + VALUES (82,'Male','2018-07-01',11.40) + ON DUPLICATE KEY UPDATE MID = MID; - -INSERT INTO officevisits(id,HCPID,PatientID) -VALUES (202,9000000000,82); \ No newline at end of file +INSERT INTO officevisits(id,visitDate,HCPID,notes,HospitalID,PatientID) + VALUES (20772,'2018-07-01',9000000000,'died','1',82) + ON DUPLICATE KEY UPDATE id = id; \ No newline at end of file diff --git a/iTrust/sql/data/deadPatient3.sql b/iTrust/sql/data/deadPatient3.sql index 86785ac8bfd93e76bebaa8cc1641645107cf485a..e8a44af2992ba3374da12de3e9b224b57dbba832 100644 --- a/iTrust/sql/data/deadPatient3.sql +++ b/iTrust/sql/data/deadPatient3.sql @@ -1,8 +1,15 @@ +DELETE FROM users WHERE MID = 83; +DELETE FROM officevisits WHERE PatientID = 83; DELETE FROM patients WHERE MID = 83; -INSERT INTO patients (MID, Gender, DateOfDeath, CauseOfDeath) -VALUES (83,'Female','2018-07-01',11.40); +INSERT INTO users(MID, password, role, sQuestion, sAnswer) + VALUES (83, '30c952fab122c3f9759f02a6d95c3758b246b4fee239957b2d4fee46e26170c4', 'patient', 'what is your favorite color?', 'blue') + ON DUPLICATE KEY UPDATE MID = MID; +INSERT INTO patients (MID, Gender, DateOfDeath, CauseOfDeath) + VALUES (83,'Female','2018-07-01',11.40) + ON DUPLICATE KEY UPDATE MID = MID; -INSERT INTO officevisits(id,HCPID,PatientID) -VALUES (203,9000000000,83); \ No newline at end of file +INSERT INTO officevisits(id,visitDate,HCPID,notes,HospitalID,PatientID) + VALUES (20773,'2018-07-01',9000000000,'died','1',83) + ON DUPLICATE KEY UPDATE id = id; \ No newline at end of file diff --git a/iTrust/sql/data/deadPatient4.sql b/iTrust/sql/data/deadPatient4.sql index ef931b2c12f8644dc5c57299c74fc0342d986bb6..8eb604ffe14f446a072e299653e55e7524f89459 100644 --- a/iTrust/sql/data/deadPatient4.sql +++ b/iTrust/sql/data/deadPatient4.sql @@ -1,8 +1,15 @@ +DELETE FROM users WHERE MID = 84; +DELETE FROM officevisits WHERE PatientID = 84; DELETE FROM patients WHERE MID = 84; -INSERT INTO patients (MID, Gender, DateOfDeath, CauseOfDeath) -VALUES (84,'Male','2018-12-01',11.40); +INSERT INTO users(MID, password, role, sQuestion, sAnswer) + VALUES (84, '30c952fab122c3f9759f02a6d95c3758b246b4fee239957b2d4fee46e26170c4', 'patient', 'what is your favorite color?', 'blue') + ON DUPLICATE KEY UPDATE MID = MID; +INSERT INTO patients (MID, Gender, DateOfDeath, CauseOfDeath) + VALUES (84,'Male','2018-12-01',11.40) + ON DUPLICATE KEY UPDATE MID = MID; -INSERT INTO officevisits(id,HCPID,PatientID) -VALUES (204,9000000000,84); \ No newline at end of file +INSERT INTO officevisits(id,visitDate,HCPID,notes,HospitalID,PatientID) + VALUES (20774,'2018-12-01',9000000000,'died','1',84) + ON DUPLICATE KEY UPDATE id = id; \ No newline at end of file diff --git a/iTrust/sql/data/deadPatient5.sql b/iTrust/sql/data/deadPatient5.sql index 1cfb9362ea8368947b40f3570232428baf32bb41..e8c854eee20afaefb4e4af404dc9d0b6d2fc24be 100644 --- a/iTrust/sql/data/deadPatient5.sql +++ b/iTrust/sql/data/deadPatient5.sql @@ -1,8 +1,15 @@ +DELETE FROM users WHERE MID = 85; +DELETE FROM officevisits WHERE PatientID = 85; DELETE FROM patients WHERE MID = 85; -INSERT INTO patients (MID, Gender, DateOfDeath, CauseOfDeath) -VALUES (85,'Male','2020-01-01',84.50); +INSERT INTO users(MID, password, role, sQuestion, sAnswer) + VALUES (85, '30c952fab122c3f9759f02a6d95c3758b246b4fee239957b2d4fee46e26170c4', 'patient', 'what is your favorite color?', 'blue') + ON DUPLICATE KEY UPDATE MID = MID; +INSERT INTO patients (MID, Gender, DateOfDeath, CauseOfDeath) + VALUES (85,'Male','2020-01-01',84.50) + ON DUPLICATE KEY UPDATE MID = MID; -INSERT INTO officevisits(id,HCPID,PatientID) -VALUES (205,9000000000,85); \ No newline at end of file +INSERT INTO officevisits(id,visitDate,HCPID,notes,HospitalID,PatientID) + VALUES (20775,'2020-01-01',9000000000,'died','1',85) + ON DUPLICATE KEY UPDATE id = id; \ No newline at end of file diff --git a/iTrust/sql/data/deadPatient6.sql b/iTrust/sql/data/deadPatient6.sql index acc6de62828d63ea1795fa81af2c643f86a1b5e8..b773a97e437682d73024a29b6ea39f439e5e7ceb 100644 --- a/iTrust/sql/data/deadPatient6.sql +++ b/iTrust/sql/data/deadPatient6.sql @@ -1,8 +1,15 @@ +DELETE FROM users WHERE MID = 86; +DELETE FROM officevisits WHERE PatientID = 86; DELETE FROM patients WHERE MID = 86; -INSERT INTO patients (MID, Gender, DateOfDeath, CauseOfDeath) -VALUES (86,'Male','2018-12-01',487.00); +INSERT INTO users(MID, password, role, sQuestion, sAnswer) + VALUES (86, '30c952fab122c3f9759f02a6d95c3758b246b4fee239957b2d4fee46e26170c4', 'patient', 'what is your favorite color?', 'blue') + ON DUPLICATE KEY UPDATE MID = MID; +INSERT INTO patients (MID, Gender, DateOfDeath, CauseOfDeath) + VALUES (86,'Male','2018-12-01',487.00) + ON DUPLICATE KEY UPDATE MID = MID; -INSERT INTO officevisits(id,HCPID,PatientID) -VALUES (206,9000000000,86); \ No newline at end of file +INSERT INTO officevisits(id,visitDate,HCPID,notes,HospitalID,PatientID) + VALUES (20776,'2018-12-01',9000000000,'died','1',86) + ON DUPLICATE KEY UPDATE id = id; \ No newline at end of file diff --git a/iTrust/sql/data/deadPatient7.sql b/iTrust/sql/data/deadPatient7.sql index 90d7a12b0be457752d8e120e933d475a4edc986c..51217ef67dd0cc3b7e292a77caf22bd3c5074a65 100644 --- a/iTrust/sql/data/deadPatient7.sql +++ b/iTrust/sql/data/deadPatient7.sql @@ -1,8 +1,16 @@ +DELETE FROM users WHERE MID = 87; +DELETE FROM officevisits WHERE PatientID = 87; DELETE FROM patients WHERE MID = 87; +INSERT INTO users(MID, password, role, sQuestion, sAnswer) + VALUES (87, '30c952fab122c3f9759f02a6d95c3758b246b4fee239957b2d4fee46e26170c4', 'patient', 'what is your favorite color?', 'blue') + ON DUPLICATE KEY UPDATE MID = MID; + INSERT INTO patients (MID, Gender, DateOfDeath, CauseOfDeath) -VALUES (87,'Female','2019-12-01',487.00); + VALUES (87,'Female','2019-12-01',487.00) + ON DUPLICATE KEY UPDATE MID = MID; +INSERT INTO officevisits(id,visitDate,HCPID,notes,HospitalID,PatientID) + VALUES (20777,'2019-12-01',9000000003,'died','1',87) + ON DUPLICATE KEY UPDATE id = id; -INSERT INTO officevisits(id,HCPID,PatientID) -VALUES (207,9000000001,87); \ No newline at end of file diff --git a/iTrust/sql/data/deadPatient8.sql b/iTrust/sql/data/deadPatient8.sql index cdb5b5bafd12c7042c9533363639839d04646e44..0542fb5077aac7ee9d767dda0beb2e468b369917 100644 --- a/iTrust/sql/data/deadPatient8.sql +++ b/iTrust/sql/data/deadPatient8.sql @@ -1,8 +1,15 @@ +DELETE FROM users WHERE MID = 88; +DELETE FROM officevisits WHERE PatientID = 88; DELETE FROM patients WHERE MID = 88; -INSERT INTO patients (MID, Gender, DateOfDeath, CauseOfDeath) -VALUES (88,'Female','2020-07-01',487.00); +INSERT INTO users(MID, password, role, sQuestion, sAnswer) + VALUES (88, '30c952fab122c3f9759f02a6d95c3758b246b4fee239957b2d4fee46e26170c4', 'patient', 'what is your favorite color?', 'blue') + ON DUPLICATE KEY UPDATE MID = MID; +INSERT INTO patients (MID, Gender, DateOfDeath, CauseOfDeath) + VALUES (88,'Female','2020-07-01',487.00) + ON DUPLICATE KEY UPDATE MID = MID; -INSERT INTO officevisits(id,HCPID,PatientID) -VALUES (208,9000000001,88); \ No newline at end of file +INSERT INTO officevisits(id,visitDate,HCPID,notes,HospitalID,PatientID) + VALUES (20778,'2020-07-01',9000000003,'died','1',88) + ON DUPLICATE KEY UPDATE id = id; \ No newline at end of file diff --git a/iTrust/sql/data/deadPatient9.sql b/iTrust/sql/data/deadPatient9.sql index 1eb7f1035613c630538d626c2c2a3e62ccbd7656..46f001045ed389149c51f798edb7ab2b9ff19966 100644 --- a/iTrust/sql/data/deadPatient9.sql +++ b/iTrust/sql/data/deadPatient9.sql @@ -1,9 +1,15 @@ +DELETE FROM users WHERE MID = 89; +DELETE FROM officevisits WHERE PatientID = 89; DELETE FROM patients WHERE MID = 89; +INSERT INTO users(MID, password, role, sQuestion, sAnswer) + VALUES (89, '30c952fab122c3f9759f02a6d95c3758b246b4fee239957b2d4fee46e26170c4', 'patient', 'what is your favorite color?', 'blue') + ON DUPLICATE KEY UPDATE MID = MID; INSERT INTO patients (MID, Gender, DateOfDeath, CauseOfDeath) -VALUES (89,'Male','2020-01-01',487.00); + VALUES (89,'Male','2020-01-01',487.00) + ON DUPLICATE KEY UPDATE MID = MID; - -INSERT INTO officevisits(id,HCPID,PatientID) -VALUES (209,9000000001,89); \ No newline at end of file +INSERT INTO officevisits(id,visitDate,HCPID,notes,HospitalID,PatientID) + VALUES (20779,'2020-01-01',9000000003,'died','1',89) + ON DUPLICATE KEY UPDATE id = id; \ No newline at end of file diff --git a/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewPatientOfficeVisitHistoryActionTest.java b/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewPatientOfficeVisitHistoryActionTest.java index c94a1dced7a287baea32ef0b2ea49702dc3a1930..a215b9c7fe22831c6aa4d5bf64e15d03a61364b8 100644 --- a/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewPatientOfficeVisitHistoryActionTest.java +++ b/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewPatientOfficeVisitHistoryActionTest.java @@ -41,7 +41,7 @@ public class ViewPatientOfficeVisitHistoryActionTest extends TestCase{ */ public void testGetPatients() throws Exception { List<PatientVisitBean> list = action.getPatients(); - assertEquals(57, list.size()); + assertEquals(67, list.size()); assertEquals("31", list.get(21).getLastOVDateD()); assertEquals("03", list.get(21).getLastOVDateM()); } diff --git a/iTrust/test/edu/ncsu/csc/itrust/unit/report/MedicalReportFilterTest.java b/iTrust/test/edu/ncsu/csc/itrust/unit/report/MedicalReportFilterTest.java index e91b276f42345741daf41494445c018c417422e1..7ae6a6a0e34651a8efe59657f058aea631837c86 100644 --- a/iTrust/test/edu/ncsu/csc/itrust/unit/report/MedicalReportFilterTest.java +++ b/iTrust/test/edu/ncsu/csc/itrust/unit/report/MedicalReportFilterTest.java @@ -68,7 +68,7 @@ public class MedicalReportFilterTest extends TestCase { public void testFilterByLowerOfficeVisit() throws Exception { filter = new MedicalReportFilter(MedicalReportFilterType.LOWER_OFFICE_VISIT_DATE, "01/01/2012", factory); List<PatientBean> res = filter.filter(allPatients); - assertEquals(14, res.size()); + assertEquals(24, res.size()); assertTrue(res.get(0).getMID() == 100L); }