Text Attributes are used to extract meaning from free text such as clinical notes.

For example, suppose you want to decide if the clinical notes for a patient indicate that they are diabetic.  You could build rules that match key phrases, such as ‘diabetic’, ‘diabetes mellitus’, ‘dm’  and so on. This approach would give a lot of false matches, however, because it does not take into account the  context of a match. Thus ‘mother diabetic’, ‘screen for dm’, and ‘dm?’ would falsely be given  the meaning ‘diabetic’.

This strategy can be strengthened by adding rules to exclude matches if the analysed text contains other key phrases such as ‘family history’. However, this will lead to legitimate matches being missed, for example ‘diabetic, ?ihd’, ‘dm, family history chd’ and so on.

With a Text Attribute, you define:

  • a primary attribute whose values will be analysed
  • a set of matching phrases that mark a potential match
  • a set of phrases that invalidate a match if they immediately precede a matching phrase
  • a set of phrases that invalidate a match if the immediately follow a matching phrase.

Additionally, a Text Attribute has a set of examples that allow you to see the effect of changes to the matching phrase and exception lists.

Defining a Text Attribute

First open the Attribute Editor (Edit|Attribute Editor) and find the attribute that you want to analyse the  values of. Right-click this attribute and from the popup menu choose ‘Add Text attribute…’:

14 text att 7.4

You will be prompted for the name of the new Text Attribute, once the name is entered you will be shown the editing dialog for the new Text Attribute:

 

Towards the top of the image, are the tabs for setting the matching phrases and exception phrases. In this image, the matching phrases tab is highlighted.

15 text contains 7.4

Matching phrases can be added and removed using the buttons provided. By clicking on the other tabs you can add and remove phrases from the exception phrases. For example, here
16 text exceptions 7.4

We have just added the phrase ‘in family’ to the ‘Except if before’ tab. This means that any matching phrases will not count as a match if it is immediately before ‘in family’. You can see this in the ‘Examples’ table:  ‘diabetes’ is one of the matching phrases, but ‘diabetes in family’ will not match.

As you add matching and exception phrases, some combinations of them get added to the examples table. By clicking the ‘Modify’ button for the examples table you can also add, remove, import and export these values.

Importing and exporting phrases and examples

The ‘Import’ button is for adding phrases from a file. The format of the file is one phrase per line. You might want to use the ‘Import’ button to add matches exported from a Text Attribute from another project, or provided by PKS.