AC-450 Created Admission simple#696
Conversation
Codecov Report
@@ Coverage Diff @@
## master #696 +/- ##
==========================================
- Coverage 12.36% 12.23% -0.13%
==========================================
Files 236 239 +3
Lines 10857 10975 +118
Branches 1002 1011 +9
==========================================
+ Hits 1342 1343 +1
- Misses 9434 9550 +116
- Partials 81 82 +1
Continue to review full report at Codecov.
|
955b468 to
a58b633
Compare
|
is there any API to fetch data to where the patient must be admitted to ??? Or should I hardcode it as |
2becf5d to
15a76ef
Compare
5cd9542 to
4b418dd
Compare
14fab5a to
56888bc
Compare
|
Almost there but facing a big error. When I am sending encounter to the server, I am receiving an error: |
6580a0c to
7f0700d
Compare
7f0700d to
fcba727
Compare
fcba727 to
3194cf6
Compare
Codecov Report
@@ Coverage Diff @@
## master #696 +/- ##
==========================================
+ Coverage 11.72% 11.86% +0.13%
==========================================
Files 249 254 +5
Lines 10770 11010 +240
Branches 1036 1062 +26
==========================================
+ Hits 1263 1306 +43
- Misses 9424 9616 +192
- Partials 83 88 +5
Continue to review full report at Codecov.
|
8341e46 to
8430311
Compare
|
I am getting the following error every time I create an admission encounter. It is saved in the server but the app crashes and I not able to debug the reason... Can you look into it @f4ww4z sir |
|
Entire PR is ready with the following changes:
The following two things are left:
|
Everything is working fine, just when I hit the submit button, this pops up and crashes the app. But on syncing, the admission data is displayed all right... I have been trying to solve this error but nothing seems to work... Can you look into this one @f4ww4z sir. This happened only in admission form, is there any special permission required??? |
|
@rishabh-997 sorry I got busy with univ assignments, I will look into this and let you know. |
I can totally understand that. My whole semester examination are cancelled and all the evaluation and grading are to be done by assignments being given nowadays. You take your time, I'll also look into this one thoroughly again and get other issues prepared locally meanwhile 😀😀 |
|
@rishabh-997 When building this PR or the latest master branch, I got this error. We should resolve that first. |
|
Hey @LuGO0, since you and @f4ww4z sir are not getting this error while running apps, can you please verify the reason behind the app crash during admission forms, ie, can you please check the logs behind the crash. There might be a different reason for this crash. |
adaeff2 to
8f9e195
Compare
@rishabh-997 sorry I didnt get a notification regarding your mention , I will do this could you please pinpoint the error which comes up for you I didnt follow the conversation from the starting !! |
#696 (comment) |
|
Ohkk @rishabh-997 I will look into, btw I looked up the converstation above and it seems data is getting synced to the server and then the crash is happening is it the case @rishabh-997?? |
yeah. the data is sent to server successfully, the crash seem to occur either while saving it locally or syncing database with server. Not able to figure out much from logs |
|
@rishabh-997 do you get this crash/error on register patient activity?? after simply registering a patient?
|
|
I ain't getting any such error while registering patients. What I see is |
|
@rishabh-997 did you find any such errors?? should I try again !! |
Nopes. I did not face any such error. Instead of registering patients, try downloading them instead so you can proceed. |
e3df8a6 to
a2235cb
Compare
| R.id.captureVitalsView -> startNewActivity(FormEntryPatientListActivity::class.java) | ||
| R.id.activeVisitsView -> startNewActivity(ActiveVisitsActivity::class.java) | ||
| R.id.dashboardProviderManagementView -> startNewActivity(ProviderManagerDashboardActivity::class.java) | ||
| R.id.dashboardProviderManagementView -> ToastUtil.error(getString(R.string.failed_to_open_vitals_form)); |
There was a problem hiding this comment.
So that users can't corrupt the database accidentally. Will be removed in the PR which will remove this error.
There was a problem hiding this comment.
If we dont give any warning, user will keep pressing icon. And the encoded string here is An error occured, Invalid or Corrupt file which is very apt
| String encounterTypeDisplay = encounter.getEncounterType().getDisplay(); | ||
| encounterTypeDisplay=encounterTypeDisplay.split("\\(")[0].trim(); | ||
| if (displayableEncounterTypesArray.contains(encounterTypeDisplay)) { | ||
| encounter.getEncounterType().setDisplay(encounterTypeDisplay.split("\\(")[0].trim()); |
There was a problem hiding this comment.
Because the server sends Admission(Simple) but we add Admission only.
| visitDAO.saveOrUpdate(visit, patientid) | ||
| .observeOn(AndroidSchedulers.mainThread()) | ||
| .subscribe(id -> | ||
| ToastUtil.success(getString(R.string.form_data_saved_successfully, formname))); |
There was a problem hiding this comment.
This line was throwing callback error at rx.internals.OnSubscribeFromCallable. So I removed the return here as it was not being used as well, also it resolved error at AC-786
| return providerLiveData; | ||
| } | ||
|
|
||
| public LiveData<List<Provider>> getProvidersWithoutStorage(RestApi restApi) { |
There was a problem hiding this comment.
Again I wanted to fetch data without storing and corrupting database so...
| @@ -0,0 +1,93 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
There was a problem hiding this comment.
I have created Relative Layout coz I designed this way back in february but I will create another issue for improving UI for forms where I will convert it to Constraint.
rishabh-997
left a comment
There was a problem hiding this comment.
Reasons behind some weird changes
dino-saurabh
left a comment
There was a problem hiding this comment.
@rishabh-997 I know you wont risk changing things again after it works after so long but should we try and remove the Tables slowly, maybe creating a seperate issue I know that will really be a tough task !! thoughts @rishabh-997 @f4ww4z Sir??
thats really some work @rishabh-997 💯 !! cant find that on stack overflow I searched for it I coudnt get it 😅 |
Before that, we need to solve AC-478. After that, we will remove ActiveAndroid tables which are not being used as such. Then we will remove SQL functions one by one and replace the corresponging codes with room functions... |
but @rishabh-997 AC-478 hasnt been done yet because from the conversation I can gather is that it requires the room migration to be complete means removing tables before implementing SQLCipher?? |
f4ww4z
left a comment
There was a problem hiding this comment.
@rishabh-997 I'm not able to access any forms during a patient's visit, it was working fine before this PR. Tested on API level 21. Maybe you need to re-display the 3 forms?
@LuGO0 Room migration doesn't necessarily mean removing the ActiveAndroid tables, we can just transfer the database functionality to Room first, including encryption, then remove ActiveAndroid-related things from the codebase. |
actually what i observed is the forms appear after the second or third run of the app after a clean install. Can you close the app completely and try again. Or I will look into it |
|
Excellent work @rishabh-997 , seems stable to me. What we can do is to add a message when the patient visit activity is blank, telling the user to click 'Form Entry'. Also when the list of forms are blank, we should display a 'try restarting the app' message. We can file new JIRA issues for this. Otherwise, this PR looks good to me. |
|
@rishabh-997 I felt the same after provider Module PR was merged 😄😄😋 |




Description of what I changed
I added a separate activity for the admission form with the following features:
Issue I worked on
JIRA Issue: https://issues.openmrs.org/browse/AC-450
Checklist: I completed these to help reviewers :)
(the number above, next to the 'Commits' tab is 1).
existing code that was well tested you do not have to add tests)