Open
Description
we use characteristics on the group resource to store data pertaining to the inventory fields unicef_section
and donor
.
After a change in how web retrieves these values i.e. by using Valuesets
stored sever-side, web and tooling now create payloads that are different.
Web:
e.g.
{
"code": {
"coding": [ {
"system": "http://smartregister.org/codes",
"code": "98734231",
"display": "Unicef Section"
} ]
},
"valueCodeableConcept": {
"coding": [ {
"system": "http://smartregister.org/CodeSystem/eusm-unicef-sections",
"code": "health",
"display": "health"
} ],
"text": "health"
}
}, {
"code": {
"coding": [ {
"system": "http://smartregister.org/codes",
"code": "45981276",
"display": "Donor"
} ]
},
"valueCodeableConcept": {
"coding": [ {
"system": "http://smartregister.org/CodeSystem/eusm-donors",
"code": "unicef",
"display": "unicef"
} ],
"text": "unicef"
}
}
while tooling:
{
"code": {
"coding": [
{
"system": "http://smartregister.org/codes",
"code": "98734231",
"display": "Unicef Section"
}
]
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://smartregister.org/codes",
"code": "98734231-1",
"display": "Value entered on the unicef section"
}
],
"text": "$unicef_section"
}
},
{
"code": {
"coding": [
{
"system": "http://smartregister.org/codes",
"code": "45981276",
"display": "Donor"
}
]
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://smartregister.org/codes",
"code": "45981276-1",
"display": "Value entered on the donor"
}
],
"text": "$donor"
}
}
Notice the valueCodeableConcept.coding
is different between the two.
This has the effect that web will not be able to interpret the unicef_section
and donor
field values from the group resource.
My suggestions:
- Logically require the template value for the mentioned fields be an existing code in the corresponding valueSet
- Update the payload_template by:
a. UpdatevalueCodeableConcept.coding.system
to point to the correct CodeSystem system url. This can be static, I do not expect we should/need to update this
b. Interpolate value ina.
tovalueCodeableConcept.coding.code
c. Remove thevalueCodeableConcept.coding.display
andvalueCodeableConcept.text
Or:
- Logically require the template value for the mentioned fields be an existing code in the corresponding valueSet
- Getting an expansion of the Valueset for each respective field i.e be it
unicef_Section
,donor
, maybe even forlocation.type
- Use the expansion in
2
as a lookup and the value in1
as the key. use the resulting coding as the correct value forvalueCodeableConcept.coding
- This also inherently adds a validation layer for what values are added for such fields