Contract Adjustment Line Operation

The purpose of this operation is to retrieve, create, update, and delete contract adjustment (override) lines.

This API does not support creations, updates, or deletes of contract time periods or adjustment schedule lines.

To load adjustment schedules and/or lines, see Adjustment Schedule API for more information.

Authorization

A user authorization configuration requires access to this operation. The relevant access restriction is contractadjustmentline IP.

Requests

Fetch Contract Adjustment Lines

The GET method can be used to fetch the contract adjustment (override) line for a contract adjustment and contract time period. This request will return all valid adjustment schedule lines that are valid for the contract adjustment and the contract time period, along with any overrides.

The difference between the result of this operation versus a get on contractadjustmentoverrides is that it will return the applicable adjustment schedule lines with their default values, even when there are no overrides.

This IP uses HTTP status codes as defined in Response Messages.

The following request fetches the contract adjustment lines available on every contract adjustment. This IP fetches the default time periods applicable during the contract time period (overlapping between startdate and enddate of contract time period) of the contract adjustment and returns them along with the overrides, if any.

http://[hostName]:[portNumber]/[api-context-root]/contractadjustments/{contract adjustment id}/contractadjustmentlines

Following is an example of a response:

{
  "contractAdjustmentLineList":
     [{
      "lineId":"",
      "amount": {
        "value": ""
      },
      "percentage": "",
      "functionDynamicLogic": {
        "id": "",
        "code" : ""
      },
      "<field name of schedule dimension with type value and datatype other than amount>": "",
      "<field name of schedule dimension with type value and datatype amount>": {
        "valueAmount" : {
          "value": "",
          "currency": ""
        }
      },
      "<field name of schedule dimension with type range and datatype other than amount>": {
        "valueFrom": "",
        "valueTo": ""
      },
      "<field name of schedule dimension with type range and datatype amount>": {
        "valueFromAmount": {
          "value": "",
          "currency": ""
        },
        "valueToAmount": {
          "value": "",
          "currency": ""
        }
      },
      "overrideAmount" :{
         "value": "",
         "currency": ""
      },
      "overridePercentage" : "",
      "overrideFunctionDynamicLogic": {
        "id": "",
        "code" : ""
      }
    },
    {
      ... other line(s)
    }
  ]
}
The payloads presented in this section are just examples. Please use the swagger/postman metadata to find out what is possible.

Metadata

The metadata of the IP will be available as a link in the contract adjustment resource.

All the attributes in the metadata related to the adjustment schedule line will be marked as readOnly; only the metadata of the override fields will be updatable.

When the POST is successful, the system returns the similar to the following resource representation of the created adjustment schedule:

{
    "MED_COND": {
        "type": "object",
        "properties": {
            "amount": {
                "type": "object",
                "properties": {
                    "value": {
                        "type": "number",
                        "xml": {
                            "attribute": true
                        },
                        "minimum": -9999999999.99,
                        "maximum": 9999999999.99,
                        "x-oi-readonly": true
                    }
                }
            },
            "functionDynamicLogic": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "number",
                        "xml": {
                            "attribute": true
                        },
                        "minimum": -9999999999.99,
                        "maximum": 9999999999.99
                    },
                    "code": {
                        "type": "string",
                        "xml": {
                            "attribute": true
                        },
                        "maxLength": 1000
                    }
                },
                "x-oi-readonly": true
            },
            "percentage": {
                "type": "number",
                "xml": {
                    "attribute": true
                },
                "minimum": -999.99,
                "maximum": 999.99,
                "x-oi-readonly": true
            },
            "medicalCondition": {
                "type": "string",
                "xml": {
                    "attribute": true
                },
                "maxLength": 1000,
                "x-oi-readonly": true
            },
            "overrideAmount": {
                "type": "object",
                "properties": {
                    "value": {
                        "type": "number",
                        "xml": {
                            "attribute": true
                        },
                        "minimum": -9999999999.99,
                        "maximum": 9999999999.99
                    },
                    "currency": {
                        "type": "string",
                        "xml": {
                            "attribute": true
                        }
                    }
                },
                "overridePercentage": {
                    "type": "number",
                    "xml": {
                        "attribute": true
                    },
                    "minimum": -999.99,
                    "maximum": 999.99
                },
                "overrideFunctionDynamicLogic": {
                    "type": "object",
                    "properties": {
                        "id": {
                            "type": "number",
                            "xml": {
                                "attribute": true
                            },
                            "minimum": -9999999999.99,
                            "maximum": 9999999999.99
                        },
                        "code": {
                            "type": "string",
                            "xml": {
                                "attribute": true
                            },
                            "maxLength": 1000
                        }
                    }
                }
            }
        }
    }
}

Create, Update, or Delete Contract Adjustment Lines

Contract adjustment (override) lines can be created, updated, or deleted using the same URL with the PATCH method.

This operation does not create adjustment schedule lines but only allows DML on their overrides.

To override value(s) to an adjustment schedule line, send the payload with operation "replace" and the ID of the adjustment schedule line for which the override is required. The processing of such a request involves looking up the adjustment schedule line with the lineId; if it is not found, GEN-HTTP-002 will be returned as lookup failed.

If the adjustment schedule line is fetched, then the following can happen:

  • If there is no existing override for the combination of line and contract adjustment, a new one is created.

  • If there is an existing override, it is updated.

    • If, after the update, all three override fields don’t have a value, then delete the override row.

{
  "contractAdjustmentLineList":
     [{
      "op": "replace",
      "lineId" : 123,
      "overrideAmount" :{
         "value": "123",
         "currency": "USD"
      }
    },
    {
      ... other line(s) if they need to be changed.
    }
  ]
}

The above operations, along with their definition links, will be part of the contractadjustments resource.

{
    "id": 41,
    "links": [
        {
            "href": "http://localhost:8080/api/generic/contractadjustments/41",
            "rel": "self"
        }
    ],
    "adjustmentSchedule": {
        "id": 15,
        "links": [
            {
                "href": "http://localhost:8080/api/generic/adjustmentschedules/15",
                "rel": "canonical"
            }
        ]
    },
    "contractTimePeriod": {
        "id": 40,
        "links": [
            {
                "href": "http://localhost:8080/api/generic/contracttimeperiods/40",
                "rel": "canonical"
            }
        ]
    },
    "contractAdjustmentOverrideList": [
        {
            "id": 42,
            "objectVersionNumber": 1,
            "links": [
                {
                    "href": "http://localhost:8080/api/generic/contractadjustmentoverrides/42",
                    "rel": "canonical"
                }
            ]
        },
        {
            "id": 43,
            "objectVersionNumber": 1,
            "links": [
                {
                    "href": "http://localhost:8080/api/generic/contractadjustmentoverrides/43",
                    "rel": "canonical"
                }
            ]
        }
    ],
    "contractAdjustmentLineList": {
        "links": [
            {
                "rel": "canonical",
                "href": "http://localhost:8080/api/contractadjustments/41/contractadjustmentlines"
            },
            {
                "rel": "oi:definition",
                "href": "http://localhost:8080/api/contractadjustments/41/contractadjustmentlines/definition#contractadjustmentlinerestadaptableentity"
            },
            {
                "rel": "edit-form",
                "href": "http://localhost:8080/api/contractadjustments/41/contractadjustmentlines/edit-form"
            }
        ]
    }
}