Skip to content

Determine maximum premium-history set ID

Determines the maximum premium-history set ID for a policy period, restricted to premium-history type codes 1 and 3, with a DBNull guard defaulting to 0.

Field Value
Operation ID OP-POL-006
Trigger Caller reads PolicyInformation.MaxPremiumHistorySetId(inDPI, inPolicyNumber, inPolicyPeriodEffectiveDate)
Inputs Data portal info, policy number, policy-period effective date
Outputs Decimal (0 if no matching row)
Primary components PolicyInformation.MaxPremiumHistorySetId
Entry point SAIF.Business.Policy\PolicyInformation.vb

Steps

  1. Caller reads PolicyInformation.MaxPremiumHistorySetId(inDPI, inPolicyNumber, inPolicyPeriodEffectiveDate).
  2. Inline scalar SQL (SQL-009) is executed against PREM_HIST_SUMMARY, filtered by policy number, period effective date, and PREM_HIST_TYPE_CODE IN ('1','3').
  3. DPI.ProcessPortalRequest executes.
  4. If the result is DBNull: returns 0.
  5. Otherwise: returns the decimal value.

Process flow

flowchart TD
    Start([MaxPremiumHistorySetId read]) --> S1[Build scalar request with SQL-009]
    S1 --> S2[Bind PolicyNumber and PolicyPeriodEffectiveDate]
    S2 --> S3[DPI.ProcessPortalRequest executes]
    S3 --> D{Result is DBNull?}
    D -->|Yes| EndZero([Return 0])
    D -->|No| EndVal([Return decimal value])

Failure and edge-case behavior

  • Unlike several sibling PolicyInformation properties, this operation correctly guards against DBNull, returning 0 instead of raising a cast exception.

Sources

  • SAIF.Business.Policy\PolicyInformation.vb