A MuleSoft IDP prompt that pulls a patient's name, contact, and demographic details from a referral packet, including an optional parent/guardian name for pediatric cases.
IDP Prompt — Patient Demographics Extraction
Objective: Every intake and referral workflow starts with the same basic patient record — name, DOB, address, contact info — but it's scattered across the packet in whatever layout the source form used. This prompt normalizes those fields into one structured record, including a conditional guardian field for pediatric referrals.
Prerequisites
- MuleSoft IDP (Einstein) enabled; a
GENERIC document action created in Anypoint IDP.
- IDP Connector wired into the calling Mule app.
- Document-action prompt configured with
source: "llm".
The prompt
Extract patient demographic information from the document.
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):
{"Patient First Name": "string|null", "Patient Last Name": "string|null", "DOB": "string|null (MM/DD/YYYY)", "Street Address": "string|null", "City": "string|null", "State": "string|null (2-letter abbreviation)", "Zip Code": "string|null", "Phone Number": "string|null", "Parent/Guardian Name": "string|null", "Gender": "string|null"}
Sample payload — extraction output
{
"Patient First Name": "Ava",
"Patient Last Name": "Nguyen",
"DOB": "05/22/2016",
"Street Address": "128 Birchwood Ln",
"City": "Madison",
"State": "WI",
"Zip Code": "53711",
"Phone Number": "608-555-0187",
"Parent/Guardian Name": "Linh Nguyen",
"Gender": "Female"
}
Testing and validation
- Happy path: an adult referral returns all core fields populated with
Parent/Guardian Name correctly null (not omitted).
- Edge case: a pediatric referral where the guardian's name appears above the patient's own name on the form — verify the model still assigns first/last name to the patient, not the guardian.
- Confirm
State is normalized to its 2-letter abbreviation even when the source spells it out in full (e.g. "Wisconsin" → "WI").
Deliverable: A structured patient-demographics record ready to create or match a Lead/Contact without manual data entry, with guardian capture built in for pediatric cases.