Custom Template Fields / params

I was looking at how we add custom template fields that can be used across multiple reports.  Intially I thought a localization file would be the best way - but this requires a post install customization to the web app each time we roll out an update.  

Use cases are things like an Online booking URL and I am sure as I move through I will find other areas requiring these fields

$R{text.onlineBookingURL} for example.  

 

I think its outside the scope to keep expandin the Letterhead and document control.  In fact there are probably fields in that archetype that could be merged into a properties file

 

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Custom Template Fields / params

Service urls are dynamic so shouldn't be hard coded in an archetype or configuration file.

Perhaps there needs to be a function to resolve a url based on the Practice Base URL field. Open to suggestions but could include:

  • application:baseurl() - returns the practice Base URL
  • application:url(relativeUrl) - returns an absolute URL given a relative URL

    E.g., for Online booking: application:url('/ws/booking/v2')

As for other configuration options, these are best encapsulated in archetypes.
For 2.4 there will be support for global settings. These currently aren't accessible to reports, but that can be added. If you have settings you want to include, let me know.

 

 

Re: Custom Template Fields / params

Completely agree with the concept of not hardcoding dynamic properties. The url was sort of an example

Context was use in an email template - to create a HTML button that dynamically lnked to the clinics online booking webpage (not the api)

Given that sometimes this URL may not be based on the application base url I had thought some sort of dynamic property would be appropriate

In my head conceptually they are linked to the practice location.  Possible as a 1 to many relationship with

CODE:NAME:Description type setup as below

Lookup.locationProperty

Type
Name
Display Name
Type
Path
Min Cardinality
Max Cardinality
Min Length
Max Length
Derived
Node name Name java.lang.String /name 1 1 0 255
Node description Description java.lang.String /description 0 1 0 255
                   
Node active Active java.lang.Boolean /active 0 1 0 255
Node code Code java.lang.String /code 1 1 0 100
Node id Id java.lang.Long

/id

0 1 0 255
 

Link this to practice location as a list on the in the config.

Create a jxpath method to access these properties:
location:property(CODE)/name etc

We could create a standardized set of properties that is loaded at install/upgrade and require users customise them to make them available via jxpath to reports.

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au
Syndicate content