The activity_type_id
and encounter_with_id
columns in myEvolv’s Event Log table can come in handy when you are configuring events in myEvolv. If you don’t need to use these columns for their intended purpose, they are easily repurposed to hold other values and since they are event log fields, they can be pulled into the canned reports easily.
The picklist values for these two columns are configured in the Table Maintenance – Extended area of the Setup module.
You will notice that unlike the other lookup tables in myEvolv, these two have a Filter Code column.
Since these lookup tables are connected to Event Log fields that will be available to all events, the picklist could end up holding many more values than would apply to certain events or just more than you would want to display for a particular event. myEvolv provides the Filter Code column so that you can filter the picklist options on particular forms. The following is a guide for how to configure a filtered picklist.
Configure the Lookup Table
In my example, I am going to use the activity_type_id
column to capture the method by which a clinician has contacted a family: Phone, Email, Text Message or In-Person
In the table maintenance for Services: Activity Types for Clients, I add an entry for each option and give all of the options a Filter Code of FN_ACT_TYPE
Configure Form
Without filtering, I have the activity_type_id
field on my form with the Activity Types for client services Look-up Table selected. When I go to open the picklist, I see the activity type look up table with all active options. The clinicians will need to search through the whole list to find one of the intended options.
In order to apply the filter, I first need to add a variable to the form. The variable should have a regular string Data Type. In my example, I have given the variable the name activity_type_filter
and a caption of FN_ACT_TYPE. The variable also has a default value of ‘FN_ACT_TYPE’ (remember to include the single quotes when setting the default value). The default value must match the filter code that you used in the lookup table. I also toggled the Is Visible setting off so that it is not shown on the form.
Next I need to make the activity_type_id
field on the form depend on the value of the variable.
In the Depends On (other) attribute, I add the following code:
getElementFromXML(formXML, 'activity_type_filter')
Note that the second argument is the name of the variable I created.
Now when I go to open the picklist, I will only see the options that have the filter code “FN_ACT_TYPE”.
Canned Reports
Because I used the activity_type_id
, the values in this field will show up in many of the canned reports in myEvolv.
This was QUITE helpful, thanks Dean!!!
Before stumbling upon this post I had gone with a different trick, using Javascript in an on change field to enforce a range I wished. In the example below I was enforcing the use of items which began with the text “Group of “:
var ewId = getFormElement(‘encounter_with_id’);
if (ewId !== ”) {
var atDescr = getDataValue(‘encounter_with’, ‘encounter_with_id’, ewId, ‘description’);
if (atDescr.search(‘Group of ‘) >= 0) {
} else {
setFormElement(‘encounter_with_id’);
alert(‘You must choose an option which starts with the text Group of’);
}
}
This is SO HELPFUL! With so many programs and reasons they are each using the activity type field, it’s really nice (and decreases human error) to have it filter. Thanks for this!