Database SQL Operation: CaseParticipantRole.searchCaseMembersByCaseIDDate
Description: | |
Sterotype: | nsmulti |
SELECT
SubQuery.concernRoleName,
SubQuery. caseParticipantRoleID
INTO
:name,
:caseParticipantRoleID
FROM
( (SELECT
concernRoleName,
caseParticipantRoleID
FROM
ConcernRole,
CaseParticipantRole,
Person
WHERE CaseParticipantRole.caseID = :caseID
AND
(
CaseParticipantRole.typeCode = :type1
OR CaseParticipantRole.typeCode = :type2
)
AND ConcernRole.concernRoleID = CaseParticipantRole.participantRoleID
AND
(
Person.concernRoleID = ConcernRole.concernRoleID
AND Person.dateOfBirth >= :dateFrom
) )
UNION
(
SELECT
concernRoleName,
caseParticipantRoleID
FROM
ConcernRole,
CaseParticipantRole,
ProspectPerson
WHERE CaseParticipantRole.caseID = :caseID
AND
(
CaseParticipantRole.typeCode = :type1
OR CaseParticipantRole.typeCode = :type2
)
AND ConcernRole.concernRoleID = CaseParticipantRole.participantRoleID
AND ProspectPerson.concernRoleID = ConcernRole.concernRoleID
)
) SubQuery
|