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.
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 Mixpeekclient = 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 tagbucket = 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 processclient.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 rerankretriever = 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
rerank
Rerank documents using cross-encoder models for accurate relevance
Resources Used
Use Cases Using This Recipe
SNF Documentation Intelligence
Automate MDS assessments and clinical documentation for skilled nursing facilities
40% less time on charting
Documentation time reduction
SNF operators, MDS coordinators, directors of nursing, and post-acute care organizations managing clinical documentation across skilled nursing facilities
Related Recipes & Resources
Explore these related resources to deepen your understanding and discover more powerful features
Document Graph Extractor
Decompose PDFs into spatial blocks (paragraphs, tables, forms, headers) with layout classification and E5 text embeddings.
Document Intelligence Search
Extract and search through PDFs, presentations, and documents. Combines OCR, layout analysis, and semantic search for comprehensive document retrieval.
BYO Embeddings Vector Search
Bring pre-computed embeddings from any provider (OpenAI, Cohere, Together, etc.) and upsert them directly into MVS for instant vector search. No feature extractors, no pipelines -- just embeddings in, results out.
Multimodal Hybrid Search Pipeline
Combine vector search with keyword search (BM25) across text, images, and video for the most comprehensive multimodal retrieval system.
Multimodal RAG Pipeline
Build a retrieval-augmented generation system that works with text, images, and video. Feed relevant multimodal context to LLMs for grounded responses.
Taxonomy Enrichment Pipeline
Automatically classify and tag content using custom taxonomies. Map your content to IAB categories, custom hierarchies, or industry-specific classifications.