Operation Details
Description: Return all prior appeal case decisions for the specified case. Only want ACTIVE records and CLOSED appeal cases.
Sterotype: nsmulti
SQL
SELECT
  AppealRelationship.resolutionCode,
  CaseHeader.caseID,
  caseReference,
  HearingDecision.decisionDate,
  Appeal.appealTypeCode
INTO
  :resolutionCode,
  :caseID,
  :caseReference,
  :decisionDate,
  :appealTypeCode 
FROM
  AppealRelationship,
  Appeal,
  CaseHeader,
  HearingDecision 
WHERE Appeal.caseID = AppealRelationship.appealCaseID 
  AND CaseHeader.caseID = Appeal.caseID 
  AND HearingDecision.caseID = Appeal.caseID 
  AND AppealRelationship.caseID = :caseID 
  AND AppealRelationship.recordStatus = :activeRecordStatus 
  AND CaseHeader.statusCode = :caseClosedStatus