2010-12-09 Logic Planning Meeting
Participants
?@Vibha Anand
?@Steve McKee
?@Tammy Dugan
?@Burke Mamlin
@Nyoman Ribeka
?@Darius Jazayeri
?@Mike Seaton
Background
This meeting was called to expand on the prior logic planning (see http://notes.openmrs.org/logicplanning). The goal was to decide on the best strategy for moving the logic service forward in a way that allows more people to begin using the service.
Notes
These notes were copied from http://notes.openmrs.org/logic-2010-12
1. There are low-hanging tickets that will make logic much more usable by the end-user. We want to group these as Logic 0.5, an release this before the holiday break. This gives us 2+ weeks.
Improved UI for viewing existing tokens and the rules they link to: LOGIC-62 (http://tickets.openmrs.org/browse/LOGIC-62 )
Implement more keys in our core data sources
Ada has identified some LOGIC-54 (http://tickets.openmrs.org/browse/LOGIC-54 ), LOGIC-57 (http://tickets.openmrs.org/browse/LOGIC-57 )
Identify some others by looking at what Data Exports support: LOGIC-63 (http://tickets.openmrs.org/browse/LOGIC-63 )
This would be great fodder for a logic-a-thon
Tokens should be case-preserving case-insensitive: LOGIC-61 (http://tickets.openmrs.org/browse/LOGIC-61 )
Finish moving concept_derived to logic_rule: LOGIC-47 (http://tickets.openmrs.org/browse/LOGIC-47 )
Token table needs a UUID: LOGIC-59 (http://tickets.openmrs.org/browse/LOGIC-59 )
Merge in code from the GSoC logic caching project
2. Some more significant (but ultra-important) tickets need design work and planning now:
Design decision regarding merging functionality of the DSS module into the logic module
Auto-compilation of rules (actual requirement is supporting a location of
Support for prioritization attribute
Modules should be able to provide rules to core
Logic doesn't start reliably
Transaction annotations need to move to the DAO layer (as low as possible)
TODO: Darius to ping ThoughtWorks for a Spring transaction annotations expert to recommend the "right" way for OpenMRS to use transactional annotations (at the DAO interface, on the DAO implementation, elsewhere? what are the "official" or "best use" rules?)
Overall design of Tokens vs Rules vs Data Sources vs "RuleProviders", Registration, etc.
New parser: LOGIC-50 (http://tickets.openmrs.org/browse/LOGIC-50 )
Need to finish explictly defining the grammar (Burke, Mike, Win, Darius)
How do we define expressions?
[CD4 COUNT] < 350 AND [MALE]
CD4_COUNT < 350 AND GENDER="M"
Look at Arden, and HQL and Java grammars
antlr for Java: http://openjdk.java.net/projects/compiler-grammar/antlrworks/Java.g
list of antlr grammar: http://www.antlr.org/grammar/list
We need a logic-a-thon for this
Currently only Vibha is smart enough to write this
Good to do this in conjuction with ongoing work to reimplment parser with Antlr 3
Performance improvements
Profile running some real logic rules, and look for bottlenecks
Win did pre-caching of obs in a custom data source for an AMPATH study. Can we do something like this in core?
Figure out how to do read-only vs read-write transactions
Define/document how to build logic criteria in Java: LOGIC-36 (http://tickets.openmrs.org/browse/LOGIC-36 )
Decide whether we want logic criteria to work like Hibernate criteria queries, and define exactly how this should work. Don't let Tammy know when we work on this.
new LogicCriteria("CD4 COUNT").lt(350).before(date).last()
last CD4 that is <350 and is before date
"LAST( CD4 < 350 BEFORE date)"
new LogicCriteria("CD4 COUNT").lt(350).last().before(date)
is the last CD4 that is < 350 before date?
"LAST( CD4 < 350) BEFORE date"
How to make it work with multiple datasources.
Recording
The link for the recording is: Recording Link (Expired on 02/28/2010)
Next Steps
Next meeting 12/17 from 2-4 PM ET
Agenda
Review Arden grammar, decide on strategy for grammar
Overall design of Tokens vs Rules vs Data Sources vs. "RuleProvider"s
Decide on strategy for supporting compiled rules