Operation Details
Description:  
Sterotype: nsmulti
SQL
SELECT
  ICDCodeConditionLink.iCDCodeConditionLinkID,
  ICDCodeConditionLink.iCDCodeID,
  ICDCode.ICDText,
  ICDCode.ICDCode,
  ICDCodeConditionLink.conditionID,
  ICDCodeConditionLink.startDate,
  ICDCodeConditionLink.endDate,
  ICDCodeConditionLink.versionNo
INTO
  :iCDCodeConditionLinkID,
  :iCDCodeID,
  :iCDText,
  :iCDCode,
  :conditionID,
  :startDate,
  :endDate,
  :versionNo 
FROM
  ICDCode,
  ICDCodeConditionLink 
WHERE ICDCodeConditionLink.conditionID = :conditionID 
  AND ICDCode.ICDCodeID = ICDCodeConditionLink.iCDCodeID 
  AND 
  (
    ICDCodeConditionLink.endDate IS NULL 
    OR ICDCodeConditionLink.endDate > current_date 
  ) 
ORDER BY ICDCode.ICDCode