Skip to content

Commit

Permalink
Remove vaccine name spaces & split exclusive vaccines for easy matchi…
Browse files Browse the repository at this point in the history
…ng with hardcoded VaccineRepo.Vaccine names

Update snapshot to 1.4.23
  • Loading branch information
ekigamba committed Sep 9, 2019
1 parent 26ae048 commit 8e639ab
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=1.4.22-SNAPSHOT
VERSION_NAME=1.4.23-SNAPSHOT
VERSION_CODE=2
GROUP=org.smartregister
POM_SETTING_DESCRIPTION=OpenSRP Client Immunization
Expand All @@ -10,4 +10,4 @@ POM_SETTING_LICENCE_NAME=The Apache Software License, Version 2.0
POM_SETTING_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_SETTING_LICENCE_DIST=repo
POM_SETTING_DEVELOPER_ID=opensrp
POM_SETTING_DEVELOPER_NAME=OpenSRP Onadev
POM_SETTING_DEVELOPER_NAME=OpenSRP Onadev
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.smartregister.immunization;

import android.support.annotation.NonNull;
import android.text.TextUtils;

import org.smartregister.Context;
import org.smartregister.commonregistry.CommonFtsObject;
Expand Down Expand Up @@ -171,8 +172,22 @@ public HashMap<String, String> getVaccineGroupings(@NonNull android.content.Cont
for (Vaccine vaccine: vaccineGroup.vaccines) {
String shortVaccineName = vaccine.getName()
.trim()
.replace(" ", "");
vaccineGrouping.put(shortVaccineName, groupName);
.replace(" ", "")
.toLowerCase();

if (!TextUtils.isEmpty(shortVaccineName)) {
if (vaccine.getVaccineSeparator() != null && shortVaccineName.contains(vaccine.getVaccineSeparator().trim())) {
String[] individualVaccines = shortVaccineName.split(vaccine.getVaccineSeparator().trim());

for (String individualVaccine: individualVaccines) {
if (!TextUtils.isEmpty(individualVaccine)) {
vaccineGrouping.put(individualVaccine, groupName);
}
}
} else {
vaccineGrouping.put(shortVaccineName, groupName);
}
}
}
}
}
Expand Down

0 comments on commit 8e639ab

Please sign in to comment.