Carpenters’ Joint Apprenticeship Committee (CJAC) and its insurance carrier, St. Paul Fire and Marine Insurance Company (St. Paul), petition for review of the March 7, 1994 order of the Workmen’s Compensation *658Appeal Board (Board) which affirmed the referee’s decision granting John Wisniewski’s (Claimant) claim petition for workers’ compensation benefits against CJAC pursuant to the Workers’ Compensation Act (Act), Act of June 2, 1915, P.L. 736, as amended, 77 P.S. §§ 1-1031. The broad issues presented are whether the referee erred in concluding that Claimant was an employee of CJAC; whether there is substantial competent evidence to support the referee’s determination that Claimant’s pain and disability resulted from an August 16, 1989 incident; and whether the referee erred in awarding total disability benefits.
It is undisputed that CJAC is a labor management group composed of representatives from the carpenter’s union and the building contractor’s association which trains carpenter apprentices to become journeyman carpenters through classroom and hands-on instruction. An apprentice must be sponsored by a contractor and attend CJAC classes one day per week, twenty-three days per year, for four years and receives a stipend paid directly by CJAC. The apprentice works for the sponsoring contractor for the remainder of the week; in Claimant’s case, Nason and Cullen (Nason). In the summer of 1989, CJAC renovated its facility and hired John S. McQuade Company (McQuade) as the general contractor for the project. During the renovation, CJAC remained open and the apprentices’ instruction consisted of hands-on training on that project.
Claimant filed identical claim petitions against CJAC and Nason alleging that while working on the project he experienced a work-related back injury. At the hearing before the referee, Claimant testified that on August 16, 1989, while prying up a concrete curb stone in CJAC’s parking lot, he lost his footing, slid backward, and felt a sharp twinge in his back. Claimant further testified that he received his work instructions directly from A1 DiMarzio, his CJAC math teacher who acted as his foreman on that job. After the accident, Claimant was given less strenuous hands-on work assignments at CJAC; he attempted to return to lightduty work at Nason from November to December 1989, but was unable to perform the work and is still unable to perform his pre-injury duties. Claimant complained of continued severe pain in his lower back radiating down his left leg.
Claimant presented the deposition testimony of Eswaran Balasubramanian, M.D., a board certified orthopedic surgeon, who testified that Claimant’s medical history revealed that he suffered from sciatica in 1974, a back injury in 1976 while in the Coast Guard, and intermittent pain for which he was prescribed medications, but Claimant previously experienced no numbness or weakness. Additionally, Dr. Balasubramanian opined that Claimant’s present increase in symptomatolo-gy was caused by his August 1989 work injury because Claimant was able to work before the 1989 accident even though he was on medication, but presently cannot; and an EMG indicates an underlying problem of chronic radiculopathy and a recent phenomena of L5, SI radiculopathy. Dr. Balasubra-manian diagnosed L5, SI radiculopathy on the left side and a herniated disc at L4, L5.
St. Paul presented the testimony of Adrian McAlary, Director of CJAC, and Albert DiMarzio, CJAC instructor. McAlary testified that although it was not a normal operating procedure, CJAC was open in the summer of 1989; there was no classroom work; and the only shop project was CJAC’s renovation and students were hired to perform carpentry and related work. DiMarzio testified that on the date of Claimant’s alleged injury, he supervised the apprentices and told Claimant the work which was to be performed and how he wanted it done; and the school held no summer classes for the previous five years.
McQuade presented the testimony of Chris Chiaro, its job superintendent at the CJAC renovation site, who testified that he informed CJAC teachers of the work that needed to be performed, and the teachers relayed the instructions to the students. If a job was performed incorrectly, Chiaro would approach the teacher, not the student directly. Nason presented the testimony of Stanley Askin, M.D., a board certified orthopedic surgeon, who testified that Claimant had long-standing back problems, did not sustain any substantial material change in his preexisting condition as a result of the alleged *659August 1989 accident, and is back to his “baseline” status.
The referee found Claimant’s testimony credible and Dr. Balasubramanian’s testimony credible and more persuasive than Dr. Askin’s. The referee found that Claimant suffered new musculoskeletal injuries to his lumbar spine while performing duties for CJAC and aggravated preexisting lumbar pathology, all of which remain unresolved. He also found that Claimant continued his school requirements through February 1990, but ceased all other employment in August 1989, except for the one month he returned to work for Nason. The referee upheld the claim petition against CJAC, dismissed the claim petition against Nason, and found that McQuade and Nason were without liability. The Board affirmed and CJAC appealed.1
CJAC argues that none of the elements of an employment relationship existed between CJAC and Claimant. CJAC contends that there was no mutual assent to an employer-employee relationship; express or implied contract of employment; right to select or remove Claimant; power to direct the manner of his performance; or potential to control him. Additionally, CJAC contends that Claimant received a stipend, not wages under the act; no taxes were withheld; no workers’ compensation insurance was taken on behalf of Claimant; and Claimant’s work on the project was irregular.2
The question of whether an employer-employee relationship exists is one of law, based upon findings of fact. W.W. Friedline Trucking v. Workmen’s Compensation Appeal Board (Reynolds), 151 Pa. Commonwealth Ct. 38, 616 A.2d 728 (1992), appeal denied, 533 Pa. 640, 621 A.2d 584 (1993). The existence of an employer-employee relationship is determined by considering several factors3; the key elements are whether the alleged employer has the right to control the work to be done and the manner in which it is performed. Duquesne Truck Serv. v. Workmen’s Compensation Appeal Board (McKeesport Truck Serv.), 165 Pa. Commonwealth Ct. 145, 644 A.2d 271 (1994). CJAC had the right to control the work to be done and the manner in which it is performed and the referee did not err in determining that an employer/employee relationship existed between CJAC and Claimant.
Alternatively, CJAC argues that if Claimant was an employee of CJAC, he was a casual employee and not entitled to workers’ compensation benefits because his presence at the job site was irregular, occasional, and temporary; and the work that he performed at the time of his injury was not in the regular course of CJAC’s business. Claimants are entitled to compensation unless they are found to be both casual employees and acting not in the regular course of the employer’s business. Industrial Abrasives, Inc. v. Workmen’s Compensation Appeal Board (Caceres), 157 Pa. Commonwealth Ct. 558, 630 A.2d 547 (1993). If the work is not of an emergency or incidental nature but represents a planned project, and *660the tenure for which the employment is to continue is of fairly long duration, the employment is not casual. Cochrane v. William Penn Hotel, 339 Pa. 549, 16 A.2d 43 (1940); Industrial Abrasives, Inc.
The referee found that CJAC underwent a change in the summer of 1989, its primary focus became the completion of the renovation project, and the school remained open as a cost-saving method so that the apprentices could work on the project. Since the project was planned in advance, not of an emergency nature, and Claimant’s work was to continue for the entire summer, his employment was not casual.4 See Industrial Abrasives, Inc.
CJAC next argues that the referee’s determination that Claimant’s pain and disability resulted from the August 1989 incident is not supported by substantial competent evidence. CJAC contends that Dr. Ba-lasubramanian’s opinion regarding causation was equivocal and based upon an erroneous assumption of Claimant’s medical history since he did not review Claimant’s military medical records which indicate a preexisting, symptomatic problem and that he incorrectly assumed that Claimant did not previously suffer from numbness. CJAC also argues that the referee erred in awarding total disability benefits and that Claimant is entitled to nothing more than partial disability benefits from January 1, 1990 because Claimant left CJAC upon graduation from the program, not as a result of his injury.
In a claim petition, the claimant bears the burden of establishing a right to compensation and of proving all necessary elements to support an award. Inglis House v. Workmen’s Compensation Appeal Board (Reedy), 535 Pa. 135, 634 A.2d 592 (1993). The referee is the ultimate factfinder and has the discretion to determine the credibility of witnesses. Sun Oil Co. v. Workmen’s Compensation Appeal Board (Thompson), 158 Pa. Commonwealth Ct. 434, 631 A.2d 1084 (1993). The referee is free to accept or reject any witness’s testimony, including medical witnesses, in whole or in part. Id.
Although Claimant’s military medical records indicate complaints of numbness associated with Claimant’s sciatica, Dr. Bala-subramanian’s testimony establishes that he considered Claimant’s sciatica as well as his Coast Guard injury in making his evaluation. His opinion was also based upon the fact that before the accident, Claimant was able to continue working even though he was on medication, but after the accident he was unable to work; and an EMG indicated an underlying problem of chronic radiculopathy and a recent phenomena of L5, SI radiculo-pathy. The referee was within his discretion in accepting Dr. Balasubramanian’s testimony over Dr. Asian’s. Dr. Balasubramanian’s testimony further establishes that Claimant’s disability continued after his graduation from the apprenticeship program at CJAC and provides substantial evidence to support the referee’s finding that Claimant met his burden of establishing his right to compensation, and that total disability benefits were proper*661ly granted.5 Since there is no error, the order of the Board is affirmed.
ORDER
AND NOW, this 10th day of February, 1995, the order of the Workmen’s Compensation Appeal Board is affirmed.
. This Court’s scope of review is limited to determining whether necessary findings of fact are supported by substantial evidence, an error of law was committed, or constitutional rights were violated. Russell v. Workmen's Compensation Appeal Board (Volkswagen of America), 121 Pa. Commonwealth Ct. 436, 550 A.2d 1364 (1988).
. CJAC also contends that Nason required Claimant to attend the school; Claimant’s primary motive for working on the project was not to earn money, but to graduate from CJAC; and the CJAC students did not work on the school renovation in the same manner as the workers employed by the general contractor and subcontractors because they began their work day at different hours. Finally, CJAC contends that no school system purchases workers’ compensation insurance to cover its students; and if the referee’s decision is upheld, it would allow any student injured at school while performing a function that remotely benefits both the student and the school to claim "employee” status.
.These factors include the control of the manner in which the work is to be done; responsibility for the result only; terms of agreement between the parties; nature of the work or occupation; skill required for performance; whether the one employed is engaged in a distinct occupation or business; which party supplies the tools; whether payment is by the time or by the job; whether work is a part of the regular business of the employer; and the right of the employer to terminate the employment at any time. Duquesne Truck Serv. v. Workmen’s Compensation Appeal Board (McKeesport Truck Serv.), 165 Pa. Commonwealth Ct. 145, 644 A.2d 271 (1994).
. CJAC also argues that Claimant was either a borrowed or statutory employee of McQuade. However, it is questionable whether those arguments were raised below since they were not discussed by the referee or Board. Assuming arguendo that those arguments were properly preserved, this Court nonetheless finds that they are without merit.
As to the borrowed employee doctrine, the borrowing employer must control or have the right to control the borrowed employee with regard to both the work to be done and the manner of performing it. Smith v. Workmen's Compensation Appeal Board (Miller), 152 Pa. Commonwealth Ct. 77, 618 A.2d 1101 (1992), appeal denied, 537 Pa. 636, 642 A.2d 489 (1994). As to the statutory employee doctrine, Section 302(b) of the Act, 77 P.S. § 462, provides that if the immediate employer of the injured worker, usually a subcontractor, has not provided insurance coverage or is not a qualified self-insurer, the employer next up the ladder from the immediate employer, usually the general contractor, becomes liable to pay benefits due the injured employee. McGrail v. Workmen’s Compensation Appeal Board (County of Lackawanna), 145 Pa. Commonwealth Ct. 595, 604 A.2d 1109, appeal denied, 531 Pa. 658, 613 A.2d 562 (1992).
There is substantial evidence to support the referee’s finding that McQuade was without liability because its involvement was limited to suggesting to the teachers what needed to be done on the project. See Smith. Furthermore, the record indicates that CJAC hired McQuade as a general contractor and there is no evidence that CJAC acted as McQuade’s subcontractor. See McGrail.
. This Court notes that the referee allowed CJAC to take a credit for earnings it paid to Claimant from August 18, 1989 through February 23, 1990, and suspended benefits from the limited period of November 27, 1989 through December 31, 1989 when Claimant was able to return to employment with Nason.