Skip to content

Commit

Permalink
RA|made vaccine cards for women work
Browse files Browse the repository at this point in the history
  • Loading branch information
raihan-mpower committed Jul 27, 2017
1 parent 1784b05 commit 0fcdd53
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion opensrp-path/src/main/assets/mother_vaccines.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"expiry": [
{
"reference": "dob",
"offset": "+130000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d"
"offset": "+10000d"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ protected Map<String, NamedObject<?>> doInBackground(Void... voids) {
String dobString = Utils.getValue(childDetails.getColumnmaps(), "dob", false);
if (!TextUtils.isEmpty(dobString)) {
DateTime dateTime = new DateTime(dobString);
VaccineSchedule.updateOfflineAlerts(childDetails.entityId(), dateTime, "child");
VaccineSchedule.updateOfflineAlerts(childDetails.entityId(), dateTime, "mother");
}

List<Vaccine> vaccineList = new ArrayList<>();
Expand Down Expand Up @@ -1259,7 +1259,7 @@ protected Void doInBackground(Void... params) {
String dobString = Utils.getValue(childDetails.getColumnmaps(), "dob", false);
if (!TextUtils.isEmpty(dobString)) {
DateTime dateTime = new DateTime(dobString);
affectedVaccines = VaccineSchedule.updateOfflineAlerts(childDetails.entityId(), dateTime, "child");
affectedVaccines = VaccineSchedule.updateOfflineAlerts(childDetails.entityId(), dateTime, "mother");
vaccineList = vaccineRepository.findByEntityId(childDetails.entityId());
alertList = alertService.findByEntityIdAndAlertNames(childDetails.entityId(),
VaccinateActionUtils.allAlertNames("child"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,18 +464,19 @@ public ContentValues processCaseModel(JSONObject entity, JSONObject clientClassi
@Override
public void updateFTSsearch(String tableName, String entityId, ContentValues contentValues) {
super.updateFTSsearch(tableName, entityId, contentValues);

if (contentValues != null && StringUtils.containsIgnoreCase(tableName, "child")) {
String dob = contentValues.getAsString("dob");

if (StringUtils.isBlank(dob)) {
return;
}

DateTime birthDateTime = new DateTime(dob);
VaccineSchedule.updateOfflineAlerts(entityId, birthDateTime, "child");
ServiceSchedule.updateOfflineAlerts(entityId, birthDateTime);
}
Log.v("tablename",tableName);
Log.v("contentValues",contentValues.toString());
// if (contentValues != null && StringUtils.containsIgnoreCase(tableName, "child")) {
// String dob = contentValues.getAsString("dob");
//
// if (StringUtils.isBlank(dob)) {
// return;
// }
//
// DateTime birthDateTime = new DateTime(dob);
// VaccineSchedule.updateOfflineAlerts(entityId, birthDateTime, "child");
// ServiceSchedule.updateOfflineAlerts(entityId, birthDateTime);
// }
if (contentValues != null && StringUtils.containsIgnoreCase(tableName, "mother")) {
String dob = contentValues.getAsString("dob");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public void updateWrapperStatus(VaccineWrapper tag) {
Map<String, Date> recievedVaccines = receivedVaccines(vaccineList);

String dobString = Utils.getValue(getChildDetails().getColumnmaps(), "dob", false);
List<Map<String, Object>> sch = generateScheduleList("woman", new DateTime(dobString), recievedVaccines, alertList);
List<Map<String, Object>> sch = generateScheduleList("mother", new DateTime(dobString), recievedVaccines, alertList);

for (Map<String, Object> m : sch) {
VaccineRepo.Vaccine vaccine = (VaccineRepo.Vaccine) m.get("vaccine");
Expand Down

0 comments on commit 0fcdd53

Please sign in to comment.