Clinical Correspondence

Creating a Letter Template

Letter templates are word processor documents (either LibreOffice or MS Office) which contain fields that reference Sections, Entries or Element components in the clinical information model. The template can then be associated with a Letter composition that contains those components, which are then extracted from the composition and used to instantiate the fields in the template.

The letter templates are created outside of cityEHR as any regular document using LibreOffice Write or MS Word. An example of a template is shown below.

 Letter Template for Patient Advice using LibreOffice Writer
Letter Template for Patient Advice using LibreOffice Writer

A Letter Template can contain any text and graphics, together with the fields which reference content in the patient record. The text for those fields is then pulled into the template from the Letter in cityEHR with which the template is associated.

#ISO-13606:Section:sectionId

The values of all Elements for all Entries in the specified Section

#ISO-13606:Entry:entryId

The values of all Elements in the specified Entry

#ISO-13606:Entry:entryId/#ISO-13606:Element:elementId

The value of the specified Element

Note that the components with the referenced identifiers must be present in the Letter with which the template is associated – if not, then the referenced field will be blank. When developing templates you can find the identifiers to use by accessing a Letter in cityEHR running in debugging mode. Click the checkbox to Show Ids and the identifiers for each component will be displayed.

Show Ids When Running cityEHR in Debugging Mode
Show Ids When Running cityEHR in Debugging Mode

Importing and Associating a Template

Letter Templates can be imported from the Administration page by selecting the option for Manage Letters | Manage Letter Templates. This page lists all currently loaded templates and you can add a new one by pressing the + button in the top right menu and then browsing to the file location of the word processor document you with to import. Pressing the red X button next to any existing template in the list allows you to change (re-import) the associated word processor file.

Letter templates
Letter templates

Once your chosen template is loaded you can associate it with one or more Compositions in the clinical information model by selecting Manage Letters | Associate Templates

Associating letter templates with compositions
Associating letter templates with compositions

Using a Template with a Letter

The templates associated with a Letter are available to select when it is being edited. Select the template and press the Wordprocessor button.

Screenshot of Letter template being edited
Screenshot of Letter template being edited

Patient advice letter template
Patient advice letter template