You are here:
InsCensusServiceStd:getMembersWithPlans
Use this service to retrieve the list of census members for a given censusId. Corresponding to these census members, the service retrieves the ContractGroupPlanIds from GroupCensusMemberPlan. The service also retrieves headers based on the fieldsetName and planFieldsetName.
Class: InsCensusServiceStd
Method: getMembersWithPlans
How It Works
This service has two key functions:
- Retrieves the list of fields in
GroupCensusMember and GroupCensusMemberPlan.The service uses the parameter
fieldsetName to retrieve the list of GroupCensusMemberfields. If there is no value, fields are retrieved from the default field set. If the entered value doesn't find a match, no fields are retrieved.The service uses the parameter
planFieldsetNameto retrieve the list of GroupCensusMemberPlan fields. If there is no value, all fields are retrieved. If the entered value doesn't find a match no fields are retrieved.Retrieves relationship fields that are combined to form the JSON headers node even if these fields are not included in the
fieldsetName. These fields are:PrimaryGroupCensusMemberId,RelationshipToPrimaryMember,SourceSystemIdentifier, andPrimaryMemberSource.If the
parameter has value, it populates the list of contract line records with the following details of the contract:contractGroupPlanIdContract Group Plan name
Product Type
Id of the contract group plans
-
The service uses
censusId to retrieve the list of census members from GroupCensusMember records and contract group plans fromGroupCensusMemberPlanfor each member.-
If the offset has value, it retrieves Primary
GroupCensusMemberrows (ordered by Id) after the offset and then retrieves all the dependents for these Primary Members. -
If there is a limit value, the service retrieves the Primary
GroupCensusMemberrows (ordered by Id) not greater than the specified limit. It then retrieves all the dependents for these Primary Members. The limit can't be more than 500. -
If
searchKeyhas value, the service retrievesGroupCensusMemberrows (ordered by Id) along with corresponding family, which hassearchKeyas a substring present in theirFirstNameorLastName. IfGroupCensusMembercontains dependents, then service retrieves primary members corresponding to those dependents. -
If
memberIdshas a value, it retrievesGroupCensusMemberrows (ordered by Id) whose Id is part ofmemberIdsarray. EithermemberIdsorsearchKeyhas to be provided in input. -
The information retrieved for each member is based on the fields retrieved from
GroupCensusMemberandGroupCensusMemberPlan. -
The list of members is placed into the
members node.
-
Service Behavior
Understand how different inputs affect the service outputs.
| Input | Service Output |
|---|---|
No |
The service retrieves no census member. |
No fieldsetName and valid censusId |
The service retrieves:
|
Valid fieldsetName and valid censusId |
The service lists GroupCensusMember fields as per the specified fieldsetName and retrieves the list of GroupCensusMember with ContractGroupPlanIds. |
No planFieldsetName valid fieldsetName and valid censusId |
The service lists GroupCensusMember fields as per the specified fieldsetName, ContractGroupPlanId and Name field of GroupCensusMemberPlan. It retrieves list of with ContractGroupPlanIds. |
Valid planFieldsetName valid fieldsetName and valid censusId |
The service retrieves:
|
Valid contractId |
The service retrieves the contract group plan name, product type, child products, and contract group plan Id as options in the ContractGroupPlanId header field. |
Valid limit |
The service retrieves:
|
Valid offset |
The service retrieves:
|
Valid offset and valid limit |
The service retrieves:
|
Valid searchKey |
The service retrieves:
|
Valid searchKey and valid limit |
The service retrieves:
|
Valid searchKey and valid offset |
The service retrieves:
|
Valid searchKey, valid limit and valid offset |
The service retrieves:
|
Remote Options
| Options | Description |
|---|---|
|
Required. Id of census whose members must be retrieved. |
|
Required. Id of Account's current contract. Retrieves the contract group plan name, product type, and contract group |
|
Optional. Name of field set to retrieve the GroupCensusMember fields. If the value is invalid, the service returns no fields. If there is no value, the service uses the default field set to retrieve GroupCensusMember fields. |
|
Optional. Retrieves GroupCensusMemberPlan and GroupCensusMember fields when there's a valid plan field set value. No fields are returned if the value is not valid. All GroupCensusMemberPlan fields are returned when there's no value. |
|
Optional. The number of census members to be retrieved. |
|
Optional. The ID of the census member after which the census members must be retrieved. |
|
A string to search for matching census member records. |
Input JSON
This service does not take an input JSON.
Output JSON
The service returns an output JSON formatted as per the example below. The output has details for the members in the census, where headers is a list of field API names of GroupCensusMember and GroupCensusMemberPlan. The members node returns list of selected plans for the member along with the ContractGroupPlanId delimited by ;. The lastOffset field shows the ID of the last census member which is retrieved. This value can be used as the offset parameter to get the next rows.
Here's the sample output JSON format:
{
"census":{
"members":[
{
"ContractGroupPlanId":"ID1;ID2",
"Id":"ID",
"fieldAPI1":"value"
}
],
"headers":[
{
"type":"field type",
"label":"field label",
"fieldId":"",
"name":"fieldAPI1"
},
{
"options":[
{
"value":"ID",
"type":"Product Type",
"name":"Contract Group Plan Name"
}
],
"type":"REFERENCE",
"label":"Plan",
"fieldId":"",
"name":"ContractGroupPlanId"
}
]
},
"lastOffset" : "census member Id"
}Here's the sample output JSON:
{
"census":{
"members":[
{
"ContractGroupPlanId":"",
"Id":"a4C4P000000dNdbUAE",
"LastName":member1,
"FirstName":primary,
"Birthdate":"1999-08-08"
},
{
"ContractGroupPlanId":"a2N4P000006ygEjUAI",
"Id":"a4C4P000000dNdcUAE",
"LastName":member1,
"FirstName":dependent,
"Birthdate":"1994-08-08"
},
{
"ContractGroupPlanId":"a2N4P000006ygEjUAI;a2N4P000006ygEiUAI",
"Id":"a4C4P000000dNdeUAE",
"LastName":member2,
"FirstName":primary,
"Birthdate":"1985-08-08"
}
],
"headers":[
{
"type":"STRING",
"label":"First Name",
"fieldId":"",
"name":"FirstName"
},
{
"type":"DATE",
"label":"Birthday",
"fieldId":"",
"name":"Birthdate"
},
{
"type":"STRING",
"label":"Last Name",
"fieldId":"",
"name":"LastName"
},
{
"type":"REFERENCE",
"label":"Plan",
"fieldId":"",
"name":"ContractGroupPlanId",
"options":[
{
"value":"a2N4P000006ygEiUAI",
"type":"Medical",
"name":"rootProd",
"childProducts": [
{
"value": "0rgDC000000000RYAQ",
"IsOptional": false,
"name": "MandatoryCoverage"
},
{
"value": "0rgDC000000000RYBQ",
"IsOptional": true,
"name": "OptionalCoverage"
}
]
},
{
"value":"a2N4P000006ygEjUAI",
"type":"Dental",
"name":"rootProd2",
"childProducts": [
{
"value": "0rgDC000000000RYCQ",
"IsOptional": false,
"name": "MandatoryCoverage"
},
{
"value": "0rgDC000000000RYDQ",
"IsOptional": true,
"name": "OptionalCoverage"
}
]
}
]
}
]
},
"lastOffset" : "a4C4P000000dNdeUAE"
}
