Consider the following scenario:
We have a weight concept, which has preferred concept names in both English and French:
- English: WEIGHT (KGS)
- French: POIDS (KGS)
At startup, we register the ObsDataSource with the LogicService, and register 2 tokens for this concept "WEIGHT (KGS)" and "POIDS (KGS)".
Then, in a page somewhere in the application, we write some code to display the patient weight by evaluating the expression "LAST WEIGHT (KGS)".
- If a user with a default Locale of English views this page, it will work as expected.
- If a user with a default Locale of French views this page, it will fail.
The reason for this can be traced to the HibernateLogicObsDAO, which tries to find a compatible Concept for a given token using the following code:
Concept concept = Context.getConceptService().getConcept(rootToken);
The implementation of ConceptService.getConcept(String name) seems to only returns Concepts matching the passed name in the current users locale. So, when a user with a French Locale views a page, no concept named "WEIGHT (KGS)" is found in their locale, and the token fails to evaluate.
This seems to be clearly a bug which ought to be fixed.