
149 N.W.2d 169 (1967)
Jerry Leroy HANSEN, Appellant,
v.
C. H. HAUGH, Warden, Men's Reformatory, Anamosa, Iowa, Appellee.
No. 52185.
Supreme Court of Iowa.
March 7, 1967.
Larry J. Conmey, Anamosa, for appellant.
Robert R. Beckman, County Atty., Robert D. Bernstein and Michael S. McCauley, Asst. Attys. Gen., for appellee.
*170 GARFIELD, Chief Justice.
Like the trial court, we refer to plaintiff as petitioner and to defendant as respondent. Petitioner is confined to the security hospital, part of the men's state reformatory at Anamosa of which respondent is warden. On August 18, 1965, petitioner filed in the Jones district court his petition for a writ of habeas corpus claiming his confinement to be illegal because he had not been convicted of a crime and should have been committed to a state mental health institute rather than to the security hospital at Anamosa.
After taking extensive evidence by both sides, hearing arguments of counsel and studying the briefs, the district court denied the writ and petitioner has appealed. We affirm the decision.
The appeal has been submitted upon a transcript from the district court, consisting mainly of the petition, the briefs and the decision and order. The appeal largely presents law questions. The court's extensive findings of fact are not challenged and we set them out as the facts in the case.
"1. Petitioner was indicted for murder in the first degree, the victim being an elderly lady who had been sexually assaulted and beaten to death by petitioner. The case was tried to a jury in the District Court of Pottawattamie County. On December 7, 1961, the jury returned a verdict of not guilty by reason of insanity.
"2. On December 15, 1961, the judge before whom the trial was held determined on overwhelming evidence that petitioner, if discharged from custody, would be dangerous to the public peace and safety. The judge's findings take grim note of the fact that in 1958, more than three years before the killing, a staff therapist at the Mental Health Institute at Independence, who had examined petitioner, reported that he, `at the depths of despair, is fully capable of killing other people.' The judge, pursuant to Code Section 785.19, ordered that petitioner be committed to `the Department for the Criminal Insane of the Men's Reformatory at Anamosa,' to be held there `until such time as he becomes sane and is no longer considered dangerous to the public peace and safety.' Since then, petitioner has been so confined under the authority of the judge's order.
"3. This `department' of the Reformatory is in fact a maximum security mental hospital located within the outer walls of the Reformatory.
"4. In Code Section 246.15, which requires the maintenance of this mental hospital at the Reformatory, and in several other sections, this hospital is labeled `department for mentally ill.' In Sections 783.3, 783.4 and 783.5, this hospital is labeled `department for the criminal insane.' In Section 218.92 this hospital is labeled `the hospital unit for the mentally ill.' Commitments are made to this hospital under Section 785.19, which authorizes commitments to `the insane hospital.' The Iowa Board of Control, the respondent Warden, the Superintendent of this hospital, and others refer to it as `the Security Hospital,' which name will be used by this Court.
"5. Petitioner, at the time of hearing in this case, October 20, 1965, was still mentally ill and would still be dangerous to society if discharged from custody.
"6. The Men's Reformatory at Anamosa is a penal institution.
"7. The Security Hospital is a part of the Men's Reformatory and, like the rest of it, is under the general control and authority of the respondent warden. The actual management and operation of the Security Hospital, however, is under the control of its Superintendent, Dr. Hege, a psychiatrist. In the minds of Dr. Hege, Chairman Wilson of the Board of Control and others the Security Hospital is a hospital, not a prison. The inmates are treated as patients, not as prisoners.
*171 "8. The Security Hospital is physically separated from the rest of the Men's Reformatory by a twenty-five foot high stone wall.
"9. Except for a small handful of severely regressed individuals, the inmates of the Security Hospital are quartered in a large dormitory-type ward, not in cells. (Petitioner has, at various times, been kept in a cell due to hostile behavior.) The hospital inmates pretty much have complete freedom of the hospital, including indoor and outdoor recreational areas.
"10. The Security Hospital is a maximum security hospital. Although the inmates enjoy considerable freedom of mobility within the hospital building and grounds, the periphery of the hospital area is securely guarded by high walls, bars on windows, and armed guards. This security prevents escape.
"11. There are no other maximum security hospitals in Iowa at the present time. If petitioner were placed in any of the State's Mental Institutes, he could escape and probably would. The only way he could be prevented from escaping from a Mental Health Institute would be to convert a room into a barred cell and keep him in it. Such confinement of petitioner would undoubtedly result in his rapid and total mental regression.
"12. The primary goal to be served by the Security Hospital is the protection of society from dangerous mentally ill persons. The secondary goal is to provide the patients with good psychiatric treatment. In the opinion of this Court, both goals are well served. Neither goal could be well served if dangerous mentally ill persons were committed to mental hospitals which are not maximum security, for the reasons pointed out in the preceding paragraph. Also, coping with dangerous mentally ill persons in a Mental Health Institute would adversely affect the Institute's therapeutic program for the rest of the patients.
"13. Prior to the decision of Judge B. J. Maxwell of this Court in Long v. Haugh, Warden, (April 14, 1965), discussed hereinafter, all inmates of the Security Hospital, including those who were civilly committed (like petitioner), were administratively treated like criminally committed prisioners of the Reformatory. They were `mugged' and fingerprinted, and the results were sent to the F.B.I.; they were assigned regular prison numbers, which were stenciled on their clothes; and general prison rules and regulations were applied for the most part.
"14. On September 28, 1965, as a response to the Long decision, the Board of Control passed a resolution providing for the termination of such procedures, and that civilly committed patients be subject only to the rules and administrative procedures promulgated by the Superintendent of the Security Hospital. Pursuant to this resolution, the changes called for are now being effectuated  no more `mugging' or fingerprinting; no more prison numbers; and Hospital, rather than prison, rules and procedures now apply. In essence, the Security Hospital is being separated from the rest of the Reformatory as much as is humanely possible under the circumstances.
"15. The Iowa Legislature has appropriated $2,605,000.00 for construction of a new maximum security mental hospital to be constructed at Oakdale, far from any penal institution. It is anticipated that this new hospital will be ready for occupancy in the summer or fall of 1967. Present plans are to move the Security Hospital staff intact to the new hospital. Patients such as petitioner would be committed to this new hopsital for security and treatment. House File 684, Acts of 61st G.A.
"16. Transfer of petitioner to a Mental Health Institute would create a clear and present danger to society, because of his potential for violence to others."
I. We note at this point we have uniformly held the trial court's findings of *172 fact in a habeas corpus action not involving custody of a child are binding upon us if supported by substantial evidence. Our review is not de novo. Herold v. Haugh, 258 Iowa ___, 145 N.W.2d 657, 659, 661, and citations; Rose v. Haugh, Iowa, 147 N.W. 2d 865, 868. Since, as stated, the above findings are not challenged we may assume they are adequately supported by evidence.
II. As the trial court observed, two issues are presented: (1) Does section 785.19, infra, authorize commitment to the security hospital, and (2) If so, are the statute and petitioner's confinement thereunder constitutional or do they violate due process of law?
Code section 785.19, under which the judge of the Pottawattamie court purported to act in ordering petitioner committed to the security hospital, provides:
"If the defense is insanity of the defendant, the jury must be instructed, if it acquits him on that ground, to state that fact in its verdict. The court may thereupon, if the defendant is in custody, and his discharge is found to be dangerous to the public peace and safety, order him committed to the insane hospital, or retained in custody, until he becomes sane."
The trial court concluded and we agree section 785.19 authorized petitioner's commitment to the security hospital. We cannot accept the contention that the words "the insane hospital" refer solely to one of the four mental health institutes at Cherokee, Clarinda, Independence and Mount Pleasant, respectively. The construction contended for is contrary to the meaning district courts and those charged with management of the security hospital have long ascribed to section 785.19.
If the legislature intended section 785.19 to authorize commitment of a defendant only to a state mental health institute or to be "retained in custody" it could easily have so stated. It is not the function of courts to legislate and they are constitutionally prohibited from doing so. Article III, section 1, Iowa Constitution.
III. On the facts found by the trial court his conclusions of law, other than that section 785.19 does not authorize commitment only to a mental health institute, include: "5. Petitioner's confinement is under a civil commitment, not a criminal one; 6. The Code provides for other types of `civil commitments' to the Security Hospital. Sections 218.92 (dangerous mental patients from mental health institutes and other state institutions), 226.30 (dangerous mental patients from mental health institutes), 246.17 (retention of mentally ill prisoners in the Security Hospital upon expiration of their criminal sentence), and 783.3 (defendants in criminal cases found to be dangerously insane at time of trial); 7. Mentally ill convicts from the Men's Reformatory and the Pentitentiary at Fort Madison are also transferred to the Security Hospital. Sections 246.15 and 246.16.
"8. Notwithstanding the facts recited in paragraph 14 of the Findings of Facts, the Security Hospital remains within the walls of the Men's Reformatory and a `department' thereof; the Resolution of the Board of Control and the administrative changes thereunder cannot alter the physical location of the Security Hospital and cannot amend Section 246.15, which establishes the Security Hospital as a `department' of the Reformatory."
The trial court's conclusions 9 and 10 quote constitutional guarantees of due process and conclusion 11 quotes Article I, section 10, Iowa Constitution regarding rights of an accused in criminal prosecutions.
The conclusions of law continue:
"12. In Long v. Haugh, Warden, decided April 14, 1965, petitioner had been transferred to the Security Hospital from a Mental Health Institute under the provisions of Section 218.92. Judge B. J. Maxwell of this Court, in a calendar entry, found the transfer of petitioner to the Security *173 Hospital of the Reformatory was invalid because the authorization under Section 218.92 is unconstitutional, sustained the petitioner's writ of habeas corpus, and remanded petitioner to the Board of Control for commitment to an `appropriate Mental Health Hospital of the State of Iowa.' In the Long case, respondent offered no evidence. Judge Maxwell was not apprised of the fact there is no other mental hospital in Iowa that could provide the necessary maximum security  in effect, that no other appropriate mental health hospital existed. The Long decision came before the development of the facts recited in paragraph 14 of the Findings of Fact herein and before the Legislature appropriated the funds to build a new maximum security mental hospital.
"13. In Re Maddox, 351 Mich. 358, 88 N.W.2d 470, (1958) is relied on by petitioner. Maddox was committed to a state prison under Michigan's `sexual psychopath' statute, which authorized commitments to `an appropriate state institution.' This was a `civil commitment.' His commitment was to the prison generally, not to a hospital within the prison. With two exceptions, he was under the same prison discipline and routine as was applied to prisoners sentenced under the criminal code. Four psychiatrists testified that Maddox's incarceration in the prison was in and of itself a form of treatment for his type of problem. Maddox brought a habeas corpus action, and the Michigan Court held his incarceration in the prison violated various constitutional rights, including his right to due process of law, and ordered him returned to `an appropriate State institution' within one month. * * *
"14. Petitioner also relies on White v. Reid, 126 F.Supp. 867 (D.C.1954). There White, a juvenile, had been ordered in a civil juvenile proceeding to be committed to an institution to be designated by the Attorney General of the United States. The Attorney General designated the Federal Correctional Institution at Ashland, Kentucky, a place of confinement for youthful offenders convicted of a crime. White brought a habeas corpus action, and the Court held commitment of White to Ashland would be unconstitutional. See: Benton v. Reid [98 U.S.App.D.C. 27], 231 F.2d 780 (D.C.Cir.1956); In Re Gentile's Petition, 339 Mass. 319, 159 N.E.2d 86 (1959); and Commonwealth v. Page, 339 Mass. 313, 159 N.E.2d 82 (1959). But see: U.S. [ex rel. Carroll] v. McNeill [2 Cir.], 294 F.2d 117 (1963); People [ex rel. Kamisaroff] v. Johnston, 13 N.Y.2d [66] 69 [242 N.Y.S.2d 38, 192 N.E.2d 11] (1963); People [ex rel. Sapp] v. McNeill [207 Misc. 686], 138 N.Y.S.2d 725 (1955); Kenstrip v. Cranor [39 Wash.2d 403], 235 P.2d 467 (Wash.1951).
"15. A person civilly committed to the Security Hospital can always raise the question of his mental illness by habeas corpus proceedings. Section 229.37; Hiatt v. Soucek, 240 Iowa 300, 304, 36 N.W.2d 432, 434 (1949).
"16. Original civil commitment of a mentally ill person without the procedures enumerated in Section 10 of Article I of the Constitution of Iowa is not unconstitutional. Peff v. Doolittle, 235 Iowa 443, 15 N.W.2d 913 (1944); Maxwell v. Maxwell, 189 Iowa 7, 177 N.W. 541 [10 A.L.R. 482] (1920); and County of Black Hawk v. Springer, 58 Iowa 417, 10 N.W. 791 (1882).
"17. * * *
"18. Enactment of 785.19 and the order of the Judge thereunder committing petitioner to the Security Hospital is an exercise of what is known as the `police power' of the State. Generally, an exercise of the police power is valid if it bears a real and substantial relation to the public health, safety, morals or general welfare, providing it is not unreasonable or arbitrary. 16 Am.Jur.2d, Constitutional Law, Section 286, p. 556.
"19. It is the duty of the court to uphold the constitutionality of a statute if possible. *174 Hiatt v. Soucek, supra, 240 Iowa 300, 302, 36 N.W.2d 432, 433."
On the facts and legal conclusions referred to, the trial court expressed the view by way of dicta that petitioner's confinement would violate due process if it were to the reformatory generally as in In re Maddox and White v. Reid, both supra, or (2) if there were in Iowa another appropriate institution, i.e., another maximum security mental hospital, to which petitioner could be committed, as in the Maddox and White cases, or (3) if petitioner, though mentally ill, were not dangerous to society.
On the record as made, however, the trial court held section 785.19 and petitioner's confinement thereunder do not violate due process but are constitutional. These considerations were deemed controlling: (1) The clear and present danger to society if petitioner were transferred to a mental health institute because of his potential for escape and violence to others; (2) Although the security hospital is a department of the reformatory located within its outer walls, it is in fact a mental hospital separated from the rest of the reformatory; (3) The present non-prison type administration and procedures of the security hospital; and (4) The state will have ready for occupancy within two years (much less than one year from now) a non-penal maximum security mental hospital so petitioner's confinement to the security hospital is a temporary expedient pending occupancy of the new hospital.
IV. It is of course our duty to uphold the constitutionality of section 785.19 if fairly possible. A statute will not be declared unconstitutional unless it clearly, plainly, palpably and without doubt infringes the constitution. We have repeatedly said in various ways that every reasonable doubt must be resolved in favor of constitutionality. Cases so holding are literally too numerous to mention. Hiatt v. Soucek, supra, 240 Iowa 300, 302, 36 N.W. 2d 432, 434, and citations; Dickinson v. Porter, 240 Iowa 393, 398-399, 35 N.W.2d 66, 71, and citations, appeal dismissed 338 U.S. 843, 70 S.Ct. 88, 94 L.Ed. 515; Spurbeck v. Statton, 252 Iowa 279, 283-284, 106 N.W.2d 660, 663, and citations. See also Becker v. Board of Education, 258 Iowa 277, 138 N.W.2d 909, 912, and citations.
Like the trial court, whose decision we approve, we are not persuaded section 785.19 or petitioner's confinement thereunder to what the trial court refers as the security hospital violates petitioner's constitutional rights to due process. No other constitutional question is raised. Our conclusion finds strong support from Rose v. Haugh, supra, Iowa, 147 N.W.2d 865.
There Rose was found to be mentally ill while confined in the reformatory at Anamosa. Pursuant to section 246.16 the state board of control transferred him to the security hospital. Shortly before his sentence expired, he was again examined and found to be extremely dangerous, with a high potential for violence toward others. The board of control, pursuant to section 246.17, ordered Rose further confined in the security hospital until he recovered or was otherwise legally released.
Rose appealed from this order in a civil proceeding authorized by section 229.17, was found then mentally ill and returned to the security hospital.
In the month preceding the filing of Hansen's petition for writ of habeas corpus here Rose filed a similar petition in the same court before the same judge, raising the same claim of violation of due process and citing In re Maddox, supra, 351 Mich. 358, 88 N.W.2d 470, and White v. Reid, supra, (D.C.Dist.Col.) 126 F.Supp. 867. Under findings of fact and conclusions of law similar to those here, the trial court denied relief and we affirmed.
Our Rose opinion makes it clear that his restraint under a civil commitment, like that of petitioner here, is not by way of punishment *175 for any act done but as treatment of his unfortunate infirmity. Constitutional provisions relating to due process for one accused of crime are not applicable to a person who must be restrained as insane. County of Black Hawk v. Springer, 58 Iowa 417, 418, 10 N.W. 791, 792-793; Maxwell v. Maxwell, 189 Iowa 7, 10, 177 N.W. 541, 543, 10 A.L.R. 482, 485 and annotation at 488; Peff v. Doolittle, 235 Iowa 443, 454, 15 N. W.2d 913, 918.
Hiatt v. Soucek, supra, 240 Iowa 300, 36 N.W.2d 432, also fully supports our decision. While serving a sentence in the men's reformatory at Anamosa Hiatt was found insane and transferred to the department for criminal insane (the security hospital) there, pursuant to Code section 246.16. Before his sentence expired he was examined by three physicians experienced in treating mental disease, found to be still insane and transferred at the expiration of his sentence to the mental health institute at Cherokee, pursuant to section 246.17.
Neither section 246.16 nor 246.17 requires a finding of mental illness by anyone other than one of the superintendents of a hospital for the mentally ill (in 246.16) or by competent physicians (in 246.17). The board of control is authorized to make the order for transfer of one so found to be mentally ill or, in 246.17, for continued confinement in the department for the mentally ill at Anamosa. As petitioner did here, Hiatt sought his release from confinement by habeas corpus on the ground the statutes deprived him of due process under federal and state constitutions.
We held neither statute violates requirements of due process, notwithstanding neither requires hearing or opportunity for appeal prior to or in connection with the commitment, in view of this provision of section 229.37: "All persons confined as insane shall be entitled to the benefit of the writ of habeas corpus, and the question of insanity shall be decided at the hearing."
The Hiatt opinion points out (pages 304-305 of 240 Iowa, page 435 of 36 N.W.2d) this provision applies to all persons confined in state supervised hospitals, the remedy there provided is analogous to an appeal to the district court and is an enlargement of the commonlaw remedy of habeas corpus. "In short, summary or ex parte administrative procedure immediately affecting private personal and property rights is usually held not to violate constitutional safeguards if opportunity for prompt subsequent judicial review is afforded" (page 306 of 240 Iowa, page 436 of 36 N.W.2d). Douglas v. King, 8 Cir. Mo., 110 F.2d 911, 127 A.L.R. 1200, and Estabrook v. King, 8 Cir. Mo., 119 F.2d 607, are cited for the constitutionality of the determination of Hiatt's mental condition at the time he was transferred to the department for criminal insane at Anamosa. See also Spurbeck v. Statton, supra, 252 Iowa 279, 288-289, 106 N.W.2d 660, 665-666.
It must be presumed this petitioner will be released from his confinement if he becomes sane and is no longer dangerous to public peace and safety. Such is the order of the judge of the Pottawattamie court. If he is not so released, the remedy Code section 229.37 provides is of course available to him.
The two precedents petitioner cites, In re Maddox, supra, 351 Mich. 358, 88 N.W.2d 470, and White v. Reid, supra, (D.C.Dist. Col.) 126 F.Supp. 867, are adequately distinguished in the trial court's conclusions of law 13 and 14, supra.
Affirmed.
All Justices concur.
