Table 2.
Java regular expression component | Translation (meaning of the regular expression component => translation in context of age + gravida/para status) | Example 1: 32-yo G1 now P2 | Example 2: 24 years old gravida IV para I now II |
---|---|---|---|
(\\d{2}) | Exactly 2 numbers => maternal age digits | 32 | 24 |
\\W* (only defined in this table once for brevity) | (Same translation for every instance of \\W*) Non-letter/underscore => a space or punctuation separating the other age components | - | |
[yearhs]* | Any 0 or more of the letters in the brackets => representation of the word “year” in the maternal age (e.g., “year” or the “y” part of “yo”); the extra h is not a typo in the pattern but rather represents a typo in the note text that we wanted to capture | y | years |
[oldp]* | Any 0 or more letters in the brackets => representation of the word “old” in the maternal age (e.g., “old” or the “o” part of “yo”); again, the extra p is a typo in the note text that we want to capture | o | old |
(Gravida|gravida|G| primparous|primiparous| primigravida| multiparous|primip) | Any of the terms separated by the vertical bar => representation of “gravida” (the number of pregnancies to date), “primiparous” (having one live birth), or “multiparous” (having more than one live birth) | G | gravida |
[0–9IVX]* | Any of the digits 0–9 or upper case letters I, V or X => representation of the gravida value, either with Arabic or Roman numerals | 1 | IV |
(now)* | The word “now” => indicates the change in para information from before the current delivery to after the current delivery | now | |
(para|Para|P|p)* | Any of the terms separated by the vertical bar => representation of “para” (i.e., the number of live births) | P | para |
([0–9IVX]*) | See above | 2 | I |
(now)* | See above | now | |
([0–9IVX]*) | See above | II |
A star (*) in the pattern means that the pattern can occur 0 or more times. We had to account for 0 occurrences because every note was missing at least one component of the pattern.