Practice Answers

The Practice Answers category contains thirteen subcategories:

The Appointment related subcategory contains the following functions:

ApptDate

Function

ApptDate

Location in PracticeScript

Functions->Practice Answers->Appointment related

Purpose

Calculates the date of a patient's appointment (if any) in the past or the future.

Format

ApptDate(PatientID, OptionalStartDate, OptionalEndDate, OptionalListOfCodes)

PatientID is the internal ID of the patient. Typically, this is the PracticeScript variable Patient.PersonID found at Fields->Data fields->Patient Info->Internal ID.

OptionalStartDate is the start of the date range to begin looking for appointments. If not specified or if 0 is specified, today's date is assumed.

OptionalEndDate is the end of the date range to begin looking for appointments. If not specified or if 0 is specified, the largest possible date is assumed.

OptionalListOfCodes allows up to 7 numeric expressions that represent ADA treatment codes. If specified, the appointment must have at least one of the treatment codes scheduled for a match to occur.

Evaluates to

The date of an appointment for the patient that meets all of the criteria. Unlike the NextApptDate() function, the appointment can already be checked out. If no matching appointment date is found, 0 is returned.

Example

ApptDate(Patient.PersonID, FirstOfMonth(), EndOfMonth(), 4910) <> 0
Returns TRUE (1) if the patient had or is having perio maintenance done this month.

HasPendingAppt

Function

HasPendingAppt

Location in PracticeScript

Functions->Practice Answers->Appointment related

Purpose

Determines if the patient has any pending appointments with the specified criteria.

Format

HasPendingAppt(PatientID,OptionalListOfCodes)

PatientID is the internal ID of the patient. Typically, this is the PracticeScript variable Patient. PersonID found at Fields->Data fields->Patient Info->Internal ID.

OptionalListOfCodes allows up to 7 numeric expressions that represent ADA treatment codes. If specified, the appointment must have at least one of the treatment codes scheduled for a match to occur.

Evaluates to

TRUE (1) if the patient has a pending appointment that meets all of the criteria. If no matching pending appointment can be found, FALSE (0) is returned.

Example

HasPendingAppt(Patient.PersonID, 2140, 2150, 2160, 2161)
Returns TRUE (1) if the patient has an amalgam appointment on the pending page.

HasPendingAppt(Patient.PersonID, 4910) = 0
Returns TRUE (1) if the patient does NOT have a perio maintenance appointment on the pending page (If the HasPendingAppt() function returns FALSE (0), the formula is TRUE).

NextApptDate

Function

NextApptDate

Location in PracticeScript

Functions->Practice Answers->Appointment related

Purpose

Calculates the date of a patient's next appointment (if any).

Format

NextApptDate(PatientID, OptionalStartDate, OptionalEndDate, OptionalListOfCodes)

PatientID is the internal ID of the patient. Typically, this is the PracticeScript variable Patient PersonID found at Fields->Data fields->Patient Info->Internal ID.

OptionalStartDate is the start of the date range to begin looking for appointments. If not specified or if 0 is specified, today's date is assumed.

OptionalEndDate is the end of the date range to begin looking for appointments. If not specified or if 0 is specified, the largest possible date is assumed.

OptionalListOfCodes allows up to 7 numeric expressions that represent ADA treatment codes. If specified, the appointment must have at least one of the treatment codes scheduled for a match to occur.

Evaluates to

The date of an appointment for the patient that meets all of the criteria. In addition to the criteria, the appointment cannot already be checked out. If no matching appointment date is found, 0 is returned.

Example

NextApptDate(Patient.PersonID, 0, 0, 2140, 2150, 2160, 2161) <> 0
Returns TRUE (1) if the patient is having an amalgam done anytime in the future (i.e. if the function does NOT return 0).

NextApptDate(Patient.PersonID, Today(), EndOfMonth(), 4910) <> 0
Returns TRUE (1) if the patient is having perio maintenance done this month.

NextApptDate(Patient.PersonID) = 0
Returns TRUE (1) if the patient has no appointments scheduled for the future.

NextApptDate(Patient.PersonID) - Today()
Returns the number of days until the patient's next appointment. NOTE: If the patient does not have a next appointment, the number is a large, negative number (- today's date).

NextNonRecallApptDate

Function

NextNonRecallApptDate

Location in PracticeScript

Functions->Practice Answers->Appointment related

Purpose

Calculates the date of a patient's next non-recall appointment (if any).

Format

NextNonRecallApptDate(PatientID, OptionalStartDate, OptionalEndDate, OptionalListOfCodes)

PatientID is the internal ID of the patient. Typically, this is the PracticeScript variable Patient.PersonID found at Fields->Data fields->Patient Info->Internal ID.

