Using Keywords to Automatically Insert Content

Keywords allow you to insert a piece of data from the patient object (usually from the EMR) into a caption, to prepopulate a field, or as part of a note. To see a list of available keywords, simply type @ and the menu will appear in the editor. A full list of options is also included in the chart below.

To indicate a keyword, just add "@" to the beginning. For example, "Dear @ptPreferredOrFirstName," will render as "Dear Jacob,".

You can also access keyword values in a script with the ScriptUtil.getKeyword() function, like "ScriptUtil.getKeyword('@ptName')". This is particularly useful for tablet rules, since a rule can access most of the patients information via this function. For example, you can show a COPD assessment questionnaire if the patient has COPD in their problem list or past medical history like this: "ScriptUtil.getKeyword('@ptHas.copd') == 'Y'"

Keywords can be very useful in conjunction with EMRFields to allow patient to update their profile automatically. For example, by setting the default text of a text field to "@ptPreferredName" and setting the EMRField mapping on the same item to "preferredName", the initial value will be the patient's preferred name in the EMR and any changes will be applied to the preferred name field in the EMR.

Note that not all keywords work for all EMRs.

Some keywords accept suffixes, which should be added after a trailing period. For example, @ptHnExpiryDate.yyyysmmsdd will show the date as 2015/06/21.

Keyword (preface with '@') Description
date The current date
time The current time
site The name of the site. Not available on tablet.
ptTitle The patient's title (e.g. "Dr.")
ptSuffix The patient's suffix, if any, e.g. "Jr."
ptName The patient's full name 
ptSurname  
ptFirstName  
ptPreferredName The preferred name of the patient, if set. For simple display purposes, consider using ptPreferredOrFirstName.
ptPreferredOrFirstName The patient's preferred name, if set, or the first name if no preferred name is available. Useful for salutations.
ptSecondName  
ptSecondNameInitials  
ptAddress1  
ptAddress2  
ptCity  
ptProvince  
ptCountry  
ptPostal  
ptAddr2Line1  
ptAddr2Line2  
ptAddr2City  
ptAddr2Province  
ptAddr2Country  
ptAddr2Postal  
ptBirthDate  
ptApproxAgeInDays  
ptHomePhone  
ptBusinessPhone  
ptBusinessExt  
ptMobilePhone  
ptEmail  
ptSex Either "M" or "F"
ptIsMale True if male
ptIsFemale True if female
ptHnVC The HN verification code.
ptHnProv  
ptHnExpiryDate The HN expiry date.
ptHn The patient's health number.
ptAge The patient's age in years.
ptHisHer Either "his" or "her" depending on pt sex
ptHisHer.cap Either "His" or "Her" (capitalized) depending on pt sex
ptHeShe Either "he" or "she" depending on pt sex 
ptHeShe.cap Either "He" or "She" (capitalized) depending on pt sex
ptHimHer Either "him" or "her" depending on pt sex
ptMaleFemale Either "male" or "female" depending on pt sex
ptManWoman Either "man" or "woman" depending on pt sex
ptFamilyDoc The patient's family doc, as per patient record
ptClinicDoc The patient's clinic doc, e.g. could be specialist
ptComments Any comments that have been typed into the demographics section of the patient chart. (PSS only)
ptCppOneLine A section of the patient profile ("CPP") flatted to a single line, delimited by semi-colon. E.g. ptCppOneLine.prob might yield "dm2; chf"
ptCpp

A section of the patient profile ("CPP") with one line per item. E.g. ptCpp.prob might yield

dm2

chf

ptFullCpp The entire patient profile, with each section heading in uppercase.
ptCheckIfHas Either "Y" or "" depending on whether the patient has the condition, e.g. @ptCheckIfHas('dm2')
ptRxFriendly A patient-friendly version of one of the patient's medications. Use a suffix to indicate which med, e.g. @ptRxFriendly.0 would be the first med on file.
ptHas Either "Y" or "N" depending on whether the patient has the condition, e.g. @ptHas('dm2'). Also checks past medical history if available.
ptLatestVal

Provides the latest lab result/vital for a particular measurement. E.g.:

@ptLatestVal.a1c

Supported vitals include ht, wt, bp, cr, egfr, a1c, oceanvital. 

ptEmergencyContactPhone  
ptEmergencyContactRelationship  
ptEmergencyContactIsPoA  
ptEmergencyContact  
ptExternalRef The patient's reference in the EMR, e.g. the patient ID
ptNextApptDate A textual description of the patient's next upcoming appointment date and time, or "(not available)". Note: Most EMR interfaces (other than PSS), as well as the tablet, do not populate this field.
ptPreferredPharmacy The preferred pharmacy for the patient. (PSS only)
user.properName The proper name of the current user. This is limited to secure message and web questionnaire invitations (e.g. "A message from Dr. John Smith") and cannot be used in eForms or rules.

 

Learn More 

1. Getting Started with eForms 11. Adding Hyperlinks to eForms
2. Creating a New Form & Understanding Form Structure 12. Editing an Existing Form
3. Adding eForm Items - General Tab 13. Helpful eForm Formatting Tips
4. Editing Menu Choices 14. Form Memory - Storing Form Values for Patients in Ocean
5. Note Formatting for Items 15. Basics of Java Script
7. Adding a Section - Overview 16. Formula Scripting
8. Scripting & More Tab Basics 17. Advanced JavaScript in Forms ("Fancy Stuff")
9. Action Menu - eForm Properties 18. ScriptPatient ("Pt") Functions
10. Action Menu - eForm Actions 19. ScriptUtil Functions
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request