Skip to content

Commit

Permalink
Merge pull request #322 from OpenSRP/issue1411-family-kit-task
Browse files Browse the repository at this point in the history
Integrated Family kit constants and alert rules
  • Loading branch information
qaziabubakar-vd authored Nov 10, 2020
2 parents ea48852 + 85c89c1 commit 0a85679
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down
1 change: 1 addition & 0 deletions opensrp-chw-core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@
<string name="drinking_water">Does the household have access to clean drinking water?</string>
<string name="hygienic_latrine">Do household members use a hygienic latrine for the disposal of feces?</string>
<string name="wash_check">WASH check</string>
<string name="family_kit">Family Kit</string>

<string name="abv_first">1st</string>
<string name="abv_second">2nd</string>
Expand Down
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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());
}
}

0 comments on commit 0a85679

Please sign in to comment.