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.
User Entered Simple
1. CUI. Enter the SDE to display. #s are restricted, so replace # with *. This parameter is the only required parameter. Example: EPIC*123
2. Options. Enter the letters corresponding to the options you would like to use. Note that the order doesn't matter.
N- Only display the label if the SDE value is evaluated as 1. Most boolean SDEs are stored as 0 or 1, and this option can only display the label text if this is the case. An example would be a check box of "Itchy?" If this SDE is checked, we can use this option to only display the label if the SDE is checked. This parameter may be used for other SDE data types if you use the 4th parameter (explained below) to map the data to 1. For example, if this SDE data is stored as a string, you can map that string to 1.
L - Always display the label. By default it only displays the label if SDE data exists. This option will have the label display no matter what.
C - Display the SDE comment instead of the value. Default is the value. A comment label can be specified in the comlbl parameter of the HHS record.
V - Display the SDE value and comment. A comment label can be specified in the SmartLink parameters.
E - Look back to previous encounters to find SDE. Default is to find the SDE filed in the same encounter. Only used with this SmartLink
M - Display a message if no value is found. Message is defined in the SmartLink parameters.
B - If data exists, break to the next line. This is used to minimize hard returns in the SmartText that will always display. This means you can place 5 SDE SmartLinks on the same line, and it will only display data on a new line if it exists. Otherwise, you would have blank lines in between each SmartLink. This should only be used in a reporting context.
D - Display multi-line data on one line separated by the delim parameter from the SmartLink record itself.
K - Indicate the requested data element is for the Kaleidoscope Eye Exam. The system will include Kaleidoscope specific inpatient data lookup to determine the latest value.
3. Label. Enter the label text
4. Data Mapping. Specify the conditions for data mapping SDEs to plain text values. Separate the From and To text with a colon (:). Example 1:True:0:False where a raw value of 1 will be displayed as True, 0 as False. Note that with the exception of *, only alphanumeric characters should be used in this parameter. Using other characters may produce unexpected results. This is good for SDE concept lists where the SDE name is stored as the data value. Instead of displaying the SDE name, you can map the name to a real value.
5. EAP ID. Not used in the encounter context; only relevant for SmartLink SDEORD [226].
6. Formatting. Determines the formatting to use if the SmartLink shows height, weight, time, date, or instant information. Note that weight and height formatting are performed only when the SmartData element is classified as a string within the record itself. If the SmartData element shows height information, enter 22 to use the height units configured in clinician profiles. If the SmartData element shows weight information, enter 23 to use the weight units configured in clinician profiles. If the SmartData element shows date and time information, follow the steps for the option that you want to use: * To choose a date and time format, enter a value from the Date: US Pattern (I E4K 1010) category list, then a caret (^), and then a value from the Time: US Pattern (I E4K 2010) category list. For example, enter 10^15 to use the MM/yyyy date format and the H:mm time format. * To choose only a date format, enter a value from the Date: US Pattern (I E4K 1010) category list and then a caret (^). For example, enter 10^ to use the MM/yyyy date format. * To choose only a time format for SmartData elements that show only time, enter a value from Time: US Pattern (I E4K 2010) category list and then a caret (^). For example, enter 15^ to use the H:mm time format. Note that time with unit formats are not available. * To choose only a time format for SmartData elements that show both date and time, enter a caret (^) and then a value from Time: US Pattern (I E4K 2010) category list. For example, enter ^15 to use the H:mm time format. Note that time with unit formats are not available.
7. SDE Line Number. For SDEs with multiple lines of data, specify which line of data to return. When this parameter is set to 1, only the first value appears; when it is set to 2, only the value from line #2 appears; and so on. Set it to -1 to return the value for the last non-null line. When it is null (""), all values appear. This user-entered parameter is ignored if the SmartLink's 6th parameter ("First or Last") is configured. Note that the second piece of the SmartLink's Link parameter (or the user-entered Option parameter, 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.
8. Not used.
9. Not used.
10. Not used.
SmartLink Advanced
Context: 2 (default) = patient-level data, 1 = episode-level data, null = encounter level data
NoVal: text to return if no value is found (default is null and nothing returned)
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
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)
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.
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.
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:
Master File: (required) 3 letter INI code for the Master file where the data resides
Item Identifier: (required) numeric code for the specific data item in the Master File
Line Number: (optional) if returned data is multi-response, optionally retrieve a specific line (option) from the data. Default (null) is to retrieve all. Use 99 to retrieve the last value in a list.
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:
Title
Abbreviation
Title and Number
Abbreviation and Number
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
Format: (optional) to select a format for returned text:
Sentence case
Title Case
lower case
UPPER CASE
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:
Master File: (required) 3 letter INI code for the Master file where the data resides
Item Identifier: (required) numeric code for the specific data item in the Master File
Line Number: (optional) if returned data is multi-response, optionally retrieve a specific line (option) from the data. Default (null) is to retrieve all.
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:
Title
Abbreviation
Title and Number
Abbreviation and Number
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
Please use "14^" to pull the AHS standard date format (dd MMM yyyy)
Please use "13^" to pull the AHS standard time format (HH:ss)
Format: (optional) to select a format for returned text:
Sentence case
Title Case
lower case
UPPER CASE
Truncation: optional number to limit the length of a returned string to the specified number of characters
Special parameters available only if CVG, EPM, EPP or RFL master files are used (see DBLINK descriptors)
Special record pull parameters available only if CVG, EPM, EPP master files used (see DBLINK descriptors)
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.
Use to prevent control how multi-line items respond with "1" used to put multiple lines each on their own line.
Used only with BED, ROM, DEP master files (see DBLINK descriptors)
Default text to display if no value is returned
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,,,,,,,,,,,,,)@
Specifies the master file INI to reference. To show information from a delivery record, enter HSB by default.
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
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.
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).
- 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 - If the item is networked to another master file, the available options are:
15 - Record ID
16 - Record Name
17 - Record Name and ID - 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 - If the item is a number, the available options are:
20 - Financial format
21 - Interval format - 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). - 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
- If the item is a category item, the available options are:
Determines the format of the text. The available options are:
- Sentence case
- Title Case
- lower case
- 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
This SmartLink can be used to display data from an extension (LPP). The extension must exist in a LPPLINK allowlist (HDF-2459).
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. Enter a blank (e.g., "EPT18862,") to just pull the latest line. 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)