Document Templates

Complete

Every form and report has a document template. The template specifies things like usage, paper format, associated printers, its content, and when it is printed.  See also Concepts|Printing for background information, and Create/View/Edit for the template details.

As shown below, the system comes with a number of standard templates. These have to be loaded using the templateload utility (see the readme.txt file in the release package for instructions). Template sets are provided for A4, A5 and Letter. You can use these but you will probably want to modify some of them. You may also want to use a report from the Resource Library set.  See below for a quick summary of how to do this.

Template Usage: One can divide the templates into three groups:
Reports - you use the Reporting|Reports screen to select the report to run
Selectable forms - (eg Patient Forms) you will be presented with a list to select from
System forms - (eg Invoices) where the system chooses the template.

For the first two you can obviously set up as many as you need - you just choose the one you want. In the last case (eg Invoices) you need to be careful because if you create three different invoice templates, the system will just use the first it finds. This is not normally a problem - after all you only need one type of invoice form. However, if you do want to use different templates for each Practice Location, then you can do this by defining the templates to be used by the location. See Administration|Organisation|Practice Location.

If you do need to create or modify reports and forms, see Reference|Reports and Forms. Note that if you want to modify an existing report or form, then if you View the template, you can then click on the Content field to download the report/form ready for editing.

 

Installing a new template
To install a new templatefrom the Resource Library, do as follows:

  1. download the jrxml (or odt) file by right-clicking on the attachment link and using 'Save Link As' (or 'Save Target As' etc depending on your browser) - remember where you saved it
  2. click the New button
  3. on the resulting New Document Template screen set the Type to Report, then click the Upload button. If it's not a report, then you need to set the appropriate Type.
  4. on the resulting window, click Browse and navigate to where you downloaded the file and select it. Click the Send button.
  5. back at the Edit Document Template screen, click the OK button

Changing a standard report paper size
The system comes with a set of reports and documents in the <OPENVPMS-HOME>/reports directory. This is structured as follows:

You can see that there are 8 directories with most having multiple sub-directories, one per function, and each of these has a sub-directory for each paper size each containing the templates for that paper size.

Note that not all paper sizes are provided. In particular, the Reports are provided only in A4 and Letter and not in A5.

So if you initially loaded the A4 set, and want to change your invoices to the A5 equivalents, then you need to load the templates in Customer/Invoice/A5. Do this by editing each template, and then pressing the Upload button to load the appropriate content.

For the invoices you will see that the directory contains the files Invoice.jrxml, Invoice Items.jrxml, Invoice Appointments.jrxml, Invoice Notes.jrxml and Invoice Reminders.jrxml.

Hence you need to edit the Invoice, Invoice Items, Appointments, Notes and Reminders templates, and in each case upload the relevant file from the Customer/Invoice/A5 directory.

Note that these A5 versions use the A5 versions of the Letterhead and Addressbock templates, but these should be present as they are loaded as part of the A4 template set in case you ever want to use some A5 versions.

 

 

Create/Edit/View

Complete

This is the create/edit/view screen for document templates. See also Concepts|Printing and Administration|Templates|Document Templates for background information.

The fields are as follows:
Name - the name of the template. The name can be anything (ie in the example above, we could change the name to 'ABCDE' and the system would still work) but it is sensible to use meaningful names. You can have multiple templates with the same name, but again, it is sensible not to.

Description - a description of the template. This should be used if necessary to clarify the purpose of the template.

Active - uncheck this to deactivate the template.

Type - this is used to define the usage of the template - for example when printing an invoice for a customer, the system looks for templates of type 'Customer Invoice'. The Type also defines what information fields are made available to the Content generator (see below). Most of the Types are self explanatory. Use 'Report' for a report (eg a list of customers or sales, etc), and 'Sub Report' for the report's repeated components (ie the line items). See also this summary.

User Level - this allows you to define who can run which reports. Each user has a level (0-9). A user with level N can only run reports of level N and below.

