Configure Personal Reporting Macros (Advanced)

Make reporting in Cimar easier and faster by utilising your own personal macros. Define keyboard shortcuts or create a clickable dropdown to automatically populate report fields with text decided by you.

For simpler config please see the simple macro guide

Creation of an advanced macro will require using/editing JSON data and using the developer console of your web browser. If this is not something you are familiar with please contact your account administrator for further help.

Create an Advanced Report Macro

Follow steps 1-4c the same as a standard macro

  1. Click the Edit as JSON checkbox

  2. Choose template

    1. With the JSON checkbox checked all possible report templates will be available

      1. If you are unsure of which template you are using please contact your account administrator

  3. Paste your valid JSON config in the text box

  4. Click Save

How to Construct JSON for Keyboard Shortcut Activated Macro

Only for Windows Users

If the template you are using is not provided in the default list you can still create a keyboard shortcut activated macro by using JSON.

The macro is created with a JSON object containing keys corresponding to the ID of the respective input/textarea HTML element and values with the text you would like to add into these elements.

Example 1 - JSON for ‘Report with Addendum’ template

{
  "report_id":"DG0000005",
  "text-input-1":"Example Text",
  "text-input-2":"Example Text\n\nWith a Line break",
  "body":""
}
		

Example 2 - JSON for ‘Report with Addendum’ template with HTML Reporting

If the role permission Radiology reports: Allow HTML in reports is turned on for your role HTML tags may be used in the text.

{
  "report_id":"DG0000005",
  "text-input-1":"<b>Example Text</b>",
  "text-input-2":"<i>Example Text</i><br><br>With a Line break",
  "body":""
}
		

How to Create Clickable Macro in UI

This is the only available personal macro for MacOS user’s currently

Many times you will have more than 9 potential macros for a report or you prefer to click a macro from a dropdown rather than using a keyboard shortcut. By using this macro you can create a dropdown list in the reporting view.

The macro is a JSON object containing a list of presets, of which contain a list of actions. These actions are where you can define the input/textarea you want to update with your predetermined text.

The presets key is a JSON list of presets. Each preset will create a new element in the report and contain a list of items to update the report with.

Each item in a preset will either contain a list of actions or another list of items . Actions will update the report with the defined text and items will create infinite levels of dropdowns. Each item contains a value key whose value determines the name of the item shown in the report. An item also contains the data-overwrite key. When set to <span class="inline-comment-marker">true</span> the actions of the item will overwrite any text currently contained in the elements they are updating. If set to <span class="inline-comment-marker">false</span> it will append the text to the end of what is currently writing in the element.

Each action has a selector key where the value is the ID(s) of the HTML element you want to update. If you want to update multiple elements with the same text separate each ID with a comma (all within the same quotation marks). Each action also has a value key where the value is the text you want to update the element with.

Example 1 - One Preset with two items - Clear Report

This example was created for the ‘Report with Addendum’ template. It appears like the screenshot above and provides two potential macros to select from. One will clear both the text fields in the report the other will populate them with data.

{
  "bypassForm": "<form>",
  "anyModality": "true",
  "presets": [
        {
            "name": "Report Presets",
            "items": [
                {
                    "value": "Clear report",
                    "data-overwrite": "true",
                    "actions": [
                        {
                            "selector": "#text-input-1, #text-input-2",
                            "value": ""
                        }
                    ]
                },
                {
                    "value": "Normal report",
                    "data-overwrite": "true",
                    "actions": [
                        {
                            "selector": "#text-input-1",
                            "value": "This is a basic example."
                        },
                        {
                            "selector": "#text-input-2",
                            "value": "This is a basic example too."
                        }
                    ]
                }
            ]
        }
    ]
}
		

Example 2 - Multiple Presets with Multilevel Dropdowns

This example was created for the ‘Report with Addendum’ template. In this example multiple presets are defined with one containing a sub dropdown.
{
  "bypassForm": "<form>",
  "anyModality": "true",
  "presets": [
        {
            "name": "Clear Report",
            "items": [
                {
                    "value": "Clear Report",
                    "data-overwrite": "true",
                    "actions": [
                        {
                            "selector": "#text-input-1, #text-input-2",
                            "value": ""
                        }
                    ]
                }
            ]
        },
        {
            "name": "Normal Report Presets",
            "items": [
                {
                    "value": "Normal report 1",
                    "data-overwrite": "true",
                    "actions": [
                        {
                            "selector": "#text-input-1",
                            "value": "This is a very basic example."
                        },
                        {
                            "selector": "#text-input-2",
                            "value": "This is a pretty basic example too."
                        }
                    ]
                },
                {
                    "value": "Normal report 2",
                    "data-overwrite": "true",
                    "items": [
                        {
                            "value": "Sub Normal Report 2",
                            "data-overwrite": "true",
                            "actions": [
                                {
                                    "selector": "#text-input-1",
                                    "value": "This is a great basic example.\n\nWith a line break"
                                },
                                {
                                    "selector": "#text-input-2",
                                    "value": "This is a basic example too."
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}
		

How to Retrieve HTML Element IDs & Report ID

To retrieve the HTML element ID of each input/text field you will need to inspect the page through your browser’s developer console. Most browsers if you right-click on the element you want to inspect an ‘Inspect Element’ option will appear.

Alternatively:

  • Chrome: View → Developer → Inspect Elements

  • Safari: Develop → Show Web Inspector

  • Firefox: Tools → Web Developer → Inspector

Text field/Input Element IDs

When in the inspector locate the text field/input you wish to update and take note of it’s ID field.

If the HTML reporting permission is on there will be an iframe element above the textfield elements. Although the textfield is not displaying the textfield’s ID will still update the iframe’s data.

Report ID

Within the inspector look for a div element with the id report-body. The attribute data-dicomgrid-report-type will contain the report’s ID.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us