Ocean Tips: The Basics of Rule Building

Ocean’s Rule functionality automates your form delivery – a particularly helpful feature if you’re a high-volume clinic rotating through different Ocean forms or simply want Ocean to do the work for you.

Clinics can use rules with Check-In Kiosks, Patient Tablets, Patient Reminders, and even within Ocean Forms to trigger certain actions. More specifically, they are lines of JavaScript code that instruct Ocean on how to carry out tasks on your behalf. Although it can sound complicated, our rule builder contains a glossary of terms you can use or you can get started with some of our rules below.

First things first, let’s break down this rule for automated Allergy Screening:

What are ScriptUtils?

ScriptUtil.getKeyword is the ScriptUtil function. These are helpful functions that retrieve information about the patients and their form responses. Not all rules require functions, but they are useful when you want to perform tasks like displaying the patient’s previous selections as they work through additional forms or triggering certain actions based on keywords like in the example above.

What are Keywords?

@ptReasonForVisit is the Keyword in this rule. Keywords allow you to specify what patient data from the chart you could like Ocean to retrieve. Addressing the form directly to the patient? Adding “Dear @ptPreferredOrFirstName” will appear as “Dear Doug” if “Doug” is in the EMR as the preferred or first name. In the example above, the key piece of data we want Ocean to recognize is the reason for visit.

Tip: Type “@” into a field to see a list of available keywords.

What else do I need to know?

() contain the keyword value which is needed to separate your terms
== meaning “equals”

Javascript requires the use of certain characters in order to make your rules function as intended. The () in the example above work like brackets in math equations (ie. BEDMAS.) If you have multiple rules and criteria linked together, && is used in place of “and.”

Tip: Our support article on the Basics of JavaScript goes over the symbols in more detail.

Allergy Screen is the appointment type/reason for visit. It’s interchangeable across all rules and corresponds to the appointment types set in your EMR.

In this example, patients who meet this criteria will automatically receive an email reminder one day before their appointment with an Allergy Screen form attached. This rule could also be added to a Patient Tablet, allowing a patient at the clinic for an allergy appointment to complete the form once they start their tablet session.

What else can Rules do?

Below, we’ve shared some more commonly-used rules and where they fit into your everyday workflow:

Patient Reminders:

For a specific provider’s patients who recently came in for a mental health visit, follow up and have them complete a PHQ-9 seven days after the visit

ScriptUtil.getKeyword(‘@providerName’) == ‘Dr. CognisantMD’ && ScriptUtil.getKeyword('@ptReasonForVisit') == 'Mental Health'
Check-In Kiosks:

At check-in, screen all of your patients over the age of 14 about their smoking status with a Smoking Screening Form

pt.getAge() > 14

As a best practice, we recommend using only short screening forms at check-in kiosks to minimize congestion and maintain a streamlined flow. For longer forms, consider using Patient Tablets.

Patient Tablets:

When a patient arrives for their annual examination, administer a Periodic Health Exam on a tablet to collect a full picture of their health. Do patients come for physicals every two years instead of one? Change the value from “365” to “730”

pt.getAge() > 30 && daysSinceLastCompleted > 365

Need help building your own rules? Reach out to our support team at ocean.tips/support and we’d be happy to help.