
182 Wis.2d 616 (1994)
514 N.W.2d 707
IN RE the MENTAL CONDITION OF BILLY JO W., Alleged To Be Mentally Ill:
BILLY JO W., Appellant,
v.
Gary METRO and Racine Journal Times, Respondents-Petitioners.
No. 92-0854.
Supreme Court of Wisconsin.
Oral argument September 7, 1993.
Decided April 21, 1994.
*625 For the respondents-petitioners there was a brief by Charles H. Constantine and Constantine, Christensen *626 & Krohn, S.C., Racine and oral argument by Charles H. Constantine.
For the appellant there was a brief by William J. Tyroler, assistant state public defender and Sean M. Brown, assistant state public defender and oral argument by Sean M. Brown.
SHIRLEYS. ABRAHAMSON, J.
This is a review of a published decision of the court of appeals, In Re the Mental Condition of Billy Jo W., 173 Wis. 2d 310, 497 N.W.2d 135 (Ct. App. 1992), reversing an order of the circuit court, Allan P. Torhorst, Judge. The circuit court authorized the Racine Journal Times and Gary Metro, a Racine Journal Times reporter, to review and publish portions of the court records produced as a result of Billy Jo W.'s chapter 51, Stats. 1991-92, civil commitment and recommitments.
The legislature has set forth countervailing policies favoring, on the one hand, confidentiality of records of ch. 51 court proceedings and, on the other, open court records and open court proceedings. The legislature has mandated that the courts balance these countervailing policies by enabling a circuit court to release civil commitment court records "pursuant to lawful order of the court which maintains the records." Sec. 51.30(3).[1] In the case at bar, this court must determine *627 under what circumstances the sec. 51.30(3), Stats. 1991-92, authorization of release of court files and records "pursuant to lawful order of the court," permits a circuit court to enter an order releasing civil commitment court records.[2]
For the reasons set forth, we read the phrase "pursuant to lawful order of the court" in 51.30(3) to allow narrow exceptions to the closing of ch. 51 civil commitment court records. In this case we identify three narrow circumstances in which a court may release *628 such court records under sec. 51.30(3). A court may release ch. 51 civil commitment court records (1) when the requested access fits within one of the statutory exceptions to the confidentiality of mental health treatment records enumerated in sec. 51.30(4)(b); (2) when the requested access is comparable to one of the statutory exceptions to the confidentiality of mental health treatment records enumerated in sec. 51.30(4)(b); and (3) when a significant interrelationship exists between the court records of the civil commitment proceedings at issue and a criminal proceeding involving a violent felony[3] pending prior to the civil commitment.
We conclude, as explained below, that the records requested in the case fall within the third circumstance. Accordingly, we reverse the court of appeals' decision denying access to the records described by the circuit court and remand the cause for further proceedings consistent with this opinion.

I.
On January 4, 1984, Billy Jo W. was charged with first degree intentional homicide. He pleaded not guilty by reason of mental disease or defect.[4] In due course Billy Jo W. was examined by a psychiatrist, and the examination raised doubts as to his competence to stand trial. The criminal court found Billy Jo W. incompetent to stand trial pursuant to sec. 971.14, and he was committed criminally. Thus the murder case did not go to trial at that time.
*629 In 1985, when the circuit court found that Billy Jo W. was unlikely to regain competency in the time period specified by sec. 971.14(5)(a), the court discharged him from criminal commitment as required by sec. 971.14(6)(a), Stats. 1991-92. Civil commitment proceedings then began in Racine County circuit court pursuant to sec. 51.20. On October 8, 1985, upon finding, pursuant to secs. 51.20(1)(a)1, (1)(a)2.b, and (1)(am),[5] that Billy Jo W. was both mentally ill and dangerous, the circuit court committed him to Mendota Mental Health Institute for a six-month period. Thereafter, recommitment hearings were held on either a semi-annual or annual basis.
Billy Jo W. was present at all but one of the recommitment hearings. Each hearing was also attended by the public defender who represented Billy Jo W.; an attorney from the Racine County Corporation Counsel's office who represented the interests of the public, pursuant to sec. 51.20(4), Stats.;[6] and a representative *630 of the Racine County Human Services Department. At each hearing the court received the written report of the medical doctor or a psychologist who had been assigned to examine Billy Jo W., as well as the stipulation or testimony of that examiner. The court minutes, doctors' reports, certain medical records from the institution and memoranda from the Racine County Human Services Department are all contained in Billy Jo W.'s civil commitment court file. The record does not indicate that any of the hearings were closed.
After each of the court hearings prior to 1990, Billy Jo W. was recommitted to an institution. In August of 1990,[7] however, he was recommitted to Cornerstone I, which is apparently a halfway house in Racine. In August 1991, he was recommitted but allowed to live independently.
While living independently in December 1991, Billy Jo W. was arrested and charged with committing three armed robberies. Criminal charges were filed in a separate case. The circuit court handling these three robbery charges found that Billy Jo W. was not competent to stand trial and once again committed him pursuant to sec. 974.14(5)(a).
After Billy Jo W. was arrested in 1991, the Racine Journal Times and Gary Metro, a reporter, (hereafter the Journal Times) filed a petition in Racine County circuit court requesting access to the contents of Billy Jo W.'s civil commitment court file, asserting a belief that this file contained psychiatric examinations conducted between 1984 and 1990. In addition, the Journal Times asked for permission to print the portions *631 of the file that the paper deemed relevant. The circuit court authorized the Journal Times to review and publish any report or correspondence dated from September 12, 1985, to February 17, 1992, that was "prepared by or on behalf of any psychologist, psychiatrist or other physician who examined [Billy Jo W.] pursuant to a court order" and, within the same dates, any evaluations prepared by the Racine County Human Services Department and any orders issued after those examinations.[8] At oral argument in this court, counsel for the Journal Times stated that the newspaper was not seeking records beyond those provided for in the circuit court order.[9]
*632 The court of appeals reversed, concluding that sec. 51.30(4)(b)4, did not give the circuit court authority to release treatment records to the news media. Evaluating the statutory exceptions to the general rule that treatment records are to be kept confidential, the court of appeals concluded that there are strict limitations on who can obtain treatment records and on what information can be released. Because the legislature had made such a great effort to preserve confidentiality of treatment records, the court of appeals reasoned that access to the material set forth by the circuit court would be inconsistent with legislative intent.

