How to sync Registration Fees in Odoo 10?

I have been trying to sync Registration Fees from “Bahmni Patient Registration” page to Odoo 10 “Quotations”. After doing some searching I found this article doc link Where there is a preferred way to sync registration fees. I have done the first part but I don’t know how to do the second part. Can anyone kindly guide me on this?

Instructions in PAT document are as follows:

Leverage the order - create fee as a service order

  • Setup
    • Create a concept class (e.g. Hospital Fees)
    • Create an order type (Hospital Fee Charges)
    • Map the order_type and class (see https://bahmni.atlassian.net/wiki/spaces/BAH/pages/18415632/Order+Fulfillment+Procedures)
    • Ensure that in Odoo - you create corresponding “Order Type”
    • Create Fee as concept for services
      • create any concept “Registration Fee”, “Consultation Charge” etc (class - Hospital Fees, datatype - NA, saleable = true)
  • Create a widget for registration second page
    • Configuration - Type of fees (name of concepts), Order type etc
    • Display in the widget - type of fees, amount, notes etc
    • Create a order of specified order type and selected fee type.
    • Watch out: there is no structured way to send amount (Best will be use order.note_to_fulfiller, or order.instruction) - they will show up

I am not sure if this will fully work. Might need to be tested. Seems the suggestion here is to use “Order Type” mechanism of Bahmni, to define a new order type, and sync that to Bahmni.

Related links:

@angshuonline : When you say, create a widget for registration second page, do you mean “custom code widget”?

@gsluthra can you please explain the widget creation part? I can understand how to create new order type in openMRS and Odoo10 but how should I integrate that order type in Bahmni UI? Also I would like to know if it is possible to make a quotation automatically when a appointment is created against any patient.

@angshuonline will be likely in a better position to answer your queries.

I don’t think there is any way to create a quote automatically on Appointment creation.

@angshuonline can you kindly answer my queries? I am new to Bahmni and trying to entertain some of the use cases which are pretty common in my country (Bangladesh). Creating quotation automatically for registration fees, appointment assignment, bed charges and operation charges are necessary requirements for deploying in any local hospital. My question is can Bahmni entertain mentioned use cases? What are the mandatory skills that are needed to achieve what I want?

Hi, there is no out of box way to do this. Also the fee collection process itself is implementation specific - it maybe registration fee or visit fee or handled manually. We have often debated whether creating an order that shows up in Odoo for registration for simple things such as this, is desirable for all, considering different usage context. (Most likely Odoo billing is done by someone else). However, this has been asked quite a number of times, if you have capacity we can guide you how to do this and hope you will contribute back to the product.

See the following for some guidance.

  1. A hack way of doing this
  2. Leverage the “order” model of OpenMRS - discussed on PAT call, you may find notes here

Basically,

  1. develop a widget that can create order (Registration Fee/Visit Fee) etc. Btw, many hospitals do not charge a visit fee for returning patients within X number of days - so maybe better to show also when was the last visit.
  2. Add ability to support through configuration in the registration second page.
  3. Add the code to create an order (From the widget).