Skip to content

Commit

Permalink
GA is hidden if the its past 40 weeks
Browse files Browse the repository at this point in the history
  • Loading branch information
junaidwarsivd committed Jan 25, 2022
1 parent 532d842 commit b9a8dd0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,12 @@ public void refreshProfileTopSection(Map<String, String> client) {
.setProfileName(client.get(DBConstantsUtils.KeyUtils.FIRST_NAME) + " " + client.get(DBConstantsUtils.KeyUtils.LAST_NAME));
getProfileView().setProfileAge(String.valueOf(Utils.getAgeFromDate(client.get(DBConstantsUtils.KeyUtils.DOB))));
try {
getProfileView().setProfileGestationAge(
client.containsKey(DBConstantsUtils.KeyUtils.EDD) && client.get(DBConstantsUtils.KeyUtils.EDD) != null ?
String.valueOf(Utils.getGestationAgeFromEDDate(client.get(DBConstantsUtils.KeyUtils.EDD))) : null);
if(client.containsKey(DBConstantsUtils.KeyUtils.EDD) && client.get(DBConstantsUtils.KeyUtils.EDD) != null)
if(Utils.getGestationAgeFromEDDate(client.get(DBConstantsUtils.KeyUtils.EDD)) <= 40) {
getProfileView().setProfileGestationAge(
String.valueOf(Utils.getGestationAgeFromEDDate(client.get(DBConstantsUtils.KeyUtils.EDD))));
}

} catch (Exception e) {
getProfileView().setProfileGestationAge("0");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,13 @@ private void populatePatientColumn(CommonPersonObjectClient pc, SmartRegisterCli

if(!StringUtils.isBlank(edd))
{
fillValue(viewHolder.ga,String.format(context.getString(R.string.ga_text), Utils.getGestationAgeFromEDDate(edd)));
if(Utils.getGestationAgeFromEDDate(edd) <= 40) {
fillValue(viewHolder.ga, String.format(context.getString(R.string.ga_text), Utils.getGestationAgeFromEDDate(edd)));
}
else
{
fillValue(viewHolder.ga,"");
}
}
else
fillValue(viewHolder.ga,"");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,15 @@ private void populatePatientColumn(CommonPersonObjectClient pc, SmartRegisterCli
String edd = Utils.getValue(pc.getColumnmaps(), DBConstantsUtils.KeyUtils.EDD, false);

if (StringUtils.isNotBlank(edd)) {
fillValue((viewHolder.ga),
String.format(context.getString(R.string.ga_text), Utils.getGestationAgeFromEDDate(edd)));
viewHolder.period.setVisibility(View.VISIBLE);
if(Utils.getGestationAgeFromEDDate(edd) > 40)
{
fillValue(viewHolder.ga, "");
}
else {
fillValue((viewHolder.ga),
String.format(context.getString(R.string.ga_text), Utils.getGestationAgeFromEDDate(edd)));
viewHolder.period.setVisibility(View.VISIBLE);
}
} else {

fillValue((viewHolder.ga), "");
Expand Down

0 comments on commit b9a8dd0

Please sign in to comment.