Inferensys

Prompt

Clinical Note Evidence Extraction and Ranking Prompt

A practical prompt playbook for using Clinical Note Evidence Extraction and Ranking Prompt in production AI workflows.
Operations team reviewing AI workflow automation on laptop, workflow builder visible, casual office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the production use case, ideal user, and critical boundaries for the clinical evidence extraction and ranking prompt.

This prompt is designed for EHR and clinical summarization engineers who need to extract findings, assessments, and plans from unstructured clinical notes and rank them into a structured timeline. It is intended for production systems where recency, provider type, and diagnostic certainty must be weighted explicitly. Use this prompt when you need a machine-readable clinical evidence chronology that downstream CDS or summarization modules can consume. The prompt assumes input notes have already been de-identified and that the calling system enforces access controls.

Do not use this prompt for real-time diagnostic decision-making without a human-review gate. It is not a substitute for clinical judgment and should not be the sole input to treatment decisions. The prompt is optimized for retrospective chart review, summarization, and evidence organization—not for prospective risk prediction or alerting. If your use case involves generating clinical alerts, treatment recommendations, or medication changes, you must add a human-in-the-loop approval step and validate outputs against established clinical guidelines.

Before deploying, ensure your pipeline enforces de-identification, logs all extractions for audit, and runs eval checks for copied-forward stale data and unresolved differential diagnoses. The prompt works best with notes that have been pre-processed to remove PHI and normalized to a consistent structure. If your notes contain significant shorthand, non-standard abbreviations, or mixed-language content, you should add a normalization step before extraction. Start with a small batch of representative notes, run the eval harness, and review outputs with a clinical SME before scaling to production volumes.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works, where it fails, and the operational prerequisites for safe deployment in clinical settings.

01

Strong Fit: Structured Summarization

Use when: extracting findings, assessments, and plans from SOAP notes, discharge summaries, or progress notes with clear section headers. Guardrail: validate output against explicit section boundaries to prevent cross-section contamination.

02

Poor Fit: Ambiguous Narrative

Avoid when: notes lack structured headings, contain stream-of-consciousness dictation, or mix subjective impressions with objective data without clear delimiters. Guardrail: route unstructured notes to a pre-processing classification step before extraction.

03

Required Input: Metadata Context

Risk: ranking by recency or provider type fails without note timestamps, author roles, and encounter types. Guardrail: require structured metadata fields as mandatory inputs; do not infer provider specialty from note content alone.

04

Operational Risk: Copied-Forward Data

What to watch: stale findings propagated across notes via copy-forward EHR behavior appear recent and authoritative. Guardrail: implement cross-note deduplication checks and flag identical phrasing across encounters older than 24 hours.

05

Operational Risk: Unresolved Differentials

What to watch: differential diagnoses extracted as confirmed findings when the note lists them as possibilities. Guardrail: require explicit certainty classification for each extracted diagnosis; flag any item lacking a resolved status.

06

Deployment Gate: Human Review

Risk: automated evidence ranking used for clinical decisions without clinician verification. Guardrail: all ranked evidence outputs must pass through a human-review queue before integration into CDS or summarization surfaces; log reviewer identity and timestamp.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A production-ready prompt for extracting and ranking clinical evidence from unstructured notes into a structured, temporal evidence timeline.

This prompt template is designed to be pasted directly into your system prompt or user message. It instructs the model to act as a clinical evidence extraction engine, processing raw clinical notes and producing a structured JSON output. The prompt enforces strict rules for ranking evidence by recency, provider type, and diagnostic certainty, while explicitly guarding against common failure modes like copying forward stale data or presenting unresolved differential diagnoses as confirmed findings. Before using this template, ensure you have a clear understanding of your input data structure and the desired output schema for your downstream application.

text
You are a clinical evidence extraction engine. Your task is to process the provided [CLINICAL_NOTE_TEXT] and extract all findings, assessments, and plans. You must rank each extracted item by recency, provider type, and diagnostic certainty to produce a structured clinical evidence timeline.

# INPUT
[CLINICAL_NOTE_TEXT]

