Return 'Y' immediately; no further tests are evaluated
PROC-RULE-004
A temporary-staffing agency is a regional-office policy
Below the premium threshold and the submission answered 'Y' to ACORD form 'SAIF' question '09' (SUB_POLICY_RESPONSE joined to SUB_ACORD_QUESTION for the policy's SUB_POLICY_SEQ_NUM)
Return 'Y'
PROC-RULE-005
A FELA or Maritime jurisdiction makes a policy a regional-office policy
Below threshold, not a temp agency, and the latest premium-history set (MAX(prem_hist_set_id) from PREM_HIST_PREM_SUMMARY) contains a PREM_HIST_CLASS_COVERAGE row with manual_class_type_code IN ('M','FELA')
Return 'Y'
PROC-RULE-006
Entity code 50 makes a policy a regional-office policy
None of the above matched andCOUNT(*) > 0 for SUB_POLICY rows with entity_code = '50'
Return 'Y'; otherwise the default 'N' stands
PROC-RULE-007
Any unexpected error is suppressed and treated as "not regional office"
WHEN OTHERS
Return 'N' - failures are silently downgraded, not raised
FUNCTIONregional_office_yn(in_policy_numpolicy.policy_num%type,in_policy_period_eff_datepolicy_period.policy_period_eff_date%type)RETURNVARCHAR2ISv_regional_indVARCHAR2(1):='N';v_manual_premiumNUMBER;v_countnumber;CURSORcsr_temp_agency(in_policy_numINpolicy.policy_num%type)ISSELECT'Y'FROMsub_policy_responserJOINsub_acord_questionqONq.sub_acord_question_seq_num=r.sub_acord_question_seq_numWHEREq.acord_form_num='SAIF'ANDq.question_num='09'ANDr.response_flag_code='Y'ANDr.sub_policy_seq_num=(selectsub_policy_seq_numfromsub_policywherepolicy_num=in_policy_num);CURSORcsr_jurisdiction_code(in_policy_numINpolicy.policy_num%type,in_policy_period_eff_dateINpolicy_period.policy_period_eff_date%TYPE)ISSELECT'Y'FROMprem_hist_class_coverageWHEREmanual_class_type_codeIN('M','FELA')ANDprem_hist_set_id=(SELECTMAX(prem_hist_set_id)FROMprem_hist_prem_summaryWHEREpolicy_num=in_policy_numANDpolicy_period_eff_date=in_policy_period_eff_date)ANDpolicy_num=in_policy_numANDpolicy_period_eff_date=in_policy_period_eff_date;BEGIN-- Get the manual premium thresholdSELECTmanual_premium_threshold_amtINTOv_manual_premiumFROMsub_constants;-- Check if manual premium is greater than 20000IFpk73059_prem_hist_summary.determine_manual_premium(in_policy_num,in_policy_period_eff_date)>v_manual_premiumTHENv_regional_ind:='Y';ELSE-- If the submission is not a leasing companyIFv_regional_ind='N'THEN-- Check if the submission is a temp agencyOPENcsr_temp_agency(in_policy_num);FETCHcsr_temp_agencyINTOv_regional_ind;CLOSEcsr_temp_agency;ENDIF;-- If the submission is not a temp agencyIFv_regional_ind='N'THEN-- Check if the jurisdiction code is FELA or MaritimeOPENcsr_jurisdiction_code(in_policy_num,in_policy_period_eff_date);FETCHcsr_jurisdiction_codeINTOv_regional_ind;CLOSEcsr_jurisdiction_code;ENDIF;-- check if entity 50ifv_regional_ind='N'thenselectcount(*)intov_countfromsub_policywherepolicy_num=in_policy_numandentity_code='50';ifv_count>0thenv_regional_ind:='Y';endif;endif;ENDIF;RETURNv_regional_ind;EXCEPTIONWHENOTHERSTHENRETURN'N';END;/* =========================================================================== Name : get_team_assignment_name Prepared By : valrey Created : 06/11/2012 Description : Returns the team assignment name Modification History -------------------------------------------------------------------------- =========================================================================== */
Note: Statements marked with * were inferred from code structure, naming conventions, or
contextual evidence where direct confirmation was not available in source artifacts. Statements
marked with ** could not be confirmed; treat as unknown until verified.