Content
Navigating to the Signature RichText Object Template in zCustom Forms
Using the Signature RichText Object Template
Deciphering which Load Macro is Being Used on the Form
Navigating to the FormPreloadMacro
Modifying to the FormPreloadMacro
Navigating to the AccelEMR_FormAutoLoad
How to Modify the AccelEMR_FormAutoLoad
How to add Multiple Signatures on the same Form
Background
During form development, you may be asked to create a digital signature box with the ability to auto populate the logged in Clinician's Digital Signature (if one exists in their User Account). This article outlines the current standards and instructions on how to complete this task using the Signature RichText Object Template on zCustom Forms and how to modify the existing Load Macro on the form to call the centralized Resize Macro.
Important Note: We have designed the Resize Signature Macro to live in a central location (Maintain, Templates, Macros) that is called and run by the load macro. This enables us to change the Resize Signature Macro from a central location instead of going into each form to change the functionality in the future.
Macro Fundamentals
Below is a list of terminology that you should know prior to starting your journey of creating the digital signature box and macro writing.
Statement
A single line of code that expresses an action to be carried out.
If Statement
Tells the macro what to do with certain information. Also known as the beginning of an instruction.
Else statement
Used to do something else when the condition in the if statement isn't true. Also known as subsequent instruction based on the if statement.
Open Ended Apostrophe at the beginning of a Statement
Special Character Formation used to transform a line of code into text that will not be triggered when a macro is run.
Indentation
Indentation is the visual structure of how your code is laid out. In the Macro Editor, we use spaces to organize code into a hierarchy. Having correct indentation (spaces) is a crucial aspect for the macro to run properly.
Navigating to the Signature RichText Object Template in zCustom Forms
- Go to Maintain, Templates, Health Record Collection Templates
- The CDO Explorer window will open up. Under All Folders segment, click on the VCH folder.
- The Contents of VCH segment will display all the forms that live within the VCH folder.
- Navigate to zCustom Form Template and double click to launch.
- The VCH\zCustom Forms Template window should now appear. Click on the Open form editor button.
- The zCustom Forms Template should now appear. Navigate to and click on the rectangular box. This is the Signature RichEdit Object Template that you want to use.
Note: This Signature RichEdit Box Template already has the Auto Populate Signature Print Variable added to it in the Object Inspector Properties.
Using the Signature Box RichText Template
Now that you know how to find the Signature RichText Object Template. There are two methods that you can conduct to use:
Method 1
You can copy and paste the Signature Box RichText Object Template to a new or existing form. Then follow the steps below.
Method 2
You can start building out your form request from zCustom Forms template. In this case, you would just need to move the Signature Box RichText Object Template to the desired location on the form and ensure that the Signature Box RichText Object corresponds to the Object in the Load Macro.
Gentle reminder: To always make a copy of the zCustom Form Template into your Development folder before you start building out your form request.
Deciphering which Load Macro is Being Used on the Form
After you have decided which method you will be using to develop the Signature box, you will need to locate the Load Macro on the form you are working on. To do this follow the steps below:
- Navigate to the Form Building Tools window. Click on the Open form editor button.
- This will open up the form and all the relevant tools you will need when building your form. Locate the Object Inspector and bring it to focus on your screen. Click on the First Object or Title Caption that appears in the Object Inspector.
- Then click on the Events tab and locate the "OnMPreload" or "OnMOpen" field. This is where you will find the Load Macro that form uses. There are two Load Macro that can appear here:
FormPreloadMacro
AccelEMR_FormAutoLoad
Creating a FormPreloadMacro
There will may be times when you will notice that a form does not have a Load Macro. In this scenario, you will need to create one by following the steps below:
- Navigate to the Form Building Tools window. Click on the Open form editor button.
- This will open up the form and all the relevant tools you will need when building your form. Locate the Object Inspector and bring it to focus on your screen. Click on the First Object or Title Caption that appears in the Object Inspector.
- Then click on the Events tab, scroll down navigate to "OnMPreload" and click on the drop down to select FormPreloadMacro.
- Once selected, double click on FormPreloadMacro to access the Macro Editor
- In the Body of the FormPreloadMacro, copy and paste the following to enable the resize macro for the RichEdit Signature Box.
If Form.IsNew Then
Set varForm = Profile.DeclareStackableVariable("CALLING_SIGNATURE_FORM")
Set varForm.Value = Form
Form.Vars("FORM_SIGNATURE_NAME") = "reSignature"
Profile.CallMacro "RESIZESIGNATURE"
End If - The Form.Vars statement tells the macro what object to run the Resize Macro on. If the name of the Signature Box is different then what appears in blue below, update it to reflect the correct name that appear in the Object Inspector, Properties tab for the Signature Box on the form you are working on.
- Form.Vars("FORM_SIGNATURE_NAME") = "reSignature"
IE. In the form development image above, notice the name of the Signature Box is RichEdit1. In this scenario, you would want to change the first statement to look at the RichEdit Object. Like this: Form.Vars("FORM_SIGNATURE_NAME") = "RichEdit1"
- Form.Vars("FORM_SIGNATURE_NAME") = "reSignature"
- Click on the
"Save Macro" Button to save your work.
- The Signature Box should now pull in the signature of the logged on clinician. Test the form using a clinician that has a digital signature in there user account to ensure this functionality is working.
Navigating to the FormPreloadMacro
Now that you know which Load Macro is being used on the Form, you will need to modify it to contain the two statements that will automatically resize the signature to fit into the signature box as well as tell the macro which object contains the signature that needs to be resized.
- From the Form Building Tool Window.
- Click on the "Open macro editor" button.
- The Form Macro Editor window will appear. Click on the "Macro Name:" dropdown and use to scrollbar to look for the FormPreloadMacro.
- Clicking on FormPreloadMacro will trigger the macro to appear in the body of Form Macro Editor.
Modifying the FormPreloadMacro
- Use to scrollbar to scroll down the body of the macro. Look for the following If and Else statement: If Form.IsNew Then .... Else as seen in image below.
- Validate if the following Resize Signature statements appear in between the If - Else Statement identified in step 1:
If the two statement exist:
- Then, you will need to determine if the function is currently set to run in the macro. To determine this quickly, you will need to look for two things:
- If there is an apostrophe (') at the beginning of the statements and if the text color appears green. This means that the statements are not set to run in the macro and the text is only informational text for the macro reader.
- If there is an apostrophe (') at the beginning of the statements and if the text color appears green. This means that the statements are not set to run in the macro and the text is only informational text for the macro reader.
- To enable to two statement functions, you need to remove the apostrophe (') at the beginning of these statements. Once you do this, the text will now appear black and red in color. This means that the statements will be triggered when the macro is run.
NOTE: Ensure the statements are indented within the If and Else Statement. Having correct indentation (spaces) is a crucial aspect for the macro to run properly.
- The Form.Vars statement tells the macro what object to run the Resize Macro on. If the name of the Signature Box is different then what appears in blue below, update it to reflect the correct name that appear in the Object Inspector, Properties tab for the Signature Box on the form you are working on.
- Form.Vars("FORM_SIGNATURE_NAME") = "reSignature"
IE. In the form development image above, notice the name of the Signature Box is RichEdit1. In this scenario, you would want to change the first statement to look at the RichEdit Object. Like this: Form.Vars("FORM_SIGNATURE_NAME") = "RichEdit1"
- Form.Vars("FORM_SIGNATURE_NAME") = "reSignature"
- Click on the
"Save Macro" Button to save your work.
- The Signature Box should now pull in the signature of the logged on clinician. Test the form using a clinician that has a digital signature in there user account to ensure this functionality is working.
If the two statements do not exist:
- Then you will need to go to copy and paste the Resize Signature statements in between the If Form.IsNew Then .... Else statement.
- Ensure the statements are indented within the If and Else Statement. Having correct indentation (spaces) is a crucial aspect for the macro to run properly.
- Ensure the apostrophe (') at the beginning of these statements have been removed.
- The text should appear black and red in color. This means that the statements will be triggered when the macro is run.
- The first statement tells the macro what object to run the Resize Macro on. If the name of the Signature Box is different then what appears in blue below, update it to reflect the correct name that appear in the Object Inspector, Properties tab for the Signature Box on the form you are working on. Form.Vars("FORM_SIGNATURE_NAME") = "reSignature"
For example, in the form image above, notice the name of the Signature Box is RichEdit1. In this scenario, you would want to change the first statement to look at the RichEdit Object. Like this: Form.Vars("FORM_SIGNATURE_NAME") = "RichEdit1"
- Click on the
"Save Macro" Button to save your work.
- The Signature Box should now pull in the signature of the logged on clinician. Test the form using a clinician that has a digital signature in there user account to ensure this functionality is working.
Navigating to AccelEMR_FormAutoLoad
- From the Form Building Tool Window.
- Click on the "Open macro editor" button.
- The Form Macro Editor window will appear. Click on the "Macro Name:" dropdown and use to scrollbar to look for the AccelEMR_FormAutoLoad.
- Clicking on AccelEMR_FormAutoLoad will trigger the macro to appear in the body of Form Macro Editor.
Modifying the AccelEMR_FormAutoLoad
- Use to scrollbar to scroll down the body of the macro. Look for the following If and Else statement: If Serial ... and Else Statement
- Validate if the following statements appear between the If - Else Statement:
If the two statement exist:
- Then, you will need to determine if the function is currently set to run in the macro. To determine this quickly, you will need to look for two things:
-
- If there is an apostrophe (') at the beginning of the statements and if the text color appears green. This means that the statements are not set to run in the macro and the text is only informational text for the macro reader.
- If there is an apostrophe (') at the beginning of the statements and if the text color appears green. This means that the statements are not set to run in the macro and the text is only informational text for the macro reader.
-
- To enable the statement functions, you need to remove the apostrophe (') at the beginning of these statements. Once you have removed the apostrophe, the text color will change to black and red. This means that the statements will be triggered when the macro is run.
NOTE: Ensure the statements are indented within the If and Else Statement. Having correct indentation (using spaces) is a crucial aspect for the macro to run properly.
- The Form.Vars statement tells the macro what object to run the Resize Macro on. If the name of the Signature Box is different then what appears in blue below, update it to reflect the correct name that appears in the Object Inspector, Properties tab for the Signature Box on the form you are working on.
- Form.Vars("FORM_SIGNATURE_NAME") = "reSignature"
For example, in the form image above, notice the name of the Signature Box is RichEdit1. In this scenario, you would want to change the first statement to look at the RichEdit Object. Like this: Form.Vars("FORM_SIGNATURE_NAME") = "RichEdit1"
- Form.Vars("FORM_SIGNATURE_NAME") = "reSignature"
- Click on the
"Save Macro" Button to save your work.
- The Signature Box should now pull in the signature of the logged on clinician. Test the form using a clinician that has a digital signature in there user account to ensure this functionality is working.
If the two statements do not exist:
-
- Then you will need to go to copy and paste the statements in between the If Form.IsNew Then .... Else statement.
- Ensure the two statements are indented within the If and Else Statement.
- Ensure the apostrophe (') at the beginning of these statements have been removed. The text should appear black and red in color. This means that the statements will be triggered when the macro is run.
- If text appears green, remove the apostrophe (').
- The Form.Vars statement tells the macro what object to run the Resize Macro on. If the name of the Signature Box is different then what appears in blue below, update it to reflect the correct name that appear in the Object Inspector, Properties tab for the Signature Box on the form you are working on.
- Form.Vars("FORM_SIGNATURE_NAME") = "reSignature"
For example, in the form image above, notice the name of the Signature Box is RichEdit1. In this scenario, you would want to change the first statement to look at the RichEdit Object. Like this: Form.Vars("FORM_SIGNATURE_NAME") = "RichEdit1"
- Click on the
"Save Macro" Button to save your work.
- The Signature Box should now pull in the signature of the logged on clinician. Test the form using a clinician that has a digital signature in there user account to ensure this functionality is working.
- Then you will need to go to copy and paste the statements in between the If Form.IsNew Then .... Else statement.
Add Multiple Signatures on the same form
Some forms have multiple pages and they could require signatures more than once. In order to auto-size all signature boxes use the last two lines of the code:
Form.Vars("FORM_SIGNATURE_NAME") = "RichEdit1"
Profile.CallMacro "RESIZESIGNATURE"
Form.Vars("FORM_SIGNATURE_NAME") = "RichEdit2"
Profile.CallMacro "RESIZESIGNATURE"
Make sure to enter the correct name of the Signature Box ("RichEdit2") as described in above section. If you require more signature boxes on the same form, repeat the two lines again and add the name of the Signature Box that you need to resize.