
621 F.Supp. 439 (1985)
David HERNANDEZ, Plaintiff,
v.
Margaret M. HECKLER, Secretary of Health and Human Services, Defendant.
No. C-80-4402-MHP.
United States District Court, N.D. California.
November 4, 1985.
*440 A. Keith Lesar, Aptos, Cal., Robert E. Taren, Santa Cruz, Cal., for plaintiff.
Lynn K. Richardson, Asst. U.S. Atty., San Francisco, Cal., for defendant.

AMENDED MEMORANDUM AND ORDER
PATEL, District Judge.
Plaintiff brings this action pursuant to 42 U.S.C. § 405(g) to obtain judicial review of a final decision of the Secretary of Health and Human Services ("the Secretary") denying his claim for Social Security disability benefits.
Plaintiff suffered a back injury in an industrial accident in June 1977 and first applied for disability benefits in December 1978. This application was denied and plaintiff did not appeal. In July 1979 plaintiff petitioned to reopen the action claiming both physical and mental impairments resulting from the injury. The claim was also denied initially and again on reconsideration. Plaintiff appealed to an Administrative Law Judge ("ALJ"). In a decision dated May 27, 1980 the ALJ ruled that plaintiff was not disabled as he was physically able to work at a sedentary, light, or medium level of activity. The Appeals Council approved the decision of the ALJ on October 10, 1980 making the ALJ's decision the final decision of the Secretary.
Plaintiff next appealed to the district court. On August 18, 1982 this court upheld the Secretary's ruling as to plaintiff's ability to perform sedentary, light, or medium work. However, the court remanded the case as the ALJ failed to make "specific findings showing that plaintiff has the physical and mental capacity to perform specific jobs" in the national economy. Hernandez v. Heckler, NO. C-80-4402, slip op. at 3 (N.D.Cal. August 18, 1982). On January 31, 1984 the ALJ ruled that plaintiff's "exertional impairments are not so severe as to preclude him from working at a medium level of activity." Relying on previous determinations that plaintiff's emotional condition was not disabling and interpreting the testimony of the vocational expert, the ALJ concluded that "there are no credible nonexertional vocationally limiting impairments, ... [and] the claimant is still able and fit to perform a wide range of operator jobs in the region of the economy in which he resides."
The Appeals Council adopted this decision on May 11, 1984 making it the final decision of the Secretary. Plaintiff again filed a timely appeal to this court. The case is now before the court on cross-motions for summary judgment. For the reasons set forth below the court finds the decision of the Secretary unsupported by substantial evidence in the record as a whole. Therefore, the decision is reversed and the case is remanded for the sole purpose of determining the date plaintiff's disability terminated and payment of benefits.

