Skip to content

Commit 0765bf6

Browse files
committed
fix hf code error in sync
1 parent 0657009 commit 0765bf6

5 files changed

Lines changed: 19 additions & 3 deletions

File tree

.DS_Store

0 Bytes
Binary file not shown.

claimManagement/.DS_Store

0 Bytes
Binary file not shown.

claimManagement/src/.DS_Store

0 Bytes
Binary file not shown.

claimManagement/src/main/java/org/openimis/imisclaims/SQLHandler.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ public JSONArray getAllPendingClaims() {
465465
for (int i = 0; i < claims.length(); i++) {
466466
JSONObject claim = claims.getJSONObject(i);
467467
String ClaimUUID = (String) claim.remove("ClaimUUID");
468+
Log.e("hf code", claim.getString("HFCode"));
468469

469470
JSONObject resultClaim = new JSONObject();
470471
resultClaim.put("details", claim);
@@ -940,4 +941,20 @@ public void InsertHealthFacilities(String Id, String Code, String Name) {
940941
e.printStackTrace();
941942
}
942943
}
944+
945+
public String getHealthFacility(String code) {
946+
String hf = "";
947+
String query = "SELECT (Code ||' '|| Name) FROM tblHealthFacilities WHERE upper(Code) like '" + code.toUpperCase() + "'";
948+
try (Cursor cursor1 = db.rawQuery(query, null)) {
949+
// looping through all rows
950+
if (cursor1.moveToFirst()) {
951+
do {
952+
hf = cursor1.getString(0);
953+
} while (cursor1.moveToNext());
954+
}
955+
} catch (Exception e) {
956+
e.printStackTrace();
957+
}
958+
return hf;
959+
}
943960
}

claimManagement/src/main/res/layout/activity_claim.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
android:layout_height="50dp"
3636
android:ems="10"
3737
android:fontFamily="sans-serif-light"
38-
android:maxLength="8"></EditText>
38+
android:maxLength="8"/>
3939
</com.google.android.material.textfield.TextInputLayout>
4040

4141

@@ -161,8 +161,7 @@
161161
android:layout_height="50dp"
162162
android:ems="10"
163163
android:paddingLeft="5dp"
164-
android:fontFamily="sans-serif-light"
165-
android:maxLength="6"/>
164+
android:fontFamily="sans-serif-light"/>
166165
</com.google.android.material.textfield.TextInputLayout>
167166

168167
<LinearLayout

0 commit comments

Comments
 (0)