extract_impression
RadReportExtractor.extract_impression(str,
text: bool = True,
include_key: bool = False,
word_boundary: int] = re.IGNORECASE,
flags: Union[re.RegexFlag, 'greedy', 'sequential'] = 'greedy',
match_strategy: Literal[bool = True,
verbose: )
Extract the impression section from the radiology report text.
Parameters
Name | Type | Description | Default |
---|---|---|---|
text | str | The input radiology report text. | required |
include_key | bool | Whether to include the section key in output, by default True | True |
word_boundary | bool | Whether to wrap word boundary around the section keys, by default False |
False |
flags | Union[re.RegexFlag, int] | Regex flags to use in pattern matching. For ‘re’ backend: These are directly passed to re.compile() For ‘re2’ backend: These are converted to re2.Options properties By default re.IGNORECASE | re.IGNORECASE |
match_strategy | (greedy, sequential) | Strategy for matching end keys: - “greedy”: Use first matching end key (faster) - “sequential”: Try end keys in order (more precise) Default is “greedy” | "greedy" |
verbose | bool | If True, prints messages if multiple start matches are found. Default is True. | True |
Returns
Name | Type | Description |
---|---|---|
str | The extracted impression section text. Returns empty string if section not found. |