Uploaded image for project: 'VPMS Web Application'
  1. OVPMS-1248

Add support to customise address formatting

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.1
    • Fix Version/s: 2.0
    • Component/s: Archetypes, Reporting
    • Labels:
      None
    • Sprint:

      Description

      Address formatting is currently performed using the "party:getBillingAddress()" and "party:getCorrespondenceAddress()" and "party:getPracticeAddress()" xpath functions.
      The billing and correspondence addresses are formatted as multi-line addresses, whereas the practice address is a single line.

      These format addresses using the PartyRules.formatAddress() method which is implemented in terms of Australian addressing conventions.

      Support is required for:

      • different country formatting conventions
      • the ability to specify a format for single and multi-line addresses
      • the ability to handle missing data. Currently 'null' appears in addresses if postcode or state data is not available
      • the ability to format billing, practice and correspondence addresses as single or multiple lines

      To do this, a new lookup will be created, "lookup.addressFormat".
      This will have two nodes:

      • singleLineFormat - the format for single-line addresses
      • multiLineFormat - the format for multi-line addresses

      Each node will be an xpath expression. This will have the following pre-defined variables supplied:

      • 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"

      Any missing data would be supplied as an empty string ("")

      These could be used as follows:

      • singleLineFormat = concat($address, ' ', $suburb, ' ', $state, ' ', $postcode)
      • multipleLineFormat = concat($address, '\n', $suburb, ' ', $state, ' ', $postcode)

      The party.organisationPractice archetype would be amended to have a new node, "addressFormat", defined as:

           <node name="addressFormat" path="/details/addressFormat" type="java.lang.String" minCardinality="0">
                 <assertion name="lookup">
                      <property name="type" value="lookup"/>
                      <property name="source" value="lookup.addressFormat"/>
                  </assertion>
           </node>
      

      The contact.location archetype would be changed to use the billing address for the 'description' node.

      The existing xpath functions will also be extended to have single and multiple line versions. E.g.

      • party:getBillingAddress(., true) - single line address format
      • party:getBillingAddress(., false) - multi-line address format
      • party:getBillingAddress(.) - calls party:getBillingAddress(., false)

      If the practice has no address format defined, the current format will be used.

        Attachments

          Activity

            People

            • Assignee:
              tanderson Tim Anderson
              Reporter:
              tanderson Tim Anderson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 6h Original Estimate - 6h
                6h
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 8h
                8h

                  Who's Looking?