Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
sidebar_position: 9
---

# Report template

A **report template** is a reusable document layout that Care fills with real data to produce a report, such as a discharge summary or an account report. A facility authors the template once. Care then generates a report from it for each patient, encounter, or account.

## Definition

A report template holds the layout of a printable document and the rules that decide which data Care puts into it. The template stays separate from the reports it produces.

A report template is specific to Care. It has no equivalent FHIR resource.

The important distinction: a template is a layout, not a document. Care creates a separate report file each time a user generates a report. A change to the template does not change a report that Care generated before the change.

A template belongs to one facility, or to the whole deployment. A facility template is visible only inside that facility. A deployment-wide template is visible in every facility.

## Key Attributes

| Components | What it captures |
| --- | --- |
| Template Name | The name that users see in the template list. |
| Slug | A short, unique text identifier for the template inside the facility. |
| Description | A short note about the purpose of the template. |
| Status | The stage of the template. See the status table below. |
| Report Type | The kind of report the template produces, such as Discharge Summary. |
| Context | The record that supplies the data, such as an encounter or a patient. |
| Default Format | The output format of the report, PDF or HTML. |
| Template HTML | The layout of the document, with placeholders for the data fields. |

### Report Type and Context

The Report Type and the Context must agree with each other. Each report type applies to one kind of record, and the context must supply data for that same kind of record. For example, a Discharge Summary applies to an encounter, so it needs an encounter context. Care refuses a template that pairs a report type with an unrelated context.

### Status

| Status | Description |
| --- | --- |
| Draft | The template is in preparation. Users cannot generate reports from the template. |
| Active | The template is published. Users can generate reports from the template. |
| Retired | The template is withdrawn. Users cannot generate reports from the template. |

## Permissions

Care grants a permission through a role. A user gets a role in a facility organization, and the permission applies to the facilities under that organization.

| Permission | Description | System Roles |
| --- | --- | --- |
| Can Read Template | See the template list and open a template. | Facility Admin, Administrator, Admin, Staff, Doctor, Nurse, Volunteer, Pharmacist |
| Can Create Template on Facility | Create a template, and change a template. | Facility Admin, Admin, Doctor, Nurse |
| Can Preview Template | See a preview of a template with sample data. | Facility Admin, Admin |
| Can View Template Schema | See the list of data fields that a context supplies. | Facility Admin, Admin |
| Can generate report from template | Generate a report from an Active template. | Facility Admin, Administrator, Admin, Staff, Doctor, Nurse, Volunteer, Pharmacist |

Only a superuser can create or change a deployment-wide template.

A user who generates a report also needs read access to the record that supplies the data. For a discharge summary, the user needs access to the encounter.

## Related

- Flow: [Create a report template](../../flows/definitions/create-a-report-template.mdx)
- Concept: [Questionnaire](../definitions/questionnaire.mdx)
- Concept: [Encounter](../clinical/encounter.mdx)
- Reference: [Report template](../../references/definitions/report-template.mdx)
5 changes: 5 additions & 0 deletions versioned_docs/version-3.0/flows/definitions/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "Definitions & Terminology",
"position": 2,
"key": "definitions-flows"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
sidebar_position: 1
---

# How to create a report template

## Overview

This flow describes how to create a [report template](../../concepts/definitions/report-template.mdx) for a facility in Care. At the end, the facility has a template that users can generate reports from.

## Pre-requisites

- You are a member of the facility that the template belongs to.
- You know which record supplies the data for the report, such as an encounter, a patient, or an account.
- You have the permissions listed below.

## Permissions

| Permission | Access |
| --- | --- |
| Can Read Template | Open the Templates page, and see the template list. |
| Can Create Template on Facility | Create the template, and save it. |
| Can View Template Schema | See the data fields that a context supplies. |
| Can Preview Template | Preview the template before you publish it. |

## Steps

### 1. Open the Templates page

Go to the facility. Select **Settings** in the facility menu. Select **Templates**.

### 2. Start a new template

Select **Create Template**. The template builder opens.

### 3. Enter the template details

Fill in the fields at the top of the builder.

| Components | What it captures |
| --- | --- |
| Template Name | The name that users see in the template list. |
| Slug | A short identifier for the template. Care fills this field from the name. |
| Status | The stage of the template. Select **Draft** while you write it. |
| Default Format | The output format of the report, **PDF** or **HTML**. |
| Report Type | The kind of report, such as **Discharge Summary**. |

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

### 4. Select the context

Select a context in **Select Context**. The context supplies the data for the report.

The context must agree with the report type. A Discharge Summary report needs an encounter context.

### 5. Add the layout

Write the layout of the document in **Template HTML**.

Care lists the available data fields below the context. Select a group to see the fields inside it. Select a field to add it at the cursor.

### 6. Preview the template

Select **Preview Template**. Care renders the layout with sample values, and shows the result.

Select **Clear Preview** to go back to the editor. Correct the layout, and preview it again.

### 7. Publish the template

Set **Status** to **Active**. Select **Save Template**.

## Expected Outcome

- Care confirms that it saved the template.
- The template appears in the template list of the facility.
- Users can generate reports from the template.

## Related

Concepts:

- [Report template](../../concepts/definitions/report-template.mdx)
- [Encounter](../../concepts/clinical/encounter.mdx)

Flows:

- [Generate a report from a template](./generate-a-report-from-a-template.mdx)
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
sidebar_position: 2
---

# How to generate a report from a template

## Overview

This flow describes how to generate a report from a [report template](../../concepts/definitions/report-template.mdx) in Care. At the end, the report file is attached to the record, and you can view or download it.

## Pre-requisites

- The record that supplies the data exists in Care, such as an encounter, a patient, or an account.
- The facility has an active report template for that kind of record.
- You have the permissions listed below.

## Permissions

| Permission | Access |
| --- | --- |
| Can Read Template | See the list of templates that you can use. |
| Can generate report from template | Generate the report. |
| Can Create Template on Facility | Create a template from the list, if none is suitable. |

Note: To generate a report on an encounter that is complete, you also need the permission to generate a report for a completed encounter.

## Steps

### 1. Open the record

Open the encounter, the patient, or the account that the report is about.

### 2. Open the Reports tab

Select **Files**. Select the **Reports** tab.

Care lists the reports that users already generated for this record.

### 3. Select a template

Select **Generate Report**. The **Available Templates** panel opens, and lists the active templates for this kind of record.

If no template is suitable, select **Create Template** to make one. See [Create a report template](./create-a-report-template.mdx).

### 4. Generate the report

Select **Generate Report** on the template that you want.

Care starts the report, and shows the progress. Only one report can be in progress for a record at a time.

### 5. Open the report

Wait until Care confirms that the report is ready. Select **Refresh** if the list does not update.

Select the report to view it. Select **Download** to save the file.

## Expected Outcome

- Care confirms that it generated the report.
- The report appears in the Reports tab of the record.
- You can view, download, or archive the report.

## Related

Concepts:

- [Report template](../../concepts/definitions/report-template.mdx)
- [Encounter](../../concepts/clinical/encounter.mdx)

Flows:

- [Create a report template](./create-a-report-template.mdx)
Loading