Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
Binary file removed .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ fastlane/readme.md

# Visual Studio Code
.vscode/
./.DS_Store
./.git/.DS_Store
*.DS_Store


# Custom product flavours
Expand Down
Binary file removed claimManagement/.DS_Store
Binary file not shown.
6 changes: 4 additions & 2 deletions claimManagement/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ android {
buildConfigField "String", "RAR_PASSWORD", '")(#$1HsD"'
buildConfigField "String", "API_VERSION", '"3"'
resValue "string", "release_tag", "release/25.04"
resValue "string", "sentry_dsn", "https://[email protected]/3"
}

productFlavors {
Expand Down Expand Up @@ -171,8 +172,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding true
Expand Down Expand Up @@ -220,5 +221,6 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
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:5.3.0'

}
Binary file removed claimManagement/src/.DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions claimManagement/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
android:resource="@xml/paths" />
</provider>

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

<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
import java.util.ArrayList;
import java.util.List;

import io.sentry.Sentry;
import io.sentry.android.core.SentryAndroid;


public class MainActivity extends ImisActivity {
private static final int REQUEST_PERMISSIONS_CODE = 1;
Expand Down Expand Up @@ -109,49 +112,53 @@ public boolean onCreateOptionsMenu(Menu menu) {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
try {
setContentView(R.layout.activity_main);

isSDCardAvailable();
isSDCardAvailable();

broadcastList = new ArrayList<>();
broadcastList.add(SynchronizeService.ACTION_CLAIM_COUNT_RESULT);
broadcastList = new ArrayList<>();
broadcastList.add(SynchronizeService.ACTION_CLAIM_COUNT_RESULT);

progressDialog = new ProgressDialog(this);
progressDialog.setCancelable(false);
progressDialog = new ProgressDialog(this);
progressDialog.setCancelable(false);

Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
actionBar = getSupportActionBar();
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
actionBar = getSupportActionBar();

new Thread(this::checkForUpdates).start();
new Thread(this::checkForUpdates).start();

drawer = findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.addDrawerListener(toggle);
toggle.syncState();
drawer = findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.addDrawerListener(toggle);
toggle.syncState();

NavigationView navigationView = findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this::onNavigationItemSelected);
NavigationView navigationView = findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this::onNavigationItemSelected);

View header = navigationView.getHeaderView(0);
loginText = header.findViewById(R.id.LoginText);
loginText.setText(global.isLoggedIn() ? R.string.Logout : R.string.Login);
RelativeLayout loginButton = header.findViewById(R.id.LoginButton);
loginButton.setOnClickListener((view) -> changeLoginState());
View header = navigationView.getHeaderView(0);
loginText = header.findViewById(R.id.LoginText);
loginText.setText(global.isLoggedIn() ? R.string.Logout : R.string.Login);
RelativeLayout loginButton = header.findViewById(R.id.LoginButton);
loginButton.setOnClickListener((view) -> changeLoginState());

accepted_count = findViewById(R.id.accepted_count);
rejected_count = findViewById(R.id.rejected_count);
entered_Count = findViewById(R.id.entered_count);
accepted_count = findViewById(R.id.accepted_count);
rejected_count = findViewById(R.id.rejected_count);
entered_Count = findViewById(R.id.entered_count);

accepted_count.setText("0");
rejected_count.setText("0");
entered_Count.setText("0");
accepted_count.setText("0");
rejected_count.setText("0");
entered_Count.setText("0");

AdminName = findViewById(R.id.AdminName);
AdminName = findViewById(R.id.AdminName);

if (checkRequirements()) {
onAllRequirementsMet();
if (checkRequirements()) {
onAllRequirementsMet();
}
} catch (Exception exception) {
Sentry.captureException(exception);
}
}

