The note section method is a text processing technique that uses the clinical note section to provide context about the meaning of keywords found in those sections. For example, let's consider medications, if you searched for the drug name Codeine in a clinical note and found it in the current medication section, you would conclude that the patient has been prescribed the drug. However, if you found the exact same name in the drug allergy section, you would probably conclude that the patient is not being prescribed the drug. Similarly, the diagnosis hypertension appearing in past medical history, has a very different meaning than if it were found in the family medical history section. When hypertension appears in past medical history, you know the patient has hypertension. But when it appears in family history, you only know that someone in the patient's family has hypertension, but not necessarily the patient themselves. In each of these cases, the actual text found is identical, but the context and meaning of the words are completely different. Let's talk a bit more about how to implement this technique with an example. Our goal is to identify patients who experienced muscle pain while taking a statin. Statins are a class of medication that are taken preventively to lower cholesterol and reduce the risk of cardiovascular disease. Muscle pain or myopathy, is one of the most common side effects and is one of the major reasons why patients stop taking their Statin. The first step to solving this problem is to identify which note types and what sections in those not types would have the information we need. Oftentimes, drug side effects that cause the patient to stop taking a drug are recorded in the medication allergy section. Even if the reaction isn't a true allergy. We know that history and physical notes as well as things like admission and discharge summaries, all tend to have medication allergy sections. Now that we've identified our note and section types, we can search the notes for section headers that mean medication allergies. Our goal is to find the section and extract all the text in that section. There are two general approaches to this task. The first method, looks to see if there's any standard section delimiter. For example, if all sections start with a new line. If the notes are well formatted and have this kind of structure, we can use that delimiter to split the node into the individual parts. The second approach is more common, because many notes lack the consistent structures needed for the first method. In this approach, the first step is to identify all the different terms used in the dataset to indicate the same note section. For example, sections labeled drug allergies or even just allergies, will all mean the same thing. Once that list has been created, you'll want to look at the section header immediately following the allergy section. Again, because each note may have a slightly different order, you'll have a few different header types for that next section. But once you have a list of all those next section headers, you can easily extract all of the information between the allergy header in the next section. Regardless of which extraction method you use, once you have that allergy section extracted, you search for your keyword of interest. In this case, the stat name, including both the generic and the brand name. For example, we would search for atorvastatin and lipitor, simvastatin and zocor. We can also use the class name stan. If any of these drug names are present, then we can initially call them a case. They have an allergy to a Statin. However, many allergy sections actually list the specific reaction caused by the allergy. In the case of statins, in some patients the Statin actually affects liver function. This calls for an extraction task, pulling out the reason listed for the allergy. In a lot of cases the reason is stored between two parenthesis. Once we have extracted the text, we can search if the reason list has something to do with muscle pain or the clinical term myopathy. Sometimes you may find that it's actually easier to just exclude all phrases that don't indicate myopathy, than to pull out all the different ways the muscle pain reaction is recorded. If you have a record where no reason has given, you can either ignore it and say you don't have enough information, or conclude that because muscle pain is the most common reaction, then it probably means they had a muscle pain reaction. As you can tell, this approach does require a bit of experience in understanding clinical note types and the types of sections found in each note, as well as the meaning of those notes section. Well, we'll cover this information for a number of common note types. This is a case where having a clinician as part of your clinical data science team can make a huge difference.