II.
In addressing the issue before this court, we first note the statement in section 51.30(3) that files and records of chapter 51 court proceedings "shall be closed." The legislative directive is that these records are to remain inaccessible.
[1]
This legislative mandate to close court records is grounded in the legislature's strong interest in keeping private the details of an individual's mental and emotional condition. Because individuals are still stigmatized by mental illness and commitment to a mental institution, they are entitled to privacy about these matters. Furthermore, society has a strong interest in facilitating the reintegration of individuals into the community. Section 51.30 implies that successful reintegration is more likely to occur when court records revealing personal information about an individual's mental and emotional history have not been revealed to the public. Thus it follows that to the extent that the civil commitment court records at issue grow solely out of ch. 51 proceedings, the legislative preference for confidentiality *633 must shape our interpretation of sec. 51.30(3).
[2]
Nevertheless sec. 51.30(3) presents several exceptions to the general rule that civil commitment court records are closed. The records are accessible to the subject of the proceeding and to that person's attorney. The subject individual can consent to release of court records. In addition, court records may be released without the subject individual's consent "pursuant to lawful order of the court." Section 51.30(3) provides, inter alia, as follows:
In other situations, such records may be released to other persons only pursuant to the informed written consent of the individual or pursuant to lawful order of the court which maintains the records. (Emphasis added)
The question before this court is the meaning of the statutory language "pursuant to lawful order of the court" in sec. 51.30(3). In other words, when may a court release ch. 51 civil commitment court records to the news media?
[3,4]
Statutory interpretation is a matter of law that this court determines de novo. State v. Olson, 175 Wis. 2d 628, 633, 498 N.W.2d 661 (1993). The principal objective of statutory interpretation is to ascertain and give effect to the intent of the legislature.

III.
[5]
On its face the phrase "pursuant to lawful order of the court" in sec. 51.30(3) provides no precise guide to what records the legislature intended to be released. In *634 an effort to discern the meaning of this phrase, we examine sec. 51.30(3) along with sec. 51.30(4) which governs access to an individual's mental health treatment records. We look to sec. 51.30(4) for guidance in interpreting sec. 51.30(3) for several reasons.
First, both sections limit access to mental health records. Section 51.30(4)(a) specifically requires that except as otherwise provided "all treatment records shall remain confidential and are privileged to the subject individual," while sec. 51.30(3) requires that civil commitment court records be "closed."
Second, both sections allow access to records "pursuant to lawful order of the court."
Third, in section 51.30(4) the legislature expressly set forth who may have access to treatment records and when. Section 51.30(4)(b) lists 22 specific, detailed exceptions to its rule of confidentiality. In contrast, sec. 51.30(3) provides no similar list of specific exceptions.
[6]
Finally, although both sec. 51.30(3) and sec. 51.30(4) limit access to records relating to mental health, the nature of the records governed by the two sections is substantially different. Court records are ordinarily open, while a person's health records are ordinarily confidential and privileged. Court records relating to civil commitment are closed under sec. 51.30(3) for reasons similar, if not identical, to the reasons the treatment records governed by sec. 51.30(4) are confidential. We can therefore assume that if the legislature is willing to allow access under sec. 51.30(4) to treatment records that are ordinarily confidential and privileged, it would be willing to allow access to ch. 51 court records under the same circumstances.
*635 [7]
In sum, we look to sec. 51.30(4) for guidance in determining the meaning of the phrase "pursuant to lawful order of the court" in both sec. 51.30(3) and sec. 51.30(4)(b) because the purpose of limiting access to treatment records and court records is similar, and because in sec. 51.30(4)(b) the legislature has enumerated 22 situations under which treatment records may be released. It is reasonable to conclude that the legislature intended the scope of access to civil commitment court records to be no more narrow than the scope of access to treatment records.
The 22 exceptions to confidentiality contained in sec. 51.30(4)(b) evidence three themes the legislature appears to consider important to allowing access to mental health treatment records. First, the exceptions clarify a particular purpose for which the treatment records are needed. For example, sec. 51.30(4)(b)1 provides access to treatment records "for the purposes of management audits, financial audits, or program monitoring and evaluation."[10]
Second, the exceptions provide access only to those persons who need access to effectuate a stated purpose. *636 For example, sec. 51.30(4)(b)1 limits access "[t]o an individual, organization or agency designated by the department or as required by law for the purpose of management audits, financial audits, or program monitoring and evaluation."[11]
Third, the information that may be obtained is limited to that needed to achieve the delineated purpose. For example, sec. 51.30(4)(b)8, which provides physicians access to records in medical emergencies, states that "such disclosure shall be limited to that part of the records necessary to meet the medical emergency."[12] In exceptions where the particular purpose requires that certain individuals have access to all of *637 the records, the exception also requires additional measures to ensure confidentiality for any purposes beyond those of the specifically allowed exception. For example, under sec. 51.30(4)(b)1, "[i]nformation obtained under this paragraph shall remain confidential and shall not be used in any way that discloses the names or other identifying information about the individual whose records are being released. The department shall promulgate rules to assure the confidentiality of such information."[13]
[8]
As we have stated previously, sec. 51.30(4)(b) also allows access to records "pursuant to lawful order of the court." This language must mean something distinct from the 22 enumerated exceptions. In interpreting sec. 51.30(4)(b) we must avoid rendering any portion surplus language, while maintaining the legislature's objective of limiting access to treatment records.
[9-11]
In keeping with the legislature's objective of limiting access to treatment records, we conclude that the phrase "pursuant to lawful order of the court" in sec. 51.30(4)(b)4 allows access in situations distinct from but substantially similar to those contained in the enumerated exceptions. The legislature intended the phrase "pursuant to lawful order of the court" in sec. 51.30(4) to allow a court to release treatment records under 51.30(4) when the requested access is comparable *638 to one of the statutory exceptions set forth in sec. 51.30(4)(b). A court may therefore grant access to treatment records under sec. 51.30(4) for a particular purpose that is similar to those enumerated, to those individuals who need access to achieve that particular purpose, and of those records needed to achieve that purpose. Under this exception to the sec. 51.30(4) mandate that treatment records remain confidential, the purpose must be consistent with the purposes for which access is currently allowed: treatment,[14] administration,[15] research,[16] law enforcement/ investigation,[17] protection/advocacy[18] and legal proceedings relating to the subject individual.[19]
*639 Allowing access to treatment records in these limited contexts comparable to the exceptions described in sec. 51.30(4)(b) provides the phrase "pursuant to lawful order of the court" with enough flexibility to encompass situations that the legislature did not anticipate, while keeping access within the bounds erected by the legislature elsewhere in sec. 51.30(4)(b).
[12]
Applying our analysis of the phrase "pursuant to lawful order of the court" in sec. 51.30(4)(b) to the phrase in sec. 51.30(3), we conclude that a circuit court may release ch. 51 court records when the requested access fits within one of the statutory exceptions in sec. 51.30(4)(b) or when the requested access is comparable to one of the statutory exceptions set forth in sec. 51.30(4)(b).
The Journal Times argues that its request fits within the statutory public safety exception to confidentiality in sec. 51.30(4)(b)12m, Stats. 1991-92,[20] and *640 that news media or any individual should be allowed access to civil commitment court records whenever public safety is a potential concern. There are several weaknesses in this argument.
Public safety is not an issue in this case. Billy Jo W. had been apprehended before the Journal Times requested his civil commitment file.
[13,14]
Furthermore the statutory public safety exception has a particular purpose, to assist in the apprehension of an individual who is on unauthorized absence from an institution. The exception allows release to any person, because anyone might have information that would assist in apprehending a patient on unauthorized absence. This exception, however, limits the information that can be released. Only information that would assist in apprehension of the patient may be disclosed.
The Journal Times points to Schuster v. Altenberg, 144 Wis. 2d 223, 249, 424 N.W.2d 159 (1988), to support its claim that patient interests in confidentiality must yield when public safety is threatened. However, Schuster is consistent with the limited exceptions to confidentiality set forth in sec. 51.30(4)(b); Schuster created a narrow exception to therapist-patient confidentiality. Under Schuster, when harm by a patient to a third party is foreseeable, the treating psychiatrist who fails to warn the third party or to institute commitment proceedings against the patient is liable for negligence. 144 Wis. 2d at 240. Like the exceptions set forth in sec. 51.30(4)(b), Schuster allows release of information for a particular purpose: protecting people who face foreseeable harm. Release of information is limited to people who need it: those who face the threat of harm. The information released is limited to that *641 necessary to effectuate the purpose. Schuster is irrelevant to creation of a public safety exception that would allow release of confidential records when an individual is no longer a threat.
[15]
The broad public safety exception advocated by the Journal Times creates at least one additional problem. In every case in which a patient is involuntarily civilly committed for treatment, a court has determined that the person is dangerous to himself or herself or to others.[21] The broad public safety exception urged by the Journal Times would allow a court in the exercise of discretion to grant access to records whenever an individual had been considered dangerous at one time, even when a presently foreseeable threat of harm to others no longer existed. Accordingly, under the urged exception, all involuntarily committed patients would face the possibility of public disclosure of their records. We conclude that the legislature would not have gone to such great lengths to protect confidentiality of records only to allow a substantially unrestricted release of those records once a person left closely supervised confinement.
[16]
The Journal Times' request for access to Billy Jo W.'s civil commitment court records does not fall within sec. 51.30(3) as analyzed in conjunction with sec. 51.30(4)(b). The scope of the Journal Times' request does not come within the existing statutory *642 exceptions and it is not comparable to any of the existing statutory exceptions.
Were the records at issue in the case at bar solely related to civil commitment proceedings under chapter 51, our analysis would end here. However, the case at bar requires us to broaden our analysis beyond the specific exclusions set forth in sec. 51.30(4)(b)4 because, at bottom, this is a criminal case.

