Reference
  • 28 Feb 2024
  • 7 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Reference

  • Dark
    Light
  • PDF

Article Summary

Clinical Expressions

Below is a list of supported Clinical Query Language (CQL) expressions:

CategoryExpressionDescription
Connectionsconnect patient {x}Connects a patient (via SSN, MR#, UID) to a storyboard. Useful for testing.
ConnectionsdisconnectClears all cached resources from a storyboard. Useful for testing.
IdentifiersssnReturns the patient's unique SSN.
IdentifiersmrnReturns the patient's unique medical record #.
IdentifiersuidReturns the patient's unique avatar identifier.
DemographicsdemosReturns the patient's core demographics.
Demographicsfull nameReturns the patient's full name.
Demographicsfirst nameReturns the patient's first name.
Demographicslast nameReturns the patient's last name.
DemographicsmiReturns the patient's middle initial.
DemographicstagReturns the patient's identification tag.
DemographicsageReturns the patient's current age.
DemographicsdobReturns the patient's data of birth.
DemographicsgenderReturns the patient's gender.
Demographicsgender shortReturns the patient's gender, in short form (M, F, U).
DemographicsaddressReturns the patient's current mailing address.
Demographicsline 1Returns line 1 of the patient's current mailing address.
Demographicsline 2Returns line 2 of the patient's current mailing address.
DemographicscityReturns the city of the patient's current mailing address.
DemographicsstateReturns the state of the patient's current mailing address.
DemographicszipReturns the zip code of the patient's current mailing address.
Demographicsprimary ethnicityReturns the patient's primary ethnicity.
Demographicssecondary ethnicityReturns the patient's secondary ethnicity.
DemographicsphonesReturns the patient's mobile, home, and work phone #s.
Demographicsmobile phoneReturns the patient's mobile phone #.
Demographicshome phoneReturns the patient's home phone #.
Demographicswork phoneReturns the patient's work phone #.
Demographicsmarriage statusReturns the patient's marital status.
Care Teamcare team [as csv]Returns the patient's care team members.
Care TeampcpReturns the patient's primary care physician.
Care Teampreferred providerReturns the patient's preferred provider.
PharmacypharmacyReturns the patient's preferred pharmacy name and phone #.
Pharmacypharmacy nameReturns the patient's preferred pharmacy name.
Pharmacypharmacy phoneReturns the patient's preferred pharmacy phone #.
Emergencyer contactReturns the patient's emergency contact information.
Emergencyer nameReturns the patient's emergency contact name.
Emergencyer relationshipReturns the patient's emergency contact relationship.
Emergencyer phonesReturns the patient's emergency contact mobile, home, and work phone #s.
Emergencyer mobile phoneReturns the patient's emergency contact mobile phone #.
Emergencyer home phoneReturns the patient's emergency contact home phone #.
Emergencyer work phoneReturns the patient's emergency contact work phone #.
Medicationsmeds [with time] [as csv]Returns a list of the patient's active medications.
Medicationstaking {x} medReturns whether or not the patient is actively taking the specified medication.
Vitalsrecent vitals [with time] [as csv]Returns the most recent value for each recorded vital sign.
Vitals[take #] {x} vitals [with time] [as csv]Returns a list of the specified vital sign's recorded values.
Vitals{x} vital [with time]Returns the most recent value of the specified vital sign.
Labsrecent labs [with time] [as csv]Returns the most recent value for each recorded lab.
Labs[take #] {x} labs [with time] [as csv]Returns a list of the specified lab's recorded values.
Labs{x} lab [with time]Returns the most recent value of the specified lab.
Allergiesallergies [with time] [as csv]Returns a list of the patient's known allergies.
Allergieshas {x} allergyReturns whether or not the patient has the specified allergy.
Scheduling{all, upcoming, completed, cancelled, no-show} [md, non-md] [telehealth] appointments [with providers] [with sites] [with time] [as csv]Returns a list of the patient's appointments.
Historydiseases [with time] [as csv]Returns a list of the patient's known diseases.
Historyprocedures [with time] [as csv]Returns a list of the patient's known procedures.
Historyfamily history [with time] [as csv]Returns a list of the patient's known family history.
Historysocial history [with time] [as csv]Returns a list of the patient's known social history.
Historyhistory of {x}Returns whether or not the patient has a history of the specified item.
Physical Examphysical exam [with time] [as csv]Returns a list of all findings during the patient's latest physical examination.
Physical Examobservation of {x}Returns the value of the specified item during the patient's latest physical examination.
Physical Examnormal observation of {x}Returns whether or not the specified item was identified as normal during the patient's physical examination.
Physical Examabnormal observation of {x}Returns whether or not the specified item was identified as abnormal during the patient's physical examination.
Problemsproblems [with comments] [with time] [as csv]Returns a list of the patient's current problems.
Problems{x} problem comments [with time]Returns the comments of the specified problem.
Problemshas {x} problemReturns whether or not the patient has the specified problem.
Recordsrecent records [with comments] [with time] [as csv]Returns a list of the patient's most recent records of each type.
Recordsrecent {x} record comments [with time]Returns the comments of the most recent specified record title. Supports partial titles.
Records[take #] {x} records [with comments] [with time] [as csv]Returns a list of the patient's records with the specified title. Supports partial titles.
Records[take #] {x} record {body, bodies}Returns the body(s) of the specified report title. Supports partial titles.
Recordssearch [all, recent] records with {criteria} [with time] [as csv] [take #]Returns records that contain the specified criteria in their title or comments.
Recordsselect [#] [token1,token2,...] from {x} records [with time] [as xml] [as json]Returns one or more data point values identified by the specified tokens (Needle ID, Object ID, Object Name, and Full ID tokens are supported). When a single token is specified, its value is returned from the latest record. When multiple tokens are specified, an array of corresponding values is returned from the same latest record. When # is specified, a single token is required and an array of # values of the same token is returned, spanning multiple records of the same type. When # is positive (+), recent values are returned. When # is negative (-), earliest values are returned. {x} supports starting and ending wildcards using * syntax.
Input Spacing

Input values (e.g. {x}) that contain spaces must replace these spaces with underscores. For example 'heart rate vital' must be specified as 'heart_rate vital'

Escape Character

When you have a storyboard input that includes a clinical expression that you don't want computed, simply add a '\' character before the start of your expression. For example '\gender' will instruct the clinical language to ignore this expression and the output will simply display the word 'gender'.

Full IDs

Full IDs are specified using AppID.ObjectID syntax. This syntax is useful when querying records composed of multiple apps (i.e. clinical notes).

Filters

Some clinical expressions support filters, which are used to filter, or reduce, the subject.

Below is a description of supported expression filters:

FilterDescription
[take #]Specifies the # of results to return. When positive (+), recent values are returned. When negative (-), earliest values are returned.
[using ai]Uses a generative AI image creation model.
[using atlas]Uses the Dr. Know Atlas medical imaging library.

Decorators

Some clinical expressions support decorators, which modify the returned results.

Below is a description of supported expression decorators:

DecoratorDescription
[with comments]Includes comments in the returned results.
[with time]Includes dates and/or times in the returned results.
[with providers]Includes provider information in the returned results.
[with sites]Includes site information in the returned results.
[as csv]Returns results as a comma-separated list.
[as xml]Returns results as an Xml document.
[as json]Returns results as a Json document.

Examples

Below are some example clinical language expressions:

Prompt: Hello, {{first name}}! You are {{age}} years old.
Output: 'Hello, John! You are 45 years old.'
Prompt: {{ take 3 heart_rate vitals }}
Output: The most recent 3 recorded heart rate values.
Prompt: {{ upcoming md appointments with time }}
Output: A numbered list of upcoming physician appointments, including dates and times.
Prompt: {{ plot bmi vitals }}
Output: A plot of all recorded BMI vital sign values.
Prompt: {{ select [token1] from echo* records }}
Output: The value of token1 from the latest record that starts with 'echo'.
Prompt: {{ select [token1,token2] from echo records }}
Output: An array containing [valueToken1,valueToken2] from the latest echo record.
Prompt: {{ select 3 [token1] from echo records with time }}
Output: An array of 3 token1 values from the latest 3 echo records, including timestamps.

What's Next