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.

Function

Description

Example Expression (boolean)

getAge()

Returns age in years

pt.getAge() > 40

getAgeInMonths()

Returns age in months pt.getAgeInMonths() > 18

getAgeInWeeks()

Returns age in weeks  pt.getAgeInWeeks() > 6

isFemale()

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

isMale()

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

getReasonForVisit()

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

getCppItemKeys(cppListKey)

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

 

getCppItemData(cppListKey)

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