Real-World Use Cases

AI in Healthcare: LLMs for Diagnosis and Clinical Management

By Carlos Montiel | Enterprise AI Solutions Architect | guatemalia.com
Leer en español →
✍️ Carlos Montiel 📂 Real-World Use Cases ⌛ 12 min read
Real-world LLM use cases in healthcare: chart summarization, voice-based clinical documentation, chatbot triage, and diagnostic imaging analysis.

The problem: 49% of physician time spent on documentation

The healthcare industry faces an efficiency crisis: physicians spend 49% of their time on administrative documentation, records are fragmented and inaccessible at the point of care, and waitlists keep growing as demand outpaces capacity.

LLMs are changing this. They don't replace the physician — they remove the administrative burden so the physician can focus on the patient.

Case 1: Automatic chart summarization (RAG)

Problem: An internist reviews 20-30 patients/day. Each chart can run 50-200 pages. That takes 10-20 minutes per patient.

Solution: A RAG pipeline that indexes the chart and generates an executive summary with: active diagnoses, current medications, allergies, latest labs, and alerts.

Result: Reduced from 15 minutes to 3 minutes per patient. The physician has more relevant clinical context, not less.

Privacy: The system must run on-premise (Llama 3.1) or in a private cloud. Patient data must never be sent to third-party APIs without confidentiality agreements.

Case 2: Voice-based clinical documentation

Problem: Physicians spend 2-3 hours a day documenting visits. This burden causes burnout and reduces time with patients.

Solution: The physician records the visit (with consent). The system:

  1. Transcribes it with Whisper (speech-recognition AI)
  2. Extracts: diagnosis, plan, medications, follow-up
  3. Generates a clinical note in SOAP format
  4. The physician reviews and approves it in 30 seconds
Result: A hospital in Mexico reported 70% less documentation time. Physicians reclaimed 2 hours a day.

Case 3: Initial-triage chatbot

A chatbot on WhatsApp or the hospital's app lets patients:

Important: Includes guardrails to escalate to a human when it detects emergency symptoms. The chatbot guides and facilitates access — it doesn't diagnose.

Code example

# RAG for medical chart summarization
from langchain_community.document_loaders import PyPDFLoader
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain_community.vectorstores import PGVector
from langchain_anthropic import ChatAnthropic
from langchain_core.prompts import ChatPromptTemplate

SYSTEM = '''You are a medical assistant. Analyze charts and generate summaries.
ONLY use information from the chart. Do NOT make new diagnoses.
Flag anything that requires urgent attention.'''

def summarize_chart(pdf_path: str) -> str:
    # Load the chart
    docs = PyPDFLoader(pdf_path).load()
    chunks = RecursiveCharacterTextSplitter(
        chunk_size=800, chunk_overlap=100
    ).split_documents(docs)

    # Index (local model for privacy)
    vectorstore = PGVector.from_documents(
        chunks,
        embedding=LocalEmbeddings(),
        connection_string="postgresql://localhost/hospital_db"
    )

    # Retrieve relevant context
    retriever = vectorstore.as_retriever(search_kwargs={"k": 8})
    context = "\n\n".join(
        [doc.page_content for doc in retriever.invoke("diagnosis medications allergies labs")]
    )

    # Generate summary
    llm = ChatAnthropic(model="claude-sonnet-4-6")
    prompt = ChatPromptTemplate.from_messages([
        ("system", SYSTEM),
        ("human", "Chart:\n{context}\n\nGenerate: 1) Active diagnoses 2) Medications 3) Allergies 4) Latest labs 5) Alerts")
    ])
    return llm.invoke(prompt.format_messages(context=context)).content

Need to implement this at your company?

Carlos Montiel is an enterprise AI solutions architect with experience in LLMs, Agents, RAG, and orchestration in Guatemala and Latin America.

Contact Carlos Montiel
Carlos Montiel
Enterprise AI Solutions Architect · guatemalia.com

Specialist in LLMs, AI Agents, RAG, LangChain, and LangGraph for companies in Guatemala and Latin America. For implementation inquiries: guatemalia.com/en/#contact