Database SQL Operation: AppealRelationship.searchActiveAssessmentsByProductDeliveryAndAppealType
Description: | Determine if there are any active appeals where an assessment for the product delivery is being appealed for the current appeal level. |
Sterotype: | nsmulti |
SELECT
AppealRelationship.caseID
INTO
:caseID
FROM
Appeal,
CaseHeader,
AppealRelationship,
CaseRelationship
WHERE Appeal.caseID = CaseHeader.caseID
AND
(
CaseHeader.statusCode = :activeStatusCode
OR CaseHeader.statusCode = :openStatusCode
OR CaseHeader.statusCode = :approvedStatusCode
)
AND Appeal.appealTypeCode = :appealTypeCode
AND Appeal.caseID = appealCaseID
AND recordStatus = :defaultRecordStatus
AND AppealRelationship.caseID = CaseRelationship.caseID
AND CaseRelationship.relatedCaseID = :caseID
AND CaseRelationship.typeCode = :assessmentProduct
AND CaseRelationship.statusCode = :defaultRecordStatus
AND CaseRelationship.reasonCode = :linkedCases
|