File tree Expand file tree Collapse file tree
src/main/java/org/openimis/imisclaims Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ android {
118118 local {
119119 applicationIdSuffix " .local"
120120 resValue " string" , " app_name_claims" , " Claims Local"
121- buildConfigField " String" , " API_BASE_URL" , ' "http:// 10.0.2.2:35787 /"'
121+ buildConfigField " String" , " API_BASE_URL" , ' "http:/10.0.2.2:8000 /"'
122122 dimension ' std'
123123 }
124124 cli {
Original file line number Diff line number Diff line change @@ -564,9 +564,16 @@ public String getClaimUUIDForCode(@NonNull String claimCode) {
564564 @ NonNull
565565 public JSONObject getClaimCounts () {
566566 JSONArray claimCounts = getQueryResultAsJsonArray (
567- "SELECT CASE WHEN cus.UploadStatus IS NULL OR cus.UploadStatus = ? THEN ? ELSE cus.UploadStatus END AS Status, count(*) AS Amount" +
568- " FROM tblClaimDetails cd LEFT JOIN tblClaimUploadStatus cus on cd.ClaimUUID=cus.ClaimUUID" +
569- " GROUP BY Status" ,
567+ "WITH LatestStatus AS (\n " +
568+ " SELECT ClaimUUID, UploadStatus, MAX(cus.UploadDate) from tblClaimUploadStatus cus GROUP BY cus.ClaimUUID\n " +
569+ ")\n " +
570+ "SELECT \n " +
571+ " CASE WHEN ls.UploadStatus IS NULL OR ls.UploadStatus = ? THEN ? ELSE ls.UploadStatus END AS Status, \n " +
572+ " count(*) AS Amount\n " +
573+ "FROM \n " +
574+ " tblClaimDetails cd \n " +
575+ " LEFT JOIN LatestStatus ls on cd.ClaimUUID=ls.ClaimUUID\n " +
576+ "GROUP BY Status;" ,
570577 new String []{CLAIM_UPLOAD_STATUS_ERROR , CLAIM_UPLOAD_STATUS_ENTERED }
571578 );
572579
You can’t perform that action at this time.
0 commit comments