# CONSTRAINTS
1.  **Stale Data Detection:** Explicitly identify and flag any information that appears to be copied forward from a previous note without a new date or provider confirmation. Mark such items with a `staleness_risk` flag.
2.  **Differential Diagnosis Handling:** Clearly separate confirmed diagnoses from active differential diagnoses. For differentials, include a `diagnostic_certainty` field set to "differential" and list the supporting and refuting evidence mentioned in the note.
3.  **Provider Attribution:** For each extracted item, identify the provider type (e.g., Attending, Resident, Nurse, Specialist) if available. Rank items from attending or specialist providers higher than those from other sources when recency is equal.
4.  **Temporal Ranking:** Rank all items in reverse chronological order based on the date they were documented or observed. If an item has no date, place it at the bottom with a flag.
5.  **Source Grounding:** For every extracted item, you MUST include a verbatim quote from the [CLINICAL_NOTE_TEXT] as the `source_quote`. Do not paraphrase.

# OUTPUT_SCHEMA
Return a single JSON object with the following structure:
{
  "patient_id": "string | null",
  "note_date": "string | null",
  "evidence_timeline": [
    {
      "item_type": "finding | assessment | plan",
      "description": "string",
      "source_quote": "string",
      "date_documented": "string | null",
      "provider_type": "string | null",
      "diagnostic_certainty": "confirmed | differential | ruled_out | unknown",
      "staleness_risk": "boolean",
      "supporting_evidence": ["string"],
      "refuting_evidence": ["string"]
    }
  ],
  "unresolved_differentials": ["string"],
  "stale_data_flags": ["string"]
}

# RISK_LEVEL
HIGH. This output may inform clinical decisions. All extracted information must be directly traceable to the source text. If the note is ambiguous, you MUST reflect that uncertainty in the output rather than making a definitive statement.

To adapt this template, replace the [CLINICAL_NOTE_TEXT] placeholder with the actual clinical note string. You can further refine the [OUTPUT_SCHEMA] to match your application's data model, but the core constraints on staleness, differential diagnoses, and source grounding should remain intact. For high-risk deployments, this prompt's output should be treated as a draft that requires human review, and you should implement a validation layer that checks the JSON structure and flags any items where source_quote is missing or staleness_risk is true.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Clinical Note Evidence Extraction and Ranking Prompt. Each placeholder must be populated before the prompt is assembled. Missing or malformed inputs are the most common cause of extraction failures and stale-data hallucinations.

PlaceholderPurposeExampleValidation Notes

[CLINICAL_NOTE_TEXT]

Raw clinical note content to extract evidence from. Accepts free-text, semi-structured, or HL7 narrative blocks.

Patient presents with 3-day history of productive cough. Vitals: T 101.2F, HR 98. Assessment: Community-acquired pneumonia, right lower lobe. Plan: Start azithromycin 500mg day 1, then 250mg days 2-5.

Required. Non-empty string. Must be at least 50 characters. Reject if only contains whitespace, HL7 delimiters without content, or copy-paste artifacts like repeated headers.

[PROVIDER_TYPE]

Role of the note author. Used to weight evidence by clinical authority and scope-of-practice relevance.

attending_physician

Required. Must match enum: attending_physician, resident, nurse_practitioner, physician_assistant, registered_nurse, specialist_consultant, pharmacist, physical_therapist, unknown. Default to unknown if not parseable. Do not infer from note content alone.

[NOTE_DATE]

Date the clinical note was authored. Used for recency scoring and stale-data detection.

2025-03-15

Required. ISO 8601 date string YYYY-MM-DD. Must not be in the future relative to system time. Reject dates before 2000-01-01 as likely data entry errors. Null allowed only if explicitly marked as unknown_date.

[PATIENT_CONTEXT]

Structured patient demographics and relevant history for diagnostic certainty weighting and population matching.

{"age": 72, "sex": "F", "active_problems": ["COPD", "Type 2 DM"], "allergies": ["penicillin"]}

Required. Valid JSON object. Must include age and sex fields at minimum. Active problems and allergies arrays may be empty but must be present. Age must be integer 0-120. Reject if JSON parse fails.

[EVIDENCE_TYPES]

