Operation Details
Description: retrieves list of case header details by concern role ID and start date, ignores case headers with specified status code
Sterotype: nsmulti
SQL
SELECT
  CaseHeader.caseID,
  CaseHeader.planID,
  CaseHeader.concernRoleID,
  CaseHeader.integratedCaseID,
  CaseHeader.integratedCaseType,
  CaseHeader.ownerOrgObjectLinkID,
  CaseHeader.registrationDate,
  CaseHeader.caseReference,
  CaseHeader.expectedStartDate,
  CaseHeader.expectedEndDate,
  CaseHeader.startDate,
  CaseHeader.endDate,
  CaseHeader.effectiveDate,
  CaseHeader.statusCode,
  CaseHeader.classificationCode,
  CaseHeader.priorityCode,
  CaseHeader.objectiveCode,
  CaseHeader.appealIndicator,
  CaseHeader.outcomeCode,
  CaseHeader.comments,
  CaseHeader.caseTypeCode,
  CaseHeader.receivedDate,
  CaseHeader.defaultDeliveryMethodType,
  CaseHeader.defaultCurrencyTypeCode,
  CaseHeader.firstReviewDate,
  CaseHeader.versionNo
INTO
  :caseID,
  :planID,
  :concernRoleID,
  :integratedCaseID,
  :integratedCaseType,
  :ownerOrgObjectLinkID,
  :registrationDate,
  :caseReference,
  :expectedStartDate,
  :expectedEndDate,
  :startDate,
  :endDate,
  :effectiveDate,
  :statusCode,
  :classificationCode,
  :priorityCode,
  :objectiveCode,
  :appealIndicator,
  :outcomeCode,
  :comments,
  :caseTypeCode,
  :receivedDate,
  :defaultDeliveryMethodType,
  :defaultCurrencyTypeCode,
  :firstReviewDate,
  :versionNo 
FROM
  CaseHeader 
WHERE CaseHeader.concernRoleID = :concernRoleID 
  AND 
  (
    CaseHeader.startDate >= :startDateFrom 
    OR :startDateFrom IS NULL 
  ) 
  AND 
  (
    CaseHeader.startDate <= :startDateTo 
    OR :startDateTo IS NULL 
  ) 
  AND NOT CaseHeader.statusCode = :statusCode 
ORDER BY startDate DESC