Loading...
A JSDoc is a type of comment block used to annotate JavaScript scripts. For code templates in Mirth® Connect, this is used not only for good documentation, but also for the code template description and the information that shows up in the auto-completion dialog in the JavaScript Editor.
When you create a new code template, a sample JSDoc is created for you:
The first portion of the comment block is used for the description of the code template, and may contain multiple lines and blank lines. Following that, you can include any JSDoc annotations, your own custom annotations, or whatever you want, as long as it follows correct JavaScript syntax. Only the following annotations are recognized by Mirth Connect for the purpose of populating the auto-completion dialog in the JavaScript Editor:
@param {Type} Name - Description
Note that the type doesn't have to be an actual JavaScript type. It can be anything you want as long as it doesn't contain the "{}" characters, like "MyObject", "String/Number", etc.
@return Description
If you change the names or number of arguments in your function, you can use the Update JSDoc button at the bottom of the editor. This will automatically inject or update @param annotations as needed, after which you can change the Type and Description as needed.
Once you have filled out your JSDoc appropriately, the function appears in the auto-completion dialog accessible from the JavaScript Editor: