Database SQL Operation: PlannedItem.countAllUnapprovAndSubmittedForServPlan
Description: | Returns a count of all unapproved and all submitted planned items for a service plan. |
Sterotype: | ns |
SELECT
COUNT(*)
INTO
:recordCount
FROM
PlannedGoal,
PlannedSubGoal,
PlannedItem
WHERE PlannedGoal.caseID = :caseID
AND PlannedSubGoal.plannedGoalID = PlannedGoal.plannedGoalID
AND PlannedItem.plannedSubGoalID = PlannedSubGoal.plannedSubGoalID
AND
(
PlannedItem.status = :planItemStatusUnapproved
OR PlannedItem.status = :planItemStatusSubmitted
)
|