Patient Demographics Summary
Overview
Pull structured demographic data from FHIR Patient, RelatedPerson, and Coverage resources. Format into a consolidated summary including identifiers, contact information, emergency contacts, insurance, preferred language, communication preferences, and advance directive status. Flag missing critical data elements that may affect care delivery.
FHIR Resources Used
| Resource |
Purpose |
Key Fields |
| Patient |
Core demographics |
name, birthDate, gender, address, telecom, communication, identifier, extension |
| RelatedPerson |
Emergency contacts, guarantors |
name, telecom, relationship, period |
| Coverage |
Insurance information |
status, type, subscriberId, payor, period, class |
Instructions
Step 1: Retrieve Patient Resource
Tool: fhir_read
resourceType: "Patient"
id: "[patient-id]"
Extract the following fields:
- Identifiers: MRN (
identifier where type.coding.code = "MR"), SSN (last 4 only), driver's license
- Name:
name array -- use name.use = "official" as primary; note maiden names (use = "maiden")
- Birth Date:
birthDate (calculate age)
- Gender:
gender (administrative gender)
- Race/Ethnicity: US Core extensions at
extension where URL = http://hl7.org/fhir/us/core/StructureDefinition/us-core-race and http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity
- Address:
address array -- identify use = "home" vs "work" vs "temp"
- Telecom:
telecom array -- phone (system = "phone"), email (system = "email"), fax
- Preferred Language:
communication array where preferred = true
- Marital Status:
maritalStatus
- Deceased:
deceasedBoolean or deceasedDateTime
- Managing Organization:
managingOrganization
Step 2: Retrieve Emergency Contacts and Related Persons
Tool: fhir_search
resourceType: "RelatedPerson"
queryParams: "patient=[patient-id]"
For each RelatedPerson:
- Extract name, relationship type (
relationship.coding.code), phone, email
- Check
period to confirm the relationship is current (no end date or end > today)
- Identify relationship roles: emergency contact, next of kin, guarantor, power of attorney
Step 3: Retrieve Insurance Coverage
Tool: fhir_search
resourceType: "Coverage"
queryParams: "patient=[patient-id]&status=active"
For each active Coverage:
- Plan name from
class where type.coding.code = "plan"
- Group number from
class where type.coding.code = "group"
- Subscriber ID from
subscriberId
- Payor organization from
payor reference
- Coverage period from
period
- Coverage order (
order field: 1 = primary, 2 = secondary)
Step 4: Check for Advance Directives
Tool: fhir_search
resourceType: "Consent"
queryParams: "patient=[patient-id]&category=http://terminology.hl7.org/CodeSystem/consentcategorycodes|acd"
If no results, also search:
Tool: fhir_search
resourceType: "DocumentReference"
queryParams: "patient=[patient-id]&type=http://loinc.org|64298-3"
LOINC 64298-3 = Power of attorney / Advance directive
Step 5: Flag Missing Critical Data
Scan the collected data and flag any of the following as missing:
- No emergency contact (zero RelatedPerson resources or none with emergency contact relationship)
- No active insurance coverage
- No preferred language specified
- No allergy documentation status (check if
AllergyIntolerance search returns zero results -- this indicates allergies have not been reviewed, not that there are none)
- No advance directive on file
- Missing phone number or email
- Missing address
Step 6: Format Output
Present the summary in this structure:
PATIENT DEMOGRAPHICS
====================
Name: [official name]
MRN: [identifier]
DOB: [birthDate] (Age: [calculated])
Gender: [gender]
Race/Ethnicity: [from extensions]
Preferred Language: [language]
Marital Status: [status]
CONTACT INFORMATION
===================
Home Phone: [telecom]
Mobile Phone: [telecom]
Email: [telecom]
Home Address: [address]
EMERGENCY CONTACTS
==================
1. [name] - [relationship] - [phone]
2. [name] - [relationship] - [phone]
INSURANCE COVERAGE
==================
Primary: [plan name] - ID: [subscriberId] - Group: [group]
Secondary: [plan name] - ID: [subscriberId] - Group: [group]
ADVANCE DIRECTIVES
==================
Status: [On file / Not on file]
MISSING DATA FLAGS
==================
- [list of flagged items]
Examples
Example 1: Complete Demographics Pull
User says: "Pull up demographics for patient 12345"
Actions:
fhir_read Patient/12345 -- returns full Patient resource with name, DOB, address, telecom, US Core race/ethnicity extensions
fhir_search RelatedPerson?patient=12345 -- returns 2 entries: spouse (emergency contact), adult child (next of kin)
fhir_search Coverage?patient=12345&status=active -- returns 1 active Coverage: Blue Cross PPO, primary
fhir_search Consent?patient=12345&category=... -- returns 1 advance directive
Result:
PATIENT DEMOGRAPHICS
====================
Name: Maria Garcia
MRN: MRN-12345
DOB: 1958-03-15 (Age: 67)
Gender: Female
Race/Ethnicity: Hispanic or Latino / White
Preferred Language: Spanish
Marital Status: Married
CONTACT INFORMATION
===================
Home Phone: (555) 234-5678
Mobile Phone: (555) 876-5432
Email: mgarcia@email.com
Home Address: 456 Oak Ave, Austin, TX 78701
EMERGENCY CONTACTS
==================
1. Roberto Garcia - Spouse - (555) 234-5679
2. Ana Garcia-Lopez - Daughter - (555) 345-6789
INSURANCE COVERAGE
==================
Primary: Blue Cross Blue Shield PPO - ID: BCB998877 - Group: GRP-4421
ADVANCE DIRECTIVES
==================
Status: On file (dated 2022-06-10)
MISSING DATA FLAGS
==================
- No secondary insurance on file
Example 2: Patient With Missing Critical Data
User says: "Who is patient abc-789? Get me their info."
Actions:
fhir_read Patient/abc-789 -- returns minimal Patient resource: name and DOB only, no telecom, no extensions
fhir_search RelatedPerson?patient=abc-789 -- returns 0 entries
fhir_search Coverage?patient=abc-789&status=active -- returns 0 entries
fhir_search Consent?patient=abc-789&category=... -- returns 0 entries
Result:
PATIENT DEMOGRAPHICS
====================
Name: James Wilson
MRN: Not recorded
DOB: 1990-11-22 (Age: 35)
Gender: Male
Race/Ethnicity: Not documented
Preferred Language: Not specified
Marital Status: Unknown
CONTACT INFORMATION
===================
No contact information on file
EMERGENCY CONTACTS
==================
None documented
INSURANCE COVERAGE
==================
No active coverage found
ADVANCE DIRECTIVES
==================
Status: Not on file
MISSING DATA FLAGS [CRITICAL]
==============================
- No phone number or email
- No home address
- No emergency contact
- No active insurance coverage
- No preferred language
- Race/ethnicity not documented
- No advance directive on file
- Allergy documentation status unknown
Troubleshooting
No Patient Resource Found
RelatedPerson Search Returns Empty But Patient Has Emergency Contact in Record
Coverage Resources Missing Plan Details
- The
class array may use different type codes depending on the payer. Check for type.coding.code values: "plan", "group", "subplan", "subgroup", "rxbin", "rxpcn".
- Some systems populate plan details in the
payor referenced Organization resource. Follow the reference with fhir_read on the Organization.
Related Skills
clinical-summary-generator -- for clinical data beyond demographics
insurance-coverage-summary -- for deeper insurance analysis including coordination of benefits
allergy-adverse-reaction-summary -- when allergy documentation flag is raised
1---2name: patient-demographics-summary3description: |4 Retrieves and formats a complete patient demographic summary from FHIR Patient, RelatedPerson, and Coverage resources.5 Use when user asks to "pull demographics", "get patient info", "show patient details", "who is this patient",6 "patient summary", "emergency contacts", "insurance info", or needs a quick overview of non-clinical patient data.7 Do NOT use for clinical summaries, lab results, medication lists, or diagnosis reviews.8metadata:9 author: LangCare10 version: 1.0.011 mcp-server: langcare-mcp-fhir12 category: patient-data13---1415# Patient Demographics Summary1617## Overview1819Pull structured demographic data from FHIR Patient, RelatedPerson, and Coverage resources. Format into a consolidated summary including identifiers, contact information, emergency contacts, insurance, preferred language, communication preferences, and advance directive status. Flag missing critical data elements that may affect care delivery.2021## FHIR Resources Used2223| Resource | Purpose | Key Fields |24|----------|---------|------------|25| Patient | Core demographics | name, birthDate, gender, address, telecom, communication, identifier, extension |26| RelatedPerson | Emergency contacts, guarantors | name, telecom, relationship, period |27| Coverage | Insurance information | status, type, subscriberId, payor, period, class |2829## Instructions3031### Step 1: Retrieve Patient Resource3233```34Tool: fhir_read35resourceType: "Patient"36id: "[patient-id]"37```3839Extract the following fields:40- **Identifiers**: MRN (`identifier` where `type.coding.code` = "MR"), SSN (last 4 only), driver's license41- **Name**: `name` array -- use `name.use` = "official" as primary; note maiden names (`use` = "maiden")42- **Birth Date**: `birthDate` (calculate age)43- **Gender**: `gender` (administrative gender)44- **Race/Ethnicity**: US Core extensions at `extension` where URL = `http://hl7.org/fhir/us/core/StructureDefinition/us-core-race` and `http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity`45- **Address**: `address` array -- identify `use` = "home" vs "work" vs "temp"46- **Telecom**: `telecom` array -- phone (`system` = "phone"), email (`system` = "email"), fax47- **Preferred Language**: `communication` array where `preferred` = true48- **Marital Status**: `maritalStatus`49- **Deceased**: `deceasedBoolean` or `deceasedDateTime`50- **Managing Organization**: `managingOrganization`5152### Step 2: Retrieve Emergency Contacts and Related Persons5354```55Tool: fhir_search56resourceType: "RelatedPerson"57queryParams: "patient=[patient-id]"58```5960For each RelatedPerson:61- Extract name, relationship type (`relationship.coding.code`), phone, email62- Check `period` to confirm the relationship is current (no `end` date or `end` > today)63- Identify relationship roles: emergency contact, next of kin, guarantor, power of attorney6465### Step 3: Retrieve Insurance Coverage6667```68Tool: fhir_search69resourceType: "Coverage"70queryParams: "patient=[patient-id]&status=active"71```7273For each active Coverage:74- Plan name from `class` where `type.coding.code` = "plan"75- Group number from `class` where `type.coding.code` = "group"76- Subscriber ID from `subscriberId`77- Payor organization from `payor` reference78- Coverage period from `period`79- Coverage order (`order` field: 1 = primary, 2 = secondary)8081### Step 4: Check for Advance Directives8283```84Tool: fhir_search85resourceType: "Consent"86queryParams: "patient=[patient-id]&category=http://terminology.hl7.org/CodeSystem/consentcategorycodes|acd"87```8889If no results, also search:90```91Tool: fhir_search92resourceType: "DocumentReference"93queryParams: "patient=[patient-id]&type=http://loinc.org|64298-3"94```9596LOINC 64298-3 = Power of attorney / Advance directive9798### Step 5: Flag Missing Critical Data99100Scan the collected data and flag any of the following as missing:101- No emergency contact (zero RelatedPerson resources or none with emergency contact relationship)102- No active insurance coverage103- No preferred language specified104- No allergy documentation status (check if `AllergyIntolerance` search returns zero results -- this indicates allergies have not been reviewed, not that there are none)105- No advance directive on file106- Missing phone number or email107- Missing address108109### Step 6: Format Output110111Present the summary in this structure:112113```114PATIENT DEMOGRAPHICS115====================116Name: [official name]117MRN: [identifier]118DOB: [birthDate] (Age: [calculated])119Gender: [gender]120Race/Ethnicity: [from extensions]121Preferred Language: [language]122Marital Status: [status]123124CONTACT INFORMATION125===================126Home Phone: [telecom]127Mobile Phone: [telecom]128Email: [telecom]129Home Address: [address]130131EMERGENCY CONTACTS132==================1331. [name] - [relationship] - [phone]1342. [name] - [relationship] - [phone]135136INSURANCE COVERAGE137==================138Primary: [plan name] - ID: [subscriberId] - Group: [group]139Secondary: [plan name] - ID: [subscriberId] - Group: [group]140141ADVANCE DIRECTIVES142==================143Status: [On file / Not on file]144145MISSING DATA FLAGS146==================147- [list of flagged items]148```149150## Examples151152### Example 1: Complete Demographics Pull153154**User says:** "Pull up demographics for patient 12345"155156**Actions:**1571. `fhir_read` Patient/12345 -- returns full Patient resource with name, DOB, address, telecom, US Core race/ethnicity extensions1582. `fhir_search` RelatedPerson?patient=12345 -- returns 2 entries: spouse (emergency contact), adult child (next of kin)1593. `fhir_search` Coverage?patient=12345&status=active -- returns 1 active Coverage: Blue Cross PPO, primary1604. `fhir_search` Consent?patient=12345&category=... -- returns 1 advance directive161162**Result:**163```164PATIENT DEMOGRAPHICS165====================166Name: Maria Garcia167MRN: MRN-12345168DOB: 1958-03-15 (Age: 67)169Gender: Female170Race/Ethnicity: Hispanic or Latino / White171Preferred Language: Spanish172Marital Status: Married173174CONTACT INFORMATION175===================176Home Phone: (555) 234-5678177Mobile Phone: (555) 876-5432178Email: mgarcia@email.com179Home Address: 456 Oak Ave, Austin, TX 78701180181EMERGENCY CONTACTS182==================1831. Roberto Garcia - Spouse - (555) 234-56791842. Ana Garcia-Lopez - Daughter - (555) 345-6789185186INSURANCE COVERAGE187==================188Primary: Blue Cross Blue Shield PPO - ID: BCB998877 - Group: GRP-4421189190ADVANCE DIRECTIVES191==================192Status: On file (dated 2022-06-10)193194MISSING DATA FLAGS195==================196- No secondary insurance on file197```198199### Example 2: Patient With Missing Critical Data200201**User says:** "Who is patient abc-789? Get me their info."202203**Actions:**2041. `fhir_read` Patient/abc-789 -- returns minimal Patient resource: name and DOB only, no telecom, no extensions2052. `fhir_search` RelatedPerson?patient=abc-789 -- returns 0 entries2063. `fhir_search` Coverage?patient=abc-789&status=active -- returns 0 entries2074. `fhir_search` Consent?patient=abc-789&category=... -- returns 0 entries208209**Result:**210```211PATIENT DEMOGRAPHICS212====================213Name: James Wilson214MRN: Not recorded215DOB: 1990-11-22 (Age: 35)216Gender: Male217Race/Ethnicity: Not documented218Preferred Language: Not specified219Marital Status: Unknown220221CONTACT INFORMATION222===================223No contact information on file224225EMERGENCY CONTACTS226==================227None documented228229INSURANCE COVERAGE230==================231No active coverage found232233ADVANCE DIRECTIVES234==================235Status: Not on file236237MISSING DATA FLAGS [CRITICAL]238==============================239- No phone number or email240- No home address241- No emergency contact242- No active insurance coverage243- No preferred language244- Race/ethnicity not documented245- No advance directive on file246- Allergy documentation status unknown247```248249## Troubleshooting250251### No Patient Resource Found252- Verify the patient ID is correct. Try searching by name and DOB instead:253 ```254 Tool: fhir_search255 resourceType: "Patient"256 queryParams: "family=[lastname]&given=[firstname]&birthdate=[YYYY-MM-DD]"257 ```258- Check if the ID format matches the FHIR server's expectations (some use UUIDs, others use numeric IDs).259260### RelatedPerson Search Returns Empty But Patient Has Emergency Contact in Record261- Some EHR systems store emergency contacts as extensions on the Patient resource rather than as separate RelatedPerson resources. Check `Patient.contact` array for embedded contact entries:262 ```263 Patient.contact[].relationship264 Patient.contact[].name265 Patient.contact[].telecom266 ```267- EPIC systems often use the `Patient.contact` array instead of RelatedPerson resources.268269### Coverage Resources Missing Plan Details270- The `class` array may use different type codes depending on the payer. Check for `type.coding.code` values: "plan", "group", "subplan", "subgroup", "rxbin", "rxpcn".271- Some systems populate plan details in the `payor` referenced Organization resource. Follow the reference with `fhir_read` on the Organization.272273## Related Skills274275- `clinical-summary-generator` -- for clinical data beyond demographics276- `insurance-coverage-summary` -- for deeper insurance analysis including coordination of benefits277- `allergy-adverse-reaction-summary` -- when allergy documentation flag is raised