From c74c5f87ff316847948b3cf37e85979417879b66 Mon Sep 17 00:00:00 2001 From: mahmud6390 Date: Thu, 15 Oct 2020 13:32:28 +0600 Subject: [PATCH] CR --- .../main/assets/json.form/hnpp_anc_pregnancy_outcome.json | 2 +- .../assets/json.form/hnpp_member_referral_followup.json | 2 ++ .../src/main/assets/json.form/hnpp_women_referral.json | 2 +- .../activity/HnppFamilyOtherMemberProfileActivity.java | 4 +--- .../brac/hnpp/fragment/HnppChildProfileDueFragment.java | 2 +- .../org/smartregister/brac/hnpp/model/DashBoardModel.java | 2 +- .../smartregister/brac/hnpp/model/SearchHHMemberModel.java | 3 +-- .../brac/hnpp/provider/HNPPMemberRegisterProvider.java | 3 --- .../brac/hnpp/provider/HnppAncRegisterProvider.java | 5 ++--- .../brac/hnpp/provider/HnppFamilyDueRegisterProvider.java | 3 +-- .../brac/hnpp/provider/HnppPncRegisterProvider.java | 7 ------- .../org/smartregister/brac/hnpp/utils/HnppDBUtils.java | 6 +++--- 12 files changed, 14 insertions(+), 27 deletions(-) diff --git a/opensrp-brac-hnpp/src/main/assets/json.form/hnpp_anc_pregnancy_outcome.json b/opensrp-brac-hnpp/src/main/assets/json.form/hnpp_anc_pregnancy_outcome.json index 504f711d0..340b41714 100644 --- a/opensrp-brac-hnpp/src/main/assets/json.form/hnpp_anc_pregnancy_outcome.json +++ b/opensrp-brac-hnpp/src/main/assets/json.form/hnpp_anc_pregnancy_outcome.json @@ -750,7 +750,7 @@ "err": "নাম লিখুন" }, "v_regex": { - "value": "^[a-zA-Z][A-Za-z\\.\\- ]*", + "value": "^[\\.\\- ]*", "err": "একটি বৈধ নাম লিখুন" }, "calculation": { diff --git a/opensrp-brac-hnpp/src/main/assets/json.form/hnpp_member_referral_followup.json b/opensrp-brac-hnpp/src/main/assets/json.form/hnpp_member_referral_followup.json index a32527864..d6b8cf9be 100644 --- a/opensrp-brac-hnpp/src/main/assets/json.form/hnpp_member_referral_followup.json +++ b/opensrp-brac-hnpp/src/main/assets/json.form/hnpp_member_referral_followup.json @@ -69,6 +69,7 @@ "values": [ "গর্ভাবস্থার সমস্যা", "প্রসবে সমস্যা", + "প্রসব পরবর্তী সমস্যা", "শিশু বিষয়ক সমস্যা", "চোখে সমস্যা", "ডায়বেটিস", @@ -79,6 +80,7 @@ "openmrs_choice_ids": { "গর্ভাবস্থার সমস্যা": "pregnancy_problems", "প্রসবে সমস্যা": "delivery_problems", + "প্রসব পরবর্তী সমস্যা": "pnc_problem", "শিশু বিষয়ক সমস্যা": "child_problems", "চোখে সমস্যা": "problems_eyes", "ডায়বেটিস": "diabetes", diff --git a/opensrp-brac-hnpp/src/main/assets/json.form/hnpp_women_referral.json b/opensrp-brac-hnpp/src/main/assets/json.form/hnpp_women_referral.json index e3568bd9d..755ec3062 100644 --- a/opensrp-brac-hnpp/src/main/assets/json.form/hnpp_women_referral.json +++ b/opensrp-brac-hnpp/src/main/assets/json.form/hnpp_women_referral.json @@ -146,7 +146,7 @@ "openmrs_entity": "", "openmrs_entity_id": "", "type": "toaster_notes", - "text": "প্রসব পরবর্তী সমস্যা : \n ১.42 দিন ভারি কাজ করা যাবে না\n ২.7 থেকে 10 দিন পূর্ণ বিশ্রামে থাকবে\n ৩. সেনেটারী ন্যাপকিন ব্যবহার করতে হবে\n ৪.প্রসবের ছয় সপ্তাহ পর্যন্ত স্বামী সহবাস করা যাবে না\n ৫. প্রতিদিন গোসল করতে হবে স্তন পরিষ্কার রাখতে হবে\n", + "text": "প্রসব পরবর্তী সমস্যা : \n১.42 দিন ভারি কাজ করা যাবে না\n২.7 থেকে 10 দিন পূর্ণ বিশ্রামে থাকবে\n৩. সেনেটারী ন্যাপকিন ব্যবহার করতে হবে\n৪.প্রসবের ছয় সপ্তাহ পর্যন্ত স্বামী সহবাস করা যাবে না\n৫.প্রতিদিন গোসল করতে হবে স্তন পরিষ্কার রাখতে হবে\n", "text_color": "#CF0800", "toaster_type": "info", "relevance": { diff --git a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/activity/HnppFamilyOtherMemberProfileActivity.java b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/activity/HnppFamilyOtherMemberProfileActivity.java index df2403f65..0c7352510 100644 --- a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/activity/HnppFamilyOtherMemberProfileActivity.java +++ b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/activity/HnppFamilyOtherMemberProfileActivity.java @@ -167,9 +167,7 @@ public void setProfileName(String fullName) { try{ String[] str = fullName.split(","); this.textViewName.setText(str[0]); - String dobString = org.smartregister.family.util.Utils.getDuration(org.smartregister.family.util.Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.DOB, false)); - String ageStr = WordUtils.capitalize(org.smartregister.family.util.Utils.getTranslatedDate(dobString, this)); - this.textViewAge.setText(getString(R.string.age,ageStr)); + this.textViewAge.setText(getString(R.string.age,str[1])); }catch (Exception e){ diff --git a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/fragment/HnppChildProfileDueFragment.java b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/fragment/HnppChildProfileDueFragment.java index 4ab645175..5422a802f 100644 --- a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/fragment/HnppChildProfileDueFragment.java +++ b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/fragment/HnppChildProfileDueFragment.java @@ -175,7 +175,7 @@ public void goToChildProfileActivity(View view) { } View encView; public void updateChildDueEntry(int type, String serviceName, String dueDate){ - if(otherServiceView==null)return; + if(otherServiceView==null || TextUtils.isEmpty(serviceName))return; serviceName = HnppConstants.immunizationMapping.get(serviceName.toUpperCase()); // if(handler !=null){ // handler.postDelayed(new Runnable() { diff --git a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/model/DashBoardModel.java b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/model/DashBoardModel.java index 6cb2bd29e..83d4f509c 100644 --- a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/model/DashBoardModel.java +++ b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/model/DashBoardModel.java @@ -68,7 +68,7 @@ public ArrayList getDashData(String todate, String fromDate){ cursor.close(); } - int countSimprints = HnppDBUtils.getCoutByFingerPrint(); + int countSimprints = HnppDBUtils.getCoutByFingerPrint(fromDate,todate); if(countSimprints>0){ DashBoardData dashBoardData1 = new DashBoardData(); dashBoardData1.setCount(countSimprints); diff --git a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/model/SearchHHMemberModel.java b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/model/SearchHHMemberModel.java index c7998f74c..33e7eb070 100644 --- a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/model/SearchHHMemberModel.java +++ b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/model/SearchHHMemberModel.java @@ -127,9 +127,8 @@ public ArrayList fetchAdo(String village, String claster){ hhMemberProperty.setId(id.length() > HnppConstants.MEMBER_ID_SUFFIX?id.substring(id.length() - HnppConstants.MEMBER_ID_SUFFIX):id); hhMemberProperty.setBaseEntityId(cursor.getString(cursor.getColumnIndex("base_entity_id"))); String dobString = Utils.getDuration(cursor.getString(cursor.getColumnIndex("dob"))); - String ageStr = WordUtils.capitalize(org.smartregister.family.util.Utils.getTranslatedDate(dobString, HnppApplication.getHNPPInstance())); - hhMemberProperty.setAge(ageStr); + hhMemberProperty.setAge(dobString); adoArrayList.add(hhMemberProperty); cursor.moveToNext(); } diff --git a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/provider/HNPPMemberRegisterProvider.java b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/provider/HNPPMemberRegisterProvider.java index ae56273ce..390df296a 100644 --- a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/provider/HNPPMemberRegisterProvider.java +++ b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/provider/HNPPMemberRegisterProvider.java @@ -128,9 +128,6 @@ private void populatePatientColumn(CommonPersonObjectClient pc, SmartRegisterCli viewHolder.profile.setImageResource(org.smartregister.family.util.Utils.getMemberProfileImageResourceIDentifier(entityType)); viewHolder.nextArrow.setVisibility(View.GONE); } else { - String ageStr = WordUtils.capitalize(org.smartregister.family.util.Utils.getTranslatedDate(dob, context)); - - patientName = patientName + "\n" + ageStr; viewHolder.patientNameAge.setFontVariant(FontVariant.REGULAR); viewHolder.patientNameAge.setTextColor(-16777216); diff --git a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/provider/HnppAncRegisterProvider.java b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/provider/HnppAncRegisterProvider.java index 2203fbbf1..85ab3c5c8 100644 --- a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/provider/HnppAncRegisterProvider.java +++ b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/provider/HnppAncRegisterProvider.java @@ -51,16 +51,15 @@ protected void populatePatientColumn(@NotNull CommonPersonObjectClient pc, Smart String dobString = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.DOB, false); String lmpString = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.LAST_MENSTRUAL_PERIOD, false); if (StringUtils.isNotBlank(dobString) && StringUtils.isNotBlank(lmpString)) { - //int age = Years.yearsBetween(new DateTime(dobString), new DateTime()).getYears(); + int age = Years.yearsBetween(new DateTime(dobString), new DateTime()).getYears(); String gaLocation = MessageFormat.format("{0}: {1} {2} {3}", context.getString(R.string.gestation_age_initial), NCUtils.gestationAgeString(lmpString, context, false), context.getString(R.string.abbrv_weeks), context.getString(R.string.interpunct)); - String ageStr = WordUtils.capitalize(org.smartregister.family.util.Utils.getTranslatedDate(dobString, context)); - String patientNameAge = MessageFormat.format("{0},{1}: {2}", patientName,context.getString(R.string.boyos), ageStr); + String patientNameAge = MessageFormat.format("{0},{1}: {2}", patientName,context.getString(R.string.boyos), age); viewHolder.patientName.setText(patientNameAge); viewHolder.patientAge.setText(gaLocation); diff --git a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/provider/HnppFamilyDueRegisterProvider.java b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/provider/HnppFamilyDueRegisterProvider.java index 23c7e64cd..6c2f30c10 100644 --- a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/provider/HnppFamilyDueRegisterProvider.java +++ b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/provider/HnppFamilyDueRegisterProvider.java @@ -117,9 +117,8 @@ private void populatePatientColumn(CommonPersonObjectClient pc, SmartRegisterCli } fillValue(viewHolder.patientNameAge, patientName); viewHolder.lastVisit.setVisibility(View.VISIBLE); - String ageStr = WordUtils.capitalize(org.smartregister.family.util.Utils.getTranslatedDate(dob, context)); - viewHolder.lastVisit.setText(context.getString(R.string.age,ageStr) ); + viewHolder.lastVisit.setText(context.getString(R.string.age,dobString) ); // Update UI cutoffs viewHolder.patientNameAge.setTextSize(TypedValue.COMPLEX_UNIT_PX, context.getResources().getDimensionPixelSize(R.dimen.member_due_list_title_size)); diff --git a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/provider/HnppPncRegisterProvider.java b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/provider/HnppPncRegisterProvider.java index 1c604a48b..bf33fcb17 100644 --- a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/provider/HnppPncRegisterProvider.java +++ b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/provider/HnppPncRegisterProvider.java @@ -51,14 +51,7 @@ public void getView(Cursor cursor, SmartRegisterClient client, RegisterViewHolde CommonPersonObjectClient pc = (CommonPersonObjectClient) client; String patientName = Utils.getValue(pc.getColumnmaps(), "first_name", true); - // calculate LMP - String dobString = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.DOB, false); - if(StringUtils.isNotBlank(dobString)){ - String ageStr = WordUtils.capitalize(org.smartregister.family.util.Utils.getTranslatedDate(dobString, context)); - String patientNameAge = MessageFormat.format("{0},{1}: {2}", patientName,context.getString(R.string.boyos), ageStr); - viewHolder.patientNameAndAge.setText(patientNameAge); - } String serialNo = org.smartregister.family.util.Utils.getValue(pc.getColumnmaps(), HnppConstants.KEY.SERIAL_NO, true); if(serialNo.isEmpty() || serialNo.equalsIgnoreCase("H")){ serialNo=""; diff --git a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/utils/HnppDBUtils.java b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/utils/HnppDBUtils.java index 5c0986614..5c756068e 100644 --- a/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/utils/HnppDBUtils.java +++ b/opensrp-brac-hnpp/src/main/java/org/smartregister/brac/hnpp/utils/HnppDBUtils.java @@ -131,8 +131,8 @@ public static String getGuid(String baseEntityId){ } return birthWeight; } - public static int getCoutByFingerPrint(){ - String query = "select count(*) from ec_family_member where gu_id IS NOT NULL and gu_id !='test'"; + public static int getCoutByFingerPrint(String startTime, String endTime){ + String query = "select count(*) from ec_family_member where gu_id IS NOT NULL and gu_id !='test' and strftime('%Y-%m-%d', datetime((last_interacted_with)/1000,'unixepoch') ) BETWEEN '"+startTime+"' AND '"+endTime+"'"; Cursor cursor = null; int count=0; try { @@ -151,7 +151,7 @@ public static int getCoutByFingerPrint(){ } public static String[] getBaseEntityByGuId(String guid){ - String query = "select ec_family_member.base_entity_id,ec_family_member.first_name,ec_family_member.unique_id,ec_family.first_name,ec_family_member.dob,ec_family_member. from ec_family_member LEFT JOIN ec_family ON ec_family_member.relational_id = ec_family.id COLLATE NOCASE where ec_family_member.gu_id = '"+guid+"'"; + String query = "select ec_family_member.base_entity_id,ec_family_member.first_name,ec_family_member.unique_id,ec_family.first_name,ec_family_member.dob from ec_family_member LEFT JOIN ec_family ON ec_family_member.relational_id = ec_family.id COLLATE NOCASE where ec_family_member.gu_id = '"+guid+"'"; Cursor cursor = null; String[] strings = new String[5]; try {