
100 N.J. Super. 595 (1968)
242 A.2d 861
LLOYD W. MC CORKLE, COMMISSIONER OF INSTITUTIONS AND AGENCIES OF THE STATE OF NEW JERSEY, PLAINTIFF-RESPONDENT,
v.
BERNARD SMITH, DEFENDANT-APPELLANT.
BERNARD SMITH, PLAINTIFF-APPELLANT,
v.
LLOYD W. MC CORKLE, DEFENDANT-RESPONDENT.
Superior Court of New Jersey, Appellate Division.
Argued April 22, 1968.
Decided May 10, 1968.
*596 Before Judges GOLDMANN, KILKENNY and CARTON.
Mr. Samuel A. Donio, assigned counsel, argued the cause for appellant Bernard Smith.
Mr. Eugene T. Urbaniak, Deputy Attorney General, argued the cause for respondent (Mr. Arthur J. Sills, Attorney General of New Jersey, attorney).
The opinion of the court was delivered by KILKENNY, J.A.D.
In these combined appeals Bernard Smith, a long-term prisoner at State Prison, charges that: (1) the Commissioner of Institutions and Agencies did not *597 have authority under R.S. 30:4-7 to transfer him to a state mental hospital; (2) his commitment to the Trenton State Hospital was done under circumstances fundamentally unfair and shocking to a sense of justice, in violation of constitutional due process guaranteed by the Fourteenth Amendment, and (3) his continued detention at that hospital entitled him to a writ of habeas corpus, erroneously denied.
At the time of oral argument of this appeal Smith had been retransferred from the Trenton State Hospital to State Prison, thereby making moot substantially all of his claims of administrative and judicial error. Since the issues may arise again, we consider for future guidance the points advanced by him.
Smith was received at State Prison on December 19, 1946 after conviction in Atlantic County of robberies, breaking and entering, and murder. Consecutive sentences aggregating 48 to 52 years were imposed, to which was superadded a consecutive life sentence. Thereafter, the Mercer County Court imposed an additional five-to-seven-year sentence for atrocious assault and battery, which was made consecutive to the aforementioned sentences, and later lodged as a detainer.
The record indicates that Smith has a long history of mental illness. As early as November 24, 1954 Dr. Paul B. Means, a staff psychiatrist at State Prison, indicated that Smith required treatment for a psychopathic personality with psychosis paranoid type. By reason thereof, he was transferred to the New Jersey State Hospital for treatment for that condition. Authority for the transfer was based on R.S. 30:4-7. Smith improved and he was returned to prison on February 28, 1964.
On January 27, 1965 Dr. Sidney G. Fine, a clinical psychiatrist at the State Prison, found Smith in partial remission with a diagnosis of schizophrenic reaction. Subsequent examinations by Dr. Fine in March and April, and on May 21, 1965 disclosed his adjustment as not favorable. Smith was retransferred to the State Hospital on May 21, 1965. He remained there until January 17, 1966 when, his *598 condition having improved, he was again transferred to prison to continue service of his sentences.
Dr. Fine again found him psychotic on August 10, 1966 and on the same day Smith was once more transferred to the State Hospital. After this transfer, Smith challenged his continued hospitalization. Judge Kingfield, sitting specially on September 22, 1966 at the hospital, after hearing and considering the psychiatric testimony presented, found that Smith was still in need of hospitalization. A writ of habeas corpus was denied.
All of the above transfers were made under the authority of R.S. 30:4-7. However, the last transfer to the hospital was followed by a regular commitment hearing in the Mercer County Court, pursuant to R.S. 30:4-82. At that hearing, Smith asked for the appointment of an attorney or a psychiatrist to act in his behalf. His request was denied by the hearing judge. Following testimony by Dr. Joachim Elizondo and Dr. Pongrac Feniczy, two licensed physicians on the staff of the New Jersey State Hospital at Trenton, and also the testimony of Smith, the County Court determined that he was mentally ill and required hospitalization for such mental illness. Accordingly, an order was entered on May 12, 1967 committing Smith to the New Jersey State Hospital at Trenton to be cared for there at the expense of the State of New Jersey.
Subsequent thereto, as first noted above, Smith recovered his mental competency sufficiently to be returned to State Prison. (We have informally been advised by his attorney that Smith was transferred back to the State Hospital on or about April 28, 1968).

