Skip to main content
Version: 3.1

Create a report template

Overview​

This flow describes how to create a new report template for a facility in the Template Builder.

Pre-requisites​

  • You work in the facility that the template is for. Care creates the template for that facility.
  • You know which record the report is for: an encounter, a patient, or a billing account. This decides the report type and the context.
  • You have the permissions listed below.

Permissions​

PermissionAccess
Can Create Template on FacilityShows Create Template if your permissions in the facility include it. To save the new template, you must hold it in the root organization of the facility, Administration. Facility Admin, Doctor and Nurse have it by default.
Can Read TemplateShows Templates in the facility settings and lists the templates. You can hold it in any organization of the facility. Facility Admin, Administrator, Staff, Doctor, Nurse, Volunteer and Pharmacist have it by default.
Can View Template SchemaLoads the contexts and their fields in the Template Builder. You can hold it in any organization of any facility. Only Facility Admin has it by default.
Can Preview TemplateNeeded only for step 5. Lets you preview the template. You can hold it in any organization of any facility. Only Facility Admin has it by default.

By default, only a Facility Admin in Administration has all of these permissions. A Doctor or a Nurse has Can Create Template on Facility by default, but not Can View Template Schema or Can Preview Template.

Steps​

1. Open the template builder​

In the facility sidebar, select Settings.

In the settings sidebar, under Forms, select Templates. Care shows the Templates page.

Select Create Template. Care opens the Template Builder.

Note: If the facility has no templates, you can also select Create Your First Template.

The Templates page in the facility settings, with the Create Template button outlined

2. Fill in the template details​

Complete these fields. All of them are required.

ComponentsWhat it captures
Template NameThe name of the template. Enter a name.
SlugThe short name of the template. Care fills it from the template name. You can change it before you save.
StatusDraft, Active, or Retired. A new template starts as Draft. Care generates reports only from an Active template.
Default FormatHTML or PDF. A new template starts as HTML. If people print the report, select PDF. Only PDF reports open and print in Care.
Report TypeDischarge Summary, Patient Summary, or Account Report. There is no default.

The slug must have 5 to 50 characters.

Use only letters, numbers, hyphens and underscores in the slug. Start and end the slug with a letter or a number.

The slug must be different from the slugs of the other templates of the facility. If it is not, Care shows "Slug already exists."

Note: You cannot change the slug after you save the template.

The Template Builder with the Template Name, Slug, Status, Default Format and Report Type fields filled in and outlined

3. Select the context​

The context is the set of data that the template can use.

In the right panel, open Select Context. Select the context that matches the report type.

Report TypeRecord that the report is forContext to select
Discharge SummaryAn encounterEncounter Report
Patient SummaryA patientPatient Report
Account ReportAn accountAccount Report

Always select a context, even if the Fields card already lists fields.

If the report type and the context do not match, Care shows "Report Type and Context are not compatible" or "Invalid report type or context" when you save.

The Template Builder with Encounter Report selected in the outlined Select Context box, and the encounter fields in the Fields card

4. Insert data fields into the template body​

The Template HTML text area holds the content of the report. You write it in the Jinja2 template language.

Note: A new template starts with a sample discharge summary in Template HTML. Change it or replace it.

The Fields card lists the fields of the context that you selected.

Put the cursor in Template HTML at the position for the data.

Select a field in the Fields card. Care inserts the field at the cursor.

If a field has nested fields, select it to show or hide them.

If the field is part of a list, Care inserts it inside a loop over the list.

When Care generates a report, each field shows the data of the record at that time.

The Template HTML box with the discharge summary advice field inserted, and the Discharge Summary Advice field outlined in the Fields card

5. Check the result​

Care does not check the syntax of the template body when you save it. Errors show only in a preview or when someone generates a report.

Preview the template before you save it. See Preview a template.

6. Save the template​

Select Save Template.

If a required field is empty, Care shows "This field is required". Complete the field and save again.

If Care cannot save the template, it shows the reason in a message.

The Template Builder with the Save Template button outlined

The Template Builder with the message Report template saved successfully outlined at the top

Expected Outcome​

  • Care shows the message "Report template saved successfully".
  • Care opens the new template in the Template Builder, so that you can continue to change it.
  • The new template shows on the Templates page of the facility.
  • If the status is Active, Care offers the template when someone generates a report of that report type. If the status is Draft or Retired, Care does not offer it.

Concepts:

Flows: