Uploaded image for project: 'Logic Module'
  1. Logic Module
  2. LOGIC-33

ObsDataSource fails for multi-lingual implementations

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Should
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Complexity:
      Undetermined
    • Development:

      Description

      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                Unassigned Unassigned
                Reporter:
                mseaton Mike Seaton
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: