
297 N.W.2d 320 (1980)
HOSPITAL SERVICES, INC., a corporation, Plaintiff and Appellant,
v.
Albert J. DUMAS, Jr., and County of Ramsey, State of North Dakota, Defendants and Appellees.
Civ. No. 9776.
Supreme Court of North Dakota.
October 6, 1980.
Pearson & Christensen, Grand Forks, for plaintiff and appellant; argued by Douglas A. Christensen, Grand Forks.
Duane Schurman, Walhalla, for Albert J. Dumas, Jr.
Lewis C. Jorgenson, State's Atty., Devils Lake, for County of Ramsey (no appearance on oral argument).
PEDERSON, Justice.
This is an appeal from a district court dismissal[1] of appellant Hospital Services' *321 suit against Albert Dumas and Ramsey County for recovery of $729.40 for services furnished Dumas by the North Dakota State Hospital. We reverse and direct entry of judgment against Ramsey County.
There is no material dispute as to the facts. In the early morning of November 19, 1975, Dumas was arrested and jailed for disorderly conduct. He appeared quite intoxicated. Later that same morning he was ordered to appear in the Ramsey County Court of Increased Jurisdiction. Claiming paralysis of his lower extremities, Dumas was unable to leave his cell. A physician examined Dumas and expressed the opinion that his condition was not serious. The judge of the county court, being unwilling to have Dumas carried into the courtroom, remanded Dumas to the custody of the Ramsey County sheriff and drafted an order committing him to the State Hospital in Jamestown.
The record is bare of any evidence, medical or otherwise, that Dumas's mental state left him unable to appear in his own defense. The committal order recites that Dumas's commitment was for treatment of alcoholism. In custody of the Ramsey County sheriff, Dumas arrived at the State Hospital on November 20 and was not allowed to leave until December 10. During that period he received services and supplies worth $729.40. Upon completion of treatment, Dumas was remanded to the custody of the Ramsey County sheriff and returned to Devils Lake.
The disorderly conduct charge was dismissed. On October 27, 1976, the State Hospital assigned the claim against Dumas of $729.40 to appellant Hospital Services, Inc.
A patient of the State Hospital is ordinarily responsible for the cost of treatment received. Section 25-09-02, NDCC, provides that the Hospital "shall recover monthly from the patient, if possible, or from the person who has been a patient in such institution after he has been discharged from the institution, expenses for care and treatment." No distinction is made between those who are patients voluntarily and those who are not. And there is authority for the proposition that a patient or his estate may, without offending constitutional safeguards, be charged for expenses arising from commitments to a health care facility. 20 A.L.R.3d 363.
Dumas is thus technically liable under the statute. The assignment of the claim by the State Hospital to Hospital Services is lawful, § 25-09-07(2), NDCC, and does not alter the obligation, which can be reduced to a judgment against the patient. Hospital Services, Inc. v. Brackey, 283 N.W.2d 174, 177 (N.D. 1979).
We conclude that Dumas's liability under the statute is, in this case, precluded by the fact that he was a prisoner in the custody of the Ramsey County sheriff. Chapter 12-44, NDCC, in force at the time of Dumas's commitment, when read together with the jail rules promulgated by the District Court for Ramsey County, requires that expenses for medical care furnished to Dumas be paid by the County.
Section 12-44-04, NDCC, states that the district courts "shall prescribe, in writing, rules for the regulation and government of the jail in the several counties within their respective districts, upon the following subjects:... 5. The employment of medical and surgical aid when necessary." Section 12-44-16 obligates counties to supply prisoners with "nursing when required ... and all necessaries for the comfort and welfare of the prisoners, as the judge of the district court shall designate by his rules." This statutory scheme plainly intends that within certain broad limits the district court has authority to define the terms upon which prisoners will receive medical care.
The rules adopted by the District Court for Ramsey County, of which we take judicial notice, establish that:

*322 "The Jailer shall see that any prisoner requiring medical attention receives the same promptly. Cost of same shall be paid by the governmental agency committing such prisoner and reimbursement sought from the prisoner." Rule 9, Jail Rules in and for the Second Judicial District, State of North Dakota. [Emphasis supplied.]
Clearly, Ramsey County is responsible for providing medical services to its prisoners and must, as the committing agency, pay for Dumas's expenses.
That Dumas's expenses were incurred at a state institution is of little consequence. The State Hospital is under a statutory duty to recover expenses from its patients. Thus its operation, insofar as it bills patients for services, is similar to any ordinary private facility. Counsel for Ramsey County asserts that the County should be spared liability simply because it would involve one governmental agency paying another for its services. Why this is improper is not made clear and no authority is cited. The County contends that had the Legislature intended agencies of government to reimburse the State Hospital for services it would have expressly said so. This argument, of course, works both ways, i. e., that by providing no exceptions in its directive that the Hospital recover expenses, the Legislature intended payment from government agencies as well as others that may be liable. Ramsey County's argument is not convincing.
Ramsey County's liability depends on whether or not it had custody of Dumas. The obligation exists only if the person receiving care is in custody as a prisoner. It was not, and cannot be reasonably denied, that Dumas was in "custody" from the time of his arrest until after his hospitalization and return to Ramsey County. See Chapter 29-08, NDCC; Rule 46, North Dakota Rules of Criminal Procedure. The fact that Dumas was under arrest and in custody upon arriving at the hospital is probably sufficient alone to make Ramsey County liable. See Mt. Carmel Med. Center v. Bd. of Cty. Com'rs, 1 Kan.App.2d 374, 566 P.2d 384, 388 (1977). In addition, however, Dumas's stay at the hospital was pursuant to an involuntary commitment and was ended by his return to the Ramsey County sheriff. It is clear that custody was continuous and effective even if not formal. See Mercy Medical Center, Inc. v. Douglas Cty., 28 Or.App. 557, 559 P.2d 1286, 1287 (1977).
Finally, we note under Jail Rule 9, above, that Dumas may be responsible for reimbursing Ramsey County whatever it pays for his medical expenses. That question is not before us. In any event, this does not relieve Ramsey County of the obligation.
Dumas has made constitutional objections to the commitment procedure itself. The order pursuant to which Dumas was committed states that the court's authority derives from § 12.1-32-02(1)(g), NDCC. However, this provision is for post-conviction commitment only, and the judge issuing the order testified at trial that his intent was to commit Dumas under § 12.1-04-06, NDCC. This statute authorizes a pretrial judicial commitment where the defendant's mental condition may constitute a defense or issue in the case, or where such condition so disables the defendant that he cannot reasonably proceed. Because the judge had authority to make a lawful commitment, we will not find his act invalid simply because of a mistaken citation. In light of our decision that Ramsey County must pay Dumas's expenses, we need not confront those issues.
The judgment of the district court is reversed and, upon remand, we direct the entry of judgment for Hospital Services, Inc., against Ramsey County.
ERICKSTAD, C. J., and PAULSON, SAND and VANDE WALLE, JJ., concur.
NOTES
[1]  The notice of appeal recites that the appeal is from a memorandum opinion, from which no appeal is permitted. Chas. F. Ellis Agency, Inc. v. Berg, 214 N.W.2d 507 (N.D. 1974). In this case the memorandum opinion contained an order of dismissal, from which an appeal is permitted. United Plainsmen Assn. v. North Dakota State Water Conservation Commission, 247 N.W.2d 457 (N.D. 1976).
