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: Retrieves and formats a complete patient demographic summary from FHIR Patient, RelatedPerson, and Coverage resources. Use when user asks to "pull demographics", "get patient info", "show patient details", "who is this patient", "patient summary", "emergency contacts", "insurance info", or needs a quick overview of non-clinical patient data. Do NOT use for clinical summaries, lab results, medication lists, or diagnosis reviews.4---56# Patient Demographics Summary78## Overview910Pull 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.1112## FHIR Resources Used1314| Resource | Purpose | Key Fields |15|----------|---------|------------|16| Patient | Core demographics | name, birthDate, gender, address, telecom, communication, identifier, extension |17| RelatedPerson | Emergency contacts, guarantors | name, telecom, relationship, period |18| Coverage | Insurance information | status, type, subscriberId, payor, period, class |1920## Instructions2122### Step 1: Retrieve Patient Resource2324```25Tool: fhir_read26resourceType: "Patient"27id: "[patient-id]"28```2930Extract the following fields:31- **Identifiers**: MRN (`identifier` where `type.coding.code` = "MR"), SSN (last 4 only), driver's license32- **Name**: `name` array -- use `name.use` = "official" as primary; note maiden names (`use` = "maiden")33- **Birth Date**: `birthDate` (calculate age)34- **Gender**: `gender` (administrative gender)35- **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`36- **Address**: `address` array -- identify `use` = "home" vs "work" vs "temp"37- **Telecom**: `telecom` array -- phone (`system` = "phone"), email (`system` = "email"), fax38- **Preferred Language**: `communication` array where `preferred` = true39- **Marital Status**: `maritalStatus`40- **Deceased**: `deceasedBoolean` or `deceasedDateTime`41- **Managing Organization**: `managingOrganization`4243### Step 2: Retrieve Emergency Contacts and Related Persons4445```46Tool: fhir_search47resourceType: "RelatedPerson"48queryParams: "patient=[patient-id]"49```5051For each RelatedPerson:52- Extract name, relationship type (`relationship.coding.code`), phone, email53- Check `period` to confirm the relationship is current (no `end` date or `end` > today)54- Identify relationship roles: emergency contact, next of kin, guarantor, power of attorney5556### Step 3: Retrieve Insurance Coverage5758```59Tool: fhir_search60resourceType: "Coverage"61queryParams: "patient=[patient-id]&status=active"62```6364For each active Coverage:65- Plan name from `class` where `type.coding.code` = "plan"66- Group number from `class` where `type.coding.code` = "group"67- Subscriber ID from `subscriberId`68- Payor organization from `payor` reference69- Coverage period from `period`70- Coverage order (`order` field: 1 = primary, 2 = secondary)7172### Step 4: Check for Advance Directives7374```75Tool: fhir_search76resourceType: "Consent"77queryParams: "patient=[patient-id]&category=http://terminology.hl7.org/CodeSystem/consentcategorycodes|acd"78```7980If no results, also search:81```82Tool: fhir_search83resourceType: "DocumentReference"84queryParams: "patient=[patient-id]&type=http://loinc.org|64298-3"85```8687LOINC 64298-3 = Power of attorney / Advance directive8889### Step 5: Flag Missing Critical Data9091Scan the collected data and flag any of the following as missing:92- No emergency contact (zero RelatedPerson resources or none with emergency contact relationship)93- No active insurance coverage94- No preferred language specified95- No allergy documentation status (check if `AllergyIntolerance` search returns zero results -- this indicates allergies have not been reviewed, not that there are none)96- No advance directive on file97- Missing phone number or email98- Missing address99100### Step 6: Format Output101102Present the summary in this structure:103104```105PATIENT DEMOGRAPHICS106====================107Name: [official name]108MRN: [identifier]109DOB: [birthDate] (Age: [calculated])110Gender: [gender]111Race/Ethnicity: [from extensions]112Preferred Language: [language]113Marital Status: [status]114115CONTACT INFORMATION116===================117Home Phone: [telecom]118Mobile Phone: [telecom]119Email: [telecom]120Home Address: [address]121122EMERGENCY CONTACTS123==================1241. [name] - [relationship] - [phone]1252. [name] - [relationship] - [phone]126127INSURANCE COVERAGE128==================129Primary: [plan name] - ID: [subscriberId] - Group: [group]130Secondary: [plan name] - ID: [subscriberId] - Group: [group]131132ADVANCE DIRECTIVES133==================134Status: [On file / Not on file]135136MISSING DATA FLAGS137==================138- [list of flagged items]139```140141## Examples142143### Example 1: Complete Demographics Pull144145**User says:** "Pull up demographics for patient 12345"146147**Actions:**1481. `fhir_read` Patient/12345 -- returns full Patient resource with name, DOB, address, telecom, US Core race/ethnicity extensions1492. `fhir_search` RelatedPerson?patient=12345 -- returns 2 entries: spouse (emergency contact), adult child (next of kin)1503. `fhir_search` Coverage?patient=12345&status=active -- returns 1 active Coverage: Blue Cross PPO, primary1514. `fhir_search` Consent?patient=12345&category=... -- returns 1 advance directive152153**Result:**154```155PATIENT DEMOGRAPHICS156====================157Name: Maria Garcia158MRN: MRN-12345159DOB: 1958-03-15 (Age: 67)160Gender: Female161Race/Ethnicity: Hispanic or Latino / White162Preferred Language: Spanish163Marital Status: Married164165CONTACT INFORMATION166===================167Home Phone: (555) 234-5678168Mobile Phone: (555) 876-5432169Email: mgarcia@email.com170Home Address: 456 Oak Ave, Austin, TX 78701171172EMERGENCY CONTACTS173==================1741. Roberto Garcia - Spouse - (555) 234-56791752. Ana Garcia-Lopez - Daughter - (555) 345-6789176177INSURANCE COVERAGE178==================179Primary: Blue Cross Blue Shield PPO - ID: BCB998877 - Group: GRP-4421180181ADVANCE DIRECTIVES182==================183Status: On file (dated 2022-06-10)184185MISSING DATA FLAGS186==================187- No secondary insurance on file188```189190### Example 2: Patient With Missing Critical Data191192**User says:** "Who is patient abc-789? Get me their info."193194**Actions:**1951. `fhir_read` Patient/abc-789 -- returns minimal Patient resource: name and DOB only, no telecom, no extensions1962. `fhir_search` RelatedPerson?patient=abc-789 -- returns 0 entries1973. `fhir_search` Coverage?patient=abc-789&status=active -- returns 0 entries1984. `fhir_search` Consent?patient=abc-789&category=... -- returns 0 entries199200**Result:**201```202PATIENT DEMOGRAPHICS203====================204Name: James Wilson205MRN: Not recorded206DOB: 1990-11-22 (Age: 35)207Gender: Male208Race/Ethnicity: Not documented209Preferred Language: Not specified210Marital Status: Unknown211212CONTACT INFORMATION213===================214No contact information on file215216EMERGENCY CONTACTS217==================218None documented219220INSURANCE COVERAGE221==================222No active coverage found223224ADVANCE DIRECTIVES225==================226Status: Not on file227228MISSING DATA FLAGS [CRITICAL]229==============================230- No phone number or email231- No home address232- No emergency contact233- No active insurance coverage234- No preferred language235- Race/ethnicity not documented236- No advance directive on file237- Allergy documentation status unknown238```239240## Troubleshooting241242### No Patient Resource Found243- Verify the patient ID is correct. Try searching by name and DOB instead:244 ```245 Tool: fhir_search246 resourceType: "Patient"247 queryParams: "family=[lastname]&given=[firstname]&birthdate=[YYYY-MM-DD]"248 ```249- Check if the ID format matches the FHIR server's expectations (some use UUIDs, others use numeric IDs).250251### RelatedPerson Search Returns Empty But Patient Has Emergency Contact in Record252- 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:253 ```254 Patient.contact[].relationship255 Patient.contact[].name256 Patient.contact[].telecom257 ```258- EPIC systems often use the `Patient.contact` array instead of RelatedPerson resources.259260### Coverage Resources Missing Plan Details261- The `class` array may use different type codes depending on the payer. Check for `type.coding.code` values: "plan", "group", "subplan", "subgroup", "rxbin", "rxpcn".262- Some systems populate plan details in the `payor` referenced Organization resource. Follow the reference with `fhir_read` on the Organization.263264## Related Skills265266- `clinical-summary-generator` -- for clinical data beyond demographics267- `insurance-coverage-summary` -- for deeper insurance analysis including coordination of benefits268- `allergy-adverse-reaction-summary` -- when allergy documentation flag is raised