IPD Visit shows Care Settings in ERP Quotation as OPD

Environment: Bahmni 0.90, vBox

  1. Create OPD Visit->Order->ERP Sync->Quotation shows Care Settings = “OPD” as expected. Close Visit.
  2. Create IPD Visit->Order->ERP Sync->Quotation shows Care Settings = “OPD” Possible bug?

Could this be because getVisitType bahmni-erp-connect (atomfeed services) gets attribute value of attributetype “Visit Status” which is not getting set to “IPD” as shown in the image below:

Instead should it not read VisitType?

Thanks @ramashish for providing this troubleshooting info. That’s always very helpful.

It looks like the actual bug is that the ‘Visit Status’ attribute type seems to be out of sync with the visit type. Aka it stills holds OPD characteristics when the visit type is in fact ‘IPD’.

Could you dig further and see how this attribute type isn’t set the right way in the first place?

Hello Everyone… Was this issue fiexd… If yes…Plse share how it can be solved

I could not debug this further to identify the root cause of this.

In the mean time you may fetch

openMRSVisit.display

by providing getter setter for display in OpenMRSVisit class

@ramashish or @bryan, would it be possible for either of you to raise a ticket for this? With as much details as possible and linking to this thread?

Hey @ramashishopenmrsVisit Added setter and getter methods for display

visitAttribute Returned the getDisplay()

But it is complaining about the return statement in OpenMRSVisit.java on line 25 which is on the setter method… Thank you

Is there any update for this issue?, We are still getting OPD visit for IPD or ER visits. cc: @utsavdeshar | @deepakneupane

on the patient dashboard what does it show? Does it show IPD/ER as active visit? IMO, it should not be anything to do with the visit attribute, rather should just expose the visit type itself. @laxman can you check the event that is being exposed and check the content? and also check in the openmrs database (or rest api), what is the type of the visit, with the visit uuid that is returned.

Yes I checked the api data for visit, and in db as well, Looking into code I think this code in MapERPOrders.java can be replaced

private String getVisitType() { for (VisitAttributes visitAttribute : openMRSVisit.getAttributes()) { if (visitAttribute.getAttributeType().getDisplay().equals(“Visit Status”)) { return visitAttribute.getValue(); } } return null; }

with

private String getVisitType() { return openMRSVisit.getVisitType().getDisplay(); }

as I see the visit attribute is not in sync with visittype and visit type display is correct.

@Laxman. I agree … in Bahmni, you will always have a Visit. Do you want to create a JIRA card, and a PR for this?

Sure @angshuonline , we will QA the solution first on our side then will raise PR. thanks.