Configurability to show Translation Label in the Observation Display Control

Context:

In Bahmni patient dashboard, we have observation display control which will show the observations captured against the concepts which are configured. We either see short name of the concept on the display control, or FSN of the concept if the short name is not present. As of now, we don’t have an option to see the synonym added from openmrs or translation label that we added from the implementer interface in the display control. Display control is not considering any of it.

Since the display control can show either the SN or the FSN, the end users are restricted and cannot have a label that they can interpret easily despite the same term being available as Synonyms or as translation in Consultation. To mitigate this, we are planning to introduce a parameter to pass custom label for the concepts (only if needed) so that the end users can keep the label they understand on the display controls.

Tech Approach:

Configure a new parameter “conceptLabelTranslations” which will take the array of FSN and Translation Keys as mentioned below

"dashboardConfig": {
"conceptNames": ["FSN1", "FSN2", "FSN3", "FSN4", "FSN5"],
"conceptLabelTranslations": [{"FSN3": "TRANSLATION_KEY1"}, {"FSN5": "TRANSLATION_KEY2"}]
},
"expandedViewConfig": {
"conceptNames": ["FSN1", "FSN2", "FSN3", "FSN4", "FSN5"],
"conceptLabelTranslations": [{"FSN3": "TRANSLATION_KEY1"}, {"FSN5": "TRANSLATION_KEY2"}]
}
  • conceptLabelTranslations” would be an optional parameter.
  • If the parameter is there, it would consider the translation key.
  • Based on the locale that Bahmni is on, display control will pull the value from the specific locale.json file. This would require adding translation key and value in the respective locale files.
  • If the translation key is not configured or the translation key doesn’t have value for the specific locale, it will fall back to the SN/FSN.
  • If the parameter is not there, the display control will fall back to existing behaviour where it will show either SN/FSN.

In the above example, for FSN3, FSN5 we will be able to see the translation label in the display control that has passed from the “conceptLabelTranslations” parameter. For the rest of the concept names like FSN1, FSN2 and FSN4, the display control will show either SN/FSN.

@angshuonline @gsluthra @swedhan @buvaneswariarun @vmalini @matirp235 @tarunshettygari @muhima08 @michaelbontyes @megkmcguire

Does it need to be an array of map? why not just a map?

"dashboardConfig": {
    "conceptNames": ["FSN1", "FSN2", "FSN3", "FSN4", "FSN5"],
    "conceptLabelTranslations": {"FSN3": "TRANSLATION_KEY1", "FSN5": "TRANSLATION_KEY2"}
}