Useful SmartLinks for Builders

This section draws attention to a few SmartLinks that allow Builders to accomplish data retrieval, formatting and analysis steps. Some SmartLinks enable text automation results not supported by typical Foundation SmartTools.

CERMSG, CERMSGREFRESH - Rule Conditional Text (HHS 64343, 14042)

This SmartLink allows one or more (CER) rules to be evaluated and either the associated error messages or specified SmartTexts to be returned to the hosting document. The SmartLink does not support embedded parameter settings. Parameters include rule identifiers, SmartText identifiers and settings affecting result formatting. There is little value in replicating this SmartLink. However, it can be embedded in SmartPhrases with all needed user-provided settings so that the SmartPhrase represents exactly how the builder intends CERMSG to behave.


CUIPAT, CUIENC - Retrieve Patient-level SmartData (HHS 224)

SmartData is often associated with FlowSheets, SmartForms and other documentation automation tools. Indeed, SmartData elements can be defined for a specific documentation purpose, adding to the vast number of already defined data variables and definitions in the Epic system. When there a need to pull a SmartData value into a documentation tool, the CUI class of SmartLinks can help. CUIPAT is pre-set for patient-level SmartData, whereas CUIENC for encounter-level data and CUIEPI for episode-level data. The configuration settings are similar.

  1. Context: 2 (default) = patient-level data, 1 = episode-level data, null = encounter level data

  2. NoVal: text to return if no value is found (default is null and nothing returned)

  3. Delimiter: how to delimit multi-select data if returned, with null defaulted (delimit with newline) and a character required if data should be concatenated on a single line

  4. Comment label: optional text to appear in front of any user comment that may be entered in association with the SmartData element, such as "Comment: " (note need for trailing space)

  5. SmartData identifier: in form "EPIC*123" for SmartData element EPIC#123. Three additional specifications can be specified, separated by commas:

    • Data display options (which can be combined):

      • N (only display label if data evaluates as 1)

      • L (always display label)

      • C (display comment)

      • V (display value and comment)

      • E (look back to previous encounters to find a value)

      • M (display a message if no value found)

      • B (break to next line if data exists)

      • D (display multi-line data on a single line separated by specified delimiter)

      • P (if displaying data filed from SmartForms)

    • Label text: using asterisk to separate text words, such as "Patient*pronoun*preference:*" for "Patient pronoun preference: "

    • Data mapping: optional substitution of a display value ('From', included in return from SmartLink and data value ('To', captured by SmartForm or other data-entry tool). Separate the From and To text with a colon (:). For example, 1:True:0:False, 1 appears as True and 0 appears as False. This is useful for lists where the SmartData element name is stored as the data value. Instead of displaying the element name, you can map the name to a suitable display value.

  6. Multi-data selection: Determines which values appear in the SmartLink. When this parameter is set to 1, only the last value specified appears. When it is set to -1, only the first value specified appears. When it is null (""), as released, all values appear. Note that the second piece of the SmartLink's fifth parameter (or the second piece of the user-defined parameters, depending on your configuration) determines whether values from only the current encounter are checked or whether past encounters are checked when no values have been filed in the current encounter. Past encounters can be checked when an E is included in this piece. Otherwise, only the current encounter is checked.

  7. Data format: Determines any special formatting needed for the data pulled in by the SmartLink. This parameter should be set when displaying data captured using a SmartForm Instant component or a SmartForm Field component with type Date Entry or Time Entry. Enter 3 in this parameter if the SmartLink is displaying a date, enter 4 for a time, or enter 11 for an instant.

Example:

  • @CUIPAT(2,not indicated,;,Comment: , EPIC*94483)@

  • POCOVHOMEOXYGEN (copied and configured from CUIPAT) uses this code:

      • d getCUI^LUPPDB34("2","home oxygen status unknown",", ","","EPIC*19601,EMDP,,1:on home oxygen:0:not on home oxygen","","")

DBLINK - Retrieve Data from Master Files (HHS 38001)

There may be a need to pull a specific item of information into SmartText or SmartPhrases but no currently available SmartLink capturing that data. A new SmartForm may be developed, for example, with no Foundation SmartLinks configured to work with the SmartData elements in that SmartForm.

User Entered Simple

DBLINK can be used as-is. When the link is inserted into SmartText, SmartPhrase or documentation objects, it accepts the following parameters:

  1. Master File: (required) 3 letter INI code for the Master file where the data resides

  2. Item Identifier: (required) numeric code for the specific data item in the Master File

  3. Line Number: (optional) if returned data is multi-response, optionally retrieve a specific line (option) from the data. Default (null) is to retrieve all.

  4. Property Number: (optional) where a master file record contains multiple properties (e.g., title, abbreviation, title and number, etc.) indicate which data property or format to return. See SmartLink description for more details.

    • Typical property numbers for category items are:

      1. Title

      2. Abbreviation

      3. Title and Number

      4. Abbreviation and Number

      5. Category Number

    • Other properties are specific to what is returned. For example, Date: X^ where X is the date format item in Category list E4K 1010 and time formats are in E4K 2010

  5. Format: (optional) to select a format for returned text:

    • Sentence case

    • Title Case

    • lower case

    • UPPER CASE

  6. Null return: (optional) default text to be shown if there is no data stored in the item. Enter a short text message without use of quotation marks.

Example

  • @DBLINK(EPT,131,,1,3,not indicated)@ OR .DBLINK[EPT,131,,1,3,not indicated

    • Returns patient sexual orientation (data stored at patient level in EPT item 131)


SmartLink Advanced

A new SmartLink can be created with options for more precise controls. This may be indicated if there is a database element frequently needed and not otherwise supported by available SmartLinks.

To use this method, set up the SmartLink without a code template or user-entered parameters. Enter the link code in the format that uses 13 parameters:

  • d DBLink^HUPPDB3("","","","","","","","","","","","","")

Parameters:

  1. Master File: (required) 3 letter INI code for the Master file where the data resides

  2. Item Identifier: (required) numeric code for the specific data item in the Master File

  3. Line Number: (optional) if returned data is multi-response, optionally retrieve a specific line (option) from the data. Default (null) is to retrieve all.

  4. Property Number: (optional) where a master file record contains multiple properties (e.g., title, abbreviation, title and number, etc.) indicate which data property or format to return. See SmartLink description for more details.

    1. Typical property numbers for category items are:

      1. Title

      2. Abbreviation

      3. Title and Number

      4. Abbreviation and Number

      5. Category Number

    2. Other properties are specific to what is returned. For example, Date: X^ where X is the date format item in Category list E4K 1010 and time formats are in E4K 2010

  5. Format: (optional) to select a format for returned text:

    1. Sentence case

    2. Title Case

    3. lower case

    4. UPPER CASE

  6. Truncation: optional number to limit the length of a returned string to the specified number of characters

  7. Special parameters available only if CVG, EPM, EPP or RFL master files are used (see DBLINK descriptors)

  8. Special record pull parameters available only if CVG, EPM, EPP master files used (see DBLINK descriptors)

  9. Use to prevent forcing default truncation if nothing entered in 6th parameter. If set to "1", data returned is not truncated if parameter 6 is not specified.

  10. Use to prevent control how multi-line items respond with "1" used to put multiple lines each on their own line.

  11. Used only with BED, ROM, DEP master files (see DBLINK descriptors)

  12. Default text to display if no value is returned

  13. Used to restrict multiline return to only the one line (if set to "1") as opposed to all lines after the value set in parameter 3.

Example

  • d DBLink^HUPPDB3("EPT","34117","","1","","","","",1,1,"","No provider teams assigned","")


DELRECITEM

Displays delivery information stored in an item in a delivery record. The SmartLink has the following parameters which can be user-entered or SmartText/SmartPhrase specified. Commonly used parameters:

Template: @DELRECITEM(HSB,NNN,,,,,,,,,,,,,)@

  1. Specifies the master file INI to reference. To show information from a delivery record, enter HSB by default.

  2. Specifies the item number (NNN) in the master file for which to show information. Use the Record Viewer to find item numbers. Common ones include:

    • Delivering provider: 35322
    • Delivery date: 35159
    • Delivery method: 35413
    • Anesthesia: 35317
    • Lacerations: 35157
  3. Specifies which line to show if the specified item is multiple response. If left blank, all lines appear. Enter a line number to show only data from that line. For example, to show the number of rupture dates recorded in a delivery record (item HSB 35130), enter .DELRECITEM[HSB,35130,0.

  4. Determines what appears for the specified master file and item. This parameter is needed only if the item specified is a category item, networked item, or the name of a master file record (.2 item).

      1. If the item is a category item, the available options are:
        1 - Title
        2 - Abbreviation
        3 - Title and Number
        4 - Abbreviation and Number
        5 - Category Number
      2. If the item is networked to another master file, the available options are:
        15 - Record ID
        16 - Record Name
        17 - Record Name and ID
      3. If the item is a .2, the available options are:
        11 - First Name Last Name
        12 - Last Name, First Name
        13 - First Name Last Name and ID
        14 - Last Name, First Name and ID
      4. If the item is a number, the available options are:
        20 - Financial format
        21 - Interval format
      5. If the item is related to a weight or height measurement, the available options are 22 - Weight format and 23 - Height format, respectively. If you use values 22 and 23, the units are based on your profile and system-wide settings for units. The following logic is used to determine which units appear for weight and height:
        - If there is a unit specified for the patient's age on the Weight Validation or Height Validation screens in the user's profile, that unit is used.
        - If there is no unit specified in those locations and there is a unit specified for the patient's age on the Weight Settings or Height Settings screens in EMR System Definitions, that unit is used.
        - If there is no unit specified in those locations and there is a unit specified in the Height and Weight field on the Unit Display and Entry screen in the user's profile, then that unit is used.
        - If there is no unit specified in that location and the Use Metric Units Only? field is set to Yes in your Epic Country Definitions (E4K) record, metric units are used (grams and centimeters). If that field is not configured, English units are used (pounds and inches).
      6. If the item is a date, the available options are:
        X^ where X is an E4K 1010 category value

        If the item is a time, then the available options are:
        Y^ where Y is an E4K 2010 category value

        If the item is an instant, then the available options are
        X^Y where x is an E4K 1010 category value and y is an E4K 2010 category value

        AHS standard date format is 11 and standard time format is 13
  5. Determines the format of the text. The available options are:

      1. Sentence case
      2. Title Case
      3. lower case
      4. UPPER CASE

10. Determines whether to show all lines of data for multiple response items on a single line. Enter 1 to show multiple lines of data on separate lines. Leave blank to show all lines of data on a single line, separated by semicolons.

12. Specifies the free text message that appears if there is no data for the item. If left blank, nothing appears if there is no data for the item.

14. Specifies free text for the item label. If left blank or there is no data for the item, no label appears.

15. Determines whether to show a blank line if multiple copies of this SmartLink are used in a SmartText and the SmartLink has no data for its item. Enter 1 to not show a blank line if the SmartLink has no data for its item. If left blank, a blank line appears if this SmartLink has no data for its item.

PRINTGROUP (HHS 35008)

This SmartLink can be used to pull the content of print groups (LPG) into text documentation. The link does not support user-provided parameters and so should be copied and renamed before configuring the replica with a desired print group ID and a few details about formatting of the returned content.

RULESMARTLINK, RULESMARTLINKREFRESH (HHS 60402, 60404)

Displays information based on a rule record. You can choose to show parts of the SmartLink that match the rule criteria, if the rule evaluates to true, or if the rule is false. For example, you can create a rule to evaluate if the patient speaks Spanish. If the rule is found to be true, a SmartLink with Spanish text is used. If the rule is found to be false, a SmartLink with English text is used.

The SmartLink does not support embedded parameter settings and so there is little value in replicating this SmartLink. However, it can be embedded in SmartPhrases with all needed user-provided settings so that the SmartPhrase represents exactly how the builder intends RULESMARTLINK to behave.

This SmartLink has the following user-entered parameters:

  • Parameter 1 - Enter the ID number of the rule to evaluate.

  • Parameter 2 - Enter the mnemonic of the SmartLink to display if the rule is true.

  • Parameter 3 - Enter the mnemonic of the SmartLink to display if the rule is false.

  • Parameter 4 - Set to 1 to remove unexpected line feeds from the SmartLink text. If this parameter is set, the SmartLink will return plain text instead of rich text.

  • Parameter 5 - Set to 1 to display the SmartLink text on multiple lines. Only set this parameter if your SmartLink text is incorrectly appearing on a single line. If this parameter is set, the SmartLink will return plain text instead of rich text.

  • Parameter 6 - Set to 1 to display the SmartLink text starting on a new line. This is useful when you want the result to be on its own line, but you don’t want a blank line to appear when there are no results. If this parameter is set, the SmartLink will return plain text instead of rich text.

  • Parameter 7 - Set to 1 to force the SmartLink text to always use plain text format, rather than rich text format.

FLOW, AHSFLOW - Retrieve Flowsheet Data (HHS 101428)

LPPLINK

SNETLINK template - copy for SmartLinks to pull in specific networked patient encounter data

SLink Command Tag

Calls code d SLink^SNETLINK(ID,DAT,path,frmt,date,time,inst,cat,trim,inln,conj,futr,primaryLangOnly) with 13 configurable parameters:

  • ID - Enter the record ID; preferred is the dynamic patient identifier variable "patID"

  • DAT - Enter the contact date in DAT form; preferred is the dynamic encounter value "patDAT"

  • path - Enter the path to the networked item that you want to look up data for. This is a /-delimited string with each piece optionally being comma-delimited to specify a line number. If you don’t enter a line number, line 1 is used. Enter All to use all lines. For example, enter "EPT7070,2/DEP4001/EAF450"

  • frmt - Determines how string data should be formatted. Enter 1 to use title case. Enter 2 to use all capitals. Enter 3 to use all lowercase. Enter 4 to use sentence case. Leave this parameter blank to not change the capitalization of the data. This parameter is ignored for languages that don’t use the Latin alphabet.

  • date - Determines how date data should be formatted. Contact your Epic representative if you wish to use this setting to specify an alternate date format.

  • time - Determines how time data should be formatted. Contact your Epic representative if you wish to use this setting to specify an alternate time format.

  • inst - Determines how instant data should be formatted. Contact your Epic representative if you wish to use this setting to specify an alternate date and time format.

  • cat - Determines how category data should be formatted. Enter 1 to use the title. Enter 2 to use the abbreviation. Leave this parameter blank to use the default unformatted value.

  • trim - Enter the number of characters to trim the return value to. This parameter is ignored for languages that don’t use the Latin alphabet.

  • inln - Determines whether information for multiple response items is returned inline. Enter 1 to return information inline, or leave this parameter blank to return information in multiple lines.

  • conj - Enter the conjunction to use when returning info in inline form.

  • futr - Determines whether the SmartLink allows lookup for future dates. Enter 1 to allow lookup for future dates, or leave this parameter blank to not allow lookup for future dates.

  • primaryLangOnly - Determines whether the SmartLink can display data using only the primary language or if the data can be translated into alternate languages. Enter 1 to limit this SmartLink to using only the system’s primary language, or leave this parameter blank to allow alternate translations.

Examples

  • d SLink^SNETLINK(patID,patDAT,"EPT23015/RFL66",,"MM/dd/yyyy)

  • d SLink^SNETLINK(patID,patDAT,"EPT23015/RFL18100,All/HNO40",4,,,,,,,,1)

  • d SLink^SNETLINK(ID,DAT,"EPT2500/HAR838","","","","",2)

AcctLink tag

This tag calls the code d AcctLink^SNETLINK(ID,DAT,EARpath,HARpath,frmt,date,time,inst,cat,trim,inln,conj,futr,primaryLangOnly) and has 14 customizable parameters:

  • ID - Enter the record ID.

  • DAT - Enter the contact date in DAT form.

  • EARpath - Enter the path to use if looking up information starting from EAR.

  • HARpath - Enter the path to use if looking up information starting from HAR

  • frmt - Determines how string data should be formatted. Enter 1 to use title case. Enter 2 to use all capitals. Enter 3 to use all lowercase. Enter 4 to use sentence case. Leave this parameter blank to not change the capitalization of the data. This parameter is ignored for languages that don’t use the Latin alphabet.

  • date - Determines how date data should be formatted. Contact your Epic representative if you wish to use this setting to specify an alternate date format.

  • time - Determines how time data should be formatted. Contact your Epic representative if you wish to use this setting to specify an alternate time format.

  • inst - Determines how instant data should be formatted. Contact your Epic representative if you wish to use this setting to specify an alternate date and time format.

  • cat - Determines how category data should be formatted. Enter 1 to use the title. Enter 2 to use the abbreviation. Leave this parameter blank to use the default unformatted value.

  • trim - Enter the number of characters to trim the return value to. This parameter is ignored for languages that don’t use the Latin alphabet.

  • inln - Determines whether information for multiple response items is returned inline. Enter 1 to return information inline, or leave this parameter blank to return information in multiple lines.

  • conj - Enter the conjunction to use when returning info in inline form.

  • futr - Determines whether the SmartLink allows lookup for future dates. Enter 1 to allow lookup for future dates, or leave this parameter blank to not allow lookup for future dates.

  • primaryLangOnly - Determines whether the SmartLink can display data using only the primary language or if the data can be translated into alternate languages. Enter 1 to limit this SmartLink to using only the system’s primary language, or leave this parameter blank to allow alternate translations.

Examples:

  • d AcctLink^SNETLINK(patID,patDAT,"EPT2207/CVG240","EPT2500/HAR300/CVG240",,,,,1)

  • d AcctLink^SNETLINK(patID,patDAT,"EPT2207/CVG255","EPT2500/HAR300/CVG255",1)

  • d AcctLink^SNETLINK(patID,patDAT,"EPT2207/CVG2340","EPT2500/HAR300/CVG2340")

CvgLink tag

This tag calls the code d CvgLink^SNETLINK(ID,DAT,path,MCpath,frmt,date,time,inst,cat,trim,inln,conj,futr,primaryLangOnly) and has 14 customizable parameters:

  • ID - Enter the record ID.

  • DAT - Enter the contact date in DAT form.

  • path - Enter the path to look up non-managed care coverages.

  • MCpath - Enter the path to look up managed care coverages.

  • frmt - Determines how string data should be formatted. Enter 1 to use title case. Enter 2 to use all capitals. Enter 3 to use all lowercase. Enter 4 to use sentence case. Leave this parameter blank to not change the capitalization of the data. This parameter is ignored for languages that don’t use the Latin alphabet.

  • date - Determines how date data should be formatted. Contact your Epic representative if you wish to use this setting to specify an alternate date format.

  • time - Determines how time data should be formatted. Contact your Epic representative if you wish to use this setting to specify an alternate time format.

  • inst - Determines how instant data should be formatted. Contact your Epic representative if you wish to use this setting to specify an alternate date and time format.

  • cat - Determines how category data should be formatted. Enter 1 to use the title. Enter 2 to use the abbreviation. Leave this parameter blank to use the default unformatted value.

  • trim - Enter the number of characters to trim the return value to. This parameter is ignored for languages that don’t use the Latin alphabet.

  • inln - Determines whether information for multiple response items is returned inline. Enter 1 to return information inline, or leave this parameter blank to return information in multiple lines.

  • conj - Enter the conjunction to use when returning info in inline form.

  • futr - Determines whether the SmartLink allows lookup for future dates. Enter 1 to allow lookup for future dates, or leave this parameter blank to not allow lookup for future dates.

  • primaryLangOnly - Determines whether the SmartLink can display data using only the primary language or if the data can be translated into alternate languages. Enter 1 to limit this SmartLink to using only the system’s primary language, or leave this parameter blank to allow alternate translations.

Examples:

  • d CvgLink^SNETLINK(patID,patDAT,"EPT2207/CVG100/EPM100,All","EPT2207/CVG115/ PPG90/EPM100,All",1)

  • d CvgLink^SNETLINK(patID,patDAT,"EPT2207/CVG100/EPM602","EPT2207/CVG115/ PPG90/EPM602",1)

  • d CvgLink^SNETLINK(patID,patDAT,"EPT2207/CVG100/EPM.2","EPT2207/CVG115/PPG90/EPM.2",1)