Show patient language in Appointments list view

appointment
Tags: #<Tag:0x00007fdb1924e428>

(Saikumar Vantaku) #1

There is a need from OCB-Maadi clinic to show patient languages in Additional info column on Appointments list view page. Whatever info we get from the backend, Bahmni supports to show like “key1: value1, key2: value2” by default. But the requirement is to show only values separated by the comma.

Note: We are renaming column header “Additional info” to “Languages” with translation key from our config.

Ex: Additional info we get is {“language”: “English”, “otherLanguage”: “Hindi”}

Bahmni shows: language: English, otherLanguage: Hindi

The requirement to show: English, Hindi

Is there anyway we can achieve this? @angshuonline @arjun @mksd @swathivarkala @binduak @pramidat


(Pramida Tumma) #2

The current behavior of displaying Key is good, as we can display different types of information like BedDetails, currentVisit, attributes e.t.c and differentiate between them. Will it be fine, if we can display each Key Value pair in a separate line which will be more readable?

Ex:

language: English

otherLanguage: Hindi

If you still want to display only Values without keys, below could be two approaches:

Approach 1: Have a boolean configuration “showOnlyValuesInAIColumn”. When set to TRUE, show only the values in the column. The default value will be FALSE

Approach 2: From the backend, see if you can send only values. In the BahmniApps, if no key is sent, do not display ‘:’


(Dimitri R) #3

On the principle I prefer approach 2 to approach 1. That would mean that Bahmni Apps figures out to display whatever it’s being given, whether it’s a list or a map.

I am cautious about the ‘overconfigurability’ with a million a possible options and combinations. It’s good to be flexible but I don’t know if people do realise that this has to be thoroughly documented so that any end implementer will ever find his/her way through this.


(Angshuman Sarkar) #4

If its a server side extension in your custom omod, then why not return a single value instead of multiple? You might as well return

{ languages: “English, Hindi” }

You would still have to live with the “key” and “:” prefixed. but would that not be acceptable? If it is, then we don’t have to do anything. (You can override the column name in your specific language pack!)

Another thing that can get effected is the sort-ability. But I wonder if someone would want to sort of such columns in an appointment list, and for what purpose?

This “additionalInfo” data was meant to push such arbitrary unforeseen attributes to be displayed. (and hence such provision as a generic way).

For example, what would you do if you were returning other additional information? and all these were important to be shown?

{ “language” : “English”, “spouse_name” : “Bahubali”, “spouse_number” : “87123123” }

@pramidat For 1: I would so no. We wouldn’t want to introduce configurations at that level. Also consider the above example, it does not make sense.

For 2: “additionalInfo” is a json object. not a string.

Alternatively, few ideas

  1. Just for this, and assuming one and only “additionalInfo” column will suffice. return something like
{
   "display": "Speaks English & Hindi, alternate number 87123123 (spouse: Sudhakar)" , 
   "language" : "English", 
   "otherLanguage" : "Hindi", 
   "spouse_name": "Sudhakar",
   "spouse_number": "87123123"
}

So the hack is that if the “additionalInfo.display” attribute exists, then show that, alternatively show the string formed from the other keys. (I personally don’t like it but leaves some bit of generality)

  1. Take one or more attributes from the “additionalInfo” object, and show that as individual columns in the table. We can have a configuration element saying

“additionalColumns” : [“language”, “spouse_number”]

So the above two columns apprear in the list as columns, and the remaining ones in the “additionalInfo” column like before!

This solves the sort-ability as well.

More work in idea 2, than 1, but idea 2 is more generic.


Additional Info in Appointment Scheduling List view
(Abhijeet Waghmare) #5

@saikumarv We want to show Primary contact in “Additional info” column of Appointments List. Could you please help where to do that change?


(Mupagasi Jean Paul) #6

Hi @angshuonline, i have same question with @abeezith, as well as adding and removing columns in the appointment list view. please help us describe how and where to change?


(Angshuman Sarkar) #7

You need to provide a custom extension for this. Check this

This line gets it from a properties file, but you can find other means


(Mupagasi Jean Paul) #8

Thanks @angshuonline, let me try it.