
96 Cal.Rptr.2d 839 (2000)
81 Cal.App.4th 550
In re PEDRO M., a Person Coming Under the Juvenile Court Law.
The People, Plaintiff and Respondent,
v.
Pedro M., Defendant and Appellant.
No. B130400.
Court of Appeal, Second District, Division Two.
June 12, 2000.
Rehearing Denied July 5, 2000.
Review Denied September 27, 2000.
*840 Cheryl Barnes Johnson, under appointment by the court of Appeal, for Defendant and Appellant.
Bill Lockyer, Attorney General, David P. Druliner, Chief Assistant Attorney General, Carol Wendelin Pollack, Assistant Attorney General, Jaime L. Fuster and Beverly K. Falk, Deputy Attorneys General, for Plaintiff and Respondent.
BOREN, P.J.
Pedro M., the appellant herein, was declared a ward of the juvenile court (Welf. & Inst.Code. § 602)[1] on May 20, 1997, after admitting that he had committed a forcible lewd act upon a child under the age of 14 years (Pen.Code, § 288, subd. (b)(1)), a lewd act upon a child under the age of 14 years (Pen.Code, § 288, subd. (a)) and second degree commercial burglary (Pen.Code, § 459). The court ordered him suitably placed subject to a variety of "conditions of probation," including that he obey all orders of the court and probation officer, and that he "[c]ooperate in a plan for psychiatric, psychological testing or treatment."
Appellant was placed in the Rancho San Antonio sexual offender program on June 11, 1997, as recommended by the juvenile court, and was removed 18 months later for purportedly "refusing to comply with the treatment plan and staff." A supplemental petition (§ 777, subd. (a)) was filed on December 14, 1998, alleging that the suitable placement disposition had been ineffective in appellant's rehabilitation and requesting that he be committed to the California Youth Authority (the CYA). Following an adjudication hearing on February 4, 1999, the juvenile court sustained two counts of the supplemental petition, finding that appellant had failed to obey the orders of the court and probation officer by refusing to comply with his treatment plan at Rancho San Antonio, and had failed to cooperate in a plan for psychiatric and psychological treatment as ordered by the court, thereby violating conditions of probation Nos. 1, 2 and 26. At the disposition hearing on February 26, 1999, the *841 juvenile court continued appellant's wardship and ordered him committed to the California Youth Authority. The court declared appellant's maximum period of confinement to be 11 years 8 months and awarded him predisposition credit, without specifying the number of days to which he was entitled.
Appealing from the latter orders relating to the supplemental petition, appellant contends: "I. The evidence in this matter was not sufficient to support the juvenile court's true findings.... [¶] II. The juvenile court abused its discretion by committing appellant [to] the California Youth Authority.... [¶] III. The juvenile court erred in failing to determine appellant's predisposition credits...."
Appellant initially contends that the testimony of Judy Brevaire, his therapist at Rancho San Antonio, was erroneously admitted after he invoked the psychotherapist-patient privilege (Evid.Code, §§ 1012, 1014), and that the evidence was insufficient in any event to establish that he had committed the probation violations alleged in the supplemental petition and that his previous placement had failed to rehabilitate him. We find his claims to be unpersuasive.
It is, of course, well settled that "[a] juvenile court enjoys broad discretion to fashion conditions of probation for the purpose of rehabilitation and may even impose a condition of probation that would be unconstitutional or otherwise improper so long as it is tailored to specifically meet the needs of the juvenile. [Citation.]" (In re Josh W. (1997) 55 Cal.App.4th 1, 5, 63 Cal.Rptr.2d 701; In re Tyrell J. (1994) 8 Cal.4th 68, 81-82, 32 Cal.Rptr.2d 33, 876 P.2d 519.) In the instant case, the juvenile court determined that appellant's rehabilitation necessitated his participation and cooperation in a sex offender treatment program, a determination that was clearly within the court's authority to make given appellant's commission of sex-related offenses.
Quite obviously, the court's ability to evaluate appellant's compliance with this particular condition of the court's disposition order and its effect on his rehabilitation would be severely diminished in the absence of some type of feedback from the therapist, and it would be unreasonable for appellant to think otherwise. (Contrast In re Eduardo A. (1989) 209 Cal.App.3d 1038, 261 Cal.Rptr. 68 [holding that the psychotherapist-patient privilege applies to confidential communications made in court-ordered counseling of a parent in a section 300 case but that the application of the privilege does not prevent the court from acquiring from other sources information needed for proper evaluation of dependency status].) Indeed, Evidence Code section 1012 itself permits the disclosure of a confidential communication between patient and psychotherapist to "those to whom disclosure is reasonably necessary for ... the accomplishment of the purpose for which the psychotherapist is consulted...." In our view, this would include the juvenile court, where the patient is a delinquent minor who has been properly directed to participate and cooperate in a sex offender treatment program in conjunction with a disposition order placing the minor on probation. Moreover, the juvenile court carefully sought to circumscribe Brevaire's testimony "so that the details of the therapeutic session [would] not [be] disclosed." As a consequence, no testimony was admitted regarding any specific statements appellant had made to Brevaire, any advice given to appellant by Brevaire, or any diagnosis made by Brevaire. Under the circumstances, therefore, we hold that the psychotherapist-patient privilege did not preclude Brevaire from testifying at the adjudication of the supplemental petition concerning appellant's participation and progress in the court-ordered treatment plan.
Brevaire's testimony was also sufficient (In re Babak S. (1993) 18 Cal.App.4th 1077, 1088-1089, 22 Cal.Rptr.2d 893) to sustain the juvenile court's finding that appellant had violated conditions of probation by not cooperating in his sex offender treatment plan, the object of which was to *842 lower his risk of re-offending.[2] Brevaire testified that the Rancho San Antonio program is comprised of five phases. According to Brevaire, the first phase "involves taking responsibility for what you've done, the harm you've done to others," the second, "understanding your feelings, understanding your family dynamics," the third, "empathy, development, and relapse prevention and your own victimization," the fourth, "more about relapse prevention," and the fifth, "after-care and mainstreaming into the community." The typical patient progresses through the entire program in approximately 18 to 24 months. Appellant, however, remained at phase No. 1 after 18 months of daily group therapy, bimonthly family meetings and monthly individual sessions.
Brevaire placed appellant's lack of progress in the Rancho San Antonio program squarely at appellant's own feet, citing his lack of motivation to change despite a number of interventions by Rancho San Antonio staff, the fact that he had "[l]ittle to no" empathy or remorse, and his passive-aggressive attitude toward his peers inside and outside the group therapy sessions. She also testified that appellant sometimes failed to complete his written therapy assignments and that he continually had to re-do assignments because of his dishonesty. An additional measure of support for Brevaire's opinion about appellant's lack of motivation was found in the testimony of appellant's probation officer, though Brevaire's testimony was sufficient in and of itself to prove the allegations of the supplemental petition.
Appellant's second contention, challenging his commitment to the CYA, is likewise without merit. A decision by the juvenile court to commit a minor to the CYA will not be deemed to constitute an abuse of discretion where the evidence "demonstrate[s] probable benefit to the minor from commitment to the CYA and that less restrictive alternatives would be ineffective or inappropriate. [Citation.]" (In re George M. (1993) 14 Cal. App.4th 376, 379, 18 Cal.Rptr.2d 29.) This standard was satisfied here.
The evidence established that notwithstanding an 18-month placement in one of the best sex offender treatment programs available at the county level, appellant had made virtually no progress toward rehabilitation and readily admitted on the date he was removed from Rancho San Antonio, "`Yes, I know I wasn't doing my program. I haven't been honest to myself and to others.'" Given the ineffectiveness of the Rancho San Antonio placement and the probation officer's indication that he knew of no other program apart from the CYA which could offer appellant "anything else that he has not been offered so far," the juvenile court was not required to send appellant to another suitable placement program, particularly when the probation officer opined that the CYA offers a sex offender treatment program of the sort that would most likely benefit appellant, "a secure setting with the comprehensive resources that will be able to meet his needs for correction and rehabilitation, such as participation in individual and small group ... counseling sessions with a psychologist."
Appellant's third contention challenges the juvenile court's failure to determine appellant's precommitment custody credit. While we agree that the juvenile court should have set forth the amount of precommitment custody credit to which appellant was entitled (In re John. H. (1992) 3 Cal.App.4th 1109, 1111, 6 Cal. *843 Rptr.2d 25), we decline appellant's request that this court correct the commitment order to reflect 139 days of credit (consisting of the 57 days which were awarded on the original section 602 petition and 82 days for the time appellant was purportedly detained after being removed from Rancho San Antonio). Contrary to appellant's assertion, the record does not unequivocally demonstrate that he was detained continuously from December 7, 1998, the date of his removal from Rancho San Antonio, through February 26, 1999, the date of the disposition hearing on the supplemental petition. As respondent points out, appellant does not seek credit for the time he was confined at Rancho San Antonio, which was an open placement and therefore did not constitute "physical confinement" within the meaning of section 726. (In re Randy J. (1994) 22 Cal.App.4th 1497, 1505, 28 Cal.Rptr.2d 152.)
The detention report prepared on December 7, 1998, following appellant's removal from Rancho San Antonio, recommends that appellant be detained at juvenile hall pending the filing of a supplemental petition. Consistent with that recommendation, the court's minute order of December 9, 1998, reflects "Minor is/remains detained JH." However, the supplemental petition which was executed and filed five days later on December 14, 1998, states, "Minor is not detained. The present whereabouts of minor is HOME." (Original emphasis.) On the other hand, the probation report of December 15, 1998, identifies appellant's whereabouts as "juvenile hall." The court's minute order of the same date says, "Minor is/remains detained except for pre-placement visits JH" and also bears the notation "released this pet." Subsequent minute orders dated January 7, 1999, February 3, 1999, February 4, 1999, and February 26, 1999, indicate that appellant was detained in juvenile hall on those dates.
At the very least, there are serious questions regarding appellant's whereabouts between the dates of December 9, 1998, and December 15, 1998. That being so, this court obviously cannot resolve the precommitment custody credit issue with certitude. It is a matter that should be directed to the trial court. (See In re Ricky H. (1981) 30 Cal.3d 176, 184-185, 192, 178 Cal.Rptr. 324, 636 P.2d 13; In re Gustavo M. (1989) 214 Cal.App.3d 1485, 1500, 263 Cal.Rptr. 328.)

DISPOSITION
The orders sustaining the supplemental petition and committing appellant to the CYA are affirmed. However, the case is remanded to the juvenile court with directions: (1) to calculate the amount of precommitment custody credit to which appellant is entitled; (2) to prepare an amended commitment order reflecting such credit; and (3) to forward a certified copy of the amended commitment order to the CYA.
COOPER, J., and MALLANO, J.[*], concur.
NOTES
[1]  Unless otherwise indicated, all further statutory references are to the Welfare and Institutions Code.
[2]  This conclusion renders it unnecessary for this court to address the effects on pending cases of recent amendments to section 777 resulting from the passage of Proposition 21. (See Ballot Pamp., Primary Elec. (March 7, 2000) text of Prop. 21, pp. 32-33 at  [as of April 25, 2000].) As both parties appear to acknowledge in their letter briefing calling this statutory change to our attention, a new disposition may be ordered under the current version of section 777 upon proper proof that a minor has violated an order of the court.
[*]   Judge of the Los Angeles Superior Court, assigned by the Chief Justice pursuant to article VI, section 6 of the California Constitution.
