Skip to main content

How To: Filter Activity Type and Encounter With Picklists

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.

activity-type-encounter-with-luts

You will notice that unlike the other lookup tables in myEvolv, these two have a Filter Code column.

filter-code-highlighted

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

activity-type-lut-with-filter-code

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.

unfiltered-picklist

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.

variable-properties

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.

activity-type-properties

Now when I go to open the picklist, I will only see the options that have the filter code “FN_ACT_TYPE”.

filtered-picklist

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.

canned-report-activity-type

Dean

Dean is a System Administrator at The House of the Good Shepherd in Utica, NY. He has been working with the myEvolv application since 2013.

3 thoughts to “How To: Filter Activity Type and Encounter With Picklists”

  1. 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’);
    }
    }

Leave a Reply

Your email address will not be published. Required fields are marked *

We are using cookies on our website

Please confirm, if you accept our tracking cookies. You can also decline the tracking, so you can continue to visit our website without any data sent to third party services.