SELECT
AppealRelationship.caseID,
AppealedCase.caseReference,
AppealRelationship.priorAppealCaseID,
PriorAppealCase.caseReference,
AppealRelationship.receivedDate,
AppealRelationship.reasonCode,
AppealRelationship.receiptMethod,
AppealRelationship.recordStatus,
AppealRelationship.emergencyCode,
AppealRelationship.continueBenefitsIndicator,
AppealRelationship.comments,
AppealRelationship.deadlineDate,
AppealRelationship.appealedDecisionDate,
AppealRelationship.versionNo,
Appeal.versionNo,
AppealRelationship.timelyIndicator,
AppealRelationship.receiptNoticeIndicator,
AppealCase.versionNo,
AppealRelationship.statusCode
INTO
:caseID,
:caseReference,
:priorAppealCaseID,
:priorCaseReference,
:receivedDate,
:reasonCode,
:receiptMethod,
:recordStatus,
:emergencyCode,
:continueBenefitsIndicator,
:comments,
:deadlineDate,
:appealedDecisionDate,
:versionNo,
:appealVersionNo,
:timelyIndicator,
:receiptNoticeIndicator,
:caseHeaderVersionNo,
:statusCode
FROM
((CaseHeader AppealedCase INNER JOIN
AppealRelationship
ON AppealedCase.caseID = AppealRelationship.caseID)
LEFT
JOIN
CaseHeader PriorAppealCase
ON AppealRelationship.priorAppealCaseID = PriorAppealCase.caseID) INNER JOIN
Appeal
ON AppealRelationship.appealCaseID = Appeal.caseID INNER JOIN
CaseHeader AppealCase
ON Appeal.caseID = AppealCase.caseID
WHERE AppealRelationship.appealRelationshipID = :appealRelationshipID
|