Lifestyle History Element Documentation
Overview
Section titled “Overview”Lifestyle History elements represent social history factors, habits, and lifestyle-related observations that can impact patient health. These include smoking, alcohol use, diet, exercise, travel history, and other social determinants.
Function
Section titled “Function”builder.add_lifestyle_history( code: CodeInput, status_value: Optional[str] = None, notes: Optional[str] = None, date: Optional[DateTimeInput] = None, id: Optional[str] = None,) -> ObservationParameters
Section titled “Parameters”Required Parameters
Section titled “Required Parameters”- code: The lifestyle factor or habit being documented
Optional Parameters
Section titled “Optional Parameters”- status_value: Current status of the lifestyle factor (e.g., “Active”, “Inactive”)
- notes: Additional details about the lifestyle factor
- date: When this information was recorded
- id: Custom resource ID
Basic Usage
Section titled “Basic Usage”Simple Lifestyle Factor (Preferred with CodeableConcept)
Section titled “Simple Lifestyle Factor (Preferred with CodeableConcept)”from fhir_sdk import FHIRDocumentBuilderfrom fhir_sdk.types import create_codeable_concept
builder = FHIRDocumentBuilder()builder.add_patient(name="John Doe", age=30)builder.add_encounter()
# Add smoking statuslifestyle = builder.add_lifestyle_history( code=create_codeable_concept( text="Smoking status", code="72166-2", system="http://loinc.org", display="Tobacco smoking status" ), status_value="Former smoker")Using String (Alternative)
Section titled “Using String (Alternative)”lifestyle = builder.add_lifestyle_history( code="Smoking status", status_value="Never smoker")With Detailed Notes
Section titled “With Detailed Notes”lifestyle = builder.add_lifestyle_history( code=create_codeable_concept( text="Alcohol use", code="74013-4", system="http://loinc.org" ), status_value="Active", notes="2-3 drinks per week, mainly wine with dinner")Common Lifestyle Factors
Section titled “Common Lifestyle Factors”Tobacco Use
Section titled “Tobacco Use”# Current smokerlifestyle = builder.add_lifestyle_history( code=create_codeable_concept( text="Smoking status", code="72166-2", system="http://loinc.org" ), status_value="Current smoker", notes="1 pack per day for 15 years")
# Former smokerlifestyle = builder.add_lifestyle_history( code="Smoking status", status_value="Former smoker", notes="Quit 5 years ago, smoked 10 years")
# Never smokerlifestyle = builder.add_lifestyle_history( code="Smoking status", status_value="Never smoker")Alcohol Use
Section titled “Alcohol Use”# Active drinkerlifestyle = builder.add_lifestyle_history( code=create_codeable_concept( text="Alcohol use", code="74013-4", system="http://loinc.org" ), status_value="Active", notes="Social drinker, 4-5 drinks per week")
# Non-drinkerlifestyle = builder.add_lifestyle_history( code="Alcohol use", status_value="Never", notes="Has never consumed alcohol")
# Former drinkerlifestyle = builder.add_lifestyle_history( code="Alcohol use", status_value="Former", notes="Stopped drinking 3 years ago")Drug Use
Section titled “Drug Use”lifestyle = builder.add_lifestyle_history( code=create_codeable_concept( text="Illicit drug use", code="74204-9", system="http://loinc.org" ), status_value="Never", notes="Denies any recreational drug use")Diet and Nutrition
Section titled “Diet and Nutrition”# Dietary habitslifestyle = builder.add_lifestyle_history( code="Dietary habits", status_value="Vegetarian", notes="Follows lacto-vegetarian diet for 5 years")
# Special dietlifestyle = builder.add_lifestyle_history( code="Special diet", status_value="Active", notes="Low-sodium diet for hypertension management")Exercise and Physical Activity
Section titled “Exercise and Physical Activity”lifestyle = builder.add_lifestyle_history( code=create_codeable_concept( text="Exercise", code="LA11834-1", system="http://loinc.org" ), status_value="Regular", notes="Walks 30 minutes daily, gym 3x per week")
# Sedentary lifestylelifestyle = builder.add_lifestyle_history( code="Physical activity level", status_value="Sedentary", notes="Desk job, minimal physical activity")Sleep Patterns
Section titled “Sleep Patterns”lifestyle = builder.add_lifestyle_history( code="Sleep patterns", status_value="Normal", notes="7-8 hours per night, no sleep disturbances")
# Sleep problemslifestyle = builder.add_lifestyle_history( code="Sleep quality", status_value="Poor", notes="Difficulty falling asleep, frequent awakenings")Occupational History
Section titled “Occupational History”lifestyle = builder.add_lifestyle_history( code="Occupation", status_value="Active", notes="Software engineer, primarily desk work")
# Occupational hazardslifestyle = builder.add_lifestyle_history( code="Occupational exposure", status_value="Previous", notes="Worked in construction for 10 years, asbestos exposure")Travel History
Section titled “Travel History”from datetime import datetime, timedelta
# Recent travellifestyle = builder.add_lifestyle_history( code="Recent travel", status_value="Yes", notes="Returned from Thailand 2 weeks ago", date=datetime.now() - timedelta(days=14))
# No recent travellifestyle = builder.add_lifestyle_history( code="Travel history", status_value="None", notes="No international travel in past 2 years")Living Situation
Section titled “Living Situation”lifestyle = builder.add_lifestyle_history( code="Living situation", status_value="Independent", notes="Lives alone in apartment, able to perform ADLs")
# Social supportlifestyle = builder.add_lifestyle_history( code="Social support", status_value="Good", notes="Strong family support, married with 2 children")Sexual History
Section titled “Sexual History”lifestyle = builder.add_lifestyle_history( code="Sexual activity", status_value="Active", notes="Monogamous relationship, uses barrier contraception")Environmental Exposures
Section titled “Environmental Exposures”lifestyle = builder.add_lifestyle_history( code="Environmental exposures", status_value="None reported", notes="No known toxic exposures, lives in suburban area")
# Pet allergies/exposureslifestyle = builder.add_lifestyle_history( code="Pet ownership", status_value="Yes", notes="Has 2 cats, no known allergies")Status Values
Section titled “Status Values”Common status values used:
- “Active” - Currently engaged in the behavior
- “Inactive” - Not currently engaged but may have history
- “Former” - Previously engaged but stopped
- “Never” - Never engaged in the behavior
- “Unknown” - Status is unknown or unclear
- “Occasional” - Infrequent or sporadic engagement
Time-based Documentation
Section titled “Time-based Documentation”from datetime import datetime
# Current assessmentlifestyle = builder.add_lifestyle_history( code="Exercise habits", status_value="Improved", notes="Started regular exercise program 6 months ago", date=datetime.now())Quantified Lifestyle Factors
Section titled “Quantified Lifestyle Factors”# Smoking with pack-yearslifestyle = builder.add_lifestyle_history( code="Smoking history", status_value="Former smoker", notes="20 pack-year history (1 PPD x 20 years), quit 2019")
# Alcohol with unitslifestyle = builder.add_lifestyle_history( code="Alcohol consumption", status_value="Moderate", notes="14 units per week (within recommended limits)")Best Practices
Section titled “Best Practices”- Use create_codeable_concept with LOINC codes when available for standardized social history
- Be non-judgmental in documentation - focus on health relevance
- Include quantitative details when possible (pack-years, drinks per week)
- Document both current status and historical information
- Update lifestyle factors periodically as they may change
- Include relevant timeframes for risk assessment
- Consider cultural and social context in documentation
Common LOINC Codes for Social History
Section titled “Common LOINC Codes for Social History”- Smoking status:
72166-2 - Alcohol use:
74013-4 - Drug use:
74204-9 - Exercise:
LA11834-1 - Occupation:
85658-3 - Education level:
82589-3
- Lifestyle history observations are categorized as “social-history”
- Information helps assess health risks and plan interventions
- Regular updates help track behavior changes over time
- Sensitive information should be documented with appropriate privacy considerations
- Multiple lifestyle factors contribute to comprehensive social history assessment