In this work, we employed the transfer-matrix method to obtain the transmittance spectrum of a defective one-dimensional photonic crystal composed of polymer materials. We consider that the dielectric constant of the polymers is a function of the applied pressure, and the cavity is infiltrated by plasma cells. When blood plasma concentration and cavity thickness are increased, we observe a defective mode tuned to long wavelengths within the photonic band gap. By calculating the energy stored in the cavity, a maximization of the quality factor to [Formula: see text] for a 2350[Formula: see text]nm cavity was observed. In addition, we report that as the applied pressure increases, the defective mode shifts to shorter wavelengths, accompanied by a decrease in the quality factor to [Formula: see text] for a pressure of 100[Formula: see text]MPa.