Address Format

Complete

This screen is used to create/view/edit the Address Format lookups. These are used to how addresses are formatted. Normally only one is needed and it is used to set the values in the 'Address Format' field on the Administration|Organisations|Practice screen.

The fields are as follows:

Name - the name of the format
Active - uncheck the box to deactivate the format
Single Line Format - the xpath expression used to generate the address when a single line address is needed
Multi Line Format - the xpath expression used to generate the address when a multiple line address is needed

The expressions should be a concat() of the required items. The following variables are available:

  • $address - e.g "36 Nonesuch St". For single-line addresses, any '\n' will be removed
  • $suburb - e.g. "Sawtell"
  • $postcode - e.g. "3095"
  • $state - e.g. "Victoria"
  • $state.code - e.g. "VIC"

Any missing data (for example if the postcode has been omitted) is supplied as an empty string ("").

These could be used as follows:

  • Single Line Format: concat($address, ', ', $suburb, ' ', $state, ' ', $postcode)
  • Multi-line Format: concat($address, '\n', $suburb, ' ', $state, ' ', $postcode)

Note that the $xxx variables are shortcuts for the expression openvpms:get(.,'xxx','').

This allows for:

  • single line:
    concat(expr:concatIf($address, ', '),
                 expr:concatIf(toUpperCase($suburb), ' '),
                 expr:concatIf($state.code, ' '),
                 $postcode)
     

          E.g. 123 Gilrown Avenue, DOREEN VIC 3754

  • multi-line:
    concat(expr:concatIf($address, $nl),
                 expr:concatIf(toUpperCase($suburb), ' '),
                 expr:concatIf($state.code, ' '),
                 $postcode)

           E.g. 123 Gilrown Avenue
                   DOREEN VIC 3754
 

In countries where the state/county/area are normally omitted (eg the UK, South Africa), the state part of the above two expressions can simply omitted.

Note that the above expressions still work for the cases where, for a customer or supplier with an overseas address, you are holding the complete multi-line address in the Address field and have not set the suburb, state or postcode. (However, the single line format may be quite long.)