---
title: ServiceCodeMappingHelper
summary: API reference for ServiceCodeMappingHelper.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Services
reference_type: package
---

# ServiceCodeMappingHelper

Configures AutoMapper (`Mapper.CreateMap`) mappings between billing service-code data-model entities and their corresponding contract types, so that `ServiceCodeService` can map query results to contract objects at runtime. It registers mappings from `CbpServiceCode` to `CbpBillServiceCode`, `CbpServiceDescription` to `ServiceDescription`, `CbpServiceFee` to `FeeSchedule`, and `CbpCptService` to `ServiceAttributeCpt`.

## Purpose
- Wires up the AutoMapper configuration needed to translate service-code, service-description, fee-schedule, and CPT-attribute data-model entities into their contract representations.
- Centralizes service-code-related mapping registration so it can be invoked once from a consuming service's static constructor.

## Context
- Namespace: `SAIF.Services.Claims.Bills`
- Assembly/package: `SAIF.Services` (packaged inside the `SAIF.SAIFCode.Core` NuGet package)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| MapServiceCodeService | `static void MapServiceCodeService()` | Registers all AutoMapper mappings for service-code-related entities by invoking the internal code-table and entity-table mapping registration routines. |

## Behavioral notes
- The internal `MapCodeTables` routine is currently a no-op; its single `Mapper.CreateMap<CbpBillStatusCode, BillStatusCode>()` call is commented out.*
- The internal `MapTables` routine registers four entity-pair mappings: `CbpServiceCode`→`CbpBillServiceCode`, `CbpServiceDescription`→`ServiceDescription`, `CbpServiceFee`→`FeeSchedule`, and `CbpCptService`→`ServiceAttributeCpt`.
- Mappings are registered via AutoMapper's static `Mapper.CreateMap` API, meaning they take effect globally for the process once `MapServiceCodeService` has been called.*

## Constraints and usage notes
- Must be called (typically once, from a static constructor such as `ServiceCodeService`'s) before any code attempts to `Mapper.Map` between the registered type pairs, otherwise AutoMapper will throw a mapping-not-found exception.*

> **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.

## Sources
- `Services/SAIF.Services/Claims/Bills/ServiceCodeMappingHelper.cs`
