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"> <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> <modelVersion>4.0.0</modelVersion>
<groupId>iTrust</groupId> <groupId>iTrust</groupId>
...@@ -158,7 +157,6 @@ ...@@ -158,7 +157,6 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
...@@ -437,4 +435,4 @@ ...@@ -437,4 +435,4 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties> </properties>
</project> </project>
\ No newline at end of file
...@@ -33,8 +33,8 @@ public class EmergencyReportActionTest extends TestCase { ...@@ -33,8 +33,8 @@ public class EmergencyReportActionTest extends TestCase {
List<AllergyBean> lab = action.getAllergies(); List<AllergyBean> lab = action.getAllergies();
assertEquals(2, lab.size()); assertEquals(2, lab.size());
List<PrescriptionBean> lpb = action.getCurrentPrescriptions(); List<PrescriptionBean> lpb = action.getCurrentPrescriptions();
assertEquals(0, lpb.size()); assertEquals(1, lpb.size());
//assertEquals("Prioglitazone", lpb.get(0).getMedication().getDescription()); assertEquals("Prioglitazone", lpb.get(0).getMedication().getDescription());
List<DiagnosisBean> ldb = action.getWarningDiagnoses(); List<DiagnosisBean> ldb = action.getWarningDiagnoses();
assertEquals(2, ldb.size()); assertEquals(2, ldb.size());
} }
......
...@@ -128,7 +128,7 @@ public class GroupReportActionTest extends TestCase { ...@@ -128,7 +128,7 @@ public class GroupReportActionTest extends TestCase {
assertEquals("\n664662530\n", res); assertEquals("\n664662530\n", res);
break; break;
case CURRENT_PRESCRIPTIONS: case CURRENT_PRESCRIPTIONS:
assertEquals("", res); assertEquals("64764-1512\n", res);
break; break;
case DIAGNOSIS_ICD_CODE: case DIAGNOSIS_ICD_CODE:
assertEquals("250.10\n79.30\n250.10\n250.10\n11.40\n15.00\n", res); assertEquals("250.10\n79.30\n250.10\n250.10\n11.40\n15.00\n", res);
......
...@@ -54,8 +54,8 @@ public class ViewExpiredPrescriptionRecordsActionTest extends TestCase { ...@@ -54,8 +54,8 @@ public class ViewExpiredPrescriptionRecordsActionTest extends TestCase {
action = new ViewExpiredPrescriptionsAction(factory, 2L); action = new ViewExpiredPrescriptionsAction(factory, 2L);
prescriptions = action.getPrescriptionsForPatient(2L); prescriptions = action.getPrescriptionsForPatient(2L);
assertEquals(3, prescriptions.size()); assertEquals(2, prescriptions.size());
assertEquals("647641512", prescriptions.get(0).getMedication().getNDCode()); assertEquals("009042407", prescriptions.get(0).getMedication().getNDCode());
assertEquals("009042407", prescriptions.get(1).getMedication().getNDCode()); assertEquals("009042407", prescriptions.get(1).getMedication().getNDCode());
prescriptions = action.getPrescriptionsForPatient(1L); prescriptions = action.getPrescriptionsForPatient(1L);
...@@ -68,4 +68,4 @@ public class ViewExpiredPrescriptionRecordsActionTest extends TestCase { ...@@ -68,4 +68,4 @@ public class ViewExpiredPrescriptionRecordsActionTest extends TestCase {
assertEquals("009042407", prescriptions.get(0).getMedication().getNDCode()); assertEquals("009042407", prescriptions.get(0).getMedication().getNDCode());
assertEquals("009042407", prescriptions.get(1).getMedication().getNDCode()); assertEquals("009042407", prescriptions.get(1).getMedication().getNDCode());
} }
} }
\ No newline at end of file
...@@ -52,10 +52,10 @@ public class ViewMacronutrientsActionTest extends TestCase { ...@@ -52,10 +52,10 @@ public class ViewMacronutrientsActionTest extends TestCase {
MacronutrientsBean msjData = msj.getMsjData(341); MacronutrientsBean msjData = msj.getMsjData(341);
assertEquals(45, msjData.getYears()); assertEquals(40, msjData.getYears());
assertEquals(112.5, msjData.getWeight(), .001); assertEquals(112.5, msjData.getWeight(), .001);
assertEquals(65.0, msjData.getHeight(), .001); assertEquals(65.0, msjData.getHeight(), .001);
assertEquals(1311.25, msjData.getMsj(), .001); assertEquals(1336.25, msjData.getMsj(), .001);
assertEquals(341L, msjData.getPatientID()); assertEquals(341L, msjData.getPatientID());
} catch (ITrustException e) { } catch (ITrustException e) {
...@@ -111,10 +111,10 @@ public class ViewMacronutrientsActionTest extends TestCase { ...@@ -111,10 +111,10 @@ public class ViewMacronutrientsActionTest extends TestCase {
MacronutrientsBean msjData = msj.getMsjData(342); MacronutrientsBean msjData = msj.getMsjData(342);
assertEquals(65, msjData.getYears()); assertEquals(60, msjData.getYears());
assertEquals(112.5, msjData.getWeight(), .001); assertEquals(112.5, msjData.getWeight(), .001);
assertEquals(65.0, msjData.getHeight(), .001); assertEquals(65.0, msjData.getHeight(), .001);
assertEquals(1211.25, msjData.getMsj(), .001); assertEquals(1236.25, msjData.getMsj(), .001);
assertEquals(342L, msjData.getPatientID()); assertEquals(342L, msjData.getPatientID());
List<FoodEntryBean> foodentry = action.getDiaryTotals(342); List<FoodEntryBean> foodentry = action.getDiaryTotals(342);
......
...@@ -49,13 +49,13 @@ public class ViewReportActionTest extends TestCase { ...@@ -49,13 +49,13 @@ public class ViewReportActionTest extends TestCase {
public void testGetPrescriptions() throws Exception { public void testGetPrescriptions() throws Exception {
gen.ndCodes(); gen.ndCodes();
List<PrescriptionBean> list = action.getPrescriptions(2L); List<PrescriptionBean> list = action.getPrescriptions(2L);
assertEquals(0, list.size()); assertEquals(1, list.size());
// PrescriptionBean bean = list.get(0); PrescriptionBean bean = list.get(0);
// assertEquals("647641512", bean.getMedication().getNDCode()); assertEquals("647641512", bean.getMedication().getNDCode());
// assertEquals("10/10/2006", bean.getStartDateStr()); assertEquals("10/10/2006", bean.getStartDateStr());
// assertEquals("10/11/2020", bean.getEndDateStr()); assertEquals("10/11/2020", bean.getEndDateStr());
// assertEquals(5, bean.getDosage()); assertEquals(5, bean.getDosage());
// assertEquals("Take twice daily", bean.getInstructions()); assertEquals("Take twice daily", bean.getInstructions());
} }
public void testGetDeclaredHCPs() throws Exception { public void testGetDeclaredHCPs() throws Exception {
......
...@@ -48,8 +48,8 @@ public class MacronutrientsDAOTest extends TestCase { ...@@ -48,8 +48,8 @@ public class MacronutrientsDAOTest extends TestCase {
try { try {
MacronutrientsBean macronutrients = macronutrientsDAO.getMsj(341); MacronutrientsBean macronutrients = macronutrientsDAO.getMsj(341);
assertEquals(1311.25, macronutrients.getMsj()); assertTrue(1336.25 == macronutrients.getMsj());
assertEquals(45, macronutrients.getYears()); assertEquals(40, macronutrients.getYears());
} catch (DBException e) { } catch (DBException e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -22,12 +22,12 @@ public class GetPrescriptionsTest extends TestCase { ...@@ -22,12 +22,12 @@ public class GetPrescriptionsTest extends TestCase {
gen.patient2(); gen.patient2();
} }
//public void testGetPatient2() throws Exception { public void testGetPatient2() throws Exception {
// List<PrescriptionBean> list = patientDAO.getCurrentPrescriptions(2l); List<PrescriptionBean> list = patientDAO.getCurrentPrescriptions(2l);
// PrescriptionBean first = list.get(0); PrescriptionBean first = list.get(0);
// assertEquals("Take twice daily", first.getInstructions()); assertEquals("Take twice daily", first.getInstructions());
// assertEquals("10/11/2020", first.getEndDateStr()); assertEquals("10/11/2020", first.getEndDateStr());
//} }
public void testNotPatient200() throws Exception { public void testNotPatient200() throws Exception {
List<DiagnosisBean> diagnoses = patientDAO.getDiagnoses(200L); List<DiagnosisBean> diagnoses = patientDAO.getDiagnoses(200L);
...@@ -38,7 +38,7 @@ public class GetPrescriptionsTest extends TestCase { ...@@ -38,7 +38,7 @@ public class GetPrescriptionsTest extends TestCase {
List<PrescriptionBean> list; List<PrescriptionBean> list;
list = patientDAO.getExpiredPrescriptions(2); list = patientDAO.getExpiredPrescriptions(2);
assertEquals(3, list.size()); assertEquals(2, list.size());
list = patientDAO.getExpiredPrescriptions(1); list = patientDAO.getExpiredPrescriptions(1);
assertEquals(0, list.size()); assertEquals(0, list.size());
...@@ -48,6 +48,6 @@ public class GetPrescriptionsTest extends TestCase { ...@@ -48,6 +48,6 @@ public class GetPrescriptionsTest extends TestCase {
List<PrescriptionBean> list; List<PrescriptionBean> list;
list = patientDAO.getCurrentPrescriptions(2); list = patientDAO.getCurrentPrescriptions(2);
assertEquals(0, list.size()); assertEquals(1, list.size());
} }
} }
...@@ -81,10 +81,10 @@ public class MedicalReportFilterTest extends TestCase { ...@@ -81,10 +81,10 @@ public class MedicalReportFilterTest extends TestCase {
public void testFilterByCurrentPrescriptions() throws Exception { public void testFilterByCurrentPrescriptions() throws Exception {
filter = new MedicalReportFilter(MedicalReportFilterType.CURRENT_PRESCRIPTIONS, "647641512", factory); filter = new MedicalReportFilter(MedicalReportFilterType.CURRENT_PRESCRIPTIONS, "647641512", factory);
List<PatientBean> res = filter.filter(allPatients); List<PatientBean> res = filter.filter(allPatients);
assertEquals(6, res.size()); assertEquals(7, res.size());
assertTrue(res.get(0).getMID() == 99L); assertTrue(res.get(0).getMID() == 2L);
assertTrue(res.get(1).getMID() == 10L); assertTrue(res.get(1).getMID() == 99L);
assertTrue(res.get(2).getMID() == 11L); assertTrue(res.get(2).getMID() == 10L);
} }
public void testFilterByCurrentPrescriptionsNoResult() { 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