ScriptPatient ("Pt") Functions

The ScriptPatient functions are available on the "pt" object in any script context, e.g. in a tablet rules or within an EForm script.



Example Expression (boolean)


Returns age in years

pt.getAge() > 40


Returns age in months pt.getAgeInMonths() > 18


Returns age in weeks  pt.getAgeInWeeks() > 6


Returns true if female, false if not pt.isFemale()


Returns true if male, false if not pt.isMale()


Returns the patient's reason for visit (not supported for all EMRs) pt.getReasonForVisit() == 'PHE'


Returns a string array of the patient profile items. Available keys will vary by EMR. See Medication Reconciliation eForm for an example of Rx profile item.

pt.getCppItemKeys('rx').length > 0



Returns a key-value table for a CPP item with a specified list key and item key.

pt.getCppItemData("immu", "influenza virus vaccine")


Learn More 

1. Getting Started with eForms 10. Action Menu - eForm Actions
2. Creating a New Form & Understanding Form Structure 11. Adding Hyperlinks to eForms
3. Adding eForm Items - General Tab 12. Editing an Existing Form
4. Editing Menu Choices 13. Helpful eForm Formatting Tips
5. Note Formatting for Items 14. Form Memory - Storing Form Values for Patients in Ocean
6. Using Keywords to Automatically Insert Content 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 19. ScriptUtil Functions


Was this article helpful?
2 out of 2 found this helpful
Have more questions? Submit a request