IMPORTANT: This only works on localhosted mirth instances
This project gives us the ability to write JavaScript within VSCode and automatically run the channel after the file has been saved. It will then take the logs printed out and display them in the Run On Save Output.
- Python (3.10 >)
- Local Mirth Instance
- Download this repository
- Run
pip install -r requirements.txt
in console - Create your test js file within the repository folder.
- Create channel within Mirth and edit the transformer to be an external script.
- Add the location of the test js file to the external script transformer.
- Create your test message on your local machine.
- Within VS Code, download the Run On Save extension by emeraldwalk
- Open Command Palette (Ctrl + Shift + P)
- Search for "Preferences: Open Workspace Settings (JSON)"
- Add the following json
{
"emeraldwalk.runonsave": {
"commands": [
{
"match": ".*.js",
"isAsync": true,
"cmd": "py run_javascript.py -cid {channel_id} -msg {message_file_location}"
}
]
}
}
- replace {channel_id} with the channel id you intead to deploy and send a message to
- replace {message_file_location} with the file location with the message you want to send
- Write your script within the test js file and save and watch it log out the logs for your channel within the Run On Save Output view.