@SuppressWarnings("deprecation") @Override public Patient getPatient() { Patient patient = Context.getPatientService().getPatient(2); Program program = Context.getProgramWorkflowService().getProgram(1); // as a sanity check, make sure the patient is currently enrolled in the program before we run the test Assert.assertTrue("Patient should be in program", Context.getProgramWorkflowService().isInProgram(patient, program, new Date(), null)); return patient; };
@SuppressWarnings("deprecation") @Override public Patient getPatient() { Patient patient = Context.getPatientService().getPatient(8); Program program = Context.getProgramWorkflowService().getProgram(10); // as a sanity check, make sure the patient is currently enrolled in the program before we run the test Assert.assertTrue("Patient should be in program", Context.getProgramWorkflowService().isInProgram(patient, program, new Date(), null)); return patient; };
@SuppressWarnings("deprecation") @Override public Patient getPatient() { Patient patient = Context.getPatientService().getPatient(2); Program program = Context.getProgramWorkflowService().getProgram(1); // as a sanity check, make sure the patient is currently enrolled in the program before we run the test Assert.assertTrue("Patient should be in program", Context.getProgramWorkflowService().isInProgram(patient, program, new Date(), null)); return patient; };
@SuppressWarnings("deprecation") @Override public void testEditedResults(SubmissionResults results) { // do all the basic assertions to make sure the program was processed correctly results.assertNoErrors(); results.assertEncounterCreated(); results.assertProvider(502); results.assertLocation(2); // confirm that that patient is no longer in the program Patient patient = Context.getPatientService().getPatient(2); Program program = Context.getProgramWorkflowService().getProgram(1); Assert.assertFalse("Patient should no longer be in program", Context.getProgramWorkflowService().isInProgram(patient, program, new Date(), null)); // but confirm that the patient was in the program in the past Assert.assertTrue("Patient should still be in program in the past", Context.getProgramWorkflowService().isInProgram(patient, program, null, new Date())); // confirm that the proper program has been closed PatientProgram pp = Context.getProgramWorkflowService().getPatientProgramByUuid("32296060-03aa-102d-b0e3-001ec94a0cc5"); Assert.assertTrue("Program completion date should be current date", TestUtil.dateEquals(new Date(), pp.getDateCompleted())); };
@SuppressWarnings("deprecation") @Override public void testResults(SubmissionResults results) { // do all the basic assertions to make sure the program was processed correctly results.assertNoErrors(); results.assertEncounterCreated(); results.assertProvider(502); results.assertLocation(2); // confirm that that patient is no longer in the program Patient patient = Context.getPatientService().getPatient(2); Program program = Context.getProgramWorkflowService().getProgram(1); Assert.assertFalse("Patient should no longer be in program", Context.getProgramWorkflowService().isInProgram(patient, program, new Date(), null)); // but confirm that the patient was in the program in the past Assert.assertTrue("Patient should still be in program in the past", Context.getProgramWorkflowService().isInProgram(patient, program, null, new Date())); // confirm that the proper program has been closed PatientProgram pp = Context.getProgramWorkflowService().getPatientProgramByUuid("32296060-03aa-102d-b0e3-001ec94a0cc5"); Assert.assertTrue("Program completion date should be current date", TestUtil.dateEquals(new Date(), pp.getDateCompleted())); };
@SuppressWarnings("deprecation") @Override public void testResults(SubmissionResults results) { // do all the basic assertions to make sure the program was processed correctly results.assertNoErrors(); results.assertEncounterCreated(); results.assertProvider(502); results.assertLocation(2); // confirm that that patient is no longer in the program Patient patient = Context.getPatientService().getPatient(2); Program program = Context.getProgramWorkflowService().getProgram(1); Assert.assertFalse("Patient should no longer be in program", Context.getProgramWorkflowService().isInProgram(patient, program, new Date(), null)); // but confirm that the patient was in the program in the past Assert.assertTrue("Patient should still be in program in the past", Context.getProgramWorkflowService().isInProgram(patient, program, null, new Date())); // confirm that the proper program has been closed PatientProgram pp = Context.getProgramWorkflowService().getPatientProgramByUuid("32296060-03aa-102d-b0e3-001ec94a0cc5"); Assert.assertTrue("Program completion date should be current date", TestUtil.dateEquals(new Date(), pp.getDateCompleted())); };
@SuppressWarnings("deprecation") @Override public void testResults(SubmissionResults results) { // do all the basic assertions to make sure the program was processed correctly results.assertNoErrors(); results.assertEncounterCreated(); results.assertProvider(502); results.assertLocation(2); // confirm that that patient is no longer in the program Patient patient = Context.getPatientService().getPatient(8); Program program = Context.getProgramWorkflowService().getProgram(10); Assert.assertFalse("Patient should no longer be in program", Context.getProgramWorkflowService().isInProgram(patient, program, new Date(), null)); // but confirm that the patient was in the program in the past Assert.assertTrue("Patient should still be in program in the past", Context.getProgramWorkflowService().isInProgram(patient, program, null, new Date())); // confirm that the proper program has been closed PatientProgram pp = Context.getProgramWorkflowService().getPatientProgramByUuid("31396060-03aa-102d-b0e3-001ec94a0cc5"); Assert.assertTrue("Program completion date should be current date", TestUtil.dateEquals(new Date(), pp.getDateCompleted())); // Confirm that the patient program has the right outcome Assert.assertEquals("Program should have recorded outcome", Context.getConceptService().getConcept(4202), pp.getOutcome()); };