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

LogicService and LogicCriteria have incompatible parseString methods

    XMLWordPrintable

    Details

    • Complexity:
      Undetermined

      Description

      Trying to use Logic as it exists in 1.5.x branch. I have created a couple of custom datasources, which register a variety of tokens with the LogicService. I have noticed that there are 2 methods that exist with an aim to parse an expression into LogicCriteria:

      LogicService.parseQuery(String) -> LogicCriteria

      LogicCriteria.parse(String) -> LogicCriteria

      It is not clear to me from the code if these methods are intended to do the same or different things. If they are meant to do different things, that needs to be made explicit. If they are meant to do the same thing, then one should be deprecated and should point to the other.

      I have found that for some expressions / tokens, the LogicService method works as expected, but the LogicCriteria method does not. In others, the LogicCriteria method works and the LogicService method does not.

      Specific examples:

      • If I try to parse the expression "LAST XXX", where XXX is a concept name, the LogicService method works, but the LogicCriteria method does not.
      • If I register a new datasource which registers a new token for each patient identifier type, in the following format "identifier_xxxx", where xxxx is the identifier name, leading to token names like "identifier_MDR TB Program Identifier", this fails to parse correctly using the LogicService method, but works correctly using the LogicCritieria method.

      In my code, I have worked around this for the moment by first trying to parse using LogicService, catching exceptions, and if exception is caught then trying the LogicCriteria method. This seems to work for everything I have tested so far.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: