Operation Details
Description: Method that reads all records from the case evidence table by case identifier and assessment identifier. This method also selects the CaseEvidence records for an integrated Case which contain evidence which is pertinent to the Case.
Sterotype: nsmulti
SQL
SELECT
  CaseEvidence.evidenceID,
  CaseEvidence.assessmentID,
  CaseEvidence.caseID,
  CaseEvidence.effectiveFrom,
  CaseEvidence.statusCode,
  CaseEvidence.versionNo
INTO
  :evidenceID,
  :assessmentID,
  :caseID,
  :effectiveFrom,
  :statusCode,
  :versionNo 
FROM
  CaseEvidence,
  CaseHeader,
  Assessment 
WHERE 
  (
    CaseEvidence.caseID = CaseHeader.integratedCaseID 
    OR CaseEvidence.caseID = CaseHeader.caseID 
  ) 
  AND CaseHeader.caseID = :caseID 
  AND Assessment.assessmentID = :assessmentID 
  AND EXISTS 
  ( 
  SELECT
    * 
  FROM
    CaseEvidenceType,
    CaseEvidence,
    EvidenceForm,
    ProductEvidenceFormLink 
  WHERE CaseEvidenceType.evidenceID = CaseEvidence.evidenceID 
    AND 
    (
      ProductEvidenceFormLink.productID = :productID 
      OR :productIDIsNull <> '0' 
    ) 
    AND EvidenceForm.evidenceFormID = ProductEvidenceFormLink.evidenceFormID 
    AND EvidenceForm.evidenceNameCode = CaseEvidenceType.evidenceFormName 
  )