You are here:
InsCensusServiceStd:addPlanSelections
Use this service to create GroupCensusMemberPlan records for existing GroupCensusMember records. It uses the ContractGroupPlans specified in the input JSON for adding plans to each GroupCensusMember. The service also accepts optional coverages per member such that primary members and dependents can be enrolled into different coverages under the same plan.
Class: InsCensusServiceStd
Method: addPlanSelections
If the plan selections for every member are uploaded using CSV, use the InsCensusServiceStd:updateMembersWithPlans service.
GroupCensus and Contract must have the same group account.
ContractGroupPlan status must be active.
How It Works
The service uses censusId and contractId to insert members' selected plans.
- For each of its
ContractGroupPlanIDs, the service evaluates whether the plan is valid for the member based on these factors:The
contractIdis valid for thecensusId.- The
ContractGroupPlan Id is valid for the contractId. IsOptOutAllPlansis false.When ContractGroupPlan has record type as Product (ContractGroupPlan of parent):
The product type of the
ContractGroupPlan for the primary member must not be equal to the product types listed in the primary member's OptOutPlanTypes.The product type of the
ContractGroupPlanfor a dependent must not be equal to the product types listed in the dependent's OptOutPlanTypes, and the product type of the ContractGroupPlan must not be equal to the product types listed in the OptOutPlanTypes of dependent's primary member.
When ContractGroupPlan has record type as CoverageSpec (ContractGroupPlan of child):
The product type of the
ContractGroupPlan of a child for the primary member must not be equal to the product types listed in the primary member's OptOutPlanTypes.The product type of the
ContractGroupPlanof a child for a dependent must not be equal to the product types listed in the dependent's OptOutPlanTypes, and the product type of the ContractGroupPlan must not be equal to the product types listed in the OptOutPlanTypes of dependent's primary member.
-
The Ids of successfully created
GroupCensusMemberPlanentries are returned for valid plans. -
The service retrieves the valid plans for eligible group classes for the given contract. Enrollment in a root plan and its coverages depends on whether the member's class is eligible for the plan, and if the plan accepts members not associated with any class.
If the service determines that a census member can enroll in a plan, the plan is added to the
GroupCensusMemberPlan.-
A plan is added to a
GroupCensusMemberPlanif:-
A census member is associated with a valid group class and a
ContractGroupPlanGroupClassrecord exists with the group class and the plan. -
A census member is associated with a valid group class, no
ContractGroupPlanGroupClassrecord exists for the group class, and the plan doesn't exist for any other group class. -
A census member is not associated with a valid group class and no
ContractGroupPlanGroupClassrecord exists with the plan.
-
-
A plan is not added to a
GroupCensusMemberPlanif:-
A census member is associated with a valid group class, no
ContractGroupPlanGroupClassrecord exists for the group class, but the plan does exist for another group class. -
A census member is not associated with a valid group class and a
ContractGroupPlanGroupClassrecord exists with the plan and group classes.
-
-
-
When invalid
contractGroupPlanIdsare passed for agroupCensusMember(the flagisNewMemberis true), the service deletes thegroupCensusMemberrecords and doesn't create any newGroupCensusMemberPlanrecords for thegroupCensusMember. Expect this output only when the flagonlySaveMembersWithValidProductsis set true in the JSON object.
Remote Options
Option |
Description |
|---|---|
|
Required. Id of census with the members whose plans must be inserted. Validates that the |
|
Required. Id of Account's current contract. Validates that the plans for each member are part of the contract. |
|
Required. JSON input with two nodes:
|
|
Optional. If true, new members without entries in |
Service Behavior
Understand how different inputs affect the service outputs.
| Input | Service Output |
|---|---|
No censusId or invalid censusId |
The service adds no member plan. |
No contractId or invalid contractId |
The service adds no member plan. |
Invalid contractId for the census specified |
The service adds no member plan. |
| No rows to insert/update | The service adds no member plan. |
Row has no ID (GroupCensusMember.Id) |
The service adds no member plan. |
Invalid ContractGroupPlanId for the contract specified |
The service creates no member plan. If
|
Invalid ContractGroupPlanId for the member (due to opt-out) |
Member plan is not created If
|
| The primary member opts out of a product type |
If the primary member opts out of a product type, the dependents also opt out of that product type. |
| Dependent member opts out of a product type |
If the primary member opts out of a product type, the dependents also opt out of that product type. If |
Input JSON
Here's the format of the input JSON:
{
"censusId":"ID",
"contractId":"ID",
"census":{
"headers":[
{
"name":"GroupCensusMemberPlan.fieldAPI1"
},
{
"name":"GroupCensusMemberPlan.fieldAPI2"
}
],
"members":[
{
"Id":"Census Member ID",
"isNewMember":true,
"GroupCensusMemberPlan.fieldAPI1":"value1",
"GroupCensusMemberPlan.fieldAPI2":"value2",
"ContractGroupPlanId": "ContractGroupPlan.Id;ChildContractGroupPlan.Id"
},
{
"Id":"Census Member ID",
"isNewMember":true,
"GroupCensusMemberPlan.fieldAPI1":"value1",
"GroupCensusMemberPlan.fieldAPI2":"value2",
"ContractGroupPlanId": "ContractGroupPlan.Id;ChildContractGroupPlan.Id"
}
]
},
"onlySaveMembersWithValidProducts" : true
}Here's an example of the input JSON:
{
"censusId":"a4D4P000000hbjSUAQ",
"contractId":"8004P000000zF2dQAE",
"census":{
"members":[
{
"ContractGroupPlanId":"a4D4P000000hbjSUAQ;a4D4P000000hbjSUAQ",
"Id":"a4C4P000000d7POUAY"
}
],
"headers":[
{
"name":"ContractGroupPlanId"
}
]
}
}Output JSON
The service returns the list of successfully inserted GroupCensusMemberPlan Ids. It also provides the list of errors encountered. These errors are grouped per member.
Here's the format of the output JSON:
{
"memberPlanIds":[
"GroupCensusMemberPlan.Id"
],
"errors":[
{
"error":"error"
}
]
}The service returns an output JSON, formatted like this:
{
"memberPlanIds":[
"a4B4P000006jKsMUAU",
"a4B4P000006jKsNUAU",
"a4B4P000006jKsOUAU",
"a4B4P000006jKsPUAU"
],
"errors":[
{
"numPlansError":2,
"error":"ContractGroupPlan value is not valid:8004P000000zJKjQAM; Medical",
"numPlans":2,
"Id":"a4C4P000000ed6dUAA",
"isNewMember":true,
"ContractGroupPlan":"8004P000000zJKjQAM;Medical"
}
]
}

