Clinical Prompt Engineering Best Practices

Master the art of writing effective prompts for AI-powered clinical documentation

Prompt Engineering Tutorial

Three Core Principles

1. Examples > Instructions

Show the AI what you want through 3-5 concrete examples rather than explaining it.

LLMs excel at pattern recognition. Examples allow the model to infer your implicit rules more effectively than explicit instructions.

2. Brevity = Quality

Concise outputs scan faster, edit easier, and feel more natural.

Brief documentation reduces cognitive load, makes error detection easier, and maintains physician-like language.

3. One Prompt, One Purpose

Specialized prompts outperform multi-function alternatives.

Modular design allows independent refinement, easier troubleshooting, and better reliability.

Have questions? Ask the AI Tutor!

Get personalized guidance on these principles and more from our interactive AI Prompt Engineering Tutor below.

Jump to Tutor ↓

Detailed Implementation Guide

Principle 1: Few-Shot Learning in Clinical Context

Few-shot examples are the foundation of effective clinical prompts. Rather than describing your preferred format, demonstrate it.

Why it works: LLMs excel at pattern recognition. Examples allow the model to infer your implicit rules—tone, structure, clinical reasoning—more effectively than explicit instructions.

Clinical Application:

  • For Assessment & Plan formatting: Provide 3-5 examples of your actual A&P sections
  • For billing documentation: Show examples with correct MDM levels and corresponding documentation
  • For patient instructions: Include samples demonstrating your communication style

Optimizing Few-Shot Examples

Variable Clinical Implementation
Quantity 3-5 examples typically optimal; more risks overfitting
Ordering Place most common scenarios first
Distribution Changing the distribution of example types can improve performance (e.g., simple vs complex, common vs rare, etc.)
Quality Create examples similar to what you actually see
Format Consider changing the format of the examples to improve performance (Q: A:, Input: Output:, etc.)
Diversity Include edge cases you encounter regularly

Principle 2: Documentation Brevity

Concise documentation serves both efficiency and safety:

Benefits:

  • Faster physician review (30-60 seconds vs 2-3 minutes)
  • Easier identification of errors or hallucinations
  • Reduced cognitive load during busy clinic days
  • More natural, physician-like language

Recommendations:

  • Use bullet points over paragraphs
  • Recognize that LLMs are naturally verbose
  • Include instructions to be concise or give a target of a certain number of words in a given section
  • Focus on clinically relevant details only

Principle 3: Modular Prompt Architecture

Multi-function prompts multiply complexity exponentially. Instead, consider chaining specialized prompts:

Workflow Example:

  1. Prompt 1: Raw transcript → Structured HPI
  2. Prompt 2: Examination findings → Formatted physical exam
  3. Prompt 3: Combined data → Assessment & Plan
  4. Prompt 4: A&P → Billing analysis

Advantages:

  • Each prompt can be refined independently
  • Failures isolate to specific functions
  • Easier troubleshooting and iteration
  • Mix and match based on encounter type

Prompt Engineering Tutor

Have questions about the best practices above? Ask the AI tutor! Get personalized guidance on few-shot learning, prompt structure, clinical documentation, and more.

Click below to initialize the AI Tutor
The AI downloads to your browser once (~870MB), then loads instantly on future visits. Requires Chrome/Edge 113+ with WebGPU.

Prompt Engineering Tutor

Ask me about prompt engineering!

Click a quick question above or type your own below.

AI is thinking...

Advanced Techniques

Task Statement Optimization

Begin every prompt with a clear, action-oriented instruction:

Good

"Convert the following transcript into a problem-based assessment and plan"

Avoid

"You are a physician who needs to write notes"

Conditional Logic Implementation

Use ICD-10 codes as triggers for boilerplate text:

If diagnosis includes J06.9, add:
"Supportive care discussed
including rest, fluids, and
symptomatic relief."

Format Rules Hierarchy

  1. Few-shot examples (highest priority)
  2. Task statement
  3. Explicit formatting rules (lowest priority, use sparingly)

Safety and Compliance

Critical Reminders

  • Always review AI output before finalizing
  • Maintain responsibility for clinical accuracy
  • Document within approved institutional tools only
  • Expect output to be helpful, but also expect errors

Quality Assurance Checklist

  • ☐ Factual accuracy verified
  • ☐ Medications and dosages confirmed
  • ☐ Follow-up instructions appropriate
  • ☐ Billing documentation sufficient
  • ☐ No hallucinated findings

Getting Started

  1. Select one workflow (e.g., Assessment & Plan only)
  2. Create 5 examples based on common encounters
  3. Create initial prompt using our template
  4. Test on 10 encounters before scaling
  5. Iterate based on specific failures

See Disclaimer. Questions about setup or best practices? Ask in our GitHub Discussions or share your workflow on the Contributions page.

Share Your Prompt

Refined a prompt that consistently delivers quality output? Consider sharing it on the contributions page. Your tested solution could save colleagues hours of iteration and help build a stronger resource for the entire clinical community.

Reference: Adapted from Schulhoff, S. "The Prompt Report: A Systematic Survey of Prompting Techniques" (2024)

Support Open Source Clinical AI

All resources are free at this time thanks to your generous support. Consider contributing prompts or supporting development.