Skip to content
Browse files

Balaji | merging conflicts

  • Loading branch information...
2 parents 95ecae8 + f0ea24a commit 38003fb90dc75468868c0b827ff526af4f46c2ee Balaji Damodaran committed Apr 30, 2012
View
5 ...national-core/src/main/java/org/motechproject/ghana/national/repository/AllSchedules.java
@@ -102,4 +102,9 @@ public EnrollmentRecord enrollment(EnrollmentRequest enrollmentRequest) {
public EnrollmentRecord getActiveEnrollment(String externalId, String scheduleName) {
return scheduleTrackingService.getEnrollment(externalId, scheduleName);
}
+
+ public List<DateTime> getDueWindowAlertTimings(EnrollmentRequest enrollmentRequest){
+ return scheduleTrackingService.getAlertTimings(enrollmentRequest).getDueWindowAlertTimings();
+ }
+
}
View
65 ghana-national-core/src/main/java/org/motechproject/ghana/national/service/CareService.java
@@ -2,6 +2,7 @@
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
+import org.joda.time.Period;
import org.motechproject.ghana.national.domain.*;
import org.motechproject.ghana.national.domain.care.*;
import org.motechproject.ghana.national.mapper.ScheduleEnrollmentMapper;
@@ -10,10 +11,12 @@
import org.motechproject.ghana.national.repository.AllPatients;
import org.motechproject.ghana.national.repository.AllSchedules;
import org.motechproject.ghana.national.vo.*;
+import org.motechproject.model.Time;
import org.motechproject.mrs.exception.ObservationNotFoundException;
import org.motechproject.mrs.model.MRSConcept;
import org.motechproject.mrs.model.MRSEncounter;
import org.motechproject.mrs.model.MRSObservation;
+import org.motechproject.scheduletracking.api.service.EnrollmentRequest;
import org.motechproject.util.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -23,8 +26,7 @@
import static org.motechproject.ghana.national.configuration.ScheduleNames.*;
import static org.motechproject.ghana.national.domain.Concept.*;
import static org.motechproject.ghana.national.domain.EncounterType.*;
-import static org.motechproject.ghana.national.tools.Utility.safeParseDouble;
-import static org.motechproject.ghana.national.tools.Utility.safeToString;
+import static org.motechproject.ghana.national.tools.Utility.*;
import static org.motechproject.util.DateUtil.newDate;
@Service
@@ -58,11 +60,12 @@ void enrollToCWCCarePrograms(CwcVO cwcVO, Patient patient) {
final List<CwcCareHistory> mergedHistories = mergeNewHistoriesWithExisting(existingHistories, cwcVO.getCWCCareHistoryVO().getCwcCareHistories());
List<PatientCare> patientCares = patient.cwcCareProgramToEnrollOnRegistration(newDate(cwcVO.getRegistrationDate()),
- mergedHistories, cwcVO.getCWCCareHistoryVO(), activeCareSchedules(patient, Arrays.asList(CWC_PENTA,CWC_IPT_VACCINE,CWC_OPV_OTHERS)));
+ mergedHistories, cwcVO.getCWCCareHistoryVO(), activeCareSchedules(patient, Arrays.asList(CWC_PENTA, CWC_IPT_VACCINE, CWC_OPV_OTHERS)));
for (PatientCare patientCare : patientCares) {
allSchedules.enroll(new ScheduleEnrollmentMapper().map(patient, patientCare));
}
+ enrollChildForPNC(patient);
}
List<CwcCareHistory> mergeNewHistoriesWithExisting(List<MRSObservation> existingHistory, List<CwcCareHistory> newHistory) {
@@ -82,8 +85,7 @@ void enrollToCWCCarePrograms(CwcVO cwcVO, Patient patient) {
String conceptName = null;
if (mrsObservation.getValue() instanceof MRSConcept) {
conceptName = ((MRSConcept) mrsObservation.getValue()).getName();
- }
- else{
+ } else {
conceptName = mrsObservation.getConceptName();
}
if (conceptToCareHistory.containsKey(conceptName)) {
@@ -103,15 +105,38 @@ public void enroll(ANCVO ancVO) throws ObservationNotFoundException {
allEncounters.persistEncounter(patient.getMrsPatient(), ancVO.getStaffId(), ancVO.getFacilityId(), ANC_REG_VISIT.value(), ancVO.getRegistrationDate(), prepareObservations(ancVO));
allEncounters.persistEncounter(patient.getMrsPatient(), ancVO.getStaffId(), ancVO.getFacilityId(), PREG_REG_VISIT.value(), ancVO.getRegistrationDate(), pregnancyObservations);
+
ActiveCareSchedules activeCareSchedules = activeCareSchedules(patient, Arrays.asList(TT_VACCINATION, ANC_IPT_VACCINE));
- TTVaccineCare ttVaccineCare = new TTVaccineCare(patient, expectedDeliveryDate, newDate(ancVO.getRegistrationDate()), activeCareSchedules.hasActiveTTSchedule(), ancCareHistoryVO.getLastTT(), ancCareHistoryVO.getLastTTDate());
- IPTVaccineCare iptVaccineCare = new IPTVaccineCare(patient, expectedDeliveryDate, activeCareSchedules.hasActiveIPTSchedule(), ancCareHistoryVO.getLastIPT(), ancCareHistoryVO.getLastIPTDate());
+ Date lastTTDate = getLastTTDate(ancCareHistoryVO,expectedDeliveryDate);
+ TTVaccineCare ttVaccineCare = new TTVaccineCare(patient, expectedDeliveryDate, newDate(ancVO.getRegistrationDate()),
+ activeCareSchedules.hasActiveTTSchedule(), ancCareHistoryVO.getLastTT(), lastTTDate);
+
+ Date lastIPTDate = getLastIPTDate(ancCareHistoryVO,expectedDeliveryDate);
+ IPTVaccineCare iptVaccineCare = new IPTVaccineCare(patient, expectedDeliveryDate, activeCareSchedules.hasActiveIPTSchedule(), ancCareHistoryVO.getLastIPT(), lastIPTDate);
List<PatientCare> patientCares = new ANCCareRegistration(ttVaccineCare, iptVaccineCare, patient, expectedDeliveryDate).allCares();
enrollPatientCares(patientCares, patient);
}
+ private Date getLastIPTDate(ANCCareHistoryVO ancCareHistoryVO,LocalDate edd) {
+ IPTDose nextIPTMilestone = ancCareHistoryVO.getLastIPT()!=null ? getNextOf(IPTDose.byValue(ancCareHistoryVO.getLastIPT())) : null;
+ Date lastIPTDate = ancCareHistoryVO.getLastIPTDate();
+ if(lastIPTDate!=null && nextIPTMilestone!=null) {
+ lastIPTDate = getEnrollmentDate(ANC_IPT_VACCINE, DateUtil.newDate(lastIPTDate), nextIPTMilestone.milestone(),edd).toDate();
+ }
+ return lastIPTDate;
+ }
+
+ private Date getLastTTDate(ANCCareHistoryVO ancCareHistoryVO,LocalDate edd) {
+ Date lastTTDate = ancCareHistoryVO.getLastTTDate();
+ TTVaccineDosage nextTTMilestone = (ancCareHistoryVO.getLastTT()!=null) ? getNextOf(TTVaccineDosage.byValue(Integer.parseInt(ancCareHistoryVO.getLastTT()))) : null;
+ if(lastTTDate!=null && nextTTMilestone!=null) {
+ lastTTDate= getEnrollmentDate(TT_VACCINATION, DateUtil.newDate(lastTTDate), nextTTMilestone.getScheduleMilestoneName(),edd).toDate();
+ }
+ return lastTTDate;
+ }
+
ActiveCareSchedules activeCareSchedules(Patient patient, List<String> scheduleNames) {
ActiveCareSchedules activeCareSchedules = new ActiveCareSchedules();
for (String scheduleName : scheduleNames)
@@ -129,7 +154,7 @@ void enrollPatientCares(List<PatientCare> patientCares, Patient patient) {
}
}
- public void enrollChildForPNCOnDelivery(Patient child) {
+ public void enrollChildForPNC(Patient child) {
enrollPatientCares(child.pncBabyProgramsToEnrollOnRegistration(), child);
}
@@ -275,11 +300,14 @@ private void processANCHistories(CareHistoryVO careHistoryVO, Patient patient) {
if (activePregnancyObservation != null) {
Date edd = getEDD(patient.getMotechId());
+ LocalDate expectedDeliveryDate = newDate(edd);
ActiveCareSchedules activeCareSchedules = activeCareSchedules(patient, Arrays.asList(TT_VACCINATION, ANC_IPT_VACCINE));
+ Date lastTTDate = getLastTTDate(ancCareHistoryVO,expectedDeliveryDate);
+ TTVaccineCare ttVaccineCare = new TTVaccineCare(patient, expectedDeliveryDate, newDate(careHistoryVO.getDate()), activeCareSchedules.hasActiveTTSchedule(), ancCareHistoryVO.getLastTT(), lastTTDate);
- TTVaccineCare ttVaccineCare = new TTVaccineCare(patient, newDate(edd), newDate(careHistoryVO.getDate()), activeCareSchedules.hasActiveTTSchedule(), ancCareHistoryVO.getLastTT(), ancCareHistoryVO.getLastTTDate());
- IPTVaccineCare iptVaccineCare = new IPTVaccineCare(patient, newDate(edd), activeCareSchedules.hasActiveIPTSchedule(), ancCareHistoryVO.getLastIPT(), ancCareHistoryVO.getLastIPTDate());
+ Date lastIPTDate = getLastIPTDate(ancCareHistoryVO,expectedDeliveryDate);
+ IPTVaccineCare iptVaccineCare = new IPTVaccineCare(patient, expectedDeliveryDate, activeCareSchedules.hasActiveIPTSchedule(), ancCareHistoryVO.getLastIPT(), lastIPTDate);
final List<PatientCare> caresApplicableToTheCurrentPregnancy = CareHistory.forPregnancy(ttVaccineCare, iptVaccineCare).cares();
@@ -297,8 +325,23 @@ private void processANCHistories(CareHistoryVO careHistoryVO, Patient patient) {
}
}
+ public LocalDate getEnrollmentDate(String scheduleName, LocalDate lastCareTakenDate, String startMilestoneName,LocalDate edd) {
+ EnrollmentRequest enrollmentRequest = new EnrollmentRequest(null, scheduleName, null, null, null, lastCareTakenDate, new Time(0,0), startMilestoneName, null);
+ List<DateTime> dueWindowAlertTimings = allSchedules.getDueWindowAlertTimings(enrollmentRequest);
+ Pregnancy pregnancy = Pregnancy.basedOnDeliveryDate(edd);
+ if (!dueWindowAlertTimings.isEmpty() && dueWindowAlertTimings.get(0).isBeforeNow() && lastCareTakenDate.toDate().after(pregnancy.dateOfConception().toDate()))
+ return getDifferenceOfDates(dueWindowAlertTimings.get(0), DateUtil.newDateTime(lastCareTakenDate)).toLocalDate();
+ return lastCareTakenDate;
+ }
+
+ private DateTime getDifferenceOfDates(DateTime dueDate, DateTime lastCareTakenDate) {
+ Period period = new Period(lastCareTakenDate,dueDate);
+ return DateUtil.now().minus(period);
+ }
+
+
Date getEDD(String motechId) {
MRSObservation eddObservation = allObservations.findObservation(motechId, EDD.getName());
- return eddObservation!=null?(Date) eddObservation.getValue():null;
+ return eddObservation != null ? (Date) eddObservation.getValue() : null;
}
}
View
2 ...ational-core/src/main/java/org/motechproject/ghana/national/service/PregnancyService.java
@@ -103,7 +103,7 @@ public void handleDelivery(PregnancyDeliveryRequest request) {
allEncounters.persistEncounter(encounterFactory.createBirthEncounter(childRequest, savedChild.getMrsPatient(), staff, facility, birthDate));
careService.enroll(new CwcVO(staff.getSystemId(), facility.mrsFacilityId(), birthDate, savedChild.getMotechId(),
Collections.<CwcCareHistory>emptyList(), null, null, null, null, null, null, null, null, null, null, savedChild.getMotechId(), false));
- careService.enrollChildForPNCOnDelivery(savedChild);
+ careService.enrollChildForPNC(savedChild);
smsForEachChild.add(new SMSTemplate().fillPatientDetails(savedChild));
}
}
View
12 .../test/java/org/motechproject/ghana/national/configuration/TTVaccinationSchedulesTest.java
@@ -82,6 +82,18 @@ public void shouldVerifyTTVaccinationScheduleOnANCRegistration() throws Schedule
alert(late, onDate("2-Apr-2012"))));
}
+// @Test
+// public void shouldMoveDueDateAccordingToHistoryInput() throws SchedulerException {
+// mockToday(newDate("19-Apr-2012"));
+// EnrollmentRequest enrollmentRequest = new EnrollmentRequest(PATIENT_ID, scheduleName, preferredAlertTime, null, null, newDate("01-Mar-2012"), null, TTVaccineDosage.TT2.getScheduleMilestoneName(), null);
+// enrollmentId = scheduleTrackingService.enroll(enrollmentRequest);
+//
+// assertTestAlerts(captureAlertsForNextMilestone(enrollmentId), asList(
+// alert(late, onDate("19-Apr-2012")),
+// alert(late, onDate("26-Apr-2012")),
+// alert(late, onDate("3-May-2012"))));
+// }
+
private String scheduleAlertForTTVaccination(LocalDate firstDosageDate) {
EnrollmentRequest enrollmentRequest = new EnrollmentRequest(PATIENT_ID, scheduleName, preferredAlertTime, firstDosageDate, null, null, null, null, null);
return scheduleTrackingService.enroll(enrollmentRequest);
View
14 ...onal-core/src/test/java/org/motechproject/ghana/national/repository/AllSchedulesTest.java
@@ -7,10 +7,7 @@
import org.mockito.Mock;
import org.motechproject.model.Time;
import org.motechproject.scheduletracking.api.domain.exception.InvalidEnrollmentException;
-import org.motechproject.scheduletracking.api.service.EnrollmentRecord;
-import org.motechproject.scheduletracking.api.service.EnrollmentRequest;
-import org.motechproject.scheduletracking.api.service.EnrollmentsQuery;
-import org.motechproject.scheduletracking.api.service.ScheduleTrackingService;
+import org.motechproject.scheduletracking.api.service.*;
import java.util.Arrays;
import java.util.List;
@@ -135,4 +132,13 @@ public void shouldReturnActiveEnrollmentToAScheduleGivenAnEnrollmentIdAndSchedul
when(mockScheduleTrackingService.getEnrollment(externalId, scheduleName)).thenReturn(enrollmentRecord);
assertThat(enrollmentRecord, is(equalTo(allSchedules.getActiveEnrollment(externalId, scheduleName))));
}
+
+ @Test
+ public void shouldReturnDueAlertsGivenAnEnrollmentRequest() {
+ EnrollmentRequest request = new EnrollmentRequest("123", "scheduleName", new Time(12, 0), new LocalDate(), null, null, null, null, null);
+ MilestoneAlerts mockMilestoneAlerts = mock(MilestoneAlerts.class);
+ when(mockScheduleTrackingService.getAlertTimings(request)).thenReturn(mockMilestoneAlerts);
+ allSchedules.getDueWindowAlertTimings(request);
+ verify(mockMilestoneAlerts).getDueWindowAlertTimings();
+ }
}
View
84 ...national-core/src/test/java/org/motechproject/ghana/national/service/CareServiceTest.java
@@ -6,6 +6,7 @@
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
+import org.mockito.Matchers;
import org.mockito.Mock;
import org.motechproject.ghana.national.configuration.ScheduleNames;
import org.motechproject.ghana.national.domain.*;
@@ -111,6 +112,7 @@ public void shouldEnrollToCWCProgram() {
verify(mockAllEncounters).persistEncounter(mockMRSPatient, staffId, facilityId, CWC_REG_VISIT.value(), registrationDate, expected);
verify(careServiceSpy).enrollToCWCCarePrograms(cwcVO, mockPatient);
+ verify(careServiceSpy).enrollChildForPNC(mockPatient);
}
@Test
@@ -662,6 +664,86 @@ public void shouldCreateSchedulesForANCProgramRegistration() throws ObservationN
}
@Test
+ public void shouldCreateSchedulesForANCProgramRegistrationWhenDueDateForHistoryIsInPast() throws ObservationNotFoundException {
+ String patientId = "Id", patientMotechId = "motechId";
+ LocalDate registrationDate = newDate(2012, 3, 1);
+ mockCurrentDate(registrationDate);
+ LocalDate dateOfConception = registrationDate.minusMonths(6);
+ Pregnancy pregnancy = basedOnConceptionDate(dateOfConception);
+ final String ttDose = "1";
+ final String iptDose = "2";
+ final Date ttDate = dateOfConception.plusMonths(1).toDate();
+ final Date iptDate = dateOfConception.plusMonths(2).toDate();
+ CareService careServiceSpy = spy(careService);
+
+ setupPatient(patientId, patientMotechId);
+ final ANCVO ancvo = createTestANCVO(iptDose, iptDate, ttDose, ttDate, RegistrationToday.IN_PAST, registrationDate.toDate(), "facilityId", null,
+ patientMotechId, Arrays.asList(ANCCareHistory.values()), pregnancy.dateOfDelivery().toDate());
+
+ final MRSObservation activePregnancyObservation = new MRSObservation<Boolean>(registrationDate.toDate(), PREGNANCY.getName(), true);
+ activePregnancyObservation.addDependantObservation(new MRSObservation<Date>(registrationDate.toDate(), EDD.getName(), pregnancy.dateOfDelivery().toDate()));
+ activePregnancyObservation.addDependantObservation(new MRSObservation<Boolean>(registrationDate.toDate(), PREGNANCY_STATUS.getName(), true));
+ activePregnancyObservation.addDependantObservation(new MRSObservation<Boolean>(registrationDate.toDate(), CONFINEMENT_CONFIRMED.getName(), true));
+ activePregnancyObservation.addDependantObservation(new MRSObservation<Double>(ttDate, TT.getName(), parseDouble(ttDose)));
+ activePregnancyObservation.addDependantObservation(new MRSObservation<Double>(iptDate, IPT.getName(), parseDouble(iptDose)));
+ Set<MRSObservation> pregnancyObs = new HashSet<MRSObservation>() {{
+ add(activePregnancyObservation);
+ }};
+
+ doReturn(pregnancyObs).when(careServiceSpy).registerPregnancy(ancvo, mockPatient);
+
+ when(mockAllSchedules.getDueWindowAlertTimings(Matchers.<EnrollmentRequest>any())).thenReturn(Arrays.<DateTime>asList(newDateTime(dateOfConception.plusWeeks(10))));
+ careServiceSpy.enroll(ancvo);
+
+ ArgumentCaptor<EnrollmentRequest> requestCaptor = ArgumentCaptor.forClass(EnrollmentRequest.class);
+ verify(mockAllSchedules, times(3)).enroll(requestCaptor.capture());
+ List<EnrollmentRequest> requests = requestCaptor.getAllValues();
+ assertScheduleEnrollmentRequest(requests.get(0), expectedRequest(patientId, PatientCare.forEnrollmentFromStart(ScheduleNames.ANC_DELIVERY, dateOfConception, mockPatient.facilityMetaData())));
+ assertScheduleEnrollmentRequest(requests.get(1), expectedRequest(patientId, PatientCare.forEnrollmentInBetweenProgram(ScheduleNames.TT_VACCINATION, newDate(2012,1,23), TTVaccineDosage.TT2.getScheduleMilestoneName(), mockPatient.facilityMetaData())));
+ assertScheduleEnrollmentRequest(requests.get(2), expectedRequest(patientId, PatientCare.forEnrollmentInBetweenProgram(ScheduleNames.ANC_IPT_VACCINE, newDate(2012,2,21), IPTDose.SP3.milestone(), mockPatient.facilityMetaData())));
+ }
+
+ @Test
+ public void shouldCreateSchedulesForANCProgramRegistrationFromStartWhenDueDateForHistoryIsIrrelevantToCurrentPregnancy() throws ObservationNotFoundException {
+ String patientId = "Id", patientMotechId = "motechId";
+ LocalDate registrationDate = newDate(2012, 3, 1);
+ mockCurrentDate(registrationDate);
+ LocalDate dateOfConception = registrationDate.minusMonths(3);
+ Pregnancy pregnancy = basedOnConceptionDate(dateOfConception);
+ final String ttDose = "1";
+ final String iptDose = "2";
+ final Date ttDate = dateOfConception.minusWeeks(1).toDate();
+ final Date iptDate = dateOfConception.minusDays(3).toDate();
+ CareService careServiceSpy = spy(careService);
+
+ setupPatient(patientId, patientMotechId);
+ final ANCVO ancvo = createTestANCVO(iptDose, iptDate, ttDose, ttDate, RegistrationToday.IN_PAST, registrationDate.toDate(), "facilityId", null,
+ patientMotechId, Arrays.asList(ANCCareHistory.values()), pregnancy.dateOfDelivery().toDate());
+
+ final MRSObservation activePregnancyObservation = new MRSObservation<Boolean>(registrationDate.toDate(), PREGNANCY.getName(), true);
+ activePregnancyObservation.addDependantObservation(new MRSObservation<Date>(registrationDate.toDate(), EDD.getName(), pregnancy.dateOfDelivery().toDate()));
+ activePregnancyObservation.addDependantObservation(new MRSObservation<Boolean>(registrationDate.toDate(), PREGNANCY_STATUS.getName(), true));
+ activePregnancyObservation.addDependantObservation(new MRSObservation<Boolean>(registrationDate.toDate(), CONFINEMENT_CONFIRMED.getName(), true));
+ activePregnancyObservation.addDependantObservation(new MRSObservation<Double>(ttDate, TT.getName(), parseDouble(ttDose)));
+ activePregnancyObservation.addDependantObservation(new MRSObservation<Double>(iptDate, IPT.getName(), parseDouble(iptDose)));
+ Set<MRSObservation> pregnancyObs = new HashSet<MRSObservation>() {{
+ add(activePregnancyObservation);
+ }};
+
+ doReturn(pregnancyObs).when(careServiceSpy).registerPregnancy(ancvo, mockPatient);
+
+ when(mockAllSchedules.getDueWindowAlertTimings(Matchers.<EnrollmentRequest>any())).thenReturn(Arrays.<DateTime>asList(newDateTime(dateOfConception.plusWeeks(10))));
+ careServiceSpy.enroll(ancvo);
+
+ ArgumentCaptor<EnrollmentRequest> requestCaptor = ArgumentCaptor.forClass(EnrollmentRequest.class);
+ verify(mockAllSchedules, atLeastOnce()).enroll(requestCaptor.capture());
+ List<EnrollmentRequest> requests = requestCaptor.getAllValues();
+ assertScheduleEnrollmentRequest(requests.get(0), expectedRequest(patientId, PatientCare.forEnrollmentFromStart(ScheduleNames.ANC_DELIVERY, dateOfConception, mockPatient.facilityMetaData())));
+ assertScheduleEnrollmentRequest(requests.get(1), expectedRequest(patientId, PatientCare.forEnrollmentFromStart(ScheduleNames.TT_VACCINATION, registrationDate, mockPatient.facilityMetaData())));
+ assertScheduleEnrollmentRequest(requests.get(2), expectedRequest(patientId, PatientCare.forEnrollmentFromStart(ScheduleNames.ANC_IPT_VACCINE, dateOfConception, mockPatient.facilityMetaData())));
+ }
+
+ @Test
public void shouldGetActiveCareSchedulesForAPatient() {
String patientId = "patientId";
setupPatient(patientId, "patientMotechId");
@@ -740,7 +822,7 @@ public void shouldCreatePNCSchedulesForChild() {
when(mockPatient.pncBabyProgramsToEnrollOnRegistration()).thenReturn(asList(pnc1, pnc2));
when(mockPatient.dateOfBirth()).thenReturn(birthDateTime);
- careService.enrollChildForPNCOnDelivery(mockPatient);
+ careService.enrollChildForPNC(mockPatient);
ArgumentCaptor<EnrollmentRequest> requestCaptor = ArgumentCaptor.forClass(EnrollmentRequest.class);
verify(mockAllSchedules, times(2)).enroll(requestCaptor.capture());
List<EnrollmentRequest> requests = requestCaptor.getAllValues();
View
2 ...nal-core/src/test/java/org/motechproject/ghana/national/service/PregnancyServiceTest.java
@@ -177,7 +177,7 @@ public void shouldCreateEncounterForPregnancyDelivery_AndForBirth() {
verify(mockAllEncounters, times(2)).persistEncounter(encounterArgumentCaptor.capture());
verify(mockAllPatients).save(patientArgumentCaptor.capture());
orderVerifyToSendSMSAtTheEnd.verify(mockCareService).enroll(cwcVOArgumentCaptor.capture());
- orderVerifyToSendSMSAtTheEnd.verify(mockCareService).enrollChildForPNCOnDelivery(child);
+ orderVerifyToSendSMSAtTheEnd.verify(mockCareService).enrollChildForPNC(child);
List<Encounter> encounters = encounterArgumentCaptor.getAllValues();
assertThat(encounters.size(), is(equalTo(2)));
View
2 ...st/java/org/motechproject/ghana/national/functional/mobile/ClientQueryFormUploadTest.java
@@ -160,7 +160,7 @@ public void shouldQueryUpcomingCareSchedules() throws IOException {
assertThat(responseBodyAsString, containsString(patientId));
assertThat(responseBodyAsString, containsString(patient.firstName()));
- assertThat(responseBodyAsString, containsString("IPT2"));
+ assertThat(responseBodyAsString, containsString("TT1"));
assertThat(responseBodyAsString, containsString(today().toString(Constants.PATTERN_DD_MMM_YYYY)));
}

0 comments on commit 38003fb

Please sign in to comment.
Something went wrong with that request. Please try again.