Operation Details
Description: To return a list of instruction line items based on a specified case and cover period. This is subtly different from the searchByCaseIDCoverPeriod() operation insofar as it searches for line items that overlap with the search criteria. This version can also cope with cover period to dates which are null which can occur on cases which are open ended.
Sterotype: nsmulti
SQL
SELECT
  InstructionLineItem.instructLineItemID,
  InstructionLineItem.amount,
  InstructionLineItem.instructLineItemCategory,
  InstructionLineItem.instructionLineItemType,
  InstructionLineItem.financialCompID,
  InstructionLineItem.coverPeriodFrom,
  InstructionLineItem.coverPeriodTo,
  InstructionLineItem.statusCode,
  InstructionLineItem.deliveryMethodType,
  CaseNominee.caseNomineeID
INTO
  :instructLineItemID,
  :amount,
  :instructLineItemCategory,
  :instructionLineItemType,
  :financialCompID,
  :coverPeriodFrom,
  :coverPeriodTo,
  :statusCode,
  :deliveryMethodType,
  :caseNomineeID 
FROM
  InstructionLineItem,
  CaseNominee 
WHERE InstructionLineItem.caseID = :caseID 
  AND InstructionLineItem.caseNomineeID = CaseNominee.caseNomineeID 
  AND (InstructionLineItem.coverPeriodFrom <= :coverPeriodTo 
  OR :coverPeriodTo IS NULL)
  AND InstructionLineItem.coverPeriodTo >= :coverPeriodFrom 
ORDER BY InstructionLineItem.coverPeriodFrom,
  InstructionLineItem.coverPeriodTo,
  CaseNominee.caseNomineeID