Lab Findings Element Documentation
Overview
Section titled “Overview”Lab Findings elements represent laboratory test results and their interpretations. These are clinical observations obtained through laboratory analysis of specimens.
Function
Section titled “Function”builder.add_lab_finding( code: CodeInput, value: Optional[Union[str, float]] = None, unit: Optional[str] = None, date: Optional[DateTimeInput] = None, interpretation: Optional[Union[Interpretation, str]] = None, notes: Optional[str] = None, id: Optional[str] = None,) -> ObservationParameters
Section titled “Parameters”Required Parameters
Section titled “Required Parameters”- code: The lab test name or code
Optional Parameters
Section titled “Optional Parameters”- value: The test result value (numeric or string)
- unit: Unit of measurement (e.g., “mg/dL”, “mmol/L”, ”%”)
- date: When the test was performed
- interpretation: Clinical interpretation of the result
- notes: Additional notes about the test or result
- id: Custom resource ID
Basic Usage
Section titled “Basic Usage”Simple Lab Result (Preferred with CodeableConcept)
Section titled “Simple Lab Result (Preferred with CodeableConcept)”from fhir_sdk import FHIRDocumentBuilder, Interpretationfrom fhir_sdk.types import create_codeable_concept
builder = FHIRDocumentBuilder()builder.add_patient(name="John Doe", age=30)builder.add_encounter()
# Add lab resultlab = builder.add_lab_finding( code=create_codeable_concept( text="Hemoglobin", code="718-7", system="http://loinc.org", display="Hemoglobin [Mass/volume] in Blood" ), value=14.2, unit="g/dL", interpretation=Interpretation.NORMAL)Using String (Alternative)
Section titled “Using String (Alternative)”lab = builder.add_lab_finding( code="Hemoglobin", value=14.2, unit="g/dL", interpretation="normal")Qualitative Result
Section titled “Qualitative Result”lab = builder.add_lab_finding( code=create_codeable_concept( text="Glucose, Urine", code="25428-4", system="http://loinc.org" ), value="Negative", interpretation=Interpretation.NORMAL)Common Lab Tests with LOINC Codes
Section titled “Common Lab Tests with LOINC Codes”Complete Blood Count (CBC)
Section titled “Complete Blood Count (CBC)”# Hemoglobinlab = builder.add_lab_finding( code=create_codeable_concept( text="Hemoglobin", code="718-7", system="http://loinc.org" ), value=13.5, unit="g/dL")
# White Blood Cell Countlab = builder.add_lab_finding( code=create_codeable_concept( text="White Blood Cell Count", code="6690-2", system="http://loinc.org" ), value=7200, unit="cells/μL")
# Platelet Countlab = builder.add_lab_finding( code=create_codeable_concept( text="Platelet Count", code="777-3", system="http://loinc.org" ), value=250000, unit="platelets/μL")Basic Metabolic Panel
Section titled “Basic Metabolic Panel”# Glucoselab = builder.add_lab_finding( code=create_codeable_concept( text="Glucose", code="2345-7", system="http://loinc.org" ), value=95, unit="mg/dL", interpretation=Interpretation.NORMAL)
# Creatininelab = builder.add_lab_finding( code=create_codeable_concept( text="Creatinine", code="2160-0", system="http://loinc.org" ), value=1.0, unit="mg/dL")
# Sodiumlab = builder.add_lab_finding( code=create_codeable_concept( text="Sodium", code="2951-2", system="http://loinc.org" ), value=140, unit="mmol/L")Lipid Panel
Section titled “Lipid Panel”# Total Cholesterollab = builder.add_lab_finding( code=create_codeable_concept( text="Total Cholesterol", code="2093-3", system="http://loinc.org" ), value=180, unit="mg/dL", interpretation=Interpretation.NORMAL)
# HDL Cholesterollab = builder.add_lab_finding( code=create_codeable_concept( text="HDL Cholesterol", code="2085-9", system="http://loinc.org" ), value=55, unit="mg/dL")
# LDL Cholesterollab = builder.add_lab_finding( code=create_codeable_concept( text="LDL Cholesterol", code="18262-6", system="http://loinc.org" ), value=110, unit="mg/dL")Interpretation with Different Result Types
Section titled “Interpretation with Different Result Types”Numeric Results with Reference Ranges
Section titled “Numeric Results with Reference Ranges”lab = builder.add_lab_finding( code="Creatinine", value=1.8, unit="mg/dL", interpretation=Interpretation.HIGH, notes="Above normal range (0.6-1.2 mg/dL)")Qualitative Results
Section titled “Qualitative Results”# Negative resultlab = builder.add_lab_finding( code="Urine Protein", value="Negative", interpretation=Interpretation.NORMAL)
# Positive resultlab = builder.add_lab_finding( code="Strep A Rapid Test", value="Positive", interpretation=Interpretation.ABNORMAL)Results with Interpretation Only
Section titled “Results with Interpretation Only”# When exact value is not recordedlab = builder.add_lab_finding( code="Liver Function Tests", interpretation=Interpretation.NORMAL, notes="All values within normal limits")Time-stamped Results
Section titled “Time-stamped Results”from datetime import datetime, timedelta
# Test performed yesterdaylab = builder.add_lab_finding( code="Fasting Glucose", value=92, unit="mg/dL", date=datetime.now() - timedelta(days=1), notes="Fasting for 12 hours confirmed")Common Lab Units
Section titled “Common Lab Units”- Blood Chemistry: “mg/dL”, “mmol/L”, “mEq/L”
- Hematology: “g/dL”, “cells/μL”, ”%”, “fL”
- Lipids: “mg/dL”, “mmol/L”
- Proteins: “g/dL”, “mg/dL”
- Enzymes: “U/L”, “IU/L”
- Hormones: “ng/mL”, “μg/dL”, “mIU/mL”
Special Lab Result Types
Section titled “Special Lab Result Types”Microbiology Results
Section titled “Microbiology Results”lab = builder.add_lab_finding( code="Blood Culture", value="No growth after 5 days", interpretation=Interpretation.NORMAL)Pathology Results
Section titled “Pathology Results”lab = builder.add_lab_finding( code="Tissue Biopsy", value="Benign epithelial tissue", notes="No evidence of malignancy")Molecular/Genetic Tests
Section titled “Molecular/Genetic Tests”lab = builder.add_lab_finding( code="COVID-19 PCR", value="Not Detected", interpretation=Interpretation.NORMAL)Best Practices
Section titled “Best Practices”- Use create_codeable_concept with LOINC codes for standardized lab tests
- Include appropriate units for all numeric results
- Add interpretation to highlight abnormal values
- Record collection/testing date for result validity
- Include notes for specimen quality or testing conditions
- Use consistent units within test panels
- Record “unable to obtain” or “insufficient sample” when applicable
- Lab findings are categorized as “laboratory” observations
- Values can be numeric (with units) or string (for qualitative results)
- Interpretation helps clinicians identify critical values
- Date stamps are crucial for trending lab values over time
- Multiple lab results can be grouped logically (e.g., CBC panel, BMP panel)