Replies: 4 comments 16 replies
-
Link to doc of current format |
Beta Was this translation helpful? Give feedback.
-
Changing the class But in {
"attribute": {
"combo": "O4VaNks6tta",
"options": [
"CW81uF03hvV",
"i4Nbp8S2G6A"
]
},
"dataValues": [
{
"dataElement": "fbfJHSPpUQD",
"period": "202201",
"orgUnit": "DiszpKrYNg8",
"value": "10",
"category": {
"combo": "jCNGsC2NawV",
"options": [
"apsOixVZlf1",
"zs2Ra6sikup"
]
}
},
{
"dataElement": "fbfJHSPpUQD",
"period": "202201",
"orgUnit": "DiszpKrYNg8",
"value": "11",
"category": {
"combo": "jCNGsC2NawV",
"options": [
"apsOixVZlf1",
"zs2Ra6sikup"
]
}
}
]
} |
Beta Was this translation helpful? Give feedback.
-
Lars I wonder why you want to expose the "combo" uid instead of the individual categories. In a sense that is an internal detail like the categoryoptioncombo. Which seems to require the order of the options which follow to be significant. And I dont think the order of categories within a categorycombo is really significant. It might be I am misunderstanding. But wouldn't something similar to the following be more robust (and also easily parseable):` "dataValues": [
{
"dataElement": "fbfJHSPpUQD",
"period": "202201",
"orgUnit": "DiszpKrYNg8",
"value": "10",
"categories": [
{ "category": "jCNGsC2NawV", "option": "apsOixVZlf1"},
{ "category": "huhyy8yuhhl", "option": "zs2Ra6sikup"}
]
}
] Note that this would also be directly mappable" to ADX. which I know is not a design goal here but might have some advantages. For exdample, using codes instead of uids would render something like: {
"dataElement": "MALARIA_CASES",
"period": "202201",
"orgUnit": "DiszpKrYNg8",
"value": "10",
"categories": [
{ "category": "SEX", "option": "FEMALE"},
{ "category": "AGE", "option": "P0Y--P1Y"}
]
} |
Beta Was this translation helpful? Give feedback.
-
Note that my remarks below are in the context of the Data Entry app. Thanks Lars! It would be great to not need to "match" My first idea is to just concatenate the optionIds - eg. This do however make the order of the optionIds significant. This is not necessarily a problem on our client-side generated form, as that is mostly internal to our rendering logic, and we can work around that. But we would still prefer the options returned in this API to be stable. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context
From a client and in particular the new data entry web app perspective, the current data value format is cumbersome to use, as it requires the client to specify the category option combo (and until recently, the attribute option combo) specifically. The option combos could be considered internal details which should not be exposed to the client. Having to load all option combos to the client uses unnecessary time and bandwidth.
Considerations
JSON is not suited for custom property names in the same way XML is, meaning we need a fixed format for the category combination and category options. The naming of "combo" and "attribute" is not ideal, but we are constrained by the existing model and should not make drastic changes in format.
Format
Proposed data value JSON format can be seen below. The new properties will be supported both for the individual and bulk format. The main goal is to avoid having to expose category option combinations, and instead rely on category combo and category options.
Beta Was this translation helpful? Give feedback.
All reactions