Each pattern attribute has a set of keywords, and each keyword has a name and a collection of matching phrases:
Suppose that a pattern attribute has keywords as follows:
Keyword | Matching Phrase |
---|---|
FH | fh, family history, f hist |
DB | db, diabetes, dm, t2dm |
ANAEMIA | anemia, anaemia |
Here are some clinical notes converted to lists of these keywords:
Clinical note | Converted |
---|---|
f hist anemia and t2dm, unwell, tired | FH ANAEMIA DB |
overweight, family history diabetes | FH DB |
When a pattern attribute appears in a case, its value is that of the associated attribute converted to a list of keywords. This is done for every episode. For example, here is a pattern attribute called “NotesSummary” that analyses values of “ClinicalNotes”:
It is possible to write rule conditions that directly compare a required string with these values. For example, for this case we could use a condition
NotesSummary contains "ANAEMIA"
To add a comment about the patient having a known disease.
However, this is not the recommended approach to using pattern attributes. One reason for not using keywords directly in a condition is that we may need to change the name of a keyword, and if we do, rules that rely on the presence or absence of the original keyword name will fail.
Keywords are regular expressions
A regular expression is a string of text in which certain characters take on a special meaning, so that the expression itself represents a whole class of texts. A familiarĀ example is that “*.jpg” represents any file with the extension “.jpg”.
In Pattern Attributes, the matching phrase of keywords are interpreted by RippleDown as regular expressions. This is mostly of use in analysing lengthy documents. For theĀ analysis of clinical notes and other short texts, regular expressions can pretty much be ignored.
Matching punctuation
Because a matching phrase for a keyword is a regular expressions, care must be taken when adding a matching phrase for punctuation such as a full-stop (period). These characters need to be ‘escaped’ with a backslash symbol ”.
Another character that must be escaped is the question mark.