213: l_ctp_rec ben_ptip_f%rowtype;
214: l_pln_rec ben_pl_f%rowtype;
215: begin
216: --
217: g_debug := hr_utility.debug_enabled;
218: --
219: if g_debug then
220: hr_utility.set_location('Entering :'||l_proc,10);
221: end if;
216: --
217: g_debug := hr_utility.debug_enabled;
218: --
219: if g_debug then
220: hr_utility.set_location('Entering :'||l_proc,10);
221: end if;
222: --
223: if ben_manage_life_events.fonm = 'Y'
224: and ben_manage_life_events.g_fonm_cvg_strt_dt is not null then
269: --
270: if p_pgm_id is not null then
271: --
272: if g_debug then
273: hr_utility.set_location('PGM_ID '||p_pgm_id,12);
274: end if;
275: --
276: l_pgm_rec := ben_cobj_cache.g_pgm_currow;
277: --
277: --
278: elsif p_pl_id is not null then
279: --
280: if g_debug then
281: hr_utility.set_location('PL_ID '||p_pl_id,14);
282: end if;
283: --
284: l_pl_rec := ben_cobj_cache.g_pl_currow;
285: --
285: --
286: elsif p_oipl_id is not null then
287: --
288: if g_debug then
289: hr_utility.set_location('OIPL_ID '||p_oipl_id,16);
290: end if;
291: --
292: l_oipl_rec := ben_cobj_cache.g_oipl_currow;
293: --
293: --
294: elsif p_plip_id is not null then
295: --
296: if g_debug then
297: hr_utility.set_location('PLIP_ID '||p_plip_id,18);
298: end if;
299: --
300: l_plip_rec := ben_cobj_cache.g_plip_currow;
301: --
301: --
302: elsif p_ptip_id is not null then
303: --
304: if g_debug then
305: hr_utility.set_location('PTIP_ID '||p_ptip_id,20);
306: end if;
307: --
308: l_ptip_rec := ben_cobj_cache.g_ptip_currow;
309: --
309: --
310: end if;
311: --
312: if g_debug then
313: hr_utility.set_location('l_pl_typ_id : '|| l_pl_typ_id ,16871);
314: end if;
315: --
316: -- Check parent eligibility
317: --
315: --
316: -- Check parent eligibility
317: --
318: if g_debug then
319: hr_utility.set_location(l_proc||' Parent elig ',10);
320: end if;
321: --
322: if p_ptip_id is not null
323: and p_par_elig_state.elig_for_pgm_flag = 'N'
396: -- the elig per participation override flag is on and the effective date is
397: -- less than (or equal to) the participation override thru date
398: --
399: if g_debug then
400: hr_utility.set_location(l_proc||' Part Ovr ',10);
401: end if;
402: --
403: if p_pgm_id is not null then
404: --
613: end if;
614: --
615: -- Check if program, plan or option has an eligibility profile
616: if g_debug then
617: hr_utility.set_location(l_proc||' Before profile loop',22);
618: end if;
619: --
620: -- Check life event eligibility. If a life event is specified and
621: -- elig_inelig_code =
640: -- (e.g. eligible for dependent only coverage in an HMO if dependent
641: -- lives in service area and participant is full time).
642: -- Only check for plan, plip and oipl.
643: if g_debug then
644: hr_utility.set_location('p_pl_id '||p_pl_id,24);
645: hr_utility.set_location('p_oipl_id '||p_oipl_id,24);
646: hr_utility.set_location('p_pgm_id '||p_comp_obj_tree_row.par_pgm_id,24);
647: end if;
648: --BUG 4055771
641: -- lives in service area and participant is full time).
642: -- Only check for plan, plip and oipl.
643: if g_debug then
644: hr_utility.set_location('p_pl_id '||p_pl_id,24);
645: hr_utility.set_location('p_oipl_id '||p_oipl_id,24);
646: hr_utility.set_location('p_pgm_id '||p_comp_obj_tree_row.par_pgm_id,24);
647: end if;
648: --BUG 4055771
649: ben_env_object.get(p_rec => l_env_rec);
642: -- Only check for plan, plip and oipl.
643: if g_debug then
644: hr_utility.set_location('p_pl_id '||p_pl_id,24);
645: hr_utility.set_location('p_oipl_id '||p_oipl_id,24);
646: hr_utility.set_location('p_pgm_id '||p_comp_obj_tree_row.par_pgm_id,24);
647: end if;
648: --BUG 4055771
649: ben_env_object.get(p_rec => l_env_rec);
650: benutils.get_batch_parameters(p_benefit_action_id => l_env_rec.benefit_action_id
651: ,p_rec => l_benmngle_parm_rec);
652: --
653: -- BUG 4055771 l_env.mode_cd Never got initialized
654: if g_debug then
655: hr_utility.set_location(l_proc||' Family mem stuff ',10);
656: end if;
657: --
658: if (p_pl_id is not null
659: or p_oipl_id is not null) and NVL(l_benmngle_parm_rec.mode_cd,'X') not in ('I','D') -- BUG 4055771
665: -- that will take precedence over lower levels.
666: -- If vrfy_fmly_mmbr_cd is defined at ler level for
667: -- a comp object that will take precedence.
668: if g_debug then
669: hr_utility.set_location('p_par_pgm_id '||p_comp_obj_tree_row.par_pgm_id,25);
670: hr_utility.set_location('p_par_ptip_id '||p_comp_obj_tree_row.par_ptip_id,25);
671: hr_utility.set_location('p_par_plip_id '||p_comp_obj_tree_row.par_plip_id,25);
672: hr_utility.set_location('p_par_pl_id '||p_comp_obj_tree_row.par_pl_id,25);
673: hr_utility.set_location('l_pl_name '||l_pl_rec.name,26);
666: -- If vrfy_fmly_mmbr_cd is defined at ler level for
667: -- a comp object that will take precedence.
668: if g_debug then
669: hr_utility.set_location('p_par_pgm_id '||p_comp_obj_tree_row.par_pgm_id,25);
670: hr_utility.set_location('p_par_ptip_id '||p_comp_obj_tree_row.par_ptip_id,25);
671: hr_utility.set_location('p_par_plip_id '||p_comp_obj_tree_row.par_plip_id,25);
672: hr_utility.set_location('p_par_pl_id '||p_comp_obj_tree_row.par_pl_id,25);
673: hr_utility.set_location('l_pl_name '||l_pl_rec.name,26);
674: end if;
667: -- a comp object that will take precedence.
668: if g_debug then
669: hr_utility.set_location('p_par_pgm_id '||p_comp_obj_tree_row.par_pgm_id,25);
670: hr_utility.set_location('p_par_ptip_id '||p_comp_obj_tree_row.par_ptip_id,25);
671: hr_utility.set_location('p_par_plip_id '||p_comp_obj_tree_row.par_plip_id,25);
672: hr_utility.set_location('p_par_pl_id '||p_comp_obj_tree_row.par_pl_id,25);
673: hr_utility.set_location('l_pl_name '||l_pl_rec.name,26);
674: end if;
675: --
668: if g_debug then
669: hr_utility.set_location('p_par_pgm_id '||p_comp_obj_tree_row.par_pgm_id,25);
670: hr_utility.set_location('p_par_ptip_id '||p_comp_obj_tree_row.par_ptip_id,25);
671: hr_utility.set_location('p_par_plip_id '||p_comp_obj_tree_row.par_plip_id,25);
672: hr_utility.set_location('p_par_pl_id '||p_comp_obj_tree_row.par_pl_id,25);
673: hr_utility.set_location('l_pl_name '||l_pl_rec.name,26);
674: end if;
675: --
676: if p_comp_obj_tree_row.par_pgm_id is not null
669: hr_utility.set_location('p_par_pgm_id '||p_comp_obj_tree_row.par_pgm_id,25);
670: hr_utility.set_location('p_par_ptip_id '||p_comp_obj_tree_row.par_ptip_id,25);
671: hr_utility.set_location('p_par_plip_id '||p_comp_obj_tree_row.par_plip_id,25);
672: hr_utility.set_location('p_par_pl_id '||p_comp_obj_tree_row.par_pl_id,25);
673: hr_utility.set_location('l_pl_name '||l_pl_rec.name,26);
674: end if;
675: --
676: if p_comp_obj_tree_row.par_pgm_id is not null
677: then
704: l_vrfy_fmly_mmbr_rl := l_par_ptip_rec.vrfy_fmly_mmbr_rl;
705: end if;
706: --
707: if g_debug then
708: hr_utility.set_location('l_ptip level '||l_vrfy_fmly_mmbr_cd,26);
709: end if;
710: end if;
711: --
712: if l_vrfy_fmly_mmbr_cd is null and
724: --
725: l_vrfy_fmly_mmbr_cd := l_par_plip_rec.vrfy_fmly_mmbr_cd;
726: l_vrfy_fmly_mmbr_rl := l_par_plip_rec.vrfy_fmly_mmbr_rl;
727: end if;
728: -- hr_utility.set_location('l_plip level '||l_vrfy_fmly_mmbr_cd,26);
729: --
730: end if;
731: --
732: if l_vrfy_fmly_mmbr_cd is null and
748: l_vrfy_fmly_mmbr_rl := l_par_pl_rec.vrfy_fmly_mmbr_rl;
749: end if;
750: --
751: if g_debug then
752: hr_utility.set_location('l_pl level '||l_vrfy_fmly_mmbr_cd,26);
753: end if;
754: end if;
755: --
756: if p_pl_id is not null then
763: l_dpnt_pl_id := p_pl_id;
764: --
765: elsif p_oipl_id is not null then
766: if g_debug then
767: hr_utility.set_location(l_proc||' oipl NN ',28);
768: hr_utility.set_location(' vrfy fmly mmbr cd from ben_elig_to_prte_rsn_f '
769: || l_elig_to_prte_rsn_row.vrfy_fmly_mmbr_cd ,29);
770: end if;
771: --
764: --
765: elsif p_oipl_id is not null then
766: if g_debug then
767: hr_utility.set_location(l_proc||' oipl NN ',28);
768: hr_utility.set_location(' vrfy fmly mmbr cd from ben_elig_to_prte_rsn_f '
769: || l_elig_to_prte_rsn_row.vrfy_fmly_mmbr_cd ,29);
770: end if;
771: --
772: if l_vrfy_fmly_mmbr_cd is null then
800: -- Check verify family member code. CDR - Check
801: -- Designation requirements.
802: --
803: if g_debug then
804: hr_utility.set_location(l_proc||' Ver FM Code ',10);
805: hr_utility.set_location(' l_vrfy_fmly_mmbr_cd ' || l_vrfy_fmly_mmbr_cd , 25 );
806: end if;
807: --
808: if l_vrfy_fmly_mmbr_cd = 'CDR' then
801: -- Designation requirements.
802: --
803: if g_debug then
804: hr_utility.set_location(l_proc||' Ver FM Code ',10);
805: hr_utility.set_location(' l_vrfy_fmly_mmbr_cd ' || l_vrfy_fmly_mmbr_cd , 25 );
806: end if;
807: --
808: if l_vrfy_fmly_mmbr_cd = 'CDR' then
809: --
847: end if;
848: */
849: --
850: if g_debug then
851: hr_utility.set_location(l_proc||' formula ',30);
852: end if;
853: --
854: l_outputs := benutils.formula
855: (p_formula_id => l_vrfy_fmly_mmbr_rl,
878: --
879: end if;
880: --
881: if g_debug then
882: hr_utility.set_location('l_per_cvrd_cd '||l_per_cvrd_cd,32);
883: hr_utility.set_location(l_proc||' PCVRDCD',32);
884: end if;
885: --
886: if l_per_cvrd_cd in ('PRTTDPNT', 'DPNTELIG') or
879: end if;
880: --
881: if g_debug then
882: hr_utility.set_location('l_per_cvrd_cd '||l_per_cvrd_cd,32);
883: hr_utility.set_location(l_proc||' PCVRDCD',32);
884: end if;
885: --
886: if l_per_cvrd_cd in ('PRTTDPNT', 'DPNTELIG') or
887: l_vrfy_fmly_mmbr_cd = 'CDR' then
906: --
907: l_ctr_count := 0;
908: --
909: if g_debug then
910: hr_utility.set_location(l_proc||' Contact loop ',10);
911: end if;
912: --
913: for l_ctr_rec in c_get_contacts
914: loop
915: --
916: -- Call dependent eligibility
917: --
918: if g_debug then
919: hr_utility.set_location('BEDEP_MN :'||l_proc,34);
920: end if;
921: --
922: ben_evaluate_dpnt_elg_profiles.main
923: (p_contact_relationship_id => l_ctr_rec.contact_relationship_id
933: ,p_dependent_eligible_flag => l_dependent_elig_flag
934: ,p_dpnt_inelig_rsn_cd => l_dpnt_inelig_rsn_cd
935: );
936: if g_debug then
937: hr_utility.set_location('Dn BEDEP_MN :'||l_proc,36);
938: end if;
939: --
940: -- Load dependent data into a plsql table to check
941: -- for designation requirements.
965: ,p_dpnt_elig_flag => l_dpnt_elig_flag);
966: --
967: if l_dpnt_elig_flag = 'N' then
968: if g_debug then
969: hr_utility.set_location('BEN_92255_DPNT_NOT_ELIG: from check_dsgn_rqmts',38);
970: end if;
971: g_inelg_rsn_cd := 'DLG';
972: fnd_message.set_name('BEN','BEN_92255_DPNT_NOT_ELIG');
973: raise g_not_eligible;
993: --
994: -- Get eligibility profile details for the business group, plan or
995: -- program or option combination as of the process date
996: if g_debug then
997: hr_utility.set_location('PGM_ID '||p_pgm_id,44);
998: hr_utility.set_location('PL_ID '||p_pl_id,44);
999: hr_utility.set_location('OIPL_ID '||p_oipl_id,44);
1000: hr_utility.set_location('PLIP_ID '||p_plip_id,44);
1001: hr_utility.set_location('PTIP_ID '||p_ptip_id,44);
994: -- Get eligibility profile details for the business group, plan or
995: -- program or option combination as of the process date
996: if g_debug then
997: hr_utility.set_location('PGM_ID '||p_pgm_id,44);
998: hr_utility.set_location('PL_ID '||p_pl_id,44);
999: hr_utility.set_location('OIPL_ID '||p_oipl_id,44);
1000: hr_utility.set_location('PLIP_ID '||p_plip_id,44);
1001: hr_utility.set_location('PTIP_ID '||p_ptip_id,44);
1002: hr_utility.set_location(l_proc||' Before Cache call',44);
995: -- program or option combination as of the process date
996: if g_debug then
997: hr_utility.set_location('PGM_ID '||p_pgm_id,44);
998: hr_utility.set_location('PL_ID '||p_pl_id,44);
999: hr_utility.set_location('OIPL_ID '||p_oipl_id,44);
1000: hr_utility.set_location('PLIP_ID '||p_plip_id,44);
1001: hr_utility.set_location('PTIP_ID '||p_ptip_id,44);
1002: hr_utility.set_location(l_proc||' Before Cache call',44);
1003: hr_utility.set_location('p_pil_row.per_in_ler_id '||p_pil_row.per_in_ler_id,44);
996: if g_debug then
997: hr_utility.set_location('PGM_ID '||p_pgm_id,44);
998: hr_utility.set_location('PL_ID '||p_pl_id,44);
999: hr_utility.set_location('OIPL_ID '||p_oipl_id,44);
1000: hr_utility.set_location('PLIP_ID '||p_plip_id,44);
1001: hr_utility.set_location('PTIP_ID '||p_ptip_id,44);
1002: hr_utility.set_location(l_proc||' Before Cache call',44);
1003: hr_utility.set_location('p_pil_row.per_in_ler_id '||p_pil_row.per_in_ler_id,44);
1004: end if;
997: hr_utility.set_location('PGM_ID '||p_pgm_id,44);
998: hr_utility.set_location('PL_ID '||p_pl_id,44);
999: hr_utility.set_location('OIPL_ID '||p_oipl_id,44);
1000: hr_utility.set_location('PLIP_ID '||p_plip_id,44);
1001: hr_utility.set_location('PTIP_ID '||p_ptip_id,44);
1002: hr_utility.set_location(l_proc||' Before Cache call',44);
1003: hr_utility.set_location('p_pil_row.per_in_ler_id '||p_pil_row.per_in_ler_id,44);
1004: end if;
1005: --
998: hr_utility.set_location('PL_ID '||p_pl_id,44);
999: hr_utility.set_location('OIPL_ID '||p_oipl_id,44);
1000: hr_utility.set_location('PLIP_ID '||p_plip_id,44);
1001: hr_utility.set_location('PTIP_ID '||p_ptip_id,44);
1002: hr_utility.set_location(l_proc||' Before Cache call',44);
1003: hr_utility.set_location('p_pil_row.per_in_ler_id '||p_pil_row.per_in_ler_id,44);
1004: end if;
1005: --
1006: if not ben_evaluate_elig_profiles.eligible
999: hr_utility.set_location('OIPL_ID '||p_oipl_id,44);
1000: hr_utility.set_location('PLIP_ID '||p_plip_id,44);
1001: hr_utility.set_location('PTIP_ID '||p_ptip_id,44);
1002: hr_utility.set_location(l_proc||' Before Cache call',44);
1003: hr_utility.set_location('p_pil_row.per_in_ler_id '||p_pil_row.per_in_ler_id,44);
1004: end if;
1005: --
1006: if not ben_evaluate_elig_profiles.eligible
1007: (p_person_id => p_person_id
1032: -- determine further eligibility based upon the rules associated
1033: -- with participation eligibility
1034: --
1035: if g_debug then
1036: hr_utility.set_location('before rules: '||l_proc,72);
1037: end if;
1038: --
1039: ben_elig_rl_cache.get_elig_rl_cache
1040: (p_pgm_id => p_pgm_id
1048: ,p_inst_set => l_inst_set
1049: ,p_inst_count => l_elig_rl_cnt
1050: );
1051: if g_debug then
1052: hr_utility.set_location(l_proc||' done rules: ',74);
1053: hr_utility.set_location('Number of rules : ' || l_inst_set.count, 74);
1054: end if;
1055: --
1056: if l_elig_rl_cnt > 0 then
1049: ,p_inst_count => l_elig_rl_cnt
1050: );
1051: if g_debug then
1052: hr_utility.set_location(l_proc||' done rules: ',74);
1053: hr_utility.set_location('Number of rules : ' || l_inst_set.count, 74);
1054: end if;
1055: --
1056: if l_elig_rl_cnt > 0 then
1057: --
1106: --
1107: if (p_ptip_id IS NOT NULL) THEN
1108: -- 5482868 Find pl_typ_id for PTIP records
1109: if g_debug then
1110: hr_utility.set_location('Fetch pl_typ_id from cache p_ptip_id ' || p_ptip_id, 75);
1111: end if;
1112: --
1113: BEN_COMP_OBJECT.get_object(p_ptip_id => p_ptip_id, p_rec => l_ctp_rec);
1114: elsif (p_plip_id IS NOT NULL)
1207: raise g_eligible;
1208: --
1209: end if; -- elig_apls_flag
1210: if g_debug then
1211: hr_utility.set_location('Leaving: '||l_proc,99);
1212: end if;
1213: --
1214: exception
1215: --
1216: when g_eligible then
1217: --
1218: -- benutils.write(p_text => 'BENDETEL g_eligible ');
1219: if g_debug then
1220: hr_utility.set_location(l_proc||' Exc g_eligible ',800);
1221: end if;
1222: --
1223: -- Set out parameters
1224: --
1235: g_rec.business_group_id := p_business_group_id;
1236: g_rec.effective_date := p_effective_date;
1237: --
1238: if g_debug then
1239: hr_utility.set_location(l_proc||' BU_WRITE g_eligible ',812);
1240: end if;
1241: --
1242: benutils.write(p_rec => g_rec);
1243: benutils.write(p_text => ben_manage_life_events.g_output_string);
1243: benutils.write(p_text => ben_manage_life_events.g_output_string);
1244: ben_manage_life_events.g_output_string := null;
1245: --
1246: if g_debug then
1247: hr_utility.set_location(l_proc||' BDE_CPE g_eligible ',814);
1248: hr_utility.set_location('AGE VAL in CPE'||p_comp_rec.age_val,814);
1249: end if;
1250: --
1251: --
1244: ben_manage_life_events.g_output_string := null;
1245: --
1246: if g_debug then
1247: hr_utility.set_location(l_proc||' BDE_CPE g_eligible ',814);
1248: hr_utility.set_location('AGE VAL in CPE'||p_comp_rec.age_val,814);
1249: end if;
1250: --
1251: --
1252: ben_determine_eligibility2.check_prev_elig
1282: );
1283: --
1284: --
1285: if g_debug then
1286: hr_utility.set_location(l_proc||' Dn Exc g_eligible ',816);
1287: end if;
1288: --
1289: when g_not_eligible then
1290: --
1289: when g_not_eligible then
1290: --
1291: -- benutils.write(p_text => 'BENDETEL g_not_eligible ');
1292: if g_debug then
1293: hr_utility.set_location(l_proc||' Exc g_not_eligible ',818);
1294: end if;
1295: --
1296: -- Set out parameters
1297: --
1308: g_rec.business_group_id := p_business_group_id;
1309: g_rec.effective_date := p_effective_date;
1310: --
1311: if g_debug then
1312: hr_utility.set_location(l_proc||' Dn BU_WRI g_not_eligible ',822);
1313: end if;
1314: --
1315: benutils.write(p_rec => g_rec);
1316: benutils.write(p_text => ben_manage_life_events.g_output_string);
1316: benutils.write(p_text => ben_manage_life_events.g_output_string);
1317: ben_manage_life_events.g_output_string := null;
1318: --
1319: if g_debug then
1320: hr_utility.set_location(l_proc||' Dn BDE_CPE g_not_eligible ',824);
1321: hr_utility.set_location('g_inelg_rsn_cd ' || g_inelg_rsn_cd ,824);
1322: hr_utility.set_location('ben_evaluate_elig_profiles.g_inelg_rsn_cd ' || ben_evaluate_elig_profiles.g_inelg_rsn_cd,824);
1323: end if;
1324: --
1317: ben_manage_life_events.g_output_string := null;
1318: --
1319: if g_debug then
1320: hr_utility.set_location(l_proc||' Dn BDE_CPE g_not_eligible ',824);
1321: hr_utility.set_location('g_inelg_rsn_cd ' || g_inelg_rsn_cd ,824);
1322: hr_utility.set_location('ben_evaluate_elig_profiles.g_inelg_rsn_cd ' || ben_evaluate_elig_profiles.g_inelg_rsn_cd,824);
1323: end if;
1324: --
1325: ben_determine_eligibility2.check_prev_elig
1318: --
1319: if g_debug then
1320: hr_utility.set_location(l_proc||' Dn BDE_CPE g_not_eligible ',824);
1321: hr_utility.set_location('g_inelg_rsn_cd ' || g_inelg_rsn_cd ,824);
1322: hr_utility.set_location('ben_evaluate_elig_profiles.g_inelg_rsn_cd ' || ben_evaluate_elig_profiles.g_inelg_rsn_cd,824);
1323: end if;
1324: --
1325: ben_determine_eligibility2.check_prev_elig
1326: (p_comp_obj_tree_row => p_comp_obj_tree_row
1355: );
1356: --
1357: --
1358: if g_debug then
1359: hr_utility.set_location(l_proc||' Dn Exc g_not_eligible ',826);
1360: end if;
1361: --
1362: end determine_elig_prfls;
1363: --