Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion opensrp-anc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ dependencies {
exclude group: 'org.yaml', module: 'snakeyaml'
exclude group: 'io.ona.rdt-capture', module: 'lib'
}
implementation('org.smartregister:opensrp-client-core:6.1.2-SNAPSHOT@aar') {
implementation('org.smartregister:opensrp-client-core:6.1.5-ALPHA8-SNAPSHOT@aar') {
transitive = true
exclude group: 'com.github.bmelnychuk', module: 'atv'
exclude group: 'com.google.guava', module: 'guava'
Expand Down Expand Up @@ -259,6 +259,7 @@ dependencies {
implementation 'org.jacoco:org.jacoco.agent:0.8.7:runtime'
testImplementation 'org.jacoco:org.jacoco.agent:0.8.7:runtime'
implementation 'org.smartregister:android-p2p-sync:0.4.0-DEV-SNAPSHOT'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-joda'

testImplementation 'junit:junit:4.13.1'
testImplementation 'org.apache.maven:maven-ant-tasks:2.1.3'
Expand All @@ -283,6 +284,7 @@ dependencies {
androidTestImplementation('androidx.test.espresso:espresso-core:3.4.0') {
exclude group: 'com.google.code.findbugs'
}
debugImplementation 'com.amitshekhar.android:debug-db-encrypt:1.0.6'
}

task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', /*'createDebugCoverageReport'*/]) {
Expand Down
4 changes: 3 additions & 1 deletion opensrp-anc/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
android:name="org.smartregister.sync.intent.P2pProcessRecordsService"
android:description="@string/component_desc_p2p_process_records_service"
android:exported="false" />

<service
android:name="org.smartregister.sync.intent.SettingsSyncIntentService"
android:permission="android.permission.FOREGROUND_SERVICE"/>
</application>

</manifest>
6 changes: 3 additions & 3 deletions opensrp-anc/src/main/assets/config/profile-overview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ fields:
---
sub_group: current_pregnancy
fields:
- template: "{{profile_overview.overview_of_pregnancy.current_pregnancy.ga}}: {gest_age}"
relevance: "gest_age != ''"
isRedFont: "gest_age > 40"
- template: "{{profile_overview.overview_of_pregnancy.current_pregnancy.ga}}: {current_gest_age}"
relevance: "current_gest_age != ''"
isRedFont: "current_gest_age > 40"

- template: "{{profile_overview.overview_of_pregnancy.current_pregnancy.edd}}: {edd}"
relevance: "edd != ''"
Expand Down
17 changes: 15 additions & 2 deletions opensrp-anc/src/main/assets/ec_client_fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@
"field": "attributes.sector"
}

}
,
},
{
"column_name": "cell",
"type": "Client",
Expand All @@ -231,6 +230,13 @@
"json_mapping": {
"field": "attributes.visit_start_date"
}
},
{
"column_name": "visit_date",
"type": "Client",
"json_mapping": {
"field": "attributes.visit_date"
}
}
]
},
Expand Down Expand Up @@ -299,6 +305,13 @@
"json_mapping": {
"field": "addresses.address2"
}
},
{
"column_name": "data_migration_is_dirty",
"type": "Client",
"json_mapping": {
"field": "attributes.data_migration_is_dirty"
}
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion opensrp-anc/src/main/assets/json.form/anc_quick_check.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"type": "date_picker",
"hint": "Date of Contact",
"expanded": "false",
"min_date": "today-1m",
"min_date": "today-6m",
"max_date": "today",
"v_required": {
"value": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;

import com.amitshekhar.DebugDB;
import com.google.android.gms.vision.barcode.Barcode;
import com.google.android.material.bottomnavigation.LabelVisibilityMode;
import com.vijay.jsonwizard.activities.FormConfigurationJsonFormActivity;
Expand All @@ -28,6 +29,7 @@
import org.json.JSONObject;
import org.smartregister.AllConstants;
import org.smartregister.anc.library.AncLibrary;
import org.smartregister.anc.library.BuildConfig;
import org.smartregister.anc.library.R;
import org.smartregister.anc.library.contract.RegisterContract;
import org.smartregister.anc.library.domain.AttentionFlag;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
import android.Manifest;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ContentValues;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.AsyncTask;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
Expand All @@ -17,16 +19,25 @@
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.joda.JodaModule;

import org.apache.commons.lang3.StringUtils;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.joda.time.LocalDate;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.smartregister.anc.library.AncLibrary;
import org.smartregister.anc.library.R;
import org.smartregister.anc.library.adapter.ProfileViewPagerAdapter;
Expand All @@ -37,18 +48,31 @@
import org.smartregister.anc.library.fragment.ProfileOverviewFragment;
import org.smartregister.anc.library.fragment.ProfileTasksFragment;
import org.smartregister.anc.library.presenter.ProfilePresenter;
import org.smartregister.anc.library.repository.PatientRepository;
import org.smartregister.anc.library.rule.ContactRule;
import org.smartregister.anc.library.sync.BaseAncClientProcessorForJava;
import org.smartregister.anc.library.task.RegenerateContactSchedulesTask;
import org.smartregister.anc.library.util.ANCJsonFormUtils;
import org.smartregister.anc.library.util.ConstantsUtils;
import org.smartregister.anc.library.util.DBConstantsUtils;
import org.smartregister.anc.library.util.Utils;
import org.smartregister.anc.library.view.CopyToClipboardDialog;
import org.smartregister.domain.Event;
import org.smartregister.repository.AllSharedPreferences;
import org.smartregister.util.PermissionUtils;
import org.smartregister.util.StringUtil;
import org.smartregister.view.activity.BaseProfileActivity;

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;

import timber.log.Timber;

Expand Down Expand Up @@ -118,8 +142,10 @@ private void getButtonAlertStatus() {
detailMap = (HashMap<String, String>) getIntent().getSerializableExtra(ConstantsUtils.IntentKeyUtils.CLIENT_MAP);
contactNo = String.valueOf(Utils.getTodayContact(detailMap.get(DBConstantsUtils.KeyUtils.NEXT_CONTACT)));
buttonAlertStatus = Utils.processContactDoneToday(detailMap.get(DBConstantsUtils.KeyUtils.LAST_CONTACT_RECORD_DATE),
ConstantsUtils.AlertStatusUtils.ACTIVE.equals(detailMap.get(DBConstantsUtils.KeyUtils.CONTACT_STATUS)) ?
ConstantsUtils.AlertStatusUtils.IN_PROGRESS : "");
ConstantsUtils.AlertStatusUtils.ACTIVE.equals(detailMap.get(DBConstantsUtils.KeyUtils.CONTACT_STATUS)) ?
ConstantsUtils.AlertStatusUtils.IN_PROGRESS : "");


}

protected void updateTasksTabTitle() {
Expand Down Expand Up @@ -151,12 +177,18 @@ protected ViewPager setupViewPager(ViewPager viewPager) {
public void onClick(View view) {
if (view.getId() == R.id.profile_overview_due_button) {
String baseEntityId = getIntent().getStringExtra(ConstantsUtils.IntentKeyUtils.BASE_ENTITY_ID);

if (StringUtils.isNotBlank(baseEntityId)) {
Utils.proceedToContact(baseEntityId, detailMap, getActivity());
finish();
Object viewTag = view.getTag(R.string.regenerate_contact_schedule);
if (viewTag!= null && (viewTag).equals(ConstantsUtils.AlertStatusUtils.REGENERATE)) {
new RegenerateContactSchedulesTask(getActivity(), baseEntityId).execute();
} else {
if (StringUtils.isNotBlank(baseEntityId)) {
Utils.proceedToContact(baseEntityId, detailMap, getActivity());
finish();
}
}



} else {
super.onClick(view);
}
Expand Down Expand Up @@ -394,4 +426,5 @@ public Button getDueButton() {
public ProfilePresenter getProfilePresenter() {
return (ProfilePresenter) presenter;
}

}
Loading