Desexed Merge Fields

Hi,

Can anyone provide me with the WORD (not open office) merge fields to enable me to get the desexed status of a patient on certificates.

Also, can anyone tell me if these fields have been updated. When we started with OpenVPMS entire animals appeared as FALSE and desexed animals appeared as TRUE which we thought was a bit confusing (we thought it should be the other way around) that's why we removed the desexed status fields altogether.

Sandra.

Comment viewing options

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

Re: Desexed Merge Fields

Hi Sandra, I have been playing with conditional fields in Word (in order to get the FALSE and TRUE of the desexed status turn into text of your choosing)and have not been able to get them to work sadly. Using conditional fields is how we control what true/false results look like in openoffice. We dont use MS office at work which makes testing them tricky for me.

I had recommended trying this with another user: 1. Type Ctl-F9 2. Curly brackets will appear. Type IF in the curly brackets -> {IF } 3. Type Ctl-F9 again -> {IF {}} 4. Type "MERGEFIELD patient.entity.desexed" -> {IF {MERGEFIELD patient.entity.desexed}} 5. Type ="True" "Desexed" "Undesexed" after the curly bracket -> {IF {MERGEFIELD patient.entity.desexed}="True" "Desexed" "Undesexed"} 6. Right click on the field and choose Update Field

I have also attached a document version which I have been advised did not work as intended :(

As for the fields themselves, I thought they were the same as Openoffice fields inserted as mergefields? A list of the merge field names is here http://www.openvpms.org/document-merging-with-open-office-writer

I've attached a screen shot showing the dialog used to insert the above texts as merge fields in Word documents. I hope it appears for everyone.

Cheers, Matt C

On Tue, 7 Jul 2009 01:58:57 +0000 (UTC), sandra@bellvet.com.au wrote:

> Hi, > > Can anyone provide me with the WORD (not open office) merge fields to > enable me to get the desexed status of a patient on certificates. > > Also, can anyone tell me if these fields have been updated. When we > started with OpenVPMS entire animals appeared as FALSE and desexed animals

> appeared as TRUE which we thought was a bit confusing (we thought it should

> be the other way around) that's why we removed the desexed status fields > altogether. > > Sandra. > _______________________________________________ > OpenVPMS User Mailing List > users@lists.openvpms.org > To unsubscribe or change your subscription visit: > http://lists.openvpms.org/listinfo/users > Posts from this mailing list can be viewed online and replied to in the > OpenVPMS User's forum- http://tinyurl.com/openvfu >

Re: Desexed Merge Fields

Hi Guys,

Thanks for having a look at this Matt.

In regards the Word document merge fields we only support MERGEFIELD. The reason is we utilise open office to do the merging of the word document and we utilise the MERGEFIELD tag to identify the field and we then get the remaining text and evaluate it as an internal expression. If the IF is inserted then we cannot identify the field and it will not get evaluated and replaced.

The good thing is the expression can utilise any valid expression we are able to use not just the field name. This means we can utilise all the standard xpath language functions as well. Unfortunately xpath does not have an If operator but I remember putting together a sneaky expression that got around this restriction. The problem is it was so sneaky I can't remember it any more but I will search the archives and find it ..

For 1.4 I have created a new function openvpms:getPatientDesexStatus(.) which returns a string "Desexed" or "Entire" based on the desex flag. Will need to internationalise before releasing though.

Cheers Tony

On 7/07/09 7:18 PM, "Mpcosta@Boroniavet. Au" :

> Hi Sandra, > I have been playing with conditional fields in Word (in order to get the > FALSE and TRUE of the desexed status turn into text of your choosing)and > have not been able > to get them to work sadly. Using conditional fields is how we control what > true/false results look like in openoffice. > We dont use MS office at work which makes testing them tricky for me. > > I had recommended trying this with another user: > 1. Type Ctl-F9 > 2. Curly brackets will appear. Type IF in the curly brackets -> {IF } > 3. Type Ctl-F9 again -> {IF {}} > 4. Type "MERGEFIELD patient.entity.desexed" -> {IF {MERGEFIELD > patient.entity.desexed}} > 5. Type ="True" "Desexed" "Undesexed" after the curly bracket -> {IF > {MERGEFIELD patient.entity.desexed}="True" "Desexed" "Undesexed"} > 6. Right click on the field and choose Update Field > > I have also attached a document version which I have been advised did not > work as intended :( > > > As for the fields themselves, I thought they were the same as Openoffice > fields inserted as mergefields? A list of the merge field names is here > http://www.openvpms.org/document-merging-with-open-office-writer > > I've attached a screen shot showing the dialog used to insert the above > texts as merge fields in Word documents. I hope it appears for everyone. > > Cheers, > Matt C > > > > On Tue, 7 Jul 2009 01:58:57 +0000 (UTC), sandra@bellvet.com.au wrote: >> Hi, >> >> Can anyone provide me with the WORD (not open office) merge fields to >> enable me to get the desexed status of a patient on certificates. >> >> Also, can anyone tell me if these fields have been updated. When we >> started with OpenVPMS entire animals appeared as FALSE and desexed > animals >> appeared as TRUE which we thought was a bit confusing (we thought it > should >> be the other way around) that's why we removed the desexed status fields >> altogether. >> >> Sandra. >> _______________________________________________ >> OpenVPMS User Mailing List >> users@lists.openvpms.org >> To unsubscribe or change your subscription visit: >> http://lists.openvpms.org/listinfo/users >> Posts from this mailing list can be viewed online and replied to in the >> OpenVPMS User's forum- http://tinyurl.com/openvfu >> > _______________________________________________ > OpenVPMS User Mailing List > users@lists.openvpms.org > To unsubscribe or change your subscription visit: > http://lists.openvpms.org/listinfo/users > Posts from this mailing list can be viewed online and replied to in the > OpenVPMS User's forum- http://tinyurl.com/openvfu

_______________________________________________ OpenVPMS User Mailing List users@lists.openvpms.org To unsubscribe or change your subscription visit: http://lists.openvpms.org/listinfo/users Posts from this mailing list can be viewed online and replied to in the OpenVPMS User's forum- http://tinyurl.com/openvfu

Re: Desexed Merge Fields

I didn't realise you could use Xpath functions. Work arounds for conditionals for xpath 1.0 here http://www.tkachenko.com/blog/archives/000156.html

in XPath number(true()) is 1, while number(false()) is 0 and when second argument of substring() function is greater than actual length of the string, empty string is returned. Hence substring($s1, number(not($condition))*string-length($s1)+1) returns $s1 if $condition is true and empty string otherwise. Concatenating two such expressions in mutually exclusive way gives us conditional strings expression.

Something like concat((substring('Desexed', (patient.entity.desexed!=false)*string-length('Desexed')+1)),(substring('Entire', (patient.entity.desexed!=true)*string-length('Entire')+1))) haven't tested it and doing this on the fly so not sure if this is what you did last time Tony. Cheers, Matt

On Wed, 08 Jul 2009 09:25:24 +1000, Tony De Keizer

wrote:

> Hi Guys, > > Thanks for having a look at this Matt. > > In regards the Word document merge fields we only support MERGEFIELD. The > reason is we utilise open office to do the merging of the word document and

> we utilise the MERGEFIELD tag to identify the field and we then get the > remaining text and evaluate it as an internal expression. If the IF is > inserted then we cannot identify the field and it will not get evaluated > and > replaced. > > The good thing is the expression can utilise any valid expression we are > able to use not just the field name. This means we can utilise all the > standard xpath language functions as well. Unfortunately xpath does not > have an If operator but I remember putting together a sneaky expression > that > got around this restriction. The problem is it was so sneaky I can't > remember it any more but I will search the archives and find it .. > > For 1.4 I have created a new function openvpms:getPatientDesexStatus(.) > which returns a string "Desexed" or "Entire" based on the desex flag. Will

> need to internationalise before releasing though. > > Cheers > Tony > > > > On 7/07/09 7:18 PM, "Mpcosta@Boroniavet. Au" : > >> Hi Sandra, >> I have been playing with conditional fields in Word (in order to get the >> FALSE and TRUE of the desexed status turn into text of your choosing)and >> have not been able >> to get them to work sadly. Using conditional fields is how we control >> what >> true/false results look like in openoffice. >> We dont use MS office at work which makes testing them tricky for me. >> >> I had recommended trying this with another user: >> 1. Type Ctl-F9 >> 2. Curly brackets will appear. Type IF in the curly brackets -> {IF } >> 3. Type Ctl-F9 again -> {IF {}} >> 4. Type "MERGEFIELD patient.entity.desexed" -> {IF {MERGEFIELD >> patient.entity.desexed}} >> 5. Type ="True" "Desexed" "Undesexed" after the curly bracket -> {IF >> {MERGEFIELD patient.entity.desexed}="True" "Desexed" "Undesexed"} >> 6. Right click on the field and choose Update Field >> >> I have also attached a document version which I have been advised did not

>> work as intended :( >> >> >> As for the fields themselves, I thought they were the same as Openoffice >> fields inserted as mergefields? A list of the merge field names is here >> http://www.openvpms.org/document-merging-with-open-office-writer >> >> I've attached a screen shot showing the dialog used to insert the above >> texts as merge fields in Word documents. I hope it appears for everyone. >> >> Cheers, >> Matt C >> >> >> >> On Tue, 7 Jul 2009 01:58:57 +0000 (UTC), sandra@bellvet.com.au wrote: >>> Hi, >>> >>> Can anyone provide me with the WORD (not open office) merge fields to >>> enable me to get the desexed status of a patient on certificates. >>> >>> Also, can anyone tell me if these fields have been updated. When we >>> started with OpenVPMS entire animals appeared as FALSE and desexed >> animals >>> appeared as TRUE which we thought was a bit confusing (we thought it >> should >>> be the other way around) that's why we removed the desexed status fields

>>> altogether. >>> >>> Sandra. >>> _______________________________________________ >>> OpenVPMS User Mailing List >>> users@lists.openvpms.org >>> To unsubscribe or change your subscription visit: >>> http://lists.openvpms.org/listinfo/users >>> Posts from this mailing list can be viewed online and replied to in the >>> OpenVPMS User's forum- http://tinyurl.com/openvfu >>> >> _______________________________________________ >> OpenVPMS User Mailing List >> users@lists.openvpms.org >> To unsubscribe or change your subscription visit: >> http://lists.openvpms.org/listinfo/users >> Posts from this mailing list can be viewed online and replied to in the >> OpenVPMS User's forum- http://tinyurl.com/openvfu > > > _______________________________________________ > OpenVPMS User Mailing List > users@lists.openvpms.org > To unsubscribe or change your subscription visit: > http://lists.openvpms.org/listinfo/users > Posts from this mailing list can be viewed online and replied to in the > OpenVPMS User's forum- http://tinyurl.com/openvfu >

_______________________________________________ OpenVPMS User Mailing List users@lists.openvpms.org To unsubscribe or change your subscription visit: http://lists.openvpms.org/listinfo/users Posts from this mailing list can be viewed online and replied to in the OpenVPMS User's forum- http://tinyurl.com/openvfu

Merge Fields

Sandra @ Bellarine

Wow, I hope I wasn't meant to follow all that, because sadly I have no hope!  I do get the gist that it will be fixed in the 1.4 realease and I think I'll hang out for that?

Thanks!

Sandra.

Re: Merge Fields

Hi Sandra,

Just Matt and I trying to figure out a solution and airing our thoughts .. Community problem solving :-)

Just working out correct expression and then will give answer to you in terms you easily implement in your documents :-)

Cheers Tony

On 8/07/09 3:05 PM, "Sandra" :

> Sandra @ Bellarine Wow, I hope I wasn't meant to follow all that, because

> sadly I have no hope!  I do get the gist that it will be fixed in the 1.4 > realease and I think I'll hang out for > that?

Thanks! Sandra. _______________________________________________

OpenVPMS

> User Mailing List

users@lists.openvpms.org

To unsubscribe or change your

> subscription visit:

http://lists.openvpms.org/listinfo/users

Posts from this

> mailing list can be viewed online and replied to in the OpenVPMS User's forum- > http://tinyurl.com/openvfu

_______________________________________________ OpenVPMS User Mailing List users@lists.openvpms.org To unsubscribe or change your subscription visit: http://lists.openvpms.org/listinfo/users Posts from this mailing list can be viewed online and replied to in the OpenVPMS User's forum- http://tinyurl.com/openvfu

Desexed Merge Fields

Hi Guys,

I managed to get the correct expression so here it is for the two different document types. I suggest you cut and paste from here rather than try and type in as it is pretty long.

Open Office

Create a field and enter the following expression

[concat(substring('Desexed',0,number(openvpms:get(.,'patient.entity.desexed'))*string-length('Desexed')+1),substring('Entire',0,number(not(openvpms:get(.,'patient.entity.desexed')))*string-length('Entire')+1))]

Word

Hit Ctrl-F9 and in the displayed curly brackets enter

MERGEFIELD [concat(substring('Desexed',0,number(openvpms:get(.,'patient.entity.desexed'))*string-length('Desexed')+1),substring('Entire',0,number(not(openvpms:get(.,'patient.entity.desexed')))*string-length('Entire')+1))]

Obviosuly you can modify teh displayed strings (Desexed, Entire) as required for your site/country.

Cheers

Tony

Desex Merge Fields

Sandra @ Bellarine

Hi Tony,

I've copied the merge field above into my document, the line now reads 'male true desexed', how do I get rid of the word true? Does it have something to do with your comment "Obviosuly you can modify the displayed strings (Desexed, Entire) as required for your site/country".

Sandra.

Re: Desex Merge Fields

Hi Sandra,

I think you just need to delete the original merge field (patient.entity.desexed) from the document.

Cheers Tony

On 13/07/09 10:36 AM, "Sandra" :

> Sandra @ Bellarine > Hi Tony, > I've copied the merge field above into my document, the line now reads 'male > true desexed', how do I get rid of the word true? Does it have something to do > with your comment "Obviosuly you can modify the displayed strings (Desexed, > Entire) as required for your site/country". > Sandra. > _______________________________________________ > OpenVPMS User Mailing List > users@lists.openvpms.org > To unsubscribe or change your subscription visit: > http://lists.openvpms.org/listinfo/users > Posts from this mailing list can be viewed online and replied to in the > OpenVPMS User's forum- http://tinyurl.com/openvfu

_______________________________________________ OpenVPMS User Mailing List users@lists.openvpms.org To unsubscribe or change your subscription visit: http://lists.openvpms.org/listinfo/users Posts from this mailing list can be viewed online and replied to in the OpenVPMS User's forum- http://tinyurl.com/openvfu

Merge fields

Sandra @ Bellarine

Hi Tony,

I'd already deleted the old desexed merge field. What remains is the patient.entity.sex and then the new merge field I copied from above.

Sandra.

Merge Fields

I tried the same insert and failed miserably including losing the original cerificate I forgot to save so I have decided to wait until 1.4.

 

By the way, is there a list of Open Office based certificates and documents that I can import. At the moment we are using a jumble of ex RxWorks & Open Office  documents but I think for editing purposes it would be easier just to use Open Office based cerificates as I for one get very confused between which merge fields to use in which type documents - so probably better if I just change everything to OO

 

Nick

Re: Merge Fields

Hi Nick,

I recently worked through this with Sandra so she may be able to help you get the merge field inserted correctly.

The field names themselves are actually the same in both kind of documents. The way you insert them into the document is different of course and unfortunately we cannot do much about this.

Obviously our preference is to use Open Office especially as it is also open source but we added support for Word Documents to ease the pain of moving current forms and letters into OpenVPMS. Given some practices may have invested many hours to develop their template documents.

The OpenVPMS release only provides a base set of standard certificate and reminder documents. The shared resources area on the web site is meant to be a repository of documents people can develop and share.

One other option is to edit your word documents in Open Office and save in open office format rather than in word format. The only thing is you will need to insert all the merge fields manually again. My be quite painful :-(

Cheers Tony

On 15/07/09 11:05 AM, "Paradisevets@Internode. Net" :

> I tried the same insert and failed miserably including losing the original > cerificate I forgot to save so I have decided to wait until 1.4.

 

By the way,

> is there a list of Open Office based certificates and documents that I can > import. At the moment we are using a jumble of ex RxWorks & Open Office  > documents but I think for editing purposes it would be easier just to use Open > Office based cerificates as I for one get very confused between which merge > fields to use in which type documents - so probably better if I just change > everything to > OO

  Nick _______________________________________________

OpenVPMS User

> Mailing List

users@lists.openvpms.org

To unsubscribe or change your

> subscription visit:

http://lists.openvpms.org/listinfo/users

Posts from this

> mailing list can be viewed online and replied to in the OpenVPMS User's forum- > http://tinyurl.com/openvfu

_______________________________________________ OpenVPMS User Mailing List users@lists.openvpms.org To unsubscribe or change your subscription visit: http://lists.openvpms.org/listinfo/users Posts from this mailing list can be viewed online and replied to in the OpenVPMS User's forum- http://tinyurl.com/openvfu

Mergefields

Hi Tony,

 

as I think the word docs have been put into the system in most places where to I find the repository of the

base set of standard certificate and reminder documents. I can then import these and replace the word docs in the templates without me fiddling with the mergefields.

 

I will also contact Sandra and see what she is willing to help me with

 

Cheers

 

Nick

Re: Mergefields

Hi Nick,

If you click on the Word icon in the template it should open up Word with the templates content. You can then save this document to any location on your system (File -> Save As ...) and edit, convert etc and then upload back to the template.

Of course always keep a copy just in case something goes wrong with the edit :-)

Cheers Tony

On 20/07/09 7:46 PM, "Paradisevets@Internode. Net" :

> Hi Tony,

 

as I think the word docs have been put into the system in most

> places where to I find the repository of the base set of standard certificate

> and reminder documents. I can then import these and replace the word docs in > the templates without me fiddling with the mergefields.

 

I will also contact

> Sandra and see what she is willing to help me > with

  Cheers   Nick _______________________________________________

OpenVPMS

> User Mailing List

users@lists.openvpms.org

To unsubscribe or change your

> subscription visit:

http://lists.openvpms.org/listinfo/users

Posts from this

> mailing list can be viewed online and replied to in the OpenVPMS User's forum- > http://tinyurl.com/openvfu

_______________________________________________ OpenVPMS User Mailing List users@lists.openvpms.org To unsubscribe or change your subscription visit: http://lists.openvpms.org/listinfo/users Posts from this mailing list can be viewed online and replied to in the OpenVPMS User's forum- http://tinyurl.com/openvfu

Merge Fields

Sandra @ Bellarine

Hi Tony,

All is well now, documents are printing correctly.  It was me not doing things correctly. Thanks for all your help!

Sandra.

Syndicate content