need to pass another newly created uuid with the patient uuid

i need to pass another uuid along with the patient uuid when creating sales orders. and that uuid also need to show as a label in the sales order. how can i do this? im waiting for a reply soon. thank you very much !

Are you trying to pass it through url?

sorry @haripriya i expressed my question in a wrong way. what i want to tell you is this. you know bahmni encounters generates sales order in the openerp. i have configured a visit uuid that will pass to a salesorder. but i need to pass the visit_id when generating a sales order. how can i do this?

Moved to the bahmni category

you said … “you have configured a visit uuid that will pass to a salesorder”? How did you manage that? Did you modify the code?

Bahmni odoo modules right now do not store Visit UUID for the sale order at all. It stores the encounter uuid as external reference in the sale_order_line table.

1 Like

@angshuonline i have attahced the feed URI of XML file below.

As you can see i have highlighted the visitUuid. but i cant see any visitId. What i want to pass is visitId.

Yes i have modified the code and i will attach the screenshots. This is what i did.


I have added a new parameter in the above screenshot like this. parameters.add(createParameter(“visit_id”, openMRSEncounter.getVisitUuid(), “string”));

i called the parameter value to a varibale “job_id” as i shown below in the screenshot.

after this i have passed the variable “job_id” to the external_id field in sales.order for now visitUuid is passing to the job_id varibale. but what i want to pass is the visitId. i hope i have explained this cleary. hoping for a reply soon.

then you have what you need - the identifier for the visit.

If you are referring to the integer “ID” of the visit, then know thats an internal primary key for the visit at the database, and you should not be referring or using that at all. Not do the REST apis expose that information.

I don’t understand whats the purpose of the “ID”. I am assuming its for grouping/reporting? which you can use the external ID as well. Other than that, what purpose do you need the internal database ID?

yes @angshuonline i need this for grouping/reporting. Use of the visitUuid is very complex to read. what i really need is to get a clear readable reference (just like patient_id) for patient visit and all the sales orders belong to that visit id.

as in the above screeshot i need to pass the visit_id “43”(external_id) to all sales order which belong to that visit id as a reference.

If its just for grouping, why do you need to display the Visit ID? Even if you have an ID like say “101”, what would it signify or mean to the report? If you want for your display purpose, then create another field where you can probably store more readable data (OPD Visit on 1/1/2019) - while the visit UUID is used still for grouping purpose but is not displayed.

1 Like

@angshuonline thank you for replying ! i also think that the solution you gave maybe be the only way to do it. if i use a field life this (OPD Visit on 1/1/2019) , i cant identify all the sales orders which belong to the patient. so what if i use it like this (OPD Visit on 1/1/2019 VISIT PATIENT GAN0001) ? is it suitable to change it like this by adding visit patient id?

@angshuonline how can i add the date with location? like in your exmaple (OPD Visit on 1/1/2019) how cal i add the visited date as a field? i know how to add the location but not the date. im expecting for a reply :slight_smile:

I don’t think for such display or grouping, you need to do any specific code change. Assuming you are using SQLs for output to report and for grouping, you can do that in the SQL itself - e.g. return a field which concats this information together! (while your group-by clause still uses the visit or encounter uuid)