-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #830 from OpenSRP/fix-app-crash-hf
Fix sync and populating locations on family register form for release app versions.
- Loading branch information
Showing
7 changed files
with
77 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
opensrp-chw-core/src/main/java/org/smartregister/chw/core/model/CoreFamilyProfileModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
package org.smartregister.chw.core.model; | ||
|
||
import com.vijay.jsonwizard.constants.JsonFormConstants; | ||
|
||
import org.json.JSONObject; | ||
import org.smartregister.chw.core.application.CoreChwApplication; | ||
import org.smartregister.chw.core.utils.CoreJsonFormUtils; | ||
import org.smartregister.family.model.BaseFamilyProfileModel; | ||
|
||
public abstract class CoreFamilyProfileModel extends BaseFamilyProfileModel { | ||
|
||
public CoreFamilyProfileModel(String familyName) { | ||
super(familyName); | ||
} | ||
|
||
@Override | ||
public JSONObject getFormAsJson(String formName, String entityId, String currentLocationId) throws Exception { | ||
JSONObject form = super.getFormAsJson(formName, entityId, currentLocationId); | ||
CoreJsonFormUtils.populateLocationsTree(form, JsonFormConstants.STEP1, CoreChwApplication.getInstance().getAllowedLocationLevels(), "nearest_facility"); | ||
return form; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
opensrp-chw-core/src/main/java/org/smartregister/chw/core/model/CoreFamilyRegisterModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.smartregister.chw.core.model; | ||
|
||
import com.vijay.jsonwizard.constants.JsonFormConstants; | ||
|
||
import org.json.JSONObject; | ||
import org.smartregister.chw.core.application.CoreChwApplication; | ||
import org.smartregister.chw.core.utils.CoreJsonFormUtils; | ||
import org.smartregister.family.model.BaseFamilyRegisterModel; | ||
|
||
public class CoreFamilyRegisterModel extends BaseFamilyRegisterModel { | ||
|
||
@Override | ||
public JSONObject getFormAsJson(String formName, String entityId, String currentLocationId) throws Exception { | ||
JSONObject form = super.getFormAsJson(formName, entityId, currentLocationId); | ||
CoreJsonFormUtils.populateLocationsTree(form, JsonFormConstants.STEP1, CoreChwApplication.getInstance().getAllowedLocationLevels(), "nearest_facility"); | ||
return form; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters