In an office or outpatient visit, the code listed first is the first-listed diagnosis: the diagnosis, condition, problem or other reason shown in the record to be chiefly responsible for the services provided. It is not always the most serious condition, and not always the first line of the note.
After it, list the coexisting conditions that were addressed or that affected the care: a chronic condition whose medicine was adjusted, a problem examined today. Conditions that were not addressed and do not affect today's care are left out.
Ask: why did the patient come in today, and what did the provider spend the visit on? A patient who comes in for sinus pain and also has hypertension that the provider rechecks gets the sinusitis first, then the hypertension.
Inpatient stays use a different rule, the principal diagnosis "after study"; that comes in the Advanced level.
The reason for the visit first, then what else was addressed.