Setup
IDE Setup
Section titled “IDE Setup”Get up and running with your favorite IDE and MirthSync in just a few minutes. This guide works with any IDE or text editor.
Prerequisites
Section titled “Prerequisites”- MirthSync installed and configured
- A Mirth Connect or OIE instance to connect to
- Your preferred IDE or text editor installed
Step 1: Create Your Project Directory
Section titled “Step 1: Create Your Project Directory”Create a directory for your Mirth configuration files:
mkdir my-mirth-projectcd my-mirth-projectStep 2: Pull Your Configurations
Section titled “Step 2: Pull Your Configurations”Pull your current Mirth Connect or OIE configurations:
./mirthsync.sh pull -s https://server:8443/api -u admin -t .This creates a file structure like:
my-mirth-project/├── Channels/│ └── Default Group/│ └── My_Channel/│ ├── channel.xml│ └── sourceConnector.js├── CodeTemplates/│ └── My Library/│ └── template.xml└── GlobalScripts/Step 3: Open in Your IDE
Section titled “Step 3: Open in Your IDE”Open the project folder in your IDE:
VS Code:
code .Sublime Text:
subl .Other IDEs: Use your IDE’s File > Open Folder menu and select your project directory.
Step 4: Configure File Associations (Optional)
Section titled “Step 4: Configure File Associations (Optional)”Most IDEs will automatically recognize XML and JavaScript files. However, you may want to configure:
- XML files - Ensure proper syntax highlighting for channel.xml files
- JavaScript files - Enable JavaScript syntax for transformer scripts
- JSON files - For metadata.json and configuration files
VS Code Example
Section titled “VS Code Example”VS Code typically auto-detects file types, but you can add to .vscode/settings.json:
{ "files.associations": { "channel.xml": "xml", "*.xml": "xml" }}Most modern IDEs automatically detect file types. If needed, check your IDE’s settings for file type associations.
Step 5: Make Your First Edit
Section titled “Step 5: Make Your First Edit”- Navigate to a channel folder (e.g.,
channels/ADT_Inbound/) - Open
channel.xmlin your IDE - Find a JavaScript transformer section
- Make a small edit (add a comment, modify a variable)
- Save the file
You should see:
- Syntax highlighting for XML tags
- JavaScript syntax highlighting in transformer sections
- Proper indentation and formatting
Step 6: Review and Commit Changes
Section titled “Step 6: Review and Commit Changes”Use your IDE’s Git integration or command line:
# See what changed./mirthsync.sh -t . git status./mirthsync.sh -t . git diff
# Commit your changes./mirthsync.sh -t . git add./mirthsync.sh -t . --commit-message "Update-channel-transformer" git commitStep 7: Push Back to Mirth Connect
Section titled “Step 7: Push Back to Mirth Connect”Deploy your changes back to Mirth Connect:
./mirthsync.sh push -s https://server:8443/api -u admin -t .Your changes are now live in Mirth Connect!
IDE-Specific Guides
Section titled “IDE-Specific Guides”For optimized setups and advanced features:
- VS Code Setup - Extensions, settings, and workflows
Common Tasks
Section titled “Common Tasks”Search Across All Channels
Section titled “Search Across All Channels”Most IDEs support “Find in Files” or “Search in Project”:
- VS Code:
Ctrl+Shift+F(Windows/Linux) orCmd+Shift+F(Mac) - Sublime Text:
Ctrl+Shift+F(Windows/Linux) orCmd+Shift+F(Mac) - Most IDEs: Similar keyboard shortcuts or use Edit menu → Find in Files
Search for function names, variable names, or any text across all your channels and code templates.
Multi-file Editing
Section titled “Multi-file Editing”Many IDEs support editing multiple files simultaneously:
- Split panes to compare channels side-by-side
- Use multi-cursor editing for bulk changes
- Open related files in tabs for quick navigation
Git Integration
Section titled “Git Integration”Most modern IDEs have built-in Git support:
- View file changes with visual diffs
- Stage and commit from the IDE
- Browse commit history
- Create and switch branches