Skip to content

Commit

Permalink
Merge pull request #158 from OpenSRP/issue1593-minor-fixes
Browse files Browse the repository at this point in the history
Backward compatibility fixes and code refactoring
  • Loading branch information
qaziabubakar-vd authored Jan 11, 2021
2 parents bf7b046 + 3aa4c76 commit d33b10d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=3.0.3-SNAPSHOT
VERSION_NAME=3.0.4-SNAPSHOT
VERSION_CODE=2
GROUP=org.smartregister
POM_SETTING_DESCRIPTION=OpenSRP Client Immunization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,27 @@ public Vaccine(Long id, String baseEntityId, String name, Integer calculation, D
this.outOfCatchment = outOfCatchment;
}

public Vaccine(Long id, String baseEntityId, String programClientId, String name, Integer
calculation, Date date, String anmId, String locationId, String syncStatus, String
hia2Status, Long updatedAt, String eventId, String formSubmissionId, Integer
outOfCatchment, Date createdAt) {
this.id = id;
this.baseEntityId = baseEntityId;
this.programClientId = programClientId;
this.name = name;
this.calculation = calculation;
this.date = date;
this.anmId = anmId;
this.locationId = locationId;
this.syncStatus = syncStatus;
this.hia2Status = hia2Status;
this.updatedAt = updatedAt;
this.eventId = eventId;
this.formSubmissionId = formSubmissionId;
this.outOfCatchment = outOfCatchment;
this.createdAt = createdAt;
}

public Vaccine(Long id, String baseEntityId, String programClientId, String name, Integer
calculation, Date date, String anmId, String locationId, String syncStatus, String
hia2Status, Long updatedAt, String eventId, String formSubmissionId, Integer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,8 @@ protected void onHandleIntent(Intent intent) {
//log out of catchment service since this is required in some of the hia2 report indicators
if (vaccine.getBaseEntityId() == null || vaccine.getBaseEntityId().isEmpty() || new Integer(1).equals(vaccine.getOutOfCatchment())) {
JsonFormUtils.createVaccineEvent(getApplicationContext(), vaccine, getEventTypeOutOfCatchment(), getEntityType(), jsonArray);

}
if (vaccine.getBaseEntityId() == null || vaccine.getBaseEntityId().isEmpty() || new Integer(1).equals(vaccine.getOutOfCatchment())) {
JsonFormUtils.createVaccineEvent(getApplicationContext(), vaccine, getEventTypeIsVoided(), getEntityType(), jsonArray);

}
vaccineRepository.close(vaccine.getId());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class VaccineScheduleTest extends BaseUnitTest {
private Vaccine newVaccine = new Vaccine(0l, VaccineTest.BASEENTITYID, VaccineTest.PROGRAMCLIENTID, magicOPV0, 0,
new Date(),
VaccineTest.ANMID, VaccineTest.LOCATIONID, VaccineTest.SYNCSTATUS, VaccineTest.HIA2STATUS, 0l,
VaccineTest.EVENTID, VaccineTest.FORMSUBMISSIONID, 0, new Date(), 1);
VaccineTest.EVENTID, VaccineTest.FORMSUBMISSIONID, 0, new Date());

@Before
public void setUp() {
Expand Down

0 comments on commit d33b10d

Please sign in to comment.