Postcode as User Field in Reminder

G'day all,

Is it possible to create an expression to provide the postcode only from a patientOwner Correspondance/Billing Address for use in a Patient Letter?  I have tried a few variations, but no success.  If not possible, I suppose just the postcode portion could be cut from the full address as a substring.

The idea is a User Field to hide a paragraph in reminders for out-of-town clients, ie any post code not ours.

Regards Simon

Comment viewing options

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

Re: Postcode as User Field in Reminder

Simon - I think that you are out of luck. There is no current support in the system for extracting the components of a contact address.

Suggestion:

Pull in the billing address, normalise-space it to force to one line, then use contains() - ie
contains(normalize-space(party:getBillingAddress(.)),'3124') which should be true only if the address contains '3124'

This will of course give as false positive if the customer's address is 3124 Smith St, but you can probably harden up the contains() to check for 'VIC 3124'.

 

Alternative approaches:

a) put your out-of-town customers in a different customer location (ie create a 'out of town' practice location which you use only to distinguish in-towners from out-of towners)

b) add a field to party.customerperson which reflects in/out of town [we have a customer language field which we use to send out SMS appointment reminders in English or Cantonese]

c) if you are not using the Travel field, use this to flag in/out-of towners

Regards, Tim G

Re: Postcode as User Field in Reminder

Thanks Tim,

I'll have a play with extracting from the address as you suggested - didn't know about the contains() fn.

At the moment the Travel field is largely unused, only for mileage to some farms. A combo of your a) and c) made me think of how we set things up in a home-grown database a few years ago, where we named the Rounds by the main town we went to, then could filter on that.  We could use the Travel field to hold the name of the Rounds.  This week is Balranald,  Sea Lake next etc.  The document paragraph could be hidden if Travel is empty, ie in-town.

Ta.

Simon Slater

Registered Linux User #463789 @ http://linuxcounter.net

Re: Postcode as User Field in Reminder

Simon - contains() is one of the Xpath functions (as is normalize-space()) - see http://www.openvpms.org/documentation/csh/1.9/reference/xpath

There are also some java functions that are available - eg toUpperCase() & toLowerCase() - but these are not documented. [Hint to Tim A: if you give me a list I will add to the above CSH page.]

Regards, Tim G

Re: Postcode as User Field in Reminder

Thanks. My bookmarks still had the 1.7 xpath ref. Updated now.

Simon Slater

Registered Linux User #463789 @ http://linuxcounter.net

Syndicate content