where such order has been issued. For the purposes of this subdivision, "substantial compliance" shall mean that at the time of reinspection by the department, all violations relating directly to providing heat and hot water and all immediately hazardous violations related to mold, eighty percent of all hazardous violations related to mold, eighty percent of all vermin violations and eighty percent of all other open hazardous and immediately hazardous violations and the related underlying conditions, have been determined by the department to have been corrected. A violation relating to mold shall only be deemed corrected if the violation has been corrected in accordance with paragraph ii of subdivision i of this section and a violation relating to vermin shall only be deemed corrected if such violation has been corrected in accordance with paragraph iii of subdivision i of this section and, when applicable, paragraph iii of subdivision k of this section.