Report Type - select the report type from the pull-down list. Those available are set using Administration|Lookups|Report Type. The Report Type can be used to select a group of reports on the Reporting|Reports screen.

Preferred Print Mode - this determines when documents are printed or offered for printing. The option is used when the document is generated as a result of invoicing an item which has an attached document. It can be set to:

  • None - the print mode is not specified
  • Immediate - print immediately using the printer/interactive option
  • Check Out - (the default) delay print until at Check Out time
  • Manual - documents must be manually selected for printing

At Check Out time, the system checks if any documents have been accumulated. If there are any that have not been printed, then a window is displayed showing the accumulated documents each with a print checkbox - those that have already been printed, and those with Mode=Manual will have the box unchecked - those whose mode is 'Check Out' will have their box checked.

Paper Size - used to indicate to the printer what size paper is required. It can be set to None, A4, A5, Custom, and Letter. Normally can be left at 'None' unless the printer(s) that you are using allow the selection of different sized paper.

Content - the 'content' is the name of the file containing the JRXML report or Open Office or Microsoft Word template used to generate the document.  See also Introduction|Reporting and JXPath Extension Functions.
If you are editing the template, click the Upload button to upload the required file. If you are viewing the template, then you can click the content file name to download the template content.
Note that for templates that are Type=Subreport, the Report that uses the subreport finds the subreport via its Content name, not its Template name.  Hence if you edit a subreport template and upload content with a different file name, you will have to modify the report to use this new subreport content name.

Orientation - set to Portrait or Landscape as required

Output Format - specifies the document format when generating documents for templates with Type set to Patient Letter, Customer Letter, or Supplier Letter. It can be set to:

  • Default - use the default output format. For JasperReport templates, this is Adobe PDF. For other templates, it is OpenOffice ODT.
  • Adobe PDF - generate Adobe .pdf documents
  • OpenOffice ODT - generate OpenOffice .odt documents. These can be edited using External Edit

Copies - set to the required number of copies

Paper Height, Width and Units - these can normally be left at their defaults unless you have specified 'Paper Size' as Custom.

Note that for OpenOffice and Microsoft Word templates, the Paper Size, Orientation, Paper Height, Paper Width, and Paper Units settings of the Document Template are ignored. These settings must be specified within the OpenOffice or Word template. That is, they are only used for templates that use Jasper Reports (jrxml) content.

Email Template - this is used when sending a document via email. It is:

  • required when the system is generating emails to send out reminders and statements;
  • optional for all other Document Templates. If present, it will be used to pre-fill emails with content when you use Print|Email to email the document.

Note also that the reminder and statement emails will have a From address that will be set as follows (where RB is the contact purpose and is Reminder for reminders and Billing for statements):

  • the RB email contact associated with the customer's Practice Location; or
  • the Practice's RB email contact, if the  customer doesn't have a Practice Location, or the Practice Location doesn't have an RB email contact; or
  • the Practice's preferred email contact, if there is no RB email contact

SMS Template - this is used for customers that have elected to receive SMS messages for patient reminders.

File Name Format - used to specify the file name format of generated documents. If unspecified, the document name is derived from the template file it was generated from. So a PDF generated from the template 'Invoice A5.jrxml' would be assigned the name 'Invoice A5.pdf'. Available formats are determined by Administration|Lookups|File Name Format

