VPMS Web Application

Allow text fields in Letters to include macros

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5
  • Fix Version/s: 1.5
  • Component/s: Documentation
  • Labels:
    None

Description

Allow text fields in Letters to include macros

Activity

Hide
Matt Costa added a comment -

Estimate or queries?

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

Looking at the forum where this originated ( http://www.openvpms.org/forum/merge-field-macros-0 ), I'm not certain that macros will work as intended.
Macros require an object to evaluate against.
E.g the 'dispensingVerb' macro in the default distribution is declared as:

expression="openvpms:lookup(openvpms:get(.,'product.entity'), 'dispensingVerb')"

This expression requires that:

  1. an object is supplied (referenced by '.').
  2. the object must have a 'product' node
  3. the product must have an 'entity' node
  4. the resulting entity must have a 'dispensingVerb' node

For letters, what would the macro be evaluated against? The act.patientDocumentLetter?

Show
Tim Anderson added a comment - Looking at the forum where this originated ( http://www.openvpms.org/forum/merge-field-macros-0 ), I'm not certain that macros will work as intended. Macros require an object to evaluate against. E.g the 'dispensingVerb' macro in the default distribution is declared as:
expression="openvpms:lookup(openvpms:get(.,'product.entity'), 'dispensingVerb')"
This expression requires that:
  1. an object is supplied (referenced by '.').
  2. the object must have a 'product' node
  3. the product must have an 'entity' node
  4. the resulting entity must have a 'dispensingVerb' node
For letters, what would the macro be evaluated against? The act.patientDocumentLetter?
Hide
Tony De Keizer added a comment -

Definitely the document act that is generating the document. So will have access to the template and the customer or patient nodes.

Show
Tony De Keizer added a comment - Definitely the document act that is generating the document. So will have access to the template and the customer or patient nodes.
Hide
Matt Costa added a comment -

This one has the go ahead Tim. Fully funded.

Show
Matt Costa added a comment - This one has the go ahead Tim. Fully funded.
Hide
Tim Anderson added a comment - - edited

Macros can now be included in document templates, using either:

1.  macro:eval(<macro name>)
2.  macro:eval(<macro name>, <expression>) 

The first form is the same as invoking:

macro:eval(<macro name>, .) 

E.g:

macro:eval('displayName')
macro:eval('qid', openvpms:get('product.entity'))

In addition, macros may now be expanded whilst inputting parameters to customer and patient letters.
The maximum parameter length has been expanded from 300 to 5000 characters.

Changes applied to:

  • archetypes, revision 3796
  • vpms, revision
Show
Tim Anderson added a comment - - edited Macros can now be included in document templates, using either:
1.  macro:eval(<macro name>)
2.  macro:eval(<macro name>, <expression>) 
The first form is the same as invoking:
macro:eval(<macro name>, .) 
E.g:
macro:eval('displayName')
macro:eval('qid', openvpms:get('product.entity'))
In addition, macros may now be expanded whilst inputting parameters to customer and patient letters. The maximum parameter length has been expanded from 300 to 5000 characters. Changes applied to:
  • archetypes, revision 3796
  • vpms, revision
Hide
Tony De Keizer added a comment -

Hi Tim,
Actually I am not sure thsi was the requirement but may be mistaken. I believe what was required was when input fields dialogues where displayed durng letter generation that the dialogue text boxes supported macros ?
Is thsi what has been developed ?
Cheers
Tony

Show
Tony De Keizer added a comment - Hi Tim, Actually I am not sure thsi was the requirement but may be mistaken. I believe what was required was when input fields dialogues where displayed durng letter generation that the dialogue text boxes supported macros ? Is thsi what has been developed ? Cheers Tony
Hide
Tim Anderson added a comment -

In addition, macros may now be expanded whilst inputting parameters to customer and patient letters.

Show
Tim Anderson added a comment -
In addition, macros may now be expanded whilst inputting parameters to customer and patient letters.
Hide
Tony De Keizer added a comment -

Alpha testing completed.OK.

Show
Tony De Keizer added a comment - Alpha testing completed.OK.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
10h
Original Estimate - 10h
Remaining:
0h
Remaining Estimate - 0h
Logged:
10h
Time Spent - 10h