---
title: Assemble the policy header payload
summary: Composes the rendered policy-header values, filtered associations, messages, help text, and cancellation-status text.
status: draft
owner: SAIF Documentation Generation
last_reviewed: 2026-07-31
library: SAIF.Application.Policy
reference_type: package
operation_id: OP-07
trigger: A consumer reads any policy-header data-provider member
---

# Assemble the policy header payload

This operation builds the policy-header payload returned to consuming applications. It loads supporting policy and agency objects, retrieves and filters header associations, applies demo masking, derives cancellation status, and exposes help text and informational messages.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-07 |
| **Trigger** | A consumer reads any `IPolicyHeaderDataProvider` member |
| **Inputs** | `DPI`, policy number, security principal, optional target association types |
| **Outputs** | Rendered policy-header values, filtered associations, messages, help texts, and cancellation-status text |
| **Primary components** | `clsStandardPolicyHeaderDataProvider` |
| **Entry point** | `Application\SAIF.Application.Policy\PolicyHeader\clsStandardPolicyHeaderDataProvider.vb` |

## Steps

1. Lazy-load the current policy through `clsPolicy.GetPolicy(DPI, PolicyNumber)`.
   - > **Origin**: The delegated retrieval flow is documented in [Retrieve a policy (optionally masked)](../../saif-business-policy-core/operations/retrieve-a-policy-optionally-masked.md).
2. Lazy-load the producing agency through `clsProducer.GetProducer(DPI, Policy.AgentNumber).Agency`.
   - > **Origin**: Producer retrieval is documented in [Retrieve producers](../../saif-business-policy-agency/operations/retrieve-producers.md).
3. Load all header associations through `clsPolicyHeaderAssociationFactory.GetPolicyHeaderAssociations`, optionally constrained by target association types.
   - > **Origin**: The delegated association flow is documented in [Resolve policy-header associations](../../saif-business-view-policy/operations/resolve-policy-header-associations.md).
4. Apply ownership filtering and then restrict the rows to association types present in the validated association-type set ([BR-112](../business-rules.md#br-112-secured-association-types-require-matching-resource), [BR-116](../business-rules.md#br-116-agents-see-only-their-own-agent-or-agency-associations)).
5. Render display values.
   - Demo mode substitutes fixed values for agency name, legal name, and policy name ([BR-118](../business-rules.md#br-118-demo-mode-masks-policyholder-values)).
   - Status description appends `Coverage Bound` only when both policy and most-recent period are bound ([BR-119](../business-rules.md#br-119-coverage-bound-indicator-requires-bound-status-and-period)).
6. Derive cancellation status by invoking [SQL-001](../sql/SQL-001-cancellation-status-derivation.md) against [POLICY](../database-tables.md#policy), [POLICY_STATUS_CODE](../database-tables.md#policy_status_code), [POLICY_DEMAND](../database-tables.md#policy_demand), [POLICY_PERIOD_PAYROLL_AUDIT](../database-tables.md#policy_period_payroll_audit), [AUDIT_CODE](../database-tables.md#audit_code), [CANCELLATION](../database-tables.md#cancellation), and [COLLECTION_LEGAL_ACTION](../database-tables.md#collection_legal_action).
   - Show the returned value only for SAIF employees ([BR-120](../business-rules.md#br-120-cancellation-status-is-for-saif-employees-only)).
   - Normalize null or `DBNull` return values to the empty string ([BR-121](../business-rules.md#br-121-null-cancellation-status-becomes-empty)).
7. Compute the rate-account number from the ER-combination parent and build the relationship description from the policy-relationship parent ([BR-122](../business-rules.md#br-122-rate-account-comes-from-er-combination-parent), [BR-123](../business-rules.md#br-123-relationship-description-uses-parent-type-and-policy-number)).
8. Build the informational message set, including the other-states-coverage message when applicable ([BR-124](../business-rules.md#br-124-other-states-coverage-emits-a-header-message)).
9. Build the `POLHD` help-text collection for the header labels and association descriptions ([BR-125](../business-rules.md#br-125-help-text-uses-the-polhd-application-code)).
   - > **Origin**: Help-text retrieval is documented in [Help text retrieval](../../saif-business/operations/help-text-retrieval.md).

## Process flow

The following diagram visualizes policy-header composition.

```mermaid
flowchart TD
    Start([Header value requested]) --> Policy[Load policy]
    Policy --> Agency[Load agency]
    Agency --> Assoc[Load header associations]
    Assoc --> Filter[Apply association security and ownership filters]
    Filter --> Render[Render display fields and masks]
    Render --> Cancel[Derive cancellation status]
    Cancel --> Extras[Build messages, help text, relationship, and rate account]
    Extras --> Done([Return header payload])
```

## Failure and edge-case behavior
- `RateAccountNumber` and `RelationshipDescription` read from the unfiltered association set rather than `ValidatedAssociations`. Whether that is intentional could not be confirmed.**
- The exact package mapping for `GetTotalDepositOnHand` was not confirmed in the findings, so deposit-on-hand behavior is documented outside this header path.**

> **Note:** Statements marked with `**` could not be confirmed; treat as unknown until verified.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [Database tables](../database-tables.md)
- [SQL catalog](../sql/index.md)
- [Security and authorization](../security-authorization.md)

## Sources
- `Application\SAIF.Application.Policy\PolicyHeader\clsStandardPolicyHeaderDataProvider.vb`
- `Business\SAIF.Business.Policy.Core\clsPolicy.vb`
- `Business\SAIF.Business.Policy.Agency\clsProducer.vb`
- `Business\SAIF.Business.View.Policy\Associations\clsPolicyHeaderAssociationFactory.vb`
- `Business\SAIF.Business\clsHelpText.vb`