I
We find lacking in merit Smith's claim that the Commissioner of Institutions and Agencies did not have authority under R.S. 30:4-7 to transfer him from State Prison to the State Hospital at Trenton. That statutory provision, originally L. 1918, c. 147, sets forth:
*599 "Each board of managers shall have power to place any inmate in any hospital in the State for such medical or surgical treatment as may be necessary, which cannot properly and adequately be rendered within the institution, and to pay for the care, maintenance and treatment of such persons, the approval of the commissioner first having been obtained."
To facilitate transfers, often arising under emergency conditions, the Board of Managers of State Prison has authorized the Commissioner, upon request of the Warden, to make these transfers. Smith's transfers were made pursuant to the statutory authority and administrative procedure.
The State Prison does not have a psychiatric unit wherein patients suffering from mental illness can be treated on a long-term basis. There are available the services of a medical director, psychiatrist and nurses to deal with day-to-day problems. There is an infirmary to accommodate surgical cases and after-care convalescence on a longer term basis, but a ward for psychotic patients has not yet been developed. Hence, when a prisoner becomes mentally ill and poses a danger to himself and other prison inmates, temporary transfer to a mental hospital where he can be properly treated becomes necessary and is sanctioned by R.S. 30:4-7.
These temporary transfers from prison to hospital  now limited to 30 days without formal commitment by L. 1965, c. 59, § 70 (N.J.S.A. 30:4-84)  permits psychiatric treatment of the prisoner under more suitable surroundings at the expense of the State. Their salutary benefits were manifested in Smith's case by the improvement in his mental condition as a result of the hospital care. Additionally, the transfer without court commitment proceedings under R.S. 30:4-82 eliminated any stigma possibly attaching to the entry of the court order and the determination of mental illness expressed therein. The prison authorities have found by experience that episodes of psychosis on the part of inmates are frequently of short duration and, therefore, do not warrant formal commitment proceedings.
*600 When the prison and hospital authorities ultimately felt that Smith's psychotic episodes would continue, then a regular commitment proceeding was pursued under R.S. 30:4-82.
There has been no showing that Smith has been prejudiced by earlier transfers to the hospital, without court order, for substantially longer periods than now contemplated by law and the administrative regulations. In each instance, he has been retransferred to prison in better mental health. He has not suffered so far as parole is concerned. The parole board heard his application for parole on February 21, 1968. Another hearing is scheduled for May 1969. Much will depend upon an improvement in his mental condition.
We conclude that the Commissioner of Institutions and Agencies does have authority under R.S. 30:4-7, as implemented by the administrative regulations, to make transfers of inmates of State Prison to a state mental hospital, when the need arises, without formal court commitment proceedings, but subject to the limitations imposed by L. 1965, c. 59, § 70; N.J.S.A. 30:4-84.

II
In the hearing before Judge Kingfield, a question arose as to whether Smith's challenge as to the propriety of the Commissioner's order of transfer required review in the Appellate Division under R.R. 4:88, rather than the sought for writ of habeas corpus. Despite the judge's view that Appellate Division review was the proper remedy, Smith was accorded a hearing on the merits as to his application. A writ of habeas corpus was denied.
The substantive issue became moot when Smith was returned to State Prison, where he wanted to be when he challenged his transfer to the State Hospital.
As to the procedural question, R.R. 4:88 provides a simple and direct appellate review of any final order or decision of any state administrative agency or official. This rule presents *601 an available remedy to one who feels aggrieved by a state administrative ruling.
As to persons confined in any hospital for the insane within this State, an application for a writ of habeas corpus is listed as an appropriate remedy in N.J.S. 2A:67-13, paragraph e, for determining sanity or insanity. So, too, N.J.S.A. 30:4-24.2, in defining the rights of patients, including the mentally ill, committed to institutions in this State, provides:
"Any individual detained pursuant to this act shall be entitled to a writ of habeas corpus upon proper petition by himself, by a relative, or a friend to any court of competent jurisdiction in the county in which he is detained."
Thus, habeas corpus appears to be an available remedy to one confined in any hospital or institution on the grounds of insanity or mental illness for the purpose of determining the basis for the confinement.
Is habeas corpus an appropriate remedy when it will not effect the complete release of the person detained, but merely alters the place of his confinement from State Prison to a state mental hospital? The converse of this situation was considered in State v. Newton, 17 N.J. 271 (1955). There, Newton petitioned for a writ of habeas corpus when he was transferred from a mental institution, to which he had been committed as a sex offender, to State Prison to serve the remainder of his term. Denial by the County Court of the writ was affirmed by the Supreme Court. It noted that Newton was not entitled, in any event, to his immediate release from custody and denial of the writ of habeas corpus might be sustained on that ground alone. But see State v. Wingler, 25 N.J. 161, 180-181 (1957). However, in Newton, the court proceeded to decide the issue on its merits and concluded that the Commissioner of Institutions and Agencies had the authority, in his discretion, to transfer Newton from a mental institution to State Prison to serve the remainder of his term.
*602 In the instant case Smith, too, was not entitled to immediate release from custody when he sought by habeas corpus proceeding to review the validity of the Commissioner's order, transferring him from State Prison to the State Hospital at Trenton for psychiatric treatment. The orders of May 24, 1965 and August 10, 1966 recited that Smith was "to be retransferred to the State Prison at Trenton upon completion of this special service." While habeas corpus may have been a technically available remedy, by virtue of N.J.S. 2A:67-13 or N.J.S.A. 30:4-24.2 supra, the ordinary remedy in such a situation was a review of the administrative action in the Appellate Division, pursuant to R.R. 4:88-8. The judicial commitment by the County Court was reviewable by appeal  a remedy Smith pursued herein.
In all events, Judge Kingfield properly denied the writ on the merits. Furthermore, the challenged action was remedied by Smith's retransfer to State Prison during the pendency of this appeal.

III
It would have comported more with fundamental fairness to have assigned an attorney to act on Smith's behalf, when he made a request for an attorney on his application for habeas corpus and at the commitment hearing in the County Court. We acceded to such a request when he sought leave to appeal as an indigent. In our view, counsel should be provided in every judicial commitment proceeding; this is the proper practice and one that should be pursued. See People ex rel. Rogers v. Stanley, 17 N.Y.2d 256, 270 N.Y.S.2d 573, 217 N.E.2d 636 (Ct. App. 1966).
However, the denial of Smith's requests for counsel at the habeas corpus and County Court hearings raises a moot issue at this time in the light of Smith's retransfer from the State Hospital to State Prison. What he sought by habeas corpus was thus accomplished; the County Court order of commitment spent itself. Its only use was to effect *603 a commitment under R.S. 30:4-82. Its vacation at this time would serve no useful purpose.
Under the circumstances, the orders under review are affirmed.