Categories of clinical evidence to extract. Controls which sections of the note are parsed and ranked.

["findings", "assessments", "plans", "medications", "vitals"]

Required. Non-empty array of strings. Each element must match enum: findings, assessments, plans, medications, vitals, labs, imaging, procedures, allergies, social_history, family_history. Reject unknown types. Order does not imply priority.

[OUTPUT_SCHEMA]

Expected structure for the ranked evidence output. Defines fields, types, and required elements for downstream consumption.

{"evidence_timeline": [{"type": "string", "content": "string", "recency_score": "number", "authority_weight": "number", "certainty": "string", "source_span": "string"}]}

Required. Valid JSON Schema or example structure. Must define evidence_timeline array with at least type, content, recency_score, and source_span fields. Reject schemas missing source_span as they prevent citation verification.

[CERTAINTY_TAXONOMY]

Controlled vocabulary for diagnostic certainty. Maps note language to standardized certainty levels for ranking.

["confirmed", "probable", "suspected", "ruled_out", "differential", "resolved"]

Required. Non-empty array of strings. Must include at least confirmed, suspected, and ruled_out. Custom taxonomies allowed but must be validated against institutional terminology standards before use. Reject taxonomies with overlapping or ambiguous terms.

[STALE_DATA_RULES]

Rules for flagging copied-forward or outdated evidence. Defines recency thresholds and duplicate detection parameters.

{"max_age_days": 90, "duplicate_span_similarity_threshold": 0.85, "flag_copied_forward": true}

Required. Valid JSON object. max_age_days must be positive integer. duplicate_span_similarity_threshold must be float 0.0-1.0. flag_copied_forward must be boolean. Reject if any required field missing.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Clinical Note Evidence Extraction and Ranking Prompt into a production EHR or clinical summarization application.

This prompt is designed to operate as a stateless extraction and ranking step within a larger clinical documentation pipeline. It should not be the sole consumer-facing output. Instead, wire it as a microservice or serverless function that receives a de-identified clinical note payload and returns a structured JSON evidence timeline. The calling application is responsible for assembling the [INPUT] (the clinical note text), [CONTEXT] (patient demographics, encounter metadata, and a list of prior resolved diagnoses if available), and [OUTPUT_SCHEMA] (the expected JSON structure for findings, assessments, and plans). The model should never receive raw PHI directly; de-identification must occur upstream.

Validation and retry logic is critical. Before the output reaches any downstream consumer or database, validate the JSON structure against the [OUTPUT_SCHEMA]. Check that every extracted finding has a non-null source_span (a direct quote from the note), a recency timestamp, and a certainty score. If validation fails, implement a single retry with the error message injected into the [CONSTRAINTS] field. If the retry also fails, log the raw output and the failed validation details, then escalate to a human review queue. Do not silently drop malformed extractions. For high-risk deployments, add a secondary LLM call using a dedicated hallucination detection prompt (from the Hallucination Detection and Flagging pillar) that compares each source_span against the original note text to detect fabricated quotes.

Model choice and tool use: Use a model with strong JSON mode and a context window large enough for the longest clinical note plus the output schema. GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Pro are appropriate starting points. This prompt does not require tool calling or RAG at runtime because the evidence is self-contained within the provided note. However, the harness should log every input, output, validation result, and retry attempt to an observability platform for trace analysis. Pay special attention to two failure modes: copied-forward stale data (where the model extracts a finding that appears verbatim in a prior note but is not re-stated in the current note) and unresolved differential diagnoses (where the model presents a differential as a confirmed finding). Mitigate the first by including prior note snippets in [CONTEXT] with explicit instructions to ignore them unless re-stated. Mitigate the second by requiring the certainty field to use a controlled vocabulary (confirmed, suspected, ruled_out, differential) and flagging any differential entry for human review before it enters the problem list.

Next steps: After validation passes, the structured evidence timeline can be ingested into a clinical data warehouse, used to update a patient summary, or fed into a downstream CDS prompt. Do not treat this prompt's output as a final clinical document. Always route findings tagged as differential or certainty: suspected to a human reviewer. Run periodic eval suites using a golden dataset of annotated clinical notes to detect regressions in extraction recall, precision, and copied-forward detection.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the required fields, types, and validation rules for the structured clinical evidence timeline output. Use this contract to build downstream parsers, database schemas, and evaluation checks.

