FlexCode
FlexCodes
Flexcodes are configurable domain values. Oracle Health Insurance supports configuring domains, including their allowed values, and specifying their allowed usage in the data model.
For example, the flex code Eye Color, allowed values 'Blue', 'Green' and 'Brown', to be used as a property of a person.
The generic flexcodes API has some special features and restrictions that are explained in the sections below.
GET
Without Query String or Query by id
The request message
POST http://[hostName]:[portNumber]/[api-context-root]/generic/flexcodes/search
or
POST http://[hostName]:[portNumber]/[api-context-root]/generic/flexcodes/search/13281
returns a response message that looks like this example:
Response Message FlexCodes
{
"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://[hostName]:[portNumber]/[api-context-root]/generic/flexcodes/13281",
"rel" : "self"
} ],
"lastUpdatedDate" : {
"value" : "2017-05-16T15:59:17.746+02:00"
},
"flexCodeSystem" : {
"links" : [ {
"href" : "http://[hostName]:[portNumber]/[api-context-root]/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://[hostName]:[portNumber]/[api-context-root]/generic/flexcodes/13311",
"rel" : "self"
} ],
"lastUpdatedDate" : {
"value" : "2017-05-16T16:56:42.897+02:00"
},
"flexCodeSystem" : {
"links" : [ {
"href" : "http://[hostName]:[portNumber]/[api-context-root]/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://[hostName]:[portNumber]/[api-context-root]/generic/flexcodes?q=flexCodeSystem.id.eq%2813691%29"
} ]
}
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"
}
Generic Features for Payload Representations
The direct fields in the /flexcodes
response message cannot be restricted.
See
Response Message FlexCodes with field restriction
{
"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://[hostName]:[portNumber]/[api-context-root]/generic/flexcodes/13281",
"rel" : "self"
} ],
"lastUpdatedDate" : {
"value" : "2017-05-16T15:59:17.746+02:00"
},
"flexCodeSystem" : {
"id" : 13691,
"links" : [ {
"href" : "http://[hostName]:[portNumber]/[api-context-root]/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://[hostName]:[portNumber]/[api-context-root]/generic/flexcodes/13311",
"rel" : "self"
} ],
"lastUpdatedDate" : {
"value" : "2017-05-16T16:56:42.897+02:00"
},
"flexCodeSystem" : {
"id" : 13691,
"links" : [ {
"href" : "http://[hostName]:[portNumber]/[api-context-root]/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://[hostName]:[portNumber]/[api-context-root]/generic/flexcodes?q=flexCodeSystem.id.eq%2813691%29"
} ]
}
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.
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. |