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

Logic Data Sources should have means for evaluating multiple tokens at once



    • Type: Bug
    • Status: Closed
    • Priority: Could
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • Complexity:
    • Development:


      Consider the current 1.5.x implementation of the PersonDataSource within Logic. This DataSource exposes 6 keys, all of which can be accessed via a single database query against the person table.

      Now, if within a page, I want to display the gender, birthdate, and death date of a person, this requires 3 separate calls to PersonDataSource.read(LogicContext, Cohort, LogicCriteria). In each of these 3 calls, the DataSource first must go to the database to retrieve all patient records for the input cohort, then iterate across all of these person records (which could be quite large), find the particular data item to return, put it into a Map, and return it.

      It would seem to make much more sense to give the PersonDataSource a means for pre-fetching more tokens than have been asked for, if it makes sense. In this case, the first time any token is requested of the PersonDataSource, it would evaluate the input cohort, iterate across it, and then puts all data items which require no more database hits into the LogicCache. Then, subsequent data requests for the input cohort could draw from the cache, rather than require re-evaluation.

      At the moment, LogicCache is completely private to LogicContext, and although each DataSource is given a LogicContext, it has no means to utilize this LogicContext for it's own caching purposes if needed.

      What are people's (Burke) feelings on making LogicService.getCache() public? If that isn't acceptable, can we find some means for allowing DataSources to do this kind of thing?

        Gliffy Diagrams




              burke Burke Mamlin
              mseaton Mike Seaton
              0 Vote for this issue
              4 Start watching this issue