Skip to content

Commit

Permalink
Enable overriding the event type out of catchment event and entity va…
Browse files Browse the repository at this point in the history
…lues in VaccineIntentService
  • Loading branch information
ndegwamartin committed Apr 27, 2018
1 parent 87546ca commit ed7198a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 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=1.2.5
VERSION_NAME=1.2.10-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 @@ -78,10 +78,10 @@ protected void onHandleIntent(Intent intent) {
jsonObject.put(JsonFormUtils.VALUE, vaccine.getCalculation());
jsonArray.put(jsonObject);

JsonFormUtils.createVaccineEvent(getApplicationContext(), vaccine, EVENT_TYPE, ENTITY_TYPE, jsonArray);
JsonFormUtils.createVaccineEvent(getApplicationContext(), vaccine, getEventType(), getEntityType(), jsonArray);
//log out of catchment service since this is required in some of the hia2 report indicators
if (vaccine.getBaseEntityId() == null || vaccine.getBaseEntityId().isEmpty()) {
JsonFormUtils.createVaccineEvent(getApplicationContext(), vaccine, EVENT_TYPE_OUT_OF_CATCHMENT, ENTITY_TYPE, jsonArray);
JsonFormUtils.createVaccineEvent(getApplicationContext(), vaccine, getEventTypeOutOfCatchment(), getEntityType(), jsonArray);

}
vaccineRepository.close(vaccine.getId());
Expand Down Expand Up @@ -118,4 +118,20 @@ public int onStartCommand(Intent intent, int flags, int startId) {
vaccineRepository = ImmunizationLibrary.getInstance().vaccineRepository();
return super.onStartCommand(intent, flags, startId);
}

protected String getEventType() {

return EVENT_TYPE;

}

protected String getEventTypeOutOfCatchment() {
return EVENT_TYPE_OUT_OF_CATCHMENT;
}

protected String getEntityType() {

return ENTITY_TYPE;

}
}

0 comments on commit ed7198a

Please sign in to comment.