diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/model/WashCheckModel.java b/opensrp-chw/src/main/java/org/smartregister/chw/model/WashCheckModel.java index d02c12682d..e7a033f31a 100644 --- a/opensrp-chw/src/main/java/org/smartregister/chw/model/WashCheckModel.java +++ b/opensrp-chw/src/main/java/org/smartregister/chw/model/WashCheckModel.java @@ -1,5 +1,7 @@ package org.smartregister.chw.model; +import com.google.gson.Gson; + import org.smartregister.chw.anc.AncLibrary; import org.smartregister.chw.anc.domain.Visit; import org.smartregister.chw.anc.domain.VisitDetail; @@ -27,6 +29,7 @@ public boolean saveWashCheckEvent(String jsonString) { baseEvent.setBaseEntityId(familyId); Visit visit = NCUtils.eventToVisit(baseEvent); + visit.setPreProcessedJson(new Gson().toJson(baseEvent)); AncLibrary.getInstance().visitRepository().addVisit(visit); for (Map.Entry> entry : visit.getVisitDetails().entrySet()) { if (entry.getValue() != null) { @@ -35,13 +38,6 @@ public boolean saveWashCheckEvent(String jsonString) { } } } - /* if (ChwApplication.getApplicationFlavor().launchWashCheckOnNativeForm()) { - // delete any previous wash check event - List visitIds = WashCheckDao.getLastWashCheckVisitId(familyId); - for (int i = 0; i < visitIds.size() - 1; i++) { - AncLibrary.getInstance().visitRepository().deleteVisit(visitIds.get(i)); - } - } */ NCUtils.addEvent(allSharedPreferences, baseEvent); NCUtils.startClientProcessing(); return true;