Field or ElementType or FormatRequiredValidation Rule

evidence_timeline

Array of objects

Must be a non-empty array. If no evidence is found, return an empty array with a top-level evidence_gap_note string field.

evidence_timeline[].finding_id

String

Must match the pattern FINDING-[0-9]{4}. Must be unique within the array.

evidence_timeline[].source_text

String

Must be a verbatim quote from the input clinical note. Length must be between 10 and 500 characters. Validate exact substring match against [CLINICAL_NOTE].

evidence_timeline[].normalized_finding

String

Must be a single, concise clinical statement in SNOMED-CT friendly language. Must not introduce new information not present in source_text.

evidence_timeline[].recency_score

Number

Must be an integer between 1 and 5, where 5 is the most recent. Score must be derived from the date_of_service or note_date relative to other findings.

evidence_timeline[].diagnostic_certainty

String

Must be one of the following enums: Confirmed, Probable, Suspected, Ruled_Out, Differential. Differential requires a non-null differential_diagnoses array.

evidence_timeline[].provider_type

String

Must be one of the following enums: Attending, Resident, Nurse, Specialist, Consultant, Unknown. If the provider role is ambiguous, use Unknown.

evidence_timeline[].is_copied_forward

Boolean

Must be true if the finding text appears identically in a prior note for the same patient, otherwise false. If patient history is not provided, default to false and set a stale_data_risk flag to Indeterminate.

PRACTICAL GUARDRAILS

Common Failure Modes

Clinical note evidence extraction fails in predictable ways. These are the most common production failure modes and the specific guardrails that catch them before they reach a clinician or downstream system.

01

Copied-Forward Stale Data

What to watch: The model treats copied-forward text from prior notes as current evidence, repeating outdated findings, resolved problems, or stale vitals as if they are new observations. This is the most common EHR-specific failure. Guardrail: Require the prompt to compare extracted findings against the encounter date. Add an eval check that flags any extracted finding whose only source span appears verbatim in a prior note from a different encounter date. If the finding lacks a fresh observation in the current note, mark it as stale_copied_forward and exclude it from the ranked timeline.

02

Unresolved Differential Diagnosis Presented as Confirmed

What to watch: The model extracts a differential diagnosis list but ranks or presents one candidate as the confirmed diagnosis without explicit resolution language in the source note. This creates false certainty in downstream CDS and billing workflows. Guardrail: Add a diagnostic_certainty field to the output schema with allowed values confirmed, suspected, differential, ruled_out. Require the prompt to only assign confirmed when the note contains explicit resolution language such as 'diagnosis confirmed,' 'final diagnosis,' or 'primary diagnosis.' Eval must flag any confirmed assignment where the source span contains 'differential includes,' 'rule out,' or 'versus.'

03

Provider-Type Authority Confusion

What to watch: The model weights all provider statements equally, treating a medical student's note, a nurse's triage assessment, and an attending physician's impression as equivalent evidence. This flattens the clinical authority hierarchy and can elevate preliminary or trainee observations above definitive assessments. Guardrail: Include a provider_type field in the extraction schema and a ranking rule that sorts by authority tier: attending > fellow > resident > APP > RN > student. Eval must test that when an attending overrides a resident's finding in the same note, the attending's version ranks higher. Flag any case where a lower-authority provider's finding outranks a higher-authority provider's contradictory finding on the same clinical question.

04

Recency Blindness Across Encounters

What to watch: The model extracts findings from the current note but ignores temporal ordering when the note references prior encounters. A finding from 'last week's labs' may be treated as equally current as today's physical exam. Guardrail: Require the prompt to assign a recency_tier based on explicit temporal markers in the source text: current_encounter, this_admission, prior_admission, historical. Add an eval that checks whether findings with historical recency appear above current_encounter findings in the ranked output. The timeline must sort by recency before any other ranking factor.

05

Missing Negation and Absence Detection