IV.
[17]
When a significant interrelationship exists between the court records of the civil commitment proceedings at issue and a criminal proceeding involving a violent felony pending prior to the civil commitment, the phrase "pursuant to lawful order of the court" must be read in light of the legislature's preference for openness in criminal court proceedings and criminal court records. In this case, the significant interrelationship between the ch. 51 civil commitment proceedings and a previously pending criminal proceeding involving a violent felony compels us to consider the Journal Times' request.
Billy Jo W. initially came to the attention of the community when he was charged with first degree murder in 1984. As stated previously, the murder case did not go to trial at that time because Billy Jo W. was determined to be incompetent to stand trial under sec. 971.14. He was then committed to various state mental institutions, at first under a criminal commitment statute and later through civil commitment proceedings.
[18]
Billy Jo W.'s path through the criminal justice and civil commitment systems brought him within the scope of several different statutory provisions relating *643 to the confidentiality of records. When he pleaded not guilty by reason of mental disease or defect, he waived the physician-patient confidentiality that ordinarily protects mental health records.[22] He was then evaluated, pursuant to sec. 971.16(3). The statute provides that reports on evaluations done under sec. 971.16(3) are confidential until the physician or psychologist has testified or upon completion of the trial. The implication is that these evaluation reports are open after the events specified in the statute have occurred.
[19,20]
Similarly, the statutes require that reports submitted to a criminal court to determine competency to stand trial shall not be disclosed except to the parties prior to a competency hearing. Section 971.14(4). The implication is that they are open records after the competency hearing has been held.[23] Once Billy Jo W. had been determined incompetent to stand trial, sec. 971.14(4)(b) required periodic re-examinations and periodic competency determinations by the court. Evaluations made pursuant to this requirement also may be disclosed at competency hearings. We can find no *644 statute under which criminal competency hearings are closed.
[21,22]
Later, Billy Jo W. was civilly committed. At issue in this case is the confidentiality of the court records relating to his ch. 51 civil commitment. Involuntary civil commitment hearings and the periodic hearings to continue a commitment are open, unless the subject individual or that individual's attorney requests that they be closed. Section 51.20(12), Stats. 1991-92. To close the proceedings, the circuit court must exercise its discretion under the guidelines set forth in La Crosse Tribune v. Circuit Court, 115 Wis. 2d 220, 241-42, 340 N.W.2d 460 (1983) and State ex rel. Wisconsin State Journal v. Circuit Court for Dane County, 131 Wis. 2d 515, 389 N.W.2d 73 (Ct. App. 1986). The record in this case gives no indication that any of the civil commitment hearings were closed.
This case is, in essence, a criminal case that made a detour through civil commitment proceedings. Billy Jo W. apparently did not become competent to stand trial during the 18-month period this court has deemed constitutionally reasonable for a defendant to be committed criminally while waiting for his mental health to improve. State ex rel. Haskins v. Dodge County Court, 62 Wis. 2d 250, 262 214 N.W. 575 (1974). Therefore, at the end of this period, Billy Jo W. underwent civil commitment proceedings and was committed under ch. 51.
[23,24]
The switch from criminal to civil commitment proceedings is constitutionally required to protect defendants from perpetual confinement due to their inability to become competent to stand trial. Jackson v. Indiana, 406 U.S. 715 (1972). However, this constitutional *645 protection of a defendant's liberty interests does not necessarily eliminate the pending criminal case. On the contrary, the criminal court retains jurisdiction over the defendant, who can be prosecuted once he regains competency. State ex rel. Porter v. Wolke, 80 Wis. 2d 197, 204, 257 N.W.2d 881 (1977). Section 971.14(6)(c) requires that the criminal court and the district attorney be notified when a defendant who has been civilly committed under sec. 51.20 is to be discharged from an inpatient facility or from commitment.
Thus the legislature has interwoven the provisions of chapters 51 and 971 to accommodate the constitutional protections against perpetual, unjustified confinement on the one hand and the interests of the public in prosecuting criminal defendants on the other. Consequently, an individual who has been charged with a criminal offense is not removed from the purview of the criminal court simply because he fails to regain competency within 18 months and is subject to civil commitment.
This case straddles the bodies of law governing civil commitment and criminal proceedings. The facts of this case establish a significant interrelationship between the closed ch. 51 civil commitment court records at issue and secs. 971.14 and 971.16, to which the legislature's policy of openness applies. As a result, we cannot focus entirely on the civil commitment aspect; we cannot analyze the request to open Billy Jo W.'s records strictly in terms of the sec. 51.30(4)(b) exceptions to the general rule of confidentiality for treatment records. Even though the parties examined the case only in these terms, our analysis must take into account the essential fact that this was a criminal case in civil clothing.
*646 [25]
It is significant that the legislature applied the confidentiality provision of sec. 51.30 to both court records and treatment records in civil commitments but only to treatment records in criminal commitments. Thus, court records of individuals who have been criminally committed are not declared confidential. Sections 51.30(3), (4) and (7).[24] This omission is particularly relevant in light of the meticulous specificity of the rest of sec. 51.30.
It is important to remember that the Journal Times is not seeking treatment records; it is seeking civil commitment court records. The circuit court limited its release of Billy Jo W.'s records to documents relating to the court's decisions to commit him civilly and later to allow him to be discharged from an inpatient facility. In the absence of a specific provision in sec. 51.30(3) addressing access to the court records of a criminal defendant who has been civilly committed, we must assess the question of releasing the court records in this case in terms of the legislative policy in favor of closing ch. 51 court records and the overall legislative policy in favor of opening court proceedings and records.
[26-28]
The legislature and this court have demonstrated a great reluctance to shield the judicial process from public view. See e.g., sec. 757.14 ("the sittings of every court shall be public and every citizen may freely attend the same"); La Crosse Tribune v. Circuit Court, 115 Wis. 2d 220, 340 N.W.2d 460 (1983). The interest protected by open courtrooms is often said to be that of *647 the criminal defendant, whose rights might be curtailed in a secret proceeding. Where a criminal defendant has desired to exclude the public, however, courts have balanced this request against the public's interest in understanding and maintaining confidence in the courts. Cf. State ex rel. Wisconsin Journal v. Dane Circuit Court, 131 Wis. 2d 515, 520-523, 389 N.W.2d 73 (Ct. App. 1986). Public confidence in the judicial system is particularly important in the context of a criminal case involving a violent felony in which the defendant has not been tried for the underlying charge because he has been found incompetent. A competency hearing, for example, should be open to the public because:
"... [t]he community's interest in this defendant's case could easily have been transformed into suspicion and even distrust of the criminal justice process had the decision rendered behind closed doors been one of incompetency to stand trial... [T]he `right to know' subsumes more than merely the ability to obtain information; on a more fundamental level, it carries implications for public confidence in and respect for the institutions that define the concepts of `guilt' and `innocence.'"
Westchester Rockland Newspapers v. Leggett, 399 N.E.2d 518, 531 (N.Y. 1979) (Fuchsberg, J., concurring). As Justice Blackmun observed, "the ability of the courts to administer the criminal laws depends in no small part on the confidence of the public in judicial remedies, and on respect for and acquaintance with the process and deliberations of those courts." Gannett Co. v. DePasquale, 443 U.S. 368, 429 (1979) (Blackmun, J. concurring and dissenting).
*648 The Journal Times argues that the civil commitment court records in this case must be opened to public scrutiny to assure that public officers and public institutions have discharged their functions with fidelity to the trust placed in them. In response, some might argue that the civil commitment court records should not be open in this case because the public interest in all chapter 51 proceedings is represented by the county corporation counsel, as required by sec. 51.20(4), and because to assist in preparation for the proceedings corporation counsel is allowed access to the treatment records concerning the admission, detention or commitment of the subject individual. Sec. 51.30(4)(b)14, Stats.
[29]
While chapter 51 provides several checks to ensure that the commitment, recommitment, transfer and release of patients are carried out in a manner which protects the interests of the community as well as those of the subject individual, these safeguards do not serve the same purpose as open court proceedings and open court records. Open court proceedings are designed to assure the public that public officials and the judicial system are operating properly. For example, in every criminal case the prosecutor represents the public, yet the proceedings are also open so that the public may gauge how well the prosecutorial and judicial systems are functioning.
When the legislature established the general rule that ch. 51 civil commitment court records be closed, with release possible "pursuant to lawful order of the court," the legislature obviously left to the court the task of weighing the need for public review in criminal proceedings against the need for confidentiality of ch. 51 court records. It would be inconsistent with this *649 legislative policy of open judicial proceedings, and with the language of sec. 51.30(3) itself, to interpret sec. 51.30(3) as prohibiting absolutely any public access to the civil commitment court records of a criminal defendant such as Billy Jo W., who had been charged with a serious violent felony, had entered a plea of not guilty by reason of mental disease or defect, had been found incompetent to stand trial, and had been civilly committed because of the duration of his incompetency and whose criminal case is still pending.
[30]
Once a circuit court makes the threshold determination that the facts of a case demonstrate a significant interrelationship between criminal proceedings involving a violent felony and the civil commitment, the court must assess pragmatically the privacy interests at stake. The court must weigh the nature and importance of the public interest in access to the ch. 51 civil commitment court records against the potential loss of privacy to the individual.
Thus the court must consider the fact that some records relating to an individual's mental health may have become open because the individual pleaded not guilty by reason of mental disease or defect. Evaluations of Billy Jo W.'s mental health may have become public because his criminal competency hearing was held in open court. Similarly, members of the public, including the press, might have attended Billy Jo W.'s civil commitment hearing, perhaps even over his objection. State ex rel. Wisconsin State Journal v. Circuit Court of Dane County, 131 Wis. 2d 515, 523, 389 N.W.2d 73 (Ct. App. 1986).
[31,32]
It is not clear from the record before this court how much, if any, of Billy Jo W.'s mental and emotional *650 problems and history may already be available to the public. Since much information may be public, it may not be possible for Billy Jo W. to harbor any great expectation of confidentiality in the civil commitment court records concerning his mental health. Individuals do not forfeit their right to privacy simply because they have been charged with a crime. However, to the extent that details of Billy Jo W.'s mental health may have become public, the shield of confidentiality that ordinarily protects civil commitment court records has been pierced.
The public was aware that Billy Jo W. had been charged with first degree murder. The public was also aware that he had pleaded not guilty by reason of mental disease or defect, that he had been found incompetent to stand trial, and that he had been institutionalized.[25] It is also a matter of public record that six years after his commitment to a state mental institution Billy Jo W. still had not been tried for the murder. Nevertheless he had been released from the institution and had been charged with three armed robberies allegedly committed after his release.
Thus the public may already know a great deal. What the public does not know is the basis for the circuit court's decision to discharge Billy Jo W. from commitment to an institution.
Cases such as this one are rare. Still, it is essential that the public have confidence in the justice system's management of criminal cases involving mentally ill defendants. Preventing the public from understanding Billy Jo W.'s case could undermine that confidence. Enabling public understanding may foster public faith in the courts.
*651 [33]
This case is distinguished from most civil commitment cases by the fact that it began as a murder case. Billy Jo W. was psychiatrically examined pursuant to a plea of not guilty by reason of mental disease or defect and was determined to be incompetent to stand trial. We repeat, individuals do not lose their right to privacy simply because they have been charged with a crime. The civil commitment court records of an individual released from an institution and subsequently charged with a crime would not be open under our analysis of sec. 51.30(3) in conjunction with ch. 971. Thus, although the robbery charges filed against Billy Jo W. after his release from the institution made him the focus of public attention, those charges in no way trigger the release of the civil commitment courts records at issue. The determinative issues, under the facts of a given criminal case, are (1) whether a significant interrelationship exists between the court records of the civil commitment proceedings at issue and a criminal proceeding involving a violent felony pending prior to the civil commitment, and (2) whether the defendant's expectations of confidentiality in the civil commitment court records have been significantly diminished.
As a threshold matter, we find that a significant interrelationship exists between the court records of the civil commitment proceedings at issue in this case and the criminal proceeding pending prior to the civil commitment. A murder charge filed before Billy Jo W. was civilly committed was still pending against him at the time the newspaper made its request for access to his civil commitment court records. Furthermore, Billy Jo W. pleaded not guilty to the murder charge by reason of mental disease or defect and the criminal court determined him to be incompetent to stand trial.
*652 We remand this case to the circuit court. We direct the circuit court to determine, in light of the facts and policy considerations stated above, whether to issue an order allowing access to any of the civil commitment court records.
The circuit court should examine in camera the records sought by the newspaper to assess how much personal information contained in the civil commitment court records has not already become a matter of public record in either the criminal or civil proceedings. The court must weigh the competing interests of Billy Jo W.'s privacy and the public's need to understand why this individual, criminally committed as incompetent to stand trial for murder, had been released from an institution without being prosecuted for that crime. Only if the nature and importance of the public interest in knowing the basis for the decision to commit Billy Jo W. to a placement outside of a locked institution outweighs the additional privacy Billy Jo W. would lose through opening more records should the newspaper be allowed access to any of the civil commitment court records.[26]
The analysis we require of a circuit court deciding a request for access to civil commitment court records reflects the countervailing legislative policies of openness of criminal proceedings and closed records in civil commitment cases and takes a pragmatic view of the actual privacy interests at stake.
*653 [34]
For the reasons set forth, we reverse the decision of the court of appeals and remand this case to the circuit court for further proceedings consistent with this opinion.
By the Court.The decision of the court of appeals is reversed and the cause remanded.
HEFFERNAN, CHIEF JUSTICE (dissenting).
Had the majority opinion contained only the analysis in section III, I would have agreed with it entirely. In section III, the majority correctly looks to the exceptions contained in sec. 51.30(4)(b), Stats., as guides to interpret the "lawful order of the court" exception to closed court records contained in sec. 51.30(3), Stats. As the majority states, a circuit court may release ch. 51 court records when the requested access fits within one of the statutory exceptions in sec. 51.30(4)(b) or when the requested access is comparable to one of the statutory exceptions set forth in sec. 51.30(4)(b). The majority further states that a court may therefore grant access to court records under sec. 51.30(3) for a particular purpose that is similar to those enumerated, to those individuals who need access to achieve that particular purpose, and to the records needed to achieve that purpose.
Had the majority applied the approach contained in section III to the Racine Journal Time's request for access to Billy Jo W.'s civil commitment court records, the request would have been denied. The Journal Times has requested access on public safety grounds, but as the majority has carefully explained, public safety is not an issue in this case. The Journal Times also attempts to base its request on the desire to review *654 the adequacy of ch. 51 proceedingsa purpose dissimilar to those enumerated. Clearly that justification for the request fails the test of being comparable to an existing statutory exception.
Although I agree with the analysis contained in section III of the majority opinion, that analysis is dicta because the majority does not apply it in disposing of the Journal Times' request for access to Billy Jo W.'s court records. When the majority actually applies the sec. 51.30 "lawful order of the court" exception to the facts of the present case, the majority does not consider whether the requested access to court records fits within or is comparable to one of the existing exceptions in sec. 51.30(4)(b). Rather, the majority, ignoring its own logic, adopts an entirely different approach to analysis of sec. 51.30(3) and applies that new analysis to the facts. The majority has thus concluded that the sec. 51.30(3) "lawful order of the court" exception encompasses two entirely different approaches to requests for access to records depending on whether there is a "significant interrelationship" between the court records of the chapter 51 proceedings and a criminal proceeding involving a violent felony pending prior to the civil commitment. The majority reasons that the two approaches are justified because, when an individual has been discharged from criminal commitment and then civilly committed, the policy in favor of open records in criminal cases applies to the civil commitment and outweighs the legislature's declared policy in favor of confidentiality contained in sec. 51.30.
I support the legislature's general presumption in favor of open records, set forth in sec. 19.31, Stats.,[1] and the legislature's presumption in favor of open court *655 proceedings.[2] However, the legislature specifically negated the normal presumption of chapter 19 when it enacted chapter 51. Both sec. 51.30(3), governing access to court records, and sec. 51.30(4), governing access to treatment records, begin with the general rule that the records are to remain confidential. Section 51.30(3) states, "The files and records of the court proceedings under this chapter shall be closed." Section 51.30(4)(a) states that except as otherwise provided, "all treatment records shall remain confidential and are privileged to the subject individual." Essentially, each of these general rules creates a presumption that the records will remain inaccessible unless one of the exceptions applies.[3] The legislature balanced the need for confidentiality against the need for public review when it established the general rule that ch. 51 records are closed. It is inappropriate for this court to upset that determination of the legislature.
To justify taking two different approaches to analysis of the sec. 51.30(3) "lawful order of the court" exception to closed ch. 51 court records, the majority *656 sua sponte finds it necessary to create a new category of ch. 51 proceedings. The majority cloaks certain civil commitments in a criminal mantle, expressly stating that a ch. 51 proceeding involving an individual whose civil commitment follows release from criminal commitment is merely "a criminal case in civil clothing." By judicially creating this category, the majority can then engraft the general policy in favor of open court records in criminal proceedings onto ch. 51 civil proceedings.
I find it logically a non sequitur that ch. 51 proceedings involving defendants discharged from criminal commitment are merely criminal cases in civil guise. The majority notes that the Due Process and Equal Protection clauses of the Constitution prohibit indefinite confinement of criminal defendants due to their inability to become competent to stand trial. Jackson v. Indiana, 406 U.S. 715 (1972). Unless there is a substantial probability that a criminal defendant will become competent in a foreseeable period, a state that has criminally committed a defendant must either institute civil commitment proceedings or release the defendant. Id. The majority characterizes this situation as a criminal case making a "detour" through civil commitment proceedings. However, "detour" suggests that the ch. 51 proceedings are just a different route to the same end. This is not necessarily true. If the subject individual does not regain competency, that person will never be subject to criminal proceedings. Moreover, if that subject individual is no longer dangerous, ch. 51 requires that the individual be released from civil commitment.
The majority recognizes that the general rule that ch. 51 records are to be closed is grounded in the legislature's strong interest in keeping private the details of an individual's mental and emotional condition, both to *657 prevent stigmatization and to facilitate reintegration into the community. However, concerns about stigmatization and reintegration should apply equally to individuals whose civil commitment follows a prior criminal commitment and to individuals who have only been civilly committed. The problems both groups of individuals face upon reentering the community are substantially the same. It is clear that the legislature has so concluded.
It is evident that chapter 51 makes no distinction between individuals involuntarily committed after release from criminal commitment and other involuntarily committed individuals. Thus, it is curious why the majority finds it significant that the legislature applied the confidentiality provision of sec. 51.30 to both court records and treatment records in civil commitments but only to treatment records in criminal commitments. The majority finds this omission significant in light of the "meticulous specificity" of the rest of the statute. However, given this "meticulous specificity", the majority does not find it significant that ch. 51 omits any mention of different treatment of court records based on whether the subject individual was previously criminally detained.
I am unclear about the real concerns underlying the majority opinion. The majority states that access is justified in this case because public confidence in the judicial process depends on public access to that process. That is, access to the records helps the public evaluate whether public officials have discharged their duties appropriately. As the majority realizes, however, ch. 51 court hearings are generally open. The majority also acknowledges that the record does not indicate that any proceedings were closed in this case. Furthermore, the concern about fostering public confidence *658 in the judicial process ought to apply equally to any ch. 51 case and not just those that follow criminal incompetency proceedings. As is universally recognized, open proceedings and records in criminal cases appropriately protect a defendant. Likewise, open court records in ch. 51 proceedings might protect the committed individual for they would enable the public to assess whether courts conducting involuntary civil commitment proceedings are doing so appropriately. But the legislature has not reached that conclusion.
In creating the general rule that court records are closed under ch. 51, the legislature has decided that the civilly committed individual's privacy concerns outweigh concerns about fostering public confidence in this limited class of judicial proceedings. Rather than providing for open records, the legislature has implemented a number of safeguards to help ensure the integrity of the process. The majority acknowledges that the hearings are open unless specifically closed by court order and that the corporation counsel, who represents the interests of the public, is required to be at all commitment and recommitment hearings. Moreover, an appeal may be taken to the court of appeals from an order filed after an involuntary commitment or recommitment hearing. That appeal can be filed by a number of individuals, including any one of the three persons who sign the petition for examination and the counsel who represents the public. Section 51.20(15), Stats. Thus, in the context of ch. 51, the court of appeals performs the role of scrutinizing the performance of the circuit court.
I cannot help but think that the majority created an exception to allow limited public access in cases involving civilly committed individuals with pending criminal charges because this is the type of ch. 51 case *659 which arouses legitimate media curiosity. Were I ab initio to balance the policy concerns at issue in determining whether ch. 51 court records should be open or closed in some instances at the discretion of the court "by lawful order", I might come to a different conclusion than did the legislature. However, in the present case, the subjective attractiveness of competing policies is not for this court to decide. The legislature has balanced these policies and provided ample guidance on acceptable exceptions to the general rule that ch. 51 court records are closed. It is inappropriate to upset the public policy determination of the legislature. I would affirm the decision of the court of appeals and deny the request for access to Billy Jo W.'s civil commitment court records.
I am authorized to state that Justice WILLIAM A. BABLITCH joins this dissenting opinion.
NOTES
[1]  Section 51.30(3), Stats. 1991-92, provides:

