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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath 'com.android.tools.build:gradle:8.13.0'
classpath 'com.apollographql.apollo:apollo-gradle-plugin:2.5.14'

// NOTE: Do not place your application dependencies here; they belong
Expand Down
9 changes: 6 additions & 3 deletions claimManagement/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ repositories {
}

android {
compileSdkVersion 32
compileSdk = 34
buildToolsVersion '33.0.0'

defaultConfig {
applicationId "org.openimis.imisclaims"
minSdkVersion 26
targetSdkVersion 32
targetSdkVersion 33
versionCode 4
versionName "2.3.6"
versionName "2.3.7"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
Expand Down Expand Up @@ -111,6 +111,7 @@ android {
buildConfigField "String", "API_BASE_URL", '"https://csuapps.minsante.cm/"'
buildConfigField "String", "RAR_PASSWORD", '"xc3-ed@/dfr;nJ3R"'
dimension 'std'
resValue "string", "sentry_dsn", '"https://54612a80b36c47e78722b9779410e3d1@glitchtip-csuapps.minsante.cm/9"'
}
niger {
applicationIdSuffix ".niger"
Expand Down Expand Up @@ -190,6 +191,7 @@ android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
}
namespace 'org.openimis.imisclaims'
}

apollo {
Expand Down Expand Up @@ -231,5 +233,6 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation group: 'com.squareup.picasso', name: 'picasso', version: '2.71828'
implementation group: 'net.lingala.zip4j', name: 'zip4j', version: '1.2.7'
implementation 'io.sentry:sentry-android:8.25.0'

}
8 changes: 5 additions & 3 deletions claimManagement/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.openimis.imisclaims">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Expand Down Expand Up @@ -57,10 +56,13 @@
android:resource="@xml/paths" />
</provider>

<meta-data
android:name="io.sentry.dsn"
android:value="@string/sentry_dsn" />

<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name_claims"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
import java.util.List;
import java.util.Objects;

import io.sentry.Sentry;

public class MainActivity extends ImisActivity {
private static final int REQUEST_PERMISSIONS_CODE = 1;
private static final int REQUEST_ALL_FILES_ACCESS_CODE = 2;
Expand Down Expand Up @@ -295,6 +297,7 @@ protected void onActivityResult(int requestCode, int resultCode, @Nullable Inten
}
} catch (Exception e) {
Log.e(LOG_TAG, "Error while copying master data.", e);
Sentry.captureException(e);
}
}
}
Expand All @@ -314,6 +317,7 @@ public void PickMasterDataFileDialog() {
try {
startActivityForResult(intent, REQUEST_PICK_MD_FILE);
} catch (ActivityNotFoundException e) {
Sentry.captureException(e);
Toast.makeText(getApplicationContext(), getResources().getString(R.string.NoFileExporerInstalled), Toast.LENGTH_SHORT).show();
}
}).setNegativeButton(getResources().getString(R.string.No),
Expand All @@ -331,6 +335,7 @@ public AlertDialog confirmRefreshMap() {
doLoggedIn(() -> DownLoadDiagnosesServicesItems(global.getOfficerCode()));
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
}
},
(dialog, i) -> dialog.cancel());
Expand Down Expand Up @@ -420,6 +425,7 @@ public AlertDialog DownloadMasterDialog() {
}
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
DownloadMasterDialog();
}
} else {
Expand Down Expand Up @@ -454,6 +460,7 @@ private void checkForUpdates() {
mNotificationManager.notify(SIMPLE_NOTIFICATION_ID, builder.build());
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
}

vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);
Expand Down Expand Up @@ -490,6 +497,7 @@ public void run() {
});
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
runOnUiThread(() -> {
progressDialog.dismiss();
if(!global.isNetworkAvailable()){
Expand Down Expand Up @@ -539,6 +547,7 @@ public void getClaimAdmins() {

} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
runOnUiThread(() -> {
progressDialog.dismiss();
if(!global.isNetworkAvailable()){
Expand Down Expand Up @@ -628,6 +637,7 @@ public void downloadServices(@NonNull final String claimAdminCode) {
}
} catch ( Exception e) {
e.printStackTrace();
Sentry.captureException(e);
if(!global.isNetworkAvailable()){
Toast.makeText(MainActivity.this, getResources().getString(R.string.CheckConnection), Toast.LENGTH_LONG).show();
} else {
Expand Down Expand Up @@ -675,6 +685,7 @@ public void downloadItems(@NonNull final String claimAdminCode) {
}
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
if(!global.isNetworkAvailable()){
Toast.makeText(MainActivity.this, getResources().getString(R.string.CheckConnection), Toast.LENGTH_LONG).show();
} else {
Expand Down Expand Up @@ -716,6 +727,7 @@ public void validateClaimAdminCode(final String claimAdminCode) {
doLoggedIn(() -> DownLoadDiagnosesServicesItems(claimAdminCode));
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
}
}
c.close();
Expand Down Expand Up @@ -778,6 +790,7 @@ public void run() {
});
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
runOnUiThread(() -> {
progressDialog.dismiss();
if(!global.isNetworkAvailable()){
Expand Down Expand Up @@ -837,6 +850,7 @@ public void run() {
});
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
runOnUiThread(() -> {
progressDialog.dismiss();
if(!global.isNetworkAvailable()){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
import java.util.Locale;
import java.util.Objects;

import io.sentry.Sentry;

public class SynchronizeActivity extends ImisActivity {
private static final String LOG_TAG = "SYNCACTIVITY";
private static final int PICK_FILE_REQUEST_CODE = 1;
Expand Down Expand Up @@ -165,6 +167,7 @@ protected void onBroadcastReceived(Context context, Intent intent) {
}
} catch (JSONException e) {
Log.e(LOG_TAG, "Error while processing claim response", e);
Sentry.captureException(e);
}
break;
case SynchronizeService.ACTION_EXPORT_ERROR:
Expand Down Expand Up @@ -358,6 +361,7 @@ public void downloadServices() {
}
} catch ( Exception e) {
e.printStackTrace();
Sentry.captureException(e);
}
});
thread.start();
Expand Down Expand Up @@ -447,6 +451,7 @@ public void downloadItems() {
}
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
runOnUiThread(() -> pd.dismiss());
}
});
Expand Down Expand Up @@ -510,6 +515,7 @@ public void run() {
});
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
runOnUiThread(() -> {
pd.dismiss();
Toast.makeText(SynchronizeActivity.this, e.getMessage() + "-" + getResources().getString(R.string.SomethingWentWrongServer), Toast.LENGTH_LONG).show();
Expand Down Expand Up @@ -542,6 +548,7 @@ public void run() {
});
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
runOnUiThread(() -> {
pd.dismiss();
ErrorDialogBox(e.getMessage());
Expand Down Expand Up @@ -584,6 +591,7 @@ public void downloadAdmins(){

} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
runOnUiThread(() -> pd.dismiss());
}
});
Expand Down Expand Up @@ -668,6 +676,7 @@ public void CheckUpdate(){
Toast.LENGTH_SHORT).show();
});
} catch (Exception e) {
Sentry.captureException(e);
runOnUiThread(() -> {
pd.dismiss();
if(!global.isNetworkAvailable()){
Expand Down Expand Up @@ -706,6 +715,7 @@ public void downloadUpdate(String lastVersion, String tagName) {
} catch (Exception e) {
Toast.makeText(this, getResources().getString(R.string.downloadUpdateFail), Toast.LENGTH_SHORT).show();
Log.e("DownloadUpdate", "Erreur: ", e);
Sentry.captureException(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
import java.util.Locale;
import java.util.Objects;

import io.sentry.Sentry;

public class SynchronizeService extends JobIntentService {
private static final int JOB_ID = 6541259; //Random unique Job id
private static final String LOG_TAG = "SYNCSERVICE";
Expand Down Expand Up @@ -142,15 +144,15 @@ private void handleUploadClaims() {

if(isValidClaimCode){
// Search insuree
try{
try {
String insuree = new FetchInsuree().execute(claim.getInsuranceNumber());
if(!insuree.isEmpty()){
insureeId = Integer.parseInt(insuree);
if(claim.getClaimProgram().equals("Cheque Santé") || claim.getClaimProgram().equals("Chèque Santé")){
if(claim.getClaimPrefix() != null){
List<ChequeImport> cheques = new ArrayList<>();
// search cheque number in server
try{
try {
cheques = new FetchChequeNumber().execute(claim.getClaimPrefix());
if(cheques.isEmpty()){
//invalid cheque
Expand Down Expand Up @@ -215,13 +217,15 @@ private void handleUploadClaims() {
} else {
result = new PostNewClaims.Result(claim.getClaimNumber(), PostNewClaims.Result.Status.ERROR,getResources().getString(R.string.SomethingWentWrongServer));
}
Sentry.captureException(e);
results.add(result);
}
}
JSONArray claimStatus = processClaimResponse(results);
broadcastSyncSuccess(claimStatus);
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
broadcastError(getResources().getString(R.string.ErrorOccurred) + ": " + e.getMessage(), ACTION_UPLOAD_CLAIMS);
}
}
Expand Down Expand Up @@ -429,6 +433,7 @@ private void handleExportClaims() {
SQLHandler.CLAIM_UPLOAD_STATUS_EXPORTED, null);
} catch (JSONException e) {
Log.e(LOG_TAG, "Exception while exporting claims", e);
Sentry.captureException(e);
}
}

Expand All @@ -453,6 +458,7 @@ private File createClaimFile(JSONObject details) {
return storageManager.createTempFile("exports/claim/" + filename);
} catch (JSONException e) {
Log.e(LOG_TAG, "Parsing claim JSON failed", e);
Sentry.captureException(e);
}
return null;
}
Expand All @@ -467,6 +473,7 @@ private void writeClaimToXmlFile(File claimFile, JSONObject claim) {
serializer.endDocument();
} catch (IOException e) {
Log.e(LOG_TAG, "Writing XML file failed", e);
Sentry.captureException(e);
}
}

Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
android.defaults.buildfeatures.buildconfig=true
android.enableJetifier=true
android.nonFinalResIds=false
android.nonTransitiveRClass=false
android.useAndroidX=true
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Sep 09 17:28:52 WAT 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Loading
Loading