ScriptPatient ("Pt") Functions

The ScriptPatient functions are available on the "pt" object in any script context, such as a tablet rule or within an eForm Action 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")

 

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