
138 Cal.App.3d 970 (1982)
188 Cal. Rptr. 376
THE PEOPLE, Plaintiff and Appellant,
v.
ERIC JOSEPH SAVILLE, JR., Defendant and Respondent.
Docket No. 42013.
Court of Appeals of California, Second District, Division Two.
December 14, 1982.
*971 COUNSEL
John K. Van de Kamp, District Attorney, Donald J. Kaplan and Dirk L. Hudson, Deputy District Attorneys, for Plaintiff and Appellant.
Wilbur F. Littlefield, Public Defender, Laurence M. Sarnoff, Steve Webber and Ronald B. Davey, Deputy Public Defenders, for Defendant and Respondent.
OPINION
ROTH, P.J.
Respondent was committed to Atascadero State Hospital in 1973 pursuant to Penal Code section 1026 after having been found not guilty by *972 reason of insanity of assault with a deadly weapon (Pen. Code, § 245, subd. (a)) and assault with a deadly weapon with intent to commit murder (Pen. Code, § 217). His maximum term of commitment was set at 2,190 days, a period he maintained expired on October 9, 1981.
On October 14, 1981, a petition for extended commitment was filed by the District Attorney of Los Angeles County pursuant to Penal Code section 1026.5. Asserting lack of jurisdiction based on the termination of his commitment, respondent sought and obtained a writ of habeas corpus dismissing the petition. This appeal followed. We affirm.
During the course of commitment, respondent was at various times granted outpatient status, which was in turn periodically curtailed on account of respondent's unacceptable behaviour.[1] On some of these occasions of curtailment, respondent, rather than being returned to Atascadero, was hospitalized in other institutions under provisions of Welfare and Institutions Code sections 5150 and 5250, part of the so-called Lanterman-Petris-Short Act (LPS) (see fn. 1).
At the hearing on the petition for writ of habeas corpus, it was shown that respondent was entitled without dispute[2] to credit for 2,111 days against his maximum commitment term of 2,190 days. Contested on the issue of credit, on the other hand, were 104 days spent by respondent in institutions other than Atascadero under the circumstances described, the contention of appellant in this regard being that, whereas respondent not only could have been but in fact was hospitalized through appropriate application of the provisions of LPS rather than by virtue of any requirement of the Penal Code, credit against the commitment term was improper.
The trial court, to the contrary, concluded respondent was entitled to credit for 84 of the 104 days, for a total confinement attributable to the commitment term of 2,195 days, on the rationale that even though respondent had been hospitalized under LPS on the occasions referred to, those commitments were nevertheless, upon the basis of substantial evidence establishing the fact, the result of action initiated by Atascadero State Hospital or by respondent's outpatient supervisor, the Los Angeles County Health Department, or his outpatient provider, the Center for Legal Psychiatry.
Against this conclusion, appellant urged before the trial court and reiterates here that, for purposes of Penal Code section 1026.5, the phrase "maximum *973 term of commitment" is defined as "the longest term of imprisonment which could have been imposed for the offense or offenses of which the person was convicted, ... less any applicable credits as defined by Section 2900.5, ..." (Pen. Code, § 1026.5, subd. (a)(1)) and that, except for presentence custody, the only applicable credits as defined by Penal Code section 2900.5 are those "attributable to proceedings related to the same conduct for which the defendant has been convicted." The result, it is then said, is that respondent is not entitled to credit for hospitalization he would have been subjected to for reasons independent of his initial confinement, i.e. pursuant to the provisions of LPS.
The trial court, as noted, in ruling otherwise on the question, observed that "We come to the first point of contention. Mr. Saville was picked up in 1976 by the police and taken to the hospital in an incident that has been described, ...
"The consensus was that Atascadero State Hospital should send a pick-up order for client, and this was done....
"Briefly, the police went to pick up the client, Mr. Saville, as a result of that order, and apparently when they went to pick him up they found that he had been cutting his eyelids.
"It appears to me that a person's hospitalization which results from the police going to pick him up because Atascadero State Hospital orders a pick-up order for him, results in time which is credited to his commitment.
"If you do not say that, you could say that Atascadero could order the police under the NGI commitment to pick up somebody  they could tell the police to bring the person to another hospital and leave that person in another hospital for months before they effectuate a transfer to Atascadero, and that none of that time would count.
"The reason the police went to pick up Mr. Saville was because Atascadero under the agis [sic] of the NGI commitment told them to pick him up. Otherwise, they wouldn't have been there.
".... .... .... .... .... ...
"They were all ready to have him brought in to the hospital when the police picked him up. It would be hard for me to visualize a reason for not counting that as part of his commitment time.
"This is not like the cases that have been cited involving other incidents. It is easy to say that if a person is picked up for armed robbery, time applicable to another charge of burglary should not apply. There are two different incidents, *974 two different crimes. This is not a criminal matter. Mr. Saville was not guilty by reason of insanity. There is no incident to refer to. The only thing we can refer to is the treatment that the hospital provides him to attempt to restore his sanity. This is the only thing we have to look at as a measure for what incarcertaion [sic] should count towards his commitment.
"Clearly, when the hospital itself says that he should be picked up and orders the police to pick him up, they are doing it as part of what they assume to be the necessary treatment to restore his sanity, and that time should count toward his treatment. It matters not whether the time is spent in La Jolla Hospital, Atascadero Hospital, or what hospital. The important thing is that his incarceration was not the result of an unrelated incident, but was in fact the result of the NGI commitment.
".... .... .... .... .... ...
"I would find that those hospitalizations which are instigated or ordered by either the outpatient facility or by the State Hospital are the types of hospitalizations in which a person could be credited, but no hospitalizations that are not related factually to the NGI commitment."
(1) We find the reasoning so expressed persuasive and the conclusion based thereon correct, the evidence having been clear on the point that the involvement of Atascadero and its outpatient counterparts accounted for the 84 days of confinement and derived solely from their relationship to respondent in the setting of his not guilty by reason of insanity commitment, whatever may have been the immediate cause of their intervention or the particular means by which that intervention was effected.
Accordingly, the petition for extended commitment was filed five days after termination of respondent's maximum permissible confinement.[3] Such being the case, the trial court properly declined to entertain it. (People v. Pacini (1981) 120 Cal. App.3d 877 [174 Cal. Rptr. 820]; cf. Johns v. Superior Court (1981) 119 Cal. App.3d 577 [175 Cal. Rptr. 443]; see also People v. Hill (1982) 134 Cal. App.3d 1055 [185 Cal. Rptr. 64].)
*975 The order appealed from is affirmed.[4]
Compton, J., and Gates, J., concurred.
NOTES
[1]  In January of 1976, for example, respondent was taken by the police to University Hospital and then to La Jolla Veteran's Administration Hospital after deliberately stabbing himself in the eye.
[2]  In its brief on appeal appellant takes the position no such concession was made. Our review of the record persuades us it was.
[3]  It is also urged by appellant that, owing to the possibility of successive grants of outpatient status, no definite determination can be made respecting the termination of confinement in cases like that present here, such that reasonable efforts to secure extensions of commitment terms should be all that is required. We regard the claim as unmeritorious in view of the fact that doubts as to dates of termination reasonably may be resolved in terms of earlier filings for the purpose predicated on the particular facts of the case, without impairment of the scope of the extention. (See Pen. Code, § 1026.5, subd. (b)(6).)
[4]  On February 5, 1982, appellant filed in this court its petition for writ of prohibition or mandate respecting the same issues disposed of herein. We ordered decision thereon to be deferred pending resolution of the appeal. Owing to the above disposition and by separate order, we dismiss the petition as moot.
