Bahmni custom sql report based on user locale

I have setup a custom sql report on bahmni. That works well but when it comes to locale i don’t have the user select locale to make use on the sql query. How do i implement that? maybe the same as start date and end parameter before i run the report

Thanks for your help

Usually Bahmni login screen asks for locale, and then all UI is changed based on that. The main Bahmni reports screen (in EMR) currently only takes dates and report type (html/pdf/etc). The output of SQL will be in same language as is stored in DB. If your data is stored in non-English locale for some fields (name, address, etc), it should show up as-is.

Can you provide some details on your requirement/use-case? Do you want to pick translation strings while rendering report?

Hi @yohannes.suraphel yes adding to Gurpreet …that view in UI is rendered from here so if we need any further customisation we might need to change this code. Currently we do not have any locale available here for the reports.

@gsluthra I’m returning cell values from the sql query like

    value as '<Header Name>'
from table

and i get the from the concept name table so i can get the locale code like ‘en’ or ‘es’ to the sql query as a parameter i can query the necessary concept name.

I’ve currently hardcoded ‘en’ language to fetch the concepts.

I think the reports code linked above by @deepthi will need some enhancement to ask for Locale Dropdown, and then you can use that as a parameter in your SQL to show reports in correct language. Otherwise, you might need to create a different report for a different language like: Patient_Count_Report(fr).