msupply-foundation / mobile

Open source mobile app for medical inventory control
http://msupply.org.nz/mobile
Other
42 stars 27 forks source link

Allow saving prescriptions in a state before finalising #4652

Closed DhanyaHerath closed 1 year ago

DhanyaHerath commented 2 years ago

Is your feature request related to a problem? Please describe.

Ivory Coast want to be able to save a prescription without it being finalised (ie. they want to be able to close the prescription, come back to it, and still be able to edit it).

Describe the solution you'd like

Proposed Solution

Other considerations/Info

Implementation

A description of how the solution would best be implemented in the code base

Describe alternatives you've considered

Additional context

Job Code:

CILIP-P3M Côte d'Ivoire (not billable) Phase 3 - Mobile Customizations

Requirement: NEXF025

56 hours budgetted

[NFM_CUST] CI NFM3 - Customisations

anildahalsussol commented 2 years ago

@DhanyaHerath @katherine-sussol : Now we have to confirm the button which actually finalizes the prescription. So I was thinking can we just add another button "Confirm" and "Finalise" so that if the user clicks on confirm then it will just save the data which will be in "Cn" status and can be editable from the customer invoice window?

DhanyaHerath commented 2 years ago

Good question @anildahalsussol! I don't think we've thought through the design of this yet, and looking through mobile docs, it doesn't look like there are other design examples we can follow.

@katherine-sussol am I missing anywhere, does mobile have the concept of "confirming"/saving an invoice?

kat-ms commented 2 years ago

@DhanyaHerath not explicitly. For customer invoices, if the user navigates away from the screen (e.g. by pressing the back button on the top of this screen: https://wiki.msupply.foundation/_detail/en:mobile:user_guide:customer_invoice_master_list.png?id=en%3Amobile%3Auser_guide%3Acustomer_inv) it will be saved as a 'confirmed' transaction (which then appears under the 'current' tab). Someone can come in later, open it up and then just tick the green finalise button.

I think the main problem with dispensing is that it's a 'wizard' flow and the UI is completely different to the CI editing page... So we could reuse the confirmed CI UI, but then would need to think about how to edit the prescriber and other dispensing specific info (e.g. usage directions). One potential problem with this is also that it might also be a bit weird to go to one place to create the prescription but then have to go to another to edit it 🤔

anildahalsussol commented 2 years ago

@bijaySussol @katherine-sussol : For now we are leaving this as its not so urgent as we think. But we are not sure when IC will have phase 3 so @bijaySussol if you think its urgent then please feel free to update thanks.

bijaySussol commented 2 years ago

Checking the behaviour of Customer invoices behaviour in current Mobile version, When the customer invoice is entered and not finalized, then that customer invoice status is on status cn.

Probably, It would be quicker to apply the same logic as Customer invoice, maybe it is already there?

kat-ms commented 2 years ago

@DhanyaHerath and I had a chat on the IC requirement - the issue description has been updated with a proposed solution and some alternatives that were previously discussed, along with a few things found while testing the dispensary.

@mark-prins any thoughts on how terrible this is for mobile and/or how annoying this will be (for developer or user)? Our thoughts were along the lines that dispensing is already quite deviant from the standard use cases ... so didn't feel we should be overly compelled to try to maintain consistency with those 🤔. I couldn't find Pauline on Github so will send a link separately!

kat-ms commented 2 years ago

There is also some discussion of the same request previously raised by @bijaySussol : https://github.com/openmsupply/mobile/issues/4122 - will close the other as a duplicate (sorry - had to pick one!)

bijaySussol commented 2 years ago

There is also some discussion of the same request previously raised by @bijaySussol : #4122 - will close the other as a duplicate (sorry - had to pick one!)

Its looks like i understood what is coming from Ivory coast :-p It had a proper info plus with Job code, this need to be keep opened

Cheers

mark-prins commented 2 years ago

We deliberately did not allow editing of prescriptions, even though it was wanted by CdI originally. There were too many challenges.. one of which could be rehydrating the state, to get you back to the point in the wizard. More of a concern was how to arrange the UI and what to do about the dispensing section overall

I don't have any concerns about differences in flow from other areas in mobile as the dispensing workflow is different already. We should return to the dispensing workflow when editing non-finalised prescriptions though, as you have it in the description. Possibly not show prescriptions in the customer invoice list at all?

One of the original concerns was how to get back to prescriptions which are unfinalised. I think that we need a screen which lists prescriptions - I think it would be weird going to a list of patients and searching for a prescription. That would only work if the list showed names of patients who had unfinalised prescriptions. and that's a bit odd.

So it would then require reworking the whole dispensing area, with an initial screen showing a prescription list, and an additional step for dispensing - you would need a patient selection list to show.. i.e.

mark-prins commented 1 year ago

After discussion w @DhanyaHerath @craigdrown @Pauline-mSupply we've decided to try and implement in the quickest way possible.

New Proposed Solution

DhanyaHerath commented 1 year ago

thanks for writing that up @mark-prins!

craigdrown commented 1 year ago

Thanks @mark-prins - can the 'you have entered a payment, this prescription must be finalised' message include "if you want to save the prescription you must clear the payment details" Thanks.

arjunSussol commented 1 year ago

Hi @DhanyaHerath is it OK to start working on this issue?

DhanyaHerath commented 1 year ago

Hi @arjunSussol sorry for the late reply - are you free to do this work now? Would you be able to give me an idea of how long you think it will take? I am happy for you to start working on this after that

arjunSussol commented 1 year ago

@DhanyaHerath I have read the design and discussion and thought I need about 10 working days for development.

DhanyaHerath commented 1 year ago

@arjunSussol ok, thanks for letting me know! Please go ahead with the work - and do you have someone to review?

JonnaQuismundo commented 1 year ago

hi @arjunSussol put it under job code [NFM_CUST] CI NFM3 - Customisations

arjunSussol commented 1 year ago

@mark-prins @DhanyaHerath @JonnaQuismundo a PR has been submitted for this issue. Please, have a look at the PR: #5175

alainsussol commented 1 year ago

Merged in version 8.6.5

AnushaUp commented 1 year ago

Testing

Tested in: Mobile v8.6.5 Steps to reproduce or otherwise test the changes of this PR:

AnushaUp commented 1 year ago

@arjunSussol @DhanyaHerath Before there was just two option Cancel and Next so while clicking Cancel the prescription used to be deleted but now when we save and close it will be saved and again we want to edit it but we want to cancel it will delete the whole prescription rather then saving the previous existing prescription. Is this gonna be the expected behaviour??

alainsussol commented 1 year ago

@AnushaUp I would be surprised if it is the right behaviour. @arjunSussol what do you think ?

AnushaUp commented 1 year ago

Got issue while creating prescription. Issue created HERE

AnushaUp commented 1 year ago

@arjunSussol @DhanyaHerath and what about the vaccination module?? Its still making the prescription in finalize state directly.

DhanyaHerath commented 1 year ago

Thanks for checking @AnushaUp! That should be fine - CDI do not use the vaccination module (phew!)