Closed DhanyaHerath closed 1 year ago
Please work on a design and estimated hours for this work before starting on it, thanks!
@sworup and @arjunSussol : Could you come up with a design plus hours needed. Once done, I am thinking you could present your findings in a meeting.... The Server we are talking about is the Tonga Vax
server.
@ujwalSussol @DhanyaHerath @arjunSussol
These are a few things that come to mind:
When vaccination is selected it triggers selectVaccine action that sets vaccine to state in VaccinePrescriptionActions. This is triggered at https://github.com/openmsupply/mobile/blob/9ecf8683e74d9cad797191f44c500ca3cd6f5fe6/src/widgets/Tabs/VaccineSelect.js#L187
If we replace this dispatch by a newly created (that we will create) checkPredispensedBeforeSelect action and do these steps we should be fine.
The above code is selecting non-vaccine history but it won't be hard to create a selector of vaccine history only.
@sworup thanks for that! Some comments:
@DhanyaHerath
I've heard that there is a separate branch for Tonga, is that correct? Could you link the branch for me, please?
It looks like tonga has v8.2.3 installed. We can create a branch off of 8.2.3 tag and start from there.
- Would it be possible to make the "7 days" a preference, rather than hardcoded? I'm a bit worried they'll ask us to change quickly...
Yes we can
It seems @arjunSussol would work on this. I will discuss this with him and give an estimated time. I am expecting around 20-30 hours, which would be around 3-4 workdays.
@DhanyaHerath We had a heated debate during our 10 minutes
standup.
I was for making our Mobile master compatible for both Kiribati
and Tonga
. So the idea was to update the master and the Tonga datafile compatible for the latest Mobile... Otherwise it complicates for support folks ... we need to know Tonga Vax are on a special version.
So the preference would be to have the Mobile master compatible for all mobile deployment.
@DhanyaHerath @sworup @ujwalSussol After discussion and local testing, we have to estimate about 3 to 5 days depends on complexities. I have some points before starting this:
1) If we are going to validate all items that are vaccines (item has already isVaccine field in both desktop and mobile side) then no need to care about item category.
2) If we differentiate vaccine based on item category then we should be cleared that mobile is accepting item_category.description
not item_category2.description
. So better to keep existing item_category.description
and end user should be aware about this functionality. Otherwise we need to change code in mobile if go with item_category2
3) 7 days period preference: We need this preference in mSupply desktop and should be editable. This preference should be set in cloud as general preference not store specific because we need same period in all over the mobile sites to validate.
4) As we need to add preference on desktop, we have to make changes there too. Also, do we need this 7 days period visible in mobile site? If yes then can add it to mobile > Setting page similar to sync settings.
5) Confirmation alert: This patient has already received one dose, are you sure you want to dispense another dose
, we need Yes
and No
for confirmation. Once we click Confirm
or OK and Next
button, the above alert should be visible. If we click Yes
then we dispense the same vaccine to that patient otherwise don't proceed ahead and keep the vaccination page open.
We are going to deal with patient vaccination history that have all records from all stores instead of respective site store. Please, give your opinion as we need to update proposed solution.
@ujwalSussol @arjunSussol @sworup Thanks!
I totally agree that the two versions should be merged, but we can't do that until we have funding for it :( It would be a much bigger job.
Answering Arjun's questions here:
item_category2
table that doesn't get sent? If at least the field is sent, that should be enough.
- We do need to check all vaccine items, but we should only alert if the same type of vaccine is being dispensed multiple times over 7 days, so we will need to use the item_category2.
Why check other categories if we are not gonna alert? Do we keep log?
- Ok, good to know...I think we should start sending item category 2 through to mobile. Does the item.category_2 field not get sent at all? Or is it the
item_category2
table that doesn't get sent? If at least the field is sent, that should be enough.
@DhanyaHerath Looking at the mobile code, our mobile app only syncs ItemCategory
into item.category
in Realm, which is item_category
table and field from mSupply. Neither item_category2
table nor the field is synced to mobile.
Unless we are sending item_category2 (and other category types) as item_category sync data from desktop server. But upon my inspection it is not the case.
@ujwalSussol @DhanyaHerath @sworup
If we skip the item_category2
works then we can do rest in 5 working days which includes development, testing and apk building.
As item_category2
is not consuming by mobile, if we need it then we have to create its fresh schema and need to link with item. After using this client needs to be re synced mobile data which would be time consuming for syncing too. Also, we need extra time to implement this into mobile and we may need more than 5 working days.
@arjunSussol @sworup : Talking with @arjunSussol today, I mentioned the point that we should control this feature with a preference of some sort.... Let us discuss tomorrow.
Why check other categories if we are not gonna alert? Do we keep log?
@sworup We should always alert if a vaccine of the same category is dispensed twice within a period of 7 days.
@arjunSussol @ujwalSussol Thanks all for the estimates and design everyone! I'll take this back to Jess to check whether we should go ahead with this work based on the 5+ day estimate.
@DhanyaHerath @jagoje :
Further discussion with @sworup and @arjunSussol : We have a confirmed plan.
@arjunSussol will update the plan here with screenshots so that @jagoje and everyone will know what the final outcome will look like.
https://docs.google.com/document/d/10nQeySzggs4ScaoQbrBRg1A8bu5qZtP6pCjRLnuUdHs/edit
@DhanyaHerath @jagoje :
Further discussion with @sworup and @arjunSussol : We have a confirmed plan.
@arjunSussol will update the plan here with screenshots so that @jagoje and everyone will know what the final outcome will look like.
https://docs.google.com/document/d/10nQeySzggs4ScaoQbrBRg1A8bu5qZtP6pCjRLnuUdHs/edit
I have updated above docs with detailed plan and tentative timeline.
Thanks Everyone for all the work,
Reviewing this now - much appreciated
Chipping In, something controlling via preference on desktop is been registered issue as well.
So sort of we heading toward a right path. Please consider updating above issue
Thanks
Hey team @arjunSussol @sworup @ujwalSussol Thanks so much for that detailed estimate! That was great - so helpful to think through.
Given we don't have specific funding for this, I think we'll have to reduce the scope, so still do this work but:
How does that sound?
@DhanyaHerath : Agreed. We are ok with your streamed down idea 👍
Discussed with @arjunSussol and @sworup .
Fantastic, thank you all! Please use the job code if you are working on this :)
@arjunSussol now that you're starting working on this, could you give me a quick estimate of when you think it will be done? Nothing too detailed, just maybe which week we should expect the work done by. Thanks Arjun!
@DhanyaHerath we have hit a potential snag with this issue. The issue is Tonga does not save prescription data (as current kiribati module version does) which means it relies on transactions in the database to get the vaccine name, id etc. This might mean we would only get vax history of current store, which in turn restricts us from check if the vaccine category was dispensed to the client in last X days in all stores.
@arjunSussol is further investigating this but the above conclusion is what it most likely looks like. I would let him finish the investigation before we say it with 100% confidence.
If that is the case, we have 3 options:
@DhanyaHerath I am trying to deliver it to you by the end of next week if the progress goes well.
After discussion with @sworup I noticed that we can get vaccination history records from all sites belong to selected current patient. So, no need to worry for now as I am not going to depend on current store data.
Just made a commit which get all vaccination history of selected patient.
Resolved with #5014
Is your feature request related to a problem? Please describe.
From Jess:
Describe the solution you'd like
This patient has already received one dose, are you sure you want to dispense another dose
, we needYes
andNo
for confirmation. Once we clickConfirm
orOK and Next
button, the above alert should be visible. If we clickYes
then we dispense the same vaccine to that patient otherwise don't proceed ahead and keep the vaccination page open. A warning pop up if a second dose of a vaccine in the same category is prescribed within 7 days. We could consider making this 7 days period editable, but the MVP version would just have it hardcoded.Implementation
TO BE DISCUSSED
Describe alternatives you've considered
TO BE DISCUSSED
Additional context
Jobcode
TGAVAC:DD