NEWVectors or files. Pick a path.Start →
    EnhancedSimilar

    Clinical Documentation Structuring

    Production-grade pipeline for ingesting clinical documents, scanned charts, EHR exports, wound photos, and therapy notes, and structuring them into coded fields aligned with MDS 3.0, PDPM, and CMS audit requirements. Combines OCR, clinical NER, taxonomy classification, and hybrid retrieval to turn unstructured bedside documentation into queryable, auditable data.

    text
    image
    Production

    Why This Matters

    Nurses spend up to 40% of their time on documentation instead of patient care. Clinical data lives in free-text notes, scanned forms, and photos that are invisible to billing and compliance systems. This recipe bridges the gap, extracting structured clinical data from every modality so MDS coordinators, billers, and surveyors can work from a single source of truth.

    from mixpeek import Mixpeek
    client = Mixpeek(api_key="YOUR_API_KEY", namespace="facility-clinical-docs")
    # 1. A bucket for chart exports, and a collection that splits pages into layout
    # blocks with OCR and a confidence tag
    bucket = client.buckets.create(
    bucket_name="patient-charts",
    bucket_schema={"properties": {"chart": {"type": "pdf"}}},
    )
    collection = client.collections.create(
    collection_name="patient-charts",
    source={"type": "bucket", "bucket_ids": [bucket["bucket_id"]]},
    feature_extractor={
    "feature_extractor_name": "document_graph_extractor",
    "version": "v1",
    "parameters": {
    "use_vlm_correction": True,
    },
    },
    )
    # 2. Upload and process
    client.buckets.upload(
    bucket["bucket_id"],
    blobs=[{"property": "chart", "type": "pdf", "data": "s3://facility-ehr-export/patient-charts/resident-0142.pdf"}],
    )
    client.collections.trigger(collection["collection_id"])
    # 3. Dense and BM25 search for clinical terms, then a cross-encoder rerank
    retriever = client.retrievers.create(
    retriever_name="mds-documentation",
    collection_identifiers=["patient-charts"],
    input_schema={"query": {"type": "text", "required": True}},
    stages=[
    {
    "stage_name": "search",
    "stage_id": "feature_search",
    "parameters": {
    "searches": [
    {
    "feature_uri": "mixpeek://document_graph_extractor@v1/intfloat__multilingual_e5_large_instruct",
    "query": {"input_mode": "text", "value": "{{INPUT.query}}"},
    "top_k": 50,
    },
    {
    "feature_uri": "mixpeek://document_graph_extractor@v1/intfloat__multilingual_e5_large_instruct",
    "query": {"input_mode": "text", "value": "{{INPUT.query}}"},
    "top_k": 50,
    "lexical": True,
    },
    ],
    "fusion": "rrf",
    "final_top_k": 50,
    },
    },
    {
    "stage_name": "rerank",
    "stage_id": "rerank",
    "parameters": {
    "inference_name": "BAAI__bge_reranker_v2_m3",
    "query": "{{INPUT.query}}",
    "document_field": "text_raw",
    "top_k": 10,
    },
    },
    ],
    )
    results = client.retrievers.execute(retriever["retriever_id"], inputs={"query": "functional mobility and ADL performance for Section G"})
    for doc in results["documents"]:
    print(doc["page_number"], doc["confidence_tag"], doc["text_raw"][:120])

    Feature Extractors

    Document Graph Extractor

    Decompose PDFs into spatial blocks (paragraphs, tables, forms, headers) with layout classification and E5 text embeddings.

    Retriever Stages

    feature search

    Search and filter documents by vector similarity using feature embeddings

    filter

    rerank

    Rerank documents using cross-encoder models for accurate relevance

    sort

    Resources Used

    Taxonomy

    Use Cases Using This Recipe

    Advanced
    8 min

    SNF Documentation Intelligence

    Automate MDS assessments and clinical documentation for skilled nursing facilities

    40% less time on charting

    Documentation time reduction

    Who It's For

    SNF operators, MDS coordinators, directors of nursing, and post-acute care organizations managing clinical documentation across skilled nursing facilities