HTTP API Resource - FlexCode

FlexCode

Flexcodes are entities in Oracle Health Insurance system that represent domain values based on a predefined configuration. The configuration is stored using FlexCodeSystem and FlexCodeFieldUsages. FlexCodes are values based on the FlexCodeSystem configuration. The values can then be referred by other entities as permissible domain values for any attribute. For example, Yes_No indicator, where permissible values are Yes and No.

The HTTP API resource for FlexCodes has some special features and restrictions that are explained in the sections below.

GET

  1. Without Query String: Search on flexcodes resource works seemlessly. The URL:

POST http://[hostName]:[portNumber]/%5bapi-context-root%5d[http://[hostName]:[portNumber]/[api-context-root]]/generic/flexcodes/search

returns something like below:

{
   "offset" : 0,
   "count" : 2,
   "hasMore" : false,
   "limit" : 50,
   "items" : [ {
      "lastUpdatedBy" : 142,
      "objectVersionNumber" : 1,
      "createdBy" : 142,
      "keyValue" : "ABC",
      "id" : 13281,
      "uuid" : "ed7e14bd-9a65-4a30-819e-4910bff9985b",
      "startDate" : "2017-05-01",
      "links" : [ {
         "href" : "http://localhost:27001/api/generic/flexcodes/13281",
         "rel" : "self"
      } ],
      "lastUpdatedDate" : {
         "value" : "2017-05-16T15:59:17.746+02:00"
      },
      "flexCodeSystem" : {
         "links" : [ {
            "href" : "http://localhost:27001/api/generic/flexcodesystems/13691",
            "rel" : "canonical"
         } ]
      },
      "Character" : "ABC",
      "NumberField" : 12,
      "DateField" : "2017-05-01",
      "creationDate" : {
         "value" : "2017-05-16T15:59:17.746+02:00"
      }
   }, {
      "lastUpdatedBy" : 10,
      "objectVersionNumber" : 1,
      "createdBy" : 10,
      "keyValue" : "DEF",
      "id" : 13311,
      "uuid" : "d8668de6-2d03-40ad-9eb7-8b68324b9f89",
      "startDate" : "2009-01-01",
      "links" : [ {
         "href" : "http://localhost:27001/api/generic/flexcodes/13311",
         "rel" : "self"
      } ],
      "lastUpdatedDate" : {
         "value" : "2017-05-16T16:56:42.897+02:00"
      },
      "flexCodeSystem" : {
         "links" : [ {
            "href" : "http://localhost:27001/api/generic/flexcodesystems/13691",
            "rel" : "canonical"
         } ]
      },
      "Character" : "DEF",
      "NumberField" : 13,
      "DateField" : "2018-05-01",
      "creationDate" : {
         "value" : "2017-05-16T16:56:42.897+02:00"
      }
   } ],
   "links" : [ {
      "rel" : "self",
      "href" : "http://localhost:27001/api/generic/flexcodes?q=flexCodeSystem.id.eq%2813691%29"
   } ]
}
  1. Query By Id: Search on flexCodes with id works as usual. In case the id is found, it is returned, else 204 No Content.

  2. With Query String: FlexCodes resource supports search on id, keyValue, flexCodeSystem’s id and flexCodeSystem’s code attributes. In other words it supports search on all the fixed columns of the FlexCode entity, but not on the configured columns, like NumberField or DateField from the example above.

POST/PUT/PATCH

Insert/Update/Patch on flexCodes works as with other resources. However, flexCodeSystem is a required attribute for these operations on FlexCode to be able to match the attributes with the configuration. In case flexCodeSystem is not provided or cannot be resolved, the system will throw COD-IP-FLCO-001.

Sample payload for insert:

{
      "keyValue" : "DEF",
      "startDate" : "2009-01-01",

      "flexCodeSystem" : {
         "id" : 13691
      },

      "Character" : "DEF",
      "NumberField" : 13,
      "DateField" : "2018-05-01"
}

DELETE

Delete works as with other resources.

Generic Features for Payload Representations

  • Fields: Works as expected, with one exception that direct fields cannot be restricted. Sample reply with fields=flexCodeSystem.id is:

{
   "offset" : 0,
   "count" : 2,
   "hasMore" : false,
   "limit" : 50,
   "items" : [ {
      "lastUpdatedBy" : 142,
      "objectVersionNumber" : 1,
      "createdBy" : 142,
      "keyValue" : "ABC",
      "id" : 13281,
      "uuid" : "ed7e14bd-9a65-4a30-819e-4910bff9985b",
      "startDate" : "2017-05-01",
      "links" : [ {
         "href" : "http://localhost:27001/api/generic/flexcodes/13281",
         "rel" : "self"
      } ],
      "lastUpdatedDate" : {
         "value" : "2017-05-16T15:59:17.746+02:00"
      },
      "flexCodeSystem" : {
         "id" : 13691,
         "links" : [ {
            "href" : "http://localhost:27001/api/generic/flexcodesystems/13691",
            "rel" : "canonical"
         } ]
      },
      "Character" : "ABC",
      "NumberField" : 12,
      "DateField" : "2017-05-01",
      "creationDate" : {
         "value" : "2017-05-16T15:59:17.746+02:00"
      }
   }, {
      "lastUpdatedBy" : 10,
      "objectVersionNumber" : 1,
      "createdBy" : 10,
      "keyValue" : "DEF",
      "id" : 13311,
      "uuid" : "d8668de6-2d03-40ad-9eb7-8b68324b9f89",
      "startDate" : "2009-01-01",
      "links" : [ {
         "href" : "http://localhost:27001/api/generic/flexcodes/13311",
         "rel" : "self"
      } ],
      "lastUpdatedDate" : {
         "value" : "2017-05-16T16:56:42.897+02:00"
      },
      "flexCodeSystem" : {
         "id" : 13691,
         "links" : [ {
            "href" : "http://localhost:27001/api/generic/flexcodesystems/13691",
            "rel" : "canonical"
         } ]
      },
      "Character" : "DEF",
      "NumberField" : 13,
      "DateField" : "2018-05-01",
      "creationDate" : {
         "value" : "2017-05-16T16:56:42.897+02:00"
      }
   } ],
   "links" : [ {
      "rel" : "self",
      "href" : "http://localhost:27001/api/generic/flexcodes?q=flexCodeSystem.id.eq%2813691%29"
   } ]
}
  • Expand: Works as expected.

METADATA

Metadata for flexcode resource will contain information about all the fixed fields, but will not be able to say anything about the configured fields, as every different configuration has different fields. In order to get metadata of the configuration, search the related flexCodeSystem and flexCodeFieldUsages.

Table 1. Expected Error Messages
Code Severity Message Description

COD-IP-FLCO-001

Fatal

Value for flexCodeSystem is either null or cannot be resolved

FlexCodeSystem value is mandatory to be able to perform PUT/PATCH/POST operations on FlexCode.