Appearance
createXUserProfileField
Creates one or more eXtended User Profile fields for an authenticated user.
NOTE: in the sample below I've left all the fields in but many are null. This is so developers can see all the fields available. The null fields do not need to be sent as they just create noise in the payload. I only displayed them to increase understanding.
General rules are: -When dataType=String then stringValue should be populated only. -When dataType=Integer then integerValue should be populated only. -When dataType=Date or DateTime then dateValue should be populated only. -When dataType=BigDecimal then decimalValue should be populated only. -When dataType=Boolean then booleanValue should be populated only. -When dataType=ForeignKey then you need to check the following flags and the populate the relevant field: -When profileField.conditionField=true then populate filed conditionId -When profileField.conditionStageField=true then populate field conditionStageId -When profileField.medicationField=true then populate fields medicationId_1, medicationId_2, medicationId_3, or medicationId_4
To group fields into a group they need to have two things: 1.) A profile group object. Only profileGroupId is needed really. In the case below it’s saying group whatever fields by “Treatment” group. . “profileGroup”: { “profileGroupId”: 1, “profileGroupName”: “Treatment”, “profileGroupFields”: [] } 2.) In order to add multiple different “Treatments” over time, I’ve added the profileGroupAlias field. This effectively becomes the name of the treatment. This field must be included for each field in the group. The value of profileGroupAlias should be the same for all fields needing to be grouped together.
Request
http
POST rest/user/xprofile-fieldsHeaders
| Header | Required | Description |
|---|---|---|
x-nextinteract-authtoken | Yes | Auth token returned from loginUser |
Parameters
json
{
"xUserProfileFields": [
{
"profileField": {
"profileFieldId": 1,
"statusCode": "A",
"dataType": "ForeignKey",
"profileFieldName": "Condition",
"supportsMultiple": false,
"conditionField": true,
"conditionStageField": false,
"medicationField": false
},
"profileGroup": {
"profileGroupId": 1,
"profileGroupName": "Treatment",
"profileGroupFields": []
},
"conditionId": 86,
"conditionStageId": null,
"medicationId_1": null,
"medicationId_2": null,
"medicationId_3": null,
"medicationId_4": null,
"profileGroupAlias": "My HUMIRA Treatment",
"stringValue": null,
"integerValue": null,
"decimalValue": null,
"dateValue": null,
"booleanValue": null
},
{
"profileField": {
"profileFieldId": 2,
"statusCode": "A",
"dataType": "ForeignKey",
"profileFieldName": "Condition Stage",
"supportsMultiple": false,
"conditionField": false,
"conditionStageField": true,
"medicationField": false
},
"profileGroup": {
"profileGroupId": 1,
"profileGroupName": "Treatment",
"profileGroupFields": []
},
"conditionId": null,
"conditionStageId": 3,
"medicationId_1": null,
"medicationId_2": null,
"medicationId_3": null,
"medicationId_4": null,
"profileGroupAlias": "My HUMIRA Treatment",
"stringValue": null,
"integerValue": null,
"decimalValue": null,
"dateValue": null,
"booleanValue": null
},
{
"profileField": {
"profileFieldId": 4,
"statusCode": "A",
"dataType": "DateTime",
"profileFieldName": "Date of Diagnosis",
"supportsMultiple": false,
"conditionField": false,
"conditionStageField": false,
"medicationField": false
},
"profileGroup": {
"profileGroupId": 1,
"profileGroupName": "Treatment",
"profileGroupFields": []
},
"conditionId": null,
"conditionStageId": null,
"medicationId_1": null,
"medicationId_2": null,
"medicationId_3": null,
"medicationId_4": null,
"profileGroupAlias": "My HUMIRA Treatment",
"stringValue": null,
"integerValue": null,
"decimalValue": null,
"dateValue": 1720658108487,
"booleanValue": null
},
{
"profileField": {
"profileFieldId": 6,
"statusCode": "A",
"dataType": "String",
"profileFieldName": "Doctor Name",
"supportsMultiple": true,
"conditionField": false,
"conditionStageField": false,
"medicationField": false
},
"profileGroup": {
"profileGroupId": 1,
"profileGroupName": "Treatment",
"profileGroupFields": []
},
"conditionId": null,
"conditionStageId": null,
"medicationId_1": null,
"medicationId_2": null,
"medicationId_3": null,
"medicationId_4": null,
"profileGroupAlias": "My HUMIRA Treatment",
"stringValue": "TestString",
"integerValue": null,
"decimalValue": null,
"dateValue": null,
"booleanValue": null
},
{
"profileField": {
"profileFieldId": 8,
"statusCode": "A",
"dataType": "String",
"profileFieldName": "Dosaging",
"supportsMultiple": true,
"conditionField": false,
"conditionStageField": false,
"medicationField": false
},
"profileGroup": {
"profileGroupId": 1,
"profileGroupName": "Treatment",
"profileGroupFields": []
},
"conditionId": null,
"conditionStageId": null,
"medicationId_1": null,
"medicationId_2": null,
"medicationId_3": null,
"medicationId_4": null,
"profileGroupAlias": "My HUMIRA Treatment",
"stringValue": "TestString",
"integerValue": null,
"decimalValue": null,
"dateValue": null,
"booleanValue": null
},
{
"profileField": {
"profileFieldId": 5,
"statusCode": "A",
"dataType": "String",
"profileFieldName": "Healthcare Provider/Practice Name",
"supportsMultiple": true,
"conditionField": false,
"conditionStageField": false,
"medicationField": false
},
"profileGroup": {
"profileGroupId": 1,
"profileGroupName": "Treatment",
"profileGroupFields": []
},
"conditionId": null,
"conditionStageId": null,
"medicationId_1": null,
"medicationId_2": null,
"medicationId_3": null,
"medicationId_4": null,
"profileGroupAlias": "My HUMIRA Treatment",
"stringValue": "TestString",
"integerValue": null,
"decimalValue": null,
"dateValue": null,
"booleanValue": null
},
{
"profileField": {
"profileFieldId": 3,
"statusCode": "A",
"dataType": "ForeignKey",
"profileFieldName": "Medication",
"supportsMultiple": true,
"conditionField": false,
"conditionStageField": false,
"medicationField": true
},
"profileGroup": {
"profileGroupId": 1,
"profileGroupName": "Treatment",
"profileGroupFields": []
},
"conditionId": null,
"conditionStageId": null,
"medicationId_1": 1,
"medicationId_2": null,
"medicationId_3": null,
"medicationId_4": null,
"profileGroupAlias": "My HUMIRA Treatment",
"stringValue": null,
"integerValue": null,
"decimalValue": null,
"dateValue": null,
"booleanValue": null
},
{
"profileField": {
"profileFieldId": 7,
"statusCode": "A",
"dataType": "String",
"profileFieldName": "Nurse Name",
"supportsMultiple": true,
"conditionField": false,
"conditionStageField": false,
"medicationField": false
},
"profileGroup": {
"profileGroupId": 1,
"profileGroupName": "Treatment",
"profileGroupFields": []
},
"conditionId": null,
"conditionStageId": null,
"medicationId_1": null,
"medicationId_2": null,
"medicationId_3": null,
"medicationId_4": null,
"profileGroupAlias": "My HUMIRA Treatment",
"stringValue": "TestString",
"integerValue": null,
"decimalValue": null,
"dateValue": null,
"booleanValue": null
}
]
}Response
200 OK
json
{
"errorMessages": [],
"xUserProfileFields": [
{
"userProfileFieldId": 33,
"profileField": {
"profileFieldId": 1,
"statusCode": "A",
"dataType": "ForeignKey",
"profileFieldName": "Condition",
"supportsMultiple": false,
"conditionField": true,
"conditionStageField": false,
"medicationField": false
},
"profileGroup": {
"profileGroupId": 1,
"profileGroupName": "Treatment",
"profileGroupFields": []
},
"conditionId": 86,
"profileGroupAlias": "My HUMIRA Treatment"
},
{
"userProfileFieldId": 34,
"profileField": {
"profileFieldId": 2,
"statusCode": "A",
"dataType": "ForeignKey",
"profileFieldName": "Condition Stage",
"supportsMultiple": false,
"conditionField": false,
"conditionStageField": true,
"medicationField": false
},
"profileGroup": {
"profileGroupId": 1,
"profileGroupName": "Treatment",
"profileGroupFields": []
},
"conditionStageId": 3,
"profileGroupAlias": "My HUMIRA Treatment"
},
{
"userProfileFieldId": 35,
"profileField": {
"profileFieldId": 4,
"statusCode": "A",
"dataType": "DateTime",
"profileFieldName": "Date of Diagnosis",
"supportsMultiple": false,
"conditionField": false,
"conditionStageField": false,
"medicationField": false
},
"profileGroup": {
"profileGroupId": 1,
"profileGroupName": "Treatment",
"profileGroupFields": []
},
"profileGroupAlias": "My HUMIRA Treatment",
"dateValue": 1720658108487
},
{
"userProfileFieldId": 36,
"profileField": {
"profileFieldId": 6,
"statusCode": "A",
"dataType": "String",
"profileFieldName": "Doctor Name",
"supportsMultiple": true,
"conditionField": false,
"conditionStageField": false,
"medicationField": false
},
"profileGroup": {
"profileGroupId": 1,
"profileGroupName": "Treatment",
"profileGroupFields": []
},
"profileGroupAlias": "My HUMIRA Treatment",
"stringValue": "TestString"
},
{
"userProfileFieldId": 37,
"profileField": {
"profileFieldId": 8,
"statusCode": "A",
"dataType": "String",
"profileFieldName": "Dosaging",
"supportsMultiple": true,
"conditionField": false,
"conditionStageField": false,
"medicationField": false
},
"profileGroup": {
"profileGroupId": 1,
"profileGroupName": "Treatment",
"profileGroupFields": []
},
"profileGroupAlias": "My HUMIRA Treatment",
"stringValue": "TestString"
},
{
"userProfileFieldId": 38,
"profileField": {
"profileFieldId": 5,
"statusCode": "A",
"dataType": "String",
"profileFieldName": "Healthcare Provider/Practice Name",
"supportsMultiple": true,
"conditionField": false,
"conditionStageField": false,
"medicationField": false
},
"profileGroup": {
"profileGroupId": 1,
"profileGroupName": "Treatment",
"profileGroupFields": []
},
"profileGroupAlias": "My HUMIRA Treatment",
"stringValue": "TestString"
},
{
"userProfileFieldId": 39,
"profileField": {
"profileFieldId": 3,
"statusCode": "A",
"dataType": "ForeignKey",
"profileFieldName": "Medication",
"supportsMultiple": true,
"conditionField": false,
"conditionStageField": false,
"medicationField": true
},
"profileGroup": {
"profileGroupId": 1,
"profileGroupName": "Treatment",
"profileGroupFields": []
},
"medicationId_1": 1,
"profileGroupAlias": "My HUMIRA Treatment"
},
{
"userProfileFieldId": 40,
"profileField": {
"profileFieldId": 7,
"statusCode": "A",
"dataType": "String",
"profileFieldName": "Nurse Name",
"supportsMultiple": true,
"conditionField": false,
"conditionStageField": false,
"medicationField": false
},
"profileGroup": {
"profileGroupId": 1,
"profileGroupName": "Treatment",
"profileGroupFields": []
},
"profileGroupAlias": "My HUMIRA Treatment",
"stringValue": "TestString"
}
]
}Errors
| Exception | Description |
|---|---|
WSInvalidParameterException | See Error Definitions |
WSInvalidAuthTokenException | See Error Definitions |
WSCacheServiceException | See Error Definitions |
WSUserServiceException | See Error Definitions |