Resolve the NCCI statistical reporting class code for a premium adjustment, using one of three lookup strategies keyed by the adjustment type code (CRP/MRP/SARAP/MARIT/FELA vs. INC vs. general).
VARCHAR2(6) — the resolved NCCI statistical reporting class code, or NULL when no matching row is found by the selected lookup strategy.
Called by
clsPremiumSummaryAdjustment (GetStatClassNumber)
Description: Resolve the NCCI statistical reporting class code for a premium adjustment, using one of three lookup strategies keyed by the adjustment type code (CRP/MRP/SARAP/MARIT/FELA vs. INC vs. general).
Adjustment types CRP, MRP, SARAP, MARIT and FELA resolve their NCCI stat code directly from the matching premium-history premium-adjustment row for the given period (no employer-liability-limit join).
in_pa_type_code IN ('CRP','MRP','SARAP','MARIT','FELA')
Open crp_stat_code_cur: SELECT ncci_stat_code FROM prem_hist_prem_adjustment phpa WHERE phpa.prem_hist_set_id = in_ph_set_id AND phpa.prem_adjustment_type_code = in_pa_type_code AND in_ps_eff_date BETWEEN prem_adjustment_eff_date AND prem_adjustment_exp_date AND in_ps_exp_date BETWEEN prem_adjustment_eff_date AND prem_adjustment_exp_date; NULL if not found
PROC-BR-007
Adjustment type INC resolves its NCCI stat code by joining the matching premium-adjustment row to employers_liability_limits on the stat code itself.
in_pa_type_code = 'INC'
Open inc_stat_code_cur: join prem_hist_prem_adjustment phpa to employers_liability_limits b on phpa.ncci_stat_code = b.emp_liab_stat_code, filtered by period overlap; NULL if not found
PROC-BR-008
All other adjustment types resolve their NCCI stat code from the general rating-rule-master stat code table.
in_pa_type_code NOT IN ('CRP','MRP','SARAP','MARIT','FELA','INC')
Open general_stat_code_cur: SELECT ncci_stat_code FROM prem_rating_ncci_stat_code WHERE rating_rule_master_id = in_rr_master_id AND prem_adjustment_type_code = in_pa_type_code; NULL if not found
Resolve the NCCI statistical reporting class code for a premium adjustment, using one of three lookup strategies keyed by the adjustment type code (CRP/MRP/SARAP/MARIT/FELA vs. INC vs. general).
FUNCTIONsp72151_determine_ncci_stat(in_policy_numINNUMBER,in_pp_eff_dateINDATE,in_rr_master_idINNUMBER,in_ps_eff_dateINDATE,in_ps_exp_dateINDATE,in_ph_set_idINNUMBER,in_pa_type_codeINVARCHAR2)RETURNVARCHAR2/* Valrey 06/21/2000 Modified function to get the default stat code from the employers_liability_limits table. *//* carade rel 6.0 csr 13 Changed to get stat code for SARAP, MINF, MINM and MRP. *//* carade rel 7.0.2 Added MINFD and MINMD.*//* carade rel 7.0.4 Changed MINFD and MINMD. *//* carade rel 7.0.5 Removed MINM, MINMD, MINF, MINFD. These will fall thru the general stat code logic. *//* carade GW Added MARIT and FELA to crp transalation */ISv_stat_codeVARCHAR2(6);v_policy_premiumNUMBER;v_policy_fed_minimumNUMBER;CURSORgeneral_stat_code_curISSELECTncci_stat_codeFROMprem_rating_ncci_stat_codeWHERErating_rule_master_id=in_rr_master_idANDprem_adjustment_type_code=in_pa_type_code;CURSORcrp_stat_code_curISSELECTncci_stat_codeFROMprem_hist_prem_adjustmentphpaWHEREphpa.prem_hist_set_id=in_ph_set_idANDphpa.prem_adjustment_type_code=in_pa_type_codeANDin_ps_eff_dateBETWEENprem_adjustment_eff_dateANDprem_adjustment_exp_dateANDin_ps_exp_dateBETWEENprem_adjustment_eff_dateANDprem_adjustment_exp_date;CURSORinc_stat_code_curISSELECTb.ncci_stat_codeFROMprem_hist_prem_adjustmentphpa,employers_liability_limitsbWHEREphpa.prem_hist_set_id=in_ph_set_idANDphpa.prem_adjustment_type_code=in_pa_type_codeANDin_ps_eff_dateBETWEENprem_adjustment_eff_dateANDprem_adjustment_exp_dateANDin_ps_exp_dateBETWEENprem_adjustment_eff_dateANDprem_adjustment_exp_dateANDphpa.ncci_stat_code=emp_liab_stat_code;BEGINIFin_pa_type_codeIN('CRP','MRP','SARAP','MARIT','FELA')THENOPENcrp_stat_code_cur;FETCHcrp_stat_code_curINTOv_stat_code;IFcrp_stat_code_cur%NOTFOUNDTHENv_stat_code:=NULL;ENDIF;CLOSEcrp_stat_code_cur;ELSIFin_pa_type_code='INC'THENOPENinc_stat_code_cur;FETCHinc_stat_code_curINTOv_stat_code;IFinc_stat_code_cur%NOTFOUNDTHENv_stat_code:=NULL;ENDIF;CLOSEinc_stat_code_cur;ELSEOPENgeneral_stat_code_cur;FETCHgeneral_stat_code_curINTOv_stat_code;IFgeneral_stat_code_cur%NOTFOUNDTHENv_stat_code:=NULL;ENDIF;CLOSEgeneral_stat_code_cur;ENDIF;RETURNv_stat_code;END;