I found a law, under search warrants.
"Upon proper affidavits being made, a search warrant may be issued under the provisions of this chapter upon any of the following grounds: ... When any property constitutes evidence relevant to proving that a felony has been committed ... This section also applies to any papers or documents used as a means of or in aid of the commission of any offense against the laws of the state."
It's pretty clear that the prosecutor has every right by law to have those medical records.