OptionalStartDate is the start of the date range to begin looking for appointments. If not specified or if 0 is specified, today's date is assumed.

OptionalEndDate is the end of the date range to begin looking for appointments. If not specified or if 0 is specified, the largest possible date is assumed.

OptionalListOfCodes allows up to 7 numeric expressions that represent ADA treatment codes. If specified, the appointment must have at least one of the treatment codes scheduled for a match to occur.

Evaluates to

The date of an appointment for the patient that meets all of the criteria. In addition to the criteria, the appointment cannot already be checked out, and the "Recall appointment" option cannot be checked. If no matching appointment date can be found, 0 is returned.

Example

NextNonRecallApptDate(Patient.PersonID) = 0
Returns TRUE (1) if the patient does not have a non-recall appointment scheduled for the future.

NextNonRecallApptDate(Patient.PersonID) - Today()
Returns the number of days until the patient's next non-recall appointment.
NOTE
: If the patient does not have a next non-recall appointment, the number is a large, negative number (- today's date).

NextRecallApptDate

Function

NextRecallApptDate

Location in PracticeScript

Functions->Practice Answers->Appointment related

Purpose

Calculates the date of a patient's next recall appointment (if any).

Format

NextRecallApptDate(PatientID, OptionalStartDate, OptionalEndDate, OptionalListOfCodes)

PatientID is the internal ID of the patient. Typically, this is the PracticeScript variable Patient.PersonID found at Fields->Data fields->Patient Info->Internal ID.

OptionalStartDate is the start of the date range to begin looking for appointments. If not specified or if 0 is specified, today's date is assumed.

OptionalEndDate is the end of the date range to begin looking for appointments. If not specified or if 0 is specified, the largest possible date is assumed.

OptionalListOfCodes allows up to 7 numeric expressions that represent ADA treatment codes. If specified, the appointment must have at least one of the treatment codes scheduled for a match to occur.

Evaluates to

The date of an appointment for the patient that meets all of the criteria. In addition to the criteria, the appointment cannot already be checked out, and the "Recall appointment" option must be selected. If no matching appointment date can be found, 0 is returned.

Example

NextRecallApptDate(Patient.PersonID) = 0
Returns TRUE (1) if the patient has no recall appointments scheduled for the future.

NextRecallApptDate(Patient.PersonID) - Today()
Returns the number of days until the patient's next recall appointment.
NOTE
: If the patient does not have a next recall appointment, the number is a large, negative number (- today's date).

The Ledger related subcategory contains the following functions:

HasTxCodeInLedger

Function

HasTxCodeInLedger

Location in PracticeScript

Functions->Practice Answers->Ledger related

Purpose

Determines if a patient has had a particular procedure posted to the ledger.

Format

HasTxCodeInLedger(PatientID, OptionalStartDate, OptionalEndDate, OptionalToothNum,ListOfCodes)

PatientID is the internal ID of the patient. Typically, this is the PracticeScript variable Patient. PersonID found at Fields->Data fields->Patient Info->Internal ID.

OptionalStartDate is the start of the date range to search the ledger. If not specified or if 0 is specified, the earliest possible date is assumed.

OptionalEndDate is the end of the date range to search the ledger. If not specified or if 0 is specified, the largest possible date is assumed.

OptionalToothNum, if specified, is the tooth number on which the tx code was performed. If not specified (or if 0 is specified), any tooth number matches.

ListOfCodes allows up to 6 numeric expressions that represent ADA treatment codes to search the ledger for. At least one code must be specified.

Evaluates to

TRUE (1) if a transaction code that meets the criteria is found in the patient's ledger. FALSE (0) is returned if the code could not be found.

Example

HasTxCodeInLedger(Patient.PersonID, 0, 0, 0, 2140, 2150, 2160, 2161) <> 0
Returns TRUE (1) if the patient has had an amalgam posted to the ledger (i.e., if the function does NOT return 0)

HasTxCodeInLedger(Patient.PersonID, 0, 0, 15, 2140, 2150, 2160, 2161) <> 0
Returns TRUE (1) if the patient has had an amalgam on tooth number 15 posted to the ledger (i.e. if the function does NOT return 0).

LedgerToText

Function

LedgerToText

Location in Practice Script

Functions->Practice Answers->Ledger related

Purpose

Converts transactions in the ledger to a block of text that can be read by a human. Most commonly used in the definition of a Document Merge Variable. This allows letters to be generated that include the treatment performed during a specified time period.

Format

LedgerToText(PatientID, StartDate, EndDate, ListOnlyTx,IncludeADACodes, IncludeTooth#,IncludeSurfaces, IncludeAmount,FormatAsTable, IncludeHeading)

PatientID is the internal ID of the patient. Typically, this is the PracticeScript variable Patient.PersonID found at Fields->Data fields->Patient Info->Internal ID.

StartDate, if specified, is the beginning date range to consider. Only transactions on or after this date are included in the result. If this parameter is 0, the earliest date in the ledger is used.

EndDate, if specified, is the ending date range to consider. Only transactions on or before this date are included in the result. If this parameter is 0, the last date in the ledger is used.

ListOnlyTx, if specified, determines if only treatment codes are included, or if payments and adjustments will also be listed. If ListOnlyTx is FALSE, all entries are included. Otherwise, only dental and medical procedures are included.

IncludeADACodes, if specified, determines if the ADA codes for each entry are included in the output. If IncludeADACodes is FALSE, the ADA code will not be part of the output. Otherwise, it is included.

IncludeTooth#, if specified, determines if the tooth number (or quadrant) of the procedure are included in the output. If IncludeTooth# is FALSE, the tooth number (or quadrant) will not be part of the output. Otherwise, it is included.

IncludeSurfaces, if specified, determines if the tooth surfaces of the procedure is included in the output. If IncludeSurfaces is FALSE, the surface letters will not be part of the output. Otherwise, they are included.

IncludeAmount, if specified, determines if the dollar value associated with the transaction is included in the output. If IncludeAmount is FALSE, the amount will not be part of the output. Otherwise, it is included.

FormatAsTable, if specified, determines how the output is to appear.
If FormatAsTable is FALSE, the output appears as free-form text. A semicolon separates the procedures. The tooth number, surfaces, and description are arranged in such a way so the entries read more like a sentence with a description of what was done.
If FormatAsTable is TRUE, the output is formatted as a table. Each field (Date, Tooth #, Surfaces, Description, Amount) is in a separate column. A TAB character separates each column.

IncludeHeading, if specified, controls whether the resulting text includes labels for each column. If IncludeHeading is FALSE, column headings are not part of the resulting text. This parameter has no effect if the previous parameter, FormatAsTable, is FALSE.

Evaluates to

A string of text that represents the procedures in the ledger that belong to the patient. The text may be in free-form text format (if FormatAsTable is FALSE), or in a table format. The table format will have columns separated by TAB characters.

Example

Assuming that two fillings were done on the patient today:

LedgerToText(Patient.PersonID, Today(), Today(), TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE)
Returns:"Code Tooth Sfc Description 2150 14 MO Amalgam 2 surface 2140 15 D Amalgam 1 surface".

LedgerToText(Patient.PersonID, Today(), Today(), TRUE, FALSE, TRUE, TRUE, FALSE, FALSE)
Returns:"MO Amalgam 2 surface on tooth #14; D Amalgam 1 surface on tooth #15".

DateOfLastTxInLedger

Function

DateOfLastTxInLedger

Location in PracticeScript

Functions->Practice Answers->Ledger related

Purpose

Determines the date a patient had a particular procedure posted to the ledger (if any).

Format

DateOfLastTxInLedger(PatientID, OptionalStartDate, OptionalEndDate, OptionalToothNum,ListOfCodes)
PatientID
is the internal ID of the patient. Typically, this is the PracticeScript variable Patient.PersonID found at Fields->Data fields->Patient Info->Internal ID.

OptionalStartDate is the start of the date range to search the ledger. If not specified or if 0 is specified, the earliest possible date is assumed. OptionalEndDate is the end of the date range to search the ledger. If not specified or if 0 is specified, the largest possible date is assumed.

OptionalToothNum, if specified, is the tooth number on which the tx code was performed. If not specified or if 0 is specified, any tooth number will match.

ListOfCodes allows up to 6 numeric expressions that represent ADA treatment codes for which to search the ledger. At least one code must be specified.

Evaluates to

The date that the procedure was done. If a match cannot be found, 0 is returned. If more than one matching procedure can be found, the date of the most recent procedure is returned.

Example

DateOfLastTxInLedger(Patient.PersonID, FirstOfMonth(), 0, 0, 2140, 2150, 2160, 2161) <> 0
Returns TRUE (1) if the patient has had an amalgam posted to the ledger this month (i.e., if the function does NOT return 0).

Today() - DateOfLastTxInLedger(Patient.PersonID, 0, 0, 0, 2140, 2150, 2160, 2161)
Returns the number of days that has passed since the last time the patient had an amalgam done.

NOTE: If the patient has never had an amalgam done, this will evaluate to a very large number (DateOfLastTxInLedger() is 0, so the number is the same as Today()).

DateOfLastTxInLedger(Patient.PersonID, 0, 0, 15, 2140, 2150, 2160, 2161) = 0
Returns TRUE (1) if the patient has never had an amalgam on tooth number 15 posted to the ledger (i.e., if the function returns 0).

The Contract related subcategory contains two syntaxes available for you to define contract-related experts:

The Tx Plan related subcategory contains the following functions:

TxPlanAccepted

Function

TxPlanAccepted

Location in PracticeScript

Functions->Practice Answers->Tx plan related

Purpose

Determines if a treatment plan was accepted by a patient.

Format

TxPlanAccepted(PatientID, OptionalStartDate, OptionalEndDate)

PatientID is the internal ID of the patient. Typically, this is the PracticeScript variable Patient.PersonID found at Fields->Data fields->Patient Info->Internal ID.

OptionalStartDate is the start of the date range to search for the treatment plan. If not specified or if 0 is specified, the earliest possible date is assumed.

OptionalEndDate is the end of the date range to search for the treatment plan. If not specified or if 0 is specified, the largest possible date is assumed.

Evaluates to

TRUE (1) if a treatment plan was accepted by the patient during the specified date range.

Example

TxPlanAccepted(Patient.PersonID, FirstOfYear(), Today())
Returns TRUE (1) if a treatment plan was accepted by the patient this year. TxPlanCreated(Patient.PersonID) Returns TRUE (1) if a treatment plan was ever accepted by the patient.

TxPlanAccepted(Patient.PersonID, Patient.FirstTreated, Patient.FirstTreated + 90)
Returns TRUE (1) if a treatment plan was accepted within 90 days of the patient's first visit.

TxPlanCreated

Function

TxPlanCreated

Location in PracticeScript

Functions->Practice Answers->Tx plan related

Purpose

Determines if a treatment plan has been created for a patient.

Format

TxPlanCreated(PatientID, OptionalStartDate, OptionalEndDate)

PatientID is the internal ID of the patient. Typically, this is the PracticeScript variable Patient.PersonID found at Fields->Data fields->Patient Info->Internal ID.

OptionalStartDate is the start of the date range to search for the treatment plan. If not specified or if 0 is specified, the earliest possible date is assumed.

OptionalEndDate is the end of the date range to search for the treatment plan. If not specified or if 0 is specified, the largest possible date is assumed.

Evaluates to

TRUE (1) if a treatment plan had been created for the patient during the specified date range. FALSE (0) is returned if a treatment plan was not created.

Example

TxPlanCreated(Patient.PersonID, FirstOfYear(), Today())
Returns TRUE (1) if a treatment plan was created for the patient this year. TxPlanCreated(Patient.PersonID) Returns TRUE (1) if a treatment plan was ever created for the patient.

TxPlanCreated(Patient.PersonID, Patient.FirstTreated, Patient.FirstTreated)
Returns TRUE (1) if a treatment plan was created on the patient's first visit.

TxPlanInProgress

Function

TxPlanInProgress

Location in PracticeScript

Functions->Practice Answers->Tx plan related

Purpose

Determines if a treatment plan is currently in progress.

Format

TxPlanInProgress(PatientID, OptionalStartDate, OptionalEndDate)

PatientID is the internal ID of the patient. Typically, this is the PracticeScript variable Patient.PersonID found at Fields->Data fields->Patient Info->Internal ID.

OptionalStartDate is the start of the date range to search for acceptance date of the treatment plan. If not specified or if 0 is specified, the earliest possible date is assumed.

OptionalEndDate is the end of the date range to search for the acceptance date of the treatment plan. If not specified or if 0 is specified, the largest possible date is assumed.

Evaluates to

TRUE (1) if a treatment plan had been accepted and is currently in progress (i.e., appointments have been scheduled). The date range, if specified, represents the date that the treatment plan was accepted. FALSE (0) is returned if a treatment plan is not currently in progress (i.e., it was never created, it was never accepted, or it has already been completed).

Example

TxPlanInProgress(Patient.PersonID, FirstOfYear(LastYear()), EndOfYear(LastYear()))
Returns TRUE (1) if a treatment plan was accepted by the patient last year and is still in progress this year.

The User Form related subcategory contains the following functions:

FormVal

Function

FormVal

Location in PracticeScript

Functions->Practice Answer->User Form related

Purpose

Determines the value of a field on a User Defined form.

Format

FormVal(PatientID, FormName, QuestionLabel, OptionalStartDate, OptionalEndDate)

PatientID is the internal ID of the patient. Typically, this is the PracticeScript variable Patient.PersonID found at Fields->Data fields->Patient Info->Internal ID.

FormName is a character string that is the name of the form you are looking for. FormName needs to match the Form name field found on the Form Definition window when defining the form. The Form name is also displayed in the Description column of the User Forms Pick List.

QuestionLabel is the character string that is the label for the specific question on the form. QuestionLabel needs to match the Question field found on the Question Definition window when defining the fields on a form. The Question label is also displayed in the Form contents window on the Form Definition window.

There are also two hidden question labels that ALWAYS exist on a form. They are "Entry date," which is the date the form was added to the chart, and "Version," which is the version number of the form. You may specify "Entry date" or "Version" for the question label if you need to.

OptionalStartDate is the start of the date range to search for when the form was added to the chart. If not specified or if 0 is specified, the earliest possible date is assumed.

OptionalEndDate is the end of the date range to search for when the form was added to the chart. If not specified or if 0 is specified, the largest possible date is assumed.

Evaluates to

If the specified form is found, the value of FormVal() depends on the type of the question. If the question is a number, it evaluates to the number that is in the field. If the question is a single line text field, FormVal() evaluates to a string. Multiple-choice questions evaluate to strings that represent the value. If the question is a option, FormVal() is 1 if the box is selected, or 0 if the box was not selected. If the form does not exist for the patient or if the question label does not exist on the form, the return value is 0.

Example

FormVal(Patient.PersonID, "TMJ Exam", "Clicking or popping") = 1

LastFormDate

Function

LastFormDate

Location in PracticeScript

Functions->Practice Answer->User Form related

Purpose

Determines the date of the last time (if any) a particular User Defined form was added to the patient's chart.

Format

LastFormDate(PatientID, FormName, OptionalStartDate, OptionalEndDate)

PatientID is the internal ID of the patient. Typically, this is the PracticeScript variable Patient.PersonID found at Fields->Data fields->Patient Info->Internal ID.

FormName is a character string that is the name of the form you are looking for. FormName needs to match the Form name field found on the Form Definition window when defining the form. The Form name is also displayed in the Description column of the User Forms Pick List.

OptionalStartDate is the start of the date range to search for when the form was added to the chart. If not specified or if 0 is specified, the earliest possible date is assumed.

OptionalEndDate is the end of the date range to search for when the form was added to the chart. If not specified or if 0 is specified, the largest possible date is assumed.

Evaluates to

The date that the form was most recently added to the patient's chart. If the form was NOT added in the date range specified, 0 is returned.

Example

LastFormDate(Patient.PersonID, "TMJ Exam") = 0
Returns TRUE (1) if the form named "TMJ Exam" has never been added to the patient's chart (i.e. if the LastFormDate is 0).
(Today() - LastFormDate(Patient.PersonID, "Head and Neck Exam")) > 365

Returns TRUE (1) if it has been more than 365 days since the patient last had the form "Head and Neck Exam" added to their chart.
NOTE
: If the patient never has had this form added, LastFormDate() is 0, and Today() - 0 is larger than 365. Thus, if the form was never added it will also evaluate to "TRUE".

The Note related subcategory contains the following functions:

NoteDate

Function

NoteDate

Location in PracticeScript

Functions->Practice Answers->Note related

Purpose

Calculates the date that a clinical note was added to the patient's chart (if ever)

Format

NoteDate(PatientID, SummaryTextToSearch, ExactMatch? OptionalStartDate, OptionalEndDate)

PatientID is the internal ID of the patient. Typically, this is the PracticeScript variable Patient.PersonID found at Fields->Data fields->Patient Info->Internal ID.

SummaryTextToSearch is a string of characters used to search. The function is looking for a note that has a Note Summary that matches

SummaryTextToSearch if not specified or if 0 is specified for this parameter, any note present in the specified date range is considered a match.

ExactMatch? specifies whether the SummaryTextToSearch must match the Note Summary exactly. If ExactMatch? is TRUE (1), it must be an exact character match (with the exception of case - upper and lower case can be different). If ExactMatch? is FALSE (0), the note is considered a match if SummaryTextToSearch can be found anywhere in the Note Summary.

OptionalStartDate is the start of the date range to begin looking for notes. If not specified or if 0 is specified, the earliest possible date is assumed.

OptionalEndDate is the end of the date range to begin looking for notes. If not specified or if 0 is specified, the largest possible date is assumed.

Evaluates to

The number of days between 01-01-2000 and the date that the note was added to the patient's chart. If no note matching the criteria is found, 0 is returned. If more than one note matches the search criteria, the date of the most recent note is returned.

Example

NoteDate(Patient.PersonID, "Recall", FALSE)
Returns the date that a recall note was last written (assuming the word "recall" is in the summary of a recall note). Zero is returned if no recall note was written.

NoteDate(Patient.PersonID, "Recall", TRUE)
Returns the date that a recall note was last written (assuming the word "recall" is the summary of a recall note). Unlike the previous example, this would not match notes with a summary such as "Adult recall" and "Child recall".

NoteDate(Patient.PersonID, "Review", FALSE, Yesterday(), Yesterday()) = 0
Returns TRUE (1) if a "Review" note was NOT made yesterday. If a review note was made yesterday, the NoteDate() function would return a non-zero value, and thus the expression would NOT equal 0, making the statement FALSE. NOTE: The NoteDate() function would find a match for notes such as "Reviewed x-rays".

NoteText

Function

NoteText

Location in PracticeScript

Functions->Practice Answers->Note related

Purpose

Returns the contents of a clinical note in the patient's chart.

Format

NoteText(PatientID, SummaryTextToSearch, ExactMatch? OptionalStartDate, OptionalEndDate, IncludeSummary?, IncludeBody?)

PatientID is the internal ID of the patient. Typically, this is the PracticeScript variable Patient.PersonID found at Fields->Data fields->Patient Info->Internal ID.

SummaryTextToSearch is a string of characters used to search. The function is looking for a note that has a Note Summary that matches SummaryTextToSearch. If not specified or if 0 is specified for this parameter, any note present in the specified date range is considered a match.

ExactMatch? Specifies whether the SummaryTextToSearch must match the Note Summary exactly. If ExactMatch? Is TRUE (1), it must be an exact character match (with the exception of case - upper and lower case can be different). If ExactMatch? Is FALSE (0), the note is considered a match if SummaryTextToSearch can be found anywhere in the Note Summary.

OptionalStartDate is the start of the date range to begin looking for notes. If not specified or if 0 is specified, the earliest possible date is assumed.

OptionalEndDate is the end of the date range to begin looking for notes. If not specified or if 0 is specified, the largest possible date is assumed.

IncludeSummary?, if TRUE (1), the Summary is included in the result. If not specified, TRUE is assumed.

IncludeBody?, if TRUE (1), the body of the note is included in the result. If not specified, TRUE is assumed.

Evaluates to

A character string that is the contents of the specified note. Depending on the parameters passed to the function, the string contains the Summary, the note body, or both. If no note is found, the string is blank (a length of 0). If the summary and body are both included, they are separated by a colon (":").

Example

NoteText(Patient.PersonID, "Recall", FALSE)
Returns "Adult recall: Performed standard cleaning and polish - JEK" (assuming that is the summary and body of the most recent recall note on file for the patient).

NoteText(Patient.PersonID, "Recall", FALSE, LastWeek(), Today(), FALSE, TRUE)
Returns "Performed standard cleaning and polish - JEK" for the same note as above (assuming the note was written within the last week).

The Document related subcategory contains the following functions:

DocTitleLastPrint

Function

DocTitleLastPrint

Location in PracticeScript

Functions->Practice Answers->Document related

Purpose

To determine the last date, if any, a particular document was printed.

Format

DocTitleLastPrint(PatientIDHere, TitleToSearchFor, ExactMatch?, OptionalStartDateRange, OptionalEndDateRange)

PatientID is the internal ID of the patient. Typically, this is the PracticeScript variable Patient.PersonID found at Fields->Data fields->Patient Info->Internal ID.

Evaluates to

The date of the most recent printing of the document for the patient. If none exists, 0 is returned.

Example

DocTitleLastPrint(Patient.PersonID, Accounts Recievable Letter #1, 0)
Returns patients with the Accounts Receivable Letter #1 in their histories.

DocCatLastPrint

Function

DocCatLastPrint

Location in PracticeScript

Functions->Practice Answers->Document related

Purpose

Determines the last date a document in a specific category was printed (if ever).

Format

DocCatLastPrint(PatientIDHere, CategoryToSearchFor, OptionalStartDateRange, OptionalEndDateRange) PatientID is the internal ID of the patient.

Evaluates to

The date of the most recent printing of a document in a specific category. If none, 0 is returned.

Example

DocCatLastPrint(Patient.PersonID, A/R Letters)
Returns patients with a document from the A/R Letters category in their histories.

The Image related subcategory contains the following functions:

LastImageDate

Function

LastImageDate

Location in PracticeScript

Functions->Practice Answers->Image related

Purpose

To determine the last date an intraoral camera image was taken for the patient (if any).

Format

LastImageDate(PatientID)

PatientID is the internal ID of the patient. Typically, this is the PracticeScript variable Patient.PersonID found at Fields->Data fields->Patient Info->Internal ID.

Evaluates to

The date of the most recent intra-oral camera image taken for the patient. If no intraoral camera images exist, 0 is returned.

Example

LastImageDate(Patient.PersonID) >= FirstOfYear()
Returns TRUE (1) if an intraoral camera image has been taken this year for the patient.

LastPortraitDate

Function

LastPortraitDate

Location in PracticeScript

Functions->Practice Answers->Image related

Purpose

Determines the last date the patient's portrait was taken (if ever).

Format

LastPortraitDate(PatientID)
PatientID
is the internal ID of the patient. Typically, this is the PracticeScript variable Patient. PersonID found at Fields->Data fields->Patient Info->Internal ID.

Evaluates to

The date of the most recent camera image taken of the patient's face. If no portrait has been taken, 0 is returned.

Example

Today() - LastPortraitDate(Patient.PersonID)) >= 730
Returns TRUE (1) if it has been 730 days or more (2 years) since the patient's portrait was last taken.

NOTE: If the patient's portrait has never been taken, LastPortraitDate() evaluates to 0, and the left side of the expression is a large number always greater than 730; thus, the formula also evaluates to TRUE.

The Insurance related subcategory contains the following function:

InsBenefitRemain

Function

InsBenefitRemain

Location in PracticeScript

Functions->Practice Answers->Insurance Related

Purpose

Calculates the dollar amount of insurance benefits the patient has remaining in the year.

Format

InsBenefitRemain(PatientID, ConsiderSecondary)

PatientID is the internal ID of the patient. Typically, this is the PracticeScript variable Patient.PersonID found at Fields->Data fields->Patient Info->Internal ID.

ConsiderSecondary, if specified, determines if secondary insurance should be factored into the calculation.

Evaluates to

The dollar amount of remaining insurance benefits the patient has. Remaining benefit is defined as the Individual Annual Maximum minus the individual benefits used. If no benefits remain, 0 is returned. If the patient does not have insurance, minus 1 (-1) is returned.

Example

Assuming the patient's primary insurance has an annual maximum of $2,500, the secondary insurance has an annual maximum of $2,500, and the patient has used $2,000 in benefits: InsBenefitRemain(Patient.PersonID, FALSE)
Returns 500 ($500 remaining benefits on primary ins)

InsBenefitRemain(Patient.PersonID, TRUE)
Returns $3,000 ($500 remaining benefits on primary ins, and $2,500 remaining on secondary).

The Staff productivity related subcategory contains the following functions:

DaysWorked

Function

DaysWorked

Location in PracticeScript

Functions->Practice Answers->Staff productivity related

Purpose

Calculates the number of days a particular staff member worked during a specified date range.

Format

DaysWorked(EmployeeID, StartDate, EndDate)

EmployeeID is the ID number of the staff member.

StartDate is the date the calculation is to begin.

EndDate is the date the calculation is to end.

Evaluates to

The number of days the staff member worked during the specified period. A "Day worked" is defined as any day that has at least one dental or medical procedure posted to a patient's ledger using the EmployeeID as the Producer.

Example

DaysWorked(Emp.EmpID, FirstOfMonth(), Today())
Calculates the number of days the employee has worked so far this month. Emp.EmpID is the employee ID of the current employee record when processing a "Staff member" based Analysis Expert cell.

MinutesWorked

Function

MinutesWorked

Location in PracticeScript

Functions->Practice Answers->Staff productivity related

Purpose

Calculates the number of minutes a staff member worked during a specified date range.

Format

MinutesWorked(EmployeeID, StartDate, EndDate)

EmployeeID is the ID number of the staff member.

StartDate is the date the calculation is to begin.

EndDate is the date the calculation is to end.

Evaluates to

The number of minutes the staff member worked during the specified period. The calculation is based on COMPLETED time card entries found in the Time Card system. If an entry has NOT been clocked out, but is included in the time period, it is ignored.

Example

MinutesWorked(Emp.EmpID, Today(), Today())
Calculates the number of minutes the employee worked today. (To get the number of hours worked, divide the result of this function by 60.)

Emp.EmpID is the employee ID of the current employee record when processing a Staff member-based Analysis Expert cell.

PatientsSeen

Function

PatientsSeen

Location in PracticeScript

Functions->Practice Answers->Staff productivity related

Purpose

Calculates the number of patients a staff member has seen during a specified date range.

Format

PatientsSeen(EmployeeID, StartDate, EndDate)

EmployeeID is the ID number of the staff member.

StartDate is the date the calculation is to begin.

EndDate is the date the calculation is to end.

Evaluates to

The number of patients the staff member worked on during the specified period. A "patient seen" is defined as any patient that has at least one dental or medical procedure posted to the ledger on a unique day using the EmployeeID as the Producer. If the same patient has been seen on more than one day, PatientsSeen() will count that patient more than once (once for each day seen). If two different staff members see a patient on the same day (e.g., the hygienist does a prophy and the doctor does an exam), the patient is counted for both staff members.

Example

PatientsSeen(Emp.EmpID, FirstOfMonth(), Today())
Calculates the number of patients the employee has worked on this month so far. Emp.EmpID is the internal employee ID of the current employee record when processing a Staff member-based Analysis Expert cell.

The Office related subcategory contains the following functions:

IncBusDay

Function

IncBusDay

Location in PracticeScript

Functions->Practice Answers->Office related

Purpose

To increment the specified date by a specified number of business days (that is, days that the office is open for business). Can also be used to see if the office is open on a specified date.

Format

IncBusDay(BaseDate, NumDaysToIncrement)

BaseDate is the date on which the calculation is based.

NumDaysToIncrement is the number of business days to add to (or subtract from) BaseDate.

Evaluates to

A date that the office is known to be opened after adjusting BaseDate by the specified number of business days.
An "open day" is based on the default appointment book's definition of days that are open, as well as any exceptions to the "Open for business" setting found on the APPT BOOK main menu option. NumDaysToIncrement is based on business days. Thus, IncBusDay(Today(), 2) differs from Today()+2 in that IncBusDay() does not count days the office is not open, such as weekends or holidays. NumDaysToIncrement can be a negative number, in which case it is subtracted from BaseDate. NumDaysToIncrement can also be 0, which returns BaseDate IF the office is open on BaseDate. If the office is closed on BaseDate and NumDaysToIncrement is 0, the next day open for business is returned.

Example

IncBusDay(Today(), 2) Assuming the office is normally open Monday through Friday, and there are no holidays, this expression evaluates to Wednesday if today is a Monday. (Monday plus two working days = Wednesday.) If today is Thursday, this evaluates to the following Monday. (Thursday plus two working days = Monday.)

 IncBusDay(Today(), 0) = Today()
This expression evaluates to TRUE (1) if the office is open today. This works because incrementing a day by 0 only affects the BaseDate if BaseDate is NOT already a business day. Thus, the first parameter (Today()) in IncBusDay(Today(), 0) is unchanged if Today() is a business day. If Today() is NOT a business day, IncBusDay() returns the next date that IS a business day, and thus is equal to Today() (and the expression evaluates to FALSE).

NextOpenDay

Function

NextOpenDay

Location in PracticeScript

Functions->Practice Answers->Office related

Purpose

Calculates the next business day that the office is open following the specified date.

Format

NextOpenDay(BaseDate)
BaseDate
is the date on which the calculation is based.

Evaluates to

A date that the office is known to be open after adjusting BaseDate by 1. NextOpenDay() is functionally equivalent to IncBusDay(BaseDate, 1). For details about NextOpenDay() see the definition of IncBusDay().

Example

NextOpenDay(Today())
Assuming the office is open Monday through Friday, and there are no holidays near by, this expression evaluates to Tuesday if today is a Monday. If today is Friday, this evaluates to the following Monday.

PrevOpenDay

Function

PrevOpenDay

Location in PracticeScript

Functions->Practice Answers->Office related

Purpose

Calculates the previous business day that the office is open prior to the specified date.

Format

PrevOpenDay(BaseDate)
BaseDate
is the date on which the calculation is based.

Evaluates to

The most recent date the office was open prior to BaseDate. PrevOpenDay() is functionally equivalent to IncBusDay(BaseDate, -1). For details about PrevOpenDay(), see the definition of IncBusDay().

Example

PrevOpenDay(Today())
Assuming the office is open Monday through Friday, and there are no holidays, this expression evaluates to Tuesday if today is a Wednesday. If today is Monday, this evaluates to the previous Friday.

The Charting related subcategory contains the following syntaxes used for building Contact Experts:

The User Defined Contact Expert Pick List contains the following HIPAA-related Contact Experts:

The syntaxes for these can be accessed from the Practice Answers function category.

To customize one of these experts:

  1. From the User Defined Contact Expert Pick List, select the expert you want to customize, and click Edit. The User Defined Contact Expert Definition window is displayed.

  2. Click Formula. The Include all records that match.. window is displayed.

  3. In the Functions section, click the plus sign (+) next to Practice Answers to expand the list.

  4. Scroll down and click the plus sign (+) next to HIPAA related to expand the list.

  5. Use the functions in the list to edit the formula for the Contact Expert.

  6. Click OK.

 

Related Topics

Using Functions

Date Functions

Special Functions

Strings Functions

Time Functions

User Defined Functions

Prompt User for Info Functions