Expand Down Expand Up @@ -283,6 +290,7 @@ protected void onActivityResult(int requestCode, int resultCode, @Nullable Inten
(d, i) -> finish());
}
} catch (Exception e) {
Sentry.captureException(e);
Log.e(LOG_TAG, "Error while copying master data.", e);
}
}
Expand All @@ -303,6 +311,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 @@ -319,6 +328,7 @@ public AlertDialog confirmRefreshMap() {
try {
doLoggedIn(() -> DownLoadDiagnosesServicesItems(global.getOfficerCode()));
} catch (Exception e) {
Sentry.captureException(e);
e.printStackTrace();
}
},
Expand Down Expand Up @@ -409,6 +419,7 @@ public AlertDialog DownloadMasterDialog() {
}
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
DownloadMasterDialog();
}
} else {
Expand Down Expand Up @@ -442,6 +453,7 @@ private void checkForUpdates() {
try {
mNotificationManager.notify(SIMPLE_NOTIFICATION_ID, builder.build());
} catch (Exception e) {
Sentry.captureException(e);
e.printStackTrace();
}

Expand Down Expand Up @@ -479,6 +491,7 @@ public void run() {
});
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
runOnUiThread(() -> {
progressDialog.dismiss();
ErrorDialogBox(e.getMessage());
Expand Down Expand Up @@ -519,6 +532,7 @@ public void getClaimAdmins() {
});
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
runOnUiThread(() -> progressDialog.dismiss());
}
});
Expand Down Expand Up @@ -553,6 +567,7 @@ public void validateClaimAdminCode(final String claimAdminCode) {
progressDialog.dismiss();
doLoggedIn(() -> DownLoadDiagnosesServicesItems(claimAdminCode));
} catch (Exception e) {
Sentry.captureException(e);
e.printStackTrace();
}
}
Expand Down Expand Up @@ -636,6 +651,7 @@ public void run() {
});
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
runOnUiThread(() -> {
progressDialog.dismiss();
Toast.makeText(MainActivity.this, e.getMessage() + "-" + getResources().getString(R.string.SomethingWentWrongServer), Toast.LENGTH_LONG).show();
Expand Down Expand Up @@ -680,6 +696,7 @@ public void run() {
});
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
runOnUiThread(() -> {
progressDialog.dismiss();
Toast.makeText(MainActivity.this, e.getMessage() + "-" + getResources().getString(R.string.AccessDenied), Toast.LENGTH_LONG).show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ public String getJustification() {
return justification;
}

public static final Creator<Service> CREATOR = new Creator<>() {
public static final Creator<Service> CREATOR = new Creator<Service>() {
@Override
public Service createFromParcel(Parcel in) {
return new Service(in);
Expand Down Expand Up @@ -611,7 +611,7 @@ public String getJustification() {
return justification;
}

public static final Creator<Medication> CREATOR = new Creator<>() {
public static final Creator<Medication> CREATOR = new Creator<Medication>() {
@Override
public Medication createFromParcel(Parcel in) {
return new Medication(in);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public String getHealthFacilityCode() {
return hfCode;
}

public static final Creator<ClaimAdmin> CREATOR = new Creator<>() {
public static final Creator<ClaimAdmin> CREATOR = new Creator<ClaimAdmin>() {
@Override
public ClaimAdmin createFromParcel(Parcel in) {
return new ClaimAdmin(in);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public List<Medication> getMedications() {
return medications;
}

public static final Creator<DiagnosesServicesMedications> CREATOR = new Creator<>() {
public static final Creator<DiagnosesServicesMedications> CREATOR = new Creator<DiagnosesServicesMedications>() {
@Override
public DiagnosesServicesMedications createFromParcel(Parcel in) {
return new DiagnosesServicesMedications(in);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public String getName() {
return name;
}

public static final Creator<Diagnosis> CREATOR = new Creator<>() {
public static final Creator<Diagnosis> CREATOR = new Creator<Diagnosis>() {
@Override
public Diagnosis createFromParcel(Parcel in) {
return new Diagnosis(in);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public String getCode(){
public String getName(){
return name;
}
public static final Creator<HealthFacility> CREATOR = new Creator<>() {
public static final Creator<HealthFacility> CREATOR = new Creator<HealthFacility>() {
@Override
public HealthFacility createFromParcel(Parcel in) {
return new HealthFacility(in);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public List<Policy> getPolicies() {
return policies;
}

public static final Creator<Insuree> CREATOR = new Creator<>() {
public static final Creator<Insuree> CREATOR = new Creator<Insuree>() {
@Override
public Insuree createFromParcel(Parcel in) {
return new Insuree(in);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public String getCurrency() {
return currency;
}

public static final Creator<Medication> CREATOR = new Creator<>() {
public static final Creator<Medication> CREATOR = new Creator<Medication>() {
@Override
public Medication createFromParcel(Parcel in) {
return new Medication(in);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public List<Medication> getMedications() {
return medications;
}

public static final Creator<PaymentList> CREATOR = new Creator<>() {
public static final Creator<PaymentList> CREATOR = new Creator<PaymentList>() {
@Override
public PaymentList createFromParcel(Parcel in) {
return new PaymentList(in);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public List<Medication> getMedications() {
return medications;
}

public static final Creator<PendingClaim> CREATOR = new Creator<>() {
public static final Creator<PendingClaim> CREATOR = new Creator<PendingClaim>() {
@Override
public PendingClaim createFromParcel(Parcel in) {
return new PendingClaim(in);
Expand Down Expand Up @@ -334,7 +334,7 @@ public double getQuantity() {
return quantity;
}

public static final Creator<Service> CREATOR = new Creator<>() {
public static final Creator<Service> CREATOR = new Creator<Service>() {
@Override
public Service createFromParcel(Parcel in) {
return new Service(in);
Expand Down Expand Up @@ -408,7 +408,7 @@ public double getQuantity() {
return quantity;
}

public static final Creator<Medication> CREATOR = new Creator<>() {
public static final Creator<Medication> CREATOR = new Creator<Medication>() {
@Override
public Medication createFromParcel(Parcel in) {
return new Medication(in);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ public enum Status {
IDLE, ACTIVE, SUSPENDED, EXPIRED, READY
}

public static final Creator<Policy> CREATOR = new Creator<>() {
public static final Creator<Policy> CREATOR = new Creator<Policy>() {
@Override
public Policy createFromParcel(Parcel in) {
return new Policy(in);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public List<SubServiceItem> getSubItems() {
return subItems;
}

public static final Creator<Service> CREATOR = new Creator<>() {
public static final Creator<Service> CREATOR = new Creator<Service>() {
@Override
public Service createFromParcel(Parcel in) {
return new Service(in);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public int getQty() {
public String getPrice() {
return price;
}
public static final Parcelable.Creator<SubServiceItem> CREATOR = new Parcelable.Creator<>() {
public static final Parcelable.Creator<SubServiceItem> CREATOR = new Parcelable.Creator<SubServiceItem>() {
@Override
public SubServiceItem createFromParcel(Parcel in) {
return new SubServiceItem(in);
Expand Down