Operation Details
Description: Operation for obtaining a list of approval criteria not associated to a particular plan item.
Sterotype: nsmulti
SQL
SELECT
  approvalCriteriaID,
  criteriaName,
  occursWhen,
  priority
INTO
  :approvalCriteriaID,
  :criteriaName,
  :occursWhen,
  :priority 
FROM
  ApprovalCriteria 
WHERE recordStatus = :approvalCriteriaRecordStatus 
  AND approvalCriteriaID NOT IN 
  ( 
  SELECT
    approvalCriteriaID 
  FROM
    PlanItemApprovalCriteriaLink 
  WHERE planItemID = :planItemID 
    AND PlanItemApprovalCriteriaLink.recordStatus = :approvalCriteriaRecordStatus 
  ) 
ORDER BY occursWhen,
  priority