Continuing the discussion from Attributes for concepts: One of the topics that came up in relation to the “Concept Attribute” feature was the contract/wire-format of a resource that has attributes. In cases like Location, Provider resources, the contract has been typically as below. I am posting an example concept with attribute
GET: /openmrs/ws/rest/v1/conept/8c92f9c4-a31a-4569-9f19-3ebbb6f8fa2b?v=full
{
"uuid": "8c92f9c4-a31a-4569-9f19-3ebbb6f8fa2b",
"display": "Diarrhea",
"name": {
"display": "Diarrhea",
"uuid": "6cf39275-64f7-47e5-bc2d-9810fbeb8e7c",
"name": "Diarrhea",
"locale": "en",
"localePreferred": true,
"conceptNameType": "FULLY_SPECIFIED",
.....
},
.....
"attributes": [
{
"display": "offline: true",
"uuid": "1a66b9e7-bcf3-4f78-b7da-9968e14dec4f",
"attributeType": {
"uuid": "e2d847ea-7620-4d12-a896-b4b395e1addf",
"display": "offline",
....
},
"value": true,
"voided": false,
....
},
.....
],
.....
}
@Burke asserted that the intention of attributes for any resource type is to extend the data model. Going by that logic, should the contract/wire-format be as below?
{
"uuid": "8c92f9c4-a31a-4569-9f19-3ebbb6f8fa2b",
"display": "Diarrhea",
"name": {
"display": "Diarrhea",
"uuid": "6cf39275-64f7-47e5-bc2d-9810fbeb8e7c",
"name": "Diarrhea",
"locale": "en",
"localePreferred": true,
"conceptNameType": "FULLY_SPECIFIED",
.....
},
.....
"offline": {
"display": "offline: true",
"uuid": "1a66b9e7-bcf3-4f78-b7da-9968e14dec4f",
"attributeType": {
"uuid": "e2d847ea-7620-4d12-a896-b4b395e1addf",
"display": "offline",
....
},
"value": true,
"voided": false,
....
},
.....
}
Notice how the “offline” attribute has moved up to the top level, indicating a top level field. I would like to know what the community thinks.
PS: (“Offline” meaning whether this concept is available for offline or not, never mind the example!)