Skip to content
Snippets Groups Projects
Commit 05c5ba76 authored by Elengikal's avatar Elengikal
Browse files

restoring iTrust source code with changes to pom.xml and context.xml

parent aae21b9d
No related branches found
No related tags found
No related merge requests found
Showing with 32 additions and 34 deletions
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>iTrust</groupId>
......@@ -158,7 +157,6 @@
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
......@@ -437,4 +435,4 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
</project>
</project>
\ No newline at end of file
......@@ -33,8 +33,8 @@ public class EmergencyReportActionTest extends TestCase {
List<AllergyBean> lab = action.getAllergies();
assertEquals(2, lab.size());
List<PrescriptionBean> lpb = action.getCurrentPrescriptions();
assertEquals(0, lpb.size());
//assertEquals("Prioglitazone", lpb.get(0).getMedication().getDescription());
assertEquals(1, lpb.size());
assertEquals("Prioglitazone", lpb.get(0).getMedication().getDescription());
List<DiagnosisBean> ldb = action.getWarningDiagnoses();
assertEquals(2, ldb.size());
}
......
......@@ -128,7 +128,7 @@ public class GroupReportActionTest extends TestCase {
assertEquals("\n664662530\n", res);
break;
case CURRENT_PRESCRIPTIONS:
assertEquals("", res);
assertEquals("64764-1512\n", res);
break;
case DIAGNOSIS_ICD_CODE:
assertEquals("250.10\n79.30\n250.10\n250.10\n11.40\n15.00\n", res);
......
......@@ -54,8 +54,8 @@ public class ViewExpiredPrescriptionRecordsActionTest extends TestCase {
action = new ViewExpiredPrescriptionsAction(factory, 2L);
prescriptions = action.getPrescriptionsForPatient(2L);
assertEquals(3, prescriptions.size());
assertEquals("647641512", prescriptions.get(0).getMedication().getNDCode());
assertEquals(2, prescriptions.size());
assertEquals("009042407", prescriptions.get(0).getMedication().getNDCode());
assertEquals("009042407", prescriptions.get(1).getMedication().getNDCode());
prescriptions = action.getPrescriptionsForPatient(1L);
......@@ -68,4 +68,4 @@ public class ViewExpiredPrescriptionRecordsActionTest extends TestCase {
assertEquals("009042407", prescriptions.get(0).getMedication().getNDCode());
assertEquals("009042407", prescriptions.get(1).getMedication().getNDCode());
}
}
}
\ No newline at end of file
......@@ -52,10 +52,10 @@ public class ViewMacronutrientsActionTest extends TestCase {
MacronutrientsBean msjData = msj.getMsjData(341);
assertEquals(45, msjData.getYears());
assertEquals(40, msjData.getYears());
assertEquals(112.5, msjData.getWeight(), .001);
assertEquals(65.0, msjData.getHeight(), .001);
assertEquals(1311.25, msjData.getMsj(), .001);
assertEquals(1336.25, msjData.getMsj(), .001);
assertEquals(341L, msjData.getPatientID());
} catch (ITrustException e) {
......@@ -111,10 +111,10 @@ public class ViewMacronutrientsActionTest extends TestCase {
MacronutrientsBean msjData = msj.getMsjData(342);
assertEquals(65, msjData.getYears());
assertEquals(60, msjData.getYears());
assertEquals(112.5, msjData.getWeight(), .001);
assertEquals(65.0, msjData.getHeight(), .001);
assertEquals(1211.25, msjData.getMsj(), .001);
assertEquals(1236.25, msjData.getMsj(), .001);
assertEquals(342L, msjData.getPatientID());
List<FoodEntryBean> foodentry = action.getDiaryTotals(342);
......
......@@ -49,13 +49,13 @@ public class ViewReportActionTest extends TestCase {
public void testGetPrescriptions() throws Exception {
gen.ndCodes();
List<PrescriptionBean> list = action.getPrescriptions(2L);
assertEquals(0, list.size());
// PrescriptionBean bean = list.get(0);
// assertEquals("647641512", bean.getMedication().getNDCode());
// assertEquals("10/10/2006", bean.getStartDateStr());
// assertEquals("10/11/2020", bean.getEndDateStr());
// assertEquals(5, bean.getDosage());
// assertEquals("Take twice daily", bean.getInstructions());
assertEquals(1, list.size());
PrescriptionBean bean = list.get(0);
assertEquals("647641512", bean.getMedication().getNDCode());
assertEquals("10/10/2006", bean.getStartDateStr());
assertEquals("10/11/2020", bean.getEndDateStr());
assertEquals(5, bean.getDosage());
assertEquals("Take twice daily", bean.getInstructions());
}
public void testGetDeclaredHCPs() throws Exception {
......
......@@ -48,8 +48,8 @@ public class MacronutrientsDAOTest extends TestCase {
try {
MacronutrientsBean macronutrients = macronutrientsDAO.getMsj(341);
assertEquals(1311.25, macronutrients.getMsj());
assertEquals(45, macronutrients.getYears());
assertTrue(1336.25 == macronutrients.getMsj());
assertEquals(40, macronutrients.getYears());
} catch (DBException e) {
e.printStackTrace();
......
......@@ -22,12 +22,12 @@ public class GetPrescriptionsTest extends TestCase {
gen.patient2();
}
//public void testGetPatient2() throws Exception {
// List<PrescriptionBean> list = patientDAO.getCurrentPrescriptions(2l);
// PrescriptionBean first = list.get(0);
// assertEquals("Take twice daily", first.getInstructions());
// assertEquals("10/11/2020", first.getEndDateStr());
//}
public void testGetPatient2() throws Exception {
List<PrescriptionBean> list = patientDAO.getCurrentPrescriptions(2l);
PrescriptionBean first = list.get(0);
assertEquals("Take twice daily", first.getInstructions());
assertEquals("10/11/2020", first.getEndDateStr());
}
public void testNotPatient200() throws Exception {
List<DiagnosisBean> diagnoses = patientDAO.getDiagnoses(200L);
......@@ -38,7 +38,7 @@ public class GetPrescriptionsTest extends TestCase {
List<PrescriptionBean> list;
list = patientDAO.getExpiredPrescriptions(2);
assertEquals(3, list.size());
assertEquals(2, list.size());
list = patientDAO.getExpiredPrescriptions(1);
assertEquals(0, list.size());
......@@ -48,6 +48,6 @@ public class GetPrescriptionsTest extends TestCase {
List<PrescriptionBean> list;
list = patientDAO.getCurrentPrescriptions(2);
assertEquals(0, list.size());
assertEquals(1, list.size());
}
}
......@@ -81,10 +81,10 @@ public class MedicalReportFilterTest extends TestCase {
public void testFilterByCurrentPrescriptions() throws Exception {
filter = new MedicalReportFilter(MedicalReportFilterType.CURRENT_PRESCRIPTIONS, "647641512", factory);
List<PatientBean> res = filter.filter(allPatients);
assertEquals(6, res.size());
assertTrue(res.get(0).getMID() == 99L);
assertTrue(res.get(1).getMID() == 10L);
assertTrue(res.get(2).getMID() == 11L);
assertEquals(7, res.size());
assertTrue(res.get(0).getMID() == 2L);
assertTrue(res.get(1).getMID() == 99L);
assertTrue(res.get(2).getMID() == 10L);
}
public void testFilterByCurrentPrescriptionsNoResult() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment