health icon indicating copy to clipboard operation
health copied to clipboard

Free follow ups

Open rtdany10 opened this issue 2 years ago • 9 comments

Currently, free follow-ups (Fee Validity) are based on Patient Registration, but, I believe free follow-ups should be based on consultations (invoiced Patient Encounter).

If I go to a hospital, I will first have to register myself there and get an OP Card. But that registration doesn't provide me any free consultation(in most cases). Once I'm registered in their database, I can schedule a consultation and pay the consultation fee. After consultation, the doctor might ask me to get some tests done. Let's consider my test results came after few days. I can consult the doctor with my test results without paying the fee again.

Usually, almost all hospitals allows a fixed number of free follow-ups for a fixed number of days after every paid consultation. Let me know your thoughts on the flow and how we can improve the current one. Will be more than happy to contribute. As a work around, we added a hook to create Fee Validity after every paid consultation.

rtdany10 avatar Sep 27 '21 07:09 rtdany10

Thanks, @rtdany10 for the suggestion.

Currently, fee validity is based on appointment. Should we make it configurable so that users can select Appointment/Encounter in healthcare settings?

@ruchamahabal @akurungadam Thoughts?

ChillarAnand avatar Sep 27 '21 09:09 ChillarAnand

Currently, fee validity is based on appointment.

I disagree to this. According to me, fee validity is based on patient registration.

You can see it here: https://github.com/frappe/healthcare/blob/c9fd664a76119c6921ba2be593ee3ef50a1d0efa/healthcare/healthcare/doctype/fee_validity/fee_validity.py#L26

This if condition makes sure free follow-up is given only to new patients. Old patients doesn't get free follow ups. In most hospitals, it doesn't matter if you're an old patient or a new patient; if you paid for a consultation, you get a/some free follow-up(like in the scenario mentioned above).

I believe fee validity should be created irrespective of the patient being new or old.

rtdany10 avatar Sep 27 '21 10:09 rtdany10

Thanks Dany and Anand, considering that Patient Encounter can be invoiced without having appointments, we should be adding this. Maybe moving the Fee Validity logic to Patient Encounter is also an option - I'm not altogether sure, we’ll need to check and come back

Currently, free follow-ups (Fee Validity) are based on Patient Registration

BTW, @rtdany10 Fee Validity is not really based on Patient Registration (new Patient), Patient Appointment insert should be doing this currently I guess?

I believe fee validity should be created irrespective of the patient being new or old.

It should be, will check this and if required do a fix, thanks

akurungadam avatar Sep 27 '21 10:09 akurungadam

BTW, @rtdany10 Fee Validity is not really based on Patient Registration (new Patient), Patient Appointment insert should be doing this currently I guess?

Although Patient Appointment insertion does the function call, it checks if the patient is new or old before creating fee validity. In case the patient is old, it returns null (as seen in the link in my above comment).

It should be, will check this and if required do a fix, thanks

We overrode few functions using a custom app to generate fee validity whenever a patient paid for a consultation(ie Sales Invoice against Patient Encounter/Appointment). Can send a pull request with the same once this issue is confirmed.

rtdany10 avatar Sep 27 '21 10:09 rtdany10

Although Patient Appointment insertion does the function call, it checks if the patient is new or old before creating fee validity. In case the patient is old, it returns null (as seen in the link in my above comment).

check_is_new_patient checks if there is an existing appointment of that patient with the selected practitioner. Doesn't matter if patient registration was old.

https://github.com/frappe/healthcare/blob/cb3fbab0ed7deeaffdace12926c7b7c8c64661ed/healthcare/healthcare/doctype/fee_validity/fee_validity.py#L40-L56

In most hospitals, it doesn't matter if you're an old patient or a new patient; if you paid for a consultation, you get a/some free follow-up(like in the scenario mentioned above).

This has to end after a certain number of consultations right? How should we make sure from which consultation should we be using the free follow-ups. Maybe you can explain the model you are trying to map.

ruchamahabal avatar Sep 27 '21 11:09 ruchamahabal

In most hospitals, it doesn't matter if you're an old patient or a new patient; if you paid for a consultation, you get a/some free follow-up(like in the scenario mentioned above).

This has to end after a certain number of consultations right? How should we make sure from which consultation should we be using the free follow-ups. Maybe you can explain the model you are trying to map.

I'll give you a scenario: Assume we have free follow-up enabled and number of free follow-ups are 2. I went to doctor A. This is my first ever visit and hence I get 2 free follow-up. He suggested me to get some tests done. I get the result after a day and visits him. Both the visits are free.

Note: I didn't pay my consultation fees here. In settings, we enabled free follow-ups only, not free consultation. But my first visit (which is a consultation) was counted as a follow-up and hence I wasn't charged. And my second visit (which is a follow-up) was deducted from the free follow-ups. My remaining free follow-ups are zero.

After few months, I went to the same doctor A. I pay the consultation fee since I don't have a free follow-up. He asked me to get some more tests done. I get the result after a day and I visit him. I will have to pay another consultation fee to see him since I don't have any free follow-ups left.

I hope you understand the issue now.

To tackle this issue; every time a patient paid consultation fees, we generated a fee validity. Thereby making follow-up(s) free.

rtdany10 avatar Sep 27 '21 11:09 rtdany10

This is by booking Patient Appointment I suppose? Will check the implementation and apply a fix soon, thanks for reporting.

akurungadam avatar Sep 27 '21 13:09 akurungadam

I'll give you a scenario: Assume we have free follow-up enabled and number of free follow-ups are 2. I went to doctor A. This is my first ever visit and hence I get 2 free follow-up. He suggested me to get some tests done. I get the result after a day and visits him. Both the visits are free.

Note: I didn't pay my consultation fees here. In settings, we enabled free follow-ups only, not free consultation. But my first visit (which is a consultation) was counted as a follow-up and hence I wasn't charged. And my second visit (which is a follow-up) was deducted from the free follow-ups. My remaining free follow-ups are zero.

This has been fixed in https://github.com/frappe/erpnext/pull/27156. Now you have to pay for first consultation and "follow ups" are free.

After few months, I went to the same doctor A. I pay the consultation fee since I don't have a free follow-up. He asked me to get some more tests done. I get the result after a day and I visit him. I will have to pay another consultation fee to see him since I don't have any free follow-ups left.

I hope you understand the issue now.

To tackle this issue; every time a patient paid consultation fees, we generated a fee validity. Thereby making follow-up(s) free.

Afaik, this use case was never part of the feature. Can be considered though. Thanks for bringing it up. This can be a part of healthcare settings because different hospitals might have different use cases.

  • Enable free follow-ups after every consultation or only the first one

ruchamahabal avatar Sep 27 '21 13:09 ruchamahabal

This has been fixed in frappe/erpnext#27156. Now you have to pay for first consultation and "follow ups" are free.

My bad, I missed that. Thank you! Been lazy to report this issue for a long time that I didn't realize it got fixed. Sorry for your time.

Afaik, this use case was never part of the feature. Can be considered though. Thanks for bringing it up. This can be a part of healthcare settings because different hospitals might have different use cases.

Thank you :)

rtdany10 avatar Sep 27 '21 14:09 rtdany10