(3) ACCESS TO COURT RECORDS. The files and records of the court proceedings under this chapter shall be closed but shall be accessible to any individual who is the subject of a petition filed under this chapter. An individual's attorney or guardian ad litem shall have access to such records without the individual's consent and without modification of the records in order to prepare for involuntary commitment or recommitment proceedings, reexaminations, appeals, or other actions relating to detention, admission or commitment under this chapter or ch. 971 or 975. In other situations, such records may be released to other persons only pursuant to the informed written consent of the individual or pursuant to lawful order of the court which maintains the records. (Emphasis added.)
[2]  The court of appeals framed the issue in this case in terms of sec. 51.30(4)(b)4, Stats. 1991-92, which covers access to mental health treatment records and which uses the same "pursuant to lawful order of a court of records" language as appears in sec. 51.30(3).

The Journal Times apparently seeks access only to ch. 51 court records covered by sec. 51.30(3). Accordingly, we do not directly address release of mental health treatment records which are governed by sec. 51.30(4). Treatment records may be included in the court file, as they are in this case.
Section 51.30(1)(b) and (4)(b)4, which govern treatment records, provide inter alia:
(1)(b) "Treatment records" include the registration and all other records concerning individuals who are receiving or who at any time have received services for mental illness, developmental disabilities, alcoholism, or drug dependence which are maintained by the department, by county departments ... and by treatment facilities....
(4) Access to Registration and Treatment records.
(b) Access without informed written consent.... [T]reatment records of an individual may be released without informed written consent in the following circumstances ...:
4. Pursuant to lawful order of a court of record.
[3]  Violent felonies include crimes such as homicide, sexual assault of an adult or a child, robbery involving a weapon, and assault involving serious physical injury.
[4]  Although the briefs contain little information about Billy Jo W.'s criminal cases, counsel enlightened the court at oral argument.
[5]  Billy Jo W. was shown to be dangerous pursuant to sec. 51.20(1)(a)2.b, Stats. 1991-92, which provides in part:

(1)(a)2.b. The individual is dangerous because he or she does any of the following:
b. Evidences a substantial probability of physical harm to other individuals as manifested by evidence of recent homicidal or other violent behavior....
Section 51.20(1)(am), Stats. 1991-92, adds that for individuals discharged from sec. 971.14(5) commitment immediately prior to commencement of ch. 51 proceedings, "acts, attempts, threats, omissions or behavior of the subject individual during or subsequent to the time of the offense shall be deemed recent for purposes of par. (a) 2.
[6]  Section 51.20(4), Stats. 1991-92, provides:

PUBLIC REPRESENTATION. Except as provided in ss. 51.42 (3)(ar)(1) and 51.437(4m)(f), the corporation counsel shall represent the interests of the public in the conduct of all proceedings under this chapter, including the drafting of all necessary papers related to the action.
[7]  The only exception was a two month period during 1988, when Billy Jo W. was sent to a group home.
[8]  The circuit court granted access to the records pursuant to sec. 905.04(4)(b), Stats. 1991-92, which is one of the exceptions to the general rule allowing assertion of a physician-patient privilege during litigation. However, as the court of appeals noted, the parties now agree that sec. 905.04(4)(b) is inapplicable. Thus, interpretation of that statute is no longer at issue.
[9]  The circuit court's order limited the Racine Journal Times' review of the civil commitment court file to 1) "any report or correspondence within the file from the 12th day of September, 1985 through the 17th day of February, 1992, prepared by or on behalf of any psychologist, psychiatrist or other physician who examined Mr. W. pursuant to court order. 2) Any orders relative to such examinations and any comprehensive evaluations prepared by the Racine county Human Services Department, which are the basis of the commitment proceedings for Mr. W. ... 3) It is the purpose of this portion of the order to make available to Petitioners the right to examine the evaluations and reports that were used specifically for the commitment proceedings brought against Mr. W. between 1985 and 1992. Petitioners are not entitled to review any hospital records and doctors reports from Winnebago which were ordered into the file as part of the proceedings at an earlier date."
[10]  For further examples, see, e.g., sec. 51.30(4)(b)2 (access for "billing or collection purposes"); sec. 51.30(4)(b)7 (access "to coordinate treatment for mental illness, developmental disabilities, alcoholism or drug abuse"); sec. 51.30(4)(b)11 (access "to prepare for involuntary commitment or recommitment proceedings"); sec. 51.30(4)(b)18 (access "for the purpose of protecting and advocating the rights of persons with developmental disabilities ... or mental illness"); sec. 51.30(4)(b)19 (access "for the purpose of reporting an apparent crime committed on the premises of an inpatient treatment facility"). Furthermore, some of the purposes are implicit. See, e.g., sec. 51.30(4)(b)8 (access to assist a physician treating a medical emergency).
[11]  For further examples, see, e.g., sec. 51.30(4)(b)7 ("[w]ithin the department [of health and social services] to coordinate treatment"); sec. 51.30(4)(b)8 ("[t]o a licensed physician" when health of individual is in danger); sec. 51.30(4)(b)12 (Notice of a change of status "to a correctional officer of the department of corrections who has custody of or is responsible for the supervision of an individual who is transferred or discharged from a treatment facility"); sec. 51.30(4)(b)19 ("[t]o state and local law enforcement agencies" for the purpose of reporting an apparent crime); sec. 51.30(4)(b)22 ("[t]o a representative of the board on aging and long-term care" for stated purposes).
[12]  For further examples, see, e.g., sec. 51.30(4)(b)9 ("Release of records under this subdivision shall be limited to such treatment records as are required by law, a record or summary of all somatic treatments, and a discharge summary. The discharge summary may include a statement of the patient's problem, the treatment goals, the type of treatment which has been provided, and recommendation for future treatment, but it may not include the patient's complete treatment record."); sec. 51.30(4) (b)12 ("Records released under this subdivision are limited to notice of the subject individual's change in status."); sec. 51.30 (4)(b)14 ("Records released under this subdivision are limited to information concerning the admission, detention or commitment of an individual who is presently admitted, detained or committed.")
[13]  For another example, see, sec. 51.30(4)(b)3 ("In approving research projects under this subsection, the department shall impose any additional safeguards needed to prevent unwarranted disclosure of information.")
[14]  See secs. 51.30(4)(b)5, 6, 7, 8, 9, 10, 20, 21, Stats. 1991-92.
[15]  See secs. 51.30(4)(b)1, 2, 15, Stats. 1991-92.
[16]  See secs. 51.30(4)(b)3, Stats. 1991-92.
[17]  See secs. 51.30(4)(b)8m, 12, 12m, 13, 16, 17, 19, 23, Stats. 1991-92.
[18]  See secs. 51.30(4)(b)18, 22, Stats. 1991-92.
[19]  See secs. 51.30(4)(b)11, 14, Stats. 1991-92. Thus a court may grant access to civil commitment court records when the information contained in the records is relevant to an issue before a court or an administrative agency. Portions of these records may be relevant, for example, in a criminal trial if a defendant pleads not guilty by reason of mental disease or defect. See, e.g., State v. Taylor, 142 Wis. 2d 36, 43, 417 N.W.2d 192 (Ct. App. 1987).

