Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,17 @@ public String getHF(int DistrictId, String HFLevel) {
protected HashMap<String, String> jsonToTable(String jsonString) {
HashMap<String, String> data = new HashMap<>();
try {
JSONObject object = new JSONObject(jsonString);
Iterator<String> keys = object.keys();
while (keys.hasNext()) {
String key = keys.next();
String value = object.getString(key);
data.put(key, value);
JSONArray array = new JSONArray(jsonString);
for (int i = 0; i < array.length(); i++) {
JSONObject object = array.getJSONObject(i);
String ControlName = object.getString("id");
String ControlValue;
if (!"null".equals(object.getString("value"))) {
ControlValue = object.getString("value");
} else {
ControlValue = null;
}
data.put(ControlName, ControlValue);
}
} catch (JSONException e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,37 @@ public class Policy implements Parcelable {
@Nullable
private final Date validityTo;

public Policy(
@NonNull String code,
@NonNull String name,
@Nullable Double value,
@Nullable Date expiryDate,
@NonNull Status status,
@Nullable Double deductibleType,
@Nullable Double deductibleIp,
@Nullable Double deductibleOp,
@Nullable Double ceilingIp,
@Nullable Double ceilingOp,
@Nullable Double antenatalAmountLeft,
@Nullable Double consultationAmountLeft,
@Nullable Double deliveryAmountLeft,
@Nullable Double hospitalizationAmountLeft,
@Nullable Double surgeryAmountLeft,
@Nullable Integer totalAdmissionsLeft,
@Nullable Integer totalAntenatalLeft,
@Nullable Integer totalConsultationsLeft,
@Nullable Integer totalDeliveriesLeft,
@Nullable Integer totalSurgeriesLeft,
@Nullable Integer totalVisitsLeft
) {
this(code, name, value, expiryDate, status, deductibleType, deductibleIp,
deductibleOp, ceilingIp, ceilingOp, antenatalAmountLeft,
consultationAmountLeft, deliveryAmountLeft, hospitalizationAmountLeft,
surgeryAmountLeft, totalAdmissionsLeft, totalAntenatalLeft,
totalConsultationsLeft, totalDeliveriesLeft, totalSurgeriesLeft,
totalVisitsLeft, null);
}

public Policy(
@NonNull String code,
@NonNull String name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.Shadows;
import org.robolectric.annotation.Config;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
Expand All @@ -38,6 +39,7 @@ private void createActivity() {
}

@Test
@Config(qualifiers = "fr")
public void french_locale_restored() {
createActivity();
assertEquals("fr", Locale.getDefault().getLanguage());
Expand Down
Loading