Version Control Workflow
Version Control Workflow with MirthSync
Section titled “Version Control Workflow with MirthSync”Learn how to effectively manage your Mirth Connect or Open Integration Engine configurations using Git and MirthSync. This guide covers proven workflows, branching strategies, and team collaboration patterns used by successful healthcare IT teams.
Workflow Overview
Section titled “Workflow Overview”Why Version Control for Healthcare Integration?
Section titled “Why Version Control for Healthcare Integration?”Healthcare integration platforms like Mirth Connect and OIE manage critical data flows between systems. Without proper version control, teams face:
- No audit trail - Can’t see who changed what channel configuration or when
- Difficult rollbacks - Rolling back a problematic deployment requires manual intervention
- Merge conflicts - Multiple developers can’t work simultaneously without stepping on each other
- No code review - Changes go directly to production without peer review
- Compliance risks - Regulatory requirements often mandate change tracking
MirthSync transforms your integration platform into versioned, reviewable, and auditable infrastructure as code.
Core Workflow Patterns
Section titled “Core Workflow Patterns”Solo Developer Workflow
Section titled “Solo Developer Workflow”Perfect for individual developers or small teams where one person manages Mirth Connect at a time.
Daily Workflow
Section titled “Daily Workflow”# Set password once per sessionexport MIRTHSYNC_PASSWORD=your_password
# 1. Start your day - pull latest from Mirth Connect./mirthsync.sh -s https://mirth.example.com:8443/api -u admin -t ./mirth-config pull
# 2. Review what's changed (if anything)./mirthsync.sh -t ./mirth-config git status./mirthsync.sh -t ./mirth-config git diff
# 3. Commit any changes from Mirth Connect./mirthsync.sh -t ./mirth-config git add./mirthsync.sh -t ./mirth-config --commit-message "Update ADT channel with new transformer logic" git commit
# 4. Push to remote backup./mirthsync.sh -t ./mirth-config git pushMaking Changes
Section titled “Making Changes”# 1. Make changes in Mirth Connect Administrator Console# (Add new channel, modify transformers, update code templates)
# 2. Pull changes to your local files./mirthsync.sh -s https://mirth.example.com:8443/api -u admin -t ./mirth-config pull
# 3. Review the changes./mirthsync.sh -t ./mirth-config git diff
# 4. Commit with descriptive message./mirthsync.sh -t ./mirth-config git add./mirthsync.sh -t ./mirth-config --commit-message "Add FHIR R4 patient admission channel
- Receives ADT^A01 messages on port 6661- Transforms HL7 v2 to FHIR R4 Patient resource- Posts to FHIR server at fhir.example.com- Includes error handling for malformed messages" git commit
# 5. Push to remote./mirthsync.sh -t ./mirth-config git pushViewing History
Section titled “Viewing History”# See commit history./mirthsync.sh -t ./mirth-config git log
# See who changed what in a file (use native git)cd ./mirth-config && git blame channels/ADT_Inbound/channel.xml && cd ..
# See changes over time (use native git for -p flag)cd ./mirth-config && git log -p channels/ADT_Inbound/ && cd ..Team Collaboration Workflow
Section titled “Team Collaboration Workflow”For teams where multiple developers work on Mirth Connect configurations simultaneously.
Feature Branch Workflow
Section titled “Feature Branch Workflow”This is the most popular workflow for teams. Each feature or change gets its own branch.
Step 1: Create Feature Branch
# Update main branch./mirthsync.sh -t ./mirth-config git checkout main./mirthsync.sh -t ./mirth-config git pull
# Create feature branch (use native git - MirthSync can't create branches)cd ./mirth-config && git checkout -b feature/lab-results-integration && cd ..
# Make changes in Mirth Connect, then pull changes to files./mirthsync.sh -s https://mirth.example.com:8443/api -u admin -t ./mirth-config pull
# Commit to feature branch./mirthsync.sh -t ./mirth-config git add./mirthsync.sh -t ./mirth-config --commit-message "Add Lab Results HL7 to FHIR integration" git commit
# Push feature branch (use native git for -u flag)cd ./mirth-config && git push -u origin feature/lab-results-integration && cd ..Step 2: Open Pull Request
# Using GitHub CLIgh pr create --title "Add Lab Results Integration" --body "## Changes- New HL7 receiver channel for lab results (ORU^R01)- Transformer to convert to FHIR Observation resources- Destination to POST to FHIR server
## Testing- Tested with sample ORU^R01 messages- Validated FHIR output against R4 spec- Verified error handling
## Deployment Notes- Requires lab_results port 6662 to be open- Update FHIR_SERVER_URL environment variable"Step 3: Code Review
Team members review the pull request:
- Check channel logic for correctness
- Review transformer code quality
- Verify error handling
- Suggest improvements
Step 4: Merge and Deploy
# After approval, merge via GitHub/GitLab UI# Or via command line (use native git for merge):./mirthsync.sh -t ./mirth-config git checkout main./mirthsync.sh -t ./mirth-config git pullcd ./mirth-config && git merge feature/lab-results-integration && cd .../mirthsync.sh -t ./mirth-config git push
# Deploy to Mirth Connect./mirthsync.sh -s https://mirth-prod.example.com:8443/api -u admin -t ./mirth-config --deploy-all pushHandling Conflicts
Section titled “Handling Conflicts”When two developers modify the same channel:
# Try to merge main into your feature branch (use native git)./mirthsync.sh -t ./mirth-config git checkout feature/your-featurecd ./mirth-config && git merge main && cd ..
# If conflicts occur:# CONFLICT (content): Merge conflict in channels/ADT_Inbound/channel.xml
# Open the file and resolve conflicts manually# Look for <<<<<<< HEAD, =======, and >>>>>>> markers
# After resolving:./mirthsync.sh -t ./mirth-config git add./mirthsync.sh -t ./mirth-config --commit-message "Merge main and resolve ADT channel conflicts" git commit./mirthsync.sh -t ./mirth-config git pushGitFlow Workflow
Section titled “GitFlow Workflow”For larger teams with formal release cycles and multiple environments (dev, staging, production).
Branch Structure
Section titled “Branch Structure”Creating Features
Section titled “Creating Features”# Start feature from develop./mirthsync.sh -t ./mirth-config git checkout develop./mirthsync.sh -t ./mirth-config git pull
# Create feature branch (use native git)cd ./mirth-config && git checkout -b feature/new-fhir-endpoint && cd ..
# Make changes, commit regularly./mirthsync.sh -s https://mirth.example.com:8443/api -u admin -t ./mirth-config pull./mirthsync.sh -t ./mirth-config git add./mirthsync.sh -t ./mirth-config --commit-message "WIP: FHIR endpoint channel setup" git commit
# Continue working..../mirthsync.sh -s https://mirth.example.com:8443/api -u admin -t ./mirth-config pull./mirthsync.sh -t ./mirth-config git add./mirthsync.sh -t ./mirth-config --commit-message "Add FHIR transformer logic" git commit
# Push feature branch (use native git for -u flag)cd ./mirth-config && git push -u origin feature/new-fhir-endpoint && cd ..
# When ready, create PR to developgh pr create --base develop --title "Add new FHIR endpoint"Release Process
Section titled “Release Process”# Create release branch from develop (use native git)./mirthsync.sh -t ./mirth-config git checkout develop./mirthsync.sh -t ./mirth-config git pullcd ./mirth-config && git checkout -b release/2.1.0 && cd ..
# Make release preparations (version bumps, etc.)./mirthsync.sh -t ./mirth-config git add./mirthsync.sh -t ./mirth-config --commit-message "Prepare release 2.1.0" git commit
# Deploy to staging environment./mirthsync.sh -s https://mirth-staging.example.com:8443/api -u admin -t ./mirth-config --deploy-all push
# If bugs found, fix in release branch./mirthsync.sh -t ./mirth-config git add./mirthsync.sh -t ./mirth-config --commit-message "Fix: Handle null lab values in transformer" git commit
# When ready, merge to main AND develop (use native git for merge and tag)./mirthsync.sh -t ./mirth-config git checkout maincd ./mirth-config && git merge release/2.1.0 && cd ..cd ./mirth-config && git tag -a v2.1.0 -m "Release 2.1.0" && cd ..cd ./mirth-config && git push origin main --tags && cd ..
./mirthsync.sh -t ./mirth-config git checkout developcd ./mirth-config && git merge release/2.1.0 && cd .../mirthsync.sh -t ./mirth-config git push
# Deploy to production./mirthsync.sh -s https://mirth-prod.example.com:8443/api -u admin -t ./mirth-config --deploy-all pushHotfix Process
Section titled “Hotfix Process”# Create hotfix from main (use native git for branch creation)./mirthsync.sh -t ./mirth-config git checkout main./mirthsync.sh -t ./mirth-config git pullcd ./mirth-config && git checkout -b hotfix/critical-transformer-bug && cd ..
# Fix the issue./mirthsync.sh -s https://mirth.example.com:8443/api -u admin -t ./mirth-config pull# Make fix in Mirth Connect./mirthsync.sh -s https://mirth.example.com:8443/api -u admin -t ./mirth-config pull./mirthsync.sh -t ./mirth-config git add./mirthsync.sh -t ./mirth-config --commit-message "Hotfix: Correct patient ID mapping in ADT channel" git commit
# Merge to main AND develop (use native git for merge and tag)./mirthsync.sh -t ./mirth-config git checkout maincd ./mirth-config && git merge hotfix/critical-transformer-bug && cd ..cd ./mirth-config && git tag -a v2.1.1 -m "Hotfix 2.1.1" && cd ..cd ./mirth-config && git push origin main --tags && cd ..
./mirthsync.sh -t ./mirth-config git checkout developcd ./mirth-config && git merge hotfix/critical-transformer-bug && cd .../mirthsync.sh -t ./mirth-config git push
# Deploy hotfix to production./mirthsync.sh -s https://mirth-prod.example.com:8443/api -u admin -t ./mirth-config --deploy-all pushBranching Strategies
Section titled “Branching Strategies”Branch Naming Conventions
Section titled “Branch Naming Conventions”Use consistent, descriptive branch names:
| Type | Pattern | Example |
|---|---|---|
| Feature | feature/<description> | feature/adt-admission-channel |
| Bugfix | bugfix/<issue> or fix/<issue> | bugfix/hl7-parsing-error |
| Hotfix | hotfix/<critical-issue> | hotfix/production-channel-down |
| Release | release/<version> | release/2.1.0 |
| Experiment | experiment/<name> | experiment/fhir-r5-support |
Branch Lifecycle
Section titled “Branch Lifecycle”# Create branch (use native git)cd ./mirth-config && git checkout -b feature/new-integration && cd ..
# Work on branch (commit often)./mirthsync.sh -t ./mirth-config git add./mirthsync.sh -t ./mirth-config --commit-message "Progress on new integration" git commit
# Keep branch updated with main (use native git for rebase/merge)./mirthsync.sh -t ./mirth-config git checkout main./mirthsync.sh -t ./mirth-config git pull./mirthsync.sh -t ./mirth-config git checkout feature/new-integrationcd ./mirth-config && git rebase main && cd .. # or: git merge main
# When complete, create PRgh pr create
# After merge, delete branch (use native git)./mirthsync.sh -t ./mirth-config git checkout main./mirthsync.sh -t ./mirth-config git pullcd ./mirth-config && git branch -d feature/new-integration && cd ..cd ./mirth-config && git push origin --delete feature/new-integration && cd ..Commit Message Best Practices
Section titled “Commit Message Best Practices”Good Commit Messages
Section titled “Good Commit Messages”# Good - Clear, imperative, explains why./mirthsync.sh -t ./mirth-config --commit-message "Add patient demographics validator to ADT channel
The validator checks for required fields (MRN, name, DOB) beforeprocessing. This prevents downstream errors when required data is missing.
Refs: JIRA-123" git commit
# Good - Concise for simple changes./mirthsync.sh -t ./mirth-config --commit-message "Update FHIR server URL to production endpoint" git commit
# Good - Explains context./mirthsync.sh -t ./mirth-config --commit-message "Increase HTTP timeout for FHIR destinations
External FHIR server sometimes takes >30s to respond during peak hours.Increased timeout to 60s to prevent false failures." git commitBad Commit Messages
Section titled “Bad Commit Messages”# Bad - Not descriptive./mirthsync.sh -t ./mirth-config --commit-message "Fixed stuff" git commit./mirthsync.sh -t ./mirth-config --commit-message "Update" git commit./mirthsync.sh -t ./mirth-config --commit-message "WIP" git commit
# Bad - Too vague./mirthsync.sh -t ./mirth-config --commit-message "Made changes to ADT channel" git commitCommit Message Template
Section titled “Commit Message Template”<type>: <short summary> (50 chars or less)
<detailed description of what and why><wrap at 72 characters>
<optional footer with issue references>Types: feat, fix, docs, style, refactor, test, chore
Pull Request Workflow
Section titled “Pull Request Workflow”Creating Effective PRs
Section titled “Creating Effective PRs”## Summary
Brief description of what this PR does and why.
## Changes
- Added HL7 v2.7 support to ADT channels- Updated transformers for new patient identifier format- Added validation for required demographics fields
## Testing
- Tested with sample HL7 messages- Verified FHIR output format- Checked error handling- Deployed to dev environment successfully
## Deployment Notes
- Requires updating ADT_PORT environment variable- New channel will be disabled by default, enable after deployment- Backup current production config before deploying
## Related Issues
Closes #42Refs #38, #40Code Review Checklist
Section titled “Code Review Checklist”Reviewers should check:
Functionality
- Does the channel do what it claims?
- Are edge cases handled?
- Is error handling adequate?
Code Quality
- Is transformer JavaScript clean and readable?
- Are there code comments for complex logic?
- Is there code duplication that could be extracted?
Testing
- Has this been tested with real/sample data?
- Are error conditions tested?
- Does it work in all target environments?
Documentation
- Are channel descriptions clear?
- Is transformer logic documented?
- Are deployment steps noted?
Security
- Are credentials properly handled?
- Is sensitive data logged?
- Are connections encrypted?
Deployment Workflows
Section titled “Deployment Workflows”Safe Deployment Process
Section titled “Safe Deployment Process”# 1. Ensure you're on the right branch./mirthsync.sh -t ./mirth-config git branch
# 2. Pull latest changes./mirthsync.sh -t ./mirth-config git pull
# 3. Review what will be deployed./mirthsync.sh -t ./mirth-config git log
# 4. Deploy to staging./mirthsync.sh -s https://mirth-staging.example.com:8443/api -u admin -t ./mirth-config --deploy-all push
# 5. Test in staging# Run smoke tests, verify channels...
# 6. If successful, deploy to production./mirthsync.sh -s https://mirth-prod.example.com:8443/api -u admin -t ./mirth-config --deploy-all push
# 7. Verify production# Check channels are running in Mirth Admin Console, test message flow
# 8. Tag the release (use native git)cd ./mirth-config && git tag -a v2.1.0 -m "Production release 2.1.0" && cd ..cd ./mirth-config && git push origin v2.1.0 && cd ..Rollback Procedure
Section titled “Rollback Procedure”If deployment goes wrong:
# Option 1: Revert to previous git commit./mirthsync.sh -t ./mirth-config git log # Find previous good commit./mirthsync.sh -t ./mirth-config git checkout abc123 # Commit hash of last good version./mirthsync.sh -s https://mirth-prod.example.com:8443/api -u admin -t ./mirth-config -f --deploy-all push
# Option 2: Use git revert (use native git - preserves history)cd ./mirth-config && git revert HEAD && cd .../mirthsync.sh -s https://mirth-prod.example.com:8443/api -u admin -t ./mirth-config --deploy-all pushTeam Collaboration Tips
Section titled “Team Collaboration Tips”Communication Practices
Section titled “Communication Practices”-
Before modifying a channel
Terminal window # Check commit history./mirthsync.sh -t ./mirth-config git log# Use native git for blamecd ./mirth-config && git blame channels/ADT_Inbound/channel.xml && cd ..# Communicate with that person before making changes -
Use draft PRs for work-in-progress
Terminal window gh pr create --draft --title "WIP: Lab integration" -
Tag team members for review
Terminal window gh pr create --reviewer @teammate1,@teammate2
Conflict Prevention
Section titled “Conflict Prevention”- Assign ownership - Specific team members own specific channels
- Communicate early - Mention in Slack/Teams when working on shared channels
- Pull often - Run pull multiple times per day
- Small commits - Commit frequently to reduce merge conflict size
- Code templates - Extract common logic to code templates to reduce duplication
Advanced Workflows
Section titled “Advanced Workflows”Cherry-Picking Changes
Section titled “Cherry-Picking Changes”Apply specific commits to other branches:
# You fixed a bug in feature branch, need it in main (use native git)./mirthsync.sh -t ./mirth-config git checkout maincd ./mirth-config && git cherry-pick abc123 && cd .. # Commit hash from feature branch./mirthsync.sh -t ./mirth-config git pushInteractive Rebase
Section titled “Interactive Rebase”Clean up commit history before merging:
# Squash last 3 commits into one (use native git)cd ./mirth-config && git rebase -i HEAD~3 && cd ..
# In editor, change "pick" to "squash" for commits to combine# Save and edit the combined commit messageSubmodules for Shared Code
Section titled “Submodules for Shared Code”If you manage multiple Mirth Connect instances:
# Create shared code templates repository (use native git)cd ./mirthsync-shared-templates && git init && cd ..
# Add as submodule to each project (use native git)cd ./mirth-config && git submodule add https://github.com/org/mirthsync-shared-templates shared && cd ..
# Update submodule in projects (use native git)cd ./mirth-config && git submodule update --remote && cd ..Troubleshooting Common Issues
Section titled “Troubleshooting Common Issues””I committed credentials!"
Section titled “”I committed credentials!"”# Remove from history (before pushing!) - use native gitcd ./mirth-configgit filter-branch --force --index-filter \ "git rm --cached --ignore-unmatch secrets.env" \ --prune-empty --tag-name-filter cat -- --allcd ..
# Add sensitive files to .gitignoreecho "*.env" >> ./mirth-config/.gitignoreecho "secrets.*" >> ./mirth-config/.gitignore./mirthsync.sh -t ./mirth-config git add./mirthsync.sh -t ./mirth-config --commit-message "Add secrets to gitignore" git commit
# Rotate the exposed credentials immediately!"Git says my XML is binary"
Section titled “"Git says my XML is binary"”# Add to .gitattributesecho "*.xml text diff=xml" >> ./mirth-config/.gitattributes./mirthsync.sh -t ./mirth-config git add./mirthsync.sh -t ./mirth-config --commit-message "Configure XML files as text" git commit"Too many merge conflicts”
Section titled “"Too many merge conflicts””Consider restructuring:
- Break monolithic channels into smaller ones
- Extract common logic to code templates
- Use channel groups to organize better
- Coordinate timing of changes to shared channels
Tools & Integration
Section titled “Tools & Integration”Git Hooks for Automation
Section titled “Git Hooks for Automation”Pre-commit hook - Run checks before commit:
#!/bin/sh# Check for common issues in channel files# Example: ensure no hardcoded passwordsif grep -r "password.*=.*['\"]" channels/ code-templates/; then echo "Possible hardcoded password found. Commit aborted." exit 1fi
# Run JavaScript linting on transformersnpm run lint --if-presentPre-push hook - Run tests before push:
#!/bin/sh# Run channel testsnpm test
if [ $? -ne 0 ]; then echo "Tests failed. Push aborted." exit 1fiGitHub/GitLab Integration
Section titled “GitHub/GitLab Integration”- Branch protection - Require PR reviews before merge
- Status checks - Require CI tests to pass
- CODEOWNERS - Auto-assign reviewers based on files changed
- Issue linking - Auto-close issues when PRs merge