Document merging with Open Office Writer

OpenVPMS utilises OpenOffice Writer to produce client and patient forms and letters. 
 
Within these open office documents we can utilise field names that get automatically replaced by OpenVPMS with the information associated with the form or letter being produced. 
 
As OpenVPMS is based on a archetyping principle which allows the data being stored to be readily modified, we had to define a field naming approach that catered for this as well. 
 
The following tables outlines  the currently defined fields that can be included in different document types:
 
Field
Document Type(s)
Description
Applicable to All Documents
 
Applicable to All Documents 
startTime
All
The date associated with the document in the current locale format.  i.e dd/MM/yyyy 
description
All
The document description 
[party:getPartyFullName(party:getPractice())]
All
Returns the Full Name of the Practice 
[party:getPracticeAddress()]
All
Returns a single line version of the Practice address 
[party:getBillingAddress(party:getPractice())]
All
Returns the formatted Billing address of the Practice 
[party:getCorrespondenceAddress(party:getPractice())]
All
Returns the formatted Correspondence address of the Practice
[party:getWorkTelephone(party:getPractice())]
All
Returns the Practice work telephone. 
[party:getFaxNumber(party:getPractice())]
All
Returns the Practice fax number 
[party:getEmailAddress(party:getPractice())]
All
Returns the Practice Email Address 
Applicable to All Customer Documents
 
Applicable to All Customer Documents
customer.entity.id
Customer
The customer ID
customer.entity.title
Customer
The customer Title 
customer.entity.initials
Customer
The customer Initials 
customer.entity.name
Customer
The customer Name in format <Lastname>,<FirstName> or <name> for organisations. 
[party:getPartyFullName(openvpms:get(.,'customer.entity'))]
Customer
The customer Full Name in format <Title> <FirstName> <Lastname> or just name if an organisation. 
customer.entity.firstName
Customer
The customer First Name 
customer.entity.lastname
Customer
The customer Last Name 
[party:getBillingAddress(.)]
Customer
Gets the first location contact for the customer which has a Billing Purpose.  If no location with this purpose then gets first preferred location contact.  If no preferred location gets first location contact found. 
[party:getCorrespondenceAddress(.)]
Customer
Gets the first location contact for the customer which has a Correspondence Purpose.  If no location with this purpose then gets first preferred location contact.  If no preferred location gets first location contact found.
customer.entity.description
Customer
The customer Preferred Address and Home Phone Number in the format
<street>
<city> <state> <postcode> - <home phone number>
[party:getEmailAddress(.)]
Customer
The customer email address
[party:getHomeTelephone(.)]
Customer
Gets the first telephone contact with a  purpose of Home.  If no telephone contact with Home gets first preferred telephone contact.  If no preferred get first telephone number found. 
[party:getWorkTelephone(.)]
Customer
Gets the first telephone contact with a  purpose of Work.  If no telephone contact with Work gets first preferred telephone contact.  If no preferred get first telephone number found.
[party:getMobileTelephone(.)]
Customer
Gets the first telephone contact with a purpose of Mobile.
[party:getFaxNumber(openvpms:get(.,'customer.entity'))]
Customer
 

Gets the first fax number found for the customer. 
[party:getAccountBalance(.)]
Customer
 

Returns the current account balance for the customer 
Applicable to All Patient Documents
 