Facts
Plaintiff David Hernandez was born on December 3, 1955 and is a resident of Watsonville, California. His employment history is comprised entirely of arduous manual labor, first as an employee of a local cannery and then in a slaughterhouse. Although plaintiff graduated from high school, testing done for rehabilitation purposes indicates reading vocabulary and comprehension abilities at the ninth grade level, math abilities at the sixth grade level, difficulties with oral expression, and certain visual-motor weaknesses.
On May 31, 1977 plaintiff suffered a back injury as a result of an industrial accident. He continued to work until June 10, 1977 when he was forced to quit because of pain. He was temporarily totally disabled from June 10 until November 24, 1977 when his treating physician released him to return to light duty. However, plaintiff did not return to work as he continued to suffer from pain and emotional disturbances stemming from the injury.
In September 1977 plaintiff began psychotherapy with Dr. Steven Lynch for *441 problems resulting from the injury. Over the next three years plaintiff was evaluated by several other orthopedic and psychiatric specialists who concluded that he was not disabled as a result of his physical injury but that a psychological component hampered his ability to return to work. The court examined this evidence and concluded that plaintiff's physical and emotional problems did not preclude him from engaging in all substantial gainful activity. Hernandez v. Heckler, NO. C-80-4402, slip op. at 2-3 (N.D.Cal. August 18, 1982).
At the remand hearing plaintiff introduced further psychological evaluation by his treating psychologist Dr. Lynch and consultative psychologist Isidoro Quiroga; the deposition of psychiatrist Walter Wilcox; and the decision and order of State Rehabilitation Counselor Lynn Pimental. Much of this information consisted of updated evaluations of information presented at the first hearing. In addition, testimony was provided by James P. Whelan, a vocational consultant hired by defendant.
Dr. Lynch's report focused on a series of three MMPI tests administered to plaintiff in 1977, 1978, and 1981. The 1977 MMPI revealed an anxiety reaction with obsessive-compulsive features of a severity usually associated with confused thinking. The 1978 MMPI indicated a marked reduction in anxiety with an increase in depression and manifestations of psychological reactions. The 1981 MMPI demonstrated significant improvement and a probable return to the personality features present prior to the injury in 1977. Dr. Lynch interpreted these results as follows:
At his first testing David would be described as having a very poor self-concept. He probably felt helpless to act in bettering his situation. He probably had good intentions but was fairly incapable of carrying them through. The prognosis for successful employment with a person with such an ego-strength score is very poor. At his second testing he showed improvement but still indicated a poor self-concept. He was relatively unable to face challenges and badly needed ego-building in order to deal with his problems. At the time of the third testing he was much improved and now shows enough ego-strength to deal effectively with life's stresses and with minor setbacks.
Dr. Quiroga evaluated plaintiff in 1980 and 1981. His second evaluation appears in the record of the second hearing. Dr. Quiroga characterizes plaintiff as a person with a passive-aggressive personality type who, at the time of his injury, had not successfully achieved emancipation from his family. Dr. Quiroga opined that plaintiff's emotional difficulties "are related to his industrial injury as well as to his pre-injury emotionally vulnerable condition or personality organization and limits extensively his ability to function successfully in the job market." He further stated, "[a]t this point, under the present circumstances, I do not believe that David is likely to benefit from Vocational Rehabilitation."
Dr. Wilcox, a psychiatrist engaged by the Workers Compensation Carrier, examined plaintiff on April 11, 1979. In the June 25, 1981 deposition submitted at the remand hearing Dr. Wilcox reiterated his opinion of April 1979 that he did not believe plaintiff could return to work for psychiatric reasons. He stated that plaintiff's continuing symptomology (pain) represented a physical manifestation of his emotional disturbance and diagnosed plaintiff's condition as an anxiety neurosis secondary to back injury. He further stated that he disagreed with a psychiatric evaluation done by psychiatrist Melvyn Shoor on February 12, 1980 in which Dr. Shoor concluded that plaintiff was not psychiatrically disabled and was capable of full employment within orthopedic limitations.[1]
Finally, plaintiff introduced the Decision and Order of Lynn Pimental, Rehabilitation Consultant for the California Division of *442 Industrial Accidents Rehabilitation Bureau. This decision refers to a Decision and Order issued on December 12, 1980 wherein plaintiff was found not suitable for rehabilitation services at that time due to his multiplicity of problems.

