VPMS Web Application

Provision for an interactive reminder interval or due date for reminder types

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.4
  • Fix Version/s: 1.5
  • Component/s: Reporting
  • Labels:
    None

Description

The idea is to have an option for a reminder type to prompt the user for the reminder due date when creating a new reminder.
This would occur when;
a) A new reminder is created in Patients->Reminders
b) During billing a product which is linked to a Reminder Type.

The default date should be populated from;
a) An expression which includes reference to patient attributes such as age and simple date arithmetic.

A reminder type should be optionally interactive in a similar way that printing templates is.

Activity

Hide
Matt Costa added a comment -

Cost estimation or queries?

Show
Matt Costa added a comment - Cost estimation or queries?
Hide
Tim Anderson added a comment -

Changes applied to:

  • archetypes, revision 4022
  • vpms, revisions 4023-4025
Show
Tim Anderson added a comment - Changes applied to:
  • archetypes, revision 4022
  • vpms, revisions 4023-4025
Hide
Tim Anderson added a comment -

For 1.5, support for interactive reminders has been added. The ability to create expressions to calculate the date has not, as xpath is not expressive enough to support it.
This is in part due to the fact that we a restricted to using xpath 1.0 which doesn't have conditional expressions nor date calculation functions.
These are available in xpath 2.0, but they haven't been implemented in the xpath library we use (jxpath).
The other reason is that while we could emulate the xpath 2.0 functions and operators, the resulting expressions would be difficult to use.
E.g, in the original discussions, there was a desire to be able to create expressions like:

...create a reminder in 3 months if the dog is 12 weeks old, 9 months if it's 6 months old or yearly if it's >1 year old

This would look something like:

      cond:if-then-else(op:dayTimeDuration-less-than(op:subtract-date(Date.new(), openvpms:get(.'patient.entity.dateOfBirth'), "P84D") ) 
                 op:add-dayTimeDuration-to-date(Date.new(),  "P90D") , 
                 cond:if-then-else(op:dayTimeDuration-less-than(op:subtract-date(Date.new(), openvpms:get(.'patient.entity.dateOfBirth'), "P180D")),
                         op:add-dayTimeDuration-to-date(Date.new(),  "P270D") , 
                         op:add-dayTimeDuration-to-date(Date.new(),  "P365D") )))

after support for the xpath 2.0 date operators is added
Another disadvantage of the above is that the entire expression needs to be evaluated, as conditional expressions need to be simulated (via a function, cond:if-then-else above)

A better approach may be to add support for other scripting languages. Prior to java 1.6, one way to do this was via BSF: http://jakarta.apache.org/bsf/ . As of 1.6, scripting is part of the java platform: http://java.sun.com/developer/technicalArticles/J2SE/Desktop/scripting/
This would mean that the most effective scripting language could be selected for the task at hand, be it javascript, groovy (http://groovy.codehaus.org/JSR+223+Scripting+with+Groovy), or some other language.

Show
Tim Anderson added a comment - For 1.5, support for interactive reminders has been added. The ability to create expressions to calculate the date has not, as xpath is not expressive enough to support it. This is in part due to the fact that we a restricted to using xpath 1.0 which doesn't have conditional expressions nor date calculation functions. These are available in xpath 2.0, but they haven't been implemented in the xpath library we use (jxpath). The other reason is that while we could emulate the xpath 2.0 functions and operators, the resulting expressions would be difficult to use. E.g, in the original discussions, there was a desire to be able to create expressions like:
...create a reminder in 3 months if the dog is 12 weeks old, 9 months if it's 6 months old or yearly if it's >1 year old
This would look something like:
      cond:if-then-else(op:dayTimeDuration-less-than(op:subtract-date(Date.new(), openvpms:get(.'patient.entity.dateOfBirth'), "P84D") ) 
                 op:add-dayTimeDuration-to-date(Date.new(),  "P90D") , 
                 cond:if-then-else(op:dayTimeDuration-less-than(op:subtract-date(Date.new(), openvpms:get(.'patient.entity.dateOfBirth'), "P180D")),
                         op:add-dayTimeDuration-to-date(Date.new(),  "P270D") , 
                         op:add-dayTimeDuration-to-date(Date.new(),  "P365D") )))
after support for the xpath 2.0 date operators is added Another disadvantage of the above is that the entire expression needs to be evaluated, as conditional expressions need to be simulated (via a function, cond:if-then-else above) A better approach may be to add support for other scripting languages. Prior to java 1.6, one way to do this was via BSF: http://jakarta.apache.org/bsf/ . As of 1.6, scripting is part of the java platform: http://java.sun.com/developer/technicalArticles/J2SE/Desktop/scripting/ This would mean that the most effective scripting language could be selected for the task at hand, be it javascript, groovy (http://groovy.codehaus.org/JSR+223+Scripting+with+Groovy), or some other language.
Hide
Matt Costa added a comment -

What will the default date be in the reminder prompt Tim? Just the current date + the reminder interval?

And just to confirm, this addition is optional per reminder type? (Interactive/non interactive)

Show
Matt Costa added a comment - What will the default date be in the reminder prompt Tim? Just the current date + the reminder interval? And just to confirm, this addition is optional per reminder type? (Interactive/non interactive)
Hide
Tony De Keizer added a comment -

Hi Matt.
If generated from billing the default will be interval setup in product reminder relationship. If not through billing then default will be reminder interval setup in reminder type.
Cheers
Tony

Show
Tony De Keizer added a comment - Hi Matt. If generated from billing the default will be interval setup in product reminder relationship. If not through billing then default will be reminder interval setup in reminder type. Cheers Tony
Hide
Tim Anderson added a comment -

The interactive flag has been added to both the reminder type and product reminder relationship.
The reminder type interactive flag is just used to specify a default value for new product reminder relationships i.e. when you select a reminder type in the product reminder, its interactive flag defaults to the value of the reminder type's flag.

Both flags default to false.

During billing, any reminders associated with the product will now be editable in a new tab next to Dispensing and Investigations.
If a product reminder is marked as interactive, a popup will display to edit the reminder when the product is selected.

Show
Tim Anderson added a comment - The interactive flag has been added to both the reminder type and product reminder relationship. The reminder type interactive flag is just used to specify a default value for new product reminder relationships i.e. when you select a reminder type in the product reminder, its interactive flag defaults to the value of the reminder type's flag. Both flags default to false. During billing, any reminders associated with the product will now be editable in a new tab next to Dispensing and Investigations. If a product reminder is marked as interactive, a popup will display to edit the reminder when the product is selected.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
16h
Original Estimate - 16h
Remaining:
8h
Time Spent - 8h Remaining Estimate - 8h
Logged:
8h
Time Spent - 8h Remaining Estimate - 8h