Applicable to All Patient Documents
[openvpms:get(party:getPatientOwner(.),'id')]
Patient
The customer ID
[openvpms:get(party:getPatientOwner(.),'title')]
Patient
The customer Title
[openvpms:get(party:getPatientOwner(.),'initials')]
Patient
The customer Initials
[openvpms:get(party:getPatientOwner(.),'name')]
Patient
The customer Name in format <Lastname>,<FirstName> or <name> for organisations. 
[party:getPartyFullName(party:getPatientOwner(.))]
Patient
The customer Full Name in format <Title> <FirstName> <Lastname> or just name if an organisation for the owner of the Patient associated with the document as at the date of the document. 
[openvpms:get(party:getPatientOwner(.),'firstName')]
Patient
The customer First Name
[openvpms:get(party:getPatientOwner(.),'lastName')]
Patient
The customer Last Name
[party:getBillingAddress(party:getPatientOwner(.))]
Patient
Gets the first location contact for the customer which has a Billing Purpose.  If no location with this purpose then gets first preferred location contact.  If no preferred location gets first location contact found.
[party:getCorrespondenceAddress(party:getPatientOwner(.))]
Patient
Gets the first location contact for the customer which has a Correspondence Purpose.  If no location with this purpose then gets first preferred location contact.  If no preferred location gets first location contact found.
[openvpms:get(party:getPatientOwner(.),'description')]
Patient
The customer Preferred Address and Home Phone Number in the format
<street>
<city> <state> <postcode> - <home phone number>
[party:getEmailAddress(party:getPatientOwner(.))]
Patient
The customer email address
[party:getHomeTelephone(party:getPatientOwner(.))]
Patient
Gets the first telephone contact with a  purpose of Home.  If no telephone contact with Home gets first preferred telephone contact.  If no preferred get first telephone number found. 
[party:getWorkTelephone(party:getPatientOwner(.))]
Patient
Gets the first telephone contact with a  purpose of Work.  If no telephone contact with Work gets first preferred telephone contact.  If no preferred get first telephone number found.
[party:getMobileTelephone(party:getPatientOwner(.))]
Patient
Gets the first telephone contact with a purpose of Mobile.
[party:getFaxNumber(party:getPatientOwner(.))]
Patient
Gets the first fax number found for the customer.
[party:getAccountBalance(party:getPatientOwner(.))]
Patient
Returns the current account balance for the customer who is the current owner of the current patient  
patient.entity.id
Patient
The patient's ID 
patient.entity.name
Patient
The patient's name 
patient.entity.species
Patient
The patient's species 
patient.entity.breed
Patient
The patient's breed 
patient.entity.sex
Patient
The patient's sex 
[party:getPatientDesexStatus(.)]
Patient
Returns status as "Entire" or "Desexed" 
[party:getPatientWeight(.)]
Patient
The patient's weight
patient.entity.colour
Patient
The patient's colour 
patient.entity.dateOfBirth
Patient
The patient's date of birth 
patient.entity.age
Patient
The patient's age including words years, months and weeks as appropriate. 
[party:getPatientMicrochip(.)]
Patient
The last microchip id for the patient. 
patient.entity.description
Patient
Returns string of <sex> <colour> <breed> (Microchip: <microchip>)
eg "Male Black Kelpie (Microchip: 956000001111234)".
patient.entity.customFields.target.customFieldName Patient returns the name of custom fields.(You need to change "customFieldName" to match the name of the node that you want)
clinician.entity.name
Patient
The name of the clinician associated with the document as derived from Administration | Users | Pick User | Name.
clinician.entity.description
Patient
The description of the clinician associated with the document as derived from Administration | Users | Pick user | Description.
id
Patient
Investigation Request id number.
product.entity.name
All Patient Forms
The name of the product associated with the form. 
product.entity.printedName
All Patient Forms
the printed name of the product associated with the form. 
[openvpms:get(., 'invoiceItem.source.batch.entity.name')]
Patient
the Batch Number associated with a product. Note that for its use in a vaccination document the template must be attached to the vaccination product so that the certificate is generated when the vaccination is invoiced. This links the certificate to the invoice item, enabling the batch number to be located. 
[openvpms:get(., 'invoiceItem.source.batch.entity.product.activeEndTime')]
Patient
the Expiry Date of the batch associated with a product. Note that for its use in a vaccination document the template must be attached to the vaccination product so that the certificate is generated when the vaccination is invoiced. This links the certificate to the invoice item, enabling the batch expiry date to be located. 
[openvpms:get(., 'invoiceItem.source.batch.entity.manufacturer.target.name')]
Patient
the Manufacturer of the product associated with the batch number. Note that for its use in a vaccination document the template must be attached to the vaccination product so that the certificate is generated when the vaccination is invoiced. This links the certificate to the invoice item, enabling the batch manufacturer to be located. 
[openvpms:get(party:getPatientReferralVet(.),'firstName')]
Patient
Returns the first Name of the  Referring Vet associated with the Patient.  The referring vet is selected based on the referral information for the patient and the date of the document. 
[openvpms:get(party:getPatientReferralVet(.),'lastName')]
Patient
Returns the first Name of the  Referring Vet associated with the Patient.  The referring vet is selected based on the referral information for the patient and the date of the document.
[openvpms:get(party:getPatientReferralVetPractice(.),'name')]
Patient
Returns the name of the Referring Practice associated with the current Referring Vet for the patient.  The referring practice is selected based on the dated associations with the referring vet and the document date. 
[party:getFaxNumber(party:getPatientReferralVetPractice(.))]
Patient
Returns the fax number of the referring practice.
[party:getFaxNumber(party:getPatientReferralVetPractice(.))]
Patient
Returns the work telephone number for the referring practice
[party:getBilling Address(party:getPatientReferralVetPractice(.))]
Patient
Returns the formatted Billing Address for the Referring Practice. 
[party:getCorrespondence Address(party:getPatientReferralVetPractice(.))]
Patient
Returns the formatted Correspondence address for the Referring Practice 
Syndicate content