TORCH: Templates - How To

Created by Tim Cook
Keywords:

'The Concept'

Major Templates are used as a quick method of creating a patient encounter note. A Major Template is defined as one that describes a major portion of an encounter note such as the physical exam, the impression or plan.

Using a well designed set of templates the healthcare provider can quickly and accurately generate a patient encounter note while speaking to the patient and checking a few boxes. Any number of major templates may be used during any one patient encounter.

Before diving in to build your own templates it is advisable to go through a patient encounter with the demo to get a feel for how they function. It will also make these instructions a little easier to understand. You can begin an encounter by selecting Patient Records from the main TORCH screen. List All Patient Records or search for a patient if you have several already entered. Click the link in the lastname opening the patient record in a new window.

Major Templates are created from other templates. A template is an object that contains one of the following datasets:

Text Only - only appears on the generated template. Used for headings or descriptions.

Radio Buttons - used to select one choice from a group.

Checkboxes - used to select one or more items from a group.

Text Input Box - used to input text or numbers taht will be displayed in the note.

Note Text - used to add text to the note that is not displayed in the template.

Script Call - a call to any valid Zope script type that returns results back to the template.

Major Templates may not be nested in other major templates.

A template may be as simple as a basic Yes or No selection or as complicated as a selection of multiple items from a list of many items. These template objects can reference and be referenced by other template objects.

If you create a circular reference by referencing a template that references the the current template, the system will constantly attempt to render the two and be unusable. You have been warned! You can repair this by editing the template via teh ZMI.

'Template Generator'

All templates are created and edited using the FreePM Template Generator. The template generator screen has three frames. The top frame contains the menu. The right-hand frame is where new template data is entered or existing templates are edited. The left-hand frame may contain either, a list of all templates or a list of only major templates.

The templates are segregated into Divisions that roughly approximate a specialty or problem area where they would be used. The left-hand frame displays either a clickable list of these divisions (for major template only display) or (in the case of All Templates) a tree structure showing the Divisions as Folders and the templates inside each division.

'Creating a Major Template'

To describe how to create a Major Template it is best to use an example. We will use a Lower Back Pain example contributed by Dr. Chason Hayes. (You may view the actual major templates from a patient record encounter screen or by clicking on the Major Templates link in the menu).

--------------------------------------------------------------------------------
added in 0.8.0 needs to be integrated not just stuck in here.
Click on the All Templates link on the menu. In the left-hand frame click on the small plus sign (+) next to Musculoskeletal. This will display all of the templates in this division. The major templates are shown with a M to the left of the template title.
Click on the template icon to show the html source code generated by that template. In the case of major templates this will render the templates the same way it will look in the encounter section.

added in 1.0b1 needs to be integrated not just stuck in here.
THe concept of template categories was superceeded by the template division implementation above. Now all templaets are created with a nine digit ID.

To edit the template or copy the template to another division, click on the title link. The template details will be displayed in the right-hand frame. To copy the template to another division, select the desired division from the division pulldown at the top of the frame.

--------------------------------------------------------------------------------

The first template we created was the Duration (click on Duration).
Looking at the Template Editor from top to bottom, you should see the Title and ID of the template you are currently editing. Next is the Category selection box. Categories are only used to group templates together in the All Templates list. You may use any template inside any other template. If you need a Category taht doesn't appear in the list you can create a new one by clicking on the Edit Categories link and completing the input boxes. Please read the instructions.

The Show in Major Template List box is unchecked, indicating that this is NOT a template that will be used to create a patient note.
Next is the template Title. A descriptive title should be entered here. You may or may not want this title displayed on the template in it's rendered state. In this case we do want to use this text. You will also notice that we chose to indent the word with two HTML non-breaking spaces. More on including HTML in your templates later.
The next option is the type of template object this should be. Here we wanted a list of duration descriptions and we only want the user to select one of them. Therefore Radio Buttons is the correct choice.

The next two input boxes are for text that will only appear in the patient encounter note. The text will appear before or after each of the options listed in the Body. This text will not appear on the template when it is rendered. In this example there is none. There reason for this will be discussed below.

The next two input boxes are only used when the Type is selected as Checkboxes. At the end of a list of checkboxes, a default selected checkbox can be generated that reduces the number of clicks required in a template. The Text for an all negative result: box should contain what you want inserted in the patient note. The Label for an all negative checkbox: contains what is displayed in the rendered template. By default this box contains the words, All Negative.

The content and positioning of the items in the Body of a template are critical to getting the results you expect.
Some general guidelines are:

the Body may contain text and/or template ID's.
when Radio Buttons or Checkboxes are selected, the option listed on the first line of the Body will be selected by default.
a template ID on the first line of the Body is rendered the same as if it were on any other line.
template ID's must be a on a line by themselves to be rendered correctly.

text input boxes must be defined with their length on the first line of the Body.

A good way to see how these different options work is to review some of the templates in the editor.

The first item in the Body is another template ID (GEN074603). This template (you may review it if you like) contains some text for the patient note that leads into the duration. The next entry is another template ID (GEN000009). This is the three character text input box template. The next six lines contain the options for the radio buttons that will appear in the template. The last item is a template (GEN074496) that contains text to be added after the Duration text.

Comments and Reviewed By are optional and at this time are stored but not used in TORCH.

There is alot more to building templates. More documentation will be prepared in the future. For now I refer you to the existing templates. Browse through them in the editor to see how they are constructed.

You can see the rendered version of any template object by clicking on it's ID in the Template Generator.

You cannot hurt your TORCH installation by experimenting with building templates. If a template doesn't work or crashes, it will only affect itself. Unless you write a malicious script that deletes other objects.