How Do I Code a Myocardial Infarction? I21 for Four Weeks, I22 for a Second MI Within Them, and I25.2 After
Part ofCardiovascular and kidney · step 3 of 6 · Read nextAfter a CABG: Z95.1 Bypass Graft Status, I25.7- and I25.810 Graft Atherosclerosis, and Z48.812 Aftercare
Editorial explanation — not an official CMS/CDC rule. Official coding instructions and source material are identified below. How to read the labels
Current data releases:ICD-10-CM FY2027 · ICD-10-PCS FY2027 · HCPCS October 2026 · MS-DRG v44 · Medicare Code Editor v44.0 · NCCI PTP Q4 2026 · MUE Q4 2026 · NCD code lists 2026-01 · LCD export September 28, 2026 · All releases and sources
Quick answer · MedCoder editorial
An acute myocardial infarction is coded from category I21 for four weeks from onset: I21.9 when type and site are unspecified, I21.0–I21.3 for a type 1 STEMI by site, I21.4 for a type 1 NSTEMI, I21.A1 for a type 2 MI with its cause coded first, I21.A9 for types 3–5. A further type 1 or unspecified MI within those four weeks adds I22. After four weeks, continuing care takes an aftercare code; a healed infarction needing no care is I25.2.
Jump to the decision rule ↓What decides the answer?
- How long ago the infarction began — inside or beyond four weeks (28 days)
- The documented type: type 1 STEMI (by site), type 1 NSTEMI, type 2, or types 3–5
- Whether a second infarction occurred within four weeks of the first, and of what type
- Whether the encounter still treats the infarction, or only its aftermath, or nothing at all
- The underlying cause, for a type 2 MI (Code First at I21.A1)
- tPA given at another facility in the prior 24 hours (Z92.82)
Why it matters
A clock, a type, and a count: the three things the code carries
Category I21, Acute myocardial infarction, is defined by time. Its Includes note reads myocardial infarction specified as acute or with a stated duration of 4 weeks (28 days) or less from onset. The Guidelines turn that into the sequencing rule coders actually need (Section I.C.9.e.1):
Official source“For encounters occurring while the myocardial infarction is equal to, or less than, four weeks old, including transfers to another acute setting or a postacute setting, and the myocardial infarction meets the definition for ‘other diagnoses’ (see Section III, Reporting Additional Diagnoses), codes from category I21 may continue to be reported. For encounters after the 4-week time frame and the patient is still receiving care related to the myocardial infarction, the appropriate aftercare code should be assigned, rather than a code from category I21. For old or healed myocardial infarctions not requiring further care, code I25.2, Old myocardial infarction, may be assigned.”
So the same infarction moves through three codes as time passes: I21 during the four weeks, an aftercare code when care continues beyond them, and I25.2 — whose inclusion terms are healed myocardial infarction and past myocardial infarction diagnosed by ECG or other investigation, but currently presenting no symptoms — once it is history. I25.2 is a disease-chapter code, not a Z86 history code; the Alphabetic Index sends “Infarct, myocardium, past” straight to it.
Within the four weeks, the code also carries the type. Type 1 STEMI is coded by site (I21.0- anterior wall by artery, I21.1- inferior wall, I21.2- other sites, I21.3 unspecified site); type 1 NSTEMI is I21.4, whose inclusion terms take in acute subendocardial, non-Q wave and nontransmural infarctions. I21.9 is the default when type or site is not documented. The Guidelines resolve the two common edge cases: “If only type 1 STEMI or transmural MI without the site is documented, assign code I21.3”; and “If an AMI is documented as nontransmural or subendocardial, but the site is provided, it is still coded as a subendocardial AMI” — I21.4, with the site adding nothing. An NSTEMI that evolves to STEMI is coded as STEMI; a STEMI converted to NSTEMI by thrombolytics is still STEMI.
Types 2 to 5 have their own codes. I21.A1, Myocardial infarction type 2 (demand ischemia, ischemic imbalance), carries a Code First note for the underlying cause — anemia, COPD, paroxysmal tachycardia, shock — so the cause leads. I21.A9, Other myocardial infarction type, covers types 3, 4a, 4b, 4c and 5, with Code First for a postprocedural MI following or during cardiac surgery (I97.190, I97.790) and a Code Also list for the stent or graft complication that caused it. Category I21 also carries Use Additional Code notes for tobacco exposure, use and dependence, and for Z92.82 when tPA was given at another facility within the previous 24 hours — Z92.82 in turn says Code First the acute MI.
A second infarction inside the four weeks: I22 with I21
Category I22 exists for one situation, stated in its Includes note: acute myocardial infarction occurring within four weeks (28 days) of a previous acute myocardial infarction, regardless of site. The Guidelines add the constraints (Section I.C.9.e.4):
Official source“A code from category I22, Subsequent ST elevation (STEMI) and non-ST elevation (NSTEMI) myocardial infarction, is to be used when a patient who has suffered a type 1 or unspecified AMI has a new AMI within the 4 week time frame of the initial AMI. A code from category I22 must be used in conjunction with a code from category I21. The sequencing of the I22 and I21 codes depends on the circumstances of the encounter.”
Official source“Do not assign code I22 for subsequent myocardial infarctions other than type 1 or unspecified. For subsequent type 2 AMI assign only code I21.A1. For subsequent type 4 or type 5 AMI, assign only code I21.A9.”
The tabular says the same from the other end: I22 carries an Excludes1 for subsequent type 2 (I21.A1) and for subsequent types 3, 4 and 5 (I21.A9). And when the two infarctions are of different types within the four weeks, I22 is not used at all — the Guidelines assign a code from I21 for each type instead. I22 is reserved for the case where both the initial and the subsequent infarction are type 1 or unspecified.
How to apply it
How to apply the rule
- Establish when the infarction began. Inside four weeks (28 days) → category I21. Beyond four weeks with care still directed at it → the appropriate aftercare code. Healed and untreated → I25.2.
- Inside the four weeks, read the type. Type 1 STEMI → I21.0-–I21.3 by documented site (I21.3 when only “STEMI” or “transmural” is documented). Type 1 NSTEMI, subendocardial or nontransmural → I21.4, whatever site is named. No type or site → I21.9.
- Type 2 → I21.A1 with the documented cause coded first. Types 3, 4 or 5 → I21.A9, with the postprocedural MI code first if applicable and the causing complication coded also.
- A second type 1 or unspecified MI within four weeks of the first → add the I22 code to the I21 code; order by the circumstances of the encounter. A second MI of a different type → two I21 codes, no I22.
- Add the Use Additional codes the record supports: Z92.82 for tPA at another facility within 24 hours, and the tobacco codes.
Examples
Coding examples
- Admitted with NSTEMI, day 3 of stay.I21.4. The site, if documented, does not change the code.
- Transferred to inpatient rehabilitation two weeks after an anterior-wall STEMI involving the LAD. The infarction is still inside its four weeks and meets the definition of an other diagnosis, so I21.02 continues to be reported — the Guidelines say so explicitly for transfers to a postacute setting.
- Cardiac rehabilitation visit six weeks after the infarction. No code from I21: after four weeks, care related to the infarction takes the appropriate aftercare code.
- ECG at an unrelated visit shows an old infarction; no symptoms, no treatment.I25.2 — its inclusion term names exactly this.
- Second type 1 NSTEMI ten days after a STEMI. The I21 code for the first infarction plus I22.2 for the subsequent NSTEMI, sequenced by the circumstances of the encounter.
- Type 2 MI documented as due to severe anemia. The anemia code first, then I21.A1 — the Code First note at I21.A1 orders it.
Practice
Practice scenarios
Scenario 1
ECG at an unrelated visit shows an old infarction; the patient has no symptoms and receives no treatment for it.
- Coding question
- I25.2 or a Z86 history code?
- Decision
- I25.2.
- Why
- Its inclusion term reads “Past myocardial infarction diagnosed by ECG or other investigation, but currently presenting no symptoms”; the classification keeps a healed infarction in the circulatory chapter.
- Documentation check
- That no care is directed at the infarction and no symptoms are attributed to it.
Scenario 2
Second type 1 NSTEMI ten days after a STEMI.
- Coding question
- Two I21 codes, or I21 with I22?
- Decision
- The I21 code for the first infarction plus I22.2, sequenced by the circumstances of the encounter.
- Why
- Section I.C.9.e.4: a new type 1 or unspecified AMI within four weeks of the initial AMI takes a code from I22, which must be used with a code from I21.
- Documentation check
- That both infarctions are type 1 or unspecified, and the dates that put the second inside four weeks.
Each scenario restates one of the worked examples above in decision form; none adds a clinical fact or a code the example does not already assign.
Common mistakes
Common mistakes
- Reporting a past infarction with a Z86.7- history code. ICD-10-CM classifies a healed infarction to I25.2 in the circulatory chapter; the Index entry “Infarct, myocardium, past” points there.
- Continuing category I21 beyond four weeks. After 28 days it is an aftercare code, or I25.2.
- Assigning I22 for a subsequent type 2 MI — only I21.A1 is assigned — or for a second infarction of a different type, where two I21 codes are used instead.
- Using I21.9 when the record documents “STEMI” without a site: that is I21.3.
- Sequencing a type 2 MI ahead of its documented cause; I21.A1 carries Code First.
- Adding a chest-pain symptom code beside a confirmed MI — the symptom is integral to the diagnosis.
Documentation matters
Documentation that changes the coding
- The date of onset, or the number of days since the infarction — the four-week boundary.
- Type 1, 2, 3, 4 or 5; STEMI or NSTEMI; the site for a STEMI.
- A second infarction within four weeks, and its type.
- Whether the current encounter treats the infarction, treats its aftermath, or merely records it as history.
- The underlying cause of a type 2 MI, and the procedure or device complication behind a type 4 or 5 MI.
- tPA given at another facility within the previous 24 hours; tobacco use, dependence or exposure.
Decision rule
Decision framework
| IF… | THEN… |
|---|---|
| MI within four weeks (28 days) of onset, type and site not documented | I21.9 |
| Type 1 STEMI, site documented | I21.0-, I21.1- or I21.2- by site |
| “STEMI” or “transmural MI” with no site | I21.3 |
| Type 1 NSTEMI, subendocardial or nontransmural (any site) | I21.4 |
| Type 2 MI with a documented cause | The cause first, then I21.A1 |
| Type 3, 4 or 5 MI | I21.A9; postprocedural MI code first if applicable; complication coded also |
| Second type 1 or unspecified MI within four weeks of the first | I21 code + I22 code; sequence by the circumstances of the encounter |
| Second MI of a different type within four weeks | An I21 code for each type; no I22 |
| Encounter after four weeks, care still directed at the infarction | The appropriate aftercare code, not I21 |
| Healed or old infarction, no further care | I25.2 — not Z86.7- |
| tPA given at another facility within the previous 24 hours | Add Z92.82 (Use Additional at I21/I22; Z92.82 says Code First the MI) |
FAQ
How long is a heart attack coded as acute?
Four weeks (28 days) from onset. Category I21 includes a myocardial infarction specified as acute or with a stated duration of 4 weeks or less from onset, and the Guidelines allow I21 to continue through that window, including transfers to another acute or postacute setting, when the infarction meets the definition of an other diagnosis.
Is a healed heart attack coded with a history code?
No. A healed or old myocardial infarction that needs no further care is I25.2, Old myocardial infarction, a code in the circulatory chapter whose inclusion terms name a healed infarction and a past infarction found on ECG. The Z86 history codes are not used for it.
Which code is used when the type of MI is not documented?
I21.9, Acute myocardial infarction, unspecified, is the default for an unspecified acute MI or unspecified type. If only type 1 STEMI or transmural MI without a site is documented, the code is I21.3 instead.
When is a code from I22 used?
When a patient who had a type 1 or unspecified acute MI has a new acute MI within four weeks of it. The I22 code is used together with a code from I21, and the order depends on the circumstances of the encounter.
Is a type 2 MI ever coded to I22?
No. The Guidelines direct that a subsequent type 2 AMI takes only I21.A1, and a subsequent type 4 or 5 AMI takes only I21.A9; I22 carries an Excludes1 for both.
What goes first, the type 2 MI or its cause?
The cause. I21.A1 carries a Code First note for the underlying cause, if applicable — anemia, COPD, paroxysmal tachycardia or shock — so that condition is sequenced before the infarction code.
Code set release
This guide was verified against ICD-10-CM FY2027, effective October 1, 2026.
Code relationships
| Relationship | At | Names | Note |
|---|---|---|---|
| includes | I21 | myocardial infarction specified as acute or with a stated duration of 4 weeks (28 days) or less from onset | |
| excludes2 | I21 | I25.2 (old myocardial infarction); I24.1 (postmyocardial infarction syndrome); I22.- (subsequent type 1 myocardial infarction) | |
| use-additional | I21 | Z92.82 (tPA at a different facility within 24 hours); F17.- (tobacco dependence); Z72.0 (tobacco use); Z87.891 (history of tobacco dependence); Z77.22, Z57.31 (tobacco smoke exposure) | |
| code-first | I21.A1 | the underlying cause, if applicable: D50.0–D64.9 (anemia); J44.- (COPD); I47.0–I47.9 (paroxysmal tachycardia); R57.0–R57.9 (shock) | |
| code-first | I21.A9 | I97.190 / I97.790 (postprocedural myocardial infarction following / during cardiac surgery), if applicable | |
| code-also | I21.A9 | T82.897- (stent occlusion); T82.855- (stent stenosis); T82.867- (stent thrombosis); I46.2; I97.89 (PCI complication); T82.218- (occlusion of coronary artery bypass graft) | |
| excludes1 | I22 | I21.A1 (subsequent type 2 MI); I21.A9 (subsequent MI of types 3, 4, 5) | |
| sequencing | I22 | I21.- (the initial infarction) | Guidelines I.C.9.e.4: I22 must be used with a code from I21; sequencing depends on the circumstances of the encounter |
| code-first | Z92.82 | I21.-, I22.- (acute myocardial infarction); I63.- (acute cerebral infarction) |
Relationships are quoted from the FY tabular notes and Official Guidelines the guide cites; none are inferred.
Relationships are quoted from the tabular notes and Official Guidelines sections the guide cites; the wording of each row is MedCoder’s.
Compare these pairs
Each pair below is one the tabular notes link; its Compare page quotes the note and says whether the two can be reported together.
Authoritative sources
Applies to FY2027 ICD-10-CM
Verified against the FY 2027 ICD-10-CM Official Guidelines (Section I.C.9.e.1–5) and the FY 2027 tabular notes at I21, I21.4, I21.9, I21.A1, I21.A9, I22, I25.2 and Z92.82.
- ICD-10-CM Official Guidelines for Coding and Reporting, FY 2027 (Section I.C.9.e, Acute myocardial infarction)
- FY 2027 ICD-10-CM Tabular List (I21, I21.0–I21.B, I22, I24.1, I25.2, Z92.82)
Official guidance cited
The Official Guidelines sections this guide quotes or applies, by heading. Passages set as quotations above are the sections’ own words; the surrounding text is MedCoder’s reading of them.
- Section I.C.9.e.1 — Type 1 ST elevation myocardial infarction (STEMI) and non-
- Section I.C.9.e.4 — Subsequent acute myocardial infarction
Passages set as quotations are verbatim official text from the sources listed. Surrounding explanation, decision tables and examples are MedCoder’s editorial reading of those sources and are not official statements. Examples are illustrative; they assign no code to any real patient.
Coder Takeaway: Count from onset: I21 for four weeks, an added I22 only for a second type 1 or unspecified MI inside them, aftercare after them, and I25.2 once the infarction is healed and untreated. Type 2 takes I21.A1 behind its cause and never I22.
Coding questions
No community questions relate to this guide yet.
Ask a Coding Question about this guide.
Didn’t find your answer?
Ask a coding question and get help from the MedCoder community.
Applicable code set: FY2027. Published September 5, 2026; last updated October 1, 2026; last reviewed October 1, 2026.