Printers tab
The Printers Tab is used to display and maintain the printers that can be used with this template.  You don't have to use this facility, but if you don't then your users will have to choose the required printer each time they print something.
Before using this you need to set up the printers available to the Practice Locations(s) - see Administration|Organisation|Practice Location.
The fields are as follows:
Practice Location - the Practice Location. Note that you can also insert the Practice here. This useful for the case where you want to set a global default printer, and override it for one (or more) locations.  For example if the standard label printer is LABEL-R, but for the upstairs office you wish to use LABEL-U, then it may be more convenient to set LABEL-R for the practice, and LABEL-U for the Main-Upstairs location, than to set the label printer for each practice location. Of course, if you only have two practice locations, then it makes no difference which way you do it, but if you have a more complex setup then it may be better to use the 'set for practice, and override for one location' approach.
Printer Name - choose one from the pull-down list
Paper Tray - if applicable, select the required tray - you will want to use this if you are running plain paper in one tray and letterhead in the other
Interactive - check this box if you want the print dialog box to be displayed (so you can use preview or email rather than print, or change the printer if necessary or load the required paper or ...) before the printing occurs. If the box is not checked, then printing proceeds immediately.

Summary

Complete

The following table summarises the standard Document Templates and their Types and usage.




Document Template Name Template Type Used by/for
Bank Deposit Bank Deposit Reporting|Deposits|Print
Customer Account Balance Report Customer Account Balance Reporting|Debtors|Report
Counter Sale Customer Counter Sale Customers|Charges|Counter Sale|Print
Credit Customer Credit Customers|Charges|Credit
Estimation Customer Estimate Customers|Estimates|Preview|Print
Invoice Customer Invoice Customers|Charges|Invoice|Print
Receipt Customer Payment Customers|Payments|Payment|Print
Statement Customer Statement Reporting|Debtors|Print & Send All
Grouped Reminders Report Grouped Reminders Reporting|Reminders|Send All
Message Message Workflow|Messaging|Print
Desexing Certificate Patient Form check-in processing
Vaccination Certificate Patient Form check-in processing
Patient Image Patient Image Patients|Medical Records|Documents|Print where the item is an Image
Referral Letter Patient Letter report macro
Reminder Cartrophen First Patient Letter Reporting|Reminders|Print & Send All
Reminder Desexing First Patient Letter Reporting|Reminders|Print & Send All
Reminder Vaccination First Patient Letter Reporting|Reminders|Print & Send All
Reminder Vaccination Puppy and Kitten First Patient Letter Reporting|Reminders|Print & Send All
Reminder Vaccination Second Patient Letter Reporting|Reminders|Print & Send All
Drug Label Patient Medication Label Customers|Charges|Invoice &
Patients|Medical Records|New|Medication
where item has a dispensing label
Patient Clinical Event Patient Visit Patients|Medical Records|Print
Patient Reminders Report Reminder Report Reporting|Reminders|Report
Clinician Sales Report Report Reporting|Reports
Customer Acquisition Report Report Reporting|Reports
Customer Balance Report Report Reporting|Reports
Customer List Report Report Reporting|Reports
Customer Payments Report Report Reporting|Reports
Customer Product Sales Report Report Reporting|Reports
Customer Reconciliation Report Report Reporting|Reports
Customer Referral Report Report Reporting|Reports
Customer Sales Report Report Reporting|Reports
Patient Acquisition Report Report Reporting|Reports
Patient Deceased Report Report Reporting|Reports
Patient List Report Report Reporting|Reports
Patient Sterilisation Report Report Reporting|Reports
Practice Clinician Sales Report Report Reporting|Reports
Product List Report Report Reporting|Reports
Product Price List Report Report Reporting|Reports
Stock Reorder Report Report Reporting|Reports
Stock Take List Report Report Reporting|Reports
Stock Valuation Report Report Reporting|Reports
StockTake Sheet Report Report Reporting|Reports
Counter Sale Items Sub Report line items component of Report
Credit Items Sub Report line items component of Report
Estimation Items Sub Report line items component of Report
Invoice Items Sub Report line items component of Report
Invoice Reminders Sub Report line items component of Report
Order Items Sub Report line items component of Report
Receipt Items Sub Report line items component of Report
Statement Items Sub Report line items component of Report
Order Supplier Order Suppliers|Orders|Preview & Generate
Till Balance Till Balance Reporting|Till Balances|Print
Work In Progress Report Work in Progress Charges Reporting|Work In Progress|Report