A MuleSoft IDP prompt that pulls diagnosis, lab, and medication history from chart notes and writes a short synthesized medical-necessity justification alongside the structured fields.
IDP Prompt — Clinical Information Extraction
Objective: Chart notes carry the clinical evidence (diagnosis, labs, insulin regimen) that justifies a device or therapy order, but that evidence is buried in free text. This prompt extracts the structured clinical fields and generates a short justification summary in one call, instead of a reviewer re-reading the whole note.
Prerequisites
- MuleSoft IDP (Einstein) enabled; a
GENERIC document action created in Anypoint IDP, scoped to the chart-notes page range.
- IDP Connector wired into the calling Mule app.
- Document-action prompt configured with
source: "llm" — required here since the justification summary is synthesized, not verbatim.
The prompt
Extract clinical information from chart notes and medical forms.
IMPORTANT: You MUST respond with ONLY a valid JSON object. No markdown, no explanation, no code fences. Use null for any field not found in the document.
Output format (JSON object):
{"ICD-10 Diagnosis Code": "string|null", "HbA1c Value": "string|null (percentage, e.g. 8.5)", "HbA1c Date": "string|null (MM/DD/YYYY)", "Current Insulin Regimen": "string|null", "Diabetes Duration": "string|null (in years)", "Complications": "string|null (comma-separated list)", "Blood Glucose Range": "string|null (e.g. 70-310 mg/dL)", "Clinical Justification Summary": "string|null (1-2 sentence summary of medical necessity)"}
Sample payload — extraction output
{
"ICD-10 Diagnosis Code": "E10.9",
"HbA1c Value": "8.5",
"HbA1c Date": "02/20/2026",
"Current Insulin Regimen": "Multiple Daily Injections",
"Diabetes Duration": "14",
"Complications": "Peripheral neuropathy, retinopathy",
"Blood Glucose Range": "70-310 mg/dL",
"Clinical Justification Summary": "Patient has poorly controlled Type 1 diabetes with an elevated HbA1c and wide glucose fluctuations despite MDI therapy, supporting the need for automated insulin delivery."
}
Testing and validation
- Happy path: a chart note with all fields present returns a populated object, including a summary that references the actual extracted values (not a generic template sentence).
- Edge case: a note missing HbA1c entirely — confirm
HbA1c Value/HbA1c Date return null rather than the summary fabricating a value to fill the gap.
- Spot-check the justification summary against the source note for hallucination — this is the one field synthesized rather than extracted, so it needs human review more than the others.
Deliverable: A structured clinical record plus a ready-to-use medical-necessity summary sentence for prior-authorization or lead-qualification workflows.