You are here:
InsEnrollmentServiceStd:getRatedGroupProducts
Use this service to calculate price to opt for a root plan with coverages for a family. The service also provides employee and employer contributions for a policy before enrollment, and supports proration for new hires.
Class: InsEnrollmentServiceStd
Method: getRatedGroupProducts
How it Works
- The service first validates input data to verify:
A
flowNameis provided. The providedflowNameand its version are valid and active.The
memberPlansnode is present and a validcensusMemberIdis provided for the node.The provided
contractIdorrootPlanIdis valid or if thecontractGroupPlanof therootPlanIdprovided is associated with the providedcontractId.Only one
memberPlansnode is specified for eachcensusMemberId. At least one primary member is specified in thememberPlansnode, and only one primary member is specified in thememberPlansnode.The member specified belongs to the family and the provided
censusId.The specified
rootPlanIdbelongs to the providedcontractId.The specified
planIdsare valid.Verifies that the expression set is configured to set the member level premium amount to the
memberPremiumfield whenisSaveMemberPremiuminput parameter is set totrue.
-
If the input data is valid, the service calls the rating flow that's provided as
flowNameparameter in the input. -
The rating flow creates
InsuranceRatingInput, executes the rating process, and then saves the rating output inInsuranceRatingOutput. -
The service returns rating output, which is the price, after applying employer and employee contribution. The service also applies proration if
IsProratedflag is set totrue. -
The service returns errors with error details in case of any validation or rating flow execution errors.
Remote Options
| OPTION | DESCRIPTION |
|---|---|
flowName
|
Required Name of the rating flow used for individual enrollment |
censusId
|
Required The ID of the group census that contains all census members of the family that need to enroll |
contractId
|
Required Id of the contract that the members belong to and the plans that they enroll in. |
rootPlanId
|
Required ID of the root contract group plan of the product for which enrollment is requested |
isProrated
|
Optional. If |
isSaveMemberPremium
|
Optional Indicates if the member-level premium amount has to be calculated and returned to output in members node. The default is Note You must configure the expression set to populate the member-level premium amount in the memberPremium field, and select the Include in Output checkbox. |
memberPlans
|
Required List of family members and their opted optional coverages |
userInputs
|
Optional The set of input data the rating procedure uses to get the price of the product |
additionalInputs
|
Optional Serialised key-value map of additional inputs used for product rating |
inputKeysList
|
Optional A comma-delimited list of input keys from the rating inputs used to include in the individual rating results |
Input JSON
Here's the sample input JSON:
{
"flowName": "Rating_Flow",
"contractId": "800RN000000jyCRYAY",
"censusId": "0r6RN0000006HOJYA2",
"rootPlanId": "0rgRN0000000320YAA",
"memberPlans": [
{
"censusMemberId": "0r6RN0000006HNkYAM",
"planIds": [
"0rgRN0000000320YAA",
"0rgRN000000031xYAA"
]
},
{
"censusMemberId": "0r6RN0000006HNuYAM",
"planIds": [
"0rgRN0000000320YAA",
"0rgRN000000031xYAA"
]
},
{
"censusMemberId": "0r6RN0000006HNuYAM"
}
]
}Output JSON
Here's the sample output JSON:
{
"rootPlanId": "0rgRN0000000320YAA",
"standardPremium": 1000,
"termPremium": 750,
"employerContribution": 550,
"employeeContribution": 450,
"members": [
{
"censusMemberId": "0r6RN0000006HNkYAM",
"termPremium": 550,
"standardPremium": 600,
"employerContribution": 350,
"employeeContribution": 200,
"contributionType": "amount"
},
{
"censusMemberId": "0r6RN0000006HNuYAM",
"termPremium": 450,
"standardPremium": 400,
"employerContribution": 200,
"employeeContribution": 250,
"contributionType": "amount"
}
]
}
Here's the sample output JSON for errors:
{
"errors": [
{
"error": "Specify a member that belongs to this family.",
"planIds": ["0rgRN0000000320YAA", "0rgRN000000031xYAA"],
"censusMemberId": "0r6RN0000006HOJYA2"
}
]
}
