diff --git a/gradle.properties b/gradle.properties index c885bd22b1..03b6b5a328 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=1.5.20-SNAPSHOT +VERSION_NAME=1.5.21-SNAPSHOT VERSION_CODE=1 GROUP=org.smartregister POM_SETTING_DESCRIPTION=OpenSRP Client Chw Core Library diff --git a/opensrp-chw-core/src/main/java/org/smartregister/chw/core/rule/FamilyKitAlertRule.java b/opensrp-chw-core/src/main/java/org/smartregister/chw/core/rule/FamilyKitAlertRule.java new file mode 100644 index 0000000000..98f30eee20 --- /dev/null +++ b/opensrp-chw-core/src/main/java/org/smartregister/chw/core/rule/FamilyKitAlertRule.java @@ -0,0 +1,21 @@ +package org.smartregister.chw.core.rule; + +import android.content.Context; + +//All date formats ISO 8601 yyyy-mm-dd + +/** + * Created by Qazi Abubakar + */ +public class FamilyKitAlertRule extends MonthlyAlertRule { + + public FamilyKitAlertRule(Context context, long lastVisitDateLong, long dateCreatedLong) { + super(context, lastVisitDateLong, dateCreatedLong); + } + + @Override + public String getRuleKey() { + return "familyKitAlertRule"; + } + +} diff --git a/opensrp-chw-core/src/main/java/org/smartregister/chw/core/sync/CoreClientProcessor.java b/opensrp-chw-core/src/main/java/org/smartregister/chw/core/sync/CoreClientProcessor.java index dea8219dd0..3896d18f32 100644 --- a/opensrp-chw-core/src/main/java/org/smartregister/chw/core/sync/CoreClientProcessor.java +++ b/opensrp-chw-core/src/main/java/org/smartregister/chw/core/sync/CoreClientProcessor.java @@ -188,6 +188,7 @@ protected void processEvents(ClientClassification clientClassification, Table va break; case CoreConstants.EventType.CHILD_VISIT_NOT_DONE: case CoreConstants.EventType.WASH_CHECK: + case CoreConstants.EventType.FAMILY_KIT: case CoreConstants.EventType.ROUTINE_HOUSEHOLD_VISIT: processVisitEvent(eventClient); processEvent(eventClient.getEvent(), eventClient.getClient(), clientClassification); diff --git a/opensrp-chw-core/src/main/java/org/smartregister/chw/core/utils/CoreConstants.java b/opensrp-chw-core/src/main/java/org/smartregister/chw/core/utils/CoreConstants.java index aa73b5d9c2..f55c9167f6 100644 --- a/opensrp-chw-core/src/main/java/org/smartregister/chw/core/utils/CoreConstants.java +++ b/opensrp-chw-core/src/main/java/org/smartregister/chw/core/utils/CoreConstants.java @@ -83,6 +83,7 @@ public interface SCHEDULE_TYPES { String ANC_VISIT = "ANC_VISIT"; String PNC_VISIT = "PNC_VISIT"; String WASH_CHECK = "WASH_CHECK"; + String FAMILY_KIT = "FAMILY_KIT"; String MALARIA_VISIT = "MALARIA_VISIT"; String FP_VISIT = "FP_VISIT"; String ROUTINE_HOUSEHOLD_VISIT = "ROUTINE_HOUSEHOLD_VISIT"; @@ -159,6 +160,7 @@ public static final class EventType { public static final String PNC_HOME_VISIT_NOT_DONE = "PNC Home Visit Not Done"; public static final String PNC_HOME_VISIT_NOT_DONE_UNDO = "PNC Home Visit Not Done Undo"; public static final String WASH_CHECK = "WASH check"; + public static final String FAMILY_KIT = "Family Kit"; public static final String NUTRITION_STATUS_BABY = "Nutrition Status - Baby"; public static final String REFERRAL_DISMISSAL = "Referral Dismissal"; public static final String ANC_NOTIFICATION_DISMISSAL = "ANC Notification Dismissal"; @@ -207,6 +209,7 @@ public static class JSON_FORM { private static final String MALARIA_CONFIRMATION = "malaria_confirmation"; private static final String MALARIA_FOLLOW_UP_VISIT_FORM = "malaria_follow_up_visit"; private static final String WASH_CHECK = "wash_check"; + private static final String FAMILY_KIT = "family_kit"; private static final String CHILD_REFERRAL_FORM = "child_referral_form"; private static final String ANC_REFERRAL_FORM = "anc_referral_form"; private static final String STOCK_USAGE_REPORT_FORM = "stock_usage_report"; @@ -366,6 +369,10 @@ public static String getWashCheck() { return Utils.getLocalForm(WASH_CHECK, locale, assetManager); } + public static String getFamilyKit() { + return Utils.getLocalForm(FAMILY_KIT, locale, assetManager); + } + public static String getRoutineHouseholdVisit() { return Utils.getLocalForm(ROUTINE_HOUSEHOLD_VISIT, locale, assetManager); } @@ -652,6 +659,7 @@ public static class TABLE_NAME { public static final String ANC_PREGNANCY_OUTCOME = "ec_pregnancy_outcome"; public static final String TASK = "task"; public static final String WASH_CHECK_LOG = "ec_wash_check_log"; + public static final String FAMILY_KIT_LOG = "ec_family_kit_log"; public static final String CHILD_REFERRAL = "ec_child_referral"; public static final String ANC_REFERRAL = "ec_anc_referral"; public static final String PNC_REFERRAL = "ec_pnc_referral"; @@ -866,6 +874,8 @@ public static class FORM_SUBMISSION_FIELD { public static final String HOME_VISIT_ILLNESS = "illness_information"; public static final String WASH_CHECK_DETAILS = "details_info"; public static final String WASH_CHECK_LAST_VISIT = "last_visit"; + public static final String FAMILY_KIT_DETAILS = "family_kit_details_info"; + public static final String FAMILY_KIT_LAST_VISIT = "family_kit_last_visit"; public static final String FAMILY_ID = "family_id"; public static final String REFERRAL_TASK = "referral_task"; public static final String REFERRAL_TASK_PREVIOUS_STATUS = "referral_task_previous_status"; diff --git a/opensrp-chw-core/src/main/res/values/strings.xml b/opensrp-chw-core/src/main/res/values/strings.xml index 0e7f1f87d9..44a94503ae 100644 --- a/opensrp-chw-core/src/main/res/values/strings.xml +++ b/opensrp-chw-core/src/main/res/values/strings.xml @@ -274,6 +274,7 @@ Does the household have access to clean drinking water? Do household members use a hygienic latrine for the disposal of feces? WASH check + Family Kit 1st 2nd diff --git a/opensrp-chw-core/src/test/java/org/smartregister/chw/core/utils/CoreConstantsTest.java b/opensrp-chw-core/src/test/java/org/smartregister/chw/core/utils/CoreConstantsTest.java index 9efcbf0266..e4faad3005 100644 --- a/opensrp-chw-core/src/test/java/org/smartregister/chw/core/utils/CoreConstantsTest.java +++ b/opensrp-chw-core/src/test/java/org/smartregister/chw/core/utils/CoreConstantsTest.java @@ -1,9 +1,18 @@ package org.smartregister.chw.core.utils; +import android.os.Build; + import org.junit.Assert; import org.junit.Test; +import org.junit.runner.RunWith; +import org.robolectric.RobolectricTestRunner; +import org.robolectric.annotation.Config; +import org.smartregister.chw.core.application.TestApplication; +@RunWith(RobolectricTestRunner.class) +@Config(application = TestApplication.class, sdk = Build.VERSION_CODES.P) public class CoreConstantsTest { + @Test public void getUnifiedReferralForms() { Assert.assertEquals(CoreConstants.JSON_FORM.getAncUnifiedReferralForm(), "referrals/anc_referral_form"); @@ -19,13 +28,23 @@ public void getReferralForms() { } @Test - public void getRegisterType() { - Assert.assertEquals(CoreConstants.REGISTER_TYPE.ANC, "ANC"); - Assert.assertEquals(CoreConstants.REGISTER_TYPE.PNC, "PNC"); - Assert.assertEquals(CoreConstants.REGISTER_TYPE.CHILD, "Child"); - Assert.assertEquals(CoreConstants.REGISTER_TYPE.FAMILY_PLANNING, "Family Planning"); - Assert.assertEquals(CoreConstants.REGISTER_TYPE.MALARIA, "Malaria"); - Assert.assertEquals(CoreConstants.REGISTER_TYPE.OTHER, "Other"); + public void getMenuType() { + Assert.assertEquals(CoreConstants.MenuType.ChangeHead, "ChangeHead"); + Assert.assertEquals(CoreConstants.MenuType.ChangePrimaryCare, "ChangePrimaryCare"); + } + + @Test + public void testGetStockUsageForm() { + Assert.assertEquals("stock_usage_report", CoreConstants.JSON_FORM.getStockUsageForm()); } + @Test + public void testGetMalariaReferralForm() { + Assert.assertEquals("referrals/malaria_referral_form", CoreConstants.JSON_FORM.getMalariaReferralForm()); + } + + @Test + public void testGetHivReferralForm() { + Assert.assertEquals("referrals/hiv_referral_form", CoreConstants.JSON_FORM.getHivReferralForm()); + } } \ No newline at end of file