You might think finding the right code for hospital acquired pneumonia (HAP) is a simple task. After all, pneumonia is a common diagnosis.
But here is the truth. The ICD-10 coding system is more specific than you might expect. And when you add the words “hospital acquired” to the equation, things get a little more complex.
Why? Because the timing of the infection changes everything. A pneumonia that starts in the community is coded differently than one that develops after a patient has been admitted to your facility.
This guide walks you through exactly what you need to know. We will cover the correct codes, the documentation requirements, and the common pitfalls that catch even experienced coders off guard.
Let us get started.

What Is Hospital Acquired Pneumonia? A Quick Clinical Refresher
Before we dive into codes, let us make sure we are on the same page clinically.
Hospital acquired pneumonia (HAP) is defined as pneumonia that occurs 48 hours or more after a patient is admitted to a hospital. Importantly, the infection cannot have been incubating at the time of admission.
This timing distinction matters because the bacteria causing HAP are often different from those found in the community. Hospital environments harbor more resistant organisms like MRSA and Pseudomonas aeruginosa. That is why HAP is treated more aggressively.
But from a coding perspective, the timing is your primary clue. If the patient arrives with symptoms, that is not HAP. If symptoms start on day three of their stay, you are likely looking at a true hospital acquired case.
The Primary ICD-10 Code for Hospital Acquired Pneumonia
Here is the direct answer you came for.
The ICD-10 code for hospital acquired pneumonia is J15.9.
This code falls under the category “Unspecified bacterial pneumonia.” You will find it within the larger block of codes for pneumonia due to other infectious organisms.
But wait. There is an important conversation to have here.
J15.9 is accurate, but it is also unspecified. Many coding professionals and payers prefer a more specific code whenever possible. That means identifying the actual organism causing the pneumonia.
Let me explain.
Why J15.9 Is Often a Temporary Code
J15.9 tells the reader: “This patient has bacterial pneumonia that was acquired in the hospital, but we do not know which bacteria caused it.”
That is acceptable in many situations, especially when culture results are still pending or when the patient is treated empirically. However, if the lab later identifies a specific organism, you should update the code.
Consider this scenario. A patient develops fever and infiltrates on chest x-ray on hospital day four. The team starts broad-spectrum antibiotics. The initial coding might use J15.9. Three days later, sputum cultures grow Klebsiella pneumoniae. At that point, the more accurate code becomes J15.0 (Pneumonia due to Klebsiella pneumoniae).
The difference matters for several reasons:
- Tracking antibiotic resistance patterns
- Hospital quality metrics
- Reimbursement accuracy
- Public health reporting
So think of J15.9 as your starting point, not your final destination.
Complete List of Related ICD-10 Codes for HAP
The ICD-10 system does not have a single code that says “hospital acquired pneumonia” in those exact words. Instead, you combine a pneumonia code with additional information about the setting.
Here are the most common codes you will use for HAP, organized by the specific organism when known.
| Organism / Type | ICD-10 Code | Description |
|---|---|---|
| Unspecified bacteria | J15.9 | Unspecified bacterial pneumonia |
| Pseudomonas | J15.1 | Pneumonia due to Pseudomonas |
| Staphylococcus | J15.2 | Pneumonia due to Staphylococcus (specify MRSA status if known) |
| Group B streptococcus | J15.3 | Pneumonia due to Group B streptococcus |
| Other streptococci | J15.4 | Pneumonia due to other streptococci |
| E. coli | J15.5 | Pneumonia due to Escherichia coli |
| Other Gram-negative bacteria | J15.6 | Pneumonia due to other Gram-negative bacteria |
| Klebsiella | J15.0 | Pneumonia due to Klebsiella pneumoniae |
| Mycoplasma | J15.7 | Pneumonia due to Mycoplasma pneumoniae |
| Anaerobes | J15.8 | Pneumonia due to other specified bacteria |
| Viral HAP (rare) | J12.9 | Viral pneumonia, unspecified |
| Aspiration HAP | J69.0 | Pneumonitis due to inhalation of food and vomit |
A special note about J69.0. Aspiration pneumonia in the hospital setting is common, especially in patients with swallowing difficulties or altered mental status. If the aspiration event happened after admission and caused pneumonia, this code accurately captures the mechanism.
The Role of Secondary Codes: Why You Cannot Stop at One Code
Here is something many guides skip over.
Hospital acquired pneumonia is rarely the only thing happening in a patient’s chart. Most patients who develop HAP have underlying conditions that made them vulnerable in the first place.
That means you need to assign secondary diagnosis codes. These tell the complete story.
Common Secondary Diagnoses Accompanying HAP
Think about the typical patient who develops pneumonia in the hospital. What brought them there initially? What conditions increase their risk?
- Chronic lung disease (J44.9 for COPD, J45.909 for unspecified asthma)
- Heart failure (I50.9)
- Diabetes mellitus (E11.9 for Type 2)
- Chronic kidney disease (N18.9)
- Malignancy (C80.1 for malignant neoplasm unspecified)
- Immunosuppression (D84.9)
- Stroke with dysphagia (I69.391 for late effects of stroke with dysphagia)
Here is a practical example.
A 72-year-old man is admitted for congestive heart failure exacerbation (I50.9). On hospital day five, he develops fever and productive cough. A chest x-ray shows a new infiltrate. Sputum cultures grow Pseudomonas. You would code:
- Principal diagnosis (reason for admission): I50.9 (Heart failure)
- Secondary diagnosis (HAP): J15.1 (Pseudomonas pneumonia)
- Additional code: Any relevant manifestations or complications
The order matters. The reason for the admission stays first. The HAP becomes a secondary diagnosis because it developed after arrival.
How to Document HAP for Accurate Coding: A Checklist for Clinicians
Coding accuracy starts with documentation. If the physician does not write it down, it did not happen. That sounds harsh, but it is the reality of medical coding.
Here is a simple checklist for clinicians documenting a possible HAP.
Required elements:
- Date of symptom onset (must be ≥48 hours after admission)
- Respiratory symptoms (cough, sputum production, dyspnea)
- Fever or hypothermia (temperature >38°C or <36°C)
- New or progressive infiltrate on chest imaging
- Oxygen saturation or blood gas findings
- White blood cell count (elevated or suppressed)
Elements that improve specificity:
- Specific organism identified (include culture results)
- Antibiotic sensitivities when available
- Whether the patient was intubated or on mechanical ventilation (this suggests ventilator-associated pneumonia, which has its own coding considerations)
- Any aspiration event documented
Do not write:
“Patient has hospital acquired pneumonia.”
Instead write:
“On hospital day three, the patient developed fever to 38.9°C, new productive cough, and oxygen desaturation to 88% on room air. Chest x-ray shows a new right lower lobe infiltrate not present on admission. Sputum culture is pending. This represents hospital acquired pneumonia. Will treat empirically with vancomycin and cefepime.”
See the difference? The second note contains the timing, the symptoms, the objective findings, and the clinical judgment. A coder can confidently assign J15.9 from that note. And when the culture comes back, they can update to a more specific code.
HAP vs. CAP vs. VAP: A Comparison Table
This is where confusion often creeps in. Let us clarify the differences between community acquired pneumonia (CAP), hospital acquired pneumonia (HAP), and ventilator associated pneumonia (VAP).
| Feature | CAP | HAP | VAP |
|---|---|---|---|
| Timing of onset | Before admission or within first 48 hours | ≥48 hours after admission | ≥48 hours after endotracheal intubation |
| Setting | Community, home, or nursing home (non-hospital) | General hospital ward | Intensive care unit, intubated patient |
| Typical organisms | Strep pneumoniae, H. influenzae, atypical bacteria | MRSA, Pseudomonas, Klebsiella, E. coli | Same as HAP, often more resistant |
| ICD-10 code examples | J15.61 (Strep pneumoniae), J13 (S. pneumoniae) | J15.9, J15.1, J15.0, etc. | Same codes as HAP, but with additional procedure code for ventilation |
| Additional coding needed | Usually none for location | Must document timing to distinguish from CAP | Need code for long-term mechanical ventilation (Z99.11) if applicable |
The most common mistake? Coding a pneumonia that starts on hospital day two as HAP. Remember the 48-hour rule. Day two might still be within 48 hours depending on admission time. If the patient came in at 10 PM on Monday and symptoms appear at 6 AM on Wednesday, that is less than 48 hours. That is still CAP.
Common Coding Mistakes and How to Avoid Them
Let me share the errors I see most often. Avoid these, and your coding accuracy will improve immediately.
Mistake #1: Coding HAP Without Confirming the 48-Hour Rule
I already mentioned this, but it deserves repeating. Some coders assume any pneumonia that appears “a few days” after admission qualifies. That is not precise enough.
The fix: Calculate the exact hours from admission to symptom onset. If you cannot document at least 48 hours, default to a CAP code.
Mistake #2: Using J15.9 When a Specific Organism Is Known
This is a missed opportunity for specificity. If the chart contains a culture result, use the organism-specific code.
The fix: Review microbiology reports before finalizing the code. If the chart says “Pseudomonas,” do not use J15.9. Use J15.1.
Mistake #3: Forgetting to Code the Underlying Condition
HAP is almost never a standalone event. Yet I see charts where the only code is J15.9. That is incomplete.
The fix: Ask yourself, “Why was this patient in the hospital long enough to develop HAP?” The answer to that question belongs in the coding.
Mistake #4: Confusing Aspiration Pneumonia with Bacterial HAP
These are different clinical entities with different codes. Aspiration pneumonia (J69.0) involves a chemical pneumonitis from stomach contents. Bacterial HAP involves an infectious organism. They can occur together, but they are not the same.
The fix: If the note describes “aspiration” or “inhalation of gastric contents,” consider J69.0. If it describes fever, leukocytosis, and positive cultures, lean toward J15 codes.
Mistake #5: Missing the Ventilator Association
A patient on a ventilator who develops HAP actually has VAP. While the pneumonia code remains the same (J15.9, etc.), you need an additional code to capture the ventilator dependence.
The fix: For any intubated patient with new pneumonia after 48 hours of intubation, add Z99.11 (Long-term (current) use of mechanical ventilation).
Real-World Coding Scenarios
Let us walk through three patient scenarios. Read each one, decide on your codes, then check against my recommendations.
Scenario 1: The Post-Surgical Patient
A 68-year-old woman undergoes elective hip replacement surgery. Her surgery is on Monday morning. On Thursday morning (72 hours post-admission), she develops fever, chills, and a cough producing green sputum. Her chest x-ray shows a new left lower lobe infiltrate. Sputum culture is ordered but results are not yet available.
What codes do you assign?
My answer:
- J15.9 (Unspecified bacterial pneumonia)
- Z47.1 (Aftercare following joint replacement surgery) – or the specific aftercare code for hip replacement
The pneumonia is clearly hospital acquired (onset day three). Without a specific organism, J15.9 is appropriate for now. The aftercare code explains why she was in the hospital.
Scenario 2: The Long-Stay Patient with Known Organism
A 55-year-old man with advanced COPD is admitted for an acute exacerbation. On hospital day 10, he spikes a fever. A bronchoscopy is performed. Cultures grow Klebsiella pneumoniae. The team documents “hospital acquired pneumonia due to Klebsiella.”
What codes do you assign?
My answer:
- J15.0 (Pneumonia due to Klebsiella pneumoniae)
- J44.1 (COPD with acute exacerbation) – this was the admission reason
Notice we use J15.0, not J15.9, because the organism is specified. The COPD code remains primary because that is why he was admitted initially.
Scenario 3: The Ventilated Patient
A 45-year-old man is admitted to the ICU with traumatic brain injury. He is intubated on admission. On hospital day six, he develops new fever, increased respiratory secretions, and his ventilator settings need to be increased. A chest x-ray shows bilateral infiltrates. Bronchoalveolar lavage grows MRSA.
What codes do you assign?
My answer:
- A41.02 (Sepsis due to Methicillin resistant Staphylococcus aureus) – if sepsis is documented
- J15.212 (Pneumonia due to Methicillin resistant Staphylococcus aureus)
- Z99.11 (Long-term current use of mechanical ventilation)
- S06.9X9A (Unspecified intracranial injury, initial encounter) – the reason for admission
This patient has VAP (ventilator associated pneumonia). The pneumonia code specifies MRSA. The ventilator code tells the full story. The traumatic brain injury code remains primary.
The Impact of Correct Coding on Hospital Quality Metrics
Why does all of this matter beyond just getting paid? Two big reasons.
Public Reporting and Reimbursement
Medicare and many private insurers track HAP rates. Hospitals with higher than expected rates may face financial penalties. Accurate coding ensures that hospitals are not penalized for pneumonia that truly developed elsewhere or for cases that do not meet the definition.
Conversely, under-coding HAP can make a hospital look safer than it really is. That helps no one. Accurate data drives quality improvement.
Antibiotic Stewardship
Specific organism codes help infection prevention teams track resistance patterns. If a hospital sees an increase in J15.0 (Klebsiella) codes, that might prompt a review of antibiotic prescribing practices. If they see many J15.212 (MRSA pneumonia) codes, they might adjust empiric therapy protocols.
In other words, your coding choices have real implications for patient safety at the population level.
Frequently Asked Questions (FAQ)
Q1: Can I use J15.9 for a patient who had pneumonia before admission but it was not documented?
No. If the pneumonia was incubating or present on admission, it is community acquired pneumonia (CAP), not HAP. Using J15.9 for a CAP case is incorrect. You would need a CAP code like J15.61 for Strep pneumoniae or J18.9 for unspecified pneumonia.
Q2: What is the exact time cutoff for HAP?
The standard definition is 48 hours or more after admission. Some facilities use a stricter definition of 72 hours for certain populations, but the widely accepted standard remains 48 hours.
Q3: Does pneumonia that develops in a skilled nursing facility count as HAP?
No. That is considered healthcare associated pneumonia (HCAP) in some older classification systems. However, current ICD-10 guidelines treat nursing home onset pneumonia as community acquired for coding purposes unless the patient was recently hospitalized. This is a nuanced area. Check your local coding guidelines.
Q4: What if the patient was transferred from another hospital?
If the patient was admitted to Hospital A for two days, transferred to Hospital B, and develops pneumonia on day three of the total hospitalization (but day one at Hospital B), is that HAP? Yes, most guidelines consider the continuous hospitalization. The clock does not restart with the transfer.
Q5: Do I need a separate code for sepsis if the patient with HAP becomes septic?
Yes. If the documentation supports sepsis (systemic inflammatory response with suspected or confirmed infection), assign a sepsis code such as A41.9 (Unspecified sepsis) or a more specific code if the organism is known. Do not assume sepsis is implied by pneumonia. It requires separate documentation.
Q6: Can a patient have both HAP and a viral pneumonia code?
Yes, though viral HAP is less common than bacterial. If a patient develops influenza (J10.08) after 48 hours in the hospital, you would assign the influenza code plus any bacterial superinfection code. Viral pneumonia codes fall under J12.
Q7: What is the difference between J15.9 and J18.9?
J15.9 is unspecified bacterial pneumonia. J18.9 is unspecified pneumonia (organism not specified and not necessarily bacterial). If the documentation simply says “pneumonia” without specifying bacterial, viral, or fungal, J18.9 might be more accurate. However, most HAP is bacterial, so J15.9 is often the better choice when the organism is unknown.
Q8: How do I code HAP in an immunocompromised patient?
Start with the pneumonia code (J15.9 or organism-specific). Then add the immunocompromised state code (D84.9 for unspecified immunodeficiency, or a more specific code like B20 for HIV). Also add the underlying condition that caused the admission.
Q9: Is there a specific ICD-10 code for “hospital acquired pneumonia” written exactly like that?
No. The ICD-10 system does not contain a code with those exact words. You must use a pneumonia code (J15.9, J15.1, J15.0, etc.) and rely on clinical documentation to establish the hospital acquired timing. The timing is not embedded in the code itself.
Q10: What happens if I use the wrong code?
Incorrect coding can lead to claim denials, audits, or reduced reimbursement. It can also distort hospital quality data. If you discover an error, submit a corrected claim with the accurate codes as soon as possible. Most payers have a timely filing limit, usually 90 to 180 days.
Additional Resource for Deeper Learning
For the most current and authoritative guidance on ICD-10 coding for pneumonia and all other conditions, refer directly to the Centers for Medicare & Medicaid Services (CMS) ICD-10 website.
You can access official coding guidelines, quarterly updates, and coding references at:
www.cms.gov/medicare/coding/icd10
Disclaimer: This information is for educational purposes only and does not constitute medical coding advice. Always consult official coding guidelines and your facility’s policies.
Author: Technical Writing Team
Date: APRIL 13, 2026
