You are here:
InsEnrollmentServiceStd:enrollPlans
Use this service to create insurance policy (InsurancePolicy) records for member's selected medical, dental, vision, and other plans.
Class: InsEnrollmentServiceStd
Method: enrollPlans
How It Works
The service does the following:
- The service takes the input JSON and looks for the information to create
the policies (Insurance Policy).
defaultIsFSCOption isFsc parameter Output True False Creates Insurance Policy ( InsurancePolicy) recordsFalse False Returns error message - "FSC disabled; Use old enrollPlans method to create asset Object ". True True Creates Insurance Policy ( InsurancePolicy) recordsFalse True Creates Insurance Policy ( InsurancePolicy) recordNote Enrollment services can either write to the Insurance Policy and related objects (Harmonized policy data model) or Asset objects (Vlocity model), depending on the isFsc parameter, and the custom setting for defaultIsFSCOption. For creating asset records, use InsEnrollmentService:enrollPlans service -
For an Insurance Policy record, the member can be represented either as a Contact or a Person Account. If the member is represented as a contact, the
Account.Idof the enrollment contract is set as the policy's Account. When a member is represented as a Person account, the Person Account Id of member is set as the policy's Account.When a member (primary or dependent) is represented as an account and a contact both, the service uses the account representation.
-
Associates dependents to the policies as Insurance Policy Participants (
InsurancePolicyParticipants). It creates another Insurance Policy Participant (InsurancePolicyParticipant) for the primary member. - The records for
InsurancePolicyParticipantsare populated according to these rules:Primary InsurancePolicyParticipant
Dependent InsurancePolicyParticipant
Primary Member Id = PersonAccount
PrimaryParticipant.PrimaryParticipantAccountId = PersonAccountPrimaryParticipant.PrimaryParticipantContactId = PersonAccount.personContactId
DependentParticipant.PrimaryParticipantAccountId = PersonAccountDependentParticipant.PrimaryParticipantContactId = PersonAccount.personContactId
Primary Member Id = ContactId
PrimaryParticipant.PrimaryParticipantContactId = ContactId
DependentParticipant.PrimaryParticipantContactId = ContactId
Dependent Member Id = ContactId/AccountId
The population of Primary participant records happens based on the primary member Id.
The dependent member population follows the same logic as described above for primary members.
-
Gets the
ProductId from the plan and stamps InsurancePolicy.ProductId to that Id. -
Creates these relationships:
Insurance Policy
InsurancePolicy.EffectiveDate=Contract.StartDateor the EffectiveStart in the input JSON.InsurancePolicy.ExpirationDate=Contract.EndDateor the EffectiveEnd in the input JSON.InsurancePolicy.ContractGroupPlanId=ContractGroupPlan.Id -
The service calculates
InsurancePolicy.PolicyTermbased onContract.ContractTerm:Insurance Policy
InsurancePolicy.PolicyTerm= Annual.InsurancePolicy.PolicyTerm= Semi-AnnualInsurancePolicy.PolicyTerm= Monthly -
Gets the
Pricekey from the input JSON and creates these relationships:Insurance Policy
InsurancePolicy.StandardPremiumAmount= PriceInsurancePolicy.TermPremiumAmount= prorated price based on the effective dates. -
Creates Insurance Policy Coverages (
InsurancePolicyCoverages) for the coverage items.
Remote Options
Option |
Description |
|---|---|
|
Required. The key to a pre-transformed JSON structure that contains information the service needs. |
Input JSON
The service takes the input JSON specified by the inputKey. In
this example, inputKey = enrollmentJson.
The service requires:
-
contractId: <value> -
Dependents: <list of maps for contactId and relationshipType of the dependents>
This input JSON can have either a list of objects or a map because the service supports creating either one policy or multiple policies.
primaryMemberId can either be a person account ID or contact ID. Based on the ID type of primaryMemberId, the service works as described earlier.
Similarly, for dependents, the service has memberId node to support both Person Account Id and Contact Id. Based on the Id type of memberId, the service works as described earlier.
Here's the sample input JSON:
{
"enrollmentJson": {
"dependents": [
{
"IsSpouse": false,
"memberId": "001RO000003NTBtYAO",
"LastName": "Jones",
"FirstName": "Jean",
"relationshipType": "Child"
}
],
"coverages": {
"records": [
{
"Price": "13",
"productcode": "CI"
}
]
},
"Price": 20,
"planId": "0rgRO000000000zYAA",
"primaryMemberId": "001RO000003Zr0AYAS",
"contractId": "800RO000000TFXdYAO"
}
}
