Installation
Installation Guide
Section titled “Installation Guide”This guide will help you install and configure Scribe2FHIR in your development environment.
Prerequisites
Section titled “Prerequisites”Before installing Scribe2FHIR, ensure you have the following prerequisites:
- Python: Version 3.8 or higher
- pip: Python package installer
- Virtual Environment: Recommended for isolation (venv, conda, or similar)
Installation Methods
Section titled “Installation Methods”Using pip (Recommended)
Section titled “Using pip (Recommended)”Install Scribe2FHIR directly from PyPI:
pip install scribe2fhirFrom Source
Section titled “From Source”For development or to get the latest features:
# Clone the repositorygit clone https://github.com/MedScribeAlliance/scribe2fhir.gitcd scribe2fhir
# Install in development modepip install -e .Using Poetry
Section titled “Using Poetry”If you prefer Poetry for dependency management:
poetry add scribe2fhirVirtual Environment Setup
Section titled “Virtual Environment Setup”We strongly recommend using a virtual environment to avoid dependency conflicts:
Using venv
Section titled “Using venv”# Create virtual environmentpython -m venv scribe2fhir-env
# Activate virtual environment# On macOS/Linux:source scribe2fhir-env/bin/activate# On Windows:scribe2fhir-env\Scripts\activate
# Install Scribe2FHIRpip install scribe2fhirUsing conda
Section titled “Using conda”# Create conda environmentconda create -n scribe2fhir python=3.10
# Activate environmentconda activate scribe2fhir
# Install Scribe2FHIRpip install scribe2fhirDependencies
Section titled “Dependencies”Scribe2FHIR automatically installs the following key dependencies:
- fhir.resources: FHIR resource models and validation
- pydantic: Data validation and parsing
- python-dateutil: Date parsing utilities
- typing-extensions: Enhanced type hints
For a complete list, see the requirements.txt file in the repository.
Verification
Section titled “Verification”Verify your installation by importing Scribe2FHIR in Python:
import scribe2fhirfrom scribe2fhir.core import DocumentBuilder
# Check versionprint(f"Scribe2FHIR version: {scribe2fhir.__version__}")
# Create a simple document builder to test installationbuilder = DocumentBuilder()print("Installation successful!")Development Setup
Section titled “Development Setup”For contributors or advanced users who want to modify the source code:
Clone and Setup Development Environment
Section titled “Clone and Setup Development Environment”# Clone the repositorygit clone https://github.com/MedScribeAlliance/scribe2fhir.gitcd scribe2fhir
# Create virtual environmentpython -m venv dev-envsource dev-env/bin/activate # On Windows: dev-env\Scripts\activate
# Install development dependenciespip install -e ".[dev]"
# Run tests to verify setuppython -m pytest tests/Development Dependencies
Section titled “Development Dependencies”Additional packages for development:
- pytest: Testing framework
- black: Code formatting
- isort: Import sorting
- mypy: Type checking
- pre-commit: Git hooks for code quality
Configuration
Section titled “Configuration”Scribe2FHIR works out of the box with default settings, but you can customize behavior through configuration files or environment variables.
Environment Variables
Section titled “Environment Variables”Set these optional environment variables:
# FHIR server endpoint (if using external FHIR server)export FHIR_SERVER_URL="https://your-fhir-server.com"
# Logging levelexport SCRIBE2FHIR_LOG_LEVEL="INFO"Configuration File
Section titled “Configuration File”Create a config.yaml file for custom settings:
fhir: version: "R5" base_url: "https://your-fhir-server.com"
logging: level: "INFO" format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
processing: batch_size: 100 timeout: 30Troubleshooting
Section titled “Troubleshooting”Common Installation Issues
Section titled “Common Installation Issues”Python Version Compatibility
Section titled “Python Version Compatibility”Ensure you’re using Python 3.8+:
python --versionDependency Conflicts
Section titled “Dependency Conflicts”If you encounter dependency conflicts:
# Create a fresh virtual environmentpython -m venv fresh-envsource fresh-env/bin/activatepip install --upgrade pippip install scribe2fhirNetwork Issues
Section titled “Network Issues”If installation fails due to network issues:
# Try with increased timeoutpip install --timeout 60 scribe2fhir
# Or use a different indexpip install -i https://pypi.org/simple/ scribe2fhirGetting Help
Section titled “Getting Help”If you encounter issues:
- Check the troubleshooting section in the documentation
- Search existing GitHub issues
- Create a new issue with detailed error information
Next Steps
Section titled “Next Steps”Now that you have Scribe2FHIR installed, you can:
- Explore the Python SDK - Learn core concepts and API
- Check out examples - See practical implementations
- Understand FHIR specification - Learn about FHIR standards
Ready to build your first FHIR resource? Head to the Python SDK documentation to get started!