For additional examples of cases in which records of mental health patients were discoverable because relevant to the proceedings, see, e.g., Office of Mental Retardation and Developmental Disabilities v. Mastracci, 433 N.Y.S.2d 946, 948-49 (N.Y. App. Div. 1980), in which the New York Appellate Division held that limited portions of records of patients at a state facility for the mentally disabled could be released to an employee who was the subject of disciplinary proceedings. Disclosure was limited to the issues of competency and credibility of witnesses and of the propensity for violence of patients who were allegedly assaulted. Identity of the patients was to remain confidential. See also, State Board for Professional Medical Conduct v. New York State Commissioner of Mental Hygiene, 409 N.Y.S.2d 665, 666-67 (N.Y. App. Div. 1978), in which the New York Appellate Division upheld a court order allowing the State Board for Professional Medical Conduct to obtain certain records from a state psychiatric center to investigate complaints concerning the conduct of a physician.
[20]  Section 51.30(4)(b)12m, Stats. 1991-92, provides for release of treatment records without informed written consent of the individual in the following circumstance:

12m. To any person if the patient was admitted under s. 971.14 or 971.17 or ch. 975 or transferred under s. 51.35(3) or 51.37 and is on unauthorized absence from a treatment facility. Information released under this subdivision is limited to information that would assist in the apprehension of the patient.
[21]  An individual is dangerous if that individual evidences: "a substantial probability of physical harm to himself or herself"; "a substantial probability of physical harm to other individuals"; or, "such impaired judgment ... that there is a substantial probability of physical impairment or injury to himself or herself." Sec. 51.20(1)(a)2a-c, Stats. 1991-92.
[22]  In State v. Taylor, 142 Wis. 2d 36, 41, 417 N.W.2d 192 (Ct. App. 1987), the court of appeals concluded, citing sec. 905.04(4) (c), that by entering a plea of not guilty by reason of mental disease or defect, a defendant loses the physician-patient privilege with respect to his past psychiatric treatment records. The court of appeals also concluded that once the privilege is removed, the confidentiality of the past physician-patient privilege under sec. 51.30(4) is also removed.

