Skip to content

Commit

Permalink
CR
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmud6390 committed Oct 15, 2020
1 parent fbc5dab commit c74c5f8
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@
"err": "নাম লিখুন"
},
"v_regex": {
"value": "^[a-zA-Z][A-Za-z\\.\\- ]*",
"value": "^[\\.\\- ]*",
"err": "একটি বৈধ নাম লিখুন"
},
"calculation": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"values": [
"গর্ভাবস্থার সমস্যা",
"প্রসবে সমস্যা",
"প্রসব পরবর্তী সমস্যা",
"শিশু বিষয়ক সমস্যা",
"চোখে সমস্যা",
"ডায়বেটিস",
Expand All @@ -79,6 +80,7 @@
"openmrs_choice_ids": {
"গর্ভাবস্থার সমস্যা": "pregnancy_problems",
"প্রসবে সমস্যা": "delivery_problems",
"প্রসব পরবর্তী সমস্যা": "pnc_problem",
"শিশু বিষয়ক সমস্যা": "child_problems",
"চোখে সমস্যা": "problems_eyes",
"ডায়বেটিস": "diabetes",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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){

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public ArrayList<DashBoardData> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,8 @@ public ArrayList<HHMemberProperty> 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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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="";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit c74c5f8

Please sign in to comment.