Question not clear
Are you asking if a newborn can get pneumonia
after being in the hospital for a week? If so, yes.
Hospital acquired pneumonias are common, even in infants, particularly if the infant is being hospitalized for another issue. If you are asking whether a newborn can still have pneumonia after being treated for a week the answer is also yes, but the reasons would have to come from the pediatrician.