Discussion
The standard the court must apply in reviewing the Secretary's decision is whether that decision was supported by substantial evidence on the record as a whole and whether the Secretary applied the proper legal standards. 42 U.S.C. § 405(g); Delgado v. Heckler, 722 F.2d 570, 572 (9th Cir.1983). Substantial evidence is "such relevant evidence as a reasonable mind might accept as adequate to support a conclusion." Richardson v. Perales, 402 U.S. 389, 401, 91 S.Ct. 1420, 1427, 28 L.Ed.2d 842 (1971).
The determination of disability in cases such as the instant one where plaintiff's injuries are not so severe as to preclude all gainful employment is two-fold. Heckler v. Campbell, 461 U.S. 458, 461-62, 103 S.Ct. 1952, 1954-55, 76 L.Ed.2d 66 (1983). First, the Secretary must determine plaintiff's present job qualifications  age, education, work experience, physical ability, and other relevant factors such as plaintiff's psychological condition. With respect to Mr. Hernandez, this determination was made at the first administrative hearing and included both his physical and psychological limitations. Neither was believed to be so severe as to preclude him from working altogether. The court upheld this determination in its August 1982 order. Hernandez v. Heckler, slip op. at 2-3 (N.D.Cal. August 18, 1982).
Second, the burden moves to the Secretary "to show that other substantial work for which plaintiff is qualified exists in the national economy." Thompson v. Schweiker, 665 F.2d 936, 939 (9th Cir. 1982).[2] The Secretary may use the medical-vocational guidelines ("the grids") if they fully describe the claimant's abilities and limitations. Campbell, 461 U.S. at 462 n. 5, 103 S.Ct. at 1995 n. 5. If, as in this case, the grids do not completely describe the plaintiff's vocational abilities the Secretary must use the testimony of a vocational expert to identify specific jobs in the national economy which a person with plaintiff's abilities and limitations can perform. Jones v. Heckler, 760 F.2d 993, 998 (9th Cir.1985) (error to apply the grids where plaintiff possesses limitations not factored into the guidelines). Until specific jobs are identified taking into account all of plaintiff's limitations, including psychological ones, the determination of disability is incomplete.
According to this court's order, the task of the ALJ at the remand hearing was to "make specific findings showing that plaintiff has the physical and mental capacity to perform specific jobs." Hernandez v. Heckler, slip op. at 3 (N.D.Cal. August 18, 1982). After receiving the evidence of plaintiff's emotional condition summarized above and the testimony of a vocational consultant the ALJ concluded: "considering any nonexertional features, I find that *443 the evidence establishes that the claimant is still able and fit to perform a wide range of operator jobs in the region of the economy in which he resides." For the reasons stated below, this conclusion is not supported by substantial evidence in the record as a whole.
The ALJ asked the vocational expert, Mr. Whelan, to testify as to the jobs a person of plaintiff's age, education and past experience could perform, taking into account his academic skills and poor visual-motor integration. Whelan stated that based on these factors plaintiff would be able to perform approximately 25% of the total jobs that exist in California. At no time did the ALJ ask Mr. Whelan to reconsider the hypotheticals in terms of the psychological evidence plaintiff proffered. As to the psychological evidence itself, Mr. Whelan testified that the poor self-concept identified by Dr. Lynch is not determinative of disability but that the information in Dr. Wilcox' deposition "suggests a pessimistic outlook for Mr. Hernandez in terms of employability."
On cross-examination Mr. Whelan testified that plaintiff's psychological impairments would affect the scope of plaintiff's employment opportunities. In response to questions regarding Dr. Lynch's test results, he opined, "to the extent that Mr. Hernandez was considered to be dysfunctional by Dr. Lynch, in view of the (inaudible) as on the MMPI and particularly the first and second testings, to that extent he would likely not be able to benefit by labor market participation." In addition, in response to counsel's questions Mr. Whelan clarified that his testimony that plaintiff could perform 25% of the jobs within California did not take into account plaintiff's psychological limitations.
It is apparent from the transcript that the ALJ's failure to pose hypotheticals to the expert regarding psychological impairments was based on his rejection of the evidence of such impairments. In so doing the ALJ lost sight of the purpose of the remand hearing, which was to determine the parameters of plaintiff's disability by specifying those jobs in the economy he could perform based on his physical and mental limitations. As the ALJ's hypotheticals fail to set forth all plaintiff's impairments they cannot constitute substantial evidence to support his findings. Gallant v. Heckler, 753 F.2d 1450, 1456 (9th Cir.1984) ("[t]he most appropriate way to ensure the validity of the hypothetical question posed to the vocational expert is to base it upon evidence appearing in the record, whether it is disputed or not").
Therefore, the court finds that the Secretary's conclusion that plaintiff was not disabled as he had the physical and mental capacity to perform a significant number of jobs in the national economy is unsupported by substantial evidence. Indeed, the unrefuted evidence in the record supports a finding of disability, for the vocational expert indicated that plaintiff's impairments as described by psychologists as early as 1977 would preclude him entering the labor market. Accordingly, the decision of the ALJ is reversed and the court finds plaintiff entitled to disability benefits commencing on the date of his injury.[3]
Plaintiff seeks a closed period of disability benefits ending July 1981. However, the record is equivocal as to when his disability ceased. Although Dr. Lynch's report indicates that plaintiff's disability ended by July 1981 the report recognizes that other evaluations of plaintiff's condition reached different conclusions. As it is the role of the Secretary to resolve conflicts in the evidence, Vincent v. Heckler, 739 F.2d 1393, 1395 (9th Cir.1984), the court remands the case to her solely for the purpose of determining the date plaintiff's disability ended and payment of benefits.
IT IS SO ORDERED.
NOTES
[1]  Dr. Shoor's report was part of the proceedings with respect to plaintiff's workers' compensation benefits and was not introduced by either party in any of the proceedings pertaining to plaintiff's Social Security status.
[2]  The Secretary argues that the unappealed denial of plaintiff's November 5, 1978 application for disability benefits creates a continuing presumption of nondisability which must be overcome by plaintiff's showing of changed circumstances. Booz v. Secretary of Health and Human Services, 734 F.2d 1378, 1379 (9th Cir. 1984); Lyle v. Secretary of Health and Human Services, 700 F.2d 566, 568-69 (9th Cir.1983). Defendant's argument is based on the application of res judicata principles to the Secretary's November 1978 decision. See Lyle, 700 F.2d at 568 n. 2 ("[r]es judicata principles are properly applied in the context of administrative decisions, although in such a context `the res judicata doctrine is not as rigid as it is with courts'").

Res judicata is an affirmative defense which is waived if not raised in the pleadings. Fount-Wip, Inc. v. Reddi-Whip, Inc., 568 F.2d 1296, 1299-1300 n. 1 (9th Cir.1978) (res judicata defense not raised in pleadings or pretrial statement not preserved); see generally, 18 Wright, Miller & Cooper, Federal Practice and Procedure, § 4405. The court finds the defense waived in the instant case as the Secretary failed to raise it in the answer to the complaint, the first motion for summary judgment, or in the court-ordered remand proceeding. Weekes v. Atlantic National Insurance Co., 370 F.2d 264, 271-72 (9th Cir.1966) (trial court has discretion to permit or deny belated assertion of res judicata defense).
[3]  The date of onset is well before March 1979, the date plaintiff's insured status terminated.