See also sec. 51.30(6) that provides: "Sections 905.03 and 905.04 supersede this section with respect to communications between physicians and patients..."
[23]  With the consent of all parties, however, under sec. 971.14(4) the court can determine competency to stand trial without an evidentiary hearing.
[24]  Section 51.30(7) provides: "Except as otherwise specifically provided, this section applies to the treatment records of persons who are committed under chs. 971 and 975."
[25]  Counsel for the Journal Times stated at oral argument that all of these facts had been reported in the newspaper.
[26]  The circuit court may prohibit access to treatment records which are in the court file, as it did in this case, or to some of the court records. The circuit court should consider that the press represents the interest of the public insofar as access to the courtroom and court records is concerned. La Crosse Tribune v. Circuit Court, 115 Wis. 2d 220, 241-42, 340 N.W.2d 460 (1983).
[1]  Section 19.31, Stats., 1991-1992 states in relevant part:

[Sections] 19.32 to 19.37 [the open records statute], shall be construed in every instance with a presumption of complete public access, consistent with the conduct of governmental business.
Decisions I have authored for this court in which the court determined that records were to be open include: Hathaway v. Joint School District No. 1, City of Green Bay, 116 Wis. 2d 388, 342 N.W.2d 682 (1984); Newspapers, Inc., v. Breier, 89 Wis.2d 417, 279 N.W.2d 179 (1979); State ex rel. Journal Company v. County Court of Racine County, 43 Wis. 2d 297, 168 N.W.2d 836 (1969).
[2]  See State ex rel. La Crosse Tribune v. Circuit Court for La Crosse County, 115 Wis. 2d 220, 340 N.W.2d 460 (1983).
[3]  It should also be noted that sec. 19.36(1), Stats., specifically makes the presumption of open records inapplicable to statutes which specifically exempt records from disclosure.