What to watch: The model extracts clinical concepts without detecting negation, extracting 'no chest pain' as evidence of chest pain, or 'denies fever' as a febrile finding. This inverts the clinical meaning and creates phantom problems. Guardrail: Add a polarity field to each extracted finding with values positive, negated, absent. Require the prompt to explicitly check for negation cues before extraction. Eval must include test cases with negated findings and flag any extraction where a negated concept is assigned positive polarity. Negated findings should still appear in the timeline but with polarity: negated and zero diagnostic weight.

06

Assessment-Plan Disconnect

What to watch: The model extracts assessments and plans as independent items, losing the clinical reasoning link between a finding and the planned action. A plan to 'start antibiotics' appears without connection to the assessment of 'suspected pneumonia,' making the evidence timeline clinically incoherent. Guardrail: Require the output schema to include an evidence_link field that maps each plan item to its supporting assessment finding by source span reference. Eval must check that every extracted plan item has at least one linked assessment finding from the same note section. Flag orphaned plans as unlinked_plan for human review.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test output quality before shipping the Clinical Note Evidence Extraction and Ranking Prompt. Each criterion targets a known failure mode in production EHR pipelines.

CriterionPass StandardFailure SignalTest Method

Copied-Forward Data Detection

Stale data from prior notes is flagged with a [STALE] tag and confidence is set to 0.0

Output includes identical text from a prior note without a staleness flag

Inject a synthetic prior note with known copied-forward text; assert the output contains [STALE] for that text span

Recency Ranking

Findings are ordered by encounter date descending; older findings appear after newer ones unless explicitly marked as a chronic condition

A finding from 2022 appears above a finding from 2024 without a chronic-condition justification

Provide three findings with dates 2022-06-01, 2024-01-15, 2024-11-03; assert the output list is in descending date order

Provider Type Weighting

Attending physician assessments rank above resident notes when both address the same finding

A resident note is ranked above an attending note for the same clinical finding on the same date

Supply two notes for the same finding on the same date, one from an attending and one from a resident; assert the attending note appears first

Diagnostic Certainty Extraction

Each finding includes a certainty level of Confirmed, Probable, Possible, or Rule-Out extracted from the note language

A finding stated as rule out pneumonia is assigned certainty Confirmed

Input a note containing rule out DVT; assert the output assigns certainty Rule-Out to the DVT finding

Unresolved Differential Diagnosis Flagging

Differential diagnoses without a final determination are tagged with [UNRESOLVED] and a recommendation for follow-up

A differential diagnosis list is presented as final findings without the [UNRESOLVED] tag

Provide a note ending with differential includes X, Y, Z without a concluding diagnosis; assert all three items carry [UNRESOLVED]

Structured Output Schema Compliance

Output is valid JSON matching the [OUTPUT_SCHEMA] with all required fields present and no extra top-level keys

Output is missing the evidence_timeline array or contains an unexpected top-level key

Validate output against the JSON schema using a programmatic schema validator; assert no validation errors

Source Citation Traceability

Every extracted finding includes a source_note_id and a quote_span referencing the originating note text

A finding appears with source_note_id: null or a quote_span that does not match any text in the provided notes

For each finding in the output, search the input notes for the quote_span string; assert an exact match exists

Empty Input Handling

When [INPUT] contains zero clinical notes, the output returns an empty evidence_timeline array with a status message explaining no data

Output hallucinates findings or returns a non-empty timeline when no notes are provided

Submit an empty notes array; assert evidence_timeline.length === 0 and status field indicates no data

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a single clinical note. Remove strict schema enforcement and use a simpler output structure (e.g., a markdown table instead of a typed JSON array). Focus on getting the extraction and ranking logic right before adding validation layers.

code
Extract clinical findings from [CLINICAL_NOTE] and rank them by recency, provider type, and diagnostic certainty. Output as a markdown table with columns: Finding, Recency, Provider, Certainty, Source Quote.

Watch for

  • Copied-forward stale data appearing as new findings
  • Unresolved differential diagnoses listed as confirmed findings
  • Missing source quotes that make verification impossible
  • Overly broad extraction that pulls in family history as current findings
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.