Analysis of defect states in optical microcavities based on the photonic quantum well structure