Skip to main content

Template Workflow

Templates are structured frameworks for generating regulatory and medical documents with consistent format, content, and compliance requirements.

What is a Template?

A template is a hierarchical structure that defines:
  • Document structure - How sections are organized
  • Content requirements - What information each section needs
  • Extraction rules - How to pull data from source documents
  • Formatting rules - Style and formatting requirements
  • Validation rules - Compliance and data validation
Templates enable organizations to generate consistent, high-quality documents by:
  • Eliminating manual document assembly
  • Ensuring regulatory compliance
  • Maintaining brand consistency
  • Accelerating document production

Template Components

1. Template

The top-level template definition that specifies:
  • Document type (CSR, IND, Protocol, etc.)
  • Overall structure and sections
  • Default extraction and formatting rules

2. Sections

Hierarchical sections that organize document content with nesting levels:
Section Levels:
  • Level 1: Top-level sections (chapters)
  • Level 2+: Nested subsections (subcategories)
  • Max Nesting: Unlimited levels supported

3. Extraction Rules

Rules that specify how to extract content from source documents:
Rule Types:
  • extraction - Pull specific data
  • summary - Create condensed summaries
  • synthesis - Combine multiple sources
  • validation - Check compliance
  • custom - User-defined processing

4. Outlines

Document-specific instances of templates that include:
  • Extracted content for a specific document
  • Section ordering and customization
  • Metadata about content sources

Typical Workflow

1. Create Template

Create a template that defines document structure:

2. Define Extraction Rules

Add extraction rules to template sections to specify how to get content:

3. Create Outline from Template

Generate a document-specific outline based on the template:

4. Generate Document

Execute the outline to produce the final document:

Use Cases

1. Regulatory Document Generation

Generate compliant regulatory documents (CSR, IND, etc.):

2. Document Customization

Customize templates for different document types:

3. Multi-Section Documents

Organize complex documents with nested sections:

4. Content Reuse

Reuse template structure across multiple documents:

Architecture

Key Concepts

Section Hierarchy

Sections are organized hierarchically with levels:
  • Level 1: Main sections (equivalent to chapters)
  • Level 2: Subsections (equivalent to section headings)
  • Level 3+: Further nesting as needed
The order_index determines position within each level.

Extraction Rules

Rules define how content is extracted and processed:

Content Organization

Content is organized by:
  1. Source - Where data comes from (which document/section)
  2. Extraction Rule - How to process the data
  3. Target Section - Where it goes in the final document
  4. Formatting - How it’s styled in output

Best Practices

  1. Start Simple - Begin with basic section structure, add rules incrementally
  2. Reuse Templates - Create templates for common document types
  3. Version Templates - Maintain template versions for compliance tracking
  4. Document Rules - Keep clear documentation of extraction rules
  5. Test Extraction - Validate extraction rules on sample documents before production use
  6. Monitor Quality - Review generated documents for extraction accuracy