Skip to content

4. Templates

Templates are how you can make every project start out consistent. Instead of recreating the same attributes, conversations, and dashboard layout for each new project by hand, you define them once in a template and Mosaic will then apply them automatically.

4.1. What is a Template?

A template is a special project that defines the look and feel and the attributes present in a project. Features of a template that will be applied to target projects include:

Project attributes: project attributes imported (see Project Attributes) into the template will be imported into target projects and given the value set in the template.

Pinned attributes: attributes pinned to the template dashboard will be pinned on the target project dashboard.

Conversations: conversations created in the template will be created in the target project. If the conversation already exists in the project, it will not be recreated or overwritten. If the conversation is pinned to the dashboard, it will be pinned in the target project.

Pinned variant watchlist: if the variant watchlist is pinned to the template dashboard, it will be pinned to the target project dashboard.

Table views: default columns for the samples and variant tables.

In short, a template captures the structure of a case — the fields to be filled in, the discussion threads to be had, and the layout of the dashboard — without containing any individual patient's data.

Tip: A useful way to think about templates is that they answer the question "what should every case of this type look like when it is first created?" Anything you find yourself setting up the same way for each new project is a candidate to move into a template.

4.2. Create / Edit Templates

Templates operate like standard projects and are created and edited in the same way as any other project. Important: the only difference between a template and any other project is a flag that designates a project as a template. This flag can only be set using the API. Please contact the Frameshift team if you need help setting up or designating a project as a template.

Once a project has been designated as a template, you build it up exactly as you would any project: import the project attributes you want every target project to have, set default values where appropriate, pin the attributes and the variant watchlist you want on the dashboard, and create the standard conversations for the case type. Because editing a template is just editing a project, you can refine it over time as your program's needs evolve.

4.3. Apply Templates

A template can be applied either when a project is created or to an existing project.

When creating a project: the Create Project form includes a dropdown menu that allows a template to be selected. This template will be applied when the project is created. When a project is created inside a collection that has an associated template, that template is applied automatically. See Creating Projects and Collections.

For an existing project: select Settings from the left menu, then select the Project Templates submenu item. If a template has already been applied to a project, the dropdown will be prepopulated with this value. Select any template from this dropdown, click Apply, and the selected template will be applied to the project.

4.4. Applying a Template Is Safe to Repeat

Applying a template never overwrites existing project content. If the template contains a conversation, attribute, or pinned item that already exists in the project, Mosaic recognizes this and leaves the existing content alone rather than duplicating or replacing it. This means you can:

  • Apply a template to a project that already has some data, to bring it up to the program's standard, without fear of losing work.
  • Update a template and re-apply it to existing projects to roll out additions (for example, a newly required attribute) — existing content is preserved and only the new items are added.

This behavior is also the reason a template can be applied automatically on creation and again later without side effects. See the related note in the FAQs.

4.5. Templates, Collections, and Scopes of Work

Templates are most powerful when paired with collections and scopes of work:

  • With a collection — associating a template with a collection means every project created inside that collection automatically inherits the same attributes, conversations, and layout. A Cardiology collection, for example, can have a template that gives every new cardiac case the same standard set of fields. See Collections.
  • With a scope of work — a scope of work defines which attributes are required on a project, while a template can supply values for those attributes in advance. Used together, the scope of work prompts the user for the necessary information and the template auto-populates whatever can be known ahead of time, minimizing the manual effort of filling in the create-project form. See Creating Projects and Collections.