import re


def parse_summary(text):
	"""
	parses and separates input text from summary in cxr reports, returns None if
	not found

	params: text
	returns: None or [input_text, summary]
	"""

	regex = r'impression.?(?::|" ")'

	if( re.search(regex, text, flags=re.IGNORECASE)==None ): #if no summary
		return None;

	data = re.split(regex, text, flags=re.IGNORECASE);
	data[0] = data[0].strip();
	data[1] = data[1].strip();

	return(data);