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 check box 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

  1. Letter Templates can be imported from the Administration page by selecting the option for 'Manage Letters' then 'Manage Letter Templates' within the cityEHR Administration page.

  2. 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 wish to import.

  3. 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

  4. Once your chosen template is loaded you can associate it with one or more Compositions in the clinical information model by selecting 'Manage Letters' then 'Associate Templates' within the cityEHR Administration page.

    Associating letter templates with compositions
    Associating letter templates with compositions

Using a Template with a Letter

After your letter template has been uploaded into cityEHR, you can now navigate back to the patient you would like to complete a letter for.

  1. Once you have completed your desired letter within cityEHR, select your desired print template from the drop-down 'Word Processor Template' list

    Note: The templates associated with a Letter are available to select after editing has begun.

    Patient advice letter template
    Patient advice letter template

  2. Click the word processor button on the right of the drop-down list and open the newly download file.

    Note: The name of the downloaded file is set to 'PatientId-letterName-date.odt'

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