Your should have sent your landlord a written notice identifying the problem (infestation of roaches), the medical issue that was resulting (attached a copy of the doctor's note), attached pictures of the roaches, and requested that he have a company come out to fumigate within 5 days due to the immediate risk to health and safety. You should have also reported the problem to the housing department and health department. As you did not, you may be responsible for the landlord's lost rent, but you can try and turn the tables on him.
You could file a claim in small claims court demanding the return of your security deposit, your costs to move out (actual out of pocket expenses paid to a third party, if any), your fees to establish your ultilities at a new sanitary place, and your out of pocket costs for the doctor. Claim is for damages resulting from constructive eviction. Make sure your claim is less than $7500. Make sure you bring proof of all of your costs, illness, picutes, written correspondence to the landlord, etc.. to court with you.
Without specific information such as the documentation you do have in your possession, review of the correspondence that occured between you and the landlord, and how much rent you were paying it is impossible to provide you with all of your options.
Disclaimer. Ms. Marsh is an attorney licensed to practice in California. The information posted above is for general information, does not constitute professional legal advice, and does not create an attorney client relationship. Ms. Marsh strongly advises the questioner to consult with an attorney to thoroughly review his or her particular circumstances and for advice tailored to his or her specific circumstances.
After putting the landlord on notice of the problem and allowing a reasonable time to have the problem fixed by the landlord, the tenant generally has a right to have the problem fixed themselves and may deduct the cost of the fix from rent if the landlord fails to take action. However, such "repair and deduct" rights may be affected by provisions within the lease. You should talk to a lawyer.